简体   繁体   English

Joomla 1.5中的If(作者)语句

[英]If (Author) statement in Joomla 1.5

i need php based if loop where i can in Joomla 1.5 HTML insert php code to find author and when i get that variable i can make IF statement 我需要基于PHP的if循环,在Joomla 1.5 HTML中可以在其中插入php代码以查找作者,当我获取该变量时,我可以进行IF语句

for example 例如

if ($author="a") {
echo "This is author a";
}

elseif ($author="b"){
echo "this is author b";
}

elseif ($author="c"){
echo "this is author c";
}

I do not know how get $author variable (name) from article 我不知道如何从文章中获取$ author变量(名称)

You should use == or === instead of = in if statements 您应该在if语句中使用=====代替=

Example

if ($author == "a") {
    echo "This is author a";
} 

elseif ($author == "b") {
    echo "this is author b";
} 

elseif ($author == "c") {
    echo "this is author c";
}

Or Use Switch 或使用开关

switch ($author) {
    case "a" :
        echo "This is author a";
        break;
    case "b" :
        echo "This is author a";
        break;
    case "c" :
        echo "This is author a";
        break;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM