Skip to:
Content
Pages
Categories
Search
Top
Bottom

"No Results Found" message when linking to private forum topic


  • sarau
    Participant

    @sarau

    I set up a forum for a church website. The forum is private and is only for the parishioners who have registered. When you send out a link to a topic on the forum, you get “No Results Found” if you aren’t logged in. This is big usability issue. People are going to assume there is something wrong with the link rather than realize that they just need to sign-in. How can have it say “you need to login in” rather than say “No Results Found”? Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

  • Robin W
    Moderator

    @robin-w

    “When you send out a link to a topic on the forum, you get “No Results Found” ” – sorry I’m being thick – how are you sending out a link – is this in a newsletter or otherwise?


    sarau
    Participant

    @sarau

    When someone at the church sends an email to the parishioners with a link to a topic in the forum, anyone who follows the link who is not signed in will see a page that says “No Results Found.” This is extremely misleading and makes it seem like there is a typo or some problem with the url. If someone who is already signed in follows the link, there is no problem and they see the topic just fine. A message that says “You need to be signed in to see the forum” would be far more helpful and less confusing language. I just don’t know how to change that language or if it’s even possible to change it.


    Robin W
    Moderator

    @robin-w

    Ok, so

    1. Can you tell me what wordpress theme you’re using or post the url.
    2. If I said “copy, rename and edit this xx.php file” would you be terrified ?


    sarau
    Participant

    @sarau

    Hi Robin,
    I’m using a child theme of the Elegant Themes Chameleon Theme. Regarding question 2, not at all. I’m not a php developer but I’m not afraid to edit a php file. I’m comfortable creating php include files and that sort of thing. I really appreciate your help with this!


    Robin W
    Moderator

    @robin-w

    ok,

    What I’d suggest you do is look in the main theme for a 404.php, and edit this to give a login link.

    (If it doesn’t have a 404.php, then copy a page.php or index.php file across to your child theme and rename it 404.php. Look for the “loop” part of the code, and put the stuff in there instead)

    You could then edit this file to have a link to your login and some different text.

    So for instance if the 404.php files says “oops sorry this link appears to be broken”

    you could amend this to :

    This page cannot display. This maybe because you are not logged in. To login click here

    or however your users login on.

    They will probably go to the home page once logged in, so having the relevant posts in say the sidebar (eg latest topics widget) will let them quickly navigate to the post.

    If any of the above not clear, please do come back.


    sarau
    Participant

    @sarau

    Hi Robin,
    Sorry for the long delay. I got sided-tracked. I followed your advice and I found something like a 404.php. The page is called no-results.php I found the text that I need to edit on the page and made changes to it however, because the text is displayed with the use of php, I’m not sure how to make it recognize the html hypertext link I added. Is it possible to make a link active within this code? It would be convenient to just click on the text and get where you need to go, if that’s possible. Here’s the code that I’m referring to:

    <p><?php esc_html_e('The page you requested could not be found or could not be displayed. If you are a parishioner and you are trying to access a forum page, it may be that you <a href="http://www.url-here/">need to log in</a>. You can do so on the forum page in the right sidebar. Otherwise, try refining your search, or use the navigation above to locate the post.','Chameleon'); ?></p>

    I can remove the anchor tag if I need to but it would be nice to have the link.

    On another, related note, when you go to the top level forum page, if you aren’t logged in it displays text that says “Oh bother! No forums were found here!” I’m pretty sure this text is coming from the bbPress plug-in. Do you know if there is a way to customize what it says here as well?

    Thanks again for all your help!


    Robin W
    Moderator

    @robin-w

    ok, yes I can probably fix your code above, and if you want to continue down that road, I’ll do some digging when I get a moment – just come back and let me know.

    However having looked at a solution for doing this at forum level I’ve sorted a different way to do this which works at topic level and seems much neater for the user, but will require a very small amount of discipline when posting a topic, but which solves both issues above.

    It takes a little setting up, and apologies that I sent you down the 404 route before I found this maybe (or maybe not) better way !

    So this solution requires that
    You have users set at wordpress to subscriber (or above) and at bbpress as participant (or above)
    that you have a separate menu item for your private forum – as users don’t see the private forum on the index when not logged in, and that this url is used in messages rather than the direct forum id (logged in users will have both choices – menu item and forum index!)

    If that’s ok, then set the forum up as follows – looks long, but is quite easy

    This solution

      uses the restrict content plugin to create a login prompt if the user is not logged on
      sets the forums to private so that they are not seen on the main index
      creates a page just for that forum, which the restrict content plugin can then use to display the need to be logged in message and login boxes
      Any topics created in the forum that need specific urls in newsletters etc. are set to subscriber – 30 seconds additional work!)

    1.Install “restrict content” plugin
    Dashboard>plugins>add new
    search for “Restrict Content” and it’s then one called just that
    Install and activate
    2. go into dashboard>settings>restrict content and add the following text (you can tailor it to say what you want) to all the options
    Sorry, you need to be a member to see this area. Login if need be [bbp-login]
    3. Go into Dashboard>forums>whichever forum and change to visibility ‘private’. This will stop this forum being seen in the main index unless logged in, so we’ll need to add a menu item later on so not logged in users can see it
    4. Find out the ID of the forum you have set to private
    This link shows you how
    http://www.authorcode.com/forums/topic/how-to-get-forum-id-in-bbpress/
    5. Create a new page called whatever eg “free speech forum”
    and put the following code into it
    [bbp-single-forum id=2922] where the id number is the number that you found out in 4. above
    6. Within this page you’ll also see below the main text you’ve just entered a new box called “restrict content” set this to subscriber (or higher is you’re really restricting).
    7. add this page to your menu’s if need be

    ALL THE ABOVE ONLY NEEDS TO BE DONE ONCE !

    If a user is logged in, and selects the menu item, they’ll just go straight into the forum.
    If they are not logged in and select the menu item, they’ll get the message you set up in 2. above together with the login boxes and having logged in will see the forum

    For topics :

    where you want a logon prompt to appear – presumably only topics in the newsletter (as it is only these that people will be entering a direct url for) – you need to go into Dashboard>topics and underneath the text you’ll see the restrict content box, change this to subscriber and they’ll get the prompt if not logged on !

    give it a go, or come back and say you want to carry down the 404 route and I’ll try and help you further on that !


    Stephen Edgar
    Keymaster

    @netweb

    When you send out a link to a topic on the forum, you get “No Results Found” if you aren’t logged in. This is big usability issue. People are going to assume there is something wrong with the link rather than realize that they just need to sign-in.

    For the record bbPress is specifically designed this way to 404 unless the user is logged in.

    In case you go down the 404 route here is the code you need based on your above code:

    
    <p>
    <?php esc_html_e('The page you requested could not be found or could not be displayed. If you are a parishioner and you are trying to access a forum page, it may be that you ','Chameleon'); ?> <a href="http://www.url-here/">need to log in</a><?php esc_html_e('. You can do so on the forum page in the right sidebar. Otherwise, try refining your search, or use the navigation above to locate the post.','Chameleon'); ?></p>
Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar