Frequently Asked Questions About Page Objects

Can I have/use PHP code in objects?
 
 

If you are using Siteseed version 1.3.2 (or higher) you can.

Calling procedures:

  • On your Interface program call the object with "$evalme=1;". Something like:

    <?
    # call object 12 in dinamic format
    $headline=12;
    $evalme=1; # auto becomes 0 after evaluation of code
    include "object/show.php";
    ?>


    ... and your php code will be evaluated.

  • All global variables are visible to the object code. If you want to use command line parameters (passed in the GET/FORM submited) by users you should preserve their values in your own variables at the top of the Interface program and handle security yourself).
  • Database link is up so you can access data directly
  • You should make objects containing code NOT AVAILABLE to editorial staff (edit them out in your staff configuration settings).
  • You should not mix objects with PHP code and object commands (INSERT...something), otherwise whatever is expanded will be evaluated also. This can actually be usefull if you have a small team of people working on the site and want to give them PHP evaluation inside articles but it's a huge security problem if you do not trust some staff members.

  •  
    Ask for more info / explore this entry in a forum

    How do I place links on the page to articles with the same subject while reading an article?
     
     

    You need to create an object listing a certain number of articles for each subject.

    In your interface use something like:

    <?
    if( $article>0 )
    {
    // get this article topic
    $local_result=mysql_query("select topic from ARTICLEtopic where article=$article LIMIT 0,1");
    if($localrow=@mysql_fetch_object($local_result)) // is there at least one topic for this article?
    {
    $mytopic= $localrow->topic;

    // make a topic relate to a certain page object...
    if($mytopic==1) { $headline=12;} // news - just the last 10 titles
    if($mytopic==2) { $headline=23;} // some of Gods greatest mistakes - just the last 10 titles
    if($mytopic==3) { $headline=23;} // some of Gods greatest mistakes - just the last 10 titles
    if($mytopic==4) { $headline=24;} // more of Gods greatest mistakes - just the last 10 titles
    if($mytopic==5) { $headline=25;} // who is this God person anyway? - just the last 10 titles
    if($mytopic==7) { $headline=44;} // sex in the ants world,
    // etc...

    // show the page object containing the related items...
    include"object/show.php";
    }
    }
    ?>


    This is pseudo code (I have not tested it) but should be pretty close to real thing...

     
    Ask for more info / explore this entry in a forum

    How do I determine the amount of titles to show on a page (object)?
     
     

    You control what articles appear on pages (and how they appear) with page objects. The exception being to display a single article since you can call it directly.

    Check out the page object you are using (editor menu) and http://www.siteseed.org/manual/article20visual1.html for the command reference.

     
    Ask for more info / explore this entry in a forum

    How do I insert multiple page objects/articles in the same interface?
     
     

    Put something like this in the Interface program:

    [...]
    $headline=53; # the number of your page object
    include "object/show.php"
    [...]


    for articles use:

    [...]
    $article=53; # the number of your page object
    include "article/show.php"
    [...]


    You can combine an unlimited number of objects in the same page...

    Note:

  • On versions bellow 1.3.1 of siteseed you should use 'include "headline/show.php"' instead of 'include "object/show.php"'
  • $clean=1; # is required BEFORE your first call to an object on versions of Siteseed previous to 1.0 pre-release 5 if the object is after the main content. If your object is before the main content you need it AFTER the call.

  •  
    Ask for more info / explore this entry in a forum

    How to use this FAQ section

    If you want to explore further or debate one of the answers feel free to do so by following the link presented in its box. Help us improve our FAQ with your participation.

    If a answer to your question is not present already please go straight to one of the other forums:

  • "Other questions" (not yet covered in the FAQ)
  • "Found a bug!"
  • "Wish list" (features you want in Siteseed)
  • "Hackers" (generic forum for people that want to help with code)
  • "Why Siteseed is great..."
  • "Other CMS systems that do something better"
  • "Why Siteseed stinks..."
  • "Security" (report and get help with security problems)

    Rules when posting messages:

  • No HTML/Javascript is allowed. PHP can be entered but not enclose it in "tags" ("<?php", "<?" or ">") or mix it with HTML tags (since they will be stripped from the message). If you want to send code mail it directly to other users with a CC to code@mrnet.pt. If itīs usefull will add it to the faq answer.
  • Do not insult people and be polite.
  • The FAQ/FORUM moderators will delete all messages that are not considered usefull from time to time. This is required to keep the FAQ and forums usefull and readable.
  • Registered users (that have logged into the system) will have their postings on display instantly, anonymous users wont - they must be approved in order to be displayed. Register yourself to get help or to help others faster.

    This FAQ / FORUM does not replace the project mailing list. Join it if you want to get the best possible support from other Siteseed users and hackers.


  • Login:

    Password:




    [New user]
    Other sites:
  • siteseed.org
  • On-line manual

    FAQ
  • Generic
  • Install Windows
  • Install Unix
  • Install OS X
  • Menu Journalist
  • Menu Editor
  • Menu Technical
  • About Interfaces
  • About Objects
  • About Articles
  • About Foruns
  • Import files
  • Import Word
  • Manual
  • Translations
  • Source code
  • External modules
  • License
  • Performance
  • ML siteseed-dev
  • ML siteseed