Search found 46 matches

by rabatos
Sat Nov 17, 2012 11:17 am
Forum: Tutorials
Topic: URL Shortener, htaccess problem
Replies: 3
Views: 1774

Re: URL Shortener, htaccess problem

Actually I've solved the problem.

The .htaccess file is fine because I've used it before for ErrorDocuments

I found it was a / before go.php I needed like so:

RewriteRule ^([a-z0-9]+)$ /go.php?key=$1 [L]
by rabatos
Thu Nov 15, 2012 5:03 am
Forum: Tutorials
Topic: URL Shortener, htaccess problem
Replies: 3
Views: 1774

URL Shortener, htaccess problem

For the URL shortener tutorial I can't seem to get the code in the htaccess file to work.

I entered:
[syntax=text]RewriteEngine On

RewriteRule ^([a-z0-9]+)$ go.php?key=$1[/syntax]

and when I enter, http://website.com/2 I just get a 404 error, and am not redirected to the go.php page at all.
by rabatos
Tue Oct 16, 2012 9:38 am
Forum: Tutorials
Topic: User Profiles - Favourites.
Replies: 1
Views: 554

User Profiles - Favourites.

I wanted to have members to be able to favourite another members profile. Similar to 'following' I guess except to just have a 'favourites' list showing your favourite users. So I had a go at this, and added a 'favourites' column to the users table. In profile.php I added: [syntax=php] <?php //Add t...
by rabatos
Sun Oct 14, 2012 8:04 am
Forum: Tutorials
Topic: User system - Show online users.
Replies: 1
Views: 604

User system - Show online users.

I tried set up a system which displays the currently online user. I added a column to the users table, so when a user logs in, that column for the user is updated with a value 'online' is inserted into the table. The member pages then just displays the users online, by checking the online column for...
by rabatos
Sat Oct 13, 2012 8:04 am
Forum: Code
Topic: News Post/Blog - flat pack system.
Replies: 2
Views: 2218

News Post/Blog - flat pack system.

I was looking for a simple news post/blog type system for the front page of my website. The website was for image sharing and the posting thing I wanted was just for members to post updates that they have made to image galleries on the website. All I wanted was a simple form where it stores posts/co...
by rabatos
Fri Oct 12, 2012 10:25 am
Forum: Tutorials
Topic: Image Gallery - how to sort images. [SOLVED]
Replies: 3
Views: 825

Re: Image Gallery - how to sort images. [SOLVED]

haha, you're welcome.
by rabatos
Mon Oct 08, 2012 7:56 am
Forum: Tutorials
Topic: Image Gallery - how to sort images. [SOLVED]
Replies: 3
Views: 825

Re: Image Gallery - how to sort images. [SOLVED]

I've found the solution.

[syntax=php]
$images = glob("*.{jpg,jpeg,png,gif}", GLOB_BRACE);

array_multisort(
array_map( 'filemtime', $images ),
SORT_NUMERIC,
SORT_DESC,
$images
);
[/syntax]

The array_multisort() function is explained here:
http://www.w3schools.com/php/func_array_multisort.asp
by rabatos
Mon Oct 08, 2012 7:31 am
Forum: Tutorials
Topic: Image Gallery - how to sort images. [SOLVED]
Replies: 3
Views: 825

Image Gallery - how to sort images. [SOLVED]

Following the Automatic Image Gallery System. Is there a way to display the images in a certain order. Basically I want to have the images displayed in the order of the most recently added image. So date order. I have a file upload function, which I can use to add new photos to the gallery, hence wh...
by rabatos
Tue Sep 18, 2012 10:30 am
Forum: Tutorials
Topic: User Profile - edit profile and profile page help
Replies: 2
Views: 646

Re: User Profile - edit profile and profile page help

Thanks. Got it working.
by rabatos
Mon Sep 17, 2012 6:24 am
Forum: Code
Topic: Simple Emailer
Replies: 1
Views: 1615

