Changing the value of $counter_text Changing the value of $counter_text
 

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

Changing the value of $counter_text

Started by Muurvaren, September 09, 2006, 12:11:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Muurvaren

Hi there!

I' am trying to integrate an external counter (BBclone) in thumpnails.php in order to know what album is liked most by visitors.
This is working but the value of $counter_text is represented by the album number. I want the _name_ of the album instead.

The number is displayed by: $counter_text = $album;

I tried everything but no go...  ???
I searched this board and also the forum of BBClone but it didn't solve my problem (although several users are using BBclone the same way i want to...).

Anyone to help me out?

My site is at: http://www.muurvaren.nl/



Muurvaren

Quote from: Nibbler on September 09, 2006, 12:30:55 PM
Post your code.

   $counter_text = $album;
   define("_BBC_PAGE_NAME", $counter_text);
   define("_BBCLONE_DIR", "bbclone/");
   define("COUNTER", _BBCLONE_DIR."mark_page.php");
   if (is_readable(COUNTER)) include_once(COUNTER);

The code is inserted at the end of thumbnails.php


Sami

Try this:
   $counter_text = $CURRENT_ALBUM_DATA['title'];
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller


Muurvaren

Quote from: bmossavari on September 09, 2006, 04:17:39 PM
Try this:
   $counter_text = $CURRENT_ALBUM_DATA['title'];

Already tried that one, no success  :(


Muurvaren

Quote from: GauGau on September 09, 2006, 07:33:25 PM
Related thread: Intergrate BBClone into cpg142

No, this one (witch I already found myself) does not work either. It's an easy question (Changing the numeric value of the album to the actual name of the album) but the answer seems to be rather difficult...


Nibbler

#7
This would be the simplest way without looking into the code in detail.


if (is_numeric($album)){
$sql = "SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = $album";
$result = cpg_db_query($sql);
list($album) = mysql_fetch_row($result);
}

$counter_text = $album;
define("_BBC_PAGE_NAME", $counter_text);
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);


Should go just before pagefooter()

Muurvaren

Quote from: Nibbler on September 09, 2006, 08:19:19 PM
This would be the simplest way without looking into the code in detail.


if (is_numeric($album)){
$sql = "SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = $album";
list($album) = mysql_fetch_row($result);
}

$counter_text = $album;
define("_BBC_PAGE_NAME", $counter_text);
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);


Should go just before pagefooter()

Thanks for the effort Nibbler, but no go... (it returns nothing)

http://www.muurvaren.nl/bbclone/show_detailed.php?lng=nl



Nibbler

I missed out the most important part of the code, that's why. I edited it into my post so try again with the new code.

Muurvaren

Quote from: Nibbler on September 09, 2006, 09:01:03 PM
I missed out the most important part of the code, that's why. I edited it into my post so try again with the new code.

Nop...  ???


Nibbler

So you have this code at the end of thumbnails.php and it doesn't work ?


$META_ALBUM_SET = $ALBUM_SET; //temporary assignment until we are sure we are keeping the $META_ALBUM_SET functionality.
CPGPluginAPI::filter('post_breadcrumb',null);
if (!$valid) {
    form_albpw();
} else {
    display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
}

if (is_numeric($album)){
$sql = "SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = $album";
$result = cpg_db_query($sql);
list($album) = mysql_fetch_row($result);
}

$counter_text = $album;
define("_BBC_PAGE_NAME", $counter_text);
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);

pagefooter();
ob_end_flush();

?>

Muurvaren

Quote from: Nibbler on September 09, 2006, 09:17:27 PM
So you have this code at the end of thumbnails.php and it doesn't work ?


$META_ALBUM_SET = $ALBUM_SET; //temporary assignment until we are sure we are keeping the $META_ALBUM_SET functionality.
CPGPluginAPI::filter('post_breadcrumb',null);
if (!$valid) {
    form_albpw();
} else {
    display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
}

if (is_numeric($album)){
$sql = "SELECT title FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = $album";
$result = cpg_db_query($sql);
list($album) = mysql_fetch_row($result);
}

$counter_text = $album;
define("_BBC_PAGE_NAME", $counter_text);
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);

pagefooter();
ob_end_flush();

?>


No it returns 'Main Site'...

You can see it your self:
http://www.muurvaren.nl/bbclone/show_detailed.php?lng=en


Muurvaren

Quote from: Nibbler on September 09, 2006, 09:17:27 PM
So you have this code at the end of thumbnails.php and it doesn't work ?

Hi Nibbler,

Had to remove the code because it showed the thumbnails twice on the same page...  ;D


Nibbler

Post the complete file, you probably have added the code all wrong.

Muurvaren

Quote from: Nibbler on September 09, 2006, 10:07:31 PM
Post the complete file, you probably have added the code all wrong.

Here it is...

Nibbler


Muurvaren

#17
Quote from: Nibbler on September 10, 2006, 12:47:37 PM
Add the code I posted.

To be sure I upgraded to 1.4.9 (from 1.4.8 )


Nibbler


Muurvaren

Quote from: Nibbler on September 10, 2006, 01:47:48 PM
That a 1.4.8 file and is incomplete.

My mistake, sorry!

Attaches is the 1.4.9 version of thumpnails.php