Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-02-2015, 10:09 PM
Colossal31 Colossal31 is offline
 
Join Date: Mar 2015
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Code Help

Tried to make a forum block that signs you up for a usergroup. I have the template set to join the group and the join part works but for some reason it will not redirect to the Usergroup Roster Page i have created for that group. Any help will be appreciated. If need be I can post the code for the template too just to make sure I didnt screw anything in there up.

Code:
<a href="/roster.php?roster=EBAFreeAgent" onclick="document.getElementById('EBA').submit();return false;">
<img src='/images/ebasignup/ebasignup.png' width='240px' height='198px' alt=''>
</a>
Reply With Quote
  #2  
Old 10-03-2015, 09:12 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So when they click on the link, it should submit a form somewhere...?
It's not clear what you exactly want. Might also want to remove "return false;" in the onclick.
Reply With Quote
  #3  
Old 10-03-2015, 06:49 PM
Colossal31 Colossal31 is offline
 
Join Date: Mar 2015
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
So when they click on the link, it should submit a form somewhere...?
It's not clear what you exactly want. Might also want to remove "return false;" in the onclick.
OK the code above is the code for the Forum Block that has a button for them to click on and it puts them in a usergroup. When they click on it, I want it to redirect them to the roster.php?roster=***** page which is just a list of those people. Right now it places them in the usergroup but does not re-direct them to the roster page. Below is the custom html for the block template. I just want it to be click>>assign to usergroup id >>>> redirect to roster page for that usergroup.


Code:
<vb:if condition="$GLOBALS[forumid] == 50"><li>
	<div class="block smaller">
		<div class="blocksubhead">
			<a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
			<span class="blocktitle">{vb:raw blockinfo.title}</span>
		</div>
		<div class="widget_content blockbody floatcontainer">
		<div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
			{vb:raw content}
		</div>
		</div>
	</div>
	<div class="underblock"></div>
</li>
<form action="profile.php" method="post" id="EBA">
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
<input type="hidden" name="do" value="joingroup" />
<input type="hidden" name="usergroupid" value="197" />
</form>
</vb:if>
Reply With Quote
  #4  
Old 10-05-2015, 11:00 PM
Colossal31 Colossal31 is offline
 
Join Date: Mar 2015
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So does anyone see what I did wrong? I am sure I screwed something up. Just looking for a little help. Basically to break it down again. This forum block is displayed in Sidebar Anywhere on a specific forum. Once the individual clicks on the image they are assigned to UG 197 and should be redirected to a Memberlist page with just that UGs members shown that I have already created. The only part of the process that is not working is the redirect. Removing the return false; from the top code stops the UG Join. If anyone can aide me in figuring out what I did wrong please let me know, because this is driving me bonkers.
Reply With Quote
  #5  
Old 10-06-2015, 02:50 AM
John Lester John Lester is offline
 
Join Date: Nov 2004
Posts: 543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In your template code for the link ... shouldn't there be a . in front of /roster.php?
Reply With Quote
  #6  
Old 10-06-2015, 04:03 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or no leading slash.
Reply With Quote
Благодарность от:
TheLastSuperman
  #7  
Old 10-06-2015, 07:35 PM
Colossal31 Colossal31 is offline
 
Join Date: Mar 2015
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by John Lester View Post
In your template code for the link ... shouldn't there be a . in front of /roster.php?
Quote:
Originally Posted by squidsk View Post
Or no leading slash.
Tried both but it still is not redirecting. The join still works but the redirect still fails.
Reply With Quote
  #8  
Old 10-08-2015, 04:19 AM
John Lester John Lester is offline
 
Join Date: Nov 2004
Posts: 543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Provide a link to the forum where the forum block is and a link to the roster page.
Reply With Quote
  #9  
Old 10-08-2015, 11:20 PM
Colossal31 Colossal31 is offline
 
Join Date: Mar 2015
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

http://www.eliteteamplay.com/forumdi...ll-Association
the forum block is to the right.

http://www.eliteteamplay.com/roster....r=EBAFreeAgent

That is the roster page.
Reply With Quote
  #10  
Old 10-09-2015, 03:43 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem is that the hyperlink has an onclick which submits the form, you can't submit a form and go to a link at the same time. The form has to actually be submitted in order for the form to be processed.

You have to hook into profile_complete and redirect the user to that page when they are sending a request to join a group.
Reply With Quote
Благодарность от:
TheLastSuperman
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:52 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.07251 seconds
  • Memory Usage 2,262KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete