I need help to Truncate Map Names in php 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   I need help to Truncate Map Names in php block
CozmicShredder
CZ Newbie
CozmicShredder has been a member for over 20 year's 20 Year Member
usa.gif michigan.gif
Occupation: Robot Tech
Age: 58
Gender: Male
Website:
Status: Offline
Joined: Oct 06, 2004
0.00 posts per day
Posts: 13
Points: 4,883
AIM Address Yahoo Messenger MSN Messenger 
I need to truncate the map name could you please help?

I guess the part I am confused about is this .$server->mMap().


Here is an example of the line I need to ajust:



$content .= "<p align=center><br>Map: <font color=red >".$server->mMap()."</font><br>";

I am using madquery.php

I have a few maps that are extreemly long names I just want to show part of the map name.



Back to top Reply with quote
#2   re: I need help to Truncate Map Names in php block
CozmicShredder
CZ Newbie
CozmicShredder has been a member for over 20 year's 20 Year Member
usa.gif michigan.gif
Occupation: Robot Tech
Age: 58
Gender: Male
Website:
Status: Offline
Joined: Oct 06, 2004
0.00 posts per day
Posts: 13
Points: 4,883
AIM Address Yahoo Messenger MSN Messenger 
Ok I tried messing with this:

Example:

if(strlen($session[uname]) > 15) {
$session[uname2] = substr($session[uname],0,15);
$session[uname2] .= "..";

But I have no clue how to implement it with:


$content .= "<p align=center><br>Map: <font color=red >".$server->mMap()."</font><br>";

Can anyone help me?



Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   

$server_map = $server->mMap();
if(strlen($server_map) > 15) {
   $server_map = substr($server_map,0,15);
        $server_map .= "...";
}
echo "$server_map";




_________________
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
#4   re: I need help to Truncate Map Names in php block
CozmicShredder
CZ Newbie
CozmicShredder has been a member for over 20 year's 20 Year Member
usa.gif michigan.gif
Occupation: Robot Tech
Age: 58
Gender: Male
Website:
Status: Offline
Joined: Oct 06, 2004
0.00 posts per day
Posts: 13
Points: 4,883
AIM Address Yahoo Messenger MSN Messenger 
I am honored thank you kindly!icon_smile.gif

It worked great but it prints the map name on top of the block.

So what posibly can I do to print the map name in the proper location?

I might find the answer I am going to look at all my blocks and see what I can add..

But I do apreciate your help I am glad to have gotten this far! icon_smile.gif



Back to top Reply with quote
#5   
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 
If this:
$content .= "<p align=center><br>Map: <font color=red >".$server->mMap()."</font><br>";


displays the map name, then change it to

$content .= "<p align=center><br>Map: <font color=red >".$server_map."</font><br>";
placing tellis code above it and remove the line with "echo" in it.


Back to top Reply with quote
#6   re: I need help to Truncate Map Names in php block
CozmicShredder
CZ Newbie
CozmicShredder has been a member for over 20 year's 20 Year Member
usa.gif michigan.gif
Occupation: Robot Tech
Age: 58
Gender: Male
Website:
Status: Offline
Joined: Oct 06, 2004
0.00 posts per day
Posts: 13
Points: 4,883
AIM Address Yahoo Messenger MSN Messenger 
My God you guys are awsome! icon_smile.gif



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