Jump to content


"My Assistant" Link for Portal Block


  • You cannot reply to this topic
No replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 20 September 2004 - 12:19 AM

This code should only display the "My Assistant" link for logged in users. It should also use a popup like the forum "My Assistant" link does.

If you use a directory name for your IPB besides "forums" you will need to change the parts of the /mkportal/templates/default/tpl_main.php javascript in red below to reflect your forum path.

BACKUP YOUR FILES FIRST!!!


[size=13]1)-----------[/size]

FIND:
[quote name='/mkportal/templates/default/tpl_main.php']
   
   
   
   
   
    {$title}

<script language="JavaScript" type="text/javascript" src="{$js}">[/quote]


ADD BELOW:
[quote name='/mkportal/templates/default/tpl_main.php']<script language='JavaScript' type="text/javascript">
<!--
function buddy_pop() { window.open('forums/index.{$ibforums->vars['php_ext']}?act=buddy&s={$ibforums->session_id}','BrowserBuddy','width=250,height=500,resizable=yes,scrollbars=yes'); }
function chat_pop(cw,ch)  { window.open('forums/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}&act=chat&pop=1','Chat','width='+cw+',height='+ch+',resizable=yes,scrollbars=yes'); }
function multi_page_jump( url_bit, total_posts, per_page )
{
pages = 1; cur_st = parseInt("{$ibforums->input['st']}"); cur_page  = 1;
if ( total_posts % per_page == 0 ) { pages = total_posts / per_page; }
else { pages = Math.ceil( total_posts / per_page ); }
msg = "{$ibforums->lang['tpl_q1']}" + " " + pages;
if ( cur_st > 0 ) { cur_page = cur_st / per_page; cur_page = cur_page -1; }
show_page = 1;
if ( cur_page < pages )  { show_page = cur_page + 1; }
if ( cur_page >= pages ) { show_page = cur_page - 1; }
else { show_page = cur_page + 1; }
userPage = prompt( msg, show_page );
if ( userPage > 0  ) {
if ( userPage < 1 )    {    userPage = 1;  }
if ( userPage > pages ) { userPage = pages; }
if ( userPage == 1 )    {    start = 0;    }
else { start = (userPage - 1) * per_page; }
window.location = url_bit + "&st=" + start;
}
}
//-->
[/quote]



[size=13]2)-----------[/size]

FIND:
[quote name='/mkportal/blocks/forumnav.php']$content = "";



  $content = "
        images/atb_npost.gif\" align=\"absmiddle\"> base_url}act=Search&CODE=getnew\">{$this->lang['m_newpost']}
  images/atb_members.gif\" align=\"absmiddle\"> base_url}act=Members\">{$this->lang['m_users']}
  images/atb_calendario.gif\" align=\"absmiddle\"> base_url}act=calendar\">{$this->lang['m_calendar']}
  images/atb_help.gif\" align=\"absmiddle\"> base_url}act=Help\">{$this->lang['m_help']}
        ";[/quote]


REPLACE WITH:
[quote name='/mkportal/blocks/forumnav.php']$content = "";
 
if(!$ibforums->member['id']) {
$content = "images/atb_npost.gif\" align=\"absmiddle\"> base_url}act=Search&CODE=getnew\">{$this->lang['m_newpost']}

  images/atb_members.gif\" align=\"absmiddle\"> base_url}act=Members\">{$this->lang['m_users']}

  images/atb_calendario.gif\" align=\"absmiddle\"> base_url}act=calendar\">{$this->lang['m_calendar']}

  images/atb_help.gif\" align=\"absmiddle\"> base_url}act=Help\">{$this->lang['m_help']}";
}

else {
$content = "images/atb_npost.gif\" align=\"absmiddle\"> base_url}act=Search&CODE=getnew\">{$this->lang['m_newpost']}

  images/atb_members.gif\" align=\"absmiddle\"> base_url}act=Members\">{$this->lang['m_users']}

  images/atb_calendario.gif\" align=\"absmiddle\"> base_url}act=calendar\">{$this->lang['m_calendar']}

  images/atb_help.gif\" align=\"absmiddle\"> base_url}act=Help\">{$this->lang['m_help']}images/atb_assistant.gif\" align=\"absmiddle\"> {$this->lang['m_assistant']}";[/quote]


[size=13]3)-----------[/size]

FIND:
[quote name='/mkportal/lang/English/lang_global.php']// ----------------------------------------------------
$langmk['group_forum'] = "Forums Menu";
// ----------------------------------------------------
$langmk['m_newpost'] = "New posts";
$langmk['m_search'] = "Search";
$langmk['m_users'] = "Users";
$langmk['m_calendar'] = "Calendar";
$langmk['m_help'] = "Help";[/quote]

ADD AFTER:
[quote name='/mkportal/lang/English/lang_global.php']$langmk['m_assistant'] = "My Assistant";[/quote]


[size=13]4)-----------[/size]

Upload your "atb_assistant.gif" into the /mkportal/templates/Forum_Skin/images/ directory.


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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users