Author Topic: [Plugin] Modified postcard viewer  (Read 32419 times)

0 Members and 2 Guests are viewing this topic.

Offline peterle

  • Newbie
  • *
  • Posts: 17
    • View Profile
[Plugin] Modified postcard viewer
« on: July 03, 2003, 10:25:22 PM »
based on the mod from uksoreeyes I modified the code a little bit. I think it is not of interest to see what message was sent. Therefore it just shows: date, who sent it and who received the card and the id of the picture with a link to open and make the used picture visible.
This is my first trial at all...My basic skills are Turbo-C and Pascal, times have changed, please forgive some possible strange lines...

Installation:

1.) create a folder "plugins" in "admin" -> ...admin/plugins

2.) create a new file called "postcard_view.php" (e.g. use notepad) with following code:

Code: [Select]
<?php // PLUGIN_TITLE: modified Postcard Viewer 

$nozip 1
define('IN_CP'1); 

$root_path "./../../"
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_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"]; 
    
    
$cat_id $row['cat_id'];
    
$pict_id get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']);
    
$image_media_file get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']); 
    
$template TEMPLATE_PATH
    
    echo <<<END
          
    <font color="#000000" size="1" >
$postcard_date: <br>sent to: $postcard_recipient_name - 
<a href="mailto:
$postcard_recipient_email"><font color="#000000" size="1">$postcard_recipient_email</a></td>
     <td valign="top" width="200" height="250">
       sent by: 
$postcard_sender_name - <font color="#555555" size="1" ><a href="mailto:$postcard_sender_email">$postcard_sender_email</a>, picture: $image_id
<a href="../../details.php?image_id=
$image_id" target="_blank">click to show picture</a>

</font></a>
<br><br><br></td>
   </tr>
 </tbody>
</table></td>
   </tr>
 </tbody>
</table><br> 
END;
  } 


display_results(); 
show_admin_footer(); 
?>

3.) save this file "postcard_view.php" in the new folder "plugins", enter admin panel and click postcard_view...

have fun...
« Last Edit: March 20, 2005, 11:14:24 PM by V@no »
_________________

<a href="http://peter.zoonited.net" target="_blank" class="postlink">http://peter.zoonited.net/templates/peli/images/4imgs.gif" border="0" /></a>

Offline ib41

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: [Plugin] Modified postcard viewer
« Reply #1 on: July 05, 2003, 08:26:45 AM »
Quote from: peterle
based on the mod from uksoreeyes I modified the code a little bit. I think it is not of interest to see what message was sent. Therefore it just shows: date, who sent it and who received the card and the id of the picture with a link to open and make the used picture visible.
This is my first trial at all...My basic skills are Turbo-C and Pascal, times have changed, please forgive some possible strange lines...


3.) save this file "postcard_view.php" in the new folder "plugins", enter admin panel and click postcard_view...

have fun...


error:
Code: [Select]
Parse error: parse error, unexpected T_SL, expecting ',' or ';' in /home/vhosts/hosting/gallery/admin/plugins/postcard_view.php on line 38
People gain a lil authority and suddenly they think they're god
then you tell them the truth and they can't handle it
so they abuse the power bestowed upon them

Offline ib41

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: [Plugin] Modified postcard viewer
« Reply #2 on: July 05, 2003, 08:27:41 AM »
Quote from: peterle
based on the mod from uksoreeyes I modified the code a little bit. I think it is not of interest to see what message was sent. Therefore it just shows: date, who sent it and who received the card and the id of the picture with a link to open and make the used picture visible.
This is my first trial at all...My basic skills are Turbo-C and Pascal, times have changed, please forgive some possible strange lines...

3.) save this file "postcard_view.php" in the new folder "plugins", enter admin panel and click postcard_view...

have fun...


ERROR received
Code: [Select]
Parse error: parse error, unexpected T_SL, expecting ',' or ';' in /home/vhosts/hosting/gallery/admin/plugins/postcard_view.php on line 38
People gain a lil authority and suddenly they think they're god
then you tell them the truth and they can't handle it
so they abuse the power bestowed upon them

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
correct version
« Reply #3 on: July 05, 2003, 07:37:50 PM »
ib41, in line 38 (and in the following line as well) there was a line break that should not have been there. this has to be one line:
Code: [Select]
$image_media_file = get_media_code($row['image_media_file'], $image_id, $cat_id, $row['image_name']);
and this one as well:
Code: [Select]
$pict_id = get_media_code($row['image_media_file'], $image_id, $cat_id, $row['image_name']);

thanks for creating this one peterle.

Offline Flo2005

  • Full Member
  • ***
  • Posts: 237
  • Copy & Paste Profi :)
    • View Profile
    • snuup.de! - Bilder - Sounds - Videos - fun4FREE!
Re: [Plugin] Modified postcard viewer
« Reply #4 on: March 20, 2005, 08:51:43 PM »
I get this error-message

