PDA

View Full Version : [ReQuest] If user doesn't specify a homepage, default is used.


N9ne
06-18-2002, 04:16 PM
What the title says;

In depth: Lets say someone signs up for your board, but they don't put in a homepage, well my request is to have it say a chosen URL (settable via ACP) to display. This is only if field is left blank...

So basically...

1. I sign up
2. I don't put in a homepage
3. It's blank
4. My homepage automatically becomes whatever homepage is set as default via the ACP :)

I think it's a simple good idea?

I hope someone can make it!!

Xenon
06-18-2002, 04:33 PM
open register.php

find
$DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signa ture,adminemail,showemail,invisible,usertitle,join date,cookieuser,daysprune,lastvisit,lastactivity,u sergroupid,timezoneoffset,emailnotification,receiv epm,emailonpm,options,birthday,maxposts,startofwee k,ipaddress,pmpopup,referrerid,nosessionhash,avata rid) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes(md5($password))."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm',' $options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash','$avatarid')");

before it add:

if(trim($homepage)=="") $homepage="http://url";


ok it doesn't read it out from admincp, but so its very easy to code ;)

N9ne
06-18-2002, 07:33 PM
Thanks! Maybe you could release this as a mini-hack, I'm sure it'd be popular!

N9ne
06-18-2002, 07:37 PM
Will this only work for people who register after I uploaded the new file?? Because I just did the hack and a user who had registered before me taking this action (who didn't put in a homepage) still has a blank homepage in his profile...

Chris M
06-18-2002, 07:49 PM
You'll have to run an SQL query...

Satan

Xenon
06-18-2002, 09:03 PM
yes it'll only work for people which register after you uploaded the new file.

as satan said, you could run an sql-query to use it for already registred users:

UPDATE user SET homepage='http://url' WHERE homepage=''


and to deny users to edit the homepage to a blank, open member.php find
$DB_site->query("UPDATE user SET birthday='".addslashes($birthday)."',signature='".addslashes($signature)."',customtitle='".intval($customtitle)."',usertitle='".addslashes($customtext)."',email='".addslashes(htmlspecialchars($email))."',parentemail='".addslashes(htmlspecialchars($parentemail))."',coppauser='$coppauser',homepage='".addslashes(htmlspecialchars($homepage))."',icq='".addslashes(htmlspecialchars($icq))."',aim='".addslashes(htmlspecialchars($aim))."',yahoo='".addslashes(htmlspecialchars($yahoo))."',usergroupid='$bbuserinfo[usergroupid]' WHERE userid='$bbuserinfo[userid]'");
and there also add before:if(trim($homepage)=="") $homepage="http://url";

g-force2k2
06-19-2002, 01:19 AM
Tha Rock you can always just as easily as alter the query for homepage and give it the default value of whateva you wanted it to be ^_- hope that helps...

g-force2k2