Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Twitter widget : syntax error

 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
SyphX
Smarty n00b


Joined: 27 May 2011
Posts: 2

PostPosted: Fri May 27, 2011 12:24 pm    Post subject: Twitter widget : syntax error Reply with quote

Hello,

I'm french, sorry for my english.
I try to install the Twitter widget (( http://twitter.com/about/resources/widgets/widget_profile )) on my site, there is :

Code:
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 6000,
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#ebebeb',
      color: '#e64824'
    },
    tweets: {
      background: '#f5f5f5',
      color: '#000000',
      links: '#e64824'
    }
  },
  features: {
    scrollbar: false,
    loop: true,
    live: true,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'default'
  }
}).render().setUser('LCMTELE').start();
</script>


It makes me an error message :

Code:
Fatal error: Smarty error: [in index.tpl line 109]: syntax error: unrecognized tag: version: 2, type: 'profile', rpp: 4, interval: 6000, width: 250, height: 300, theme: { shell: { background: '#ebebeb', color: '#e64824' (Smarty_Compiler.class.php, line 446) in /var/www/vhosts/lcm.fr/httpdocs/includes/library/PEAR/Smarty/Smarty.class.php on line 1095


I do not know where I could make a mistake.
Thanks ! Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4683
Location: Hamburg / Germany

PostPosted: Fri May 27, 2011 1:38 pm    Post subject: Reply with quote

see http://www.smarty.net/docsv2/en/language.function.literal.tpl
Back to top
View user's profile Send private message
SyphX
Smarty n00b


Joined: 27 May 2011
Posts: 2

PostPosted: Fri May 27, 2011 1:53 pm    Post subject: Reply with quote

Hey thanks ! It works ! Smile
Back to top
View user's profile Send private message
bfmountain
Smarty n00b


Joined: 17 Aug 2011
Posts: 1

PostPosted: Wed Aug 17, 2011 1:14 pm    Post subject: Similar Twitter widget problem Reply with quote

Hi - I'm trying to use the same Twitter widget and have successfully used {literal} tags to get the script running, but would like to use template tags to set the value of .setUser
Code:
}).render().setUser('LCMTELE').start();
</script>

Have experimented but keep getting syntax errors. Would really appreciate some help. Very Happy
Back to top
View user's profile Send private message
pzuiderent
Smarty n00b


Joined: 01 Nov 2012
Posts: 1

PostPosted: Thu Nov 01, 2012 9:52 pm    Post subject: new twitter widget Reply with quote

I think there is a new twitter widget at the moment wich works. But my pages ar getting real slow due to memory issues I think. This is what I wrote in my footer.tpl:

Quote:

<div id="footer">

<table width="1000">
<tbody>
<tr><th width="250"><h1>Documentation</H1></th><th width="250"><H1>Twitter</H1></th><th width="250"><H1>Follow Us</H1></th><th><h1>Contact</H1></th>
<tr><td>
{if $config.settings.tospage}<li><a href="{linkto page='terms.of.use.php'}">{$lang.termsOfUse}</a></li>{/if}

{if $config.settings.pppage}<li><a href="{linkto page='privacy.policy.php'}">{$lang.privacyPolicy}</a></li>{/if}

{if $config.settings.papage}<li><a href="{linkto page='purchase.agreement.php'}">{$lang.purchaseAgreement}</a></li> {/if}
</td>
<td>
<a class="twitter-timeline" href="https://twitter.com/digins" data-widget-id="264121136428761088">Tweets by @Digins</a>
{literal}
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
{/literal}
<td>
<div>
<a href="http://www.facebook.com/Digins" rel="nofollow" target="_blank"><img src="{$baseURL}/assets/themes/DiginsTheme/socialicons/Facebook-Honey-Suckle.png" alt="Follow Us on Facebook" title="Follow Us on Facebook" /></a>
<a href="http://twitter.com/#!/digins" rel="nofollow" target="_blank"><img src="{$baseURL}/assets/themes/DiginsTheme/socialicons/Twitter-Honey-Suckle.png" alt="Follow Us on Twitter" title="Follow Us on Twitter" /></a>
<a href="http://pinterest.com/digins/" rel="nofollow" target="_blank"><img src="{$baseURL}/assets/themes/DiginsTheme/socialicons/Pinterest-Honey-Suckle.png" alt="Follow Us on Pinterest" title="Follow Us on Pinterest" /></a>
</td></tr>
</tbody>
</table>
</div>


Anyone an idea? Am I doing this right Embarassed ? I would like some help.

kind regads
Peter
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP