I'm trying to dynamically generate my own custom tweet button using this line of php.
echo "<li><a href=\"javascript:\" onclick=\"javascript:
popitup('https://twitter.com/share?text=Check%20out%20{$items[$i]
['name']}%20at%20&url=cmplt.st/item/{$items[$i]
['item_id']}&via=cmpltst&counturl=completeset.us/items/{$items[$i]['item_id']}')\"
class=\"twitter\">T</a></li>";
The problem is that the URL parameter isn't showing up in the share box. I'm trying to get the share box to display Check out {item name} at cmplt.st/item/{item'item_id}
where cmplt.st/item/{item'item_id}
links to completeset.us/items/{item_id}
, but it only displays Check out {item name} at
. How can I get the url to actually show up in the tweet?
EDIT:
Here's the popitup function. All it does it pop up the share box in a separate window.
//Function to pop up a new window
function popitup(url) {
newwindow=window.open(url,'name','height=300,width=500');
if (window.focus) {newwindow.focus()}
return false;
}
The problem with the URL not showing up was simply that I didn't have an http:// on the front. For some reason Twitter despises naked domains. I believe that the code they use to parse URLs doesn't recognize addresses that don't have http(s):// on the front. I've found that whenever I'm having a problem with twitter, checking the URLs is a good place to start.