Jump to content


[SMF 1.1 RC2] How to view Topics in new Windows ???


8 replies to this topic

#1 eakkanake

  • Members
  • 13 posts
  • Thailand

Posted 22 May 2006 - 11:45 AM

Hi there, Mr. Visiblesoul.
I have a question to ask you about "How to view Topics in new Windows ???".
I tried to search form www.simplemachines.org but nothing & now it's DOWN.
I study from myself that it have to use script "_blank" in somewhere but I don't know where it has to be. So, I have to disturb you again, Thanks and be rich in your business.

#2 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 22 May 2006 - 09:31 PM

eakkanake said:

Hi there, Mr. Visiblesoul.
I have a question to ask you about "How to view Topics in new Windows ???".
I tried to search form www.simplemachines.org but nothing & now it's DOWN.
I study from myself that it have to use script "_blank" in somewhere but I don't know where it has to be. So, I have to disturb you again, Thanks and be rich in your business.
What version of SMF are you using?

You want all topic links in the forum index to open in new windows?

Honestly this is not a good practice. It breaks the "Back" button and does not allow users with disabilities to navigate your forum. Why do you need this functionality? Most people use the right-click menu or Shift+Left-click to open new windows.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#3 eakkanake

  • Members
  • 13 posts
  • Thailand

Posted 22 May 2006 - 09:46 PM

It's member idea from my Website. They said it's the easiest way to view the Forum. Maybe they don't know how to "Back" to the last page ... hehehe.

#4 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 22 May 2006 - 09:52 PM

eakkanake said:

It's member idea from my Website. They said it's the easiest way to view the Forum. Maybe they don't know how to "Back" to the last page ... hehehe.
What version of SMF?


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#5 eakkanake

  • Members
  • 13 posts
  • Thailand

Posted 22 May 2006 - 09:57 PM

OOPS, Sorry, 1.1 RC2 Please.

#6 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 22 May 2006 - 10:05 PM

OK, I will try to look at this tomorrow. It is late here and my brain isn't working well. ;)


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#7 eakkanake

  • Members
  • 13 posts
  • Thailand

Posted 22 May 2006 - 10:06 PM

Thanks, My Brother.Good Night. ;)

#8 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 24 May 2006 - 03:00 PM

Here are some examples of how to open SMF links in new windows. There are many more but you can figure out the rest by looking at these examples.


The Category link on the forum index can be changed like this...
FIND in /Sources/BoardIndex.php
			$context['categories'][$row_board['ID_CAT']]['link'] = '<a name="' . $row_board['ID_CAT'] . '" href="' . (isset($row_board['canCollapse']) ? $context['categories'][$row_board['ID_CAT']]['collapse_href'] : $context['categories'][$row_board['ID_CAT']]['href']) . '">' . $row_board['catName'] . '</a>';
REPLACE WITH:
			$context['categories'][$row_board['ID_CAT']]['link'] = '<a name="' . $row_board['ID_CAT'] . '" href="' . (isset($row_board['canCollapse']) ? $context['categories'][$row_board['ID_CAT']]['collapse_href'] : $context['categories'][$row_board['ID_CAT']]['href']) . '" target="_blank">' . $row_board['catName'] . '</a>';
The last post link on the forum index can be changed like this...

FIND in /Sources/BoardIndex.php
			$this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '">' . $row_board['short_subject'] . '</a>';
REPLACE WITH:
			$this_last_post['link'] = '<a href="' . $this_last_post['href'] . '" title="' . $row_board['subject'] . '" target="_blank">' . $row_board['short_subject'] . '</a>';
This will make the topic links open in a new window in "Board" view (ex: index.php?board=1.0)...

FIND in /Sources/MessageIndex.php

					'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['firstSubject'] . '</a>'
REPLACE WITH:
					'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0" target="_blank">' . $row['firstSubject'] . '</a>'
I acn't find where to add the target for the board links on the index page. And I am tired of looking. Anyway, this hack is a bad idea in my opinion.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#9 eakkanake

  • Members
  • 13 posts
  • Thailand

Posted 05 June 2006 - 04:00 AM

Thank you very much, Mr. Visiblesoul. Sorry about my disappear for a while. Because There's big DIASTER in my country, Riot. Many people died in this diaster.So, My association (Internet Cafe Council of Thailand) came to help people. Now, Everything is fine. :D




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users