Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2   Go Down

Author Topic: Final Extract plugin for cpg 1.5.x  (Read 60648 times)

0 Members and 1 Guest are viewing this topic.

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Final Extract plugin for cpg 1.5.x
« on: November 28, 2009, 06:58:11 pm »

Hi all,

I've ported the Final_Extract plugin for cpg1.5.x

The final_extract plugin removes core blocks from the final HTML produced by Coppermine, just before it is displayed to the user on the web page.  This is probably the best way to remove things like menu buttons and other core items like links & buttons throughout the various pages Coppermine produces.
This plugin version comes with usergroup settings by admin panel: You can define for each usergroup the menu elements to display (or to hide). 
the  settings are done by admin panel.  If a new group is created , it is taken into account and can be also parameterized. 
This plugin is multilangage. currently  “english”  "german" and “french” language files exists.
feel free to share your own lang file with the Coppermine community.

Version 1.1
Two known issues corrected

Known Issues:

They are some little issues in this version, so if someone can have a look  ;D

   *The language detection doesn't work while uninstalling the plugin
   *If you select "keep the table used for the pluging " while uninstalling, the table is still deleted (Fixed in version 1.1)
   *The check all javascript doesn't work (Fixed in version 1.1)
« Last Edit: July 25, 2014, 11:20:36 am by Αndré »
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Nibbler

  • Guest
Re: Final Extract plugin for cpg 1.5.x (beta version)
« Reply #1 on: November 28, 2009, 07:02:38 pm »

Please remove extraneous files when you package plugins. You have included a __MACOX directory, several .svn directories and a .DS_Store file. For the uninstall issue, you are checking whether the 'drop' key exists - you should instead be checking if it is 1.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x (beta version)
« Reply #2 on: November 28, 2009, 07:19:45 pm »

Thank's Nibbler, i'll have a look at this and apologise for the unexpected files
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x (beta version)
« Reply #3 on: December 06, 2009, 06:10:13 pm »

Version 1.1 Attached to the very first post.
Issues corrected:
Javascript "select all" work's now
Unistall delete database plugin table if option selected.
Only one known issue with the lang detection who doesn't work for unistallation form
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Final Extract plugin for cpg 1.5.x
« Reply #4 on: December 07, 2009, 02:17:17 pm »

Very nice work!

It might be my setup, but I am seeing different output depending on the Theme (standard 1.5.2) being used. It seems only that the difference is with the Sub menu.

You can see here CPG 1.5.2 Gallery

I have hidden last comments, top-rated and login buttons using Final Extract. In the footer I have pasted/hacked in a theme select list to make selection easier. Debug is on for all at the moment.

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x
« Reply #5 on: December 07, 2009, 02:57:54 pm »

you're right, it seems depending with the theme who use grafical sub mens. i 'll have a look at his ASP
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

homeuser

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Final Extract plugin for cpg 1.5.x
« Reply #6 on: March 07, 2010, 03:28:50 pm »

Hi,

at the moment I play a little around with 1.5x. There is no installation available via internet.
I have found some errors, I like to share with you.
First, I recogonized a new release v2.4 for 1.5x. But the installation never works. I sneak into the source code and detect there is no supercage-code in it.
My guess, v2.4 is for 1.4x not 1.5x as mentioned in the filename of the attachment in the first posting and on sourceforge.

Next, the configuration.php is defective, a wrong CR/LF brokes the plugin display with an error message.
Find:
Code: [Select]
$author='Donnoman@donovanbray.com from <a href="http://cpg-contrib.org" target="_blank">cpg-contrib.org</a>&nbsp;<b>
Modified by:</b> BMossvari at gmail dot com <a href="http://www.myprj.com" target="blank">Myprj.com</a><br>Modified and ported for CPG 1.5.x by<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=9980" target="blank">Frantz</a>';
Replace with:
Code: [Select]
$author='Donnoman@donovanbray.com from <a href="http://cpg-contrib.org" target="_blank">cpg-contrib.org</a><br /><b>Modified by:</b> BMossvari at gmail dot com <a href="http://www.myprj.com" target="blank">Myprj.com</a><br />Modified and ported for CPG 1.5.x by <a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=9980" target="blank">Frantz</a>';

plugin_config.php.
Just a little optical improvement. A space between the version display and the last dash. ;)
Find:
Code: [Select]
starttable('100%', 'Final Extract for CPG 1.5.x - '.$lang_plugin_final_extract['version'].'- <a href="pluginmgr.php" class="admin_menu">Plugin Manager</a>', 3);
Replace with:
Code: [Select]
starttable('100%', 'Final Extract for CPG 1.5.x - '.$lang_plugin_final_extract['version'].' - <a href="pluginmgr.php" class="admin_menu">Plugin Manager</a>', 3);

1.5x uses other language variables for "continue".
Find:
Code: [Select]
        msg_box($lang_plugin_final_extract['display_name'], $lang_plugin_final_extract_delete['nothing_changed'], $lang_continue, 'index.php?file=final_extract/plugin_config');
Replace with:
Code: [Select]
        msg_box($lang_plugin_final_extract['display_name'], $lang_plugin_final_extract_delete['nothing_changed'], $lang_common['continue'], 'index.php?file=final_extract/plugin_config');

Find:
Code: [Select]
        msg_box($lang_plugin_final_extract['display_name'], $lang_plugin_final_extract_delete['success'], $lang_continue, 'index.php?file=final_extract/plugin_config');
Replace with:
Code: [Select]
        msg_box($lang_plugin_final_extract['display_name'], $lang_plugin_final_extract_delete['success'], $lang_common['continue'], 'index.php?file=final_extract/plugin_config');

A simple typo:
Find:
Code: [Select]
            <td align="center" valign=top class=tableb><input name="lastcom" type="checkbox"  <?php if($row2['lasctom']==1) { echo 'checked="cheked"';$nb++;} ?>/></td>
Replace with:
Code: [Select]
            <td align="center" valign=top class=tableb><input name="lastcom" type="checkbox"  <?php if($row2['lastcom']==1) { echo 'checked="cheked"';$nb++;} ?>/></td>

Remove the error with the wrong language at uninstall.
codebase.php
Find:
Code: [Select]
function final_extract_cleanup($action)
{
    global $lang_plugin_final_extract_config;
Replace with:
Code: [Select]
function final_extract_cleanup($action)
{
    global $CONFIG, $lang_common, $lang_plugin_final_extract_config;

Also use the correct language for the Yes/No selection:
Find:
Code: [Select]
               <td>Yes</td>
Replace with:
Code: [Select]
               <td>{$lang_common['yes']}</td>

Find:
Code: [Select]
               <td>No</td>
Replace with:
Code: [Select]
               <td>{$lang_common['no']}</td>


Some little improvement. Added an "uncheck all" button as opposite to the "check all" button.

plugin_config.php
Find:
Code: [Select]
//onload = change;
</script>
Before add:
Code: [Select]
function uncheck_all(formname) {
 i=0;
 while(document.getElementById(formname).elements[i]) {
document.getElementById(formname).elements[i].checked="";
i+=1;
 }
}

Find:
Code: [Select]
            <tr>
                <td class=tableb align="<?php echo $align ?>" dir="<?php echo $direction ?>">&nbsp;</td>
                <td align="center" valign=top class=tableb>&nbsp;&nbsp;
                  <input class="button" type="button" value="<?php echo $lang_plugin_final_extract_manage['list_chkall']; ?>" name="restore_config" onclick="return check_all('blocks');"></td>
              </tr>
Replace with:
Code: [Select]
            <tr>
                <td colspan="2" align="right" valign=top class=tableb>
                  <input class="button" type="button" value="<?php echo $lang_plugin_final_extract_manage['list_chkall']; ?>" name="restore_config" onclick="return check_all('blocks');">&nbsp;
                  <input class="button" type="button" value="<?php echo $lang_plugin_final_extract_manage['list_unchkall']; ?>" name="restore_config" onclick="return uncheck_all('blocks');"></td>
              </tr>

lang/english.php
Find:
Code: [Select]
'list_chkall' => 'Check All', // CPA 1.2.2
After add:
Code: [Select]
'list_unchkall' => 'Uncheck All',

lang/french.php
Find:
Code: [Select]
'list_chkall' => 'Sélectionner tout', // CPA 1.2.2
After add:
Code: [Select]
'list_unchkall' => 'Sélectionner rien',
Or add a better french translation. :)

At last I reworked the german translation (attached), e.g. the translation for "my_profile_block" was completely missing.
The language variables list_submit, list_restore and list_stat seemes to be ununsed.

There is always a warning in the debug-infos:
Quote
/plugins/final_extract/include/init2.inc.php
    * Warning line 24: mysql_free_result(): supplied argument is not a valid MySQL result resource
I have no idea yet, how to deal with it.

Hope this helps.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x
« Reply #7 on: March 07, 2010, 04:06:17 pm »

thank's for sharing your improvements.

I'll have a loock at this ASP (I'm working on another poject on this moment...)
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Final Extract plugin for cpg 1.5.x
« Reply #8 on: March 08, 2010, 08:59:47 am »

I'm looking into this - please stand by.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x
« Reply #9 on: March 08, 2010, 09:10:47 am »

ok thank's
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Final Extract plugin for cpg 1.5.x
« Reply #10 on: March 08, 2010, 09:32:28 am »

The version in the SVN indeed is the one for cpg1.4.x and not for cpg1.5.x. Plugin currently doesn't work as expected. I have partially comitted fixes. Work still in progress.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x
« Reply #11 on: March 08, 2010, 09:58:31 am »

Not sure i understand.
The pluging version i attached on the very first post (version 1.1) was working for me on my testbed and was designed for cpg1.5.x
The 2.4 version attached is not the cpg1.5 version (i d'on't know who has attached this here  ;)) maybe is this mistake the fault...
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

gldickens3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: Final Extract plugin for cpg 1.5.x
« Reply #12 on: July 04, 2010, 03:02:32 pm »

I am trying to migrate my 1.4.26 Coppermine installations to version 1.5.6.  I installed the Final Extract plugin file from this thread which is named: "cpg_1.5.x_plugin_final_extract_ver1.1.zip". The plugin will not install and instead I get the following error in my browser:

Quote
Critical error
There was an error while processing a database query

I then implemented the modifications listed by homeuser in Reply #6 to the plugin, however that does not work either and results in the same error message.

Am I doing something wrong or is this plugin broken on cpg 1.5.x?

Thanks,

Gordon
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x
« Reply #13 on: July 04, 2010, 03:50:39 pm »

The version in the SVN indeed is the one for cpg1.4.x and not for cpg1.5.x. Plugin currently doesn't work as expected. I have partially comitted fixes. Work still in progress.
please wait the time someone look into this. But you can enable debug mod to have the entire error message that can help to find what's going wrong
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

gldickens3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: Final Extract plugin for cpg 1.5.x
« Reply #14 on: July 04, 2010, 10:53:07 pm »

Hi François

Thanks for the tip to run in debug mode!  I got the plugin working.  Basically, the mysql scripts in the plugin had a couple of typos and the install script does not execute properly.  Attached is a working version of the Final Extract plugin which is based on the "cpg_1.5.x_plugin_final_extract_ver1.1.zip" file in the first post of this tread with the following modifications:

1) Implemented the modifications listed by homeuser in Reply #6 to the plugin.
2) Modified schema.sql to rename the Final Extract table "cp_final_extract_config" instead of "CPG_final_extract_config".
3) Modified basic.sql to rename the Final Extract table "cp_final_extract_config" instead of "CPG_final_extract_config".
4) Modified basic.sql to add a missing single quote for the last field's value in the fourth INSERT command.

Everything now works except for the plugin installation which still does not install and populate the "cp_final_extract_config" table as I think that it should. I am not sure why the install scripts don't execute properly, however, if you run mysql scripts manually as follows then everything works perfectly thereafter:

mysql -u<username> -p<password> -D<database> < schema.sql
mysql -u<username> -p<password> -D<database> < basic.sql

FYI,

Gordon
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Final Extract plugin for cpg 1.5.x
« Reply #15 on: July 05, 2010, 07:08:02 am »

Thank's  for your contribution, bt you have forgotten to attach the file  ;)
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

gldickens3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: Final Extract plugin for cpg 1.5.x
« Reply #16 on: July 05, 2010, 12:58:34 pm »

Hi François

Yes, I forgot to attach the file.  Duh.... Sorry about that!  :o

Attached is a working version of the Final Extract plugin which has been modified as described in my prior post. As I mentioned, everything works except for the plugin installation which still does not install and populate the "cp_final_extract_config" MySQL table. Therefore, you must run the mysql scripts manually and then everything works perfectly thereafter.

Gordon

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Final Extract plugin for cpg 1.5.x
« Reply #17 on: July 05, 2010, 02:02:45 pm »

Everything now works except for the plugin installation which still does not install and populate the "cp_final_extract_config" table as I think that it should. I am not sure why the install scripts don't execute properly
Quite obvious:
2) Modified schema.sql to rename the Final Extract table "cp_final_extract_config" instead of "CPG_final_extract_config".
3) Modified basic.sql to rename the Final Extract table "cp_final_extract_config" instead of "CPG_final_extract_config".
You mustn't rename the table prefix, as it gets replaced by the installer:
Code: (codebase.php) [Select]
$sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
Logged

gldickens3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: Final Extract plugin for cpg 1.5.x
« Reply #18 on: July 05, 2010, 02:51:00 pm »

Quite obvious:You mustn't rename the table prefix, as it gets replaced by the installer:
Code: (codebase.php) [Select]
$sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);

Hi Αndré,

Well, that doesn't work either.  You get the following error:

Quote
mySQL error: Table '<database_name>.cp_final_extract_config' doesn't exist

With the table prefix set to CPG_ the "CPG_final_extract_config" table is never created by the script and so it never gets the chance to do the /CPG_/cp_/ replacement.

Gordon
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Final Extract plugin for cpg 1.5.x
« Reply #19 on: July 05, 2010, 03:09:03 pm »

Please re-install the plugin using version 1.2 I attached to the initial post and everything works fine :)
Logged
Pages: [1] 2   Go Up
 

Page created in 0.033 seconds with 20 queries.