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] 2   Go Down

Author Topic: Changing the value of $counter_text  (Read 9546 times)

0 Members and 1 Guest are viewing this topic.

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Changing the value of $counter_text
« on: September 09, 2006, 12:11:55 pm »

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/

Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #1 on: September 09, 2006, 12:30:55 pm »

Post your code.
Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #2 on: September 09, 2006, 02:32:16 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

Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Changing the value of $counter_text
« Reply #3 on: September 09, 2006, 04:17:39 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Changing the value of $counter_text
« Reply #4 on: September 09, 2006, 07:33:25 pm »

Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #5 on: September 09, 2006, 07:58:33 pm »

Try this:
   $counter_text = $CURRENT_ALBUM_DATA['title'];

Already tried that one, no success  :(

Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #6 on: September 09, 2006, 08:06:32 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...

Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #7 on: September 09, 2006, 08:19:19 pm »

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

Code: [Select]
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()
« Last Edit: September 09, 2006, 09:00:12 pm by Nibbler »
Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #8 on: September 09, 2006, 08:52:34 pm »

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

Code: [Select]
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


Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #9 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.
Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #10 on: September 09, 2006, 09:12:45 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...  ???

Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #11 on: September 09, 2006, 09:17:27 pm »

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

Code: [Select]
$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();

?>
Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #12 on: September 09, 2006, 09:24:00 pm »

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

Code: [Select]
$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

Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #13 on: September 09, 2006, 10:05:53 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

Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #14 on: September 09, 2006, 10:07:31 pm »

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

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #15 on: September 10, 2006, 12:26:35 am »

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

Here it is...
Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #16 on: September 10, 2006, 12:47:37 pm »

Add the code I posted.
Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #17 on: September 10, 2006, 01:32:41 pm »

Add the code I posted.

To be sure I upgraded to 1.4.9 (from 1.4.8 )

« Last Edit: September 10, 2006, 03:37:02 pm by wadh »
Logged

Nibbler

  • Guest
Re: Changing the value of $counter_text
« Reply #18 on: September 10, 2006, 01:47:48 pm »

That a 1.4.8 file and is incomplete.
Logged

Muurvaren

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 37
    • Muurvaren, digitale fotografie
Re: Changing the value of $counter_text
« Reply #19 on: September 10, 2006, 03:36:25 pm »

That a 1.4.8 file and is incomplete.

My mistake, sorry!

Attaches is the 1.4.9 version of thumpnails.php





Logged
Pages: [1] 2   Go Up
 

Page created in 0.032 seconds with 19 queries.