Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 10:59:32 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Private messages disabled
Caused by the massive abuse of the PM system in the past, the sending of personal messages has been disabled for all regular users on the Coppermine forum.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Multiple anycontents  (Read 6363 times)
0 Members and 1 Guest are viewing this topic.
just_some_guy Topic starter
Supporter
****
United Kingdom United Kingdom

Posts: 539


I am currently on holiday, back in a few weeks. :D


« on: October 17, 2007, 06: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 -

  • Backup your original index.php as this will overwrite your current one.
  • Upload the content of one of the attached archives to your gallery root folder. Use anycontent1.zip for 1 extra anycontent box, use anycontent2.zip for 2 extra anycontent boxes and so on.
  • Follow the below instructions.
  • Go to config => Album list view => then add how many anycontent's you want. For example: breadcrumb/catlist/alblist/lastup,2/anycontent/anycontent1/anycontent2/. This will give a total of 3 anycontent's including the 2 extra ones.
  • To edit the content of these sections simply edit the files: anycontent1.php,anycontent2.php etc.
Instructuctions:

Open index.php.

Find:

Code:
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:
//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

  • anycontent1.zip - 1 extra anycontent.
  • anycontent2.zip - 2 extra anycontent.
  • anycontent3.zip - 3 extra anycontent.

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

  • I am currently working on a pluginized version of this, untill then, here is the manual version.


Hope this proves useful,

just_some_guy

if a Dev Team Member could move this to the Mods section that would be great, thanks.
« Last Edit: October 19, 2007, 07:19:42 am by GauGau » Logged

Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums
Hein Traag
Dev Team member
****
Gender: Male
Netherlands Netherlands

Posts: 2153


A, B, Cpg


WWW
« Reply #1 on: October 18, 2007, 07:52:42 am »

Nice work just_some_guy. Keep it going  Wink
Logged

ashwilf
Coppermine newbie

Posts: 8


« Reply #2 on: April 16, 2008, 02:05:49 pm »

Thank You - this works perfect  Grin
Logged
Deus
Contributor
***
Gender: Male
United Kingdom United Kingdom

Posts: 141



WWW
« Reply #3 on: December 21, 2008, 10:21:51 am »

thank you, nice little mod.
Logged

http://www.mess-hall.co.uk/
Gallery, blog/news and PS3 gaming forum
tjiepie
Coppermine novice
*
Posts: 23


« Reply #4 on: March 11, 2009, 06:33:33 pm »

Thank you, good job  Cool
Logged
armus
Coppermine newbie

Turkey Turkey

Posts: 11


« Reply #5 on: November 02, 2009, 08:14:13 pm »

+ on this: If you want to display any content in an album page , simply add

Code:
//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.
Logged
Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #6 on: November 03, 2009, 08: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.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.044 seconds with 15 queries.