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: Slider Plugin Modification..  (Read 3778 times)

0 Members and 1 Guest are viewing this topic.

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Slider Plugin Modification..
« on: April 04, 2012, 06:09:39 pm »

Hi, I have to set one of my albums for the slider and as the current slider does not implement this and only offers "Last Upload, Random, Top Rated, Most Viewed", I add some extra code manually.. as follows;-


Quote
plugin_config.php
********************************************************
I ADD

<option value="model" <?php if($SLIDERSET['slider_album'] == "model") echo 'selected="selected"';?>><?php echo 'The Best Models'?></option>

Just below..

<option value="toprated" <?php if($SLIDERSET['slider_album'] == "toprated") echo 'selected="selected"';?>><?php echo $lang_meta_album_names['toprated']?></option>

********************************************************

Quote
codebase.php
********************************************************
I ADD

// request string for album Model pics

  else if ($SLIDERSET['slider_album'] == "model")
  {
     $slider_query = "SELECT * FROM {$CONFIG['TABLE_ALBUMS']} AS p WHERE aid=3 AND filename like '%.jpg' AND filename not like 'youtube_%' $slider_FORBIDDEN_SET $META_ALBUM_SET ORDER BY RAND() LIMIT $sliderlimit";
  }

Just below..

else if ($SLIDERSET['slider_album'] == "lastup") {
    $slider_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' $slider_FORBIDDEN_SET $META_ALBUM_SET ORDER BY pid DESC LIMIT $sliderlimit"; 
  }
********************************************************

Now, I could see another extra option called "The Best Models" and when I click the summit button, the value is updated successfully... However, when I try to see the result on the main page, it says "There was an error while processing a database query" .

Please, kindly give me some suggestion... I am really in need to make this working..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Slider Plugin Modification..
« Reply #1 on: April 05, 2012, 10:01:17 am »

Please enable debug mode and post the extended error message. I guess it will work when you change
Code: [Select]
{$CONFIG['TABLE_ALBUMS']}to
Code: [Select]
{$CONFIG['TABLE_PICTURES']}
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Slider Plugin Modification..
« Reply #2 on: April 06, 2012, 04:51:03 am »

Hi, Andre.. You are absolutely right! Thank you very much! The problem is partially solved, however, I do not know how to show the sliding description. For example, if it is "Top Rated", above the sliding pictures the text "Top Rated" is shown, and if it is "Random Files", The the text "Random Files" is displayed. Now that I used Models album and I want to show the text "Models" above the sliding pictures, do you have any idea how could I achieve this? I will try to figure out at the same time..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Slider Plugin Modification..
« Reply #3 on: April 06, 2012, 11:23:54 am »

As I don't know the plugin nor investigate its code, you should search the whole plugin's code for
Code: [Select]
starttable
The second parameter is the table's caption.
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.