vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   New Posting Features - Form Hack (https://vborg.vbsupport.ru/showthread.php?t=126676)

Grimbone 12-10-2008 04:59 AM

I cannot find my templates to edit anywhere at all. When i goto Style Manager -> Edit Templates nothing is listed at all under custom templates. Clearly the templates have to be somewhere because my test page is showing the form I have been working on in the Plugin PHP Code section.

http://www.legacyofthehorde.com/foru...hp?do=wow_form

The Plugin Code shows...

PHP Code:

// Name of the main template
$maintemplate "form";
// Name of the answer template
$answertemplate "formanswers"

but I cannot find the templates.

Any ideas?

WNxWakko 12-10-2008 10:10 AM

Since my upgrade to 3.7, i get an error when viewing a form that is intended for those not logged in. The error only displays if you are not logged in and yes I have the guest variable enabled.

Quote:

Fatal error: Call to undefined function fetch_registration_string() in /warriornation.net/httpdocs/Forum/newthread.php(74) : eval()'d code on line 4253
EDIT, took out all the image verification and the error is gone. However submitting forms as unregistered isnt working anymore. I get the confirmation message as if its worked, however the thread never shows up in the forum specified. Yes i have unregistered usergroup post ability enabled in it.

meissenation 12-10-2008 01:10 PM

Quote:

Originally Posted by Grimbone (Post 1682114)
I cannot find my templates to edit anywhere at all. When i goto Style Manager -> Edit Templates nothing is listed at all under custom templates. Clearly the templates have to be somewhere because my test page is showing the form I have been working on in the Plugin PHP Code section.

http://www.legacyofthehorde.com/foru...hp?do=wow_form

The Plugin Code shows...

PHP Code:

// Name of the main template
$maintemplate "form";
// Name of the answer template
$answertemplate "formanswers"

but I cannot find the templates.

Any ideas?

It's not listed under custom templates but it will be listed in the list of templates alphabetically. Scroll down to the "F" templates and you'll see it.

Digital Jedi 12-10-2008 07:54 PM

Quote:

Originally Posted by meissenation (Post 1681621)
D'oh - thank you sir! I left everything for Registered Users set to No under the Forum Permissions but changed the Upload Attachments to Yes and now it appears :)

Edit: Well - one step forward, but not quite there. If I make it so they can upload attachments it gives them the button for the attachments but it does not allow them to actually attach to the form. I have to make it so it goes to a forum that's off limits to Registered Users due to personal information being posted in the form (Address, phone #, email, etc) but really want them to be able to attach.

When you say it doesn't allow them, what does it do exactly? Does no upload form show up, or does it restrict the posting of the message upon submit? Check your Message Attachment Options as well under vBulletin Options.


Quote:

Originally Posted by Grimbone (Post 1682114)
I cannot find my templates to edit anywhere at all. When i goto Style Manager -> Edit Templates nothing is listed at all under custom templates. Clearly the templates have to be somewhere because my test page is showing the form I have been working on in the Plugin PHP Code section.

http://www.legacyofthehorde.com/foru...hp?do=wow_form

The Plugin Code shows...

PHP Code:

// Name of the main template
$maintemplate "form";
// Name of the answer template
$answertemplate "formanswers"

but I cannot find the templates.

Any ideas?

The Custom Templates list is for templates YOU create. Modifications generally put their templates, as meissenation mentioned, alphabetically in the main template listing.


Quote:

Originally Posted by WNxWakko (Post 1682279)
Since my upgrade to 3.7, i get an error when viewing a form that is intended for those not logged in. The error only displays if you are not logged in and yes I have the guest variable enabled.



EDIT, took out all the image verification and the error is gone. However submitting forms as unregistered isnt working anymore. I get the confirmation message as if its worked, however the thread never shows up in the forum specified. Yes i have unregistered usergroup post ability enabled in it.

Only other thing I can think of is to check to the forum ID variable in the plugin, as well as ENABLE FORM TO BE POSTED setting.

Grimbone 12-10-2008 08:50 PM

Thanks for point me in the right direction!

Great mod!

rhamer 12-10-2008 11:08 PM

Without sounding stupid, is there a complete idiots guide to getting this working?

I am a new forum admin, but I am a programmer (not PHP) and I am struggling to understand how this all hangs together and how to make it work.

I imported the XML file with the product manager.
I then found the plugin and edited that, although I didnt make any changes.
I figured that the PHP code was what generated the form, so I left that alone for the minute to just get something to work.

However I don't know how to get this to trigger from a forum i.e when I press the new thread button, I don't get the form.

I assume you enable it somehow for each forum.

I also don't understand the relationship between the product and the plugin. Do you use the priduct to create multiple plugins as needed? How are they named and how does the name relate to which form you want displayed in each forum?

I tried reading this entire thread, but 90 pages is beyond me making sense of it.

Any help and guidence would be most appreciated.

Cheers

Rohan

Digital Jedi 12-11-2008 04:46 AM

Quote:

Originally Posted by rhamer (Post 1682787)
Without sounding stupid, is there a complete idiots guide to getting this working?

I am a new forum admin, but I am a programmer (not PHP) and I am struggling to understand how this all hangs together and how to make it work.

I imported the XML file with the product manager.
I then found the plugin and edited that, although I didnt make any changes.
I figured that the PHP code was what generated the form, so I left that alone for the minute to just get something to work.

However I don't know how to get this to trigger from a forum i.e when I press the new thread button, I don't get the form.

I assume you enable it somehow for each forum.

I also don't understand the relationship between the product and the plugin. Do you use the priduct to create multiple plugins as needed? How are they named and how does the name relate to which form you want displayed in each forum?

I tried reading this entire thread, but 90 pages is beyond me making sense of it.

Any help and guidence would be most appreciated.

Cheers

Rohan

Most of this is explained in the supplied documentation, but basically, you only need to edit the plugin and the two templates. The $variables are defined in the plugin. If you tell the plugin that $firstname is equal to "First Name", then every instance of $firstname in the template will convert to First Name.

You don't necessarily have to do that for all text, as is shown in the example plugin, but you do need to do it for the form areas. Open the plugin again and go through the area again line by line. There's instructions all through the plugin on what does what and what needs to be configured. In fact, most, if not all of the documentation was worked into the plugin's comments.

rhamer 12-11-2008 07:15 AM

Thanks Jedi, I have now got it working.

The biggest problem I had was understanding how it worked, I didn't realise that this was a page that you linked to, that in turn took the results and posted them. I was thinking the form would appear when I clicked the "New Thread" button on a nominated forum.

I do however have a couple of questions.

How do I stop guests from using the form? i.e make the submit not work if your not logged on and
Can the formanswer template have HTML tags in it like <b></b>? I tried adding them but it just showed the tags in the result.

Cheers

Rohan

Digital Jedi 12-11-2008 11:20 AM

Quote:

Originally Posted by rhamer (Post 1682951)
Thanks Jedi, I have now got it working.

The biggest problem I had was understanding how it worked, I didn't realise that this was a page that you linked to, that in turn took the results and posted them. I was thinking the form would appear when I clicked the "New Thread" button on a nominated forum.

I do however have a couple of questions.

How do I stop guests from using the form? i.e make the submit not work if your not logged on and
Can the formanswer template have HTML tags in it like <b></b>? I tried adding them but it just showed the tags in the result.

Cheers

Rohan

It won't accept HTML, I presume, for security reasons. But you can use BBCode, as long as you keep the variables a space away for the code. At least, my experience has been that it doesn't like it if you do this: [b]$variable[/b] It only likes this:[b] $variable [/b]

Guests permissions is a variable in the plugin.

etzero 12-11-2008 06:45 PM

DJ, This is a question in referance to post #1313 where a someone asked:

Quote:

I use the forms for an application process and it is submitted into an area that only certain people have access to. The applicants cannot read the area it is submitted to but I found out that they can subscribe to the thread and be sent the replies. How can I deny anyone from subscribing in that section?
Which I think I may have found a solution to. If you could please verify or deny this I would appreciate it.

The default code looks like this:

Code:

if ($vbulletin->userinfo['autosubscribe'] != -1)
                        {
                                $newpost['emailupdate'] = $vbulletin->userinfo['autosubscribe'];
                        }
                        else
                        {
                                $newpost['emailupdate'] = 9999;
                        }

My thought is that it if changed to this it should always delete the users subscrition regardless if he was set up though the user CP.

Code:

$newpost['emailupdate'] = 9999;

By looking at functions_newpost.php, '9999' apears to be the correct value to delete any subscritions for that thread?

Code:

// ### DO THREAD SUBSCRIPTION ###
        if ($vbulletin->userinfo['userid'] != 0)
        {
                require_once(DIR . '/includes/functions_misc.php');
                $post['emailupdate'] = verify_subscription_choice($post['emailupdate'], $vbulletin->userinfo, 9999);

                ($hook = vBulletinHook::fetch_hook('newpost_subscribe')) ? eval($hook) : false;

                if (!$threadinfo['issubscribed'] AND $post['emailupdate'] != 9999)
                { // user is not subscribed to this thread so insert it
                        /*insert query*/
                        $vbulletin->db->query_write("INSERT IGNORE INTO " . TABLE_PREFIX . "subscribethread (userid, threadid, emailupdate, folderid, canview)
                                        VALUES (" . $vbulletin->userinfo['userid'] . ", $threadinfo[threadid], $post[emailupdate], $post[folderid], 1)");
                }
                else
                { // User is subscribed, see if they changed the settings for this thread
                        if ($post['emailupdate'] == 9999)
                        {        // Remove this subscription, user chose 'No Subscription'

                                $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "subscribethread WHERE threadid = $threadinfo[threadid] AND userid = " . $vbulletin->userinfo['userid']);
                        }
                        else if ($threadinfo['emailupdate'] != $post['emailupdate'] OR $threadinfo['folderid'] != $post['folderid'])
                        {
                                // User changed the settings so update the current record
                                /*insert query*/
                                $vbulletin->db->query_write("REPLACE INTO " . TABLE_PREFIX . "subscribethread (userid, threadid, emailupdate, folderid, canview)
                                        VALUES (" . $vbulletin->userinfo['userid'] . ", $threadinfo[threadid], $post[emailupdate], $post[folderid], 1)");
                        }
                }
        }

It seems counter intuitive as I would have guessed a value of ‘0’ would remove subscriptions.


All times are GMT. The time now is 02:39 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.05990 seconds
  • Memory Usage 1,801KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)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