PHP/MYSQL code help to phpnuke block

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   PHP/MYSQL code help to phpnuke block
Diabo
CZ Newbie
Diabo has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 07, 2005
0.00 posts per day
Posts: 8
Points: 300
   
Hi there, im trying to implement some addon to a phpnuke block but i'm having some dificulties...

ok heres what i want, lets suppose i titled something - " this is a test -*" ... notice that "-*", i used that on title name cuz it's a way i'v found to highlight some topics... so i wanted my block to .. if a title has that "-*" he show some msg....

part of the code is

function mostrar_autor($autor) {
if ($title == '-*') {
echo "Review Oficial";
} else {
echo "Não Oficial";
}
}

of course later on i have the call for the $title... though i can't seem to make him distint the one with -* with the ones that don't have it...



Back to top Reply with quote
#2   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 19 year's 19 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 46
Gender: Male
Fav. Sports Team: Da Bears.
Website:
Status: Offline
Joined: Jul 01, 2004
0.04 posts per day
Posts: 288
Points: 15,094
  MSN Messenger 
What kind of difficulties are you having? I missed your question there.




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#3   re: PHP/MYSQL code help to phpnuke block
Diabo
CZ Newbie
Diabo has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 07, 2005
0.00 posts per day
Posts: 8
Points: 300
   
i can't seem to make him distint the one with -* with the ones that don't have it... he echos "Não Oficial" in all of them... meaning he doesnt detect the "-*".



Back to top Reply with quote
#4   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 19 year's 19 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 46
Gender: Male
Fav. Sports Team: Da Bears.
Website:
Status: Offline
Joined: Jul 01, 2004
0.04 posts per day
Posts: 288
Points: 15,094
  MSN Messenger 
Is this the $title:

" this is a test -*"

?




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#5   re: PHP/MYSQL code help to phpnuke block
Diabo
CZ Newbie
Diabo has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 07, 2005
0.00 posts per day
Posts: 8
Points: 300
   
sorta... that was an exemple... like... for instance: " Manchester United - Chelsea -* " i add that " -* " to the titles i want to highlight later on on the block, with that function... though i can't seem to make him echo a different msg to those with the " -* "



Back to top Reply with quote
#6   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 19 year's 19 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 46
Gender: Male
Fav. Sports Team: Da Bears.
Website:
Status: Offline
Joined: Jul 01, 2004
0.04 posts per day
Posts: 288
Points: 15,094
  MSN Messenger 
Well the $title will never be equal to -* because of the other text that comes before that. Maybe you could store a value in your database that would indicate which ones should be bold.




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#7   re: PHP/MYSQL code help to phpnuke block
Diabo
CZ Newbie
Diabo has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 07, 2005
0.00 posts per day
Posts: 8
Points: 300
   
but isn't there a way to make him read the title and if he finds out that -* he echoes?!

someone suggested me this:

if (strpos($title, "-*") === false) {
print("-* not found");
} else {
print("-* found");
}

though all i get is, in this case, not found on all the titles.



Back to top Reply with quote
#8   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
Not sure exactly what your trying to do but this will tell you if the -* is at the end of a variable:


function bold_title($title) {
    global $title;
    if (substr($title, -2) == "-*")
    {
         return 1;
    }
    else
    {
         return 0;
    }
}

$title = 'Test -*';
if (bold_title('$title')) {
    echo "<b>".$title."</b>";
}
else
{
    echo $title;
}




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#9   re: PHP/MYSQL code help to phpnuke block
Diabo
CZ Newbie
Diabo has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: May 07, 2005
0.00 posts per day
Posts: 8
Points: 300
   
That code kinda helped me... i manage to use it for my thing... thanks



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum