. .
pragmaMx Support Forum 17 März 2010, 05:47:13 *
Willkommen Gast. Bitte einloggen oder registrieren.


Einloggen mit Benutzername und Passwort
News:
Brauchen Sie Hilfe? Bitte nutzen Sie unsere Suchfunktion bevor Sie Beiträge oder Fragen ins Board schreiben! Viele Fragen wurden bereits gestellt und beantwortet. Danke!
 
Übersicht Hilfe Forenregeln / Boardrules
 
Suche
Seiten: [1]   Nach unten
Drucken
Autor Thema: How to convert CPG Plugin to a MX-CPG Plugin  (Gelesen 5287 mal)
0 Mitglieder und 1 Gast betrachten dieses Thema.
Beyond_Doubt Topic starter
neu hier
*
Offline Offline

Geschlecht: Männlich
Beiträge: 13


« am: 27 Februar 2006, 00:51:38 »

Appologies, but this is an English only post; I know no German.

I have a PragmaMX installation with MX-CPG 1.4.3.
In that installation I have added a few Plugins from the CPG site.
Some of these Plugins required small modifications to the codebase.php before they would work.
Usually this modification was just to change...
Code: [Select]  
require ('plugins/control_fullsize/include/init.inc.php');
to
Code: [Select]  
require (dirname(__FILE__).'/include/init.inc.php');


However I am very eager to use the 'File Replacer' Plugin that can be found here.

But when I use that Plugin, and then click on the 'Replace File' button I get the following error message...
Zitat
Sorry, you can't access this file directly, parameter 'name' is required...



So, I am asking for some help here.
Are there any modifications that need to be made to basic CPG code to convert it to MX-CPG that I have missed?
Or, more to the point, can someone get this plugin working in MX-CPG for me?

cheesy

Thanks in advance!
Gespeichert
Andi
Administrator
******
Offline Offline

Geschlecht: Männlich
Beiträge: 16.993



WWW
« Antworten #1 am: 27 Februar 2006, 10:54:25 »

Hi Smiley

yes, that's a really great plugin.

There is only few changes necessary in the codebase.php.


In links, the correct and complete filename is required:
Code: [Select]  
#$data['menu'] .= ' <a href="?replacer_pid='.$data['pid'].'"  class="admin_menu">Replace file</a>';
should be
Code: [Select]  
$data['menu'] .= ' <a href="displayimage.php?replacer_pid='.$data['pid'].'"  class="admin_menu">Replace file</a>';


on includes, the full path is needed, we can use the bridge-Constant "MXCPG_PATH_INCLUDE"
Code: [Select]  
require('include/picmgmt.inc.php');
should be:
Code: [Select]  
require(MXCPG_PATH_INCLUDE.'picmgmt.inc.php');


"header location" doesn't work correctly in the pragmaMx Bridge. We use the bridge-Function mxcpg_redirect()
Code: [Select]  
header("Location: {$CONFIG['site_url']}/displayimage.php?pos=-$pid");
should be:
Code: [Select]  
mxcpg_redirect(MXCPG_MODLINK."&act=displayimage&pos=-$pid");
MXCPG_MODLINK is a bridge-Constant which stores "modules.php?name=Gallery"


in forms, the action attribute is required:
Code: [Select]  
echo '<form method="post" enctype="multipart/form-data">';
should be:
Code: [Select]  
echo '<form method="post" action="displayimage.php?replacer_pid='.$pid.'" enctype="multipart/form-data">';
And here, the "replacer_pid" is required in the URL.


I do not know, whether it is a fundamental problem of the Plugins, but in my testing gallery the link "replace file" was indicated doubly in the menu.
Therefore I built the following additional code into the function  menu():
Code: [Select]  
static $check;
if (isset($check))
return $data;
$check=true;


Enclosed the changed file Wink


@ all
Ja, das komplette Plugin stellen wir in die Downloads Wink
« Letzte Änderung: 01 März 2006, 10:04:34 von Andi » Gespeichert

schön´s Grüssle, Andi
Kein Support über PN, Mail oder ICQ!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!


Schon wieder Neujahr? Dabei hätte das alte noch für Monate gereicht...
Beyond_Doubt Topic starter
neu hier
*
Offline Offline

Geschlecht: Männlich
Beiträge: 13


« Antworten #2 am: 27 Februar 2006, 19:50:00 »

Thank you Andi for a quick, and informative, reply. Smiley

I really appreciate your help on this issue. There was no way I was going to catch all those changes!
Gespeichert
Andi
Administrator
******
Offline Offline

Geschlecht: Männlich
Beiträge: 16.993



WWW
« Antworten #3 am: 27 Februar 2006, 23:19:05 »

hello Smiley
no problem, that happened gladly.
We will also use this Addon....  thumbup
Gespeichert

schön´s Grüssle, Andi
Kein Support über PN, Mail oder ICQ!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!


Schon wieder Neujahr? Dabei hätte das alte noch für Monate gereicht...
Andi
Administrator
******
Offline Offline

Geschlecht: Männlich
Beiträge: 16.993



WWW
« Antworten #4 am: 01 März 2006, 10:03:52 »

Hi Smiley

the updated file, as here described:
http://coppermine-gallery.net/forum/index.php?topic=21193.msg132231#msg132231

[gelöscht durch Administrator]
Gespeichert

schön´s Grüssle, Andi
Kein Support über PN, Mail oder ICQ!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!


Schon wieder Neujahr? Dabei hätte das alte noch für Monate gereicht...
Beyond_Doubt Topic starter
neu hier
*
Offline Offline

Geschlecht: Männlich
Beiträge: 13


« Antworten #5 am: 02 März 2006, 00:27:45 »

Thank you again Smiley

I should also like to make a quick reminder to anyone interested in using this plugin that to let the regular site users have the option of replacing their files you will need to enable Allow users to retain control over their pics in public galleries in the User Settings section of the Gallery Config screen.

Of course a site admin can always do this. Smiley
Gespeichert
Seiten: [1]   Nach oben
Drucken
 
Gehe zu:  

Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC
design by hENNE, layout based on YAML