4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Plugins => Topic started by: peterle 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:
<?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...
-
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:
Parse error: parse error, unexpected T_SL, expecting ',' or ';' in /home/vhosts/hosting/gallery/admin/plugins/postcard_view.php on line 38
-
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
Parse error: parse error, unexpected T_SL, expecting ',' or ';' in /home/vhosts/hosting/gallery/admin/plugins/postcard_view.php on line 38
-
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:
$image_media_file = get_media_code($row['image_media_file'], $image_id, $cat_id, $row['image_name']);
and this one as well:
$pict_id = get_media_code($row['image_media_file'], $image_id, $cat_id, $row['image_name']);
thanks for creating this one peterle.
-
I get this error-message
Parse error: parse error, unexpected '&', expecting T_PAAMAYIM_NEKUDOTAYIM or '(' in /www/htdocs/snuup/portal/4images/admin/plugins/postcard_view.php on line 7
-
I get this error-message
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)
-
hhmmm,
i have a blank Page when i click it in ACP :)
-
try replace $PHP_SELF with $_SERVER['PHP_SELF']
-
try replace $PHP_SELF with $_SERVER['PHP_SELF']
I replaced it and now i have a blank Page, too :(
-
it should work now
-
try this one
:arrow:
<?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();
?>
-
try this one
:arrow:
This one works. Thanks!!!!
-
More Postcard Details? very nice, use it! :lol:
<?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();
?>
-
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
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
-
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
-
and i have this error :
Parse error: parse error, unexpected $ in /home/www/web59/html/4images/admin/plugins/postcard_view.php on line 55
line is : ?>
what is the problem ?
-
in my case it works fine - just a bit feeling strange to read the postcards! :wink:
somebody is having a postcardcounter?
sincerly
vincent
-
it would be possible to add - if the postcard have been read or not - and maybe to add a resend?
sincerly
vincent