Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
NeapolitanWorld
Involved
Involved



Joined: Nov 06, 2005
Posts: 339
Location: Los Angeles, USA

PostPosted: Thu Jul 22, 2010 5:45 pm Reply with quote

Has anyone tried out the meebo bar? I'm trying to install it but with no luck, anyone know which files you need to insert the snippets of javascript?

thx
jc

_________________
My Raven Site Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Thu Jul 22, 2010 7:05 pm Reply with quote

Here is an example of my theme.php that has the meebo bar on it. I added the first bit of code after the body tag in themeheader and the second code at the end of themefooter.

Code:
function themeheader() {

    global $user, $banners, $sitename, $slogan, $cookie, $prefix, $anonymous, $topic, $name, $sel, $db, $ThemeSel, $nukeNAV, $name;
    cookiedecode($user);
echo "<body>";
echo "<script type=\"text/javascript\">\n";
echo "if (typeof Meebo == 'undefined') {\n";
echo "  Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};\n";
echo "  (function(q){\n";
echo "    var d=document,b=d.body;\n";
echo "    if(!b){var cb=arguments.callee;return setTimeout(function(){cb(q)},100);}\n";
echo "    var m=b.insertBefore(d.createElement('div'), b.firstChild), s=d.createElement('script');\n";
echo "    m.id='meebo'; m.style.display='none'; m.innerHTML='<iframe id=\"meebo-iframe\" frameBorder=\"0\" ><\/iframe>';\n";
echo "    s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;\n";
echo "    d.getElementsByTagName('head')[0].appendChild(s);\n";
echo "   })({network: 'site id and number goes here', stage: false});\n";
echo "  Meebo('makeEverythingSharable');\n";
echo "}\n";
echo "</script>\n";
echo "\n";
   if ($banners) {
      echo ads(1);
   }
  if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0') !== FALSE) {
    $navtop = ' • <a href="index.php"><b>'._HOME.'</b></a> • <a href="downloads.html"><b>'._UDOWNLOADS.'</b></a> • <a href="account.html"><b>'._FSIYOURACCOUNT.'</b></a> • <a href="forums.html"><b>'._BBFORUMS.'</b></a> • ';
}

else {
    $navtop = $nukeNAV;
}
if (defined('INDEX_FILE')) {
        echo '<div id="header"><div id="header_inner" class="fixed"><div id="logo"><span><img src="themes/'.$ThemeSel.'/images/logo.png" alt="Tricked Out News" border="0" /></span></div>';
if ($banners) {
echo '<div id="logo_right">';
echo ads(0);
echo '</div>';
         };
echo '</div><center>'.$navtop.'</center><br style="clear: left" /></div><div id="main" class="clearfix"><div id="main_inner" class="fixed"><div id="primaryContent_3columns">';
  }else{
    echo '<div><div id="header"><div id="header_inner" class="fixed"><div id="logo"><span><img src="themes/'.$ThemeSel.'/images/logo.png" alt="" border="0" /></span></div>';
if ($banners) {
echo '<div id="logo_right">';
echo ads(0);
echo '</div>';
         };
echo '</div><center>'.$navtop.'</center><br style="clear: left" /></div><div id="main" class="clearfix"><div id="main_inner" class="fixed"><div id="primaryContent_2columns">';   
  }
 
   
     if (defined('INDEX_FILE')) {

    echo '<div id="columnA_3columns">';
   }else{
      echo '<div id="columnA_2columns">';
  }
   
}

/************************************************************/
/* Function themefooter()                                   */
/* Control the footer for your site.                        */
/************************************************************/

function themefooter() {
    global $index, $foot1, $foot2, $foot3, $foot4, $name;
     echo '</div></div><div id="secondaryContent_3columns">';     
   if (defined('INDEX_FILE')) {
   echo '<div id="secondaryContent_2columns"><div id="columnC_2columns">';
  }else{
     echo '<div id="columnB_3columns">';
  }

   blocks('left');
   
   echo '</div>';
 
   if (defined('INDEX_FILE')) {

     
   echo '<div id="columnC_3columns">';
   
    blocks('right');
    echo '</div>';
   }
   
    $footer_message = "<p>$foot1</p><p>$foot2</p><p>$foot3</p><p>$foot4</p>";
     echo '</div><br class="clear" /></div></div></div><div id="footer" class="fixed">';
footmsg();
echo '</div>';
echo "<script type=\"text/javascript\">\n";
echo "  Meebo(\"domReady\");\n";
echo "</script>\n";
}

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
NeapolitanWorld







PostPosted: Fri Jul 23, 2010 1:39 am Reply with quote

nuken, thank you! works like a charm Very Happy

jc
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6437

PostPosted: Sat Jul 24, 2010 7:43 am Reply with quote

I added to nukeSEO.com without touching the theme and only by adding a new file or two. I could post the files if you like.

_________________
I search, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
NeapolitanWorld







PostPosted: Sat Jul 24, 2010 10:28 am Reply with quote

kguske, that would be nice to have! no need to edit all my themes anytime theres an update Very Happy please do.

jc
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Jul 24, 2010 10:35 am Reply with quote

addJSToBody() and addons folder Wink

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
kguske







PostPosted: Sat Jul 24, 2010 8:50 pm Reply with quote

Create a file called includes/addons/body-Meebo.php with this, substituting the value of your Meebo network code:
Code:
<?php

$meebo_network = 'myMeeboNetworkCode';
$bodyHTML = '
<script type="text/javascript">if (typeof Meebo == \'undefined\') {  Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};  (function(q){    var d=document,b=d.body;    if(!b){var cb=arguments.callee;return setTimeout(function(){cb(q)},100);}    var m=b.insertBefore(d.createElement(\'div\'), b.firstChild), s=d.createElement(\'script\');    m.id=\'meebo\'; m.style.display=\'none\'; m.innerHTML=\'<iframe id="meebo-iframe" frameBorder="0" ></iframe>\';    s.src=\'http\'+(q.https?\'s\':\'\')+\'://\'+(q.stage?\'stage-\':\'\')+\'cim.meebo.com/cim/cim.php?network=\'+q.network;    d.getElementsByTagName(\'head\')[0].appendChild(s);   })({network: \''.$meebo_network.'\', stage: false});  Meebo(\'makeEverythingSharable\');}</script>
<script type="text/javascript">  Meebo("domReady");</script>';

if (is_array($bodyJS) and function_exists('addJSToBody')) addJSToBody($bodyHTML, 'inline');
else echo $bodyHTML."\n";

?>
 
NeapolitanWorld







PostPosted: Sat Jul 24, 2010 11:59 pm Reply with quote

kguske, thank you. This is great because I don't have to worry about adding it to new themes or when upgrades come along I don't have to add code to each and every theme. Very Happy this works perfect. Thank you!

jc
 
zacklk
Regular
Regular



Joined: Mar 06, 2010
Posts: 79

PostPosted: Wed Sep 01, 2010 2:44 am Reply with quote

Mr. kguske. did u update meebo code in nukeseo.com? i tried the code way added here. everything works except chat logins. when i check view source in ur site its showing a bigger code then showing in mine. if u change the code can u please share with us. thank you.
 
View user's profile Send private message
kguske







PostPosted: Wed Sep 01, 2010 11:09 am Reply with quote

Here's the updated code (Meebo changed the JS):
Code:
<?php

$meebo_network = 'myMeeboNetworkCode';
$bodyHTML = '
<script type="text/javascript">
window.Meebo||function(b){function p(){return["<",i,\' onload="var d=\',g,";d.getElementsByTagName(\'head\')[0].",
j,"(d.",h,"(\'script\')).",k,"=\'//",b.stage?"stage-":"","cim.meebo.com/cim?iv=",a.v,
"&",q,"=",b[q],b[l]?"&"+l+"="+b[l]:"",b[e]?"&"+e+"="+b[e]:"","\'\"></",i,">"].join("")}
var f=window,a=f.Meebo=f.Meebo||function(){(a._=a._||[]).push(arguments)},d=document,
i="body",m=d[i],r;if(!m){r=arguments.callee;return setTimeout(function(){r(b)},
100)}a.$={0:+new Date};a.T=function(u){a.$[u]=new Date-a.$[0]};a.v=4;var j="appendChild",
h="createElement",k="src",l="lang",q="network",e="domain",n=d[h]("div"),v=n[j](d[h]("m")),
c=d[h]("iframe"),g="document",o,s=function(){a.T("load");a("load")};f.addEventListener?
f.addEventListener("load",s,false):f.attachEvent("onload",s);n.style.display="none";
m.insertBefore(n,m.firstChild).id="meebo";c.frameBorder="0";c.id="meebo-iframe";
c.allowTransparency="true";v[j](c);try{c.contentWindow[g].open()}catch(w){b[e]=
d[e];o="javascript:var d="+g+".open();d.domain=\'"+d.domain+"\';";c[k]=o+"void(0);"}try{var t=
c.contentWindow[g];t.write(p());t.close()}catch(x){c[k]=o+\'d.write("\'+p().replace(/"/g,
\'\\"\')+\'");d.close();\'}a.T(1)}({network:"'.$meebo_network.'"});
Meebo("makeEverythingSharable");
</script>
';
if (is_array($bodyJS) and function_exists('addJSToBody')) addJSToBody($bodyHTML, 'inline');
else echo $bodyHTML."\n";

?>
 
zacklk







PostPosted: Wed Sep 01, 2010 12:16 pm Reply with quote

thank you sir. its works great Smile
 
fernades
New Member
New Member



Joined: Aug 18, 2010
Posts: 21

PostPosted: Fri Apr 08, 2011 4:22 am Reply with quote

I am also looking for the same! Anyway thanks a lot.
 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Sat Aug 20, 2011 5:01 am Reply with quote

how can I find myMeeboNetworkCode ??
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©