vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Code Help (https://vborg.vbsupport.ru/showthread.php?t=320404)

Colossal31 10-02-2015 10:09 PM

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>


Dave 10-03-2015 09:12 AM

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.

Colossal31 10-03-2015 06:49 PM

Quote:

Originally Posted by Dave (Post 2556159)
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>


Colossal31 10-05-2015 11:00 PM

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.

John Lester 10-06-2015 02:50 AM

In your template code for the link ... shouldn't there be a . in front of /roster.php?

squidsk 10-06-2015 04:03 PM

Or no leading slash.

Colossal31 10-06-2015 07:35 PM

Quote:

Originally Posted by John Lester (Post 2556373)
In your template code for the link ... shouldn't there be a . in front of /roster.php?

Quote:

Originally Posted by squidsk (Post 2556453)
Or no leading slash.

Tried both but it still is not redirecting. The join still works but the redirect still fails.

John Lester 10-08-2015 04:19 AM

Provide a link to the forum where the forum block is and a link to the roster page.

Colossal31 10-08-2015 11:20 PM

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.

Dave 10-09-2015 03:43 AM

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.


All times are GMT. The time now is 03:10 PM.

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.01715 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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