Creating new links in phpBB issues

STG related Support requests. Post site related support issues or questions about Star Trek Guide, or any of the tools or services on STG -- Not for phpBB Support --
Forum rules
Image
Post site related support issues or questions about phpBB Academy at Star Trek Guide, tools or STG services.
Post site feedback here as well.
Programming and general coding support or assistance should be requested in the Coding Assistance forums.

No phpBB Support in this forum

Creating new links in phpBB issues

Postby wired076 » 10 Oct 2009, 18:51

I have created two new links on phpBB forum but when I click and go into the photo album and then click on either of these links it doesn't go to the correct location.

I believe to get around this issue it involves creating some php link variables that store the location of those folders and then use that variable name in place of a standard link.

Could someone please advise me on how to do this?

http://wired.is-a-geek.net/monkeygun/new/

The first link is the contact and the other is the USERGROUP link.
I.T. Construct
STG Supporter
Please contact me via email/im for help at reasonable prices.
USA Based Web hosting
email: admin@itconstruct.com.au
- Visit http://www.itconstruct.com.au
wired076    
Supporter
Supporter
 
Posts: 494
Joined: 03 Feb 2009, 16:51
Location: Australia
Gender: Male
phpBB Knowledge: 5


Re: Creating new links in phpBB issues

Postby topdown » 10 Oct 2009, 20:12

First think, they need to be accessible anywhere in phpBB, so they need to be added to the header function in the includes/functions.php or hooked in some way.
Find this in the includes/functions.php
Code: Select all
    // The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array( 


everything in that assign_vars function is global.

Now if your link is your_site.com/forum/new_folder

Then you need to add something like this
Code: Select all
        'NEW_LINK'                => append_sid($phpbb_root_path . 'new_folder/'), 

or
Code: Select all
        'NEW_LINK'                => append_sid("{$phpbb_root_path}new_folder/"), 
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3022
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Creating new links in phpBB issues

Postby Obsidian » 10 Oct 2009, 20:15

Uhhh, that's not gonna work topdown. That append_sid() call is not correct, it should be like this:

Code: Select all
            'NEW_LINK'                => append_sid("{$phpbb_root_path}new_folder/"),  
うるさいうるさいうるさい!

StopForumSpam Spam Reporting Database
Giving xrumer and friends a great big "screw you" since 2007.
User avatar
Obsidian    
Supporter
Supporter
 
Posts: 2250
Joined: 04 Mar 2008, 23:35
Gender: Male
phpBB Knowledge: 10

Re: Creating new links in phpBB issues

Postby topdown » 10 Oct 2009, 20:16

erm, fixed it before you posted ;)
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3022
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Creating new links in phpBB issues

Postby wired076 » 10 Oct 2009, 21:09

topdown wrote:First think, they need to be accessible anywhere in phpBB, so they need to be added to the header function in the includes/functions.php or hooked in some way.
Find this in the includes/functions.php
Code: Select all
    // The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array( 


everything in that assign_vars function is global.

Now if your link is your_site.com/forum/new_folder

Then you need to add something like this
Code: Select all
        'NEW_LINK'                => append_sid($phpbb_root_path} . 'new_folder/'), 

or
Code: Select all
        'NEW_LINK'                => append_sid("{$phpbb_root_path}new_folder/"), 


That isn't working. :(

The code section is:(Contact line is 3636, contact.php is in the root phpBB directory and is a custom phpBB page)

Code: Select all
         $template->assign_vars(array(
            'MESSAGE_TITLE'      => $msg_title,
            'MESSAGE_TEXT'      => $msg_text,
            'S_USER_WARNING'   => ($errno == E_USER_WARNING) ? true : false,
            'S_USER_NOTICE'      => ($errno == E_USER_NOTICE) ? true : false,
            'Contact'           => append_sid("{$phpbb_root_path}/contact.php"))
         );


The error is
Code: Select all
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/monkeygun/new/includes/functions.php on line 3636
I.T. Construct
STG Supporter
Please contact me via email/im for help at reasonable prices.
USA Based Web hosting
email: admin@itconstruct.com.au
- Visit http://www.itconstruct.com.au
wired076    
Supporter
Supporter
 
Posts: 494
Joined: 03 Feb 2009, 16:51
Location: Australia
Gender: Male
phpBB Knowledge: 5

Re: Creating new links in phpBB issues

Postby topdown » 10 Oct 2009, 21:44

One thing I see wrong in your code above right away is
Code: Select all
'Contact'           => append_sid("{$phpbb_root_path}/contact.php"))


'Contact' Should be 'CONTACT'
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3022
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Creating new links in phpBB issues

Postby wired076 » 10 Oct 2009, 22:03

topdown wrote:One thing I see wrong in your code above right away is
Code: Select all
'Contact'           => append_sid("{$phpbb_root_path}/contact.php"))


'Contact' Should be 'CONTACT'


This has been fixed but error still exists! :(
I.T. Construct
STG Supporter
Please contact me via email/im for help at reasonable prices.
USA Based Web hosting
email: admin@itconstruct.com.au
- Visit http://www.itconstruct.com.au
wired076    
Supporter
Supporter
 
Posts: 494
Joined: 03 Feb 2009, 16:51
Location: Australia
Gender: Male
phpBB Knowledge: 5

Re: Creating new links in phpBB issues

Postby topdown » 10 Oct 2009, 22:31

Lets start from the beginning
What did you put where and copy the chunks of code into code blocks labeling each with the relative file.
You should turn on debugging also if you haven't.
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3022
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Re: Creating new links in phpBB issues

Postby Obsidian » 10 Oct 2009, 22:33

Something I also spotted beyond that...the PHP file extension is hardcoded and should instead use the $phpEx variable.
Code: Select all
             $template->assign_vars(array(
                'MESSAGE_TITLE'      => $msg_title,
                'MESSAGE_TEXT'      => $msg_text,
                'S_USER_WARNING'   => ($errno == E_USER_WARNING) ? true : false,
                'S_USER_NOTICE'      => ($errno == E_USER_NOTICE) ? true : false,
                'CONTACT'           => append_sid("{$phpbb_root_path}contact.$phpEx"),
             ));

It may help clean up the code that way, but we need more context code around those lines to debug further.
うるさいうるさいうるさい!

StopForumSpam Spam Reporting Database
Giving xrumer and friends a great big "screw you" since 2007.
User avatar
Obsidian    
Supporter
Supporter
 
Posts: 2250
Joined: 04 Mar 2008, 23:35
Gender: Male
phpBB Knowledge: 10

Re: Creating new links in phpBB issues

Postby topdown » 10 Oct 2009, 22:35

I just noticed this code that I posted has a syntax error
Code: Select all
        'NEW_LINK'                => append_sid($phpbb_root_path} . 'new_folder/'),  


should be
Code: Select all
        'NEW_LINK'                => append_sid($phpbb_root_path . 'new_folder/'),  


Sorry
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
User avatar
topdown    
STG Styles Leader
STG Styles Leader
 
Posts: 3022
Joined: 01 Oct 2007, 22:56
Location: Handyman's harddrive
Favorite Team: STG Teams
Gender: Male
phpBB Knowledge: 9

Next

Return to STG Support

Who is online

Users browsing this forum: psbot [Picsearch] and 1 guest