/    Sign up×
Community /Pin to ProfileBookmark

urgent help needed

have a huge headache as i just cant see whats wrong here ..

options[‘extra_threadfields_active’] == ‘1’){
if (THIS_SCRIPT == “showthread”)
{
$cache = array_merge($cache, array (‘showthread_extra_fields’));}

if (THIS_SCRIPT == “postings”)
{
$cache = array_merge($cache, array (‘newthread_extra_fields’));}

if (THIS_SCRIPT == “newthread”)
{
$cache = array_merge($cache, array (‘newthread_extra_fields’));}

if (THIS_SCRIPT == “forumdisplay” OR THIS_SCRIPT == “se
whats wrong with this

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@gvreMay 18.2011 — Could you post the full source and describe what the problem is? Please, use PHP tags when posting php code (the php icon to the right side of editor).
Copy linkTweet thisAlerts:
@aj_nscMay 18.2011 — Well, just to save a little bit on resources you should probably be using elseif instead just a bunch of if's:

[code=php]
if(THIS_SCRIPT == a) {

} elseif(THIS_SCRIPT == b) {

} elseif(THIS_SCRIPT == c) {

}
[/code]


Your code, as written, will test every if condition it comes across, despite the fact that only one of them could ever actually be true. The code in this reply will stop testing conditions once it finds the first one that evaluates to true.

That probably won't solve your problem, though, because as gvre said, you really didn't provide much of a description of what the problem is.
×

Success!

Help @Frankfurt spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...