small issue in psnGallery2

Issue description: If the <cpg_xxxx> tag is used with only 1 parameter and no separator, nothing is displayed.
Discover by: William Spaetzel
Final Fix : next release (probably 1.3.0)
Workaround: use the tag with parameters (eg: <cpg_gallery>3|2|1</cpg_gallery> instead of <cpg_gallery>3</cpg_gallery>)

IE User : Don’t wait for IE version 9.7.8.1 to have PNG transparency

Already in the past, I mentionned this stupid issue with IE… if you don’t use GIF image, you have no transparency ! The full support of PNG image is not supported by IE. To refresh your memories : usage of gif instead of png.

I was surfing and I found this hack. Which is more than easy to implement and it seems it works more than perfectly !

It is composed by a single clever java script ! Amazing ! Microsoft developpers should have a look at the code ! 🙂

psnGeneric version 1.0.1 finally out !

the plugin “psnGeneric version 1.0.1 is finally out ! It was announced few weeks ago…But I had a lot of work to do that’s why it is out only today !

So what’s the plugin ?

Do you see the “quote” block on the left side of this site ? and the “download” filelist block (also on the left side) ? Both are done via the psnGeneric version 1.0.1

So in other word, it is something that display an extract or a full list of records based on a criteria.

For the “quote” example, here is the line added in my “index.php” : the_genRandom( 'QUOTE',1,'','','', ''); .
For the “download” example, the following code is used : genList( 'WPHACK',100,'','','', '');

How to create/manage those lists ?

I create a small administration page for that.

Three different actions are possible : editdeletecreate.

Everything is done via a very easy and intuitive tabular interface.

[EDIT]
In order to fix a small mySQL syntax issue (for old mySQL versions), you have to update the line 94 of wp-admin/psnGENAdmin.php as below :

Change $psnSQLLimit = "LIMIT ".$psnLimit." OFFSET ".$psnOffset;
into $psnSQLLimit = "LIMIT ".$psnOffset.",".$psnLimit;

Thanks Bernd Pressler to notify me about this.

WPPlugin psnGeneric soon out

What’s psnGeneric ?

It allows you to display an extract (random or not) of several records based on a key from a table. This can be used to display a random quote, a list of file to download, a list of … in fact, what you want !

How does it work ?

Few functions that you can call from your “index.php”. There is no limitation except your imagination ! The “Quote of the day” and the “Download” sections displayed on this page use this functionnality. Here is the call for the “Quote” :

< ?php the_genRandom( 'QUOTE',1,'','','', ''); ?>

You manage the content via the WP-Admin area (as you can see below).

Nothing to display.

This is only a preview. It will be out and available for download end of this week-end.

Further information on psnGallery2 tags/functions

Out of a post (eg: in index.php)

// Generate tags to display several random pictures from a specific Coppermine album (if -1 : from all albums)
function CPGRndPicture($aid=-1, $count =-1, $nSize=1,$before='',$after='', $activelink=true, $dummy='') // Generate tags to display a full album from a specific Coppermine album (if -1 : from all albums)...
function CPGAlbum($aid, $nCols=4, $nSize=1, $beforeCol="", $afterCol="", $beforeRow="", $afterRow="")

// Get the name of an album
function CPGAlbumName($aid)

// Get the name of a category
function CPGCategoryName($cid)

// Get the number of pictures within an album
function CPGAlbumPicCount($aid)

// Get the album name list of a category
function CPGAlbumListCategory($cid, $count=-1, $nSize=1, $before='', $after='')

// Display a picture (in some modes)
function CPGPicture($pictID, $nSize=1, $before='', $after='', $mode='picture', $dummy=0)

// Display the specific thumbnail associated with an album
function CPGAlbumThumb ($aid, $nSize=1, $before='', $after='')

Within POST

Tag defined Associated function Action

  • <cpg_album> => CPGAlbum($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ], $elems[ 5 ], $elems[ 6 ]);
  • <cpg_albumcatlist> => CPGAlbumListCategory($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ]);
  • <cpg_albumname> => CPGAlbumName($elems[ 0 ]) ;
  • <cpg_albumpiccount> => CPGAlbumPicCount($elems[ 0 ]);
  • <cpg_albumthumb> => CPGAlbumThumb($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ], $elems[ 5 ], $elems[ 6 ]);
  • <cpg_categoryname> => CPGCategoryName($elems[ 0 ]) ;
  • <cpg_gallery> => CPGRndPicture($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ], $elems[ 5 ], $elems[ 6 ]);
  • <cpg_picture> => CPGPicture($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ], $elems[ 5 ], $elems[ 6 ]);
  • <gallery> => CPGRndPicture($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ], $elems[ 5 ], $elems[ 6 ]);

Of course, $elems[ x ] will be replace by the according value:

In other words : <cpg_gallery>1|5|1</cpg_gallery> will become CPGRndPicture(1, 5, 1, ”, ”, ”, ”); and finally :

Another example : <cpg_picture>275|1</cpg_picture> will become CPGPicture(275, 1, ”, ”, ”, ”, ”) and finally :