Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 19th, 2006, 6:25 AM   #1
suleiman
Newbie
 
Join Date: Dec 2006
Posts: 1
Rep Power: 0 suleiman is on a distinguished road
Exclamation Replace %2520 with %20?

I'm having a bizarre problem here. In the function that displays tags on a Wordpress blog, I'm trying to modify the code so that the tag list works on every blog instead of only on the main blog (it's a Multi User version of Wordpress).

What I did was declare the variable "$path" and set it to my main blog domain.

Then later on in my function I have this line:

echo '<a href="' . $path . '?c='.$key.'" style="font-size: '.$size.'%"';

The issue is that while this works fine when a user clicks on a Tag category that has no spaces, when a tag category does have spaces then the links point to /random%2520interesting/ instead of /random%20interesting/.

The consequence is that nothing displays anymore for Tag categories with spaces.

I'm desparately trying to figure out what is causing this to fandango. If anyone has any ideas (particularly if you know of a variable I could use to point to the main blog site instead of declaring a new $path variable) then I would truly be much obliged.

Alternatively a string replace function I could run on the above echo command or pass through the $path variable would also rock the boat.

Thanks!


EDIT: I fixed this problem. Apparently by including "www" in the path I was mucking things up. Now I've since taken it out and all is well in the neighborhood

Last edited by suleiman; Dec 19th, 2006 at 6:40 AM. Reason: Fixed
suleiman is offline   Reply With Quote
Old Dec 19th, 2006, 7:03 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I just want to say "thank you" for posting the solution you discovered. Searchers with similar problems may find this thread (although searchers are usually pretty thin on the ground).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
replace space with ' * ' TecBrain C++ 15 Apr 13th, 2005 12:32 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:34 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC