vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Forms Hack (https://vborg.vbsupport.ru/showthread.php?t=93970)

Abe1 12-16-2005 11:54 AM

Quote:

Originally Posted by utw-Mephisto
Just a question for understanding, to change the actuall look of the created form I need to modify the template ?

Yes.

BiReL41r 12-16-2005 07:51 PM

Wow, yet another great hack. Best hack for applications to a website.

dsotmoon 12-17-2005 07:06 PM

wow, how have i missed this all this time, will install today, thanks

silurius 12-17-2005 07:48 PM

Abe did you post a PayPal link? I'd like to tip as this has been a great help to my project.

Abe1 12-17-2005 09:44 PM

Quote:

Originally Posted by silurius
Abe did you post a PayPal link? I'd like to tip as this has been a great help to my project.

Thanx alot, it would be appreciated. I just posted a link in the main post.

cclaerhout 12-18-2005 12:51 PM

Quote:

Originally Posted by Abe1
Thanx alot, it would be appreciated. I just posted a link in the main post.

Thanks for this great hack.
I have just a little question

When i'm connected as a guest and try to submit the form :
email sending is working
pm sending is not working
opening a new thread in a specified forum is not working.

But all theses tree functions are working if i'm connected as a member.

I've given guests the ability to "open" new threads in the specified forum (but they still can't see the forum), but it still doesn't work.

And i don't know why PM sending by a guest don't work.

Where did i make a mistake ? ;)

Abe1 12-18-2005 03:09 PM

Quote:

Originally Posted by cclaerhout
Thanks for this great hack.
I have just a little question

When i'm connected as a guest and try to submit the form :
email sending is working
pm sending is not working
opening a new thread in a specified forum is not working.

But all theses tree functions are working if i'm connected as a member.

I've given guests the ability to "open" new threads in the specified forum (but they still can't see the forum), but it still doesn't work.

And i don't know why PM sending by a guest don't work.

Where did i make a mistake ? ;)

I never realy did tests with Guests. I will soon try to by pass all the vb permissions but still use their functions so everything goes smoothly.

Guests can't send PM's as far as I know.

Spinball 12-18-2005 05:06 PM

Apologies, Abe (and others), but I need a bit of help, please.
I want to call the form with a passed forum number.
I have put the variable in thus:
PHP Code:

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'advert_type' => TYPE_STR,
'advert_title' => TYPE_STR,
'location' => TYPE_STR,
'confirmation' => TYPE_STR,
'f' => TYPE_STR
));

// Part 2
$advert_type $vbulletin->GPC['advert_type'];
$advert_title $vbulletin->GPC['advert_title'];
$location $vbulletin->GPC['location'];
$confirmation $vbulletin->GPC['confirmation'];
$f $vbulletin->GPC['f']; 

and
PHP Code:

$formforumid $f;
if (
strlen($formforumid) == 0) {
   
$errormessage $vbulletin->userinfo['username'] . ", Fatal Error - please contact admin and tell them the formforumid variable was blank when trying to create a new classified advert.  Thanks!";
   eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
   exit();


Yet when I call the script thus:
http://www.avforums.com/forums/newth...eds_form&f=115
I get the error message.
If I hard code the forum number in, it works perfectly.
Why is $f null?
Thanks in advance.

Abe1 12-18-2005 05:51 PM

Quote:

Originally Posted by Spinball
Apologies, Abe (and others), but I need a bit of help, please.
I want to call the form with a passed forum number.
I have put the variable in thus:
PHP Code:

// Part 1
$vbulletin->input->clean_array_gpc('p', array(
'advert_type' => TYPE_STR,
'advert_title' => TYPE_STR,
'location' => TYPE_STR,
'confirmation' => TYPE_STR,
'f' => TYPE_STR
));

// Part 2
$advert_type $vbulletin->GPC['advert_type'];
$advert_title $vbulletin->GPC['advert_title'];
$location $vbulletin->GPC['location'];
$confirmation $vbulletin->GPC['confirmation'];
$f $vbulletin->GPC['f']; 

and
PHP Code:

$formforumid $f;
if (
strlen($formforumid) == 0) {
   
$errormessage $vbulletin->userinfo['username'] . ", Fatal Error - please contact admin and tell them the formforumid variable was blank when trying to create a new classified advert.  Thanks!";
   eval(
'print_output("' fetch_template('STANDARD_ERROR') . '");');
   exit();


Yet when I call the script thus:
http://www.avforums.com/forums/newth...eds_form&f=115
I get the error message.
If I hard code the forum number in, it works perfectly.
Why is $f null?
Thanks in advance.

You can't use 'f'. It is reserved for a fourmid.

cclaerhout 12-18-2005 05:55 PM

Quote:

Originally Posted by Abe1
You can't use 'f'. It is reserved for a fourmid.

Thanks for your answer Abe1. I'm waiting after your tests :)

Spinball 12-18-2005 07:45 PM

Quote:

Originally Posted by Abe1
You can't use 'f'. It is reserved for a fourmid.

I'm trying to use it as the forumid as per your suggestion in the code
Quote:

//FORUM TO POST NEW THREAD IN
//You CAN make this number a variable. You can have a drop down menu or in the link like do=form&f=1. Make sure you add it the variables list.
and use 'f' to post the new thread in the forum with id 'f'.
And indeed if I change 'f' to 'post_to_forum' it still fails.
:confused:

Abe1 12-18-2005 08:56 PM

Quote:

Originally Posted by Spinball
I'm trying to use it as the forumid as per your suggestion in the code

and use 'f' to post the new thread in the forum with id 'f'.
And indeed if I change 'f' to 'post_to_forum' it still fails.
:confused:

OK.

Skip the f part and automaticly if you do f= in the url, the varible $forumid will equal it. dont add it to the part on2 and part 2.

WNxWakko 12-18-2005 09:06 PM

There must be a way to get this form to allow people not registered on the board to submit it. PLEASE!!!

Spinball 12-18-2005 09:16 PM

Quote:

Originally Posted by Abe1
OK.

Skip the f part and automaticly if you do f= in the url, the varible $forumid will equal it. dont add it to the part on2 and part 2.

Thanks. That got the page up, but when I posted the form I got
Quote:

Warning: Cannot use a scalar value as an array in /includes/functions_newpost.php on line 331
Sorry to be a pain, but any ideas?

Abe1 12-18-2005 09:18 PM

Quote:

Originally Posted by Spinball
Thanks. That got the page up, but when I posted the form I got

Sorry to be a pain, but any ideas?

Nope. Just make sure you dont have any where you are change what f or forumid equals to.

WNxWakko 12-18-2005 09:56 PM

Ok I have a new question for ya.

I have a custom profile field field41 that is a dropdown menu with over 40 games listed. I use that to display what games members are playing.

So lets say I want that field to show up in your form, same dropdown list of those games, but it pull the games you can select from the list of the custom profile field. How or can this be done?

Abe1 12-18-2005 09:58 PM

Quote:

Originally Posted by WNxWakko
Ok I have a new question for ya.

I have a custom profile field field41 that is a dropdown menu with over 40 games listed. I use that to display what games members are playing.

So lets say I want that field to show up in your form, same dropdown list of those games, but it pull the games you can select from the list of the custom profile field. How or can this be done?

It mostlkly can be done just I dont have time right no.You would need a query that pulls the info and format it for the form.

Daniel 12-19-2005 03:35 AM

How do you remove certain fields? I mean, I deleted them from the customization, but they're there but blank.

SLGR 12-19-2005 03:40 AM

I was looking forward for this hack.
I will read the thread and will install as soon as a finish upgrading to 3.5.2
Anyway, clicking install right now!

Spinball 12-19-2005 08:31 AM

Quote:

Originally Posted by Abe1
Nope. Just make sure you dont have any where you are change what f or forumid equals to.

Ah. Yes I do do that.
We have different forums for 'Wanted' adverts and 'For Sale' adverts.
If someone posts from either and selects the other option (i.e. posts a 'Wanted' advert from the 'For Sale' forum) then I (rather usefully, I thought) change the forumid so that the advert goes tot he right place.
PHP Code:

      if ($formforumid == 62) {
         if (
$advert_type == "Wanted:") {
            
$formforumid 198;
         }
      } elseif (
$formforumid == 198) {
         if (
$advert_type == "For Sale:" or $advert_type == "For Trade:") {
            
$formforumid 62;
         }
      } 

however I don't think that is the problem here since I am posting into forum 115.
I guess I'll have to struggle through it. Unless anyone can throw me a rope?
Thanks

pipin 12-19-2005 09:14 AM

Similar thing like Spinball:

Wondering if i cant add the threadid in the form call like do=form&threadid=123766 to post the answers in that thread.
any change that i can adjust it to it and a hint - if possible - how?

Abe1 12-19-2005 12:04 PM

Quote:

Originally Posted by pipin
Similar thing like Spinball:

Wondering if i cant add the threadid in the form call like do=form&threadid=123766 to post the answers in that thread.
any change that i can adjust it to it and a hint - if possible - how?

In the URL have $t=

In the plugin, have the threadid equal $threadinfo[threadid]

Abe1 12-19-2005 12:43 PM

Version 3.3: (12/19/2005)
  • [FIXED] Guests can now post using the forms to make a thread or post. They cannot send a PM though.
  • [ADDED] Paypal link so you can make a donation for this hack.

pipin 12-19-2005 01:55 PM

Quote:

Originally Posted by Abe1
In the URL have $t=

In the plugin, have the threadid equal $threadinfo[threadid]

so i do this:

Code:

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "0";


//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "1";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = $threadinfo[threadid];


Opening the form with
http://www.xx
.xxx/vbulletin//newthread.php?do=form&$t=84

causes
Warnung
: Cannot use a scalar value as an array in /includes/functions_newpost.php (Zeile 258)

setting $formreplythreadid = "84"; works

Abe1 12-19-2005 01:57 PM

Quote:

Originally Posted by pipin
so i do this:

Code:

//ENABLE FORM TO BE POSTED - 1 = yes, 0 = no
$formforum = "0";


//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "1";

//EXISTING THREAD ID FOR FORM TO REPLY IN
$formreplythreadid = $threadinfo[threadid];


Opening the form with
http://www.xx
.xxx/vbulletin//newthread.php?do=form&$t=84

causes
Warnung
: Cannot use a scalar value as an array in /includes/functions_newpost.php (Zeile 258)

setting $formreplythreadid = "84"; works

Link should be:
http://www.xx.xxx/vbulletin//newthread.php?do=form&t=84

pipin 12-19-2005 02:01 PM

Quote:

Originally Posted by Abe1


still the same:

Warnung: Cannot use a scalar value as an array in /includes/functions_newpost.php (Zeile 258)

Quote:

Datenbankfehler in vBulletin 3.5.2:

Invalid SQL:
SELECT postid FROM post WHERE threadid= ORDER BY dateline LIMIT 1;

MySQL-Fehler : You have an error in your SQL syntax near 'ORDER BY dateline LIMIT 1' at line 1
Fehler-Nr. : 1064

Noonster 12-19-2005 04:58 PM

[ADDED] Paypal link so you can make a donation for this hack.

^^ I cant seem to find that or how to do it :( - Any ideas??

Abe1 12-19-2005 05:57 PM

Quote:

Originally Posted by Noonster
[ADDED] Paypal link so you can make a donation for this hack.

^^ I cant seem to find that or how to do it :( - Any ideas??

It's at the bottom of my first listing.

Stachel 12-19-2005 06:17 PM

Thanks for this Abe1 !

Stachel

Spinball 12-19-2005 08:13 PM

Quote:

Originally Posted by pipin
still the same:

Warnung: Cannot use a scalar value as an array in /includes/functions_newpost.php (Zeile 258)

That's the same kind of error I'm getting.

Daniel 12-19-2005 08:29 PM

Quote:

Originally Posted by Daniel
How do you remove certain fields? I mean, I deleted them from the customization, but they're there but blank.


anyone?

pipin 12-19-2005 08:58 PM

Quote:

Originally Posted by Daniel
How do you remove certain fields? I mean, I deleted them from the customization, but they're there but blank.

as stated before there are two templates : form and formanswers !

cclaerhout 12-19-2005 11:43 PM

Thanks for this update !
Little question : how to update an existing installation. Do we have to update all plug-ins ?

Edit : that's good i've compared the two files and see what has changed.

WNxWakko 12-19-2005 11:58 PM

How do I make the vbtext box required?

I am adding at such and its not working,

if ($answer1 == '' OR $messagearea == '')
{

cclaerhout 12-20-2005 12:42 AM

Me again ; i've just finished to test guest function to open a new thread in a forum : IT WORKS GREAT :)

Thank you !

Abe1 12-20-2005 11:51 AM

Quote:

Originally Posted by WNxWakko
How do I make the vbtext box required?

I am adding at such and its not working,

if ($answer1 == '' OR $messagearea == '')
{

It's called '$vbtextanswer' but it's not made until AFTER the check. You would have to suffle some code around. I will move it around fronext version.

keroberos 12-23-2005 01:26 AM

Keep getting this error when i try to create a new thread:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/fight/public_html/forums/newthread.php(68) : eval()'d code on line 1


any ideas?

Abe1 12-23-2005 11:51 AM

Quote:

Originally Posted by keroberos
Keep getting this error when i try to create a new thread:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/fight/public_html/forums/newthread.php(68) : eval()'d code on line 1


any ideas?

You have an error on the first line of the plug-in. Please make sure the line strats with //

keroberos 12-23-2005 03:53 PM

Quote:

Originally Posted by Abe1
You have an error on the first line of the plug-in. Please make sure the line strats with //

haha i knew i inputed something wrong somewhere i just couldnt find it, thanks and awsome job.

tommyxv 12-23-2005 09:28 PM

I want to add a drop down for all 50 states.... what variable do i use after i use all 26 letters?

EX:

$dropdownchoice6z = "Georgia";


All times are GMT. The time now is 01:22 PM.

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.02382 seconds
  • Memory Usage 1,869KB
  • 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_code_printable
  • (5)bbcode_php_printable
  • (26)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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