that might be something strange when I say that I want to encode a URL partially, But I am caught in this situation and it seems that I got no other solution...
here is my code snippet
$url = isset($_GET['u']) ? esc_url($_GET['u']) : '';
$image = isset($_GET['i']) ? $_GET['i'] : '';
maybeappend = '<a href="?ajax=photo_thickbox&i=' + encodeURIComponent(img.src) +
'&u=<?php echo urlencode($url); ?>&height=400&width=500" title=""
class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>';
its taken from wordpress /wp-admin/press-this.php
the issue is, I cant post to my site via Press this
bookmarklet
I searched the google, studied the wordpress forums and found that I need to tweek Press this
button in my bookmark tool bar in broswer..
but for me, that is not a solution,,why? obviously, I cant teach every visitor to do this change in their broswer..so I have to edit my code residing on server...
how can I edit encodeURIComponent(img.src)
and <?php echo urlencode($url); ?>
so it DOES NOT ENCODE HTTP://
part of url,
say I got a url 'http://www.google.com I want it to be encoded as www.google.com
any suggesion?
How can I achieve my goal? might be some regex ? (dont know regex :( )
what would be the code adjustment for this??
thanks for your help..