Frequently Asked Questions About Interfaces

How do I know the context (subject) from a certain article to change stuff on the interface?
 
 

Just hit the database and ask for it...

[...]
<?
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;

// want to get the "subject" name also?
$local_result=mysql_query("select legenda =from ARTICLEtopictxt where serial=$mytopic LIMIT 0,1");

if($localrow=@mysql_fetch_object($local_result)) // get the topic name
{
$topicname=$localrow->legenda;
}
}
}
?>
[...]


Then you can do something like:

[...]
<title>SIC.Online - <? if ($article>0) print "$topicname"; else print"$area_name"; ?></title>
[...]


Or something like:

[...]
if($mytopic=1) { $bgcolor="#00000"; [... more stuff per tematic area ...] }
else if ($mytopic=2) { $bgcolor="#00000"; [... more stuff per tematic area ...] }
[...]


And so on...

Note:

  • In siteseed you allways have on of three things available to determine contect: $id, $headline or $article. Use them to recreate the interfaces in real time based on current content being displayed.

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

    How do I print the current section and the path that leads to it?
     
     

    To get a menu and print sub section try something like

    <?

    # prints sub areas
    $query = mysql_query ("SELECT id, name FROM areas WHERE parent=$id ORDER BY weight");

    if (mysql_num_rows($query)) {
    ?>
    <table border=0 cellspacing=0 cellpadding=0 bgcolor=#FFFFFF align="center">
    <tr>
    <td>
    <table border=0 cellspacing=1 cellpadding=0 align="center">
    <tr bgcolor=#FFFFFF>
    <?
    $num_areas = mysql_num_rows($query);
    $largura = 100/$num_areas;
    $itens_barra = 1;

    while (list($child_id, $child_name) =mysql_fetch_row($query)) {

    $child_name = htmlentities (StripSlashes($child_name));

    print "<td>".
    "<font color=#FF9900 face='Verdana, Arial, Sans-Serif' size=1>".
    "<b><a href='index.php?id=$child_id'>$child_name</a></b>".
    "</font></td>";

    if ($itens_barra!=$num_areas) { print "<td
    align=center> | </td>";}
    if ($itens_barra==5) { print "</tr><tr
    bgcolor=#FFFFFF>"; $itens_barra = 1; }
    else $itens_barra ++;
    }

    ?>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <?
    }
    ?>


    The tables are only for obtain the output. You can edit the html code to obtain another look.

     
    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 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