News:

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

Main Menu

[DONE] Magic Llama mod

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

Previous topic - Next topic

babylonking

Quotewhat? do you have them turned on on your site? becouse they are moving on localhost and Xtram! what are they doing?

Yes i just test it in my forum.......... wanna go and see cuz i'm online now but hidden. ::)

Aquilo

try cleaning out your cache becouse this thing is flying around my screen like you jahe speen set at like 15 or 20! on your site! in FireFox!

babylonking

Quote from: Aquilo on April 06, 2004, 10:53:26 AM
try cleaning out your cache becouse this thing is flying around my screen like you jahe speen set at like 15 or 20! on your site! in FireFox!

I deleted the catch but still the image is not floating.  ::)

Aquilo

#123
well I'm downloading Opera 7.23 to test this in, even though I think it's spywear, who actualy uses Opera? it looks like kazza for the web! (well one of the older versions did!)


[EDIT] The Llama's fly in Opera 7.23, but the ubbc buttons here DONT! if I highlight this text and click bold it goes to the end! :P

[Unknown]

Hmm..... you only had to ask.  But, you'll have to figure out how to use it.

http://www.simplemachines.org/community/Themes/simple/moveobj.js

-[Unknown]

Aquilo

Quote from: [Unknown] on April 06, 2004, 11:38:37 AM
Hmm..... you only had to ask.  But, you'll have to figure out how to use it.

http://www.simplemachines.org/community/Themes/simple/moveobj.js

-[Unknown]

that wouldn't be hard it looks like it would be used like a php class! and it is cleaned up alot, nice!

on a side note, Opera is not to bad when it comes to performance! is it built off of IE? :D

Aquilo

#126
Quote from: [Unknown] on April 06, 2004, 11:38:37 AM
Hmm..... you only had to ask.  But, you'll have to figure out how to use it.

http://www.simplemachines.org/community/Themes/simple/moveobj.js

-[Unknown]

Well that wasn't hard at all, plus I was kinda mad because I was logged on for less then a minuet and I get can I use the phone like always, but things get do when I'm not on the net! :D

like I said almost like a php class! ;D and I added llama_speed to your moveobj.js

can we use you moveobj.js since it is less code?
but there is one thing in 1024x768 it has the scrollbar overflow problem only offsetting it 16px, and also my last question "do you think it's better if it's stays in the window and not move down?"

<script language="JavaScript" type="text/javascript">
var llama_speed = Math.round(Math.random()*40);
</script>
<script language="JavaScript" type="text/javascript" src="moveobj.js"></script>
<script language="JavaScript" type="text/javascript">
/* Floating image script
By Virtual_Max (http://www.geocities.com/siliconvalley/lakes/8620)
Permission granted to Dynamicdrive.com to feature it in it\'s archive
For 100\'s of FREE DHTML scripts and components,
Visit http://dynamicdrive.com */

var Llama1;
function StartLlama()
{
Llama1 = new Chip("Llama1",68,68);
Llama1.move();
}
window.onUnload = "Llama1.stop();";
</script>

<div id="Llama1" style="position: absolute; top: 200; left:200; width: 68; height: 68; z-index: 5">
<a href="index.php?action=magicLlama;magicLlama=xxxxxxxxxxxxx">
<img src="golden_llama2.gif" border=0></a>
</div>

<script language="JavaScript" type="text/javascript">
StartLlama();
</script>

[Unknown]

I think it's because the actual height and width are wrong on the div.  I also always made it start at a random position ;).

-[Unknown]

ROGUE-Master

Is there an actual full WORKING version of this with all these bugs fixed?

Aquilo

um... yes! The current uploaded files install on a clean copy of SMF and 128 posts, allot of fixes, and new features, it installs and works!

But I should be going to bed but in an hour or so, I'm going to be uploading a complete one part mod!

Homie

YAAAAAAAAAa YOU RocK Aquilo The Llama Master  :)

Aquilo

#131
on question! should there be fields so the admin can enter the height and width of the image, should the script auto detect the height and width, or should the script auto detect the height and width if the admin leaves the fields blank? or leave it as is? ok two questions do you want extra options in modsetting to allow users to turn this on and off like "allow member to chouse template settings" and an option for you to show or not show the info in user profiles for the number of llamas caught?

Homie

Have it so you can resize the image and stuff and all the other stuff that sounds smart so then people have more options Ok  :)

Aquilo


Homie

Remember to tell us when you finish all that Thanks  :)

Regards
Homie

Aquilo

OK it's done! the link is atop the first post of this thread!


Daniel D.

Perhaps another color for the text ?

Aquilo

I was wanting a dark grey but that's not an option unless I can use hex test woot that work ok I'll change it!!!

babylonking

I installed the full mod but i get this error after clicking on floating llama image.

Fatal error: Call to undefined function: magicllama() in /home/babylon/public_html/forum/index.php on line 115

Aquilo

the only way I can reproduce this error is to comment out the whole function in karma.php

Fatal error: Call to undefined function: magicllama() in c:\program files\apache group\apache\htdocs\smf_forum\index.php on line 115

if there where an error in magicLlama() then there would be another error with that one.

check your karma.php file becouse that's the only step it takes is adding that function!

***********************************************************
Start Editing Sources/Karma.php                     File: 3
***********************************************************
<Edit file>
Sources/Karma.php
</Edit file>

<Search for>
// What's this?  I dunno, what are you talking about?  Never seen this before, nope.  No siree.
</Search for>

<Add before>
// muhahahahahahahahaha, the Llama's have been set FREE!
function magicLlama()
{
global $_REQUEST, $user_info, $modSettings, $db_prefix, $context;

// NO GUESTS ALLOWED!
if ($user_info['is_guest'])
is_not_guest();

// set your user id stored in $context array
$userid = $context['user']['id'];

// now lets see if we have a Llama by that name!?
$request = db_query("
SELECT *
FROM {$db_prefix}llama_info
WHERE llama_id = '$_REQUEST[magicLlama]'
LIMIT 1", __FILE__, __LINE__);

// most likely a script kiddy so we'll let the Llamas have at him!
if (!$request || mysql_num_rows($request) == 0)
fatal_error('Bad Llama id! >:(', true);

$Llamainfo = mysql_fetch_assoc($request);
mysql_free_result($request);

// oops got here too late! ha...ha...!
if ($Llamainfo['member'] != '')
{
$context['title'] = 'Sorry too late!';
$context['display'] = $modSettings['lateLlama'];
}
else
{
// let's get your info in the database befor someone else get's the Llama!
db_query("
UPDATE {$db_prefix}llama_info
SET member = $userid, Caught = " . time() . "
WHERE llama_id = '$_REQUEST[magicLlama]'
LIMIT 1", __FILE__, __LINE__);

$field1 = ($Llamainfo['Type'] == 1) ? 'karmaGood' : 'karmaBad';
$field2 = ($Llamainfo['Type'] == 1) ? 'goodpoints' : 'badpoints';
$field3 = ($Llamainfo['Type'] == 1) ? 'goodllamas' : 'badllamas';

// log the users points
updateMemberData($userid, array(
$field1 => $field1 . ' + ' . $Llamainfo['points'],
$field2 => $field2 . ' + ' . $Llamainfo['points'],
$field3 => $field3 . ' + 1',
));

$context['title'] = 'You got a ' . $modSettings['Type' . $Llamainfo['Type']] . '!';
$context['display'] = str_replace(
array("%N", "%P", "%K"),
array(
$modSettings['Type' . $Llamainfo['Type']],
(($Llamainfo['Type']==1) ? $Llamainfo['points'] : '-' . $Llamainfo['points']),
$modSettings['karmaLabel']),
$modSettings['Type' . $Llamainfo['Type'] . '_discription']);
}

if (!isset($context['page_title']))
$context['page_title'] = $context['title'];

loadTemplate('MagicLlama');
$context['sub_template'] = 'Llama_speak';

unset($Llamainfo);
obExit();
}
</Add before>

Advertisement: