| Topic Archived |
View previous topic :: View next topic |
| Author |
Message |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Sun Aug 22, 2004 2:21 pm Post subject: Member Quick Link |
|
can we make it so that members of the site can access their profile through the simple link of www.yoursitename.com/username ???
it would be MUCH easier for members and non-members to promote the site...like, i see people who have profiles on other websites using links like above but on cpg it's something like www.yousitename.com/in...?=username
: )
can this be done?
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
Trevor Developer


Offline Joined: Apr 19, 2004 Posts: 2170 Location: New York
|
Posted: Sun Aug 22, 2004 11:50 pm Post subject: Re: Member Quick Link |
|
It may interfere with other tasks though.
In this case, it may be best to do something like index.php?user=Cody
Trevor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / 1.3.34 / 4.1.18 / 4.4.2 / CVS
|
|
| Back to top |
|
 |
DJ Maze Developer


Offline Joined: Apr 19, 2004 Posts: 5683 Location: http://tinyurl.com/5z8dmv
|
Posted: Mon Aug 23, 2004 1:20 am Post subject: Re: Member Quick Link |
|
You can do that easily yourself with a .htaccess mod_rewrite
| Code:: |
RewriteRule ^member/(.*) index.php?name=Your_Account&op=userinfo&username=$1 |
DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Mon Aug 23, 2004 1:12 pm Post subject: Re: Member Quick Link |
|
you mean by adding that to the root htaccess file, it will let users into their profile/account by typing yoursite.com/username
? : )
i'll have to try it ...!
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Tue Aug 24, 2004 4:28 pm Post subject: Re: Member Quick Link |
|
that doesn't work?
unless i did it wrong
what do i need to do?
so users can click on yoursitename.com/username
to pull up their info?
thanks!
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Tue Aug 24, 2004 8:06 pm Post subject: Re: Member Quick Link |
|
any word on this either?
i tried the htaccess thing, unless i goofed it up?
would be a great feature for the site : )
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
Trevor Developer


Offline Joined: Apr 19, 2004 Posts: 2170 Location: New York
|
Posted: Tue Aug 24, 2004 8:20 pm Post subject: Re: Member Quick Link |
|
Well, if you don't want to use .htaccess, you could add it to index.php
Open up index.php
Find:
Replace with:
| PHP: |
global $mainindex, $userinfo;
|
Find:
| PHP: |
} else { $message = _MODULENOTACTIVE; nuke_error($message, ""); } } }
|
Replace with:
| PHP: |
} else { $message = _MODULENOTACTIVE; nuke_error($message, ""); } } } elseif (isset($_GET['user'])) { $userLookup = $_GET['user']; if (!ereg("^([a-zA-Z0-9_\-]+)$", $userLookup)) { die("You're so cool!"); } header("Location: ".getlink("Your_Account&op=userinfo&username=$userLookup").""); }
|
Trevor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / 1.3.34 / 4.1.18 / 4.4.2 / CVS
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Wed Aug 25, 2004 1:03 pm Post subject: Re: Member Quick Link |
|
nope that didn't work either.... : (
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
Trevor Developer


Offline Joined: Apr 19, 2004 Posts: 2170 Location: New York
|
Posted: Wed Aug 25, 2004 1:53 pm Post subject: Re: Member Quick Link |
|
Will check on this. I'm having a bit of FTP trouble at the moment, but I should have a working version within an hour or so
Trevor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / 1.3.34 / 4.1.18 / 4.4.2 / CVS
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Wed Aug 25, 2004 4:03 pm Post subject: Re: Member Quick Link |
|
ok rock on ; )
this would be the coolest thing =)
and/or even create a module where users can have their own webpage, like, their profile page but with more stuff...yeah no? : )
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
Trevor Developer


Offline Joined: Apr 19, 2004 Posts: 2170 Location: New York
|
Posted: Wed Aug 25, 2004 4:06 pm Post subject: Re: Member Quick Link |
|
| masterbeta wrote: |
| and/or even create a module where users can have their own webpage, like, their profile page but with more stuff...yeah no? : ) |
Yeah, that would be associated with the My Account module. We've received loads of requests for this, so it just may show up in future releases
Trevor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / 1.3.34 / 4.1.18 / 4.4.2 / CVS
|
|
| Back to top |
|
 |
