Jump to content

Coopermine Top Rated Photos - Right Block


jjmusicpro

Recommended Posts

Ok, i tried to get this to work but couldnt figure it out, right now, its ment for a center block,

but i wanted to make it a right block, and just have it display the pictures down, and not accross, i tried to put a break link after each but didnt work

here is the code

 

thanks again guys!

 

$content .= '<br /><table width="200" cols="1" border="0" cellpadding="0" cellspacing="0" border="1" align="center"><tr align="center">';
$pic = 0;
while ($row = $db->sql_fetchrow($result)) {
    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $theme_prefix = $CONFIG['theme'].'/';
    } else {
        $theme_prefix = '';
    } 
    $caption = '<img src="' . $CPG_M_DIR . '/' . $theme_prefix . 'images/rating' . round($row["pic_rating"] / 2000) . '.gif" align="center" border="1">' . '<br />' . sprintf($lang_get_pic_data['n_votes'], $row['votes']) . '<br />';
    if ($CONFIG['seo_alts'] == 0) {
   $thumb_title = $row['filename'];
    } else {
        if ($row['title'] != '') {
            $thumb_title = $row['title'];
        } else {
            $thumb_title = substr($row['filename'], 0, -4);
        } 
    } 
    stripslashes($thumb_title);
    $content .= '<td align="center" valign="baseline"><a href="' . $CPG_M_URL . '&file=displayimage&meta=topn&cat=0&pos=' . $pic . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '"><br />' . $caption . '</a></td>';
    $pic++;
} 
$content .= '</tr><tr><td colspan="'.$limit.'" valign="baseline" align="center"><a href = "'. $CPG_M_URL . '">'.$lang_pagetitle_php["photogallery"].'</a></td></tr></table>';

Link to comment
https://forums.phpfreaks.com/topic/92930-coopermine-top-rated-photos-right-block/
Share on other sites

I have the vertical scroller source for Coppermine, PHP-Nuke port, version 1.2.2c

 

<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery 1.2.2c for CMS                                   //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003  Grégory DEMAR <[email protected]>               //
// http://www.chezgreg.net/coppermine/                                      //
// ------------------------------------------------------------------------- //
// Updated by the Coppermine Dev Team                                        //
// (http://coppermine.sf.net/team/)                                          //
// see /docs/credits.html for details                                        //
// ------------------------------------------------------------------------- //
// New Port by GoldenTroll                                                  //
// http://coppermine.findhere.org/                                          //
// Based on coppermine 1.1d by Surf  http://www.surf4all.net/               //
// ------------------------------------------------------------------------- //
// 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.                                      //
// ------------------------------------------------------------------------- //
if (eregi("block-CPG", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
} 
define('NO_HEADER', true);
global $prefix, $db, $CONFIG, $Version_Num, $cpg_dir;


$cpg_dir = "coppermine";

$cpg_block = true;
include("modules/" . $cpg_dir . "/include/load.inc");
$cpg_block = false; 

// $limit=$CONFIG['thumbcols']; //number of thumbs
$limit = 10; //number of pictures
$content = '';
// marquee info at http://www.faqs.org/docs/htmltut/_MARQUEE.html
$content='<p align="center"><a name="scroller"></a><MARQUEE loop="1" behavior="SCROLL" direction="up" height="150" scrollamount="1" scrolldelay="1" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'><center>';
$maxlength = 20; // maximum length of name in block 

// modified by DJMaze
$result = $db->sql_query("SELECT pid, filepath, filename, p.aid, pic_rating, p.votes, p.title FROM ".$cpg_prefix."pictures AS p INNER JOIN ".$cpg_prefix."albums AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE approved='YES' AND p.votes >= '{$CONFIG['min_votes_for_rating']}' GROUP BY pid ORDER BY ROUND((pic_rating+1)/2000) DESC, p.votes DESC LIMIT $limit");
$pic = 0;
while ($row = $db->sql_fetchrow($result)) {
    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $theme_prefix = $CONFIG['theme'].'/';
    } else {
        $theme_prefix = '';
    } 
    $caption = "<img src=\"" . $CPG_M_DIR . "/" . $theme_prefix . "images/rating" . round($row['pic_rating'] / 2000) . ".gif\" align=\"center\" border=\"0\">" . "<br />" . round($row['pic_rating'] / 2000,2)."/5 ";
    $caption .= sprintf(N_VOTES, $row['votes']);
    $caption .= "<br />";

    if ($CONFIG['seo_alts'] == 0) {
   $thumb_title = $row['filename'];
    } else {
        if ($row['title'] != '') {
            $thumb_title = $row['title'];
        } else {
            $thumb_title = substr($row['filename'], 0, -4);
        } 
    } 
    stripslashes($thumb_title);
    $content .= '<p align="center"><a href="' . $CPG_M_URL . '&file=displayimage&meta=topn&cat=0&pos=' . $pic . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '"><br />' . $caption . '</a></p>';
    $pic++;
//##    $content .= '<p align="center"><a href="' . $CPG_M_URL . '&file=displayimage&pos=-' . $row["pid"] . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $thumb_title . '" title="' . $thumb_title . '"><br />' . $vote_dis . '</a><br /><br />';
} 
$content .= '</MARQUEE></p><p align="center"><a href="'. $CPG_M_URL . '">'.$lang_pagetitle_php["photogallery"].'</a></p>';
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.