collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 466
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Manually Adding Shoutbox  (Read 7203 times)

0 Members and 1 Guest are viewing this topic.

Offline xKroniK13x

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • Coding is Fun
    • The Quad Connection
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Manually Adding Shoutbox
« on: May 20, 2014, 07:37:51 PM »
Hello guys, it's been a while since I've posted here. I have a quick question. I am currently implementing a mobile solution to my website, and am having some trouble. I am trying to add the shoutbox to just the BoardIndex template (so that regardless of the shoutbox settings, it is ONLY shown on the board index page). I cannot, for the life of me, figure out how to manually add the shoutbox to the page. I looked through all of the installation scripts for Simple Portal, and I've also attempted to pull some of the php from the Shoutbox template files... to no avail.

Anyone have any guidance here? Thank for the help!
Here to help who I can.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Manually Adding Shoutbox
« Reply #1 on: May 20, 2014, 08:34:01 PM »
You will be able to do this using a block with custom display options. 
The ~action|forum should do the trick.
Make sure you have enabled SimplePortal blocks in the forum.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline xKroniK13x

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • Coding is Fun
    • The Quad Connection
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Manually Adding Shoutbox
« Reply #2 on: May 21, 2014, 08:01:11 AM »
You will be able to do this using a block with custom display options. 
The ~action|forum should do the trick.
Make sure you have enabled SimplePortal blocks in the forum.

It appears on every theme BUT the mobile theme. I believe it's because the SimplePortal install script failed on the mobile theme. I can't seem to get it to do any modifications on the theme.
Here to help who I can.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Manually Adding Shoutbox
« Reply #3 on: May 22, 2014, 09:46:02 AM »
SimplePortal only makes 2 changes to themes, and these would NOT prevent any simpleportal blocks from showing.
So this is not the main cause of your problem.

I imagine that the main cause of your problem is that SimplePortal will disable itself if the constant WIRELESS is defined
This is because, in SMF, WIRELESS is only defined in the case of WAP, WAP2, or IMODE -- all of which indicate old phone browsers that can't handle a lot of HTML and CSS (and were built to operate on old, extremely low bandwidth cell data networks, back in the days when cell phones were designed to be used mainly for audio communications).

So I am going to guess again that your mobile theme comes with a mod in index.php that detects common mobile browsers, sets WIRELESS and WIRELESS_PROTOCOL, and uses the mobile theme.
This is just a guess; I am not familiar with any mobile mods or themes.

If you share with us the section of index.php which follows loadSession(), we may be able to help you make some changes that will allow SimplePortal to work with this mod's redefinition of what WIRELESS means.

Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline xKroniK13x

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • Coding is Fun
    • The Quad Connection
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Manually Adding Shoutbox
« Reply #4 on: May 22, 2014, 02:03:12 PM »
This is the part of index.php after the loadSession(). I don't see any changes... or at least none that would change themes, etc.

Code: [Select]
// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
if (isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']))
unset($_SESSION['nowap']);
elseif (isset($_REQUEST['nowap']))
$_SESSION['nowap'] = true;
elseif (!isset($_SESSION['nowap']))
{
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
$_REQUEST['wap2'] = 1;
elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
$_REQUEST['imode'] = 1;
else
$_REQUEST['wap'] = 1;
}
}

if (!defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' : '')));

// Some cellphones can't handle output compression...
$modSettings['enableCompressedOutput'] = '0';
// !!! Do we want these hard coded?
$modSettings['defaultMaxMessages'] = 5;
$modSettings['defaultMaxTopics'] = 9;

// Wireless protocol header.
if (WIRELESS_PROTOCOL == 'wap')
header('Content-Type: text/vnd.wap.wml');
}

// Restore post data if we are revalidating OpenID.
if (isset($_GET['openid_restore_post']) && !empty($_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]['post']) && empty($_POST))
{
$_POST = $_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]['post'];
unset($_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]);
}

I am using a modified version of this theme, and am using this mod for detection.