Quote
Parse error: parse error, unexpected '&', expecting T_PAAMAYIM_NEKUDOTAYIM or '(' in /www/htdocs/snuup/portal/4images/admin/plugins/postcard_view.php on line 7


Project offline

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] Modified postcard viewer
« Reply #5 on: March 20, 2005, 10:33:55 PM »
I get this error-message

Quote
Parse error: parse error, unexpected '&', expecting T_PAAMAYIM_NEKUDOTAYIM or '(' in /www/htdocs/snuup/portal/4images/admin/plugins/postcard_view.php on line 7


please reinstall the mod, I've corrected the code. (the code was corrupted after migrating from the old forum)
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)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Plugin] Modified postcard viewer
« Reply #6 on: March 20, 2005, 10:41:07 PM »
hhmmm,

i have a blank Page when i click it in ACP :)
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

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] Modified postcard viewer
« Reply #7 on: March 20, 2005, 10:44:51 PM »
try replace $PHP_SELF with $_SERVER['PHP_SELF']
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)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Plugin] Modified postcard viewer
« Reply #8 on: March 20, 2005, 10:47:57 PM »
try replace $PHP_SELF with $_SERVER['PHP_SELF']

I replaced it and now i have a blank Page, too :(
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

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] Modified postcard viewer
« Reply #9 on: March 20, 2005, 11:14:36 PM »
it should work now
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)

Offline MoOoDy

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [Plugin] Modified postcard viewer
« Reply #10 on: March 25, 2005, 02:01:36 PM »
try this one
 :arrow:


Code: [Select]
<?php // PLUGIN_TITLE: modified Postcard Viewer 

$nozip 1
define('IN_CP'1); 

$root_path "./../../"
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_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"]; 
    
    $cat_id 
$row['cat_id'];
    $pict_id get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']);
    $image_media_file get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']); 
    $template TEMPLATE_PATH
    
    
echo " <<<END
          
<font color=\"#000000\" size=\"1\"><br></td>
   </tr>
</tbody>
</table></td>
   </tr>
</tbody>
</table><br>
        <table border=\"1\" width=\"100%\">
                <tr>
                        <td height=\"15\" width=\"119\" align=\"center\" bgcolor=\"#E5E5E5\">
                        <p align=\"center\"><b>DATE</b></td>
                        <td height=\"15\" width=\"148\" align=\"center\" bgcolor=\"#E5E5E5\"><b>SENT TO</b></td>
                        <td height=\"15\" width=\"158\" align=\"center\" bgcolor=\"#E5E5E5\"><b>BY</b></td>
                        <td height=\"15\" width=\"286\" align=\"center\" bgcolor=\"#E5E5E5\"><b>PICTURE</b></td>
                </tr>
                <tr>
                        <td height=\"21\" width=\"119\" align=\"center\" bgcolor=\"#F5F5F5\">
                        <font color=\"#000000\" size=\"2\" face=\"Tahoma\" >
$postcard_date</td>
                        <td height=\"21\" width=\"148\" align=\"center\" bgcolor=\"#F5F5F5\">
                        <font face=\"Tahoma\">  <font color=\"#000000\" size=\"2\" >
                        
$postcard_recipient_name</font><font size=\"2\"><br>  </font>  <font color=\"#000000\" size=\"1\" >
                <a href=\"mailto:
$postcard_recipient_email\">
                        <font color=\"#000000\" size=\"2\">
$postcard_recipient_email</a></font></td>
                        <td height=\"21\" width=\"158\" align=\"center\" bgcolor=\"#F5F5F5\">
                        <font face=\"Tahoma\"><font color=\"#000000\" size=\"2\">
                        
$postcard_sender_name</font><font size=\"2\"><BR> </font>
                        <font color=\"#555555\" size=\"2\" ><a href=\"mailto:
$postcard_sender_email\">$postcard_sender_email</a></font></font></td>
                        <td height=\"21\" width=\"286\" align=\"center\" bgcolor=\"#F5F5F5\"><font color=\"#000000\" size=\"1\">
                        <font color=\"#555555\" size=\"2\" face=\"Tahoma\" >
                        
$image_id,
<a href=\"../../details.php?image_id=
$image_id\" target=\"_blank\">click to show picture</a>

</font></font><font color=\"#000000\" size=\"2\" face=\"Tahoma\"> </a>
                         </td>
                </tr>
        </table>\n"
;
END;  


display_results(); 
show_admin_footer(); 
?>

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Plugin] Modified postcard viewer
« Reply #11 on: March 25, 2005, 03:26:30 PM »
try this one
 :arrow:


This one works. Thanks!!!!
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Dominion

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • lachstdu.com - Schlapplachen erlaubt!
Re: [Plugin] Modified postcard viewer
« Reply #12 on: April 15, 2005, 08:02:38 AM »
More Postcard Details? very nice, use it!  :lol:


