چه جوری عنوان آخرین ارسال های انجمن در فروم به صورت اسپید بار رو بزارم؟؟؟
عنوان آخرین ارسال های انجمن در فروم به صورت اسپید بار!!!
آغاز شده توسط
aftab design
, 1388/05/14 ساعت 13:34
3 پاسخ برای این موضوع
#4
ارسالی 1388/05/15 ساعت 11:04
اگه منظورتون آخرین ارسال های انجمن هست بصورت افکت دار مانند دمو زیر از روش زیر استفاده کنید
دمو
برای اینکار فایل forum.php تو روت اصلی رو باز کن
این کد ها رو پیدا کن
بالای کدهای قبل این کدها رو قرار بده
$sql_posts = $db->query("SELECT tid, title, last_date, post, views, last_poster_name FROM ". PREFIX . "_forum_topics ORDER BY last_date DESC LIMIT 0,10");
while($row2 = $db->get_row($sql_posts))
{
$topictitle = stripslashes($row2['title']);
$idtopic = $row2['tid'];
$link = "/forum.php?do=forum&showtopic={$idtopic}";
$topictitle2 .= '"'.$topictitle.'",';
$link2 .= '"'.$link.'",';
}
$tpl->set('{topic_title)', $topictitle2);
$tpl->set('{topic_link}', $link2);
خوب حالا فایل templates/Default/forum/mainforum.tpl رو باز کن کد زیر رو پیدا کن
بالای کد بالا این کد رو قرار بده
<script type="text/javascript" language="javascript">
var theSummaries = new Array({topic_title)"");
var theSiteLinks = new Array({topic_link}"");
</script>
تو همین فایل, پایین کد {info}{content} کد های زیر رو قرار بدید
<script type="text/javascript" language="javascript">
// Control parameters
var theCharacterTimeout = 60;
var theStoryTimeout = 3000;
var theWidgetOne = "-";
var theWidgetTwo = " ";
var theWidgetNone = "";
var theItemCount = theSummaries.length;
var NS6=(document.getElementById && !document.all) ? true : false;
// Ticker startup
function startTicker()
{
// Define run time values
theCurrentStory = -1;
theCurrentLength = 0;
// Locate base objects
if (document.getElementById) {
runTheTicker();
}
else {
document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
return true;
}
}
// Ticker main run loop
function runTheTicker()
{
var myTimeout;
// Go for the next story data block
if(theCurrentLength == 0)
{
theCurrentStory++;
theCurrentStory = theCurrentStory % theItemCount;
theStorySummary = theSummaries[theCurrentStory];
theTargetLink = theSiteLinks[theCurrentStory];
}
var textTitle = theStorySummary.substring(0,theCurrentLength) + whatWidget();
if (theTargetLink ) {
if (NS6) {
document.getElementById("theTicker").innerHTML = '<a href="'+ theTargetLink +'" target="_blank" class="tick">'+textTitle+'</a>';
}
else {
document.all.theTicker.innerHTML = '<a href="'+ theTargetLink +'" target="_blank" class="tick">'+textTitle+'</a>';
}
}
else {
if (NS6) {
document.getElementById("theTicker").innerHTML = '<span class="tickertext">'+textTitle+'</span>';
}
else {
document.all.theTicker.innerHTML = '<span dir=rtl" class="tickertext">'+textTitle+'</span>';
}
}
// Modify the length for the substring and define the timer
if(theCurrentLength != theStorySummary.length)
{
theCurrentLength++;
myTimeout = theCharacterTimeout;
}
else
{
theCurrentLength = 0;
myTimeout = theStoryTimeout;
}
// Call up the next cycle of the ticker
setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
if(theCurrentLength == theStorySummary.length)
{
return theWidgetNone;
}
if((theCurrentLength % 2) == 1)
{
return theWidgetOne;
}
else
{
return theWidgetTwo;
}
}
startTicker();
</script>
حالا اگه میخوای بالای اسپید بار تو انجمن این لینک رو نشون بده فایلtemplates/Default/forum/main.tpl رو باز کن
کد زیر رو رو پیدا کن
<div style="font-size: 12px; font-weight: bold;"><img src="{THEME}/forum/images/nav.gif" border="0" width="10px" height="10px" /> {BOARD HEADER**}</div>
بالای کد بالا این کد رو قرار بده
<div style="border: 1px solid silver; text-align: right; padding: 5px;" dir="rtl" class=stext><span style="font:11px tahoma;" id="theTicker"></span></div>
حالا اگه منظورت اسپید بار یا همون مسیر کاربر تو انجمن هست میتونید داخل فایل templates/Default/forum/mainforum.tpl از کد {**BOARD HEADER} بدون ** استفاده کنید و داخل فایل templates/Default/forum/mainforum.tpl هم میتونید از کد {speedbar} استفاده کنید
دمو
برای اینکار فایل forum.php تو روت اصلی رو باز کن
این کد ها رو پیدا کن
$tpl->set('{AJAX}', $ajax);
بالای کدهای قبل این کدها رو قرار بده
$sql_posts = $db->query("SELECT tid, title, last_date, post, views, last_poster_name FROM ". PREFIX . "_forum_topics ORDER BY last_date DESC LIMIT 0,10");
while($row2 = $db->get_row($sql_posts))
{
$topictitle = stripslashes($row2['title']);
$idtopic = $row2['tid'];
$link = "/forum.php?do=forum&showtopic={$idtopic}";
$topictitle2 .= '"'.$topictitle.'",';
$link2 .= '"'.$link.'",';
}
$tpl->set('{topic_title)', $topictitle2);
$tpl->set('{topic_link}', $link2);
خوب حالا فایل templates/Default/forum/mainforum.tpl رو باز کن کد زیر رو پیدا کن
{info}{content}
بالای کد بالا این کد رو قرار بده
<script type="text/javascript" language="javascript">
var theSummaries = new Array({topic_title)"");
var theSiteLinks = new Array({topic_link}"");
</script>
تو همین فایل, پایین کد {info}{content} کد های زیر رو قرار بدید
<script type="text/javascript" language="javascript">
// Control parameters
var theCharacterTimeout = 60;
var theStoryTimeout = 3000;
var theWidgetOne = "-";
var theWidgetTwo = " ";
var theWidgetNone = "";
var theItemCount = theSummaries.length;
var NS6=(document.getElementById && !document.all) ? true : false;
// Ticker startup
function startTicker()
{
// Define run time values
theCurrentStory = -1;
theCurrentLength = 0;
// Locate base objects
if (document.getElementById) {
runTheTicker();
}
else {
document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
return true;
}
}
// Ticker main run loop
function runTheTicker()
{
var myTimeout;
// Go for the next story data block
if(theCurrentLength == 0)
{
theCurrentStory++;
theCurrentStory = theCurrentStory % theItemCount;
theStorySummary = theSummaries[theCurrentStory];
theTargetLink = theSiteLinks[theCurrentStory];
}
var textTitle = theStorySummary.substring(0,theCurrentLength) + whatWidget();
if (theTargetLink ) {
if (NS6) {
document.getElementById("theTicker").innerHTML = '<a href="'+ theTargetLink +'" target="_blank" class="tick">'+textTitle+'</a>';
}
else {
document.all.theTicker.innerHTML = '<a href="'+ theTargetLink +'" target="_blank" class="tick">'+textTitle+'</a>';
}
}
else {
if (NS6) {
document.getElementById("theTicker").innerHTML = '<span class="tickertext">'+textTitle+'</span>';
}
else {
document.all.theTicker.innerHTML = '<span dir=rtl" class="tickertext">'+textTitle+'</span>';
}
}
// Modify the length for the substring and define the timer
if(theCurrentLength != theStorySummary.length)
{
theCurrentLength++;
myTimeout = theCharacterTimeout;
}
else
{
theCurrentLength = 0;
myTimeout = theStoryTimeout;
}
// Call up the next cycle of the ticker
setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
if(theCurrentLength == theStorySummary.length)
{
return theWidgetNone;
}
if((theCurrentLength % 2) == 1)
{
return theWidgetOne;
}
else
{
return theWidgetTwo;
}
}
startTicker();
</script>
حالا اگه میخوای بالای اسپید بار تو انجمن این لینک رو نشون بده فایلtemplates/Default/forum/main.tpl رو باز کن
کد زیر رو رو پیدا کن
<div style="font-size: 12px; font-weight: bold;"><img src="{THEME}/forum/images/nav.gif" border="0" width="10px" height="10px" /> {BOARD HEADER**}</div>
بالای کد بالا این کد رو قرار بده
<div style="border: 1px solid silver; text-align: right; padding: 5px;" dir="rtl" class=stext><span style="font:11px tahoma;" id="theTicker"></span></div>
حالا اگه منظورت اسپید بار یا همون مسیر کاربر تو انجمن هست میتونید داخل فایل templates/Default/forum/mainforum.tpl از کد {**BOARD HEADER} بدون ** استفاده کنید و داخل فایل templates/Default/forum/mainforum.tpl هم میتونید از کد {speedbar} استفاده کنید
1 کاربر در حال خواندن این موضوع است
0 کاربر، 1 مهمان و 0 عضو مخفی