This little extra feature will let u use those kind of tags in templates:
{ifno tagname1}
{tagname2}
or page content
{endifno tagname1}What does it mean?
It will display whatever is registered in {
tagname2} if {
tagname1} is empty or set as 0
the format is the same as {if
tagname}{
tagname} or whatever else{endif
tagname} but works opposite
For 4images v1.7Open /includes/template.php
Find:
function replace_if($template) {
foreach ($this->key_cache as $key => $val) {
if (empty($this->val_cache[$key]) || $this->val_cache[$key] == REPLACE_EMPTY) {
$reg = "/".$this->start."if[ \t\r\n]+".$key.$this->end."(.*)".$this->start."endif[ \t\r\n]+".$key.$this->end."/siU";
$template = preg_replace($reg, "", $template);
}
}
return $template;
}
Add after:
function replace_ifno($template) {
foreach ($this->key_cache as $key => $val) {
if (!empty($this->val_cache[$key]) && $this->val_cache[$key] != REPLACE_EMPTY) {
$reg = "/".$this->start."ifno[ \t\r\n]+".$key.$this->end."(.*)".$this->start."endifno[ \t\r\n]+".$key.$this->end."/siU";
$template = preg_replace($reg, "", $template);
}
}
return $template;
}
Find:
$template = $this->replace_if ($template);
Add after:
$template = $this->replace_ifno ($template);
Find:
"/".$this->start."endif[ \t\r\n]+[^ \t\r\n".$this->end."]+".$this->end."/",
Add after:
"/".$this->start."ifno[ \t\r\n]+[^ \t\r\n".$this->end."]+".$this->end."/",
"/".$this->start."endifno[ \t\r\n]+[^ \t\r\n".$this->end."]+".$this->end."/",
Find:
$replace_array = array(
Add after, those two lines:
"",
"",
For 4images v1.7.1Please apply
[1.7.1] Conditional tags inside other conditional tags + {ifno ...}{endifno ...} bug fix, which includes {ifno..} feature: