• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] Pop-Up Twitter Sharing with PHPVibe

Started by megaman79,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

megaman79Topic starter

Hello PHPVibe,

Can I get some help getting this code working with PHPVibe.
The function of this code is to open a Pop-Up Window (Center Screen)
to Tweet the Video Content.

This code works fine with another site I have, but I want to customize it for PHPVibe also.

<a href="http://twitter.com/intent/tweet?text={$posts.caption|stripslashes}&url={$baseurl}/{$posts.seokey|stripslashes}&via=FotosCatolicas" onClick="return twitter_click(600, 300)" target="_blank" title="Share on Twitter">Share on Twitter</a>


Thanks for the Help!
"Very Happy with PHPVibe"
  •  

PHPVibe A.

<a href="http://twitter.com/intent/tweet?text=<?php echo _html($video->title); ?>&url=<?php echo $canonical; ?>&via=FotosCatolicas" onClick="return twitter_click(600, 300)" target="_blank" title="Share on Twitter"><img src="http://www.yotengofe.com/images/twittears.png"/></a>


twitter_click should be a javascript function defined somewhere from what I can figure out.

megaman79Topic starter

Quote from: Alexander on
<a href="http://twitter.com/intent/tweet?text=<?php echo _html($video->title); ?>&url=<?php echo $canonical; ?>&via=FotosCatolicas" onClick="return twitter_click(600, 300)" target="_blank" title="Share on Twitter"><img src="http://www.yotengofe.com/images/twittears.png"/></a>


twitter_click should be a javascript function defined somewhere from what I can figure out.

Thx Alexander. There a small issue.

If Video Title has strange simbols it will just not work for example.

1. Title: Goool De Dios ( works fine)
2. Title: "Somos del Señor" Canción = Results: https://twitter.com/intent/tweet?text=
3. Title: Agua & Sangre - Solo Gracias = Result: Agua  http://www.video.tucristo.com/video/217/agua-amp-sangre-solo-gracias-a-ti-videoclip-oficial-musica-catolica/ via @FotosCatolicas

As you can see, 1 works. 2. Don't get content, 3. It just get the first word: Agua

Something is missing for special characters.
"Very Happy with PHPVibe"
  •  

PHPVibe A.

Not sure what Twitter accepts,try changing

<?php echo _html($video->title); ?>


to

<?php echo $video->title; ?>


or if it doesn't work to

<?php echo htmlentities($video->title); ?>

megaman79Topic starter

Quote from: Alexander on
Not sure what Twitter accepts,try changing

<?php echo _html($video->title); ?>


to

<?php echo $video->title; ?>


or if it doesn't work to

<?php echo htmlentities($video->title); ?>


Thanks Alexander,

<?php echo $video->title; ?> ( Works fine)

But it doesn't detect the: & characters. If title is: John & Mike
Twitter will just detect: John

Hope there a fix for this type of issue.
"Very Happy with PHPVibe"
  •  

PHPVibe A.


PHPVibe A.

You could try also

<?php  $clear = preg_replace('/[^a-zA-Z0-9\s]/', '', strip_tags(html_entity_decode($video->title))); echo $clear; ?>


Bu this is kinda radical :)

megaman79Topic starter

Quote from: Alexander on
You could try also

<?php  $clear = preg_replace('/[^a-zA-Z0-9\s]/', '', strip_tags(html_entity_decode($video->title))); echo $clear; ?>


Bu this is kinda radical :)

Hello Alexander,

The last code do not detect the following characters.
1. &
2. -
3. ó (spanish character): á é í ó ñ

Agua  Sangre  Solo Gracias A Ti  Videoclip Oficial  Msica Catlica

It should be: Agua & Sangre - Solo Gracias A Ti - Videoclip Oficial  Msica Católica
"Very Happy with PHPVibe"
  •  

PHPVibe A.

Try this, this is kinda the last solution I see...
<?php $clear = preg_replace("/[^\p{Latin}0-9'-]+/u", " ", strip_tags(html_entity_decode($video->title)));
echo $clear; ?>

Similar topics (7)