Modify the POTW Plugin Pack Modify the POTW Plugin Pack
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Modify the POTW Plugin Pack

Started by fatmcgav, March 21, 2007, 04:47:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fatmcgav

Hi tehre,

i want to modify the POTW plugin so i can have the Week thumb show wherever i put a tag for it...

Now the code from the weekthumb.php which displays what i want is: require('include/init.inc.php');
global $prefix, $dbi;

$content = '';
{   
  $query = <<< EOT
    SELECT p.pid, aid, filepath, filename, owner_name, owner_id 
      FROM {$CONFIG['TABLE_PLUGIN_POTD']} AS pp LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p
      ON p.pid=pp.pid
    WHERE pp.potw='1'
EOT;
  $result = cpg_db_query($query, $dbi);
  $picture = mysql_fetch_array($result);
 
  $img = "<img src=\"{$CONFIG['path_to']}albums/{$picture['filepath']}thumb_{$picture['filename']}\"  border=\"0\">";
  $content .= <<<EOT
    <tr style="background-color: #F2F5F7;" align="centre">
      <td style="background-color: #F2F5F7;" align="center" ><big>{$lang_meta_album_names['potw']}</big><br />
  <a href="displayimage.php?pos=-{$picture['pid']}">$img</a><br />
        <br />
      </td>
    </tr>
EOT;
  $stop++;
}

print $content;


I want to be able to put the Weekly thumb pic in a right column, using {POTW_Thumb}...

Any ideas on how?

I've tried creating a new function at the end of my theme.php file, but it just gives me an error:
//POTW Thumb Mod
function potw_thumb()
{
global $CONFIG;

//$content = <<<EOT
//{   
  $result = cpg_db_query("SELECT p.pid, aid, filepath, filename, owner_name, owner_id FROM {$CONFIG['TABLE_PLUGIN_POTD']} AS pp LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.pid=pp.pid WHERE pp.potw='1'");
  $picture = mysql_fetch_array($result);   
  $img = "<img src=\"{$CONFIG['path_to']}albums/{$picture['filepath']}thumb_{$picture['filename']}\"  border=\"0\">";

  $content = <<<EOT
     <tr style="background-color: #F2F5F7;" align="centre">
  <td style="background-color: #F2F5F7;" align="center" ><big>{$lang_meta_album_names['potw']}</big><br />
  <a href="displayimage.php?pos=-{$picture['pid']}">$img</a><br />
<br />
  </td>
</tr>
EOT;
}

QuoteParse error: syntax error, unexpected $end in /home/cibnsyp/public_html/testgal/themes/water_drop/theme.php on line 580

Any ideas on where to begin???

Cheers
Fatmcgav

fatmcgav

My site can be found here
That's what i'm trying to achieve...

Cheers
Fatmcgav

Joachim Müller

$img = "<img src=\"{$CONFIG['path_to']}albums/{$picture['filepath']}thumb_{$picture['filename']}\"  border=\"0\">"; is made-up code that is wrong both in terms of syntax as well as logic.

fatmcgav

Quote from: GauGau on March 21, 2007, 05:26:05 PM
$img = "<img src=\"{$CONFIG['path_to']}albums/{$picture['filepath']}thumb_{$picture['filename']}\"  border=\"0\">"; is made-up code that is wrong both in terms of syntax as well as logic.

Any ideas what code i should be using?
As i've had a play, and i cant work it out...

Any info appreciated...

Cheers
Fatmcgav