Trevor Developer


Offline Joined: Apr 19, 2004 Posts: 2170 Location: New York
|
Posted: Wed Aug 25, 2004 7:04 pm Post subject: Re: Member Quick Link |
|
Replace contents of index.php with:
| PHP: |
<?php /********************************************* CPG-NUKE: Advanced Content Management System ******************************************** A highly modified version of PHP-Nuke 6.5 which is Copyright (c) 2002 by Francisco Burzi phpnuke.org
Under the GNU General Public License version 2
Last modification notes:
$Id: index.php,v 1.2 2004/06/25 21:09:20 teckart Exp $
*************************************************************/ require_once("mainfile.php"); $PHP_SELF = "modules.php"; $_SERVER['PHP_SELF'] = "modules.php";
if (!isset($file)) { $file="index"; } else if (ereg("\.\.",$file)) { die("You are so cool..."); }
if (defined('OSC_INSTALLED') && is_user($user)) { run_osc_start(); }
global $userinfo;
if (isset($name)) { // modules.php $module = 1; if (ereg("\.\.",$name)) { die("You are so cool..."); } $name = trim($name); // Fix_Quotes($name, 1);
if ($name == "Credits") { $index = 0; include("header.php"); OpenTable(); echo '<h2 align="center">Credits</h2>'; CloseTable(); echo "<br />"; OpenTable(); echo '<table border=0 width="100%">'; echo '<tr><td><font size="+1"><b>Mod</b></font></td><td><font size="+1"><b>Description</b></font></td><td><font size="+1"><b>Author(s)</b></font></td></tr>'; echo '<tr><td colspan=4><hr /></td></tr>'; echo '<tr><td valign="top">CPG-Nuke '.$Version_Num.'</td><td>'.$copyright.'</td><td valign="top"><a href="http://www.cpgnuke.com" target="_new">Akamu & DJMaze</a></td></tr>'; $result = $db->sql_query("SELECT * FROM ".$prefix."_credits ORDER BY modname"); while($row = $db->sql_fetchrow($result)) { echo '<tr><td colspan=4><hr /></td></tr>'; echo "<tr><td valign=\"top\">$row[modname]</td><td valign=\"top\">$row[description]</td><td valign=\"top\"><a href=\"http://$row[url]\" target=\"_new\">$row[author]</a></td></tr>"; } echo '</table>'; CloseTable(); include("footer.php"); exit; } else if ($name == "smilies") { include("includes/nbbcode.php"); echo smilies_table("window", $field, $form); exit; } else if ($name == "Privacy_Policy") { $index = 0; include("header.php"); OpenTable(); echo '<h2 align="center">Privacy Policy</h2>'; if (is_admin($admin)) { echo '<a href="'.adminlink('UsersConfig').'">Modify this message</a>'; } CloseTable(); echo "<br />"; OpenTable(); list($privacy) = $db->sql_fetchrow($db->sql_query("SELECT registermsg FROM ".$prefix."_users_config")); echo $privacy; CloseTable(); include("footer.php"); exit; } $modpath = "modules/$name/$file.php"; if (!file_exists($modpath)) { die("Sorry, such file doesn't exist..."); } if (is_admin($admin)) { include($modpath); } else { $sql = "SELECT active, view FROM ".$prefix."_modules WHERE title='$name'"; $result = $db->sql_query($sql); list($mod_active, $view) = $db->sql_fetchrow($result); if ($mod_active) { $ThemeSel = get_theme(); if ($view == 0) { include($modpath); } else if ($view == 1) { if (is_user($user)) { include($modpath); } else { // don't show register link unless allowuserreg is yes $allowur = $db->sql_fetchrow($db->sql_query("SELECT allowuserreg FROM ".$prefix."_users_config")); $message = "<b>"._RESTRICTEDAREA."</b><br /><br />"._MODULEUSERS.(($allowur['allowuserreg']) ? _MODULEUSERS2 : "" ) ; nuke_error($message, _ACCESSDENIED); } } elseif ($view == 2) { $message = "<b>"._RESTRICTEDAREA."</b><br /><br />"._MODULESADMINS; nuke_error($message, _ACCESSDENIED); } // VIEW == USERGROUPS elseif ($view > 2) { if ($userinfo['_mem_of_groups'][($view-2)]) { include($modpath); } else { list($groupName) = $db->sql_fetchrow($db->sql_query("select group_name from ".$prefix."_bbgroups where group_id=".($view-2))); $message = "<b>"._RESTRICTEDAREA."</b><br /><br />$groupName group access required"; nuke_error($message, _ACCESSDENIED); } } } else { $message = _MODULENOTACTIVE; nuke_error($message, ""); } } } elseif (isset($_GET['user'])) { $userLookup = $_GET['user']; if (!ereg("^([a-zA-Z0-9_\-]+)$", $userLookup)) { die("You're so cool!"); } header("Location: ".getlink("Your_Account&op=userinfo&username=$userLookup").""); } else { // index.php $name = $main_module; $home = 1; if ($httpref && isset($_SERVER["HTTP_REFERER"])) { $referer = check_html($_SERVER['HTTP_REFERER'], 'nohtml'); if ($referer!="" && !eregi("^unknown", $referer) && substr("$referer",0,strlen($nukeurl))!=$nukeurl && !eregi("^bookmark",$referer)) { $result = $db->sql_query("INSERT INTO ".$prefix."_referer VALUES (NULL, '$referer')"); } $numrows = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$prefix."_referer")); if($numrows[0] >= $httprefmax) { $result = $db->sql_query("DELETE FROM ".$prefix."_referer"); } } $ThemeSel = get_theme(); $modpath = "modules/$name/$file.php"; if (file_exists($modpath)) { require($modpath); } else { $message = (is_admin($admin)) ? '<b>'._HOMEPROBLEM.'</b><br /><br />[ <a href="'.adminlink('modules').'">'._ADDAHOME.'</a> ]' : _HOMEPROBLEMUSER; nuke_error($message, ""); } } ?>
|
See it in action by heading to index.php?user=Phillip, obviousely inputting the username of your choice
Trevor's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux / 1.3.34 / 4.1.18 / 4.4.2 / CVS
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Wed Aug 25, 2004 8:54 pm Post subject: Re: Member Quick Link |
|
yeah but i'd want a yoursite.com/username
: )
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
DJ Maze Developer


Offline Joined: Apr 19, 2004 Posts: 5683 Location: http://tinyurl.com/5z8dmv
|
Posted: Wed Aug 25, 2004 9:43 pm Post subject: Re: Member Quick Link |
|
| Code:: |
<limit GET PUT POST>
order allow,deny
allow from all
</limit>
# deny most common except .php
<filesmatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
deny from all
</filesmatch>
#Disable .htaccess viewing from browser
<files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</files>
<files ~ "\config.php$">
deny from all
</files>
RewriteEngine On
RewriteRule /index.html /index.php
RewriteRule ^member/(.*) index.php?name=Your_Account&op=userinfo&username=$1
# You can change to yoursite.com
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
Options -Indexes |
_________________ There are two paths, the short one and the long one.
When you choose the short path you will notice it takes longer then the long path.
So READ the FAQ and Wiki first 
DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Fedora 15 / 2.2.22 / 5.5.20 / 5.3.10 / CVS
|
|
| Back to top |
|
 |
masterbeta Translator


Offline Joined: May 12, 2004 Posts: 1049 Location: Reading, PA
|
Posted: Wed Aug 25, 2004 10:19 pm Post subject: Re: Member Quick Link |
|
is that if i change the index.php page like above?
i didn't change the index page, but i added the code into htaccess
with no luck : (
_________________ []D [] []\/[] []D
Check out my bear site - www.insidebear.com
masterbeta's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) RHL7 2.6.9-67.0.15ELsmp/A1.3.41(Unix)/MySQL4.1.22-standard/PHP5.2.5-ZO/Dragonfly 9.1.2.1
|
|
| Back to top |
|
 |
|
|