nneonneo's Shoutbox

Started by nneonneo, December 26, 2006, 06:58:11 PM

Previous topic - Next topic

pooya

Fatal error: Function name must be a string in /home/warcraft/public_html/forums/Sources/Load.php on line 153
Line 153 : $request = $smcFunc['db_query']('', '

Help, code below.

Quote// Try to load it from the cache first; it'll never get cached if the setting is off.
   if (($modSettings = cache_get_data('modSettings', 90)) == null)
   {
      $request = $smcFunc['db_query']('', '
         SELECT variable, value
         FROM {db_prefix}settings',
         array(
         )
      );
      $modSettings = array();
      if (!$request)
         db_fatal_error();
      while ($row = $smcFunc['db_fetch_row']($request))
         $modSettings[$row[0]] = $row[1];
      $smcFunc['db_free_result']($request);

nneonneo

@funcouldron: Use the instructions for manual installation of a mod.

@natefish: $maxLines in yshout/settings.php

@pooya: That's not in my code...are you on SMF 2 or SMF 1?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

pooya


nneonneo

Try putting "global $smcFunc;" above the first quoted line. I have no idea if this will work, though, since *it is not my code*.

(also, if I might ask, what does this have to do with the shoutbox?)
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

pooya

Ive put this all in one go in index.template.php
[/quote]<?
// YSHOUT HERE - <head> code
   global $boardurl,$shoutFile;
   $shoutFile='home';
   $scripturlparsed = parse_url($scripturl);
   $scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
   $args='';
   foreach($_GET as $key => $value) // passthrough $_GET
      $args.='&'.urlencode($key).'='.urlencode($value);
   echo '
   <script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
   <script src="',$boardurl,'/yshout/settings.js" type="text/javascript"></script>
   <script type="text/javascript"><!-- // --><![CDATA[
   window.onload=function(){loadChat();};
   var shoutFile="',$shoutFile,'";
   var yshout_php="',$scriptpath,'?yshout',$args,'";
   // ]]></script>
   <script src="',$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
   <style type="text/css">
      #yshout {
         font-size: 10px;
         overflow: hidden;
      }
      #yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
      }
      #yshout #shouts { /* main shouts area */
      }
      #yshout .shout { /* one shout */
         margin: 0 0 0; /* Top Bottom Linespacing */
         line-height: 1;
      }
      #yshout .shout-timestamp {
         font-style: normal;
         font-weight: normal;
      }
      #yshout .shout-adminlinks { /* del and ban buttons */
         font-size: 6pt;
         color: #141414;
      }
      #yshout #shout-form {
         margin: 0;
         padding: 0;
      }
      #yshout #shout-form fieldset {
         border: none;
      }
      #yshout #forum-name {
         color: #666666;
         width: 70px;
         margin-right: 5px;
      }
      #yshout #shout-text {
         width: 310px;
         margin-right: 5px;
      }
      #yshout #shout-button {
         width: 55px;
      }
      #yshout .shout-invalid { /* invalid shout (shout textbox) */
         background: #FFFDD1;
      }
   </style>';
   // YSHOUT END - <head> code
// YSHOUT HERE - shoutbox code
   global $txt,$context,$boarddir;
   if(allowedTo('yshout_view'))
   {
      echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
      echo '<div id="yshout">';
      include_once($boarddir.'/yshout/yshout.php');
      echo '</div>';
   }
   elseif($context['user']['is_guest'])
      echo $txt['yshout_no_guests'];
   // YSHOUT END - shoutbox code
?>[/quote]

Now the thing happening is i see the shoutbox appear but then under 2 seconds i get this same fatal error on the same line.

**To many functions of global $smsFunc; is present in load.php ... lol which one to alter ?

nneonneo

You quoted a bunch of lines. Add "global $smcFunc;" before the first quoted line.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

bullbreedluverz

Im trying to install ASB 1.21 on 1.1.7 and get the following error, ive had it installed before but recently upgraded to 1.1.7 from 1.1.5 and now cant install

1.    Execute Modification    ./index.php                                            Test successful
2.    Execute Modification    ./Themes/default/index.template.php    Test failed
3.     Execute Modification     ./Themes/default/index.template.php     Test successful

i had a look at the manual instructions which said to look in /Themes/default/index.template.php & find;


                           <input type="hidden" name="hash_passwrd" value="" />
                        </form>';
   }


but i cant find that on my /Themes/default/index.template.php as i believe that relates to 1 of the login/register functions when viewing the forum as a guest but i have that removed on my forum

I have this on my template

// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
   else


   echo '
                     </div>';


Rather than this

   // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
   else
   {
      echo '            </span>
                        <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

                        <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                           <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                           <select name="cookielength">
                              <option value="60">', $txt['smf53'], '</option>
                              <option value="1440">', $txt['smf47'], '</option>
                              <option value="10080">', $txt['smf48'], '</option>
                              <option value="43200">', $txt['smf49'], '</option>
                              <option value="-1" selected="selected">', $txt['smf50'], '</option>
                           </select>
                           <input type="submit" value="', $txt[34], '" /><br />
                           <span class="middletext">', $txt['smf52'], '</span>
                           <input type="hidden" name="hash_passwrd" value="" />
                        </form>';
   }

   echo '
                     </div>';


ive attatched my /Themes/default/index.template.php without ASB 1.21 installed on it, if you could have a look at it and add the necessary edits id be grateful

pooya

Quote from: nneonneo on November 19, 2008, 10:01:55 AM
You quoted a bunch of lines. Add "global $smcFunc;" before the first quoted line.

Sorry cant make sense :( would my load.php file help ?

Deacon Frost

#4428
I have been trying my hardest to get this to work, but I just can't. Firstly, I was getting template issues with the load after page, then I tried the onload, fatal error because the folder wasn't in the right spot.

Well now it just says "Shout Box". It doesn't display the shout box, nor anything other than the text. The folder is in the right spot, and I'm using the one that loads with the page (1.17).

If anyone has any ideas or such. I have been searching this thread, but 222 pages to go through is quite difficult :P.


Thanks in advance.


To avoid advertisement thoughts, or such, if you ask, I'll send you a pm with the link.

nneonneo

@bullbreedluverz: One place to try is to put the code
echo '<div id="mainframe">
<div class="tborder"><div id="user_section" class="bordercolor"><div class="windowbg2 clearfix">';
// YSHOUT HERE - shoutbox code
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
// YSHOUT END - shoutbox code
echo '</div></div></div></div>';

above
echo '
     
<div id="logobox"></div>


@pooya: Well, like I said, I don't think this has anything to do with my shoutbox...

@Deacon Frost: Send me a PM. I'll take a look.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

waremock

What is the key to make this work on Beta 4?

Krandall

do you guys know if it's possible to make it ONLY show up on one page (topic discussion area) instead of the whole forum?

nwobhm

How to place this shout box into a separate window or more like into a pop-up window?  I did use search and got few hints, but I'm not sure if they were about the same thing ::)
I did understand that yshout code from index.template file should be placed into a seperate html file? Does this need to be done with all themes? and where this html file should be placed?

bullbreedluverz

thanx for the help nneonneo but it didnt work, think ive butchered my index.template too much

nneonneo

@waremock: At this time, it comes down to a manual installation. I will post a new version when 2.0 goes final.

@Krandall: Yes. You just have to wrap the shoutbox in
global $topic;
if(isset($topic) && $topic) {
SHOUTBOX CODE
}


@nwobhm: You can just remove the shoutbox from index.template.php, and use the standalone /yshout/ shoutbox at http://<domain>/<path/to/forum>/yshout/index.php.

@bullbreedluverz: Hmm; it worked for me when I used your index.template.php. Can you tell me what happened when you tried it?
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

bullbreedluverz


nneonneo

What is wrong with it? I can see it fine...
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

Krandall

Quote from: nneonneo on November 22, 2008, 12:03:06 PM
@Krandall: Yes. You just have to wrap the shoutbox in
global $topic;
if(isset($topic) && $topic) {
SHOUTBOX CODE
}



I tried it. It "sort of" works. It allows me to post to the shout box when I'm in the topic of my choice. But it still shows on all of the pages of the forum. Thoughts?

nneonneo

That shouldn't happen. This is what I've got, and it hides the shoutbox on all non-topic pages:

global $topic;
if(isset($topic) && $topic) {
// YSHOUT HERE - shoutbox code
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
// YSHOUT END - shoutbox code
}
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

Krandall

Hmm,

this is all modified in the theme's index.template.php correct?

This is what mine looks like:

Note: I changed it a bit so it should only show on board 1. pretty sure I did that correctly.

// YSHOUT HERE - <head> code
global $board;
if(isset($board) && $board==1) {
global $boardurl,$shoutFile;
$shoutFile='home';
$scripturlparsed = parse_url($scripturl);
$scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
$args='';
foreach($_GET as $key => $value) // passthrough $_GET
$args.='&'.urlencode($key).'='.urlencode($value);
echo '
<script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/settings.js" type="text/javascript"></script>
<script type="text/javascript"><!-- // --><![CDATA[
window.onload=function(){loadChat();};
var shoutFile="',$shoutFile,'";
var yshout_php="',$scriptpath,'?yshout',$args,'";
// ]]></script>
<script src="',$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
<style type="text/css">
#yshout {
font-size: 10px;
overflow: hidden;
}
#yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
}
#yshout #shouts { /* main shouts area */
}
#yshout .shout { /* one shout */
margin: 0 0 0; /* Top Bottom Linespacing */
line-height: 1;
}
#yshout .shout-timestamp {
font-style: normal;
font-weight: normal;
}
#yshout .shout-adminlinks { /* del and ban buttons */
font-size: 6pt;
color: #141414;
}
#yshout #shout-form {
margin: 0;
padding: 0;
}
#yshout #shout-form fieldset {
border: none;
}
#yshout #forum-name {
color: #666666;
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
#yshout .shout-invalid { /* invalid shout (shout textbox) */
background: #FFFDD1;
}
</style>';
}
// YSHOUT END - <head> code

Advertisement: