Announcement

Collapse
No announcement yet.

Search Form on Non-VBulletin Page How-To

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Search Form on Non-VBulletin Page How-To

    It works great for guests, but what is the code to get it to work if you're logged in (and/or not logged in)? It appears to be an issue with the securitytoken, receiving this message if logged in: Your submission could not be processed because you have logged in since the previous page was loaded.

    CODE WORKS GREAT, EXCEPT IF LOGGED IN:
    ===========
    <form action="/forums/search.php?do=process" method="post">
    <div>
    <input type="hidden" name="do" value="process" />
    <input type="hidden" name="quicksearch" value="1" />
    <input type="hidden" name="childforums" value="1" />
    <input type="hidden" name="exactname" value="1" />
    <input type="hidden" name="s" value="" />
    <input type="text" id="query" name="query" tabindex="1001" class="text" />
    <input type="submit" class="button" tabindex="1004" value="Search Forums" class="searchbut" />
    <input type="hidden" name="securitytoken" value="guest" />
    <input type="hidden" name="showposts" value="1" id="rb_nb_sp0" tabindex="1002" />
    </div>
    </form>

    ======
    Thanks for any feedback you can provide.

  • #2
    This really should be posted over on vbulletin.org, the modification site.

    But, have you looked at the search form in the navbar? It uses this for the securitytoken:
    HTML Code:
    <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment


    • #3
      Your suggestions would be great if the code was on a vbulletin page/template. I'm simply trying to provide a search on another page. I'm surprised this is a big deal... Could I just leave security token empty or provide a tiny PHP check for the cookie or something...? I'll try to post findings if anyone responds. I suppose I will post the same thing at .org as you suggest.

      Comment


      • #4
        Originally posted by Brettc View Post
        Your suggestions would be great if the code was on a vbulletin page/template. I'm simply trying to provide a search on another page. I'm surprised this is a big deal... Could I just leave security token empty or provide a tiny PHP check for the cookie or something...? I'll try to post findings if anyone responds. I suppose I will post the same thing at .org as you suggest.
        it's on the same domain I presume. Use this as the start point:

        http://www.vbulletin.org/forum/showthread.php?t=228112

        All you really need is to include the right files. You don't need to make a template at all.

        Comment


        • #5
          Yes, good assumption. It is on the same domain... Thank you very much. I'm very close I'm sure...

          After including global, I'm still trying to echo or output one of these:
          $vbulletin->userinfo['securitytoken']
          $bbuserinfo[securitytoken]

          I'll try to post or link results here and also on .ORG
          http://www.vbulletin.org/forum/showt...03#post2027803

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X