Hello, I'd like to add another link on the membership page under "Useful Links"; it has the logout, change password ect. in that section. Can anyone direct me to the right file to do this? Thanks for your help, Theresa
Sure thing. The following example adds 3 links. Put the code to site.inc.php (if that file does not exist, create it). Code: setup_plugin_hook("get_member_links", "custom_links"); function custom_links($user){ return array("http://firstlink" => 'Description 1', "http://secondlink" => 'Description 2', "./thisworkstoo.php" => _SOME_VARIABLE_IN_CUSTOM_LANGUAGE_FILE); } Modify the firstlink/secondlink/thisworks and descriptions.
Thank you! I looked in templates for the file and didn't see it, so I'll make it. I understand all but the thisworkstoo.php and "some variable in custom language file". What exactly do I put there? I know how to get around the files a little but don't want to guess. Theresa
This required only if you want to make links in different languages. have a look: http://manual.amember.com/Editing_Phrases/Text_Messages
./thisworkstoo.php is called a relative link, http://secondlink is an absolute link. (check Google for an indepth explanation) _SOME_VARIABLE_IN_CUSTOM_LANGUAGE_FILE is, as Alexander described, only if you want to have the description of the links appear in different languages. For this to use you have to add the following line to for example en-custom.php Code: define('_SOME_VARIABLE_IN_CUSTOM_LANGUAGE_FILE', 'The description for the link you would like to display'); And if you use also the Dutch language on your site you add it to nl-custom.php Code: define('_SOME_VARIABLE_IN_CUSTOM_LANGUAGE_FILE', 'Omschrijvinng voor de link die je wilt tonen');
Thanks, this works well. Is there a way to remove a link too. I want to be able to remove the 'Affiliates area' link under 'Useful Links'. Don't really want to hack the core files.
I was able to add the links fine. But somewhere along the line the code is picking up a file hierarchy off of my backup on my computer instead of the site. So it is giving me a Not Found error message when I click the Logout link or the Change Password/Edit Profile link. The requested URL /amember/Templates/http://www.christianhomebusinessassoc.com/amember/logout.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I need to change the URL and remove the "Templates" directory, that is not where these pages are located, they are straight in my amember folder and I am assuming that will then remove this error and direct these links back to their appropriate pages???? Where do I change this URL? Searched everywhere and could not find it. Thanx! Claudia
It should be in templates that you edited. It seems that your HTML editor added this code. Try to download modified template again and serahc for /amember/Templates using simple editor like notepad.
I've created a page called "Support" and added it to all subscribers, so the link is on "Active Products". But I actually want to display this link in the "Useful Links" field. How can I do this? Thanks
I want to add a link to "Useful Links" and I tried the above code and received the following error: Fatal error: Call to undefined function setup_plugin_hook() in /home/content/11/7839711/html/amember/application/configs/site.php on line 16
same here PHP Fatal error: Call to undefined function setup_plugin_hook() in /......./application/configs/site.php on line 31, v4.2.14 Just realised this is V3 forum, will repost in v4 forum...
Code in this thread is for aMember v3. For aMember v4 use this instead: http://www.amember.com/docs/How_to_add_own_link_to_"Useful_Links"_block_in_member's_area