2007-08-07, 07:34 PM
Pages: 1 2
2007-08-08, 07:10 AM
It can always be hardcoded in the member.php file Will take a look for it right away
Open member.php
Find
Replace by
Find
Open member.php
Find
$query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'");
Replace by
if(!$mybb->input['username'])
{
$query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'");
}
else
{
// CHECK IF USERNAME EXISTS
$uname = username_exists($db->escape_string($mybb->input['username']));
if($uname)
{
$username = $db->escape_string($mybb->input['username']);
// GET INFO
$query = $db->simple_select(TABLE_PREFIX."users", "*", "username='$username'");
}
}
Find
$memprofile = $db->fetch_array($query);
Add below $uid = $memprofile['uid'];
2007-08-08, 05:13 PM
LeX- Wrote:It can always be hardcoded in the member.php file Will take a look for it right away
Open member.php
Find
$query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'");
Replace by
if(!$mybb->input['username']) { $query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'"); } else { // CHECK IF USERNAME EXISTS $uname = username_exists($db->escape_string($mybb->input['username'])); if($uname) { $username = $db->escape_string($mybb->input['username']); // GET INFO $query = $db->simple_select(TABLE_PREFIX."users", "*", "username='$username'"); } }
You have tested this code? Because I don't succeed in doing to working
2007-08-08, 05:16 PM
Yes i've tested it, you can test it at my forum.
With Username ::
http://thingiej.be/mybb129/member.php?ac...ername=LeX-
With UID ::
http://thingiej.be/mybb129/member.php?ac...file&uid=1
With Username ::
http://thingiej.be/mybb129/member.php?ac...ername=LeX-
With UID ::
http://thingiej.be/mybb129/member.php?ac...file&uid=1
2007-08-08, 06:15 PM
Thanks It's good!!!
Is impossibile translate this code in a plugin?
Is impossibile translate this code in a plugin?
2007-08-08, 06:39 PM
Since there aren't any good hooks for it, i will have to say no for now =P
2007-08-18, 10:37 AM
LeX- Wrote:Since there aren't any good hooks for it, i will have to say no for now =P
Thanks for your code, is good!
Is possible modified in the URL the username for example if there is a nickname: gòkù i want that the url is http://forum.it/member.php?action=profile&username=goku and not http://forum.it/member.php?action=profile&username=gòkù
Is possible?
2007-08-18, 10:45 AM
No, cause when you're gonna search for the username "goku" it wont return any result. And you can't use a str_replace for the char o into ò and u into ù , cause not every name needs that replacement.
2007-08-27, 07:57 PM
LeX- Wrote:It can always be hardcoded in the member.php file Will take a look for it right away
Open member.php
Find
$query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'");
Replace by
if(!$mybb->input['username']) { $query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'"); } else { // CHECK IF USERNAME EXISTS $uname = username_exists($db->escape_string($mybb->input['username'])); if($uname) { $username = $db->escape_string($mybb->input['username']); // GET INFO $query = $db->simple_select(TABLE_PREFIX."users", "*", "username='$username'"); } }
However this code has a bug: in the page profile when there is written "Find All Threads — Find All Posts", the links in them don't work
2007-08-27, 08:01 PM
gokufg Wrote:LeX- Wrote:It can always be hardcoded in the member.php file Will take a look for it right away
Open member.php
Find
$query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'");
Replace by
if(!$mybb->input['username']) { $query = $db->simple_select(TABLE_PREFIX."users", "*", "uid='$uid'"); } else { // CHECK IF USERNAME EXISTS $uname = username_exists($db->escape_string($mybb->input['username'])); if($uname) { $username = $db->escape_string($mybb->input['username']); // GET INFO $query = $db->simple_select(TABLE_PREFIX."users", "*", "username='$username'"); } }
However this code has a bug: in the page profile when there is written "Find All Threads — Find All Posts", the links in them don't work
Find all threads - Find all posts goes by search.php ... not by member.php. And every profilelink is build up by default with a uid; if the normal profilelink works it will also work when you click on a profilelink in the "Find all threads - find all posts" results.
Pages: 1 2