Archive

Posts Tagged ‘php’

Send a Private Message on Group Request in phpBB3

December 6th, 2007

Check out my phpBB3 development board for directions on private messaging leaders on a group request!

programming ,

Display a phpBB3 Avatar on a Custom Page

November 26th, 2007

In your php file, you will need to run a database query, for example:

$sql = 'SELECT user_avatar, user_avatar_type, user_avatar_width, user_avatar_height
            FROM '
. USERS_TABLE . "
            WHERE user_id = "
. $user->data['user_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result)

Now that you have the required data, you can use the [url=http://area51.phpbb.com/docs/code/phpBB3/_includes---functions_display.php.html#functionget_user_avatar]get_user_avatar[/url] function that’s in includes/functions_display.php

$avatar = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']);

Assign $avatar to a template variable.

$template->assign_var('USERS_AVATAR', $avatar)

And finally, add {USERS_AVATAR} into the template page, where you want it to show.

<!-- IF USER_AVATAR -->
            {USER_AVATAR}
            <!-- ELSE -->
            {USER_AVATAR_NONE}
<!-- ENDIF -->

Onovia, hardware, programming ,

Wordpress Thumnail Size

March 26th, 2007

The default thumbnail size for Wordpress is just ridiculous. It’s to small to realy see what exactly the image is. Changing the default thumbnail size is unfortunately not in the Wordpress options.

Following these easy steps, you can change this:
Wordpress Small Thumbnails

into this:
Wordpress Large Thumbnails

  1. Open
    wp-admin/admin-functions.php
  2. Find (as of 2.12 this is on line 2118)
    $max_side = apply_filters( 'wp_thumbnail_max_side_length',
    128, $attachment_id, $file );
  3. Change to
    $max_side = apply_filters( 'wp_thumbnail_max_side_length',
    256, $attachment_id, $file );
  4. Save and upload the file.

These easy steps will double the thumbnail size. You may adjust the altered number to a size of your choice, however 256 will probably be perfect for any theme.

Onovia , ,

Admin Icons SQL

March 6th, 2007

I made a quick and easy PHP script for those of you that use the Admin Icons SQL plugin for amxmodx. The first release was quite simple, and looked ugly. This ones a bit spiffed up, and has a login for security. The only thing you need to modify is the settings in config.php. Report any problems and make requests with a comment. The file is attached to the post.

Features:
- Cookie based authentication
- Add, delete, and edit icon entries

TODO:
- Create an installer
- Create an importer for icons.cfg

Admin Icons SQL

Onovia , ,

Current Projects and a New Comunity!

February 15th, 2007

For the past few days I’ve been experimenting with different ways of logging users on an HLDS. In the past I’ve developed AMXX plug ins to write and read to a database every time a user connected. While this worked great on servers with local databases, it proved to be problematic with most servers, which have remote databases.
My solution: Parse the server via php, getting only the information we need. This produces no lag. It would be less load than you typing status in the console. The project consists of two parts: an amxx plugin, and a php script. The script can be run via cron every x seconds, and the database will be updated live. There’s much more to do with this project. Here’s a screen shot of the output table.

SteamID Tracker

I’ve also been working on a Natural Selection log parser. It’s also written in php. It parses your game log files, looking for specific events. This WILL NOT provide player statistics. This script will be used for general statistics only. The statistics will be saved to a database, so that they can be displayed on your clan or community web page.

Natural Selection Log Parser

On a side note, a friend and myself have started building our new community. We decided on the name UFIGaming. It MIGHT have reason behind the name, but who knows. :D Anyways, you can head on over to the website and register! http://ufigaming.net.

Onovia , ,