Adding HTML content in POTD (anycontent) Adding HTML content in POTD (anycontent)
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Adding HTML content in POTD (anycontent)

Started by claude258, November 08, 2005, 03:45:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

claude258

I would like to add some html content on the left and right of my POTD (Picture Of The Day). It is an anycontent. I know how to add it before or after it but not on the left or right (see the picture). Do you know how to do it? Thanks.

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fi2.photobucket.com%2Falbums%2Fy40%2Fbriere2%2FEyeball.jpg&hash=e911e2f76dd70bcbb3163213687fb7fc20ae2704)

Joachim Müller

The potd mod is not part of coppermine's core code but comes as a hack. Support for hacks is only given on the thread that deals with the particular hack, so you should have posted your question as a reply. Anyway, this sound like an easy one, so stick to this thread for now. However, we can't know what you did code-wise. Just by looking at a screenshot we will not be able to come up with code fixes. Post a link to your site (to the particular page your screenshot shows) and post the content of your anycontent.php file to let us see what you did.

claude258

The link to the page is:
http://claudebriere.net/coppermine/

and the anycontent (POTD) is:

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.1
 
**********************************************/

/**
* Coppermine Photo Gallery 1.4.1 potd.php
*
* This file file gets included in the index.php if you set the option in admin
* can be used to display any content from any program, it is always to be edited
* according to tastes and then used
*
* @copyright 2002,2005 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
* @package Coppermine
*/

define('POTD_PHP'true);
define('IN_COPPERMINE'true);

global 
$prefix$dbi$lang_meta_album_names




    
 
   $result 
db_query("SELECT pid, aid, filepath, filename, owner_name, owner_id  from {$CONFIG['TABLE_PICTURES']} WHERE potd='1'"$dbi);
  $picture mysql_fetch_array($result); 
  
  
  
   $img 
"<img src=\"albums/{$picture['filepath']}thumb_{$picture['filename']}\"  border=\"0\">";
   $content .= "<center><tr><td><center><a href=\"displayimage.php?pos=-{$picture['pid']}\">$img</a><br /><br /><big>{$lang_meta_album_names['potd']}</big><br><small>par</small><b> <a href=\"thumbnails.php?album=lastupby&uid={$picture['owner_id']}\">{$picture['owner_name']}</a></b><br />
<a href=\"thumbnails.php?album=potdarch\">
{$lang_meta_album_names['potdarch']}</a>
</center></td></tr>"



$stop++; 

print 
$content;

endtable();
?>


Joachim Müller

find   $content .= "<center><tr><td><center><a href=\"displayimage.php?pos=-{$picture['pid']}\">$img</a><br /><br /><big>{$lang_meta_album_names['potd']}</big><br><small>par</small><b> <a href=\"thumbnails.php?album=lastupby&uid={$picture['owner_id']}\">{$picture['owner_name']}</a></b><br />
<a href=\"thumbnails.php?album=potdarch\">{$lang_meta_album_names['potdarch']}</a>
</center></td></tr>";
and replace with   $content .= "<tr><td align=\"center\">
<div style=\"float:left\">
Your content to the left.
</div>
<div style=\"float:left\">
<a href=\"displayimage.php?pos=-{$picture['pid']}\">$img</a><br /><br /><big>{$lang_meta_album_names['potd']}</big><br><small>par</small><b> <a href=\"thumbnails.php?album=lastupby&uid={$picture['owner_id']}\">{$picture['owner_name']}</a></b><br />
<a href=\"thumbnails.php?album=potdarch\">{$lang_meta_album_names['potdarch']}</a>
</div>
<div style=\"float:left\">
Your content to the right.
</div>
</td></tr>";
Instead of having <div> tags you can of course add another table as well like this   $content .= "<tr><td align=\"center\">
<table border=\"0\" width=\"100%\">
<tr>
<td>
Your content to the left.
</td>
<td>
<a href=\"displayimage.php?pos=-{$picture['pid']}\">$img</a><br /><br /><big>{$lang_meta_album_names['potd']}</big><br><small>par</small><b> <a href=\"thumbnails.php?album=lastupby&uid={$picture['owner_id']}\">{$picture['owner_name']}</a></b><br />
<a href=\"thumbnails.php?album=potdarch\">{$lang_meta_album_names['potdarch']}</a>
</td>
<td>
Your content to the right.
</td>
</tr>
</table>
</td></tr>";
This is all plain html, no special PHP stuff involved.