Thread Rating:
  • 11 Vote(s) - 4.27 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] DVZ Shoutbox 2.3.4
(2017-03-31, 01:20 AM)metulburr Wrote: @Noobly
Quote:I want it on the index as it is as well as on a separate page called livechat. It must work on both pages simultaneously.

Quote:Did you ever come right with this? @metulburr if you have do you mind PMing me the solution, I am at my wits end here.
wow yeah i have come a long way in just 5 months of tinkering with things. 

Yes i figured it out. You need to add this exact line in your hooks in the file /inc/plugins/dvz_shoubox.php (i put it right after the other hooks)
$plugins->add_hook('dvz_shoutbox_start',  ['dvz_shoutbox', 'load_window']); 
//  load Shoutbox window to {$dvz_shoutbox} variable 

After this, you can put in {$dvz_shoutbox} variable in both your index page and in any custom pages

Why this is not in the settings i am not sure? It seems like it should be

An example would be our chat here on the index at the bottom
https://python-forum.io/index.php

as well as on a custom page by itself
https://python-forum.io/shoutbox.php

Does not seem to work, how did you built the shoutbox.php page?
Perhaps this Shoutbox is not comparable with this tutorial ->  https://coderwall.com/p/jnw-pg/mybb-custom-pages
Reply
this is the exact content of my page

shoutbox.php which resides in mybb root location
<?php

define('IN_MYBB', '1');
define('THIS_SCRIPT', 'shoutnox.php');
require "./global.php";

$plugins->run_hooks("dvz_shoutbox_start");

add_breadcrumb("Shoutbox", "shoutbox.php");
eval("\$page = \"".$templates->get("shoutbox")."\";");
output_page($page);



and my shoutbox template in global templates
            <html>
            <head>
            <title>{$mybb->settings['bbname']} - Shoutbox</title>
            {$headerinclude}
            </head>
            <body id="shoutbox">
            {$header}
{$dvz_shoutbox}
            {$footer}
            </body>
            </html>
Reply
(2017-03-31, 11:29 AM)metulburr Wrote: this is the exact content of my page

shoutbox.php which resides in mybb root location
<?php

define('IN_MYBB', '1');
define('THIS_SCRIPT', 'shoutnox.php');
require "./global.php";

$plugins->run_hooks("dvz_shoutbox_start");

add_breadcrumb("Shoutbox", "shoutbox.php");
eval("\$page = \"".$templates->get("shoutbox")."\";");
output_page($page);



and my shoutbox template in global templates
            <html>
            <head>
            <title>{$mybb->settings['bbname']} - Shoutbox</title>
            {$headerinclude}
            </head>
            <body id="shoutbox">
            {$header}
{$dvz_shoutbox}
            {$footer}
            </body>
            </html>

One moment.

Holy God @metulburr

I love you so damn much!!! Can I send you wine or kisses or something?

Side note:

Is there a way with CSS that I can make the full screen one a little longer ?

On the index page I like the chat box with it's smaller height

However on the shoutbox page would it be possible to make that one a bit longer, to fill up more of the screen's height?

Height: 95vh: would be legit I suppose
Reply
Quote:Is there a way with CSS that I can make the full screen one a little longer ?
our forum voted to remove the shoutbox from the index. Otherwise i was trying to do the same thing.

You cannot change one setting for the other, they are the same. And they both are one, showing on two different pages (at least as of now). However since i wanted it longer on the custom page, and shorter on the index, i was thinking of making an iframe to the custom page for the index page, and just restricting the length of the iframe. So you would extend the length in the shoutbox settings very long and in theory it would be long in the custom page, but restricted in the index to x length. Havent done it since we decided to rid the index of the shoutbox (AKA remove the shoutbox index variable), but i think that should work. 

Quote:I love you so damn much!!! Can I send you wine or kisses or something?
if you feel the need
Reply
Sweet stuff again thanks so muchh!!

We just need a way to put a conditional for this:

<div class="window" style="height:{$mybb->settings[\'dvz_sb_height\']}px">
// This is a line in the plugin itself inc/plugins/dvz_shoutbox.php

//Essentially we want to achieve the below so the question becomes how to do a if statement in the template file for the page
IF PAGENAME = Livechat_full {
<div class="window" style="height:95vh;">
} else {
<div class="window" style="height:{$mybb->settings[\'dvz_sb_height\']}px">
}
Reply
Quote:/Essentially we want to achieve the below so the question becomes how to do a if statement in the template file for the page
You can do this with another plugin to allow template conditionals
http://mybbhacks.zingaburga.com/showthread.php?tid=464
Reply
I have that plugin, but for some reason it is not working, can the plugin code be so hard cache that ctrl+F5 is not enough to bust the cache?

As my page seems the same. I even changed <div class="window" style="height:{$mybb->settings[\'dvz_sb_height\']}px">

To <div class="window" style="height:95vh"> as a test, but the page doesnt seem updated.
Reply
whats not working? The plugin or that specific condition? Im not sure enough on that one on how to do that condition to make it work as you expect it to.
Reply
(2017-03-31, 01:32 PM)metulburr Wrote: whats not working? The plugin or that specific condition? Im not sure enough on that one on how to do that condition to make it work as you expect it to.

Both, I tried to change the code directly to height:95vh

That way I know it must work so I refresh the page use inspect element, but it still says height is 160px so it is as if the page as not re-loaded the plugin file if that makes sense at all?
Reply
Quote:but it still says height is 160px so it is as if the page as not re-loaded the plugin file if that makes sense at all?
did you change this in the install template of the plugin file itself, or the actual current dvz_shoutbox template in ACP?

It works for me if i change that line in ACP tmeplates. Unless its your template if condition is not correct?

Quote: can the plugin code be so hard cache that ctrl+F5 is not enough to bust the cache?
you can try a different browser but i doubt it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)