vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   New Posting Features - Easy Forms - Create a form or multiple forms without php or html knowledge (https://vborg.vbsupport.ru/showthread.php?t=201097)

bananalive 07-17-2009 03:55 PM

Quote:

Originally Posted by Andyrew (Post 1850464)
How do i remove [B][SIZE=3][/SIZE][/B] from a post that appears as a blank space when a user does not fill in an optional question.

Form Hook: Before Submit:

$formoutput = str_replace("[B][SIZE=3][/SIZE][/B]", "", $formoutput);

Andyrew 07-17-2009 05:48 PM

Thanks. :up:

Elenna 07-17-2009 07:27 PM

Thanks again, bananalive! :)

Andyrew 07-19-2009 11:19 AM

Quote:

Originally Posted by bananalive (Post 1850621)
Form Hook: Before Submit:

$formoutput = str_replace("[B][SIZE=3][/SIZE][/B]", "", $formoutput);

Someone has just filled in the form and it still left a space, the above code was not removed from the post. :confused:

BostWick-x 07-19-2009 09:47 PM

I'm sorry if this has already been answered (I did search through the thread), but how would I go about creating a hook that checked to see if a users post count was above 10? I have no PHP knowledge. (At best, all I can do is look at a chunk of code and get the general understanding of what it does)

The reason I ask this is because my forum is dedicated to an online game, and I want to be able to give people the option to create a forum for their clan. I want there to be a minimum post requirement for them to be able to do this, because in the past I have had to check manually and it's sort of a pain for me to do.

Thanks!

Dagothar 07-19-2009 11:58 PM

Quote:

Originally Posted by bananalive (Post 1848591)
Thanks,

You can click the Support Developer in the right hand side of first post of every page. Beneath Mod Information and The Developer.

Ack--thought on some pages I saw a PayPal button, and was only looking for that. :embarassed:
Done. Thanks again!

bananalive 07-20-2009 11:32 AM

Quote:

Originally Posted by Andyrew (Post 1851613)
Someone has just filled in the form and it still left a space, the above code was not removed from the post. :confused:

If you want to remove the question as well look at the bbcode code and text you wish removed and add it exactly into hook where X is:

Form Hook: Before Submit:

$formoutput = str_replace("X", "", $formoutput);

bananalive 07-20-2009 11:34 AM

Quote:

Originally Posted by BostWick-x (Post 1851861)
I'm sorry if this has already been answered (I did search through the thread), but how would I go about creating a hook that checked to see if a users post count was above 10? I have no PHP knowledge. (At best, all I can do is look at a chunk of code and get the general understanding of what it does)

The reason I ask this is because my forum is dedicated to an online game, and I want to be able to give people the option to create a forum for their clan. I want there to be a minimum post requirement for them to be able to do this, because in the past I have had to check manually and it's sort of a pain for me to do.

Thanks!

Add the following php code to Form Hook: Form Start:

PHP Code:

if($vbulletin->userinfo['posts'] < 10)
{
$errormessage "You need 10 posts to use this form.";
eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');



Andyrew 07-20-2009 03:55 PM

1 Attachment(s)
Quote:

Originally Posted by bananalive (Post 1852123)
If you want to remove the question as well look at the bbcode code and text you wish removed and add it exactly into hook where X is:

Form Hook: Before Submit:

$formoutput = str_replace("X", "", $formoutput);

Still not removing anything. :( What i am using is a for sale listing form, and one question is does your item come with a scope. yes/no = radio checkbox.
Then if the answer is no the next question they are told to ignore, but if yes the next question they fill in the type of scope.
So if they choose "no" and don't fill in the type of scope, this is then submitted with a space/gap in the for sale thread, if i click on edit thread i have to remove [b][size=3][/size][/b] from the post to remove the space/gap between the item for sale listing. Maybe i have to tell the form somehow to ignore the next question if the answer is "no"
See pic for example of gap between rows.

BostWick-x 07-20-2009 06:13 PM

Quote:

Originally Posted by bananalive (Post 1852125)
Add the following php code to Form Hook: Form Start:

PHP Code:

if($vbulletin->userinfo['posts'] < 10)
{
$errormessage "You need 10 posts to use this form.";
eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');



Thank you very much, that did the trick. :)


All times are GMT. The time now is 10:11 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.02063 seconds
  • Memory Usage 1,756KB
  • 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
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete