how to change the category table information? how to change the category table information?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

how to change the category table information?

Started by Prinmode, November 26, 2006, 06:21:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Prinmode

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

Prinmode


Joachim Müller


Prinmode

I know now which is the line, I found in this 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?

Prinmode

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)

Gizmo

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.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

Joachim Müller

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.

Prinmode

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)
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)
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

Joachim Müller

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.

genden

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();

?>

Prinmode

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

genden

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)



Joachim Müller

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!

Prinmode

so, how add the users_count in the array? exist other way?