4images Forum & Community

General / Allgemeines => Programming => Topic started by: Sunny C. on March 25, 2011, 06:18:05 PM

Title: if endif - html Tags
Post by: Sunny C. on March 25, 2011, 06:18:05 PM
Hallo zusammen,

in den PHP Dateien kann man ja mit diesen Codeschnipsel abhängig davon was im ACP angegeben wurde einen gewissen Inhalt ein oder ausblenden:
   if($config['test'] == 1)  {
   $test_code .= "Test\n";
   }

Ist das auch irgendwie möglich das man in den HTML Dateien so etwas verwenden kann?
Code: [Select]
{if if($config['test'] == 1).....

Sowas in der Art?!
Title: Re: if endif - html Tags
Post by: MrAndrew on March 26, 2011, 08:05:00 AM
Same question...

Is it possible to show/hide information from code below with next tags: "{if lightbox_list} {endif lightbox_list}"

$sql = "SELECT l.lightbox_image_ids, u.user_id, l.user_id".get_user_table_field(", u.", "user_name")."
FROM (".LIGHTBOXES_TABLE." l, ".USERS_TABLE." u)
WHERE l.lightbox_image_ids LIKE '%$image_id%' AND u.user_id=l.user_id";

$result = $site_db->query($sql);
  $lightbox_row = array();
  while ($row = $site_db->fetch_array($result)) {
    $lightbox_row[] = $row;
  }
  $site_db->free_result($result);
  $num_rows = sizeof($lightbox_row);
if ($num_rows) {
    for ($i = 0; $i < $num_rows; $i++) {
$lightbox_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$lightbox_row[$i]['user_id'])."\">".$lightbox_row[$i]['user_name']."</a>";
if ($i+1 != $num_rows) {
$lightbox_list .= ", ";
}
}
}

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"lightbox_list" => $lightbox_list,

How to create such conditions and difficult it?

Many thanks
Title: Re: if endif - html Tags
Post by: Rembrandt on March 26, 2011, 01:20:00 PM
...Is it possible to show/hide information from code below with next tags: "{if lightbox_list} {endif lightbox_list}"
...

insert below the SQL "$result"
 $lightbox_list="";

mfg Andi
Title: Re: if endif - html Tags
Post by: Sunny C. on March 26, 2011, 05:51:29 PM
Hallo zusammen,

in den PHP Dateien kann man ja mit diesen Codeschnipsel abhängig davon was im ACP angegeben wurde einen gewissen Inhalt ein oder ausblenden:
   if($config['test'] == 1)  {
   $test_code .= "Test\n";
   }

Ist das auch irgendwie möglich das man in den HTML Dateien so etwas verwenden kann?
Code: [Select]
{if if($config['test'] == 1).....

Sowas in der Art?!