Advanced search  

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

Pages: [1]   Go Down

Author Topic: Modify the POTW Plugin Pack  (Read 3660 times)

0 Members and 1 Guest are viewing this topic.

fatmcgav

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Modify the POTW Plugin Pack
« on: March 21, 2007, 04:47:17 pm »

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:
Code: [Select]
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:
Code: [Select]
//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;
}
Quote
Parse 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
Logged

fatmcgav

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Modify the POTW Plugin Pack
« Reply #1 on: March 21, 2007, 04:49:44 pm »

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

Cheers
Fatmcgav
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Modify the POTW Plugin Pack
« Reply #2 on: March 21, 2007, 05:26:05 pm »

Code: [Select]
$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.
Logged

fatmcgav

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Modify the POTW Plugin Pack
« Reply #3 on: March 25, 2007, 12:28:56 am »

Code: [Select]
$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
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 20 queries.