我正在尝试调整我网站中帖子的字符显示,但无论我如何更改代码。它要么截断到 1 个单词,要么出现错误。请帮忙,我该怎么办?
这是代码。
<p style="float:right; margin-top:3px;width:88px;">
{if $short_urls eq "1" OR $short_urls eq "2"}
{insert name=get_short_url value=a assign=takento PID=$posts[i].PID SEO=$posts[i].name}
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$takento}" data-via="{$twitter}" data-hashtags="DailyRantz" data-text="{insert name=strip_special2 value=a assign=cstory2 text=$posts[i].story}{$cstory2}", data-count="horizontal">Tweet</a>
{else}
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$baseurl}/view/{$posts[i].name|stripslashes|replace:' ':'+'}/" data-via="{$twitter}" data-text="You know,.......Want to know my Daily Rantz? Join me and others @" data-count="horizontal" data-hashtags="DailyRantz">Tweet</a>
{/if}
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</p>
我确实添加了代码,但它对我不起作用。有人知道我做错了什么吗?
<div style="float:right;">
<p style="float:left; margin-top:4px; margin-right:10px;">
<a href="javascript:;" onclick="plusToggle('{$posts[i].PID}');"><img src="{$imageurl}/plus_mini.gif"></a>
</p>
{文字}
<p style="float:right; margin-top:3px;width:88px;">
{if $short_urls eq "1" OR $short_urls eq "2"}
{$smarty->assign{'$post[i].PID'}|truncate:100:'...':True;
{insert name=get_short_url value=a assign=takento PID=$posts[i].PID SEO=$posts[i].name}
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$takento}" data-via="{$twitter}" data-hashtags="DailyRantz" data-text="{insert name=strip_special2 value=a assign=cstory2 text=$posts[i].story}{$cstory2}", data-count="horizontal">Tweet</a>
{else}
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{$baseurl}/view/{$posts[i].name|stripslashes|replace:' ':'+'}/" data-via="{$twitter}" data-text="You know,...Want to know my Daily Rantz? Join me and others @" data-count="horizontal" data-hashtags="DailyRantz">Tweet</a>
{/if}
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</p>
请帮忙,非常感谢您的时间。