PDA

View Full Version : Custom Cursor on / off


Kars10
01-03-2003, 07:40 PM
Hi !!
Is there a way to set a (or more) custom-cursor(s) in my forums and my members can switch the cursor(s) on or off in there options??

Currently i using in headinclude something like:

CURSOR: url('cursor.cur');

Can anyone help?

Logik
01-03-2003, 07:42 PM
In my opinon. That would bulk up the forums.. But that is not what you think maybe.

Graphics
01-04-2003, 01:34 PM
I can't do this myself but I know that it will be quite hard to set up. At least I think... You'll need to use Javascript... *Shudders*

Chris M
01-04-2003, 01:55 PM
Why would it be hard?

Im sure you could just add a field to the user table, something like:

ALTER TABLE user ADD customcursor smallint(6) DEFAULT '0' NOT NULL

Then just edit member.php and set the queries to update the user etc, then edit the modifyoptions template, and add a radio button section with "Use custom cursor?", and then "yes" and "no" options...

Then just edit global.php, and do a check on the user to see if they use the custom cursor, something like:

if ($bbuserinfo[customcursor]==1) {
$cursorcode = "the cursor code";
}else{
$cursorcode = "";
}

Then jsut add $cursorcode to the headinclude template...

Im sure it can be done that way;)

Satan

Kars10
01-04-2003, 02:05 PM
Cool thank you Chris!!
Can you code something for me/us? ;)
Would be very cool!!

Chris M
01-04-2003, 04:56 PM
I could try;)

:)

Satan

Kars10
01-04-2003, 06:10 PM
Cool!! Thanks chris!! ;)

Chris M
01-04-2003, 08:48 PM
Heh...I had coded it earlier, but our stupid internet cutoff:bored:

Here you go!

Run this sql query:
ALTER TABLE user ADD customcursor smallint(6) DEFAULT '0' NOT NULL

Open forum/member.php
Find:
if ($bbuserinfo[emailnotification]) {
$emailnotificationchecked="checked";
$emailnotificationnotchecked="";
} else {
$emailnotificationchecked="";
$emailnotificationnotchecked="checked";
}
add below:
if ($bbuserinfo[customcursor]) {
$customcursorchecked="checked";
$customcursornotchecked="";
} else {
$customcursorchecked="";
$customcursornotchecked="checked";
}
Find:
$emailnotification=iif($emailnotification=="yes",1,0);
add below:
$customcursor=iif($customcursor=="yes",1,0);
Find: (unhacked vB)
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cook ieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergrou pid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
Replace with:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cook ieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',customcur sor='$customcursor',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergrou pid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
Edit the "modifyoptions" template
Find:
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Use 'Email Notification' by default?</b></normalfont><br>
<smallfont>Using this option emails you whenever someone replies to a thread that you have participated in.</smallfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>
<input type="radio" name="emailnotification" value="yes" $emailnotificationchecked> yes
<input type="radio" name="emailnotification" value="no" $emailnotificationnotchecked> no
</normalfont></td>
</tr>
add below:
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Use Custom Cursor?</b></normalfont><br>
<smallfont>Using this option sets your Cursor to the Custom Cursor set by the Administrator.</smallfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>
<input type="radio" name="customcursor" value="yes" $customcursorchecked> yes
<input type="radio" name="customcursor" value="no" $customcursornotchecked> no
</normalfont></td>
</tr>
Open forum/global.php
Find:
// ###################### Referrer Stuff #########################

// Referer stuff
if ($bbuserinfo['userid']==0 and $usereferrer and !$bbreferrerid and $referrerid) {
if ($r_id = $DB_site->query_first("SELECT userid FROM user WHERE userid = '".addslashes($referrerid)."'")) {
vbsetcookie("bbreferrerid",$r_id[userid]);
}
}
add below:
if ($bbuserinfo[customcursor]==1) {
$cursorcode = "the cursor code";
}else{
$cursorcode = "";
}
Now open the headinclude template and add $cursorcode where you want...

:)

Satan

Kars10
01-05-2003, 07:18 AM
This saves my life!!! :D
Thank you so much Chris!!! ;)

Btw: ...this could be ready to put in Full Releases!

Kars10
01-05-2003, 07:22 AM
Here, i put it in a Txt-File... ;)

Logik
01-05-2003, 07:55 AM
Nice. but i wont use ;)

Kars10
01-05-2003, 08:37 AM
Works like a charm Hellsatan!! :)

Chris M
01-05-2003, 09:50 AM
It does? Cool...

You can release it if you'd like:)

Satan