Simple Machine Codes
March 28, 2024, 05:24:57 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Basic affiliate thingymawhatzit

Pages: [1]   Go Down
  Print  
Author Topic: Basic affiliate thingymawhatzit  (Read 1400 times)
0 Members and 1 Guest are viewing this topic.
CodeLover
100 Club Member

Offline Offline

Gender: Male
Posts: 331


View Profile
« on: May 31, 2008, 05:48:21 am »

This is my first SmfForFree code, so don't be surprised if it's dumb. (the affiliates only show up on the main page portal lol. I could probably make it better, but I'm too tired Tongue)

There's not much "actual code" in it, but whatever Tongue

Start by going to the Admin panel. (By the way this uses jQuery)
Under Configuration, click on portal settings.
Make sure Enable Portal is checked.
Under Add Block, type in "Affiliates" in the name field. Make sure the type is html. Make the alignment say "center".
Click edit html under the block type thing.
In the box, type in <center> and </center>. In the center tags, put your affiliate. The syntax of it should be like this:
Code:
<a href=link to site><img src=image></a>

Put as many of those as you want in.
After all of your affiliates are added, add in the following code:
Code:
<span class="affiliate"><br /><br /></span>
Remember, this should all be in the center tag.
Now comes the actual JavaScript Tongue
In all of the img tags, put in the following code:
Code:
onMouseOver="$('.affiliate').html('<br />' + 'DESCRIPTION OF SITE')" onMouseOut="$('.affiliate').html('<br /><br />')"

Replace DESCRIPTION OF SITE with a description of the site.

At the end, your html should look like this:
Code:
<center><a href="affiliate1"><img src="affiliate1image" onMouseOver="$('.affiliate').html('<br />' + 'This site is cool.')" onMouseOut="$('.affiliate').html('<br /><br />')"></a><a href="affiliate2"><img src="affiliate2image" onMouseOver="$('.affiliate').html('<br />' + 'This site is awesome.')" onMouseOut="$('.affiliate').html('<br /><br />')"></a><a href="affiliate3"><img src="affiliate3image" onMouseOver="$('.affiliate').html('<br />' + 'This site is amazing!')" onMouseOut="$('.affiliate').html('<br /><br />')"></a></center>

Save the HTML and viola! you just wasted 5 minutes installing a dumb script! Enjoy Tongue

Preview: http://codewatchers.smfforfree4.com/index.php
It automatically makes the box bigger when you hover over the affiliate, but that doesn't happen if you add more stuff to the portal Wink
« Last Edit: July 23, 2008, 08:47:52 am by CodeLover » Report Spam   Logged

Don't get mad at me if I'm acting immature - I'm only 10 Grin


Share on Facebook Share on Twitter

Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« Reply #1 on: May 31, 2008, 10:19:14 am »

Nice one Smiley  Glad to see someone else making codes Cheesy
Report Spam   Logged

K I L L A
Starter

Offline Offline

Posts: 15


View Profile
« Reply #2 on: May 31, 2008, 12:48:14 pm »

I've been looking for a guide on adding the affliates Thanks Tongue
Report Spam   Logged
CodeLover
100 Club Member

Offline Offline

Gender: Male
Posts: 331


View Profile
« Reply #3 on: May 31, 2008, 05:57:13 pm »

There are probably better codes for this, but ok Grin
Report Spam   Logged

Don't get mad at me if I'm acting immature - I'm only 10 Grin


legend 1234
100 Club Member

Offline Offline

Gender: Male
Posts: 461


Legend 1234


View Profile WWW
« Reply #4 on: June 01, 2008, 12:59:45 am »

woow man very nice first code

great job

legend 1234
Report Spam   Logged

CodeLover
100 Club Member

Offline Offline

Gender: Male
Posts: 331


View Profile
« Reply #5 on: June 01, 2008, 03:32:33 am »

Thanks legend Smiley
Report Spam   Logged

Don't get mad at me if I'm acting immature - I'm only 10 Grin


tonypker13
Ummmm Did I just Pwn myself?
Members

Offline Offline

Posts: 86

I think i just owned myself?


View Profile
« Reply #6 on: June 17, 2008, 01:52:11 am »

Dude Pwnage code!!! Afro Afro Afro Afro
Report Spam   Logged


Brendan
100 Club Member

Offline Offline

Gender: Male
Posts: 219



View Profile
« Reply #7 on: July 23, 2008, 08:21:57 am »

For the part
Code:
onMouseOver="$('.affiliate').html('DESCRIPTION OF SITE')" onMouseOut="$('.affiliate').html('<br />')"
you don't really need that i added it and it didn't do anything it just wrote beside the affiliate that code, so i don't think it necessary
Report Spam   Logged



Signature made by me. This is my first gif I ever made.
CodeLover
100 Club Member

Offline Offline

Gender: Male
Posts: 331


View Profile
« Reply #8 on: July 23, 2008, 08:44:54 am »

What that part of the code does is it makes it so that hovering your mouse over the image makes the description appear. Oh and I messed up on the code that I put in the first post, I'm gonna fix that now...
Report Spam   Logged

Don't get mad at me if I'm acting immature - I'm only 10 Grin


Brendan
100 Club Member

Offline Offline

Gender: Male
Posts: 219



View Profile
« Reply #9 on: July 23, 2008, 08:49:33 am »

oK Smiley Awesome job I got it to work...do you have a affiliate So i can add yours??
Report Spam   Logged



Signature made by me. This is my first gif I ever made.
CodeLover
100 Club Member

Offline Offline

Gender: Male
Posts: 331


View Profile
« Reply #10 on: July 23, 2008, 08:57:52 am »

I actually don't have an affiliate image because I'm too lazy to make one;

And I'm going to hold off on the linking to sites/advertising for awhile...
Report Spam   Logged

Don't get mad at me if I'm acting immature - I'm only 10 Grin


Brendan
100 Club Member

Offline Offline

Gender: Male
Posts: 219



View Profile
« Reply #11 on: July 23, 2008, 08:59:31 am »

Thats not good well maybe for you it is good  Cheesy
Report Spam   Logged



Signature made by me. This is my first gif I ever made.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy