Menu

#52 Generalized XML/RSS/HTML output

m7
closed
nobody
None
5
2002-09-19
2002-05-22
No

Could the link and other function specific tags be
moved from the template to the class script?

For instance {ROOTURL}/article.php3?story_id={STORY_ID}
could be
replaced with {LINK} if link were defined in full in
the generator class
as follows (just sample code):

$link = $_PSL['rooturl'] . '/article.php3?story_id=' .
story[$i][story_id];
$mozilla = $_PSL['rooturl'] .
'/backend.php3?view=mozilla&d=0&max=5';
$opml = $_PSL['rooturl'] . '/backend.php3?view=opml';
$template->set_var(array(
'STORY_ID' => $story[$i]["story_id"],
'TITLE' => htmlspecialchars($story[$i]["title"]),
'INTRO_TEXT' => $description,
'LINK' => $link,
'MOZILLA' => $mozilla,
'OPML' => $opml,
'TARGET' => $ary['target'],
'COUNT' => $ary['max'],
'IDX' => $i,
'DATEF' => $story[$i]["date"]
));

PHPSELF would likely be needed, as would definitions
for Mozilla & OPML output.

I think this would be a lot more flexible way to use
these templates. I'm planning to implement them on two
different modules & would like to be able to use the
same set of templates.

Mike

Discussion

  • Joe Stewart

    Joe Stewart - 2002-09-05

    Logged In: YES
    user_id=77269

    Okay, added the LINK placeholder. The Mozilla and Opml
    templates both used the same link, so can be replaced by LINK

    backend.php3,v 1.30 2002/09/05 00:41:57

     
  • Joe Stewart

    Joe Stewart - 2002-09-05
    • status: open --> pending
     
  • Joe Stewart

    Joe Stewart - 2002-09-19
    • status: pending --> closed
     
  • Joe Stewart

    Joe Stewart - 2002-09-19

    Logged In: YES
    user_id=77269

    This feature has been added to the CVS. Please update your
    copy of PHPSlash, or wait for the next release.

     

Log in to post a comment.