vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Custom Cursor on / off (https://vborg.vbsupport.ru/showthread.php?t=47339)

Kars10 01-03-2003 07:40 PM

Custom Cursor on / off
 
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:

[sql]ALTER TABLE user ADD customcursor smallint(6) DEFAULT '0' NOT NULL[/sql]

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:

Code:

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:
[sql]ALTER TABLE user ADD customcursor smallint(6) DEFAULT '0' NOT NULL[/sql]

Open forum/member.php
Find:
Code:

  if ($bbuserinfo[emailnotification]) {
    $emailnotificationchecked="checked";
    $emailnotificationnotchecked="";
  } else {
    $emailnotificationchecked="";
    $emailnotificationnotchecked="checked";
  }

add below:
Code:

  if ($bbuserinfo[customcursor]) {
    $customcursorchecked="checked";
    $customcursornotchecked="";
  } else {
    $customcursorchecked="";
    $customcursornotchecked="checked";
  }

Find:
Code:

  $emailnotification=iif($emailnotification=="yes",1,0);
add below:
Code:

  $customcursor=iif($customcursor=="yes",1,0);
Find: (unhacked vB)
Code:

  $DB_site->query("UPDATE user
                  SET ".$updatestyles."adminemail='$adminemail',
                      showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
                      maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
                      timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
                      startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
                      emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
                      nosessionhash='$nosessionhash'
                  WHERE userid='$bbuserinfo[userid]'");

Replace with:
Code:

  $DB_site->query("UPDATE user
                  SET ".$updatestyles."adminemail='$adminemail',
                      showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
                      maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
                      timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',customcursor='$customcursor',
                      startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
                      emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
                      nosessionhash='$nosessionhash'
                  WHERE userid='$bbuserinfo[userid]'");

Edit the "modifyoptions" template
Find:
Code:

<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:
Code:

<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:
Code:

// ###################### 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:
Code:

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

1 Attachment(s)
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


All times are GMT. The time now is 12:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01069 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete