Étiquette : PHP

  • Near Future Posts plugin

    For an external development I needed to be able to display future posts but not all future posts. I started with the future posts plugin of Michael Moncur but it doesn’t fit to what I really needed.

    The posts to be displayed should have been maximum 20 days in the future…

    So the plugin is now able to display the future posts of ‘x’ days (defined via an simple administration screen).

    (suite…)

  • psnCPGAdmin in the Admin Panel

    Well, here is the preview of how to add the psnGallery2 Admin in the WP Administration Panel….
    (suite…)

  • psnGallery2 1.4 preview

    As you know I had some hard time those last weeks : too much work no enough time ! Well, I assume it is end-of-year related as it is like that every year !

    Oops ! I said that it is « end-of-year » period…. Oh ! No ! No gift ?!?!!!

    Well, in fact there is a gift : my famous psnGallery2 new version (1.4.0) will be soon available…probably current of the coming week.

    The major innovations are :

    • Install / Upgrade script (as simple as the one from WordPress !)
    • psnCPGAdmin.php has been reviewed to allow to display albums without categories (sorry to be so late, Sophist…)
    • fixes of several bugs

    To install or to upgrade to this version, you will have to fill in the following screen :

    13-1848.jpg

    Here below, some snapshots of the install script and of the psnCPGAdmin…

    So this will be soon available for download ! Christmas time ! 😉

    (suite…)

  • Small code to display a day picture instead of date

    Inspired by the post « little calendar hack for wordpress » from Introducing the all new Gavin Laking, I decided to implement an old idea : display a picture based on the date….To do so :

    Within the main « post » loop (index.php) :
    (suite…)

  • StatTraq permalink support fix

    I installed the statTraq plugin on 23rd September but I found a small issue with permalink url…The post id was not saved because I am using nice url…

    Insert the following code just after $browser = statTraqGetBrowser(); (around line 37) in « wp-content/plugins/stattraq.php »….

    (suite…)

  • psnGallery2 fix for dash in the database name !

    Well, I was helping Peter to use psnGallery2…And I finally found the issue :

    His Coppermine database name was like « database-coppermine » ! So in the code, to be able to handle several databases (one for WordPress and another for Coppermine), the plugin is using this kind of syntax :

    select * from database-coppermine->cpg110_config this causes a mySQL Error ! Because the first dash seems to be considered as a special character !

    To fix this, I will deliver very soon the release 1.3.2 !

    In the meantime, if you have the issue, simply replace in psnGallery2.php (around line 164)

    $info['TBLPREFIX'] = $info['DBNAME'].'.'.$info['TBLPREFIX'];
    with
    $info['TBLPREFIX'] = '`'.$info['DBNAME'].'`.'.$info['TBLPREFIX'];

    This will fix the issue !

  • plugin psnGallery2 version 1.3.1 available for download

    The new version of the psnGallery2 has been released !

    As announced, the new functionnalities are :

    • Display the last uploaded pictures from a specific Coppermine album
    • Display the most viewed pictures from a specific Coppermine album
    • Display the best rated pictures from a specific Coppermine album

    They are available via tags in post and via php functions anywhere else.

    The automatic install script will be soon available…

    (suite…)

  • psnGallery2 1.3.1 soon on your site

    If I have time, the psnGallery2 version 1.3.1 will be available for download tonight (GMT+2).

    It includes few fixes and the 3 new tags described in the previous post.

    I have also scheduled for a near future to improve the install/upgrade procedure, it will be based on the WordPress install/upgrade script.

    The install functionnalities will be :

    • Create the table « psnGallery » if doesn’t exist and/or update the structure if needed.
    • Look for the Coppermine « config.inc.php » to extract the Coppermine configuration data
    • Create/Update all required « psnGallery2 » parameters

    I give no date for this but it could be soon (depending on the free time I will have in the coming days, weeks)

    I will keep you posted on the evolution of that script.

  • psnGallery2 : Syntax clarification : Out of Post

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

    • To display several random pictures from a specific Coppermine album (if -1 : from all albums) : CPGRndPicture($albumid, $count, $nSize,$before,$after, $activelink)
    • Generate tags to display a full album from a specific Coppermine album (if -1 : from all albums)… : CPGAlbum($albumid, $nCols, $nSize, $beforeCol, $afterCol, $beforeRow, $afterRow)
    • Get the name of an album : CPGAlbumName($albumid)
    • Get the name of a category : CPGCategoryName($categoryid)
    • Get the number of pictures within an album : CPGAlbumPicCount($albumid)
    • Get the album name list of a category : CPGAlbumListCategory($categoryid, $count, $nSize, $before, $after)
    • Display a picture (in some modes) : CPGPicture($pictureID, $nSize, $before, $after, $mode, $dummy)
    • Display the specific thumbnail associated with an album : CPGAlbumThumb ($albumid, $nSize, $before, $after)

    Parameters explanation :

    • « $albumid » and the « $pictureid » can be found in the « psnGallery2 » Administration page.
    • « $count » represents the number of pictures to display.
    • « $nSize » is the size of the picture to display (1=thumbnail, 2=normal size and 3 is the fullsize picture)
    • « $before » is the string (HTML) to insert before each picture
    • « $after » is the string (HTML) to insert after each picture
    • « $categoryid » is the category of the album to display
    • « $mode » will display different supplemental information on the picture according the mode (EXIF data, statistic, etc…).
  • psnGallery 2 Sticky information

    What’s that ?

    It provides you an « gateway » between your Coppermine Gallery and your WordPress Blog.

    A lot of functionnalities for your Blog within a post or outside a post !

    How to make it work ?

    The main requirements are to have installed :

    If those applications are up and running, only few steps are required :
    (suite…)