Topic Title as Weblink - Open link in new page?
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Topic Title as Weblink - Open link in new page?
I'm using version 1.0.3 of the Topic Title as Weblink mod and am on phpBB version 2.0.21
I have this mod installed and it's working great... I'd just like the links to open in a new page.
I found a thread here with some instructions... but I think it's an old thread for an old version of the mod and phpBB as the code referenced isn't even in the newest version of the mod.
Thanks for the help! Sorry I don't speak German.
I have this mod installed and it's working great... I'd just like the links to open in a new page.
I found a thread here with some instructions... but I think it's an old thread for an old version of the mod and phpBB as the code referenced isn't even in the newest version of the mod.
Thanks for the help! Sorry I don't speak German.
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Try this:
Code fixed.
Code: Alles auswählen
#
#-----[ OPEN ]-----
#
viewforum.php
#
#-----[ FIND ]-----
#
$topic_edit = '';
if ( $topic_rowset[$i]['topic_type'] == POST_TITLE_LINK )
#
#-----[ BEFORE, ADD ]-----
#
$target = '';
#
#-----[ FIND ]-----
#
$view_topic_url = $row['post_text'];
#
#-----[ AFTER, ADD ]-----
#
$target = 'target="_blank"';
#
#-----[ FIND ]-----
#
'TOPIC_EDIT' => $topic_edit,
#
#-----[ AFTER, ADD ]-----
#
'TOPIC_TARGET' => $target,
#
#-----[ OPEN ]-----
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]-----
#
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
#
#-----[ IN-LINE FIND ]-----
#
class="topictitle"
#
#-----[ IN-LINE BEFORE, ADD ]-----
#
{topicrow.TOPIC_TARGET}
Zuletzt geändert von oxpus am Mi 11.Okt, 2006 18:01, insgesamt 1-mal geändert.
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Thanks!
Well... I didn't get any errors... but the links aren't opening in a new page still. Could be because I'm using the MorpheusX template and so the template code isn't exactly the same. Here's my topic row code... you can see here where I placed the topicrow.TARGET code:
Any ideas?
Well... I didn't get any errors... but the links aren't opening in a new page still. Could be because I'm using the MorpheusX template and so the template code isn't exactly the same. Here's my topic row code... you can see here where I placed the topicrow.TARGET code:
Code: Alles auswählen
<!-- BEGIN topicrow -->
<tr>
<td class="row4" align="center" valign="middle" width="21" style="padding: 1px;"><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="17" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /></td>
<td class="row1h{topicrow.XS_NEW}" width="100%" {T_ONCLICK}="window.location.href='{topicrow.U_VIEW_TOPIC}'"><span class="genmed">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}</span><span class="topiclink{topicrow.XS_NEW}"><a {topicrow.TARGET} class="topiclink{topicrow.XS_NEW}" href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>{topicrow.TOPIC_EDIT}</span><span class="gensmall"><br>{topicrow.TOPIC_DESCRIPTION}<br />
<span class="gotopage">{topicrow.GOTO_PAGE}</span></span></td>
<td class="row2" align="center" valign="middle"><span class="gen">{topicrow.REPLIES}</span></td>
<td class="row3" align="center" valign="middle"><span class="gensmall">{topicrow.TOPIC_AUTHOR}</span></td>
<td class="row2" align="center" valign="middle"><span class="gen">{topicrow.VIEWS}</span></td>
<td class="row3" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
</tr>
<!-- END topicrow -->not really. it's a pretty new phpBB install and the only other forum mod i have is a topic description mod that i use in conjunction with this weblink one so that i can have a description for the links.
here's the blocks around where you had me add the viewforum.php code:
here's the blocks around where you had me add the viewforum.php code:
Code: Alles auswählen
$target = '';
$topic_edit = '';
if ( $topic_rowset[$i]['topic_type'] == POST_TITLE_LINK )
{
$topic_edit = ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) ? ' <a href="'.$view_topic_url.'" class="nav"><img src="'.$images['icon_edit'].'" border="0" /></a>' : '';
$sql = "SELECT post_text FROM " . POSTS_TEXT_TABLE . "
WHERE post_id = ".$topic_rowset[$i]['topic_first_post_id'];
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not create topic title weblink', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$view_topic_url = $row['post_text'];
$target="_blank";
}
$db->sql_freeresult($result);
$last_post_url = '';
$views = '';
$replies = '';
$last_post_author = '';
$newest_post_img = '';
}Code: Alles auswählen
$template->assign_block_vars('topicrow', array(
'TOPIC_DESCRIPTION' => (trim(htmlspecialchars($topic_rowset[$i]['topic_description'])) != "") ? htmlspecialchars($topic_rowset[$i]['topic_description']) . "<br>" : "",
'ROW_COLOR' => $row_color,
'ROW_CLASS' => $row_class,
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_FOLDER_IMG' => $folder_image,
'TOPIC_AUTHOR' => $topic_author,
'GOTO_PAGE' => $goto_page,
'REPLIES' => $replies,
'NEWEST_POST_IMG' => $newest_post_img,
'TOPIC_TITLE' => $topic_title,
'TOPIC_EDIT' => $topic_edit,
'TOPIC_TARGET' => $target,
'TOPIC_TYPE' => $topic_type,
'VIEWS' => $views,
'FIRST_POST_TIME' => $first_post_time,
'LAST_POST_TIME' => $last_post_time,
'LAST_POST_AUTHOR' => $last_post_author,
'LAST_POST_IMG' => $last_post_url,
'L_TOPIC_FOLDER_ALT' => $folder_alt,
'U_VIEW_TOPIC' => $view_topic_url)
Zuletzt geändert von JKeats am Mi 11.Okt, 2006 00:06, insgesamt 1-mal geändert.
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Ahrghhh, yes, sorry:
Replace in the viewtopic_body.tpl {topicrow.TARGET} with {topicrow.TOPIC_TARGET} ...
Replace in the viewtopic_body.tpl {topicrow.TARGET} with {topicrow.TOPIC_TARGET} ...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
- oxpus
- Administrator
- Beiträge: 28735
- Registriert: Mo 27.Jan, 2003 22:13
- Wohnort: Bad Wildungen
- Kontaktdaten:
Öhm, yes... The target will be contains just the half of the code.
Please replace in viewforum.php
with
Please replace in viewforum.php
Code: Alles auswählen
$target="_blank";Code: Alles auswählen
$target = 'target="_blank"';Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!