Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [cpg1.5.x]: Show anycontent on Home Page only v1.0  (Read 6131 times)

0 Members and 1 Guest are viewing this topic.

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1498
  • aka 'i-imagine'
    • Home Page
[cpg1.5.x]: Show anycontent on Home Page only v1.0
« on: March 11, 2010, 03:04:04 am »

The plugin will remove the display of anycontent.php from the main Album list page (index.php?cat=0).

This can help to avoid showing duplicate content equal to the main Home page.

There is no configuration available - just install and go. Advanced users could edit the file codebase.php to add a different anycontent to Album list page (index.php?cat=0). There are comment lines clearly marking where edits could be added.

Demo Here
« Last Edit: March 11, 2010, 03:37:48 am by Joe Carver »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: [cpg1.5.x]: Show anycontent on Home Page only v1.0
« Reply #1 on: March 11, 2010, 07:45:06 am »

Why not just put this into anycontent?
Code: [Select]
<?php
if ($cat == '') {
    echo 
'Hello world';
} else {
    
// do nothing
}
?>
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1498
  • aka 'i-imagine'
    • Home Page
Re: [cpg1.5.x]: Show anycontent on Home Page only v1.0
« Reply #2 on: March 11, 2010, 12:41:17 pm »

No reason at all - that seems to work just fine.

But since I had wrote the plugin package for the newbie/novice users who would not be aware of cpg's variables maybe I will redo it with your if/else and rename it as "Alternate or No anycontent for the main album list".

Unless, of course, it is indicated that I would be wasting my time.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: [cpg1.5.x]: Show anycontent on Home Page only v1.0
« Reply #3 on: March 11, 2010, 01:31:37 pm »

Hehe, no: your contribution is of course fine and welcome ;D. But this plugins looks sort-of redundant to me: anycontent only makes sense for those who know their way around in PHP a bit. Given your skills I would have expected a more sophisticated plugin, but that's fine as well: everybody likes easy.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1498
  • aka 'i-imagine'
    • Home Page
Re: [cpg1.5.x]: Show anycontent on Home Page only v1.0
« Reply #4 on: March 11, 2010, 05:55:11 pm »

Thanks - although I think I could make a good argument against my skillset...

At the moment I am going to make only a couple of small changes. Adding tables and changing the expression for matching to the newer output of SEF url's.

Unfortunately using $cat as for the if/else does not appear to work - I should have remembered this when replying earlier having learned through using a similar routine for the iScroll plugin.

Somehow Coppermine treats/reads the value $cat different when in index.php  vs. when it reads it from the plugin and perhaps elsewhere. It returns $cat=0 when on the home page when in my plugins.

This can be seen/proven by making a simple "custom footer" with this code.
Code: [Select]
<?php
global 
$cat;
echo $cat;
?>
It will always echo 0 for $cat on the home page.

I respectfully await any suggestions - but for something so simple, please don't use any time that you might not have. However I am curious when you wrote:
I would have expected a more sophisticated plugin,
What did you have in mind?  :)  Thanks again






Pages: [1]   Go Up
 

Page created in 0.018 seconds with 23 queries.