MOD Linkback For Knowledge Base


Subject: MOD Linkback For Knowledge Base
Here a modification in order to modernize to your IP version 1.2.x.

Naturally fairies the backup of the rows before modifying

We begin:

OPEN
Code: [Download] [Hide] [Select]
/includes/kb_article.php


SEARCH:
Code: [Download] [Hide] [Select]
// $print_url = append_sid( this_kb_mxurl( "mode=article&k=" . $article_id . "&print=true", true ) );
$print_url = append_sid( "./kb.php?mode=article&k=" . $article_id ."&page_num=".($page_num+1)."&start=".$start ."&print=true", true );


AFTER ADD:
Code: [Download] [Hide] [Select]
// START Linkback on kb.php || By J.C. Design ||
if ( ($board_config['url_rw'] == '1') || ( ($board_config['url_rw_guests'] == '1') && ($userdata['user_id'] == ANONYMOUS) ) )
{
$linkback = $article_title . '-kba' . $article_id;
$con_accento = array("à","è","é","ì","ò","ù");
$senza_accento = array("a","e","e","i","o","u");
$linkback = str_replace($con_accento,$senza_accento,$linkback);
$linkback = html_entity_decode($linkback);
$linkback = str_replace("'","'",$linkback);
$linkback = preg_replace("#[^a-zA-Z0-9-_ ]#","",$linkback);
$linkback = str_replace(" ","-",$linkback);
$linkback = str_replace("___","-",$linkback);
$linkback = str_replace("__","-",$linkback);
$linkback = str_replace("--","-",$linkback);
$linkback = str_replace("_-_","-",$linkback);
$linkback = str_replace("", "-", $linkback);
$linkback = strtolower($linkback).'.html';
}
else
{
$linkback = append_sid('kb.' . $phpEx . '?mode=article&k=' . $article_id);
}
// END Linkback on kb.php || By J.C. Design ||



SEARCH:
Code: [Download] [Hide] [Select]
'U_PRINT' => $print_url,


AFTER ADD:
Code: [Download] [Hide] [Select]
// START Linkback on viewtopic.php || By J.C. Design ||
'U_LINKBACK_URL' => 'http://' . $board_config['server_name'] . $board_config['script_path'] . $linkback,
'U_LINKBACK_BBCODE' => '[url=http://' . $board_config['server_name'] . $board_config['script_path'] . $linkback . ']' . $article_title . ' - ' . $board_config['sitename'] . '[/url]',
'U_LINKBACK_HTML' => '<a href="http://' . $board_config['server_name'] . $board_config['script_path'] . $linkback . '">' . $article_title . ' - ' . $board_config['sitename'] . '</a>',

'L_SELECT_LINKBACK_KB_URL' => $lang['Select_Linkback_Kb_Url'],
'L_SELECT_LINKBACK_KB_BBCODE' => $lang['Select_Linkback_Kb_Bbcode'],
'L_SELECT_LINKBACK_KB_HTML' => $lang['Select_Linkback_Kb_Html'],
'L_SHARE_KB_ARTICLE' => $lang['Share_Article_Kb'],
// END Linkback on viewtopic.php || By J.C. Design ||


OPEN /languge/lang_english/lang_main.php

SEARCH:
Code: [Download] [Hide] [Select]
//$lang[''] = '';


BEFORE ADD:

Code: [Download] [Hide] [Select]
//Linkback KB || By J.C. Design ||
$lang['Select_Linkback_Kb_Url'] = 'Click in order to select the link direct to this article.';
$lang['Select_Linkback_Kb_Bbcode'] = 'Click in order to select the BBCode code to use in the forums.';
$lang['Select_Linkback_Kb_Html'] = 'Click in order to select the link HTML code to use in the sites or blog.';
$lang['Share_Article_Kb'] = 'Share this Article';



OPEN templates/*/kb_article_body.tpl

SEARCH:
Code: [Download] [Hide] [Select]
</span>
</td>
</tr>
<!-- END switch_pages -->
<tr><td class="cat" valign="middle" align="center"><span class="post-buttons">&nbsp;{EDIT_IMG}</span>&nbsp;</td></tr>
</table>{IMG_TFL}{IMG_TFC}{IMG_TFR}


AFETR ADD:
Code: [Download] [Hide] [Select]
{IMG_THL}{IMG_THC}<span class="forumlink">{L_SHARE_KB_ARTICLE}</span>{IMG_THR}<table class="forumlinenb" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<form name="select_all">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="row1" width="120"><label for="linkback_url" class="post-details" style="cursor:pointer;" title="{L_SELECT_LINKBACK_KB_URL}"><b>URL:</b></label></td>
<td class="row2"><textarea id="linkback_url" style="width:99%;height:15px;" readonly="readonly" onClick="javascript:this.form.linkback_url.focus();this.form.linkback_url.select();" class="gensmall">{U_LINKBACK_URL}</textarea>
</td>
</tr>
<tr>
<td class="row1" width="120"><label for="linkback_html" class="post-details" style="cursor:pointer;" title="{L_SELECT_LINKBACK_KB_HTML}"><b>HTML:</b></label></td>
<td class="row2"><textarea id="linkback_html" style="width:99%;height:15px;" readonly="readonly" onClick="javascript:this.form.linkback_html.focus();this.form.linkback_html.select();" class="gensmall">{U_LINKBACK_HTML}</textarea>
</td>
</tr>
<tr>
<td class="row1" width="120"><label for="linkback_bbcode" class="post-details" style="cursor:pointer;" title="{L_SELECT_LINKBACK_KB_BBCODE}"><b>BBCode:</b></label></td>
<td class="row2"><textarea id="linkback_bbcode" style="width:99%;height:15px;" readonly="readonly" onClick="javascript:this.form.linkback_bbcode.focus();this.form.linkback_bbcode.select();" class="gensmall">{U_LINKBACK_BBCODE}</textarea>
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td class="spaceRow" colspan="5"><img src="{SPACER}" width="1" height="3" alt=""></td>
</tr>
</table>{IMG_TFL}{IMG_TFC}{IMG_TFR}


EoM


I hope you or useful :mrblue:

Last edited by FedericoBiccheddu on Mon 22 Dec, 2008 18:42; edited 1 time in total
Subject: Re: MOD Linkback For Knowledge Base
thx but i think that file is not right ;) >>
Quote:
OPEN templates/*/album_showpage_body.tpl

Profile PM  
Subject: Re: MOD Linkback For Knowledge Base
Thast is? :oops:

screen

Subject: Re: MOD Linkback For Knowledge Base
here look at the kb_article.php and you will find the right file

i had marked it for you

Quote:
// Build page

if ( !$print_version )
{
if ( $reader_mode )
{
$template->set_filenames( array( 'body' => 'kb_article_reader.tpl' ) );
}
else
{
$template->set_filenames( array( 'body' => 'kb_article_body.tpl' ) );
}
}
else
{
$template->set_filenames( array( 'body' => 'kb_article_body_print.tpl' ) );
}

Profile PM  
Subject: Re: MOD Linkback For Knowledge Base
OMG

Sorry, I badly had read and understood :oops:

Excuse me :mrblue:


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.2265s (PHP: 9% SQL: 91%)
SQL queries: 11 - Debug Off - GZIP Enabled