Login     Sign up
Automatically add admin as friend when signed up?
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Hey,

I wanted to know if this can be done, the reason is I will be using the newsfeed about site updates/changes etc. and displaying them in the feed of members would be great, they would always have the option to remove as friend if they dont want to see updates.

Thanks

164 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

file: member.module.php

function signup

below

[code]
$uid = insert_id();
[/code]
add code

[code]
sql_query("insert into ".tb()."friends (uid,fid,created) values ($uid,1,$timeline)");
sql_query("insert into ".tb()."friends (uid,fid,created) values (1,$uid,$timeline)");
[/code]

assuming that the account id of admin is 1

164 months ago
John D (@johnd)
Join date: Oct 29th 2010
Community posts: 132
View Profile
Send Message

Thank you very much falcon :)

Easier than I thought :)

164 months ago
Pencil Eaters (@mikecow)
Join date: Oct 16th 2010
Community posts: 29
View Profile
Send Message

this is something i'm looking to do please give a little more detail

163 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

just put this..

[code]sql_query("insert into ".tb()."friends (uid,fid,created) values ($uid,1,$timeline)");
sql_query("insert into ".tb()."friends (uid,fid,created) values (1,$uid,$timeline)");[/code]

below this

[code]$uid = insert_id();[/code]

in this file member.module.php which is in includes/libs

you can change the 1 to whatever ID # admin is which would normally be 1 in default install but could be something else just check in phpMyadmin (accounts table) if you think it could be something else and change it

163 months ago
Pencil Eaters (@mikecow)
Join date: Oct 16th 2010
Community posts: 29
View Profile
Send Message

but which code set should i insert it in between. like in html you have body tags and headers etc. There is so much code here i'm not sure where to put it. Do i just put it anywhere?

163 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

well as i wrote before

file: includes\libs\member.module.php

there is a function called signup

in that function there is a line

$uid = insert_id();

just below that

insert these two lines

sql_query("insert into ".tb()."friends (uid,fid,created) values ($uid,1,$timeline)");
sql_query("insert into ".tb()."friends (uid,fid,created) values (1,$uid,$timeline)");

163 months ago
Pencil Eaters (@mikecow)
Join date: Oct 16th 2010
Community posts: 29
View Profile
Send Message

Thanks. I've managed to go to the files and everything but i still can't seem to find the signup function. i'm using version 4.2.1. please make sure your wording everything carefully. I understand it, but i just cant seem to find the signup fucntion.

163 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

mate what do you mean 'please make sure your wording everything carefully. I understand it, but i just cant seem to find the signup fucntion'

its pretty straight forward

just put these 2 lines of code..
[code]
sql_query("insert into ".tb()."friends (uid,fid,created) values ($uid,1,$timeline)");
sql_query("insert into ".tb()."friends (uid,fid,created) values (1,$uid,$timeline)");
[/code]

below this line of code.

[Code]$uid = insert_id();[/code]

in this file member.module.php which is in includes/libs

the wording couldn't be more accurate ..

open file (member.module.php) in your editor go to search find this line [code]$uid = insert_id();[/code]

and insert the other 2x lines below it.. simple

163 months ago
Pencil Eaters (@mikecow)
Join date: Oct 16th 2010
Community posts: 29
View Profile
Send Message

lol cool. finally found it. thanks so much lol. my eyes were everywhere. thanks again. Also please sign up for my site also which is
www.pencileaters.com

163 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

:) glad to hear it Mike ...

163 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

thanks mate, for the translation ;)

163 months ago
1 2 3 Next