Author Topic: whos online as dropdown list  (Read 16672 times)

0 Members and 1 Guest are viewing this topic.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: whos online as dropdown list
« Reply #15 on: December 25, 2005, 03:08:42 PM »
@Acidgod:

Thanks for the corrections.

Althought, I found one weakness from :

Quote

$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&;".URL_USER_ID."=".$row['session_user_id'];


replace with :

Code: [Select]

$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$row['session_user_id']);


Careful when redirecting (especially under the sessions.php file). ;)

Merry Christmas.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: whos online as dropdown list
« Reply #16 on: December 25, 2005, 09:34:23 PM »
in additional a little perfomance enhansment:
instead of
Code: [Select]
preg_replace("/{user_id}/"use
Code: [Select]
str_replace("{user_id}"
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: whos online as dropdown list
« Reply #17 on: December 25, 2005, 09:52:07 PM »
Understood.

Does str_replace has a better modulation than preg_replace ? If so, in what way exacly ?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: whos online as dropdown list
« Reply #18 on: December 25, 2005, 09:56:57 PM »
Well, preg_replace is for REGEX, and it works much slower. In this case there is no REGEX used, its simply string replacement, so why would use more complex function ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: whos online as dropdown list
« Reply #19 on: December 25, 2005, 10:16:53 PM »
Ah ! now I get it. ;)

Quote

so why would use more complex function


You might want to ask Jan (for the session's core) about this and you might want to ask Nicky for the memberlist MOD about this string as well. These are the places I have discovered them.  :mrgreen:

"BUT", I'm currently fixing these issues up as we speak.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: whos online as dropdown list
« Reply #20 on: December 25, 2005, 10:40:06 PM »
Update: All Done !