Page codeblock

I'm using a page as my homepage and would like to included on this page when new photos are uploaded. I beleive it can be done in the codeblock, but I'm not sure what the code would be to input. I've looked through the user guide and found code for comments, but not new photo items. Can anyone help?

Comments

  • acrylian Administrator, Developer
    Well, there are several options. You can use the printLatestImages() function (see image_album_statistic plugin on the documentation) within a codeblock (if your theme supports it , otherwise you have to add the call to one of the codeblocks yourself).

    Or you use the CombiNews mode for the news section, then new images are mixed between the normal news articles automatically as if they were articles (see the demo for an example)
  • JimL Member
    Thanks acrylian. I ask for your patience with me since I am very new at this and don’t know a thing about writing code, and am having a difficult time undestanding all this, but am anxious to learn. I found the documentation you mentioned, printLatestImages, but when I copied the code line to the codeblock , the code text appears on the page. I'm sure there must be somthing I'm leaving off.
  • acrylian Administrator, Developer
    You have to put `<?php printLatestImages(<number of images>); ?>` into the code, just like on a theme page direclty. Otherwise it is used as plain text. (you can of course use the codeblocks for normal text as well).
  • JimL Member
    Is this the only thing I put in the codeblock: <?php printLatestImages(<number of images>); ?>

    Or do I need to put something else in it? I put that code in, changed <number of images> to <5>, but nothing happens.

    Does is matter which codeblock it goes in? I put the comments code in codeblock2 and was going to put this one in codeblock1. If I'm not mistaken, codeblock1 appears on the right side of page, while codeblock2 shows up at bottom of page. Not sure where codeblock3 shows up.

    If I can't get this to work, how would I do the other option you mentioned, add the call to one of the codeblocks myself?
  • Each codeblock is associated with a differnt "location" on the page. (The location is determined by the theme.) Look for the `printCodeblock(x)` function call. X will be the codeblock number.

    You do, of course, need a real number (5) not `` that is meta notation saying put your number here.
  • JimL Member
    Thanks sbillard, that does work now, the images show up, although in a column and not row. I guess that's the format in the theme also, and I guess I look under the page.php for the theme I'm using to find the printcodeblock x?

    What I'm really trying to do, for example, is put a code in codeblock1 that will display the following: "Username has added 3 photos to the album JimL" and then right below that, show the thumbnails of photos added. I don't know if I'm expecting too much. Since I'm using a "page" as my home page, when a family member adds photos, I want it displayed so everyone will know new photos were added.

    I'm trying to create a family site and I'm currently using the ZPGalleriffic theme, is there another theme that might work better? thanks for the patience.
  • acrylian Administrator, Developer
    1. The calls for the codeblocks are on pages.php and sidebar.php if you use the Zenpage theme. regarding the zpGalleriffic theme I don't know (it is not an official theme).

    2. The addition of the username will needs customizations as that is not supported.
  • Am I reading that correct that you can use php in the codeblock? So if I wanted to I could add

    `
    <?php
    if (function_exists('printUserLogin_out')) {
    printUserLogin_out(" | ");
    }
    ?>
    `
    To a codeblock, then call that codeblock in the specific page I want that on and it should work?

    I ask as I tried it and it did not work, but looking at the source of the page I can see the code as if it was written in plain text.

    GW
  • acrylian Administrator, Developer
    You have to use the `printCodeblock` function. That should execute php code entered. `getCodeblock` just gets the plain content. Btw, with the right TinyMCE configuration you can also use these fields as further content fields.
  • (Question resolved. Not a Zenphoto issue.)
Sign In or Register to comment.