forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: just_some_guy on October 17, 2007, 07:55:13 pm

Title: Multiple anycontents
Post by: just_some_guy on October 17, 2007, 07:55:13 pm
Multiple anycontents

CPG 1.4x

This MOD allows you to add more than one anycontent to your gallery. Its very simple and very usefull. Some ideas of what to use this for could be: customizing the position of ads on your gallery or just simply adding more content.

How to install and usage -

Instructuctions:

Open index.php.

Find:

Code: [Select]
case 'anycontent':
                        if ($cat == 0) {
                            ob_start();
                            /**
                             * Any php code or HTML can be put in this file and will be displayed
                             */
                            include('anycontent.php');
                            $anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
                            ob_end_clean();
                            echo ($anycontent);
                        }
                        flush();
                        break;

and above this add:

Code: [Select]
//mod
                            case 'anycontent1':
                if ($cat == 0) {
                 
                                   include('anycontent1.php');
                                   
                }
                flush();
                break;
//mod

//mod
                            case 'anycontent2':
                if ($cat == 0) {
                 
                                   include('anycontent2.php');
                                   
                }
                flush();
                break;
//mod

//mod
                            case 'anycontent3':
                if ($cat == 0) {
                 
                                   include('anycontent3.php');
                                   
                }
                flush();
                break;
//mod

This will generate 3 anycontent's. To activate them you will need to add the information to the Album list view as described above.


Attachments



Enclosed in the zip's is the original anycontent.php file. This came with the main download of CPG, you will need to edit it to apply your own content.

Notes




Hope this proves useful,

just_some_guy

if a Dev Team Member could move this to the Mods section that would be great, thanks.
Title: Re: Multiple anycontent's
Post by: Hein Traag on October 18, 2007, 08:52:42 am
Nice work just_some_guy. Keep it going  ;)
Title: Re: Multiple anycontents
Post by: ashwilf on April 16, 2008, 03:05:49 pm
Thank You - this works perfect  ;D
Title: Re: Multiple anycontents
Post by: Deus on December 21, 2008, 11:21:51 am
thank you, nice little mod.
Title: Re: Multiple anycontents
Post by: tjiepie on March 11, 2009, 07:33:33 pm
Thank you, good job  8)
Title: Re: Multiple anycontents
Post by: armus on November 02, 2009, 09:14:13 pm
+ on this: If you want to display any content in an album page , simply add

Code: [Select]
//mod
                if ($_GET["album"] ==586) {include('anycontent.php'); }
//mod
just before "?>"

in the thumbnails.php  , 586 is the album number maybe any other you can repeat the code as many album you have to add it in.
Title: Re: Multiple anycontents
Post by: Joachim Müller on November 03, 2009, 09:12:11 am
You can modify any PHP file and add the include command. That's obvious, but not the way that the anycontent feature works in coppermine; with your method, the content of the included PHP is being included after the template has been parsed, so it renders the output completely invalid. Sorry, we can not recommend what you suggest: the modification in itself is trivial and the way it is performed is invalid.