website.com/username

Post your suggestions for the script here.

website.com/username

Postby scottdallas » Mon Apr 20, 2009 2:40 pm

I have no idea how it would be done or where to start but I was thinking it would be awesome if when a user signed up on cnr it would automatically create them a directory on the website so website.com/username shows up.. then when they write stuff it could show up their main news on their page and on like username/view.php?news-article.html

Seems like most logical setup to me at the moment. hmm
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Partyism » Mon Apr 20, 2009 4:34 pm

uhm correct me if im wrong but isnt this already possible?

example: http://www.partyism.nl/leden/partyism-nl
translated : http://www.partyism.nl/member/membername

Avatar beeing showed, all fields en my articles...
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby scottdallas » Wed Apr 22, 2009 10:26 am

yes.. it appears when one acquires such knowledge, such as yourself, this can occur happily.

CAN YOU SHARE YOUR SECRETS? (reminds me of that MadTV skit: http://www.youtube.com/watch?v=kTFZyl7hfBw)

hey what's goin on with the /member/ part in the URL tho lol... dont want it
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Partyism » Wed Apr 22, 2009 1:28 pm

ive made a page called profile.php in root
in my templates i have a link on a member name like this:

Code: Select all
<a href="{link=../profile/user}" title="Go to {author}s profile">{author}</a>


urls.ini

Code: Select all
[../profile]
dousers = "member{add:do=users}"
user = "member/{user:do=users}"


my include code on all pages:

Code: Select all
<?PHP
            if ($do == 'users'){
               include $cutepath.'/show_users.php';
            } elseif ($do == 'archives'){
               echo cn_archives();
            } else {
               $number = "15";
               $template = "Headlines";
               $category = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22";
               include($cutepath.'/show_news.php');
            }
         ?>   
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby scottdallas » Wed Apr 22, 2009 1:48 pm

nice i see i'm going to forget tho so i'm going to bookmark this and come back to study it :)

my members list works on scodal.com but when you click names it goes to the wrong page and stuff. i've been needing to figure out what's up with all that. this should help :)
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Partyism » Wed Apr 22, 2009 2:03 pm

Good luck, youll need it.
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby scottdallas » Thu Apr 23, 2009 2:19 pm

lol it always says that on SmashTV right before you start.. "Good luck.. you'lllll need it!" am i the only one that played that?

I still haven't looked into the code yet.

update okay checked it out

So, I'm guessing I only need this to make it work
Code: Select all
<?PHP
            if ($do == 'users'){
               include $cutepath.'/show_users.php';
            } else {
               $number = "10";
               include($cutepath.'/show_news.php');
            }
         ?>


Yes, correct.. lol.. Okay, I'm getting somewhere with this:
http://www.scodal.com/who.php?users/scodal.html
http://www.scodal.com/who.php?users/dice.html

I wish I could take out 'users/'.... also does it do this on your site? When you're on a content page, for example: http://www.scodal.com/view.php?this-is-awesome.html then I click the user 'dice' (on far right).. it takes you to http://www.scodal.com/who.php?users/dic ... esome.html which is wrong.. and in comments it doesn't work at all showing up as http://www.scodal.com/{link=../who/user} in the href lol and that's as far as i'm going to get with that for now

oh one more thing that would be cool if we could figure it out is to get the 'requested' username in the <title> field so SEO would see this page (http://www.scodal.com/who.php?users/dice.html) as <title>profile of 'dice' :: scodal.com</title> or something
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby typeman » Tue Feb 09, 2010 8:19 pm

I'm having great difficulties with this. :(

I've done exactly as said above and I've come into two problems with it.

1) My CSS isn't loading (pointing to the wrong place) on the member's profile.

2) When on the profile, the show_users.php doesn't seem to work, thus meaning nothing where it's supposed to be, is there. :(

Can any help please? :D
typeman
 
Posts: 102
Joined: Sat Oct 17, 2009 7:38 am

Postby liketobemad » Fri Feb 12, 2010 9:16 am

For CSS
Try linking complete url like
<link rel="stylesheet" href="http://yoursite.com/style.css" media="all" type="text/css" />


and for inclusion of Php files

try include absolute paths.... like /home/...
liketobemad
 
Posts: 36
Joined: Sun Sep 06, 2009 4:39 pm

Postby Hawk » Tue Feb 16, 2010 2:10 pm

For css, I would recommend using absolute paths instead a full domain, so it that case your code would look like this:
Code: Select all
<link href="/css/style.css" rel="stylesheet" type="text/css" />

With PHP include, using absolute paths needs to be done like this, otherwise it won't work, or you can just use relative paths.
Example how to do include with absolute path:
Code: Select all
<?php include $_SERVER['DOCUMENT_ROOT']."/includes/includefile.php"; ?>
User avatar
Hawk
 
Posts: 248
Joined: Tue Aug 29, 2006 9:00 pm

Postby typeman » Wed Feb 17, 2010 7:12 pm

Hawk wrote:For css, I would recommend using absolute paths instead a full domain, so it that case your code would look like this:
Code: Select all
<link href="/css/style.css" rel="stylesheet" type="text/css" />

With PHP include, using absolute paths needs to be done like this, otherwise it won't work, or you can just use relative paths.
Example how to do include with absolute path:
Code: Select all
<?php include $_SERVER['DOCUMENT_ROOT']."/includes/includefile.php"; ?>


Thanks :)

I've done that and now all the stuff is there. My only problem now is the URL ini. I've done exactly as stated above, but the user's profile doesn't appear on the page. However, the table thing does (if i haven't selected a user).
typeman
 
Posts: 102
Joined: Sat Oct 17, 2009 7:38 am

Postby Hawk » Fri Feb 19, 2010 7:05 pm

Hm, you could try with something like this:
Code: Select all
dousers = "{add:do=users}"
user = "{user:do=users}.html"

Not sure why, but for some reason I never managed to get to post news without the extension, so maybe the same thing is case here too.
However, I would suggest using the code like this
Code: Select all
dousers = "users{add:do=users}"
user = "users/{user:do=users}.html"

simply for seo reasons, as user profile information isn't the most relevant information you have on your site, so you would get other more important pages better indexed.
User avatar
Hawk
 
Posts: 248
Joined: Tue Aug 29, 2006 9:00 pm


Return to Suggestions



Who is online

Users browsing this forum: No registered users and 1 guest