News:

Wondering if this will always be free?  See why free is better.

Main Menu

Integration hook not working for WAP version

Started by lor300, March 23, 2016, 12:46:28 PM

Previous topic - Next topic

lor300

I do integration to my website. For desktop version it's fine. I changed menu URL with integration hook:

function integrate_actions_hook( &$actionArray ) {

unset( $actionArray['login'] ) ;
unset( $actionArray['login2'] ) ;

unset( $actionArray['activate'] ) ;

unset( $actionArray['register'] ) ;
unset( $actionArray['register2'] ) ;

unset( $actionArray['reminder'] ) ;
 
}



function integrate_menu_buttons_hook( &$buttons ) {

$new_buttons = array(
 
  'login'      => array( 'href' => 'http://mywebsite.com/login.htm'  ),
  'register'  => array( 'href' => 'http://mywebsite.com/signup.html' )

  ) ;
 
  foreach( $new_buttons as $key => $val ) {
   if( isset($buttons[$key]) ) {
    $buttons[$key]['href'] = $val['href'] ;   
   }
  }
}



But it's not working in wap version.

I found in wiki the page for desktop version:
http://wiki.simplemachines.org/smf/Main_menu

How to do it for WAP version?

Illori

i am pretty sure most of those types of hooks dont exist in the wap version due to how they are coded.

lor300

Quote from: Illori on March 23, 2016, 01:05:42 PM
i am pretty sure most of those types of hooks dont exist in the wap version due to how they are coded.

Ok. Any ideas about works around? :)

Kindred

WAP mode is mostly useless anyway and is getting phased out, I believe
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


margarett

Quote from: lor300 on March 23, 2016, 01:33:44 PM
Any ideas about works around? :)
If you really want to invest in that (as other said, wap is really dead nowadays), you need to edit Wireless.template.php

if ($context['user']['is_guest'])
echo '
<p class="windowbg"><a href="', $scripturl, '?action=login;wap2">', $txt['wireless_options_login'], '</a></p>';
else
{
if ($context['allow_pm'])
echo '
<p class="windowbg"><a href="', $scripturl, '?action=pm;wap2">', empty($context['user']['unread_messages']) ? $txt['wireless_pm_inbox'] : sprintf($txt['wireless_pm_inbox_new'], $context['user']['unread_messages']), '</a></p>';
echo '
<p class="windowbg"><a href="', $scripturl, '?action=unread;wap2">', $txt['wireless_recent_unread_posts'], '</a></p>
<p class="windowbg"><a href="', $scripturl, '?action=unreadreplies;wap2">', $txt['wireless_recent_unread_replies'], '</a></p>
<p class="windowbg"><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], ';wap2">', $txt['wireless_options_logout'], '</a></p>';
}


And
if ($context['user']['is_guest'])
echo '
<tr><td><a href="', $scripturl, '?action=login;imode">', $txt['wireless_options_login'], '</a></td></tr>';
else
{
if ($context['allow_pm'])
echo '
<tr><td><a href="', $scripturl, '?action=pm;imode">', empty($context['user']['unread_messages']) ? $txt['wireless_pm_inbox'] : sprintf($txt['wireless_pm_inbox_new'], $context['user']['unread_messages']), '</a></td></tr>';
echo '
<tr><td><a href="', $scripturl, '?action=unread;imode">', $txt['wireless_recent_unread_posts'], '</a></td></tr>
<tr><td><a href="', $scripturl, '?action=unreadreplies;imode">', $txt['wireless_recent_unread_replies'], '</a></td></tr>
<tr><td><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], ';imode">', $txt['wireless_options_logout'], '</a></td></tr>';
}
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

lor300


Advertisement: