Advanced search  

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]

Pages: [1]   Go Down

Author Topic: how to change the category table information?  (Read 6349 times)

0 Members and 1 Guest are viewing this topic.

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
how to change the category table information?
« 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
Logged

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: how to change the category table information?
« Reply #1 on: November 26, 2006, 06:47:43 pm »

upps! my post should be in templates forum sorry
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: how to change the category table information?
« Reply #2 on: November 26, 2006, 09:02:40 pm »

Moving accordingly from "cpg1.4 miscellaneous"
Logged

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: how to change the category table information?
« Reply #3 on: November 26, 2006, 11:35:44 pm »

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?
Logged

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: how to change the category table information?
« Reply #4 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:
Code: [Select]
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)
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: how to change the category table information?
« Reply #5 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.
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: how to change the category table information?
« Reply #6 on: November 29, 2006, 07:38:24 am »

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.
Logged

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: how to change the category table information?
« Reply #7 on: November 29, 2006, 05:41:53 pm »

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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fimg319.imageshack.us%2Fimg319%2F7425%2Fbeforefz6.th.png&hash=e90da4a9788f8e590d38ae81d7b4e431f7c08589)
With the change:(later)
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fimg241.imageshack.us%2Fimg241%2F8899%2Fnextgw9.th.png&hash=088addfd26fe89a75ba5861b2a6ba1a9de409c35)
The coppermine:
http://200.72.175.130/
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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: how to change the category table information?
« Reply #8 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.
Logged

genden

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: how to change the category table information?
« Reply #9 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();

?>
Logged

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: how to change the category table information?
« Reply #10 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
Logged

genden

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: how to change the category table information?
« Reply #11 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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.subirimagenes.com%2Fimagenes%2Fprevio%2Fthump_551416patch.JPG&hash=5bf8de9aa032e637fc150c13cd41a90087245878)
Logged

genden

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: how to change the category table information?
« Reply #14 on: December 01, 2006, 05:38:58 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!
Logged

Prinmode

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: how to change the category table information?
« Reply #15 on: December 01, 2006, 06:26:22 pm »

so, how add the users_count in the array? exist other way?
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 15 queries.