Re: Simple Emailer

Links no longer active, any chance of a fresh one?
by rabatos
Sun Sep 16, 2012 6:46 am
Forum: Tutorials
Topic: User Profile - edit profile and profile page help
Replies: 2
Views: 646

User Profile - edit profile and profile page help

I want to have some optional fields for the user profiles. So what I want is for example: On the edit profile page to be able to enter a phone number. But for this to only be displayed on the profile page if there is a value in the database. If its empty nothing should show. And if there is a value ...
by rabatos
Wed Sep 12, 2012 10:21 pm
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2505

Re: User Profile List Catergories

Thanks
by rabatos
Wed Sep 12, 2012 1:58 am
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2505

Re: User Profile List Catergories

Oh okay I see my problem. Thank you for that.
Also is there a way, that if the number of users in 0 that I can hide that.
So it only shows 1+
by rabatos
Tue Sep 11, 2012 5:58 am
Forum: Tutorials
Topic: User Profile- edit profile <br> tags
Replies: 8
Views: 1585

Re: User Profile- edit profile <br> tags

Alright thanks for that. I'll make the appropriate changes.
by rabatos
Mon Sep 10, 2012 10:39 am
Forum: Tutorials
Topic: User Profile- edit profile <br> tags
Replies: 8
Views: 1585

Re: User Profile- edit profile <br> tags

Ah okay, so having

$info = mysql_real_escape_string(nl2br(htmlentities($info)));

for my update profile function in user.inc isn't a good idea.
by rabatos
Mon Sep 10, 2012 5:06 am
Forum: Tutorials
Topic: User Profile- edit profile <br> tags
Replies: 8
Views: 1585

Re: User Profile- edit profile <br> tags

I added return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string); but removed the "\n" so now it is return preg_replace('/\<br(\s*)?\/?\>/i', "", $string); and this seems to work fine, no problems that I can see, but could removing "\n" affect anything?
by rabatos
Mon Sep 10, 2012 4:37 am
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2505

Re: User Profile List Catergories

This is the category list page [syntax=php] <?php include('core/init.inc.php'); $pageTitle = "Trades"; include('../includes/header.php') ?> <body class="body"> <br> <div class="gradientBoxesWithOuterShadows"> <div> <h4 class="font5">NZ Trades</h4> <br> <div al...
by rabatos
Sun Sep 09, 2012 2:28 pm
Forum: Tutorials
Topic: User Profile- edit profile <br> tags
Replies: 8
Views: 1585

Re: User Profile- edit profile <br> tags

Well this is the edit_profile.php [syntax=php] <?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/members/core/init.inc.php"; include_once($path); if (isset($_POST['location'], $_POST['info'])){ $errors = array(); if (preg_match('#^[a-z0-9 ]+$#i', $_POST['location']) === 0){ $errors[] = '...
by rabatos
Sun Sep 09, 2012 1:09 pm
Forum: Tutorials
Topic: User Profile- edit profile <br> tags
Replies: 8
Views: 1585

User Profile- edit profile <br> tags

On my user profile edit page, in the about me text box, I have it so that the current information from the database for the user is shown, so they can edit the old info. But in the text box it shows all the <br> tags which are generated after the user updates the profile. How can I hide this, as I h...
by rabatos
Fri Sep 07, 2012 4:52 am
Forum: Tutorials
Topic: User Profile List Catergories
Replies: 18
Views: 2505

Re: User Profile List Catergories

Oh yup I got the count sort of working.

I get the correct count of users, but it displays as zeros.

like this:

category 000000

It should show a number.
by rabatos
Thu Sep 06, 2012 11:30 am
Forum: Tutorials
Topic: User Profile - Profile Pictures
Replies: 3
Views: 851

Re: User Profile - Profile Pictures

Thanks for that. Hadn't thought to check there.

Just one thing.

What do I change if I want to be able to re-size the height and scale the width instead of re-sizing the width like it's doing now.