Hey, hi!
May someone please guide me how to make a custom location of a page that I have in a custom subdirectory?
I tried this way, but it says I'm on Forum Index (and I'm not)
example:
site.com/forum/custom_directory/index.php
(10-23-2008 05:02 AM)EviLito Wrote: [ -> ]Hey, hi!
May someone please guide me how to make a custom location of a page that I have in a custom subdirectory?
I tried this way, but it says I'm on Forum Index (and I'm not)
example:
site.com/forum/custom_directory/index.php
Are you exactly in "site.com/forum/custom_directory/index.php"?
With ".php" in your browser's address? or in "site.com/forum/custom_directory/"?
Your location should contain '.php'
Can you give the url, and upload or copy your edited file?
Sure, thanks for replying.
"site.com/forum/custom_directory/index.php" means my custom page. The forum original index page is in "site.com/forum/index.php" but it seems like the WOL functions doesn't detect directories? In the "switch-case" code they only select the file name, and my file name is also "index.php" (it's in another directory tough) and it appears in the Who's Online list: "Viewing board index" (or something like that)
The WOL functions shouldn't detect directories.
Why not giving it other name?
you can still redirect that 'index.php' to the new one if you want
(10-28-2008 11:59 AM)dvb Wrote: [ -> ]Why not giving it other name?
Well, I wanted to have a gallery image section, and it's really hard and ugly setting in the forum root directory. It should have its own directory: Example: myforum.com/gallery so in that address yo go to index.php by default, and shows the gallery.
Anyway, I guess I should rename it but I won't have a nice address anymore

(Ej: myforum.com/gallery/images.php)
Thanks for your replies.
This is very useful. Thanks for a great tutorial

I've just viewed this thread
How do I hide a group from "who's online"?, so I'm giving the answer here to help all the others.
First of all we have to know in which pages MyBB generate a viewable list of users (except plugins), a quick search of '
while($user = $db->fetch_array($query))' will give a quick result (I've omitted the unimportant results):
MYBB_ROOT/
forumdisplay.php
Line 214 listing the users that browsing the same forum
MYBB_ROOT/
inc/functions_calendar.php
Line 523 listing the users that have a birthday today or in a calendar day
MYBB_ROOT/
index.php
Line 69 listing usernams of all online users
MYBB_ROOT/
memberlist.php
Line 215 members list...
MYBB_ROOT/
online.php
Line 166 the who's online list
MYBB_ROOT/
portal.php
Line 256 generally, like index.php
To control which user groups are shown just add in the top of the mentioned loop ('
while($user = $db->fetch_array($query))') of any of the pages above, a code like the following examples, that will check the user's usergroup and according to the condition skip the user:
For example, in 'online.php' we have this code:
PHP Code:
while($user = $db->fetch_array($query))
{
$plugins->run_hooks("online_user");
we can change it to this:
PHP Code:
while($user = $db->fetch_array($query))
{
//If the user is an administrator, don't tell the users what he's doing
if ($user['usergroup']==4) continue;
$plugins->run_hooks("online_user");
Of course if you'll make this, users still can see what an administrator is doing in the administrator's profile page
Another example, in 'memberlist.php' we have this code:
PHP Code:
while($user = $db->fetch_array($query))
{
$plugins->run_hooks("memberlist_user");
we can change it to this:
PHP Code:
while($user = $db->fetch_array($query))
{
//If the user is banned or awating activation, don't display him
if (in_array($user['usergroup'],array(5,7))) continue;
$plugins->run_hooks("memberlist_user");
Both of the examples above can be made in a plugin in the proper hook.
In this thread -
http://community.mybboard.net/thread-44052.html
you can see a nice & simple solution for the following problem:
(01-24-2009 09:35 PM)Sephiroth Wrote: [ -> ]A while back I posted a question regarding online list integration, for a custom-coded section of the website.
However, I have another question. I plan on changing the structure of this site, to MyBB's index page is /forums/index.php and the new homepage is simply /index.php
... Is there a way to differentiate the two different index.php scripts in online.php so I could have it as "Viewing Site Homepage" instead of "Viewing Forum Index"?
And the solution
(01-28-2009 12:23 PM)flash.tato Wrote: [ -> ]Did you study at least the function expecially the $location param.
PHP Code:
if($location == "index.php")
$user_activity['activity'] = "home";
else // ($location == "/forums/index.php")
$user_activity['activity'] = "index";
Then edit accordingly
PHP Code:
function build_friendly_wol_location($user_activity)
I should note that in case this doesn't working, try something like "/forums/index.php?"
In my localhost I've installed mybb in the subfolder 'mybb' and for the location 'http://127.0.0.1/mybb/online.php' the $location param' is '/mybb/online.php?'
(02-01-2009 04:05 PM)dvb Wrote: [ -> ]In this thread - http://community.mybboard.net/thread-44052.html
you can see a nice & simple solution for the following problem:
(01-24-2009 09:35 PM)Sephiroth Wrote: [ -> ]A while back I posted a question regarding online list integration, for a custom-coded section of the website.
However, I have another question. I plan on changing the structure of this site, to MyBB's index page is /forums/index.php and the new homepage is simply /index.php
... Is there a way to differentiate the two different index.php scripts in online.php so I could have it as "Viewing Site Homepage" instead of "Viewing Forum Index"?
And the solution
(01-28-2009 12:23 PM)flash.tato Wrote: [ -> ]Did you study at least the function expecially the $location param.
PHP Code:
if($location == "index.php")
$user_activity['activity'] = "home";
else // ($location == "/forums/index.php")
$user_activity['activity'] = "index";
Then edit accordingly
PHP Code:
function build_friendly_wol_location($user_activity)
I should note that in case this doesn't working, try something like "/forums/index.php?"
In my localhost I've installed mybb in the subfolder 'mybb' and for the location 'http://127.0.0.1/mybb/online.php' the $location param' is '/mybb/online.php?'
Well my solution is pretty raw i've to say.
Because it doesn't check proper URL (that code with index.php?id=ok will fail because it isn't handled properly) but hey it was meant as proof of concept.
And good work for a guide also if i highly suggest users to learn PHP or better programming

this was very usefull to me, thanks
dvb 