forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: fatmcgav on March 21, 2007, 04:47:17 pm

Title: Modify the POTW Plugin Pack
Post by: fatmcgav 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
Title: Re: Modify the POTW Plugin Pack
Post by: fatmcgav on March 21, 2007, 04:49:44 pm
My site can be found here (http://www.fatmcgav.me.uk/testgal)
That's what i'm trying to achieve...

Cheers
Fatmcgav
Title: Re: Modify the POTW Plugin Pack
Post by: Joachim Müller 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.
Title: Re: Modify the POTW Plugin Pack
Post by: fatmcgav 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