| ||||
| ||||
| Welcome to the UltraBB public support forum! Did you know there is an inexpensive totally integrated gallery available for UltraBB? Read more here: Gallery Details |
| Moderated by: Jim | Page: 1 2 |
|
||||||||||||||
| "My Posts" Link | Rate Topic |
| Author | Post |
|---|
| Posted: Fri Jun 25th, 2010 01:36 am |
|
1st Post |
|
TVDinner Go UCONN!
|
Question - In my QUICK LINKS drop down links I would like to have a link that says My Posts or Go To My Posts that would pull up the posts of the member clicking it. So each member when logged on could quickly go to their posts - this link -
When I am creating the link in the files - what URL do I use so this link will work for each person when they are logged in to see their posts. I hope I explained that correctly, lol Thanks for the help
|
||||||||||||||
| |||||||||||||||
| Posted: Fri Jun 25th, 2010 12:59 pm |
|
2nd Post |
|
bartmanaz License Holder
|
They can already access that info by clicking on their own user name>profile>posts. This would seem to duplicate that capability. Bart
|
|||||||||||||
| ||||||||||||||
| Posted: Fri Jun 25th, 2010 01:01 pm |
|
3rd Post |
|
TVDinner Go UCONN!
|
bartmanaz wrote: They can already access that info by clicking on their own user name>profile>posts. This would seem to duplicate that capability. you are correct - i am trying to eliminate the extra step of having to go to their profile and make it a one click option from any page by putting it on the main navigation Quick Links Menu. On many forums there is a button available to "See My Posts" or "Go to my Posts" on the main menu of options. That is what I am trying to mimic. I know it can be done, I just want to make sure to code it properly to take the people to their specific post page. Thanks.
|
||||||||||||||
| |||||||||||||||
| Posted: Fri Jun 25th, 2010 01:54 pm |
|
4th Post |
|
martin_wynne Licence Holder
|
TVDinner wrote:On many forums there is a button available to "See My Posts" or "Go to my Posts" on the main menu of options. That is what I am trying to mimic. I know it can be done, I just want to make sure to code it properly to take the people to their specific post page. Hi TVD, This link works to create a My Posts button if you put it in the index_header template. I can't tell you where to put it because your theme is different from mine: <a class="navbutton" href="$ base_dir/view_user.php?id=$mark_all_read&posts=1">My Posts</a> Likewise, this link creates a My Started Topics button: <a class="navbutton" href="$ base_dir/view_user.php?id=$mark_all_read&topics_started=1">My Started Topics</a> EDIT: in both cases remove the space between $ and base. The space is needed here to defeat this forum. ($mark_all_read contains the user ID). regards, Martin. Last edited on Fri Jun 25th, 2010 02:08 pm by martin_wynne |
|||||||||||||
| ||||||||||||||
| Posted: Fri Jun 25th, 2010 02:23 pm |
|
5th Post |
|
TVDinner Go UCONN!
|
Martin - thank you very much. I am going to try this today. Much appreciated and I will post back if it works for me. Thank you.
|
||||||||||||||
| |||||||||||||||
| Posted: Fri Jun 25th, 2010 03:28 pm |
|
6th Post |
|
martin_wynne Licence Holder
|
TVDinner wrote: Martin - thank you very much. You're welcome. To be strictly correct you should make the links conditional like this, so that they don't appear for guest visitors. However, if you do this each one must start a new line in the template and be all on one line. Remove the spaces between $ and base: ?mark_all_read('<a class="navbutton" href="$ base_dir/view_user.php?id=$mark_all_read&posts=1">My Posts</a>':'') ?mark_all_read('<a class="navbutton" href="$ base_dir/view_user.php?id=$mark_all_read&topics_started=1">My Started Topics</a>':'') Note that :'') at the end is two single quotes, not a double quote. regards, Martin. Last edited on Fri Jun 25th, 2010 03:33 pm by martin_wynne |
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 05:17 am |
|
7th Post |
|
TVDinner Go UCONN!
|
Hi Martin - question I have my Quick Links drop down options in the Menu2 template. So when I try to add this code to the other menu options it does not work
It creates the link in the drop down menu but I get and "Invalid request" Error page when a user clicks the link what am I doing wrong?
|
||||||||||||||
| |||||||||||||||
| Posted: Sat Jun 26th, 2010 09:19 am |
|
8th Post |
|
martin_wynne Licence Holder
|
TVDinner wrote: what am I doing wrong? Hi TVD, You didn't read my post: This link works to create a My Posts button if you put it in the index_header template. The user ID isn't available in the menu templates. It would need a mod to the php file (unless Jim or David can see otherwise?). I've posted php mods in the past but Jim is not too happy about them, and they will fail after the next upgrade. Instead I provided a mod which anyone can use in the theme editor. Note that you must make the mod in each of your themes. I've added the links to my board, thanks for the suggestion. Attached Image (viewed 63 times):
|
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 10:30 am |
|
9th Post |
|
TVDinner Go UCONN!
|
I like it also in the index header like you have it and will try again. Thanks
|
||||||||||||||
| |||||||||||||||
| Posted: Sat Jun 26th, 2010 12:33 pm |
|
10th Post |
|
TVDinner Go UCONN!
|
OK this worked GREAT putting it on the Home Page. Looks like this:![]() Next question - How do I put those same 2 new buttons on my "New Posts" page in the same place? This page - http://www.watchfreeks.com/index.php?show=recent OR IN THE QUICK LINKS drop down menu so it would be on top of every page? Thank you! Last edited on Sat Jun 26th, 2010 01:15 pm by TVDinner |
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 04:30 pm |
|
11th Post |
|
martin_wynne Licence Holder
|
TVDinner wrote:Next question - How do I put those same 2 new buttons on my "New Posts" page in the same place? Hi TVD, The user ID isn't available in the index_active_topics_header template. All things are possible, but this requires a mod to the index.php file. I can provide the code, but Jim may not approve, and it will almost certainly be lost after the coming upgrade. p.s. I can see the new buttons when I visit your site as a guest (which then produce error messages). To hide them from guest visitors, see my earlier post. regards, Martin.
|
||||||||||||||
| |||||||||||||||
| Posted: Sat Jun 26th, 2010 05:24 pm |
|
12th Post |
|
wingnutter Forever Learning
|
Thanks Martin. This partially worked for me in the theme I tested, but the two buttons are sitting on top of the Forums/Selected/Popular/Recent/Mark all forums, I would prefer them to be beside them on the same line as James had it.
|
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 05:39 pm |
|
13th Post |
|
martin_wynne Licence Holder
|
Hi TVD, It's only one extra line, so here it is. USE THIS ENTIRELY AT YOUR OWN RISK -- the index.php file is critical and if you mess it up your entire board will be wrecked. In index.php find these lines (search for index_active_topics_header): "page_title" => BOARD_NAME, "main_menu" => main_menu(), "current_location" => BOARD_NAME, "pop_ups" => generate_user_popups($user_menus), "board_name" => BOARD_NAME, "show" => $vars["show"]); echo(create_list_header($vars["sort_by"], BASE_DIR . "/index.php?$show_what&sort_by=\$sort_by", $other_vars, "index_active_topics_header")); echo $output; and insert these lines in red where shown: "page_title" => BOARD_NAME, "main_menu" => main_menu(), "current_location" => BOARD_NAME, "pop_ups" => generate_user_popups($user_menus), "board_name" => BOARD_NAME, // FREEKS BEGIN "mark_all_read" => USER_ID, // FREEKS END "show" => $vars["show"]); echo(create_list_header($vars["sort_by"], BASE_DIR . "/index.php?$show_what&sort_by=\$sort_by", $other_vars, "index_active_topics_header")); echo $output; Save and upload the modified index.php file. You can then copy and paste the same code which you used in the index_header template into the index_active_topics_header template. The same buttons will then work in the Recent Posts pages. The // FREEKS lines are optional comments which will help you diff the files when you get the next board upgrade. regards, Martin.
|
||||||||||||||
| |||||||||||||||
| Posted: Sat Jun 26th, 2010 05:45 pm |
|
14th Post |
|
martin_wynne Licence Holder
|
wingnutter wrote: Thanks Martin. This partially worked for me in the theme I tested, but the two buttons are sitting on top of the Forums/Selected/Popular/Recent/Mark all forums, I would prefer them to be beside them on the same line as James had it. Hi Steve, Post the relevant lines of your actual template code and I will mark it up for you. Everyone's theme is different (mine certainly is Do you want the buttons style, or plain text links like mine? Attached Image (viewed 47 times):
|
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 09:15 pm |
|
15th Post |
|
TVDinner Go UCONN!
|
martin_wynne wrote: TVDinner wrote:Next question - How do I put those same 2 new buttons on my "New Posts" page in the same place? Martin When I use the other code it does not show - for example this
This code works for members logged in on the home page, but like you said guests see an error if they click, which makes sense.
Last edited on Sat Jun 26th, 2010 09:19 pm by TVDinner |
|||||||||||||||
| ||||||||||||||||
| Posted: Sat Jun 26th, 2010 09:40 pm |
|
16th Post |
|
wingnutter Forever Learning
|
I hope thsi works Martin; !site_header !start_sidebar <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td valign="top" class="clean" width="100%"> <table width="100%" cellpadding="0" cellspacing="0" class="drwTable drwTableNoBottomBorder"> <tr class="drwDarkYellow"> <td valign="middle" align="center"> <strong>Steve Saunders Goldwing Forums</strong> </td> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0" class="drwTable drwTableNoBottomRow"> <tr class="drwDarkYellowLight"> <td> !button_set_start !tab_selected($tab_caption='<a class="drwnavbutton" href="/forum/">%forums</a>') !tab($tab_caption='<a class="drwnavbutton" href="/forum/selected.html">%selected_topics</a>') !tab($tab_caption='<a class="drwnavbutton" href="/forum/popular.html">%popular_topics</a>') !tab($tab_caption='<a class="drwnavbutton" href="/forum/recent.html">%recent_topics</a>') <a class="navbutton" href="/forum/view_user.php?id=$mark_all_read&posts=1">My Own Posts</a> <a class="navbutton" href="/forum/view_user.php?id=$mark_all_read&topics_started=1">My Own Topics</a> ?mark_all_read('!tab($tab_caption='<a class="drwnavbutton" href="/forum/index.php?mark_all_read=1">%mark_all_forums_read</a>')':'') !button_set_end </td></tr></table> </td> </tr> </table>
|
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 09:42 pm |
|
17th Post |
|
TVDinner Go UCONN!
|
you need to add !tab($tab_caption=' before each line and ') at the end
|
||||||||||||||
| |||||||||||||||
| Posted: Sat Jun 26th, 2010 10:48 pm |
|
18th Post |
|
martin_wynne Licence Holder
|
TVDinner wrote:When I use the other code it does not show Hi TVD, That was all a bit garbled. Start again -- remove everything you have added. Then find the line: <td class="clean" width="100%"> </td> and immediately above it insert these two lines: ?mark_all_read('!tab($tab_caption='<a class="navbutton" href="$ base_dir/view_user.php?id=$mark_all_read&posts=1">My Posts</a>')':'') ?mark_all_read('!tab($tab_caption='<a class="navbutton" href="$ base_dir/view_user.php?id=$mark_all_read&topics_started=1">My Started Topics</a>')':'') Note that each of these two lines must begin on the extreme left and must be all on one line. Important: on each line remove the space between $ and base which is needed only here to defeat this forum. For the same reason, do not copy and paste back the code which you posted here, which this forum has corrupted. regards, Martin.
|
|||||||||||||
| ||||||||||||||
| Posted: Sat Jun 26th, 2010 11:00 pm |
|
19th Post |
|
martin_wynne Licence Holder
|
wingnutter wrote: I hope this works Martin Hi Steve, David has created your own nav button class, so you need to change that, like this: Find the line: !tab($tab_caption='<a class="drwnavbutton" href="$ base_dir/recent.html">%recent_topics</a>') and immediately below it insert these two lines: ?mark_all_read('!tab($tab_caption='<a class="drwnavbutton" href="$ base_dir/view_user.php?id=$mark_all_read&posts=1">My Posts</a>')':'') ?mark_all_read('!tab($tab_caption='<a class="drwnavbutton" href="$ base_dir/view_user.php?id=$mark_all_read&topics_started=1">My Started Topics</a>')':'') Note that each of these two lines must begin on the extreme left and must be all on one line. Important: on each line remove the space between $ and base which is needed only here to defeat this forum. For the same reason, do not copy and paste back any of the code which you posted here, which this forum has corrupted. regards, Martin.
|
||||||||||||||
| |||||||||||||||
| Posted: Sat Jun 26th, 2010 11:31 pm |
|
20th Post |
|
wingnutter Forever Learning
|
Thanks very much Martin and James, this is a very useful addition. James method also worked before I seen your reply, so I updated it with yours and that works fine too. I slightly changed the text on the buttons to the text you used. Attached Image (viewed 54 times): Last edited on Sat Jun 26th, 2010 11:45 pm by wingnutter |
|||||||||||||
| ||||||||||||||
| Current time is 10:18 am | Page: 1 2 |
| UltraBB Forums > UltraBB > Software Assistance > "My Posts" Link | Top |
![]() |