وهي هاكات مفيدة تتعلق بوضوع بنرات دعائية في المنتدى وهذه روابطها :
1- http://www.vbulletin.org/forum/showt...ghlight=rotate
2- http://www.vbulletin.org/forum/showt...ghlight=rotate
وهي هاكات مفيدة تتعلق بوضوع بنرات دعائية في المنتدى وهذه روابطها :
1- http://www.vbulletin.org/forum/showt...ghlight=rotate
2- http://www.vbulletin.org/forum/showt...ghlight=rotate
__________________
شبكة قلعة العرب
http://www.arabscastle.com
===============
في دمشق كل شي غير!
08-29-01 at 03:04 PM FireFly said this in Post #1
Works with vBulletin v2.2.0!
This hack will allow you to add banners to your categories row (like done on SitePointForum.com - use that as a demo).
You can add / remove sponsors for any category that exists and also on creation (of category) time.
You can specify the name, banner url and the sponsor's site.
Currently it only supports categories from level 1, and only on forum index. -if you want more please tell and I'll see what I can do.
Umm, that's it I think. Installation is fairly easy (and the hack itself didn't take too much time), so you shouldn't have any problems.
Feedback from any kind is very appreciated!
First of all, run the following query
For more info about running queries take a look here or here.كود:ALTER TABLE forum ADD sponsorname VARCHAR(100) not null AFTER cancontainthreads, ADD sponsorimg VARCHAR(100) not null AFTER sponsorname, ADD sponsorurl VARCHAR(255) not null AFTER sponsorimg
Add a custom template, name it forumhome_forumbit_level1_nopost_sponsor and put the following in it:
(You can tweak this for your tables. Playing around with the colspans should be enough though. This is for the default table structure)كود:<tr id="cat"> <td bgcolor="{categorybackcolor}" colspan="2"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont color="{categoryfontcolor}"><b>$forum[title]</b></normalfont></a> <br><smallfont color="{categoryfontcolor}">$forum[description]</smallfont></td> <td bgcolor="{categorybackcolor}" colspan="4"><a href="$forum[sponsorurl]" target="_blank"><img src="{imagesfolder}/$forum[sponsorimg]" border="0" alt="Proudly sponsored by $forum[sponsorname]"></a></td> </tr>
In forum.php (under your admin folder) add
right afterكود PHP:
maketableheader("Sponsors</b> <i>Only supported by categories</i>","",0);
makeinputcode("Sponsor name","sponsorname");
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg");
makeinputcode("Sponsor full URL","sponsorurl");
(around line 121)كود PHP:
makeyesnocode("Count posts made in this forum towards user post counts?","countposts",1);
Still in forum.php, replace
withكود PHP:
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayorder,parentid,
parentlist,allowposting,cancontainthreads,daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
styleoverride,allowratings,countposts,moderateattach)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$moderateattach')");
(around lines 136-147)كود PHP:
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayorder,parentid,
parentlist,allowposting,cancontainthreads,sponsorname,sponsorimg,
sponsorurl,daysprune,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allowsmilies,allowicons,
styleoverride,allowratings,countposts,moderateattach)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','".addslashes($sponsorname)."','".addslashes($sponsorimg)."',
'".addslashes($sponsorurl)."','$daysprune','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode','$aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$moderateattach')");
Still in forum.php, add
right afterكود PHP:
maketableheader("Sponsors</b> <i>Only supported by categories</i>","",0);
makeinputcode("Sponsor name","sponsorname",$forum[sponsorname]);
makeinputcode("Sponsor banner file<br>(your default images folder is added, no need in that)","sponsorimg",$forum[sponsorimg]);
makeinputcode("Sponsor full URL","sponsorurl",$forum[sponsorurl]);
(around line 230)كود PHP:
makeyesnocode("Count posts made in this forum towards user post counts?","countposts",$forum[countposts]);
Still in forum.php, replace
withكود PHP:
$DB_site->query("UPDATE forum
SET
styleid='$styleset', title='".addslashes($title)."', description='".addslashes($description)."',
active='$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,
allowposting='$allowposting', cancontainthreads='$cancontainthreads', daysprune='$daysprune',
newpostemail='".addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
moderatenew='$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
allowimages='$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',
styleoverride='$styleoverride', allowratings='$allowratings', countposts='$countposts',
moderateattach='$moderateattach'
WHERE forumid='$forumid'");
(around lines 261-273)كود PHP:
$DB_site->query("UPDATE forum
SET
styleid='$styleset', title='".addslashes($title)."', description='".addslashes($description)."',
active='$isactive', displayorder='$displayorder', parentid='$parentid', parentlist=$parentlist,
allowposting='$allowposting', cancontainthreads='$cancontainthreads',
sponsorname='".addslashes($sponsorname)."',sponsorimg='".addslashes($sponsorimg)."',
sponsorurl='".addslashes($sponsorurl)."',daysprune='$daysprune',
newpostemail='".addslashes($newpostemail)."', newthreademail='".addslashes($newthreademail)."',
moderatenew='$moderatenew', allowhtml='$aallowhtmlcode', allowbbcode='$aallowbbcode',
allowimages='$aallowimgcode', allowsmilies='$aallowsmilies', allowicons='$aallowicons',
styleoverride='$styleoverride', allowratings='$allowratings', countposts='$countposts',
moderateattach='$moderateattach'
WHERE forumid='$forumid'");
Save and upload forum.php.
In index.php (the main folder) replace this line
with this codeكود PHP:
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
(around line 298)كود PHP:
if ($forum['sponsorimg'] && $forum['cancontainthreads']==0 && $depth==1) {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level1_nopost_sponsor")."\";");
} else {
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");
}
Save and upload index.php.
That's it.
If you did everything correctly (it wasn't very hard, was it?) and I didn't do any mistakes (it's tested alright!, but I might have forgot something to post), you can start adding sponsors to your forum!
__________________
شبكة قلعة العرب
http://www.arabscastle.com
===============
في دمشق كل شي غير!
اسأل الله سبحانه ان يجزيك خيرا ويبارك لك وعليك والحقيقة انك ما قصرت وياليت نقدر رد لك بعض افضالك
ملاحظة : الكود اللي في الاقتباس يجعل الوصول الى زر اضافة رد مستحيل وقمت بنسخ الكود من موضوع آخر لاتمكن من كتابة هذا الرد
![]()
ياليت اللي جربه يعطينا مثال![]()
حاولت تجربة الهاك الأول ولكنه يطلب مني كود الأعلان ، وليس رابط الأعلان ، هل يوجد حل لهذا ؟؟
أو هل يوجد اية طريقة اخرى للأعلان في المنتدى ؟؟؟
__________________
أبو خليفه : كلنا معاك