Is it possible? Doesn anyone have a clue how such thing can be implemented, so if someone takes the quiz can post the results (with a link to the test) on twitter, or even facebook?
Post results in twitter?
(5 posts) (2 voices)-
Posted 2 months ago #
-
Hah, I made it... just needed to add some javascript provided by twitter itself, and it's working!
Posted 2 months ago # -
Can you post the code here? It might be helpful to others.
Posted 2 months ago # -
I just added in show_quiz.php, after this line:
print str_replace($replace_these, $with_these, stripslashes($quiz_details->final_screen));this code:
print ('
<center><font color="##FFFF40"><b>Post your results on Tweeter: </b></font> <a href="https://twitter.com/share" class="twitter-share-button"');
print ('data-url="http://goo.gl/a3tyk"');
print ('data-counturl="http://www.jogabrasil.com.br/2011/12/01/quiz_jogos_brasileiros/"');
print ('data-lang="en"');
print ('data-text="I scored ' .$quiz_score.' of ' .$quiz_total. ' questions! My result is "' .$quiz_rating.'"! Take the quiz you too!"');
print ('data-hashtags="#JogaBrasil"');
print ('data-count="vertical">Post your results on Tweeter!</center>');
print ('<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElements);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>');
it's basically a bunch of print's with the javascript provided by tweeter - no big deal.
Btw: I would really like some fix for the 'missing sub-menu' problem... :(
Posted 1 month ago # -
Ouch, I don't know why I wrote 'Tweeter' so many times :P
Of course the site is Twitter :P~Posted 1 month ago #
Reply
You must log in to post.