Thanks for the help!
Here to help who I can.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Manually Adding Shoutbox
« Reply #5 on: May 22, 2014, 02:29:19 PM »
You can go through the manual installation instructions for the mod yourself.
http://custom.simplemachines.org/mods/index.php?action=parse;mod=3349;attach=201257;smf_version=2.0.7
I suspect, if it is anywhere, that Subs-MobileDetect.php is the culprit.

I have not scoured any of this code myself.

The author of that mod, emanuele seems like a great guy to me.He can be very helpful.  Explain the problem, and ask if the mod does anything to set WIRELESS for other clients than the wap, wap2, and imode clients that out-of-the-box SMF does.  He can point you at the correct portion of the code, and coming up with some way to make the two mods and the theme compatable will be much easier after that, I think.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline xKroniK13x

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • Coding is Fun
    • The Quad Connection
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Manually Adding Shoutbox
« Reply #6 on: May 22, 2014, 02:36:01 PM »
You can go through the manual installation instructions for the mod yourself.
http://custom.simplemachines.org/mods/index.php?action=parse;mod=3349;attach=201257;smf_version=2.0.7
I suspect, if it is anywhere, that Subs-MobileDetect.php is the culprit.

I have not scoured any of this code myself.

The author of that mod, emanuele seems like a great guy to me.He can be very helpful.  Explain the problem, and ask if the mod does anything to set WIRELESS for other clients than the wap, wap2, and imode clients that out-of-the-box SMF does.  He can point you at the correct portion of the code, and coming up with some way to make the two mods and the theme compatable will be much easier after that, I think.

I'll take a look at the Subs-MobileDetect script and see what I can come up with. I'll report back with my findings, whether on my own, or with the help of the developer.  8)
Here to help who I can.

Offline xKroniK13x

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • Coding is Fun
    • The Quad Connection
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Manually Adding Shoutbox
« Reply #7 on: May 22, 2014, 07:55:47 PM »
So I've been thinking about it and doing some trial and error... I disabled the WIRELESS testing by a few lines of code in the index.php placed after the lines of codes above...

Code: [Select]
if (isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode'])) {
unset($_REQUEST['wap']);
unset($_REQUEST['wap2']);
unset($_REQUEST['imode']);
}

And then I was thinking about it... it is indeed an issue with the theme. If I disable the auto detection mod, and just set the forum default theme to the mobile theme, it still will not display the shoutbox (or any block, for that matter). Maybe the easiest thing would be to make a blank page with the shoutbox, and iFrame it into the theme.
« Last Edit: May 22, 2014, 09:06:28 PM by xKroniK13x »
Here to help who I can.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Manually Adding Shoutbox
« Reply #8 on: May 23, 2014, 03:04:02 PM »
You would also have to prevent WIRELESS from being defined in index.php and/or portal standalone.php. 
Can you use the mobile theme on your desktop by Calling it directly?
What happens if you uninstall the mod?

Have you asked Emanuel about the issue?
If you see how SimplePortal works, it works by calling an additional theme layer, which can be layered into any theme -- unless it is disabled. 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline xKroniK13x

  • Semi Newbie
  • *
  • Posts: 21
  • Gender: Male
  • Coding is Fun
    • The Quad Connection
  • SMF Version: 2.0.7
  • SP Version: 2.3.5
Re: Manually Adding Shoutbox
« Reply #9 on: May 23, 2014, 09:46:49 PM »
You would also have to prevent WIRELESS from being defined in index.php and/or portal standalone.php. 
Can you use the mobile theme on your desktop by Calling it directly?
What happens if you uninstall the mod?

Have you asked Emanuel about the issue?
If you see how SimplePortal works, it works by calling an additional theme layer, which can be layered into any theme -- unless it is disabled.

I have not spoken to Emanuel, simply because I over-rode the setting of WIRELESS with the code I posted above. I did get my SimplePortal integration working, thanks to an SMF forum member named filmstarr, who recently started modifying the theme again to update it to meet new mobile standards. It is a little rough at the moment, but completely functional.

Thanks a ton for the help... and for future people that may run into the same problem, this is a link to the GitHub for the new theme, that is working with SP right now.
Here to help who I can.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Manually Adding Shoutbox
« Reply #10 on: May 27, 2014, 03:01:35 PM »
I'm glad that theme changes helped you get this working.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?