vb.org Archive

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

Mobo 03-03-2011 11:29 AM

I found how to add the form to a Sticky thread in the Book Review Form, so that could work for me if there is not a way to have it displayed at the top of the forum.

However, testing the form inside the Sticky thread has lead to some issues.

1. The form is displayed inside of a scrolling box in the post. Is there a way to get it to just show the entire form in the post?

2. I also tried to get the form to redirect the submitter to the Book Review forum. The problem is that it loads that new page inside the same scrolling box that form is in on the post in the Sticky thread. Anyway around that?

Thanks for the great mod and all the help you have been giving us!

bananalive 03-03-2011 11:34 AM

Quote:

Originally Posted by Mobo (Post 2169060)
Okay, I installed this mod and have a working form that posts a thread in my Book Review sub-forum. Is there a way to have the form its self displayed at the top of that forum, instead of in a link buried in the man nav menu?

You could edit template FORUMDISPLAY

HTML Code:

<vb:if condition="$foruminfo['forumid']==2">
<iframe src="misc.php?do=form&fid=1&embed=1" width="100%" height="300"></iframe>
</vb:if>

Add it above :

HTML Code:

<div id="above_threadlist" class="above_threadlist">

Mobo 03-03-2011 11:57 AM

Thanks Dom, that worked to display the form in the forum. Is there a way to make it so that the form is shown again after they submit it? Right now if I have it set for them to see the Thank You message, it display that new page inside the box the form was in. If I set it to redirect to the forum, it also does that inside the box the form was in.

Thanks again!

bananalive 03-03-2011 12:24 PM

Quote:

Originally Posted by Mobo (Post 2169082)
Thanks Dom, that worked to display the form in the forum. Is there a way to make it so that the form is shown again after they submit it? Right now if I have it set for them to see the Thank You message, it display that new page inside the box the form was in. If I set it to redirect to the forum, it also does that inside the box the form was in.

Thanks again!

Set the redirect url to:
HTML Code:

http://www.yoursite.com/forums/misc.php?do=form&fid=1&embed=1
This will display 'Thank you' message and redirect them back to the form again.

russellw 03-04-2011 01:27 AM

Quote:

Originally Posted by bananalive (Post 2169036)
Have you tried un-installing and then re-installing it. The default page when a 'do' isn't called is the smilies so the hooks aren't exec'ing. Do you get any error messages at the top of the page?

Thanks for the response. I have tried installing and uninstalling several times but I shall try again.

There are no errors on the page and none in the error log either but a bit of digging through my upgrade notes shows that we commented out a line in global.php because with it in vbportal refused to run.

the line was:

Code:

//        ($hook = vBulletinHook::fetch_hook('global_start')) ? eval($hook) : false;
I note that a couple of other hacks use the global_start hook (and I presume this one does too) so I will disable them and see what happens when I uncomment the line.

Cheers
Russ

by way of PS:

After disabling the 3 hacks that used the hook and uncommenting the line, vbportal is the only thing that works - everything else just returns a blank page.

There is an error in the error log (at least):

Code:

PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required './../global.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/global.php(350) : eval()'d code on line 49
.. so that might make a useful starting point. Of course, line 350 is the hook code shown above which is obviously where the issue is.

russellw 03-04-2011 06:42 AM

Ok - after some snooping I found that the vbportal hook was the root cause of the evil as it was redirecting global.php to the wrong location.

I removed the hook and reinstalled Easy Forms but with the same result. A look in the db shows no hooks relating to Easy Forms - I presume from a look at the xml file there should be?

Cheers
Russ

PS: I edited the xml and uploaded the hooks fine - still a couple of permission based errors but I'm getting there.

Mobo 03-04-2011 06:59 AM

That worked a treat Dom, thanks again.

ascroft 03-04-2011 08:02 PM

Hi thanks for this -

1. Previously I have used a plugin as follows:

if (in_array($forumid, array(53,9999)))
{
header( 'Location:/listings/misc.php?do=form&fid=8' ) ;
}

This linked a particular form to a particular forum and was called from newthread_form_start- presume I should be listing all of the forumids in this plugin that I want the form launched from?

2. Also, in the view form after applying the mods below against the question I just get a list of forums and can't select one? Kind of related to this, can I control what forums can be selected from (want the same as the forums that they form can be launched from in 1 above) and give them different names i.e. not show PW_Dunedin but Dunedin? Also the threadid picker which was previously using a custom question (thanks to you previously) seems to have stopped working - can't see the pick list any more for this. Other info - in the default for the formbody I had set the threadid to 'none' as the custom question then sorted that, but for the post thread I have to specify a forum - not sure if that is the issue?

Thanks.

Quote:

Originally Posted by bananalive (Post 2168162)
  1. Edit Form
  2. Add 'Custom' Question
    • Type
      Code:

      Custom
    • Reference
      Code:

      forumid
    • PHP Code
      PHP Code:

      foreach ($vbulletin->forumcache AS $forumid  => $forum)
      {
      if (
      $qo['forumid']==$forumid)
      {
      $forum['selected'] = ' selected="selected"';
      }
      $answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
      }
      $answer .= "</select>"

    • Compulsory:
      Code:

      Yes
  3. Form Hook: Form Start:
    PHP Code:

    $form['forumid'] = $qo['forumid']; 

  4. Form Hook: Before Submit:
    PHP Code:

    $forumid $form['forumid'] = $qo['forumid']; 



bananalive 03-05-2011 04:05 PM

Quote:

Originally Posted by ascroft (Post 2169610)
Hi thanks for this -

1. Previously I have used a plugin as follows:

PHP Code:

if (in_array($forumid, array(53,9999))) 
{  
header'Location:/listings/misc.php?do=form&fid=8' ) ;  


This linked a particular form to a particular forum and was called from newthread_form_start- presume I should be listing all of the forumids in this plugin that I want the form launched from?

2. Also, in the view form after applying the mods below against the question I just get a list of forums and can't select one? Kind of related to this, can I control what forums can be selected from (want the same as the forums that they form can be launched from in 1 above) and give them different names i.e. not show PW_Dunedin but Dunedin? Also the threadid picker which was previously using a custom question (thanks to you previously) seems to have stopped working - can't see the pick list any more for this. Other info - in the default for the formbody I had set the threadid to 'none' as the custom question then sorted that, but for the post thread I have to specify a forum - not sure if that is the issue?

Thanks.

1. Add them in a comma seperated list so for forumids: 53,9999,34,55,66 you would want
PHP Code:

if (in_array($forumid, array(53,9999,34,55,66))) 
{  
header'Location:/listings/misc.php?do=form&fid=8' ) ;  


2. I missed the first line of the code off of the example. Updated original post: https://vborg.vbsupport.ru/showpost....postcount=1135

PHP Code for the custom question, should be: (This includes the limit to show only forums: 53,9999,34,55,66)

PHP Code:

$answer "<select name=\"$formbit[id]\" id=\"q_" $formbit[id]  . "\">";
foreach (
$vbulletin->forumcache AS $forumid  => $forum)
{
if (!
in_array($qo['forumid'], array(53,9999,34,55,66)))
{
continue;
}
if (
$qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>"


ascroft 03-05-2011 10:48 PM

OK - thanks - progress here. :)

1. I have changed the plugin to launch the form from forums 53 & 65. Thanks.

2. The PHP code now shows the full forum list in the form if I don't filter - but doesn't show anything in the drop down if I restrict this. For example only including 53,65 in the array?

3. The thread prefix which is also working off a drop down doesn't show anything in the list either until I submit, then it says its missing, and then the drop down is populated. I can then select and submit - as long as the filter isn't on as per 2.

The form hook before submit presently shows:

$form['prefixid'] = $qo['prefix'];
$forumid = $form['forumid'] = $qo['forumid'];

The first row I already had for the prefix, and then added the second row now. Maybe they should be reversed?

btw the PHP in the custom question for the prefix is:

require_once(DIR . '/includes/functions_prefix.php');
$thisanswer = $q[$formbit[id]];
$prefix_options = fetch_prefix_html($form['forumid'], $thisanswer, true);
$answer = '<select name="' . $formbit[id] . '" id="q_' . $formbit[id] . '" class="bginput">';
$answer .= '<option value="">'.$vbphrase[no_prefix_meta].'</option>';
$answer .= $prefix_options;
$answer .= '</select>';


Finally, my initial test posted the thread in to the forum I launched the form (and is the default forum in the form body) from even though I selected another forum from the drop down list. I may have to do more testing re this point once a couple more of the other things are clarified.

Many thanks for your help.


Quote:

Originally Posted by bananalive (Post 2169872)
1. Add them in a comma seperated list so for forumids: 53,9999,34,55,66 you would want
PHP Code:

if (in_array($forumid, array(53,9999,34,55,66))) 
{  
header'Location:/listings/misc.php?do=form&fid=8' ) ;  


2. I missed the first line of the code off of the example. Updated original post: https://vborg.vbsupport.ru/showpost....postcount=1135

PHP Code for the custom question, should be: (This includes the limit to show only forums: 53,9999,34,55,66)

PHP Code:

$answer "<select name=\"$formbit[id]\" id=\"q_" $formbit[id]  . "\">";
foreach (
$vbulletin->forumcache AS $forumid  => $forum)
{
if (!
in_array($qo['forumid'], array(53,9999,34,55,66)))
{
continue;
}
if (
$qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>"




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