PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
NeapolitanWorld
Involved
Involved


Joined: Nov 06, 2005
Posts: 318
Location: Los Angeles, USA

PostPosted: Fri Jul 24, 2009 12:50 am Reply with quote Back to top

Hello everyone,
I have a nice coppermine block "gallery stats" that works but for some reason it duplicates the results/content on the block Confused

Gallery
Albums: 400
Pictures: 11771
· Views: 1519568
· Votes: 45546
· Comments: 50408
Upload approval: 0
Batch add pictures
Review Comments
Groups
Users
Albums
Categories
Config
Gallery
Albums: 400
Pictures: 11771
· Views: 1519568
· Votes: 45546
· Comments: 50408
Upload approval: 0
Batch add pictures
Review Comments
Groups
Users
Albums
Categories
Config

I'm hoping one of you experts in this can take a quick glance and see if you see anything obvious in the block that is duplicating Very Happy

Code:
if (eregi("block-CPG", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}
define('NO_HEADER', true);
global $prefix, $db, $CONFIG, $Version_Num, $cat, $cpg_dir;

$cpg_dir = "coppermine";
$cat = is_numeric($cat) ? $cat : 0;

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

$content = "";

$result = $db->sql_query("SELECT dirname, prefix FROM ".$prefix."_cpg_installs");
while ($row = $db->sql_fetchrow($result)) {
    if ($content != "") $content .= "<hr />";
    $cpgdir = $row[0];
    $cpgprefix = $row[1];
    $cpgtitle = $db->sql_fetchrow($db->sql_query("SELECT custom_title FROM " . $prefix . "_modules WHERE title='$cpgdir'"));
    if ($cpgtitle[0] == '') $cpgtitle[0] = $cpgdir;
    $content .= "<center><b>" . $cpgtitle[0] . "</b></center>";
    $content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;" . ALBUMS . ": " . cpg_tablecount($cpgprefix . "albums", "count(*)") . "<br />";
    $content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;" . PICTURES . ": " . cpg_tablecount($cpgprefix . "pictures", "count(*)") . "<br />";
    $num = cpg_tablecount($cpgprefix . "pictures", "sum(hits)");
    if (!is_numeric($num)) $num = 0;
    $content .= "<strong><big>&nbsp;&nbsp;&middot;</big></strong>&nbsp;" . PIC_VIEWS . ": $num<br />";
    $num = cpg_tablecount($cpgprefix . "pictures", "sum(votes)");
    if (!is_numeric($num)) $num = 0;
    $content .= "<strong><big>&nbsp;&nbsp;&middot;</big></strong>&nbsp;" . PIC_VOTES . ": $num<br />";
    $content .= "<strong><big>&nbsp;&nbsp;&middot;</big></strong>&nbsp;" . PIC_COMMENTS . ": " . cpg_tablecount($cpgprefix . "comments", "count(*)") . "<br />";
    if (GALLERY_ADMIN_MODE) {
        $num = $db->sql_fetchrow($db->sql_query("SELECT count(*) FROM " . $cpgprefix . "pictures WHERE approved='NO'"));
        if ($name != $cpgdir) $cat = 0;
        $content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=editpics&amp;mode=upload_approval").'">' . UPL_APP_LNK . "</a>: " . $num[0] . "<br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=searchnew").'">' . SEARCHNEW_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=reviewcom").'">' . COMMENTS_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=groupmgr").'">' . GROUPS_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=usermgr").'">' . USERS_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=albmgr&amp;cat=$cat").'">' . ALBUMS_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=catmgr").'">' . CATEGORIES_LNK . "</a><br />";
        if (is_admin($admin)) $content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=config").'">' . CONFIG_LNK . "</a>";
    } else if (USER_ADMIN_MODE) {
        $content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=albmgr").'">' . ALBMGR_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=modifyalb").'">' . MODIFYALB_LNK . "</a><br />" .
                    "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&nbsp;<a href=\"".getlink("$cpgdir&amp;file=profile&amp;op=edit_profile").'">' . MY_PROF_LNK . "</a>";
    }
}
// $ob = ob_get_contents();
// ob_end_clean();
?>


Thanks Very Happy

jc
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Fri Jul 24, 2009 1:12 am Reply with quote Back to top

Probably you have more than one row in the PREFIX_cpg_installs table, which is causing it to loop. I don't know why it's coded that way
View user's profile Send private message Visit poster's website
NeapolitanWorld
Involved
Involved


Joined: Nov 06, 2005
Posts: 318
Location: Los Angeles, USA

PostPosted: Fri Jul 24, 2009 11:37 am Reply with quote Back to top

Hi evaders that was exactly it on my coppermine table nuke_cpg_installs I had a duplicate:
1 coppermine nuke_cpg_ 1.3.0
2 coppermine nuke_cpg_ 1.3.0

Removed the 2nd and it's working perfect Very Happy
You da man worship

Thanks!
jc
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum