News:

Wondering if this will always be free?  See why free is better.

Main Menu

[DONE] Magic Llama mod

Started by Aquilo, April 04, 2004, 08:03:55 AM

Previous topic - Next topic

BigMike

Hopefully on Sunday of this weekend, I am going to get the Final 1.0 version up and I will install the llama mod. I last used them on beta 4 I think, so it will be a good thing for my members who are (still) wondering what happened to them ;)

I will let you know if the "Hits" bug has been fixed or not (if it is effected)

BigMike

Webby

Is it safe to use v.0.8 on the final ?!

Which version is being used on this board ??

Jerry

Unknown made his own :P, and this does work on SMF1.0 as far as I know ;)


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Webby

When I'm logged out and look at my main page where I use SSI.php, I get :

Quote
Notice: Undefined index: goodllamas in /home/admin/domains/salesplaza.nl/public_html/forum/Sources/Load.php on line 185

Notice: Undefined index: goodpoints in /home/admin/domains/salesplaza.nl/public_html/forum/Sources/Load.php on line 186

Notice: Undefined index: badllamas in /home/admin/domains/salesplaza.nl/public_html/forum/Sources/Load.php on line 187

Notice: Undefined index: badpoints in /home/admin/domains/salesplaza.nl/public_html/forum/Sources/Load.php on line 188

What to do ?

Webby

#204
Solved this already.

One question though :

When you catch a llama, could it also show the totals of your Karma/Llama's on the page you get like it does here ?

Quote
You caught a cute forum member under the mistletoe! You get 1 points!

Caught Secret Flying Mistletoe: 5

Your new Karma total is 16.

dschwab9

I installed this mod a couple of days ago.  It's going to be a bandwidth killer for sure - board traffic has doubled  :P

I'm seeing the llama popup, but not move, on occasion.  Seen it on two different computers too.  Anyone else got that?

Sixpack

I get it on Opera but not on IE.  What browser you using?
hxxp:www.theoscarspot.com [nonactive]

EG

#207
I got it all setup I think...

and after trying to change the settings on it got this:

Fatal error: Call to undefined function: loadllamas() in /lotruk/forum/index.php on line 146

I think I need to start all over and check each change that should have been made was :-\

(I created a package instead of the Boardmod, for ease of uninstallation......)




nah stumped....  doesnt seem to be anything vital missing

apart from the forum comes back up, if I comment out line 146 loadllamas()

dschwab9

Quote from: Sixpack on January 05, 2005, 12:31:19 AM
I get it on Opera but not on IE.  What browser you using?

I'm using IE.  Tested on mozilla, and never saw it happen there.

Webby

When you catch a llama, could it also show the totals of your Karma/Llama's on the page you get like it does here ?

Quote
You caught a cute forum member under the mistletoe! You get 1 points!

Caught Secret Flying Mistletoe: 5

Your new Karma total is 16.

?

EG

#210
ok  handcoding is the only way!

started all over... and now it works ;D

hmmm there must be a way to put the total up..

it uses the karma total figure doesnt it as displayed within a topic....

EG

#211
surely we can use this mod
http://www.simplemachines.org/community/index.php?topic=18720.msg152843

to give a table of most caught llamas ???

has anyone got it to work with anything but the default theme ???

Webby

Implemented this for the Karma, but now for the "caught Llama's" ???  ;)

Webby

used the code give here :

http://www.simplemachines.org/community/index.php?topic=18720.msg152843

and adjusted it a bit to get a table of llama's :

in Stats.php find :


// Activity by month.


and add before :


// Top 5 llama Rating
$llama_results = db_query("
SELECT realName, goodllamas, ID_MEMBER FROM {$db_prefix}members ORDER BY goodllamas DESC LIMIT 10", __FILE__, __LINE__);

$context['llama'] = array();

while( $row_llama = mysql_fetch_assoc($llama_results) )
{
$context['gllama'][] = array(
'llama' => $row_llama['goodllamas'],
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_llama['ID_MEMBER'] . '">' . $row_llama['realName'] . '</a>'
);
}

// Bottom 5 llama Rating
$llama_results = db_query("
SELECT realName, badllamas, ID_MEMBER FROM {$db_prefix}members ORDER BY badllamas DESC LIMIT 10", __FILE__, __LINE__);

$context['bllama'] = array();

while( $row_llama = mysql_fetch_assoc($llama_results) )
{
$context['bllama'][] = array(
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_llama['ID_MEMBER'] . '">' . $row_llama['realName'] . '</a>',
'llama' => $row_llama['badllamas']
);
}

// Highest Total llama
$llama_results = db_query("
SELECT goodllamas, badllamas, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (goodllamas-badllamas) DESC LIMIT 10", __FILE__, __LINE__);

$context['htllama'] = array();

while( $row_llama = mysql_fetch_assoc($llama_results) )
{
$context['htllama'][] = array(
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_llama['ID_MEMBER'] . '">' . $row_llama['realName'] . '</a>',
'Good' => $row_llama['goodllamas'],
'Bad' => $row_llama['badllamas']
);
}

// Lowest llama total
$llama_results = db_query("
SELECT goodllamas, badllamas, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (goodllamas-badllamas) ASC LIMIT 10", __FILE__, __LINE__);

$context['ltllama'] = array();

while( $row_llama = mysql_fetch_assoc($llama_results) )
{
$context['ltllama'][] = array(
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_llama['ID_MEMBER'] . '">' . $row_llama['realName'] . '</a>',
'Good' => $row_llama['goodllamas'],
'Bad' => $row_llama['badllamas']
);
}


in Stats.template.php find :


foreach ($context['top_time_online'] as $poster)
            echo '
                                                <tr>
                                                        <td width="60%" valign="top">', $poster['link'], '</td>
                                                        <td width="20%" align="left" valign="top">', $poster['time_online'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['time_percent'] . '" height="15" alt="" border="0" />' : '&nbsp;', '</td>
                                                        <td width="20%" align="right" valign="top" nowrap="nowrap">', $poster['time_online'], '</td>
                                                </tr>';
        echo ' </table></td></tr>';


and replace with :


foreach ($context['top_time_online'] as $poster)
            echo '
                                                <tr>
                                                        <td width="60%" valign="top">', $poster['link'], '</td>
                                                        <td width="20%" align="left" valign="top">', $poster['time_online'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $poster['time_percent'] . '" height="15" alt="" border="0" />' : '&nbsp;', '</td>
                                                        <td width="20%" align="right" valign="top" nowrap="nowrap">', $poster['time_online'], '</td>
                                                </tr>';
        echo ' </table></td></tr>';

if( $modSettings['llamaMode'] == 0 )
{
echo '<tr>
<td class="catbg" colspan="2">Highest Llama rating (good - bad)</td>
<td class="catbg" colspan="2">Lowest Llama rating (good - bad)</td>
</tr>
<tr>
<td class="windowbg" colspan="1">
<img src="'. $settings['images_url']. '/stats_posters.gif" width="20" height="20" />
</td>
<td class="windowbg2">';

foreach($context['htllama'] as $htllama)
{
$total = $htllama['Good'] - $htllama['Bad'];
echo '<table border="0" cellpadding="1" cellspacing="0" width="100%"><tr>
<td class="windowbg2" width="80%" align="left">'.
$htllama['Link']
.'</td>
<td class="windowbg2" width="20%" align="right">'.$total.'</td>
</tr></table>';
}





echo'</td><td class="windowbg" colspan="1">
<img src="'. $settings['images_url']. '/stats_posters.gif" width="20" height="20" />
</td>
<td class="windowbg2">';


foreach($context['ltllama'] as $ltllama)
{
$total = $ltllama['Good'] - $ltllama['Bad'];
echo '<table border="0" cellpadding="1" cellspacing="0" width="100%"><tr>
<td class="windowbg2" width="80%" align="left">'.
$ltllama['Link']
.'</td>
<td class="windowbg2" width="20%" align="right">'.$total.'</td>
</tr></table>';
}
}


It might not be the nicest way to do it, but it works for me :)

EG

me too!

I used that code...

I also used the mod to zero ppls Karmas first... because some people had Karma from a time we once had it running :-\

Webby

Oops,

I had to change


if( $modSettings['llamaMode'] == 0 )


into


if( $modSettings['KarmaMode'] == 0 )


because the errorlog was growing ;)

EG

have you worked out how to get it to work in all themes ?

ive copied the code to the index.template.php in another theme... and made sure the image is in that themes image directory... as well as the settings.template.php

hmmm... bit lost as to what is missing now :-\

Webby

No, sorry. I'm only using it in the default......

EG

#218
RAH!  worked it out finally!

I was silly..

there are THREE places in the index.template.php in each theme, that need the same edit

   global $context, $settings, $options, $scripturl, $txt;
   global $modSettings, $user_info;

once I put those in in a theme not the default... it worked ;D

(providing of course that the image itself is in that themes images directory ;))

Sixpack

I am getting the following errors from Guests in my error log since 1.0 upgrade and as well in the 1.0.1


8: Undefined index: goodllamas
theoscarspot.com/smf/Sources/Load.php
187


8: Undefined index: goodpoints
theoscarspot.com/smf/Sources/Load.php
188

8: Undefined index: badllamas
theoscarspot.com/smf/Sources/Load.php
189

8: Undefined index: badpoints
theoscarspot.com/smf/Sources/Load.php
190


It is not harming anything in reguards, just basically filling up my log with a few hundred errors daily much similar to the search bug thats been reported.  Any ideas on what to change to correct this?

hxxp:www.theoscarspot.com [nonactive]

Advertisement: