Hot pictures plugin for cpg1.5.x Hot pictures plugin for cpg1.5.x
 

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

Hot pictures plugin for cpg1.5.x

Started by Αndré, March 30, 2012, 02:27:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

Set pictures as 'hot' for x days and display them in a meta album 'hotpics'.

This plugin is the result of a freelance request by altenae. Just install the plugin as described in the Coppermine docs. By default it will add 3 buttons to the intermediate page view for the administrator. In codebase.php you can change those buttons
$buttons = array(1, 2, 3); // each number will create a button 'Hot for x days'
and also determine, which user groups will see the buttons
$groups = array(1); // enter the group IDs which should be allowed to set pictures as 'hot'
(there's no web configuration interface available).

Deus

what is a meta album?
How do I set one up?

https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

lurkalot

#2
Quote from: Deus on September 14, 2012, 09:55:20 PM
what is a meta album?
How do I set one up?

This plugin creates a extra album =  'hotpics'  which you can get to display by adding it to the breadcrumbs list.

Config > Album list view > scroll down to, "The content of the main page"  and add it to the breadcrumb list, example,

breadcrumb/slider/catlist/alblist/hotpics/toprateda/random,2/lastup,2/onlinestats  etc.

You can also add more meta albums by using the More meta albums plugin, http://forum.coppermine-gallery.net/index.php/topic,63706.0.html
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Deus

Brilliant, thanks Lurkalot, that had me scratching my head a bit.
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

allvip

Critical error
There was an error while processing a database query

I disabled the plugin and tryed to enabled it back but I get this error.

I proabibly did not removed the hot pictures before disabling it.

phill104

To know what the problem is you need to detail the full error message. This can be done by enabling debug.

You can disable the plugin via phpmyadmin, you can also enable debug there. Details of how to do this can be found in the docs and in numerous threads in the forums.
It is a mistake to think you can solve any major problems just with potatoes.

allvip

Critical error

There was an error while processing a database query.
While executing query 'ALTER IGNORE TABLE cpg_pictures ADD hot_expire int(11) default '0'' in plugins/hot_pictures/codebase.php on line 180

mySQL error: Duplicate column name 'hot_expire'

File: /home/allvip/public_html/allvip.us/gallery/include/functions.inc.php - Line: 272

allvip

I can not disable the plugin via phpmyadmin because is not in the  cpg_plugins table and his does not have his own table like cpg_plugin_xfeeds

allvip

I would like to remove all the database of this plugin and do a fresf install of hot pictures plgin but can not find it in phpMyAdmin

Niecher

Hello allvip,

I have the same problem as you, then:

1º.- within the structure of the table "cpg_pictures" manually delete the column "hot_expire".

2º.- edit codebabe.php

find:

// Add new column
$thisplugin->add_action('plugin_install', 'hot_pictures_install');
function hot_pictures_install() {
    global $CONFIG;
    cpg_db_query("ALTER IGNORE TABLE {$CONFIG['TABLE_PICTURES']} ADD hot_expire int(11) default '0'");
    return true;
}


and replace:

// Add new column
$thisplugin->add_action('plugin_install', 'hot_pictures_install');
function hot_pictures_install() {
    global $CONFIG;
    cpg_db_query("ALTER TABLE {$CONFIG['TABLE_PICTURES']} ADD hot_expire int(11) default '0'");
    return true;
}

// Remove new column
$thisplugin->add_action('plugin_uninstall', 'hot_pictures_uninstall');
function hot_pictures_uninstall() {
    global $CONFIG;
    cpg_db_query("ALTER TABLE {$CONFIG['TABLE_PICTURES']} DROP hot_expire");
    return true;
}


Regards.

allvip

I already deleted hot expire.
thanks for the code.

allvip

to delete a colum from a table with phpMyAdmin:

click the coppermine database - left sidebar of phpMyAdmin
click table cpg15x_pictures
click SQL button at top of the page
click Clear
paste in the box :

ALTER TABLE cpg15x_pictures
DROP COLUMN hot_expire


Αndré

Seems that
QuoteALTER IGNORE ...
doesn't work as expected. Which MySQL version is installed on your server?

Niecher

#13
Hello André,

Quoteversion 5.1.68

Regards.

Αndré

Confirmed on my testbed. Seems that I misunderstood IGNORE in this context. Will release a new plugin version soon.

Αndré

Plugin version 1.5 attached to initial post.

brynn

Quote from: AndreBy default it will add 3 buttons to the intermediate page view for the administrator.

There don't seem to be any new buttons in intermediate page.  I put it in the breadcrumb, and the empty block shows up everywhere.  But I don't see any new buttons, anywhere.

Should I go into the codebase.php file and edit something?  If so, please tell me what.  Otherwise ???

My gallery:  http://inkscapecommunity.com/ic_gallery/index.php

Thanks for your help   :)

brynn

Unistalled for now.  Let me know if you want me to help troubleshoot and I will re-install it.   :)

Αndré


brynn

Ok, I re-installed it, but still don't see the new buttons, not even in Curve theme.  Let me put it in the breadcrumbs....  Hhm, still no new buttons.  I have several themes available.  Should I check them all?