vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   NO images in Post New thread (https://vborg.vbsupport.ru/showthread.php?t=51302)

ga.net 04-07-2003 10:51 AM

NO images in Post New thread
 
Is there a hack for this??

Sebastian 04-07-2003 11:14 AM

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.

ga.net 04-07-2003 09:27 PM

What I mean is unable to use the IMG tag in Post New Thread. Are you referring to this too?

Sebastian 04-08-2003 05:25 AM

its not possible to do this i dont think, i thought you mean uploading images.

Boofo 04-08-2003 07:42 AM

This is quick and dirty and not tested, but I think it should work.

In functions.php

Find:

PHP Code:

  if ($enablecensor==and $censorwords!="") { 

ABOVE it add:

PHP Code:

  if($newthread) {
    
$text preg_replace("/IMG/i"""$text);
    
$text preg_replace("/img/i"""$text);
  } 

Also add $newthread to the global line right above this.

ga.net 04-08-2003 08:53 AM

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?? :)

Boofo 04-08-2003 08:57 AM

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.

Sebastian 04-08-2003 11:28 PM

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.

ga.net 04-10-2003 11:49 AM

Ok thanks! Ill try it out. So this hack will be able to prevent posting of images in first post??

ga.net 04-13-2003 08:01 AM

bump

Boofo 04-13-2003 05:31 PM

Have you tried the above code yet?

ga.net 04-14-2003 01:26 PM

Not yet! sorry :)

ga.net 04-17-2003 05:43 AM

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

Erwin 04-17-2003 05:55 AM

Not perfect, but will work.

Open newthread.php, find:

PHP Code:

    // check max images
    
if ($maximages!=0) {
      
$parsedmessage=bbcodeparse($message,$forumid,$allowsmilie);
      if (
countchar($parsedmessage,"<img")>$maximages) {
        eval(
"standarderror(\"".gettemplate("error_toomanyimages")."\");");
        exit;
      }
    } 

Below, add:

PHP Code:

    if(strstr($message,'[img]')) {
      eval(
"standarderror(\"".gettemplate("error_noimagesnewreply")."\");");
      exit;
    }
    if(
strstr($message,'[IMG]')) {
      eval(
"standarderror(\"".gettemplate("error_noimagesnewreply")."\");");
      exit;
    } 

Then, ADD a template called "error_noimagesnewreply" with this content:

Code:

You cannot use the [img] code with a new thread!
That would work.

ga.net 04-17-2003 06:07 AM

Shouldnt it be newthread instead of newreply???

Erwin 04-17-2003 06:12 AM

Oops... yes, it's the same instructions, same code. :)

Boofo 04-17-2003 06:15 AM

Quote:

Today at 02:12 AM Erwin said this in Post #16
Oops... yes, it's the same instructions, same code. :)
I'm just curious...why didn't this work?

if($newthread) {
$text = preg_replace("/IMG/i", "", $text);
$text = preg_replace("/img/i", "", $text);
}

ga.net 04-17-2003 06:42 AM

Im getting a parse error

Erwin 04-17-2003 06:45 AM

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.

ga.net 04-17-2003 06:52 AM

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;
}

Erwin 04-17-2003 07:07 AM

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.

ga.net 04-17-2003 07:11 AM

Ok! but weird cause I just copy and pasted what you posted.

ga.net 04-17-2003 07:17 AM

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. :)

Erwin 04-17-2003 07:21 AM

What you posted:

if($message,'[img]')) {

What I posted:

if(strstr($message,'[img]')) {

Can you see the difference now?

Erwin 04-17-2003 07:22 AM

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.

ga.net 04-17-2003 07:30 AM

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

ga.net 04-17-2003 07:43 AM

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
  • Page Generation 0.01652 seconds
  • Memory Usage 1,775KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete