المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : بلوك الاخبار الرائع لمجلة MKPortal


taha2
10-03-2009, 12:33 AM
بلوك الاخبار المطور لمجلة MKPortal

مشاهدة البلوك من هنـــــــــــــــــــــا ([فقط الأعضاء المسجلين والمفعلين يمكنهم رؤية الوصلات])


لتحميل البلوك من هــــــــنـــــــــــا ([فقط الأعضاء المسجلين والمفعلين يمكنهم رؤية الوصلات]*nt.net/vb/attachment.php?attachmenti*=266966&*=1214697007)

طريقة التركيب

1- قم بتحميل *ynamic_***_news.php الى داخل ملف البلوك في المجله على هذا الامتداد "/mkportal/blocks/"


2- قم بتحميل هذا الملف من المجله "mkportal/templates/{yourtemplate}/mkp.js"

yourtemplate = اسم الاستايل المستخدم

في نهاية الملف اضف


//** Kimi a**e* for Dynamic *** News v1.0
//** Tab ******* script v2.0- © Dynamic Drive DHTML co*e library ([فقط الأعضاء المسجلين والمفعلين يمكنهم رؤية الوصلات]*ynamic*rive.com)

////NO NEED TO EDIT BELOW////////////////////////

function **tab*******(tabinterfacei*){
this.tabinterfacei*=tabinterfacei* //ID of Tab Menu main container
this.tabs=*ocument.getElementByI*(tabinterfacei*). getElementsByTagName("a") //Get all tab links within container
this.enabletabpersistence=true
this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr *efine*, relative to all tab links, within container
this.currentTabIn*ex=0 //In*ex of currently selecte* hot tab (tab with sub *******) within hottabspositions[] array
this.sub*******i*s=[] //Array to store i*s of the sub *******s ("rel" attr values)
this.rev*******i*s=[] //Array to store i*s of arbitrary *******s to expan*/contact as well ("rev" attr values)
this.selecte*ClassTarget="link" //keywor* to in*icate which target element to assign "selecte*" CSS class ("linkparent" or "link")
}

**tab*******.get******=function(Name){
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (*ocument.******.match(re)) //if ****** foun*
return *ocument.******.match(re)[0].split("=")[1] //return its value
return ""
}

**tab*******.set******=function(name, value){
*ocument.****** = name+"="+value+";path=/" //****** value is *omain wi*e (path=/)
}

**tab*******.prototype={

expan*it:function(tabi*_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
this.cancelautorun() //stop auto cycling of tabs (if running)
var tabref=""
try{
if (typeof tabi*_or_position=="string" && *ocument.getElementByI*(tabi*_or_position).getAttr ibute("rel")) //if specifie* tab contains "rel" attr
tabref=*ocument.getElementByI*(tabi*_or_position)
else if (parseInt(tabi*_or_position)!=NaN && this.tabs[tabi*_or_position].getAttribute("rel")) //if specifie* tab contains "rel" attr
tabref=this.tabs[tabi*_or_position]
}
catch(err){alert("Invali* Tab ID or position entere*!")}
if (tabref!="") //if a vali* tab is foun* base* on function parameter
this.expan*tab(tabref) //expan* this tab
},

cycleit:function(*ir, autorun){ //PUBLIC function to move fowar* or backwar*s through each hot tab (tabinstance.cycleit('fowar*/back') )
if (*ir=="next"){
var currentTabIn*ex=(this.currentTabIn*ex<this.hottabspositions.length-1)? this.currentTabIn*ex+1 : 0
}
else if (*ir=="prev"){
var currentTabIn*ex=(this.currentTabIn*ex>0)? this.currentTabIn*ex-1 : this.hottabspositions.length-1
}
if (typeof autorun=="un*efine*") //if cycleit() is being calle* by user, versus autorun() function
this.cancelautorun() //stop auto cycling of tabs (if running)
this.expan*tab(this.tabs[this.hottabspositions[currentTabIn*ex]])
},

setpersist:function(bool){ //PUBLIC function to toggle persistence feature
this.enabletabpersistence=bool
},

setselecte*ClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selecte*" CSS class ("linkparent" or "link")
this.selecte*ClassTarget=objstr || "link"
},

getselecte*ClassTarget:function(tabref){ //Returns target element to assign "selecte*" CSS class to
return (this.selecte*ClassTarget==("linkparent".toLowerCase()))? tabref.parentNo*e : tabref
},

urlparamselect:function(tabinterfacei*){
var result=win*ow.location.search.match(new RegExp(tabinterfacei*+"=(\\*+)", "i")) //check for "?tabinterfacei*=2" in URL
return (result==null)? null : parseInt(RegExp.$1) //returns null or in*ex, where in*ex (int) is the selecte* tab's in*ex
},

expan*tab:function(tabref){
var sub*******i*=tabref.getAttribute("rel") //Get i* of sub******* to expan*
//Get "rev" attr as a string of IDs in the format ",john,george,trey,***," to easily search through
var associate*revi*s=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/s+/, "")+"," : ""
this.expan*sub*******(sub*******i*)
this.expan*rev*******(associate*revi*s)
for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, an* assign only the selecte* tab the CSS class "selecte*"
this.getselecte*ClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==sub*******i*)? "selecte*" : ""
}
if (this.enabletabpersistence) //if persistence enable*, save selecte* tab position(int) relative to its peers
**tab*******.set******(this.tabinterfacei*, tabref.tabposition)
this.s***urrenttabin*ex(tabref.tabposition) //remember position of selecte* tab within hottabspositions[] array
},

expan*sub*******:function(sub*******i*){
for (var i=0; i<this.sub*******i*s.length; i++){
var sub*******=*ocument.getElementByI*(this.sub******* i*s[i]) //cache current sub******* obj (in for loop)
sub*******.style.*isplay=(sub*******.i*==sub****** *i*)? "block" : "none" //"show" or hi*e sub ******* base* on matching i* attr value
}
},

expan*rev*******:function(associate*revi*s){
var allrevi*s=this.rev*******i*s
for (var i=0; i<allrevi*s.length; i++){ //Loop through rev attributes for all tabs in this tab interface
//if any values store* within associate*revi*s matches one within allrevi*s, expan* that DIV, otherwise, contract it
*ocument.getElementByI*(allrevi*s[i]).style.*isplay=(associate*revi*s.in*exOf(","+allrevi*s[i]+",")!=-1)? "block" : "none"
}
},

s***urrenttabin*ex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
for (var i=0; i<this.hottabspositions.length; i++){
if (tabposition==this.hottabspositions[i]){
this.currentTabIn*ex=i
break
}
}
},

autorun:function(){ //function to auto cycle through an* select tabs base* on a set interval
this.cycleit('next', true)
},

cancelautorun:function(){
if (typeof this.autoruntimer!="un*efine*")
clearInterval(this.autoruntimer)
},

init:function(automo*eperio*){
var persiste*tab=**tab*******.get******(this.tabinterf acei*) //get position of persiste* tab (applicable if persistence is enable*)
var selecte*tab=-1 //Currently selecte* tab in*ex (-1 meaning none)
var selecte*tabfromurl=this.urlparamselect(this.tabint erfacei*) //returns null or in*ex from: tab*******.htm?tabinterfacei*=in*ex
this.automo*eperio*=automo*eperio* || 0
for (var i=0; i<this.tabs.length; i++){
this.tabs[i].tabposition=i //remember position of tab relative to its peers
if (this.tabs[i].getAttribute("rel")){
var tabinstance=this
this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr *efine*) relative to its peers
this.sub*******i*s[this.sub*******i*s.length]=this.tabs[i].getAttribute("rel") //store i* of sub ******* ("rel" attr value)
this.tabs[i].onclick=function(){
tabinstance.expan*tab(this)
tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
return false
}
if (this.tabs[i].getAttribute("rev")){ //if "rev" attr *efine*, store each value within "rev" as an array element
this.rev*******i*s=this.rev*******i*s.concat(this. tabs[i].getAttribute("rev").split(/s*,s*/))
}
if (selecte*tabfromurl==i || this.enabletabpersistence && selecte*tab==-1 && parseInt(persiste*tab)==i || !this.enabletabpersistence && selecte*tab==-1 && this.getselecte*ClassTarget(this.tabs[i]).className=="selecte*"){
selecte*tab=i //Selecte* tab in*ex, if foun*
}
}
} //END for loop
if (selecte*tab!=-1) //if a vali* *efault selecte* tab in*ex is foun*
this.expan*tab(this.tabs[selecte*tab]) //expan* selecte* tab (either from URL parameter, persistent feature, or class="selecte*" class)
else //if no vali* *efault selecte* in*ex foun*
this.expan*tab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
if (parseInt(this.automo*eperio*)>500 && this.hottabspositions.length>1){
this.autoruntimer=setInterval(function(){tabinstan ce.autorun()}, this.automo*eperio*)
}
} //END int() function

} //END Prototype assignment
//** END Kimi a**e* for Dynamic *** News v1.0




ثم قم بحفظ التغيير و اعادت تحميله


3- قم بفتح style.css على الاتمتداد "mkportal/templates/{yourtemplate}/style.css"

وفي النهاية اضف



/* Kimi a**e* for Dynamic News */
a.selecte*{
font-style: italic;
}
/* En* Kimi a**e* */



والان قد انتهينا من التركيب

ويبقى لدينا ان نقوم بتنشيط البلوك

من لوحة تحكم المجلة -> البلوكات -> *ynamic_***_news

قم بتنشيطه و ضعه في الوسط ومن ثم قم بتغيير السمه مثلا لاسم الاخبار


لكم مني كل التقدير ,,