Code: [Select]
<?php // PLUGIN_TITLE: modified Postcard Viewer 

$nozip 1
define('IN_CP'1); 

$root_path "./../../"
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_date 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"];
    $image_name $row["image_name"]; 
    $image_thumb_file $row["image_thumb_file"]; 
    $cat_id $row["cat_id"]; 
    $postcard_headline $row["postcard_headline"]; 
    $postcard_message $row["postcard_message"]; 
 
    
    $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"]; 
    
    $cat_id 
$row['cat_id'];
    $pict_id get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']);
    $image_media_file get_media_code($row['image_media_file'], $image_id$cat_id$row['image_name']); 
    $template TEMPLATE_PATH
    
    
echo 
          
<font color=\"#000000\" size=\"1\"><br></td>
   </tr>
</tbody>
</table></td>
   </tr>
</tbody>
</table><br>
        <table border=\"1\" width=\"100%\">
                <tr>
                        <td height=\"15\" width=\"119\" align=\"center\" bgcolor=\"#E5E5E5\">
                        <p align=\"center\"><b>DATE</b></td>
                        <td height=\"15\" width=\"148\" align=\"center\" bgcolor=\"#E5E5E5\"><b>SENT TO</b></td>
                        <td height=\"15\" width=\"158\" align=\"center\" bgcolor=\"#E5E5E5\"><b>BY</b></td>
                        <td height=\"15\" width=\"286\" align=\"center\" bgcolor=\"#E5E5E5\"><b>POSTCARD</b></td>
                </tr>
                <tr>
                        <td height=\"21\" width=\"119\" align=\"center\" bgcolor=\"#F5F5F5\">
                        <font color=\"#000000\" size=\"2\" face=\"Tahoma\" >
$postcard_date</td>
                        <td height=\"21\" width=\"148\" align=\"center\" bgcolor=\"#F5F5F5\">
                        <font face=\"Tahoma\">  <font color=\"#000000\" size=\"2\" >
                        
$postcard_recipient_name</font><font size=\"2\"><br>  </font>  <font color=\"#000000\" size=\"1\" >
                <a href=\"mailto:
$postcard_recipient_email\">
                        <font color=\"#000000\" size=\"2\">
$postcard_recipient_email</a></font></td>
                        <td height=\"21\" width=\"158\" align=\"center\" bgcolor=\"#F5F5F5\">
                        <font face=\"Tahoma\"><font color=\"#000000\" size=\"2\">
                        
$postcard_sender_name</font><font size=\"2\"><BR> </font>
                        <font color=\"#555555\" size=\"2\" ><a href=\"mailto:
$postcard_sender_email\">$postcard_sender_email</a></font></font></td>
                        <td height=\"21\" width=\"286\" align=\"center\" bgcolor=\"#F5F5F5\"><font color=\"#000000\" size=\"1\">
                        <font color=\"#555555\" size=\"2\" face=\"Tahoma\" >
<a href=\"../../postcards.php?postcard_id=
$postcard_id\" target=\"_blank\"><b>$image_name</b></a> (<a href=\"../../details.php?image_id=$image_id\" target=\"_blank\">ID: $image_id</a>)<br>
<a href=\"../../postcards.php?postcard_id=
$postcard_id\" target=\"_blank\"><img src=\"../../data/thumbnails/$cat_id/$image_thumb_file\" alt=\"$image_name\" width=\"140\" height=\"110\" border=\"0\"></a><br>
<b>Titel:</b> 
$postcard_headline<br>
<b>Nachricht:</b> 
$postcard_message


</font></font><font color=\"#000000\" size=\"2\" face=\"Tahoma\"> </a>
                         </td>
                </tr>
        </table>\n"
;
END;  


display_results(); 
show_admin_footer(); 
?>

greetz, Dominion

Offline no_nick

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [Plugin] Modified postcard viewer
« Reply #13 on: April 26, 2005, 10:34:48 AM »
I ttried this mod it looks nice . but I never saw any thing just got thsi error any one can help me please what wil be the problem
Quote
Warning: main(): Unable to access ./../admin/admin_global.php in /customers/mysite.com/mysite.com/httpd.www/cards/admin/plugins/postcard_view.php on line 8

Warning: main(./../admin/admin_global.php): failed to open stream: No such file or directory in /customers/mysite.com/mysite.com/httpd.www/cards/admin/plugins/postcard_view.php on line 8

Fatal error: main(): Failed opening required './../admin/admin_global.php' (include_path='.:/usr/lib/php') in /customers/mysite.com/mysite.com/httpd.www/cards/admin/plugins/postcard_view.php on line 8

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: [Plugin] Modified postcard viewer
« Reply #14 on: April 26, 2005, 02:46:09 PM »
Somewhere you made a mistake.  Restore your backup files and reapply the mod changes.  Be very careful because even one character can break things in programming code