4images Modifications / Modifikationen > Plugins

[Plugin] Modified postcard viewer

<< < (3/4) > >>

MoOoDy:
try this one
 :arrow:



--- 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\"><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(); 
?>
--- End code ---

JensF:

--- Quote from: MoOoDy on March 25, 2005, 02:01:36 PM ---try this one
 :arrow:


--- End quote ---

This one works. Thanks!!!!

Dominion:
More Postcard Details? very nice, use it!  :lol:



--- 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_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(); 
?>

--- End code ---

no_nick:
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
--- End quote ---

Chris:
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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version