News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

nneonneo's Shoutbox

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

Previous topic - Next topic

Ashu

i already attached my file here....you can take a look at it if you want to...

[unplugged]

The file that you attached has no errors as far as I can test. It also does not have the code you posted above, so I cannot test what errors it is giving you. Add that code back to the file (to where you were getting the parse error) then reattach the file and I will be more than happy to look at it for you.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



Ashu

oh actually i removed it to get it work again :D

i just want to show the shout box as a category like news and announcement or anything.. coz on the default theme its showing it on just up to the admin link. so its good if you can make it work.

[unplugged]

OK. I believe I have accomplished what you wanted.  ;) It is in it's own category just above the News category. It may require some fine tuning, but I will leave that entirely up to you.  :P

Hope that was what you were looking for.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



nneonneo

(aah! too many responses!)

@denio: In that case, to avoid overloading the server, set refreshTime in yshout/js/yshout.js to something higher (in milliseconds).

@optimushunk: Package Parser should be working now for SMF 1.1.5.

@Pratt: Works for me. Did you set $boardurl to the *full* URL to your forum?

Thanks very much to ameo and SunKing for helping out :)
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!

[unplugged]

Not a problem at all.  :D

After all, you have finals...
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



Gunstra

I have installed this mod but cannot edit the settings due to the mod not showing up in the admin panel, I can see it under installed packages just fine, but there is no links to get to the settings, I have attached a couple screenshots to show what I am talking about, a few mods I have installed are the same way, is it an SMF bug or is it the mods?

nneonneo

@SunKing: Finals are over, thankfully (ended a few weeks back), but now I have a full-time job, making it harder for me to make timely responses like I used to.

@Gunstra: Not all mods have admin options. This one in particular does not, so it doesn't even install any other options to your admin panel. Options are controlled in the yshout/yshout.php file.
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!

ameo

I'm trying "something else" and I can't seem to find width of shoutbox.
Help?!?
antechinus:
QuoteIf you are dying for a solution it may be wise to seek medical attention.
Get some Awesome Smileys for your forum

|±(ಠ_ಠ
)±|

Sheepdog360

is it possible to have the shoutbox only accessible by certain forum groups?

sashafiero

I've moved to a new server, AND upgraded the board, AND upgraded the shoutbox, AND am using a custom theme.  *whew*  Needless to say, it broke.

The forum it resides on [nofollow]
The yshout/yshout.php file [nofollow]

It also continues to show a login form no matter what.

I made sure the yshout.php has 755 permissions, I made sure I copied the code into my custom theme correctly.. because it's complaining about errors in the forum's code, I really don't know what to do.  It was working fine before I moved servers.

Someone who wants to look at it can use "TestAccount" pw "testaccount"

Thank you for your time!  I've really enjoyed using the shoutbox in the past, and don't want to lose it!
SMF 1.1.5 | nneonneo's Shoutbox 1.20

nneonneo

@ameo: Width? Should be in the CSS block of index.template.php or yshout-style.css; if it's not there, you need to add it.
If you're talking about the number of characters that can be entered, that's in yshout.php.

@jarhead9952: See http://www.simplemachines.org/community/index.php?topic=137508.msg1532734#msg1532734 and http://www.simplemachines.org/community/index.php?topic=137508.msg1536275#msg1536275 (you want my responses to RobXduffy in both posts). In your case, since you want a list of "allowed" groups, rather than "banned" groups, change
if (count(array_intersect(array(4), $membergroups)) == 0)
to
if (count(array_intersect(array(4), $membergroups)) > 0)
and vice-versa.

@sashafiero: I think the forum language is not set somehow: the first error is "Undefined index: lang_character_set". This probably means that either the language pack for your language isn't installed, or that the global language isn't set. All the other errors relate to this one.

If you had some language packs on the old forum, you should install them on the new forum to avoid trouble. To dismiss the warnings, you can add "error_reporting(0);" right before session_start(); in yshout/yshout.php; this will silence all the notices, but doesn't fix their cause.

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!

ALEJO

nneonneo when r u going to do another great mod? :D
solo el mas paranoico sobrevive

Nibogo

Quote from: nneonneo on May 10, 2008, 05:56:46 PM
@NIBOGO: Except for the last part (about adding "echo' </table>', shoutbox(), '</div></table>';"), do the instructions for index.template.php; the last bit, you add to boardindex.template.php (n.b. you *may* need to add the shoutbox function to BoardIndex.template.php depending on what order the files get loaded). Of course, SunKing knows his code best, so if I'm mistaken, please let me know :)

i dot it but the shoutbox is not collapsable:

http://www.mundo-se.com/foro/index.php?action=forum

[unplugged]

Did you INSERT the SQL line into your database as posted above? It will not collapse unless you do this. You will need to use phpMyAdmin or similiar to INSERT it. Here is my tutorial on exactly how to do it.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



faminsk

Quote from: nneonneo on January 19, 2008, 11:01:07 AM
I'm reposting pongsak's smiley guide because the recent server crash has deleted the smiley.php attachment.

Quote from: pongsak on August 18, 2007, 11:10:08 PM
For adding smiley .Let's go.
1. Adding 1 line of script between <head> and </head> index.template.php  .


<script type="text/javascript" language="JavaScript" src="',$boardurl,'/mymod/animatedcollapse.js"></script>


This file will create sliding effect.

2. Create "mymod" dir in root forum dir and copy these code and safe as "animatedcollapse.js"

//Animated Collapsible DIV- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated June 27th, 07'. Added ability for a DIV to be initially expanded.

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "") //get current page path and name, used to uniquely identify this page for persistence feature

function animatedcollapse(divId, animatetime, persistexpand, initstate){
this.divId=divId
this.divObj=document.getElementById(divId)
this.divObj.style.overflow="hidden"
this.timelength=animatetime
this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId) //"yes" or "no", based on cookie value
this.contentheight=parseInt(this.divObj.style.height)
var thisobj=this
if (isNaN(this.contentheight)){ //if no CSS "height" attribute explicitly defined, get DIV's height on window.load
animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load")
if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
this.divObj.style.visibility="hidden" //hide content (versus collapse) until we can get its height
}
else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
this.divObj.style.height=0 //just collapse content if CSS "height" attribute available
if (persistexpand)
animatedcollapse.dotask(window, function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId, thisobj.isExpanded)}, "unload")
}

animatedcollapse.prototype._getheight=function(persistexpand){
this.contentheight=this.divObj.offsetHeight
if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){ //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
this.divObj.style.height=0 //collapse content
this.divObj.style.visibility="visible"
}
else //else if persistence is enabled AND this content should be expanded, define its CSS height value so slideup() has something to work with
this.divObj.style.height=this.contentheight+"px"
}


animatedcollapse.prototype._slideengine=function(direction){
var elapsed=new Date().getTime()-this.startTime //get time animation has run
var thisobj=this
if (elapsed<this.timelength){ //if time run is less than specified length
var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength)
this.divObj.style.height=distancepercent * this.contentheight +"px"
this.runtimer=setTimeout(function(){thisobj._slideengine(direction)}, 10)
}
else{ //if animation finished
this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0
this.isExpanded=(direction=="down")? "yes" : "no" //remember whether content is expanded or not
this.runtimer=null
}
}


animatedcollapse.prototype.slidedown=function(){
if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
alert("Please wait until document has fully loaded then click again")
else if (parseInt(this.divObj.style.height)==0){ //if content is collapsed
this.startTime=new Date().getTime() //Set animation start time
this._slideengine("down")
}
}
}

animatedcollapse.prototype.slideup=function(){
if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
alert("Please wait until document has fully loaded then click again")
else if (parseInt(this.divObj.style.height)==this.contentheight){ //if content is expanded
this.startTime=new Date().getTime()
this._slideengine("up")
}
}
}

animatedcollapse.prototype.slideit=function(){
if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
alert("Please wait until document has fully loaded then click again")
else if (parseInt(this.divObj.style.height)==0)
this.slidedown()
else if (parseInt(this.divObj.style.height)==this.contentheight)
this.slideup()
}

// -------------------------------------------------------------------
// A few utility functions below:
// -------------------------------------------------------------------

animatedcollapse.curveincrement=function(percent){
return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
}


animatedcollapse.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
}

animatedcollapse.getCookie=function(Name){
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

animatedcollapse.setCookie=function(name, value, days){
if (typeof days!="undefined"){ //if set persistent cookie
var expireDate = new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()
}
else //else if this is a session only cookie
document.cookie = name+"="+value
}


3. download smiley.php and safe in mymod dir.

4. Search after in index.template.php or boardindex.template.php depend on where u put shout box.

*<div id="yshout"', empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>
or
*<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>

   add

<div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Open Smiley</a> | <a href="javascript:collapse1.slideup()">Close</a>';
require('mymod/smiley.php');
loadSmileys();
echo '
<div id="smiley_pic">';
printSmileys('shout_form','shout_text');
echo '
</div>
<script type="text/javascript">
//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse1=new animatedcollapse("smiley_pic", 1000, false)
</script>
</div>


5. Open yshout.php for namely some input.

find (up to 4 times)

*id="shout-form"

replace  to

*id="shout-form" name="shout_form"

find (up to 4 times)

*id="shout-text"

replace to

*id="shout-text" name="shout_text"

That's it.  :D



EDIT [Feb 4 2008]: Updated a few instructions. Changes are noted in red, changes to code marked with a red *.

First, I'd like to say that this mod is great.  Once I started reading the mod site info and the links you put there, things worked like a breeze.

Now, I am trying to implement this change and I've run into a problem.

I have the shoutbox in a TP Block (BTW, that works great for denying guests and other groups access), I have made all the changes as described and put the code that goes after the <div> that points to where you want the shoutbox to be in the same block.  I get an error in Load.php and everything comes to a crashing halt. 

Could you help me get the correct code into the TP block that will point correctly to the rest of the modified code?

A note. 

I made a change to externalize the .css and used the yshout-style.css file to control the file.  It was a very simple change and I like having external .css files.

One request, I would like to make a change to have the entry line at the top of the box instead of the bottom, can you  give me some pointers on how to do that?  That will help with folks who have different resolutions on different computers and the use of the scroll bar.

Again, great mod.  Thanks in advance for your help.

Nibogo

Quote from: SunKing on May 16, 2008, 07:07:27 PM
Did you INSERT the SQL line into your database as posted above? It will not collapse unless you do this. You will need to use phpMyAdmin or similiar to INSERT it. Here is my tutorial on exactly how to do it.

I do the modification but the shoutbox is not appear:

http://www.mundo-se.com/foro/index.php?action=forum

nneonneo

#2317
@ALEJO: I don't run my own forum anymore, which was my main source of "what-do-my-members-need" mods. Maybe if someone makes a good suggestion I may consider :)

@faminsk: The block is a phpblock, right? The code should look like
echo '<div id="yshout"></div><div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Open Smiley</a> | <a href="javascript:collapse1.slideup()">Close</a>';
                     require('mymod/smiley.php');
                     loadSmileys();
                  echo '
                     <div id="smiley_pic">';
                        printSmileys('shout_form','shout_text');
                  echo '
                     </div>
                     <script type="text/javascript">
                     //Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
                     var collapse1=new animatedcollapse("smiley_pic", 1000, false)
                     </script>
                  </div>';

For putting the form up top instead of on the bottom, you will want to move this code in yshout/yshout.php
echo '<div id="shouts">';
echo readChat($chatFile, $logDir);
echo '</div>';

to right before
if($gzipCompression) ob_end_flush();
break;

case "shout":

That will output the shouts after the form. Then, you may wish to reverse the shout order: there's a link on the main mod page or first page of this thread for that.

@NIBOGO: Two errors in my JS console:
1) smfToggle not defined. I think this is only defined for SMF 2, not SMF 1.
2) set_cookie is redefined by global.js. This is a minor issue, and you can probably fix it by replacing "set_cookie" in yshout/js/yshout.js by something else (like create_cookie or similar) to avoid the name clash.

@SunKing: Your code is using smfToggle, which isn't in SMF1. Unfortunately, SMF1 lacks a coherent upshrink system like the one in SMF2, which makes it fairly difficult to get a decent upshrink in SMF1. For example, the code for the default header upshrink in SMF1:
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{';

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>

It might be possible to adapt this code (plus modifications to the main block) to support SMF1.
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!

[unplugged]

#2318
Sorry. I didn't realize there was a difference between the two versions of SMF in regard to the toggle. Thank you for bringing that to my attention. I've edited the original post to reflect this.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



sashafiero

Quote@sashafiero: I think the forum language is not set somehow: the first error is "Undefined index: lang_character_set". This probably means that either the language pack for your language isn't installed, or that the global language isn't set. All the other errors relate to this one.

If you had some language packs on the old forum, you should install them on the new forum to avoid trouble. To dismiss the warnings, you can add "error_reporting(0);" right before session_start(); in yshout/yshout.php; this will silence all the notices, but doesn't fix their cause.

I'm afraid I'm still at a loss... I DIDN'T have any languages installed previously, and I put in the error_reporting(0); where you said, but the errors are still displaying.

Also, in addition to that login box always being there, I don't have the History and other links.  D:  My poor shoutbox is imploding...

I thank you again for your help!
SMF 1.1.5 | nneonneo's Shoutbox 1.20

Advertisement: