• [Plugin] Postcard Viewer 4 0 5 1
Currently:  

Author Topic: [Plugin] Postcard Viewer  (Read 61550 times)

0 Members and 1 Guest are viewing this topic.

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [Plugin] Postcard Viewer
« Reply #30 on: September 15, 2005, 12:09:28 AM »
Quote
i get only an error
Parse error: parse error, unexpected '&', expecting T_PAAMAYIM_NEKUDOTAYIM or '(' in /home/www/marcomarten.com/htdocs/gallery/admin/plugins/postcard_view.php on line 7

I get the same error

Offline kleiner_Hobbit

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • Berlin in Bildern
Re: [Plugin] Postcard Viewer
« Reply #31 on: January 19, 2006, 10:16:15 PM »
Bei mir kam auch immer diese Fehlermeldung.

Ich habe den Code vom "Modified Card Viewer" entsprechend angepasst und nun klappt es  8)
 :arrow: Datei siehe Zip-File

Viele Grüße

kleiner_Hobbit

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Plugin] Postcard Viewer
« Reply #32 on: January 19, 2006, 11:04:07 PM »
If I may leave my inputs, even though the last english post was on sept 15 2005, I'd like to comment on something.

This paragraph :

Quote

<?php // PLUGIN_TITLE: Postcard Viewer

$nozip = 1;
define('IN_CP', 1);

$root_path = (eregi("\/plugins\/", $PHP_SELF)) ? "./../../" : "./../";
define('ROOT_PATH', $root_path);
require(ROOT_PATH.'admin/admin_global.php');
show_admin_header();

function display_results() {
    global $site_db;

    $sql = "SELECT *
                    FROM ".POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
                    WHERE p.image_id = i.image_id
                    ORDER BY postcard_id DESC";
    $result = $site_db->query($sql);
    while($row = $site_db->fetch_array($result)){
      $postcard_id = $row["postcard_id"];
        $postcard_date = date("D d M, Y g:i a", $row["postcard_date"]);
        $image_id = $row["image_id"];
        $postcard_bg_color = $row["postcard_bg_color"];
        $postcard_border_color = $row["postcard_border_color"];
        $postcard_font_color = $row["postcard_font_color"];
        $postcard_font_face = $row["postcard_font_face"];
        $postcard_sender_name = $row["postcard_sender_name"];
        $postcard_sender_email = $row["postcard_sender_email"];
        $postcard_recipient_name = $row["postcard_recipient_name"];
        $postcard_recipient_email = $row["postcard_recipient_email"];
        $postcard_headline = $row["postcard_headline"];
        $postcard_message = $row["postcard_message"];
        $cat_id = $row['cat_id'];
        $image_media_file = get_media_code($row['image_media_file'], $image_id, $cat_id, $row['image_name']);
        $template = TEMPLATE_PATH;

        echo <<<END
        <table cellspacing="0" cellpadding="1" align="center" border="0">
  <tbody>
    <tr>
      <td bgcolor="$postcard_border_color"><table cellspacing="0" cellpadding="10" bgcolor="$postcard_bg_color" border="0">
  <tbody>
    <tr>
      <td valign="top"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">$postcard_date</font><br><a href="../../details.php?image_id=$image_id" target="_blank">$image_media_file</a><br>
        <font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">$postcard_recipient_name - </font>
      <a href="mailto:$postcard_recipient_email"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">$postcard_recipient_email</font></a></td>
      <td valign="top" width="200" height="250"><div align="right"><img src="$template/images/stamp.gif" border="0"></div>
        <br> <br> <b><font face="$postcard_font_face" color="$postcard_font_color" size="4">$postcard_headline</font></b><br>
        <br> <font face="$postcard_font_face" color="$postcard_font_color" size="2">$postcard_message</font><br>
        <br> <font face="$postcard_font_face" color="$postcard_font_color" size="2">$postcard_sender_name</font><br> <a href="mailto:$postcard_sender_email"><font
                  face="$postcard_font_face" color="$postcard_font_color" size="2">$postcard_sender_email</font></a></td>
    </tr>
  </tbody>
</table></td>
    </tr>
  </tbody>
</table><br>
END;
    }
}

display_results();
show_admin_footer();
?>


should rather be re-coded like this :

Code: [Select]

<?php // PLUGIN_TITLE: Postcard Viewer

$nozip 1;

define('IN_CP'1);
define('ROOT_PATH''../../');
require(
ROOT_PATH.'admin/admin_global.php');
show_admin_header();

if (
$action == "") {
$action "postcards_view";
###### End of if statement.

if ($action == "postcards_view") {

function 
display_results() {
global 
$site_db$table_menu$site_sess;

$sql "

SELECT *
FROM "
.POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
WHERE p.image_id = i.image_id
ORDER BY postcard_id DESC

"
;

$result $site_db->query($sql);

while (
$row $site_db->fetch_array($result)) {

$postcard_id $row["postcard_id"];
$postcard_date date("D d M, Y g:i a"$row["postcard_date"]);

$image_id $row["image_id"];

$postcard_bg_color $row["postcard_bg_color"];
$postcard_border_color $row["postcard_border_color"];
$postcard_font_color $row["postcard_font_color"];
$postcard_font_face $row["postcard_font_face"];
$postcard_sender_name $row["postcard_sender_name"];
$postcard_sender_email $row["postcard_sender_email"];
$postcard_recipient_name $row["postcard_recipient_name"];
$postcard_recipient_email $row["postcard_recipient_email"];
$postcard_headline $row["postcard_headline"];
$postcard_message $row["postcard_message"];

$cat_id $row['cat_id'];

$image_media_file get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']);

$table_menu "";
$table_menu .= "

<table cellspacing=\"0\" cellpadding=\"1\" align=\"center\" border=\"0\">
  <tbody>
    <tr>
      <td bgcolor=\""
.$postcard_border_color."\"><table cellspacing=\"0\" cellpadding=\"10\" bgcolor=\"".$postcard_bg_color."\" border=\"0\">
  <tbody>
    <tr>
      <td valign=\"top\"><font color=\"#000000\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">"
.$postcard_date."</font><br><a href=\"".$site_sess->url(ROOT_PATH."details.php?&amp;".URL_IMAGE_ID)."\" target=\"_blank\">".$image_media_file."</a><br>
        <font color=\"#000000\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">"
.$postcard_recipient_name." - </font>
<a href=\"mailto:"
.$postcard_recipient_email."\"><font color=\"#000000\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">".$postcard_recipient_email."</font></a></td>
      <td valign=\"top\" width=\"200\" height=\"250\"><div align=\"right\"><img src=\""
.get_gallery_image("stamp.gif")."\" border=\"0\"></div>
        <br> <br> <b><font face=\""
.$postcard_font_face."\" color=\"".$postcard_font_color."\" size=\"4\">".$postcard_headline."</font></b><br>
        <br> <font face=\""
.$postcard_font_face."\" color=\"".$postcard_font_color."\" size=\"2\">".$postcard_message."</font><br>
        <br> <font face=\""
.$postcard_font_face."\" color=\"".$postcard_font_color."\" size=\"2\">".$postcard_sender_name."</font><br> <a href=\"mailto:".$postcard_sender_email."\">
             <font face=\""
.$postcard_font_face."\" color=\"".$postcard_font_color."\" size=\"2\">".$postcard_sender_email."</font></a></td>
    </tr>
  </tbody>
</table></td>
    </tr>
  </tbody>
</table><br>

"
;

echo 
$table_menu;
unset (
$table_menu);

###### End of while statement.
###### End of function statement.

$disp_results = (function_exists('display_results')) ? display_results() : '';
unset (
$disp_results);

show_admin_footer();

###### End of if statement.
?>



Tell me if you still have these error messages after replacing this block. ;)

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [Plugin] Postcard Viewer
« Reply #33 on: January 20, 2006, 12:48:16 AM »
Great job, now it works.

Thank you TheOracle!   :D

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Plugin] Postcard Viewer
« Reply #34 on: January 20, 2006, 12:50:18 AM »
Great job, now it works.

Thank you TheOracle!   :D

Excellent. Glad to see it worked out fine for you. The first codings gave me the creaps a little.  8O  :mrgreen:

Offline maninblue

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • GulceNet
Re: [Plugin] Postcard Viewer
« Reply #35 on: January 21, 2006, 11:03:29 PM »
sorry i am not an advance user but i got the code and put it to site as card_viewer.php and run it and i got the error

Warning: main(../../admin/admin_global.php): failed to open stream: No such file or directory in D:\Inetpub\vhosts\gulce.net\httpdocs\card_viewer.php on line 8

Fatal error: main(): Failed opening required '../../admin/admin_global.php' (include_path='.;./includes;./pear') in D:\Inetpub\vhosts\gulce.net\httpdocs\card_viewer.php on line 8

Not sure if i make a mistake. Can you help?
Roses:) I really like

http://www.gulce.net  (Sorry just in Turkish for now)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Plugin] Postcard Viewer
« Reply #36 on: January 21, 2006, 11:09:22 PM »
@maninblue: (thought it was maninblack  :mrgreen:)

Simply play with this bolded part below :

Quote

define('ROOT_PATH', '../../');


from your file.

Hint: If you have another plugin file, from inside the plugins folder, simply copy that line and copy it into your new one. ;)

Offline maninblue

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • GulceNet
Re: [Plugin] Postcard Viewer
« Reply #37 on: January 21, 2006, 11:14:34 PM »
now it works i change it:)

note: men sometimes wear blue also (not an alien buster)
Roses:) I really like

http://www.gulce.net  (Sorry just in Turkish for now)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Plugin] Postcard Viewer
« Reply #38 on: January 21, 2006, 11:21:59 PM »
sorry i am not an advance user but i got the code and put it to site as card_viewer.php and run it and i got the error

Warning: main(../../admin/admin_global.php): failed to open stream: No such file or directory in D:\Inetpub\vhosts\gulce.net\httpdocs\card_viewer.php on line 8

Fatal error: main(): Failed opening required '../../admin/admin_global.php' (include_path='.;./includes;./pear') in D:\Inetpub\vhosts\gulce.net\httpdocs\card_viewer.php on line 8

Not sure if i make a mistake. Can you help?
You didnt follow properly the installation instructions:
http://www.4homepages.de/forum/index.php?topic=5769.msg24828#msg24828
The file must be placed in admin/plugins/ folder not into your 4images root.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)