vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

scubasteve3 07-13-2011 04:39 AM

Quote:

Originally Posted by cellarius (Post 2219370)
You really need to open your own thread for this - this has nothing to do with this tutorial.

You're right. Sorry about that. Figured it out.

On a side note, here is something related to this. So I was able to add a new page with the template. Looks great except one thing. There is some extra space on the top of the page so now my logo and login is moved down and there is about a 1/2" gap of nothing from the top. This is only on the new external php page I created. All my other pages look fine. Any suggestions?

cellarius 07-13-2011 05:30 AM

That's either something in the PHP-Code or in the template you created, or some stray css. Without knowing the code and/or seeing the page that's just guesswork.

Lynne 07-13-2011 03:43 PM

Quote:

Originally Posted by scubasteve3 (Post 2219886)
You're right. Sorry about that. Figured it out.

On a side note, here is something related to this. So I was able to add a new page with the template. Looks great except one thing. There is some extra space on the top of the page so now my logo and login is moved down and there is about a 1/2" gap of nothing from the top. This is only on the new external php page I created. All my other pages look fine. Any suggestions?

You would really need to post a link to the page in order for us to see what is going on.

thunderclap82 07-14-2011 06:15 PM

I got my vB page working. It's a newsletter subscription form, real simple. A user enters an email address, enter the security code and that's it. Problem is vB bounces back with

"Your submission could not be processed because a security token was missing."

If I turn off CSRF_PROTECTION to FALSE the problem goes away, but I'm leery of disabling anything that is titled PROTECTION.

I found some posts saying that I should add

Code:

<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
to my template. That doesn't seem to fix the problem though. Any thoughts?

(If this should be a new thread then I apologize for doing it here. Feel free to move if necessary.)

Lynne 07-14-2011 08:50 PM

Quote:

Originally Posted by thunderclap82 (Post 2220558)
I got my vB page working. It's a newsletter subscription form, real simple. A user enters an email address, enter the security code and that's it. Problem is vB bounces back with

"Your submission could not be processed because a security token was missing."

If I turn off CSRF_PROTECTION to FALSE the problem goes away, but I'm leery of disabling anything that is titled PROTECTION.

I found some posts saying that I should add

Code:

<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
to my template. That doesn't seem to fix the problem though. Any thoughts?

(If this should be a new thread then I apologize for doing it here. Feel free to move if necessary.)

In vB4 it would be this:
Code:

<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />

thunderclap82 07-14-2011 08:54 PM

Does this go in the template I created or in the .php file? Because if it's the template it doesn't seem to be working. I have it in the blockrow area. Does it go somewhere else?

--------------- Added [DATE]1310697032[/DATE] at [TIME]1310697032[/TIME] ---------------

I've pinpointed the problem. It's value="$bbuserinfo[securitytoken]" that's causing the problem. If I change it to "guest" it works fine, but only if the user isn't logged in.

Is there a way to get this working so if it's a non-member/not logged in member or a logged in member it behaves the same way? What if I just disable CSRF_PROTECTION for this particular script?

Lynne 07-15-2011 03:38 AM

The code I posted goes into the form which should be in the template. I took the code directly out of the header template - if you have written it correctly, it will work for a guest or member.

AusPhotography 07-15-2011 03:46 AM

I wrote a simple product that allows you to embed Google Custom Search using this approach.
https://vborg.vbsupport.ru/showthread.php?t=266449

It is really just a page shell + tab, feel free to grab the code as you need.

Kym

thunderclap82 07-15-2011 02:00 PM

Quote:

Originally Posted by Lynne (Post 2220701)
The code I posted goes into the form which should be in the template. I took the code directly out of the header template - if you have written it correctly, it will work for a guest or member.

Well, I followed your code exactly so I have a feeling it's because it's calling another php file.

Quote:

Originally Posted by snoopytas (Post 2220707)
I wrote a simple product that allows you to embed Google Custom Search using this approach.
https://vborg.vbsupport.ru/showthread.php?t=266449

It is really just a page shell + tab, feel free to grab the code as you need.

I'll take a look. Thanks!

If I can't get it working I'll just go with turning off the protection. It works for both then, and the form has two security measures of it's own so I think it's fairly safe.

kh99 07-15-2011 04:14 PM

Quote:

Originally Posted by thunderclap82 (Post 2220840)
Well, I followed your code exactly so I have a feeling it's because it's calling another php file.

It didn't work because your form isn't in a template. You might be able to do it by editing your form code php file and adding:

HTML Code:

<input type="hidden" name="securitytoken" value="<?php global $vbulletin; echo $vbulletin->userinfo['securitytoken']; ?>" />

This would be easier if, as someone pointed out in the other thread, you were to put your form in a template, but that would mean making more changes to the form code.


All times are GMT. The time now is 12:15 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03651 seconds
  • Memory Usage 1,754KB
  • 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
  • (1)bbcode_html_printable
  • (6)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