Search found 92 matches

by amochohan
Fri Feb 08, 2008 12:24 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: How to find top 20% in array
Replies: 8
Views: 373

How to find top 20% in array

Im writing a mod for phpBB which i'm close to cracking - I just can't get my head around some code. Basically, each user gets points for different activities they do (this works fine, the points get assigned no problem). Now i'm fetching a list of all the users in the database, sorted by their point...
by amochohan
Mon Jan 21, 2008 10:37 am
Forum: [3.0.x] MOD Writers Discussion
Topic: Check to see if user is online
Replies: 3
Views: 475

Re: Check to see if user is online

Thanks to member jelly_doughnut, Im using the following code to check if a user is online or not: //Online time is currently 5 minutes (60 secs x 5) $onlinetime = time() - 300; $sql = 'SELECT session_user_id FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = 2 AND session_time > ' . $onlinetime; $r...
by amochohan
Mon Jan 21, 2008 10:21 am
Forum: [3.0.x] MOD Writers Discussion
Topic: Show if a user is logged in
Replies: 4
Views: 316

Re: Show if a user is logged in

I'm using: $lasthour = time() - 3600; $sql = 'SELECT session_user_id FROM phpbb_sessions WHERE session_user_id = 2 AND session_time > ' . $lasthour; $result = $db->sql_query($sql); $rows = array(); while ($row = $db->sql_fetchrow($result)) { $rows[] = $row; } $db->sql_freeresult($result); $total_pos...
by amochohan
Fri Jan 18, 2008 11:03 am
Forum: [3.0.x] MOD Writers Discussion
Topic: cant show bbcode
Replies: 1
Views: 185

cant show bbcode

I'm trying to post comments on a page to view completely separate to the forums in my environment while maintaining the use of bbcode. The code is now working perfectly to insert the parsed text into a table in the database so it incorporates the bb tags. However when i try to read the data back fro...
by amochohan
Fri Jan 18, 2008 10:18 am
Forum: [3.0.x] MOD Writers Discussion
Topic: Show if a user is logged in
Replies: 4
Views: 316

Re: Show if a user is logged in

Thanks for the reply jelly, I think my question was a bit vague however... I meant how can one user see if another is online.. For example, user named "joe" views a custom page i've built with information about user "fred". I want it to show on freds page if he is online, or calculate when he was la...
by amochohan
Thu Jan 17, 2008 4:45 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: Show if a user is logged in
Replies: 4
Views: 316

Show if a user is logged in

I've managed to get users to login and out externally from the phpBB forum environment and that works fine. When they then navigate to the forum and view any of their posts it shows they are set as online - so I know that also works. What I want to do is show if a user is online or not on a page ext...
by amochohan
Mon Jan 14, 2008 11:46 am
Forum: [3.0.x] MOD Writers Discussion
Topic: $user_add to insert custom fields too
Replies: 1
Views: 243

$user_add to insert custom fields too

Is it possible to build an sql array, to insert a new user using $user_add including custom fields? Come crude coding... $sql_ary = array( 'username' => $user, 'username_clean' => $user_clean, 'user_password' => phpbb_hash($password), 'user_pass_convert' => 0, 'user_email' => $email, 'user_email_has...
by amochohan
Thu Jan 10, 2008 2:19 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: Fatal error on call to sql_query
Replies: 1
Views: 236

Fatal error on call to sql_query

Im doing a simple select statement (well trying!) and I keep getting the following error: Fatal error: Call to a member function sql_query() on a non-object in C:\xampp\htdocs\tc2\newuser.php on line 217 The code in question is: $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE username = ' . $v...
by amochohan
Thu Jan 10, 2008 1:34 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: update users details
Replies: 3
Views: 197

Re: update users details

ive built an array of the details, but i don't know how to use it within the update query... can you give an example so i can use it to learn from?
by amochohan
Thu Jan 10, 2008 12:51 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: update users details
Replies: 3
Views: 197

update users details

How can this be done using the phpbb api?
by amochohan
Tue Jan 08, 2008 2:48 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: where is $avatar_salt defined?
Replies: 6
Views: 1104

where is $avatar_salt defined?

As the title suggests. Im going to be uploading image files which are to be used as a users avatar but the way it which the database saves the filename and the filename itself don't correspond. It seems the filename is being salted so just wanted to know how to find out what the salt is so i can wri...
by amochohan
Tue Jan 08, 2008 1:17 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: Site integration with PHPBB3.0?
Replies: 2
Views: 1023

Re: Site integration with PHPBB3.0?

I've managed to get the login working, it's actually very simple to do. As another member recommended, if you search you'll find all you need to do it. Once my project is finished i might make it publically available depending on if anyone needs it. I've made a much nicer registration page, with liv...
by amochohan
Tue Jan 08, 2008 12:44 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: Upload avatars from external registration
Replies: 2
Views: 431

Re: Upload avatars from external registration

Update: I was trying to just insert the image using: 'user_avatar' => $new_image when setting up the array for use with the user_add function as I'd thought that would automatically handle the insertion once given the file but it doesn't. I've looked around in the functions_user.php file and have fo...
by amochohan
Tue Jan 08, 2008 9:46 am
Forum: [3.0.x] MOD Writers Discussion
Topic: Upload avatars from external registration
Replies: 2
Views: 431

Re: Upload avatars from external registration

I've managed to get the page to display avatars, it's just the ability to upload a new avatar that i'm struggling with if anyone has any suggestions?
by amochohan
Mon Jan 07, 2008 2:55 pm
Forum: [3.0.x] MOD Writers Discussion
Topic: Upload avatars from external registration
Replies: 2
Views: 431

Upload avatars from external registration

Im creating a site based around a phpBB 3 forum, i've managed to get an external registration form working great with logins etc. I can read all the user data no problems on my own php pages. The problem is, that I can't seem to figure out how to upload avatars to a users profile... Can anyone help?...

Go to advanced search