coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Prinmode on November 26, 2006, 06:21:05 PM

Title: how to change the category table information?
Post by: Prinmode on November 26, 2006, 06:21:05 PM
Hi, I have begun it is to do changes to the coppermine, I have achieved several, but this I dont' know how does, cannot find where is the code that shows that.
I want to change the albums and files column for users and files of the table " category " of the main page.
I have looked for some solution in the forums but I do not find exactly mine  :(
i use coppermine 1.4.x

Might anybody to help me? they would be grateful

bye
Title: Re: how to change the category table information?
Post by: Prinmode on November 26, 2006, 06:47:43 PM
upps! my post should be in templates forum (http://forum.coppermine-gallery.net/index.php?board=51.0) sorry
Title: Re: how to change the category table information?
Post by: Joachim Müller on November 26, 2006, 09:02:40 PM
Moving accordingly from "cpg1.4 miscellaneous (http://forum.coppermine-gallery.net/index.php?board=54.0)"
Title: Re: how to change the category table information?
Post by: Prinmode on November 26, 2006, 11:35:44 PM
I know now which is the line, I found in this (http://forum.coppermine-gallery.net/index.php?topic=38584.0) post xD
now only I lack some variable that it has the users count.
I found this line in some of the plugins but I do not know as it is used:

$result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_USERS']}");
        $num_users = mysql_fetch_array($result);
        $num_users = $num_users[0];
How i take all that and place it in a variable?
Title: Re: how to change the category table information?
Post by: Prinmode on November 28, 2006, 11:13:28 PM
nobody knows? sorry for the  inconvenience ad ofr insist, but i need that info.
Seeing the code y don't found a function that obtain a result of the number users for place in the template, so, i created my own function but don't work (sorry i'm a newbie ;D), i created en functions.inc.php the following:
function cantidadusuarios()
{
        $result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_USERS']}");
        $usuarios_count = mysql_fetch_array($result);
        $usuarios_count = $usuarios_count[0];
}

and the theme.inc.php i changed this:

Quote<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td> <-- that for {USUARIOS_COUNT}
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>
        <tr>
            <td class="tableb" colspan="3">{CAT_ALBUMS}</td>
        </tr>
<!-- END catrow -->

and the result is: nothing  :D ... in the category table nothing appears, who can help me?

(i can't post my web, i'm host in my pc and have ip dinamic :D, sorry)
Title: Re: how to change the category table information?
Post by: Gizmo on November 29, 2006, 01:46:06 AM
I really don't understand what it is you want to change. Since you can't post a link to your gallery, make some screen shots and write on them what you want to change.
Title: Re: how to change the category table information?
Post by: Joachim Müller on November 29, 2006, 07:38:24 AM
Quote from: Prinmode on November 28, 2006, 11:13:28 PM
and the theme.inc.php i changed this:
Stop editing include/themes.inc.php and undo your edits there. Edit themes/yourtheme/theme.php instead. Everything that can be accomplished by editing themes.inc.php can be accomplished by editing your custom theme just as well.
Title: Re: how to change the category table information?
Post by: Prinmode on November 29, 2006, 05:41:53 PM
Quote from: Gizmo on November 29, 2006, 01:46:06 AM
I really don't understand what it is you want to change. Since you can't post a link to your gallery, make some screen shots and write on them what you want to change.
sorry i speak spanish, i'm chilean  ;D
i upload two images with the change:
Actually:(before)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg319.imageshack.us%2Fimg319%2F7425%2Fbeforefz6.th.png&hash=e90da4a9788f8e590d38ae81d7b4e431f7c08589) (http://img319.imageshack.us/my.php?image=beforefz6.png)
With the change:(later)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg241.imageshack.us%2Fimg241%2F8899%2Fnextgw9.th.png&hash=088addfd26fe89a75ba5861b2a6ba1a9de409c35) (http://img241.imageshack.us/my.php?image=nextgw9.png)
The coppermine:
http://200.72.175.130/
Quote from: GauGau on November 29, 2006, 07:38:24 AM
Stop editing include/themes.inc.php and undo your edits there. Edit themes/yourtheme/theme.php instead. Everything that can be accomplished by editing themes.inc.php can be accomplished by editing your custom theme just as well.
okey, i replaced the edited file for the original file  :)
I hope it will be understood, forgive but I do not dominate his language
;D
Title: Re: how to change the category table information?
Post by: Joachim Müller on November 29, 2006, 07:17:08 PM
Hehe, that's OK, no need to apologize. Sorry if my advice sounded harsh. Of course you're free to edit as you see fit. My recommendations on not fiddling with themes.inc.php are just advices, based on my experience.
Title: Re: how to change the category table information?
Post by: genden on December 01, 2006, 12:44:10 AM
in file anycontent.php

<?php
starttable("100%", "");
?>

<tr>
        <td class="tableh1" width="80%"><span class="statlink">Index</span></td>
        <td class="tableh1" width="10%" align="center"><span class="statlink">Users</span></td>       
</tr>

<tr>
   <td class="tableb"><table border="0"><tr><td></td><td><span class="catlink"><b><a href="index.php?cat=1">PhotoDAY</a></b></span>Galería de usuarios::</td></tr></table></td>
        <td class="tableb">
<?php
     $result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_USERS']}");
   $num_users = mysql_fetch_array($result);
        $num_users = $num_users[0];
       
        echo $num_users;
?>
   </td>
</tr>          

<?php
endtable();

?>
Title: Re: how to change the category table information?
Post by: Prinmode on December 01, 2006, 01:22:43 AM
Hey! that's fine!
thanks genden, is a good way of replace the cat_list table!!
bravo!! ;D
men, you are a genius :P, see ya
Title: Re: how to change the category table information?
Post by: genden on December 01, 2006, 04:46:04 AM
open themes.inc.php

search
<td class="tableh1" width="80%" align="left"><b>{CATEGORY}</b></td>
<td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
<td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
-------               
change
<td class="tableh1" width="80%" align="left"><b>{CATEGORY}</b></td>
<td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
<td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
<td class="tableh1" width="10%" align="center"><b>{USERS}</b></td>               

*******
search
<td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
<td class="catrow" align="center">{ALB_COUNT}</td>
<td class="catrow" align="center">{PIC_COUNT}</td>
-----------
change
<td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
<td class="catrow" align="center">{ALB_COUNT}</td>
<td class="catrow" align="center">{PIC_COUNT}</td>
<td class="catrow" align="center">{USERS_COUNT}</td>               

********

search
<td class="tableb" colspan="3">{CAT_ALBUMS}</td>
---------
change
<td class="tableb" colspan="4">{CAT_ALBUMS}</td>

********

search
<td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
----------
change
<td colspan="4" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>

*****************
search
  $params = array('{CATEGORY}' => $lang_cat_list['category'],
            '{ALBUMS}' => $lang_cat_list['albums'],
            '{PICTURES}' => $lang_cat_list['pictures'],           
            );
-------
change           
  $params = array('{CATEGORY}' => $lang_cat_list['category'],
            '{ALBUMS}' => $lang_cat_list['albums'],
            '{PICTURES}' => $lang_cat_list['pictures'],
            '{USERS}' => $lang_cat_list['users'],
            );

************
search
$params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => $category['cat_albums'],
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],               
                );
--------
change               
$params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => $category['cat_albums'],
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
                '{USERS_COUNT}' => $category[4],
                );               
************
search
$params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => '',
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],           
                );
------
change               
$params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => '',
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
           '{USERS_COUNT}' => $category[4],
                );               

********************
open english.php

search
$lang_cat_list = array(
  'category' => 'Category',
  'albums' => 'Albums',
  'pictures' => 'Files', 
);
--------

change
$lang_cat_list = array(
  'category' => 'Category',
  'albums' => 'Albums',
  'pictures' => 'Files',
  'users' => 'Users',
);
 
************
open index.php

search

if (!empty($FORBIDDEN_SET) && !$cpg_show_private_album) {
        $album_filter = ' and ' . str_replace('p.', 'a.', $FORBIDDEN_SET);
        $pic_filter = ' and ' . str_replace('p.', $CONFIG['TABLE_PICTURES'] . '.', $FORBIDDEN_SET);
    }
   
add after

$result = cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_USERS']}");
$num_users = mysql_fetch_array($result);
$num_users = $num_users[0];
*********
search
$cat_data[] = array($link, $subcat['description'], $album_count, $pic_count, 'cat_albums' => $cat_albums, 'cat_thumb' => $user_thumb);
-------
change
$cat_data[] = array($link, $subcat['description'], $album_count, $pic_count, $num_users, 'cat_albums' => $cat_albums, 'cat_thumb' => $user_thumb);

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.subirimagenes.com%2Fimagenes%2Fprevio%2Fthump_551416patch.JPG&hash=5bf8de9aa032e637fc150c13cd41a90087245878)
Title: Re: how to change the category table information?
Post by: genden on December 01, 2006, 04:50:27 AM
screenshot for patch
http://www.subirimagenes.com/imagenes/previo/thump_551416patch.JPG (http://www.subirimagenes.com/imagenes/previo/thump_551416patch.JPG)
Title: Re: how to change the category table information?
Post by: Prinmode on December 01, 2006, 04:59:27 AM
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg139.imageshack.us%2Fimg139%2F3161%2Fpatchfz7.th.jpg&hash=0bb1c334b02994d2c02a38b0e06c6a3907f52eef) (http://img139.imageshack.us/my.php?image=patchfz7.jpg)  ;D

i'm try the patch, work perfect!
http://200.72.175.130/photoday


cya
Title: Re: how to change the category table information?
Post by: Joachim Müller on December 01, 2006, 05:38:58 AM
Quote from: genden on December 01, 2006, 04:46:04 AM
open themes.inc.php
No, don't do that! Never edit include/themes.inc.php - under no circumstances. Edit themes/yourtheme/theme.php instead!
Title: Re: how to change the category table information?
Post by: Prinmode on December 01, 2006, 06:26:22 PM
so, how add the users_count in the array? exist other way?