View next topic
View previous topic
Post new topic   Reply to topic
Author Message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 755

PostPosted: Wed Mar 16, 2005 2:57 pm
Reply with quote

Open modules/Maps/index.php

find on or around line 61

Code:
$cattitlett = ereg_replace(" ", "_", $cattitle);


after, on a new line add

Code:
$mapsincat = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_mapmap where cat='$catid'"));


next find on or around line 70

Code:
."$cattitle</a><br><br>\n"


and change to

Code:
."$cattitle</a> ($mapsincat)<br><br>\n"


This will put the number of maps after the title. If you want it to show up elsewhere, you just need to call the variable $mapsincat.

enjoy!

If you have any how to requests, post them in this forum.


Last edited by gotcha on Mon Dec 18, 2006 7:50 pm; edited 1 time in total 
View user's profile Send private message Visit poster's website
Chief




Joined: Mar 15, 2005
Posts: 10

PostPosted: Wed Mar 16, 2005 11:07 pm
Reply with quote

Many Thx ... Wink

_________________
www.jtf-2.com 
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger ICQ Number
GuNS-365th




Joined: Oct 20, 2005
Posts: 14
Location: Rivers, Manitoba, Canada

PostPosted: Fri Dec 02, 2005 3:39 pm
Reply with quote

hi i can get the numer of maps to show up on the main page

http://365dwd.com/365/modules.php?name=Maps

thanks in advance

here is the code as per forum
Code:
<?php

/***************************************/
/* Maps Manager by gotcha  version 1.1 */
/* Copyright 2005 http://nukecoder.com */
/* You MAY NOT copy in whole or in part*/
/* or redistribute map manager without */
/* written consent from the author.    */
/* Contact and support can be found at */
/* http://nukecoder.com                */
/***************************************/

/* if ( !defined('MODULE_FILE') )
{
        die("You can't access this file directly...");
} */

if(!stristr($_SERVER['PHP_SELF'], "modules.php") && !stristr($_SERVER['SCRIPT_NAME'], "modules.php")) {
        die ("You can't access this file directly...");
}

@require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
if (!isset($_GET['id'])){
        $id = "0";
        $cat = _MAIN;
}else{
        $id = intval($_GET['id']);
}
$cat = check_html(stripslashes(ereg_replace("_", " ", $cat)), nohtml);
$pagetitle = "- $module_name - $cat";

@include("header.php");
@include("modules/$module_name/functions.php");

//title("$sitename - ". _MAPS);
nav();

if ($id != 0){
        $catheadtitle = getparentlink($id, $cat);
        title($catheadtitle);
}
$result = $db->sql_query("SELECT * FROM ".$prefix."_mapcat where mainid='$id'");

$num = $db->sql_numrows($result);
if ($num > 0) {
        $cr1 = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='c_img'");
        list($catimagedir) = $db->sql_fetchrow($cr1);
        $cr1a = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='c_thumbw'");
        list($cattw) = $db->sql_fetchrow($cr1a);
        $cr1b = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='c_thumbh'");
        list($catth) = $db->sql_fetchrow($cr1b);
        opentable();
        echo "\n<!--show categorys -->\n\n"
                ."<table width='100%' cellpadding='4'>\n";
        $i = 0;
        while($row = $db->sql_fetchrow($result)) {
                $catid = intval($row['id']);
                $cattitle = stripslashes($row['title']);
                $catdtl = stripslashes($row['details']);
                $catimage = stripslashes($row['image']);
                $mainid = intval($row['mainid']);
                $cattitlett = ereg_replace(" ", "_", $cattitle);
                $mapsincat = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_mapmap where cat='$catid'"));
                if ($i == 0) {
                        echo "<tr>\n";
                }
                echo "<td valign='top' width='50%'>\n"
                        ."<center>\n"
                        ."<a href='modules.php?name=$module_name&amp;cat=$cattitlett&amp;id=$catid'>\n"
                        ."<img src='$catimagedir/$catimage' alt='$cattitle' width='$cattw' height='$catth' border='0'><br>\n"
                        ."$cattitle</a> ($mapsincat)<br><br>\n"
                        ."$catdtl<br><br>\n"
                        ."</center>\n"
                        ."</td>\n";
                $i++;
                if ($i == 2) {
                        echo "</tr>\n";
                        $i = 0;
                }
        }
        if ($i == 1) {
                echo "<td> ;;</td>\n"
                        ."</tr>\n";
        }
        echo "</table>\n";
        echo "\n<!--end show categorys -->\n\n";
        closetable();
        echo "<br>";
}


$page = $_GET['page'];
if(!isset($page)){
        $page = 1;
}
$cr2 = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='m_page'");
        list($maps_page) = $db->sql_fetchrow($cr2);
$page = intval($page);
$maps_page = trim($maps_page);
$from = intval(($page * $maps_page) - $maps_page);
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_mapmap where cat='$id' ORDER BY 'title' ASC LIMIT $from, $maps_page");
$num2 = $db->sql_numrows($result2);
if ($num2 > 0) {
        $cr3 = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='m_img'");
        list($mapimagedir) = $db->sql_fetchrow($cr3);
        $cr3a = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='m_thumbw'");
        list($maptw) = $db->sql_fetchrow($cr3a);
        $cr3b = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='m_thumbh'");
        list($mapth) = $db->sql_fetchrow($cr3b);
        $cr3c = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='a_rate'");
        list($allowratings) = $db->sql_fetchrow($cr3c);
        $cr3d = $db->sql_query("SELECT mval FROM ".$prefix."_mapconfig where mname='d_limit'");
        list($desclimit) = $db->sql_fetchrow($cr3d);
        opentable();
        echo "<!--show maps-->\n";
        echo "<table width='100%' cellpadding='4'>\n";
        $n = 0;
        while ($row2 = $db->sql_fetchrow($result2)){
                $mapid = intval($row2['mapid']);
                $maptitle = stripslashes($row2['title']);
                $mapdtl = stripslashes($row2['details']);
                $mapimage = stripslashes($row2['image']);
                $mapfile = stripslashes($row2['mapfile']);
                $maphits = intval($row2['hits']);
                $filesize = getfilesize(intval($row2['filesize']));
                $maptitlett = ereg_replace(" ", "_", $maptitle);
                if (strlen($mapdtl) > $desclimit){
                        $mapdtls = substr($mapdtl, 0, $desclimit)."<br>... ( <a href='modules.php?name=$module_name&amp;file=viewmap&amp;title=$maptitlett&amp;id=$mapid'>"._MORE."</a> )\n";
                }else{
                        $mapdtls = "$mapdtl";
                }
                if ($mapdtls == ""){
                        $mapdtls = " ;;";
                }
                $result = $db->sql_query("SELECT * FROM ".$prefix."_mapvotes where mapid='$mapid'");
                $row = $db->sql_fetchrow($result);
                $rating = $row['rating'];
                $totalvotes = $row['totalvotes'];
                if ($n == 0) {
                echo "<tr>\n";
                }
                echo "<td valign='top' width='50%'>\n";

                echo "<table width='100%' cellpadding='4' cellspacing='2'>\n"
                        ."<tr>\n"
                        ."<td rowspan='2' width='25%' align='center' valign='top'>\n";
                if (!isurl($mapimage)){
                        echo "<a href='#' title='$maptitle' onClick=\"winname=window.open('$mapimagedir/$mapimage','winname','width=800,height=600,top=50,left=50,status,scrollbars,resizable');\">\n"
                                ."<img src='$mapimagedir/thumb/$mapimage' alt='$maptitle' width='$maptw' height='$mapth' border='0'></a>\n";
                }else{
                        echo "<a href='#' title='$maptitle' onClick=\"winname=window.open('$mapimage','winname','width=800,height=600,top=50,left=50,status,scrollbars,resizable');\">\n"
                                ."        <img src='$mapimage' alt='$maptitle' width='$maptw' height='$mapth' border='0'></a>\n";
                }
                echo "</td>\n"
                        ."<td colspan='2' width='75%' height='10%' valign='top'>\n"
                        ."<font class='title'>&raquo;</font> <a href='modules.php?name=$module_name&amp;file=viewmap&amp;title=$maptitlett&amp;id=$mapid' title='"._VIEW." $maptitle'><font class='title'>$maptitle</font></a>\n"
                        ."</td>\n"
                        ."</tr>\n"
                        ."<tr>\n"
                        ."<td colspan='2' width='75%' valign='top'>"
                        ."<blockquote>\n"
                        ."<font class='content'>".ereg_replace("\n", "<br>", $mapdtls)."</font>\n"
                        ."</blockquote>\n"
                        ."</td>\n"
                        ."</tr>\n"
                        ."<tr>\n"
                        ."<td width='25%' align='center' valign='top'>\n";
                if ($allowratings == 1){
                        ratingimg($rating);
                        if ($totalvotes > 0){
                                echo "<br>"._TOTALVOTES." -&raquo; <strong>$totalvotes</strong>";
                        }
                }else{
                        echo " ;;";
                }
                echo "</td>\n"
                        ."<td valign='top'>\n"
                        .""._FILESIZE." -&raquo; <b>$filesize</b><br>\n"
                        .""._DOWNLOADS." -&raquo; <b>$maphits</b>\n"
                        ."</td>\n"
                        ."<td width='40%'>\n";
                if (is_admin($admin)){
                        echo "<form action='".$admin_file.".php' method='post'>\n"
                                ."<input type='hidden' name='op' value='editmap'>\n"
                                ."<input type='hidden' name='id' value='$mapid'>\n"
                                ."<input type='image' src='modules/$module_name/images/minimap.gif' title='"._EDIT." $maptitle' border='0'>\n"
                                ."</form>\n";
                }else{
                        echo " ;;";
                }
                echo "</td>\n"
                        ."</tr>\n"
                        ."</table>\n"
                        ."<form action='modules.php?name=$module_name&amp;file=downloadmap' method='post'>\n"
                        ."<input type='hidden' name='id' value='$mapid'>\n"
                        ."<center><input type='submit' value='"._DOWNLOAD." $maptitle'></center>\n"
                        ."<br>\n"
                        ."</form>\n"
                        ."<hr noshade color='$bgcolor2'>\n"
                        ."</td>\n";
                        $n++;
   if ($n == 2) {
      echo "</tr>\n";
      $n = 0;
   }


        }
   if ($n == 1) {
      echo "<td>& nbsp;</td>\n"
         ."</tr>\n";
   }
   echo "</table>\n";

   echo "<!--end show maps-->\n\n";
        $result = $db->sql_query("SELECT * FROM ".$prefix."_mapmap where cat='$id'");
        $total_results = $db->sql_numrows($result);
        $total_pages = ceil($total_results / $maps_page);
        if ($total_pages != 1){
                echo "<!--page numbering-->\n\n";
                echo "<table align='center'>\n"
                        ."<tr>\n";
                if($page > 1){
                        $prev = ($page - 1);
                        echo "<td valign='top'>\n"
                                ."<a href='modules.php?name=$module_name&amp;cat=".ereg_replace(" ", "_", $cat)."&amp;id=$id&amp;page=$prev'>\n"
                                ."<img src='modules/$module_name/images/left.gif' alt='"._PREV."' border='0'></a> ;; ;;\n"
                                ."</td>\n";
                }

                for($i = 1; $i <= $total_pages; $i++){
                        if(($page) == $i){
                                echo "<td valign='top'>\n"
                                        ."<b><i>$i</i></b>\n"
                                        ."</td>\n";
                        }else{
                                echo "<td valign='top'>\n"
                                        ."<a href='modules.php?name=$module_name&amp;cat=".ereg_replace(" ", "_", $cat)."&amp;id=$id&amp;page=$i'><b>$i</b> </a>\n"
                                        ."</td>\n";
                        }
                }
                if($page < $total_pages){
                        $next = ($page + 1);
                        echo "<td valign='top'> ;; ;;\n"
                                ."<a href='modules.php?name=$module_name&amp;cat=".ereg_replace(" ", "_", $cat)."&amp;id=$id&amp;page=$next'>\n"
                                ."<img src='modules/$module_name/images/right.gif' alt='"._NEXT."' border='0'></a>\n"
                                ."</td>\n";
                }
                echo "</tr>\n"
                        ."</table>\n"
                        ."<!--end page numbering-->\n\n";
        }
        closetable();
}

if ($num == 0 && $num2 == 0) {
        opentable();
        echo "<center>"._NOCATDATA."<br><br>"._GOBACK."<center>\n";
        closetable();
}
@include("footer.php");
?>
 
View user's profile Send private message Send e-mail 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
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 5 Hours