Welcome to Yserbius.Org! Join our Ultima Online Private Server and have some old school fun.

Modification

slohand

Yserbian
Staff member
#1
I made a modification to the Forum where the Subject line is filled in when you reply to a topic to save time for the user. Please let me know if you notice any bugs in this. I would appreciate it very much. Thanks Slo
 

slohand

Yserbian
Staff member
#2
DOnt pay attention to me folks I will be hammering away around here today making some changes,, I will be implementing a level indicator system like a RPG level indicator based on posting. So it will be on and offline until i get it working right,, thanks Slohand

you can view a working idea of this at

http://yserbius.org/modules.php?name=Forums&file=profile&mode=viewprofile&u=4

I will be posting the Rules on how this determines its level when i am done.. Thanks all Slohand
 

slohand

Yserbian
Staff member
#3
Ok so you have probably noticed a new Addition to the Forum

Levels will be based on the amount of Post made by the Poster and is calculated here

if($profiledata['user_posts'] < 1)
{
$level_level = 0;
}
else
{
$level_level = floor( pow( log10( $profiledata['user_posts'] ), 3 ) ) + 1;
}

HP's

Determine Hit Points (HP)

Hp is based on user activity.
Max HP is based on the user's level, and will generally
be the same for all users of the same level.

A user's current HP is based on the user's posts per day.
A higher post per day (ppd), the more HP they will have. A
user with an average PPD (set below) will have 50% of their
max HP. As a user goes over the average PPD, they will have
more HP, but the gains will decrease as the user's PPD increases.
This makes achieving 100% hp difficult, but not impossible.

For users with under the average PPD, they will have HP equal
to 1/2 the percentage their ppd is of the average.
ie- a user with 2.5 ppd, and an average ppd of 5 will have
25% of their max HP. This is because 2.5 is 50% of 5, and 1/2
of that, is 25%.
Users who manage to post so far above the average that they have
more HP than their max will recieve a bonus to their max HP.

Note that users at level 0 will always have 0 / 0 hp.


Determine MP

MP is calculated by how long the user has been around
and how often they post.

Max MP is based on level, and increases with level
Each post a user makes costs them mp,
and a user regenerates mp proportional to how
many days they have been registered

Determine EXP percentage
Experience is determined by how far the user is away
from the next level. This is expressed as a percentage.

Note, a user of level 0 has 100% experience. Making one post
will put them at level 1. Also, a user that is shown to have 100%
experience, will go up a level on their next post

Most of you probably wont care about all this.. let me know if you have questions thanks Slo...
 

Tiger

Active Members
#5
Hey Slo... The photo album doesn't have a way to go back to yserbius.org... That an easy fix? Maybe launch it as a new window? If ya can do that, launch it into a new window, whats the code for that? Not familure enough with PHP, but I'd like to know the PHP for that, so I can do the same with a few of my menu items....
 

slohand

Yserbian
Staff member
#6
I am overhauling the Gallery soon it has given me problems so I am switching it from a ported to a stand alone once i do that i will edit the header to include a link back to here.

Now for opening in new window

surely the fastest way to redirect from a module is

<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");

OpenTable();
?>

html>
<head>
<meta http-equiv="REFRESH" content="0; URL=http://www.yoursite.com" >
</head>
</html>

<?php
CloseTable();
include("footer.php");
?>




Btw redirecting and targeting a new window is best done with javascript or html since they are client side ,,, php is serverside and it is impossible to open a window with server side functions so you have to drop out of php to do so. why would you want to redirect and target new ,, just redirect and on your new page add a link back to the site

If i need to go deeper let me know glad to help Slo
 

Tiger

Active Members
#7
Yeh, I would like one of my menu items on my site to launch a new window... Or, if it's as easy as the code above, to create the HTML content within the module itself... See the HTML isn't the problem, how PHP interacts with it is... I don't quite yet grasp how they do interact.... I thought PHP was an extended syntx... :oops:
 

slohand

Yserbian
Staff member
#8
create a directory in your modules folder and inside create a index file ,, to bring a module page to life with html just do this

<?php
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");

OpenTable();


?>
put your html here

<?php
CloseTable();
include("footer.php");
?>


then save the file as index.php and you are on your way,, if you dont want the blocks on right side to show then change $index=1; to 0 and walla it is that simple if you need to call other files in the directory let me know i will post that code also... hope this helps Slo
 

Tiger

Active Members
#9
Thanks slo! One more question..
Code:
<meta http-equiv="REFRESH" content="0; URL=http://www.tigereyegfx.net/tiger/photoalbum/">
Using the above code, how do I add
Code:
target="_blank"
? It doesn't work....?
 

slohand

Yserbian
Staff member
#10
Ok
Redirection with a new window would be a problem,, it would leave you with a redirection screen that did not know what to do and a new open screen now if your wanting to link to a gallery from a nuke screen then you will not be able to create that link from the left main menu it is defect with nuke. instead you have to create a block with a link for example

<a href="http://www.yoururl.com/yourfile.php" target="_blank">

Ok go to Block folders make a file and name it whatever.php

open it and write something like this



<?php


if (eregi("block-yourfilename.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

$content ="<a href=\"http://www.yoururl.com/yourfile.php\" target=\"_blank\">YouLINKname</a>";

?>

Explanation

<?php tells PHP what follows is to be complied and run by the php compiler


if (eregi("block-yourfilename.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
This is so folks cant access this file directly without going through your website.

$content =
This tells PHP and Nuke that what follows is to go inside the block.

"<a href=\"http://www.yoururl.com/yourfile.php\" target=\"_blank\">YouLINKname</a>"; This is the link you will have and when a user clicks it they willbe redirected to a place on a new page and your current page will stay the same.

?> Tells the server PHP functions have ended.

Note*** see how I escaped all the quote marks except the first one and last one you must escape them all in between with a \ or php will go haywire and dont forget to add the semi colon at the end of the line of code...

This is also how you do any HTML work in block with just what i told you. here you can have more than 1 $content = lines so I hope this helps a little. If you run into problems let me know the site you want to redirect to and I will write the block for you.
 
Top