PDA

View Full Version : need help with a mod for forums


destrugter
06-11-2007, 02:35 AM
ok, i need this code turned into php form...unless there is a way i can save it as a javascript format and have my forums load it on every post that contains it.

it is a hide hack...and yes i know what you are thinking "most hide hacks are used to hide sharez or warez" well after i have fully installed it and it works i will give you the link to my forums to see that i am not using it for that..my forums are about video games and so if someone plays runescape or of the sort, and there is a guide that offers a way to get tons of money fast, then i think that they should post and keep the forum active to see it...here is the code, and if you are helping me with it then please keep the copyright intact and provide your own copyright along with it. code is below it wont fit in code so ill just seperate it.

***************Code***************
<script type='text/javascript'>
//Hidden Content Script By Beta
var _msg = " [<b>You Must Be a registered member and Reply to this thread to view the post. <br>If you are not registered then click <a href=http://z10.invisionfree.com/Game_Zone252/index.php?act=Reg&CODE=00> Here </a> to register</b>] ";
if(location.href.match(/showtopic=(\d+)($|#|&)/i)){
var _loc = RegExp.$1;
_div = document.getElementsByTagName('DIV');
for(e=0;e<_div.length;e++){
if(_div[e].className == 'postcolor' && _div[e].innerHTML.match(/\[hide\](.*?)\[\/hide\]/gim)){
_div[e].innerHTML = _div[e].innerHTML.replace(/\[hide\](.*?)\[\/hide\]/gim,"<span class='message'>" + _msg + "</span><span class='hidden' style='display:none'>$1</span>");
document.write("<iframe src='" + location.href.split('index.php')[0] + "index.php?s=&act=Stats&CODE=who&t=" + _loc + "' width='0px' height='0px' id='dataCheck' onload='javascript:checkData();' name='dataCheck'></iframe>");
}}}
if(location.href.match(/Post&CODE=02&f=\d+&t=(\d+)($|#|&)/i)){
var _loc = RegExp.$1;
_spn = document.getElementsByTagName('SPAN');
for(e=0;e<_spn.length;e++){
if(_spn[e].className == 'postcolor' && _spn[e].innerHTML.match(/\[hide\](.*?)\[\/hide\]/gim)){
_spn[e].innerHTML = _spn[e].innerHTML.replace(/\[hide\](.*?)\[\/hide\]/gim,"<span class='message'>" + _msg + "</span><span class='hidden' style='display:none'>$1</span>");
document.write("<iframe src='" + location.href.split('index.php')[0] + "index.php?s=&act=Stats&CODE=who&t=" + _loc + "' width='0px' height='0px' id='dataCheck' onload='javascript:checkData();' name='dataCheck'></iframe>");
}}}
function checkData(){
if(window.frames['dataCheck']){
checkAll = window.frames['dataCheck'];
var _lks = checkAll.document.getElementsByTagName('A');
var _usr = document.getElementById('userlinks').rows[0].cells[0].getElementsByTagName('A')[0];
for(i=0;i<_lks.length;i++){
if(_lks[i].href.match(/showuser=\d+$/i) && _lks[i].href == _usr.href){
_spn = document.getElementsByTagName('SPAN');
for(a=0;a<_spn.length;a++){
if(_spn[a].className == 'hidden'){
_spn[a].style.display = 'block';
_spn[a-1].style.display = 'none';
}}}}}}
</script>
*******************CODE****************

so if you know a way for my forums to go through my files and find that as a javascript code and it will hide the text until the user posts in that topic then please help me with that...if you wanna make the mod for me then please...but if you want to help me create it then that would be cool also

check back later ^^

wwe
06-11-2007, 04:42 AM
What forum script are you running? There are usually tons of already made hide hacks out there for the forums. (Assuming you're using something popular-ish, like phpBB, vB, IPB, MyBB, SMF, etc.)

destrugter
06-11-2007, 06:12 AM
What forum script are you running? There are usually tons of already made hide hacks out there for the forums. (Assuming you're using something popular-ish, like phpBB, vB, IPB, MyBB, SMF, etc.)

i am using punBB so i guess that is phpBB i have been looking for hide hacks but it only hides from guests...i need it to hide from everyone (as the script says) until they post.

wwe
06-11-2007, 06:40 AM
I'm not sure if there's a way to hide something completely in a post. I've seen those type of Hide Hacks, but a lot of them have a hole in there that when you quote the first post, you see the content.

I am not too familiar with punBB so I'm not sure if there's a mod out there for it. There probably is though, since that's a major one people ask for most of the time.

destrugter
06-11-2007, 06:44 AM
I'm not sure if there's a way to hide something completely in a post. I've seen those type of Hide Hacks, but a lot of them have a hole in there that when you quote the first post, you see the content.

I am not too familiar with punBB so I'm not sure if there's a mod out there for it. There probably is though, since that's a major one people ask for most of the time.

i have been googling since i started my forums which was probably on friday...and i cannot find one that is supported with this version..punBB is just phpBB...do you think there is a way for me to put in one of the php files that everytime a topic is opened to read the javascript file and i upload the javascript file too my site?

wwe
06-11-2007, 09:03 PM
Well I've been doing a quick search and can't find anything either. Hmm...

I suggest you just go ahead and try things out. If they work, then yay, if they don't, then oh well. Maybe there's a Spoiler type mod out there for punBB?

Oh and punBB isn't phpBB. They're very a like but not the same.

destrugter
06-12-2007, 01:41 AM
well there is a spoiler code but this would allow the user to simply click a button to reveal the guides...which i would like them to post instead ^^

well like i asked before is there a way i can save this as a js file upload it too my site and have it to where everytime a topic is opened when the words appear they replace it with the code i put above which comes out too

[You must be a registered user and post in this topic to view the hidden content. If you are not registered click here to register.]

cr0wonline
06-12-2007, 09:58 PM
Why use JS? The user could simply disable JS or look in the source to see the content.

I think that directly in the PHP file that displays posts, replace the echo statement that displays the post with:
echo (($userInfo['posts']>=50) ? $row['post'] : preg_replace("/\[hide\](.+?)\[\/hide\]/i","",$row['post']));

Of course, replacing the variables and column names with the ones used in the forum code.

destrugter
06-13-2007, 02:22 AM
what would i replace that code with?

EDIT: Nevermind....where would the code be? parser, index, ?