silver21 122 ارسال شده در مرداد 92 گزارش بازنشر ارسال شده در مرداد 92 چنین افزونه یا کدی وجود داره که عنوان آخرین مطالب (مثلا 10 خبر آخر) در بالای سایت تایپ میشه و بعد چند ثانیه خبر بعدی ، مثل این سایت (آخرین خبرها) که با wp هست و سایتهای خبری؟ نقل قول لینک به ارسال
!Mojtaba 980 ارسال شده در مرداد 92 گزارش بازنشر ارسال شده در مرداد 92 چنین افزونه یا کدی وجود داره که عنوان آخرین مطالب (مثلا 10 خبر آخر) در بالای سایت تایپ میشه و بعد چند ثانیه خبر بعدی ، مثل این سایت (آخرین خبرها) که با wp هست و سایتهای خبری؟سلاماین مورد چندید بار در انجمن مطرح شده1. یک صفحه در قالبتون بسازید به نام news.phpاین کدها رو هم بگذارید توش<?php ?><script>// CREDITS:// Newsticker// By Peter Gehrig// Copyright © 2010 Peter Gehrig. All rights reserved.// Permission given to use the script provided that this notice remains as is.// Additional scripts can be found at [url="http://www.fabulant.com"]http://www.fabulant.com[/url]// IMPORTANT:// If you add this script to a script-library or script-archive// you have to add a highly visible link to// [url="http://www.fabulant.com"]http://www.fabulant.com[/url] on the webpage// where this script will be featuredvar text=new Array()var textlink=new Array()var texttarget=new Array()<?php $recent = new WP_Query("showposts=1"); while($recent->have_posts()) : $recent->the_post();?>text[0]="<?php the_title(); ?>." <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=1");while($recent->have_posts()) : $recent->the_post();?>text[1]="<?php the_title(); ?>." <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=2");while($recent->have_posts()) : $recent->the_post();?>text[2]="<?php the_title(); ?>." <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=3");while($recent->have_posts()) : $recent->the_post();?>text[3]="<?php the_title(); ?>." <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=4");while($recent->have_posts()) : $recent->the_post();?>text[4]="<?php the_title(); ?>." <?php endwhile;wp_reset_query(); ?>// Add a link for each message// Enter "#" if you don't want to link a message (see sample below)<?php $recent = new WP_Query("showposts=1");while($recent->have_posts()) : $recent->the_post();?>textlink[0]="<?php the_permalink(); ?>" <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=1");while($recent->have_posts()) : $recent->the_post();?>textlink[1]="<?php the_permalink(); ?>" <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=2");while($recent->have_posts()) : $recent->the_post();?>textlink[2]="<?php the_permalink(); ?>" <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=3");while($recent->have_posts()) : $recent->the_post();?>textlink[3]="<?php the_permalink(); ?>" <?php endwhile;wp_reset_query(); ?><?php $recent = new WP_Query("showposts=1&offset=4");while($recent->have_posts()) : $recent->the_post();?>textlink[4]="<?php the_permalink(); ?>" <?php endwhile;wp_reset_query(); ?>texttarget[0]="_self"texttarget[1]="_self"texttarget[2]="_self"texttarget[3]="_self"texttarget[4]="_self"var textfont="Arial"var textfontcolor="#333"var textfontcolorrollover="#000"var textfontsize=9var textdecoration="none"var textbgcolor="#eee"var textweight="bold"var textitalic="normal"var textwidth=1000var textheight=28var textpause=3var textborder=1var textbordercolor="#aaaaaa"var speed=70document.write("<table border=0 cellpadding=0 cellspacing=0>")document.write("<tr><td width="+textwidth+" height="+textheight+" valign=top dir=rtl>")var textalign="right"var textvalign="top"var textitalicA=""var textitalicB=""var textweightA=""var textweightB=""var textfontsizeHTML=1var i_mes=0var i_substring=0var i_presubstring=0var i_text=0var textcontent=""var notag=truevar textpresubstring=""var textaftersubstring=""textpause*=1000var browserinfos=navigator.userAgentvar ie4=!document.getElementById&&document.all&&!browserinfos.match(/Opera/)var ie5=document.getElementById&&document.all&&!browserinfos.match(/Opera/)var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/)var opera=browserinfos.match(/Opera/)function gettextcontent() {tablewidth=textwidth-2*textbordertableheight=textheight-2*textbordertextpresubstring=text[i_text].substring(0,i_presubstring)var i_prepre=i_presubstring-1if (i_prepre<0) {i_prepre=0}if (text[i_text].substring(i_prepre,i_presubstring)=="<"){notag=false}if (text[i_text].substring(i_prepre,i_presubstring)==">"){notag=true}if (notag) { textcontent="<table border=0 cellpadding=4 width="+tablewidth+" height="+tableheight+" class=\"mynews\" dir=rtl><tr valign="+textvalign+"><td align="+textalign+">" textcontent+="<a href='"+textlink[i_text]+"' target='"+texttarget[i_text]+"' style='position:relative; font-family:"+textfont+";text-decoration:"+textdecoration+";font-family:"+textfont+";color:"+textfontcolor+";font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+"' onmouseover=\"this.style.color=\'"+textfontcolorrollover+"\'\" onmouseout=\"this.style.color=\'"+textfontcolor+"\'\">" textcontent+=textpresubstring textcontent+="</a>" textcontent+="</td></tr></table>"}}function showtickerNS6() {textcontent="<table border=0 cellpadding=4 width="+textwidth+" height="+textheight+" class=\"mynews\"><tr valign="+textvalign+"><td align="+textalign+">"textcontent+="<a href='"+textlink[i_text]+"' target='"+texttarget[i_text]+"' style='position:relative; font-family:"+textfont+";text-decoration:"+textdecoration+";font-family:"+textfont+";color:"+textfontcolor+";font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+"' onmouseover=\"this.style.color=\'"+textfontcolorrollover+"\'\" onmouseout=\"this.style.color=\'"+textfontcolor+"\'\">"textcontent+=text[i_text]textcontent+="</a>"textcontent+="</td></tr></table>"document.getElementById("ticker").innerHTML=textcontenti_text++if (i_text>=text.length-1) {i_text=0}var timer=setTimeout("showtickerNS6()", 2*textpause)}function showticker() {if (i_substring<=text[i_text].length) { i_substring++ i_presubstring=i_substring-1 if (i_presubstring<0) {i_presubstring=0} gettextcontent() if (ie4) { ticker.innerHTML=textcontent var timer=setTimeout("showticker()", speed) } if (ie5 || opera || ns6) { document.getElementById("ticker").innerHTML=textcontent var timer=setTimeout("showticker()", speed) }}else { clearTimeout(timer) var timer=setTimeout("changetext()", textpause)}}function changetext() {i_substring=0i_presubstring=0i_text++if (i_text>text.length-1) { i_text=0}showticker()}if (ie5 || ns6 || opera) {if (ns6) { textwidth-=2*textborder textheight-=2*textborder}document.write('<div ID="roof" style="position:relative;width:'+textwidth+'px;height:'+textheight+'px;border-style:solid;border-width:'+textborder+'px;border-color:'+textbordercolor+';background-color:'+textbgcolor+'">')document.write('<span ID="ticker" style="position:absolute;top:0px;left:0px;width:'+textwidth+'px;height:'+textheight+'px;"></span>')document.write('</div>')}window.onload=showtickerdocument.write("</td></tr></table>")</script>و در محلی که قراره خبرها دیده بشند<?php include (TEMPLATEPATH . 'news.php'); ?> 2 نقل قول لینک به ارسال
silver21 122 ارسال شده در مرداد 92 مالک گزارش بازنشر ارسال شده در مرداد 92 این اشتباه بود:<?php include (TEMPLATEPATH . 'news.php'); ?>این درست عمل کرد:<?php include (TEMPLATEPATH . '/news.php'); ?> نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .