Open Forum Links In New Window? - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Community Archive (https://community.mybb.com/forum-106.html) +--- Forum: Archived Forums (https://community.mybb.com/forum-143.html) +---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html) +----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html) +------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html) +------ Thread: Open Forum Links In New Window? (/thread-94923.html) Pages:
1
2
|
Open Forum Links In New Window? - Jayfore - 2011-05-23 Hello, Does anyone know if there is a way to make forum links open in a new window? I have set up a forum on my site, just for external links/resources, to help my members out. When they click one of these links, it opens the other site in the same window. Obviously, I don't want to direct people completely away from my site -- I would like my site to remain open in its original window. Is there a configuration option for this, that I am missing? This feature is very clunky to use, but I would really like to use it. Thanks! RE: Open Forum Links In New Window? - XxSky DreamerxX - 2011-05-23 As far as I know, there is a way which is custom way & it can be done like this: If you want your link to open a page in a new window use the target="_blank" in the <a href> tag. Targetting the link to "_blank" simply opens a new browser window that will load the linked page.
Other then that, I don't think its possible I am looking for a way to find it and as soon as I do, I will let you know. RE: Open Forum Links In New Window? - Yaldaram - 2011-05-23 Open ./inc/class_parser.php file and find;
and replace it to the following;
RE: Open Forum Links In New Window? - Aries-Belgium - 2011-05-23 (2011-05-23, 07:36 AM)Yaldaram Wrote: This will not work. Why casting a string value to a boolean? Makes no sense at all. Also strstr() is not the appropriate function to use to check if a string contains another string. You should use strpos() instead.
RE: Open Forum Links In New Window? - Jayfore - 2011-05-23 Hmmm... I changed this:
To this:
Now, when I click one of the forum links, nothing ever opens. Did I do something wrong? Thanks! RE: Open Forum Links In New Window? - Aries-Belgium - 2011-05-23 I hadn't checked out the complete code, but find this: and add this on a new line below it:
That should work. However (!!!) there is a much better solution that doesn't require a core modification and that works with all URLs. Add a new MyCode via AdminCP > Configuration > MyCode with these settings: Title: Open internal links in same window Regular expression: Replacement:
RE: Open Forum Links In New Window? - Jayfore - 2011-05-23 (2011-05-23, 01:43 PM)Aries-Belgium Wrote: I hadn't checked out the complete code, but find this: Hmm, after adding that new line, now I get this error when loading the page: Parse error: syntax error, unexpected T_GLOBAL, expecting ';' or '{' in /home2/greatlc9/public_html/testforum/inc/class_parser.php on line 1632 I'm not sure why it's complaining about line 1632 now, as that line is blank:
As for your other option, that would be good for general use, but I don't think it will help me make the "Forum Links" open in new windows. You know how you can create a forum as just a link? That is what I want to open in a new window... The links that people post in threads are already opening in new windows, for the most part. Thanks for your help! RE: Open Forum Links In New Window? - Aries-Belgium - 2011-05-23 Oh, I'm sorry I didn't read the complete thread. I based my answer on the core modification Yaldaram posted which doesn't do what you want. If you haven't made any other modification to that file, download a fresh MyBB zip from this site and replace the modified file with the one from the zip file. For your initial request: I'm not a big fan of core modifications because it will cause problems when updating your MyBB installation. A template modification is less intrusive and easier to control when you upgrade your MyBB installation. Install and activate this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=260 And then go to AdminCP > Templates & Style > Templates > Search/Replace. Search for: Replace with: Then press Search/Replace.That should work. RE: Open Forum Links In New Window? - Tim_bc - 2011-05-27 (2011-05-23, 02:21 PM)Aries-Belgium Wrote: Oh, I'm sorry I didn't read the complete thread. I based my answer on the core modification Yaldaram posted which doesn't do what you want. If you haven't made any other modification to that file, download a fresh MyBB zip from this site and replace the modified file with the one from the zip file. Sorry, I am trying to accomplish the same thing. The link for the plugin, the file is only 1.65KB. This going to sound stupid, but how am I suppose to install this plug in? Copy it to the root? Any help would be greatly appreciated, Tim RE: Open Forum Links In New Window? - Aries-Belgium - 2011-05-27 (2011-05-27, 04:59 AM)Tim_bc Wrote: Sorry, I am trying to accomplish the same thing. The link for the plugin, the file is only 1.65KB. This going to sound stupid, but how am I suppose to install this plug in? Copy it to the root? No, download the .7z file from the page I linked to. You need 7zip to extract it. In that compressed file there is a file called phptl.php. Starting from the MyBB root, navigate to inc -> plugins and place that file in this folder. Now go to AdminCp > Configurtion > Plugins and search for "PHP in Templates" and click "Activate" at the end of the row. |