![]() |
NO images in Post New thread
Is there a hack for this??
|
there is an option in the admin cp to not allow people to upload attachments, you must go under forum permissions and use custom settings for which ever forum you want to restrict it.
|
What I mean is unable to use the IMG tag in Post New Thread. Are you referring to this too?
|
its not possible to do this i dont think, i thought you mean uploading images.
|
This is quick and dirty and not tested, but I think it should work.
In functions.php Find: PHP Code:
PHP Code:
|
Thanks! But what do you mean by quick and dirty???
If it would cause problems, is there a way to just disable the IMG Tag?? :) |
It won't cause problems. Either it will work or it won't. If it doesn't work, just take the code you add out. Quick and dirty means fast and untested, is all. ;) I use code similar to this to disable a vbcode tag I use so no one else can use it.
|
there is really no way to just disable it when making a new thread .. all you can do it pre replace it with nothing, as boofo pointed out.
|
Ok thanks! Ill try it out. So this hack will be able to prevent posting of images in first post??
|
bump
|
Have you tried the above code yet?
|
Not yet! sorry :)
|
I got this error
Parse error: parse error in /www/greenarcher.net/html/forums/admin/functions.php on line 128 Fatal error: Call to undefined function: getuserinfo() in /www/greenarcher.net/html/forums/admin/sessions.php on line 112 |
Not perfect, but will work.
Open newthread.php, find: PHP Code:
PHP Code:
Code:
You cannot use the [img] code with a new thread! |
Shouldnt it be newthread instead of newreply???
|
Oops... yes, it's the same instructions, same code. :)
|
Quote:
if($newthread) { $text = preg_replace("/IMG/i", "", $text); $text = preg_replace("/img/i", "", $text); } |
Im getting a parse error
|
The instructions I gave you are so basic they are error-free.
Redo the hack again from scratch. Post the parse error, and the 10 lines before and after of the code that the parse error specifies. If you still get errors, then there something wrong with the way you are doing it - make sure you use Notepad, not Wordpad, and you're not mucking up the formatting. @ Boofo - not sure what's wrong with your code, looks fine to me. |
Here's the error:
Parse error: parse error in /www/greenarcher.net/html/forums/newthread.php on line 198 Here is part of the code // check max images if ($maximages!=0) { $parsedmessage=bbcodeparse($message,$foruminfo[forumid],$allowsmilie); if (countchar($parsedmessage,"<img")>$maximages) { eval("standarderror(\"".gettemplate("error_toomany images")."\");"); exit; } } if($message,'[img]')) { eval("standarderror(\"".gettemplate("error_noimage snewreply")."\");"); exit; } if($message,'[IMG]')) { eval("standarderror(\"".gettemplate("error_noimage snewreply")."\");"); exit; } |
You are using the WRONG code.
Take a close look at what I posted, then at what you posted. You are missing this bit in crucial places strstr Like I said, redo the hack again. Follow the instructions. Delete the above chunk of code, copy and paste EXACTLY what I posted. |
Ok! but weird cause I just copy and pasted what you posted.
|
I dont see any difference! Mind if you post the code without quoting it? I copy and pasted what you posted and I dont see any differece. :)
|
What you posted:
if($message,'[img]')) { What I posted: if(strstr($message,'[img]')) { Can you see the difference now? |
Here's the code without putting it in a code box.
if(strstr($message,'[img]')) { eval("standarderror(\"".gettemplate("error_noimage snewreply")."\");"); exit; } if(strstr($message,'[IMG]')) { eval("standarderror(\"".gettemplate("error_noimage snewreply")."\");"); exit; } Strange that you can't copy it properly... Let us know if it's a bug. |
Please check what you posted in page 1. This is what I copied:
http://www.greenarcher.net/err.gif Where's the "strstr" ???? Anyway thanks! Im gonna try it out |
Thanks! it works, the problem is when I edit the post and put the IMG tags, the images appears.
|
All times are GMT. The time now is 03:52 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|