-
Posts
283 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by Someone
-
Understandable regarding the time limit. Just wanted to point out. I will improve the module to also allow for [yt]videoid[/yt] BB code, That way user can also set the size he wishes for the video. And a setting for default embedded size when parsing yt links.
-
I suggest we get to set domain or ip addresses in our accounts. That will be shown as valid for.
-
I think it would be better to have the hook player_info adding data to an array or something, than echoing raw HTML. As it is now, your profile stat display is limited to be a 2 column table. http://www.nw-engine.com/wiki/index.php/Player_info.php This also reminds me of DisplayAvatar(); I changed it to take a second argument, so I can have the avatar HTML loaded before displaying. function DisplayAvatar ($user, $return = false) .... if(!$return){ echo "<img src='index.php?p=avatar&display=$uid'>"; } else { return "<img src='index.php?p=avatar&display=$uid'>";; } ....
-
Yes, there is. To define your own BB code , just mak a new module, make a file called pretty_message.php then do what you want todo with the variable $sourceText If you want to implement this in your own system, the regex used is available in the link I posted. I tried to find the hook pretty_message.php in the documentation, but it is missing in the list of hooks. http://www.nw-engine.com/wiki/index.php/Module EDIT: It has now been added at http://www.nw-engine.com/wiki/index.php/Pretty_message.php
-
Bootstrap Theme Experimentation
Someone replied to Someone's topic in Free Modules (Requests or Offers)
Your more like the grandfather I never got ;) -
1.1.2 Update *Set sizes of embedded links through the module manager. *Set max amount of embedded videos in each posting, this counts both links and [yt] tags. *Added [yt] BB code. [yt=small|medium|large]videoid[/yt] Pixel sizes for each size can be set in module manager Module available fro free here http://www.nw-engine.com/index.php?c=modules&m=120 Credit for the "all known youtube links" regex goes to ridgerunner @ http://stackoverflow.com/questions/5830387/php-regex-find-all-youtube-video-ids-in-string [ATTACH=CONFIG]842[/ATTACH]
-
Dunno know if its good enough. But will get you there, without modifying the lib/common.php As such this can be built by a module developer. Not that I am against having it in as a core module. Sooner or later I will be using multiple menus. By that time my game should be near release, and would probably just hand code in the links. They do not change that often on a live game. a module to manage this would be good for people who are not developers themselves though. You can also build a module that reads your entries in the menu.php Such as: <?php $menuEntries[] = new MenuEntry("Home", null, null, 0); $menuTopEntries[] = new MenuEntry("Admin Top Home", null, null, 0); Then in auto_post_content.php RunHook("menu.php", "menuTopEntries"); //instead of RunHook("menu.php", "menuEntries"); Not tested any of this, but after browsing the code, this should be possible
-
Request from illusions about the in game forums
Someone replied to a_bertrand's topic in New Worlds Engine
MOARE! template functions Love them -
Have a look at modules/insider_menu particularly auto_post_content.php If you made your own version where you sort/remove/add what links you want, and add the content to $content['topMenu'] instead of $content['sideMenu'], then in your template echo $content['topMenu'] where you want it.
-
That I believe this to be true. On the other hand, if a host does not allow .htaccess or mod_rewrite, there is no chance in h*** they will allow you to run a browser game on that account. Hosts such as hostgator will suspend your account even with very little activity, its even their TOS not to run browser games. You can set Apache to only use one .htaccess file that is in the root, and not look for it in all sub folders. But hard for the engine itself to account for every type of system setup. I think that in the end these matters are up to each game owner.
-
Bootstrap Theme Experimentation
Someone replied to Someone's topic in Free Modules (Requests or Offers)
Ok lib.php is the way to go. Gonna read up structuring classes, and not naming things on random such as I am doing atm. +1 for cheap templates, also belive it should be easier/cheaper to get pro designers who know the framework through sites such as oDesk and freelancer.com jQuery is already used by NWE as default, so jQuery away :) -
http://www.nw-engine.com/verify.php?l=XXXXXXXXXX&sip=::1 Replace X with the first 10 digits of your license. I too missed the part where it says that my email will be publicly available. I prob did not pay enough attention to notice it, and quite frankly I don't like it.
-
select max(id) from user_stat_types, thanks did not know that.
-
Bootstrap Theme Experimentation
Someone replied to Someone's topic in Free Modules (Requests or Offers)
hehe glad I made you lol Problem is that when I make new modules, its not very compatible. Benn thinking about it, I could simply have the standard class names in there as well. Or improve the boot class, to have setting for if it is to use the bootstrap CSS framework or not. -
Bootstrap Theme Experimentation
Someone replied to Someone's topic in Free Modules (Requests or Offers)
Boots class, placed in a pre_proccess.php file class Boot{ private $return = ''; public function CreateForm($name){ echo '<form method="post" class="form-horizontal" name="'.$name.'"><div class="control-group">'; } public function AlertBox($title, $message, $titleClass, $textClass){ return '<div class="alert alert-block '.$titleClass.'"><h4>'.$title.'</h4><p class="'.$textClass.'">'.$message.'</p></div>'; } public function EndForm(){ echo '</div></form>'; } public function Legend($legend_value){ echo '<legend>'.$legend_value.'</legend>'; } public function Input($label,$name, $value,$id,$placeholder ){ echo '<div class="control-group"><label class="control-label" for="'.$id.'">'.$label.'</label><div class="controls"><input type="text" name="'.$name.'" value="'.$value.'" id="'.$id.'" placeholder="'.$placeholder.'"></div></div>'; } public function Radio($label,$name, $value,$id,$checked = FALSE ){ if(!$checked){ $checked_html = ''; } else { $checked_html = 'checked'; } echo '<label class="radio"><input type="radio" name="'.$name.'" id="'.$id.'" value="'.$value.'" '.$checked_html.'>'.Translate($label).'</label>'; } function StartTabList(){ echo '<ul class="nav nav-tabs">'; } function EndTabList(){ echo '</ul>'; } function TabListItem($id,$label, $active = false){ if($active == false){ echo '<li><a href="#'.$id.'" data-toggle="tab">'.$label.'</a></li>'; } else { echo '<li class="active"><a href="#'.$id.'" data-toggle="tab">'.$label.'</a></li>'; } } function TabContentStart($id = 'myTabContent'){ echo '<div id="'.$id.'" class="tab-content">'; } function TabContentItemStart($id, $active = false){ if($active == false){ echo '<div class="tab-pane fade" id="'.$id.'">'; } else { echo '<div class="tab-pane fade active in" id="'.$id.'">'; } } function TabContentItemEnd(){ echo '</div>'; } function TabContentEnd(){ echo '</div>'; } public function Submit($label){ echo ' <div class="controls"><input type="submit" class="btn" value="'.$label.'"></div>'; } } Sample bank page above made with the class: $boot = new Boot(); echo TableHeader('City Bank-Your Money Is Our Buisness'); echo '<div class="label label-success pull-right">'.number_format($userStats['bank']->value).'$</div>'; $boot->CreateForm('bankDeposit'); $boot->Legend('Deposit'); if( strlen($msg) > 0 ){ echo $boot->AlertBox('Banker', $msg, 'alert-success', 'text-sucess'); } $boot->Input('Amount','deposit_amount','', 'amount','1000$ Minimum'); $boot->Submit('Make Deposit'); //SubmitButtonV2('Make Deposit Damit','bankDeposit'); $boot->EndForm(); $boot->CreateForm('bankWithdrawal'); $boot->Legend('Withdrawal'); $boot->Input('Amount','with_amount','', 'with_amount','1000$ Minimum'); $boot->Submit('Make Withdrawal','makeCrime','', 'makeCrime','Howto'); $boot->EndForm(); echo TableFooter(); echo TableHeader('Current Deposits-Send Your Money To Me'); ?> <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th style="width: 13%;"> </th> <th>Deposited</th> <th>Intrest</th> <th>Time Left</th> </tr> </thead> <tbody> <?php echo $list; ?> </tbody> </table> <?php echo TableFooter(); echo $boot->AlertBox('How Money Grows in Computers', 'After you deposit money, you will after some time get an interest back. That is if the bank you deposited in dont get robbed.', 'alert-info', 'text-info'); ?> -
This is not intended for the user who want a usable theme, its intended for experimentation use only I have been experimenting with using http://twitter.github.com/bootstrap/index.html Mainly for the CSS framework. Added to this thread are two files, a theme file [ATTACH]839[/ATTACH] unzip it and place the folder in your templates folder. And a [ATTACH]838[/ATTACH] module,this is a hack of the original inside_menu that comes with NWE. Unzip and place it in the modules folder. In order to use the bootstrap theme you need to disable inside_menu and enable inside_menu_boot in the Module Manager DO NOT ENABLE BOTH AT THE SAME TIME, if you do, disable one of them by placing a file named "module.lock" in one of the module folders. Sample content.php that uses this theme: <div> <h3>City Bank <small>Your Money Is Our Buisness</small></h3> <div class=""><div class="label label-success pull-right">5,137$</div> <form method="post" class="form-horizontal" name="bankDeposit"><div class="control-group"> <legend>Deposit</legend> <div class="control-group"><label class="control-label" for="amount">Amount</label><div class="controls"><input name="deposit_amount" value="" id="amount" placeholder="1000$ Minimum" type="text"></div></div> <div class="controls"><input class="btn" value="Make Deposit" type="submit"></div></div></form><form method="post" class="form-horizontal" name="bankWithdrawal"><div class="control-group"><legend>Withdrawal</legend><div class="control-group"><label class="control-label" for="with_amount">Amount</label><div class="controls"><input name="with_amount" value="" id="with_amount" placeholder="1000$ Minimum" type="text"></div></div> <div class="controls"><input class="btn" value="Make Withdrawal" type="submit"></div></div></form></div></div><div><h3>Current Deposits <small>Send Your Money To Me</small></h3><div class=""> <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th style="width: 13%;"> </th> <th>Deposited</th> <th>Intrest</th> <th>Time Left</th> </tr> </thead> <tbody> <tr><td><a class="btn btn-mini btn-danger" href="index.php?p=ngm_bank&cancel=3&token=8df9dbc00e6491c80658f534c698fc29">Cancel Transaction</a></td><td> 1,000</td><td>10 1%</td><td>1h 50m </td></tr> <tr><td><a class="btn btn-mini btn-danger" href="index.php?p=ngm_bank&cancel=4&token=7d440ca88d99d6a972912684f36ad089">Cancel Transaction</a></td><td> 1,500</td><td>15 1%</td><td>2h 50m </td></tr><tr><td><a class="btn btn-mini btn-danger" href="index.php?p=ngm_bank&cancel=5&token=52b3d66b4c86632ef72a0b3799397394">Cancel Transaction</a></td><td> 2,000</td><td>20 1%</td><td>2h 50m </td></tr><tr><td><a class="btn btn-mini btn-danger" href="index.php?p=ngm_bank&cancel=6&token=c92c8b4b9a2c74c5bb70d9d64256c4cd">Cancel Transaction</a></td><td> 1,000</td><td>10 1%</td><td>2h 50m </td></tr> </tbody> </table> </div></div> <div class="alert alert-block alert-info"> <h4>How Money Grows in Computers</h4> <p class="text-info">After you deposit money, you will after some time get an interest back. That is if the bank you deposited in dont get robbed.</p> </div> This results in: [ATTACH=CONFIG]840[/ATTACH] Using the default bootstrap theme inside_menu_boots.zip bootstrap.zip
-
Soo, if I am to add a userStats var with a new module, I should during module activation (enable/disable) do: SELECT id FROM `user_stat_types` ORDER BY `user_stat_types`.`id` DESC LIMIT 1 Then use that as a base, add 1 and use that for id for my user_stat_types.id column Or is there a neat way to do it through the module .sql file?
-
I am unfamiliar with mysqli, and noticed the db class had $NbRows figured that contained the number of rows. But in the later sample, I asked for a true/false. So to make it simple, best way to get number of rows returned from a database query?
-
Reason I am asking is that I often prefer to know if there is rows to show. I often tent to make scripts following this structure. /* * Manage displaying current transactions and handle payouts */ $result = $db->Execute("SELECT id, amount, bonus, rate, time FROM ngm_bank WHERE playerid = ? LIMIT 5", $userId); //var_dump($result); while(!$result->EOF) { //print_r($result->fields); $timeLeft = $result->fields[4] - time(); if($timeLeft > 0){ $left = sec2string(sec2time( $timeLeft )); $list .= '<tr><td><a class="btn btn-mini btn-danger" href="index.php?p=ngm_bank&cancel='.$result->fields[0].'">Cancel Transaction</a></td><td> '.number_format($result->fields[1]).'</td><td>'.number_format($result->fields[2]).' '.$result->fields[3].'%</td><td>'.$left.'</td></tr>'; } else { //Remove transaction and send money to bank $payout = $result->fields[2]+$result->fields[1]; $payout_total += $payout; $userStats['bank']->value += $payout; $db->Execute("DELETE FROM ngm_bank WHERE id = ? LIMIT 1", $result->fields[0]); } $result->MoveNext(); } $result->Close(); if(strlen($list) == 0){ $list = '<tr><td colspan="4">You currently do not have any money in the bank</td></tr>'; } Further down the output section <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th style="width: 13%;"> </th> <th>Deposited</th> <th>Intrest</th> <th>Time Left</th> </tr> </thead> <tbody> <?php echo $list; ?> </tbody> </table> As you see I made a tempt solution by using strlen(). That does not work to bad in this example. But would like a way to do this: $r = mysql_query("SELECT * FROM users WHERE id='something'"); if(mysql_num_rows() > 0){ // do stuff } else { // No reason todo anything }
-
A modules forum sub section could be good perhaps. Even if a module is on the market place, we would all like to discuss the module with each other and the module developer. It will make the NWE engine more visible on the forum as well.
-
Greg must be shell shocked from the security risks and the code structure of McCodes. Yeah I considered geting the secured Redux version, but when I went to the demo site, it was hacked, after logging in I was met with a message from the hackers. As statet above, you are free to distribute however you want, you do not need use the market place. Its meant to be a reassurance for buyers that it has been reviewed for security risks.
-
http://www.nw-engine.com/wiki/index.php/Main_Page Follow practices such as $result = $db->Execute("select id from bugs where filename = ?", $_GET['filename']); When querying the database. http://www.nw-engine.com/wiki/index.php/Marketplace
-
If you have some sample markup, or a link to the page, it will be easier to give advice.
-
yourgang.php does not show what is used to output content to the page, looks like the file does that ./gangs/content.php does that. When you find it, add charset to the htmlentities() htmlentities($u['username'], ENT_QUOTES, "UTF-8") If that fails, there is an interesting comment at this page http://php.net/manual/en/function.htmlentities.php its the top comment on the page So might be worth to try htmlentities($u['username']) Think this depends on the php version being used.
-
I do have some plans down the road, but for now I think I will focus on the core function of the module. Actually the version I am working on right now is customized to me in the output. But will make a more skeleton version, where only the core functionality of traveling is in place. Then we can have module(s) built around that. Layout of the tables: CREATE TABLE IF NOT EXISTS `ngm_destinations_main` ( `id` smallint(4) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(20) NOT NULL, `short` char(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; CREATE TABLE IF NOT EXISTS `ngm_destinations_sub` ( `id` smallint(4) unsigned NOT NULL AUTO_INCREMENT, `mainLocation` smallint(4) unsigned NOT NULL, `name` varchar(20) NOT NULL, `hasMainStation` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Does this city have a station like airport', `hasSubStation` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'ie has train station', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; CREATE TABLE IF NOT EXISTS `ngm_destinations_local` ( `id` smallint(4) unsigned NOT NULL AUTO_INCREMENT, `sublocation` smallint(4) unsigned NOT NULL, `name` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 CREATE TABLE IF NOT EXISTS `ngm_travel` ( `userid` int(10) unsigned NOT NULL, `toMain` smallint(5) unsigned NOT NULL, `toSub` smallint(5) unsigned NOT NULL, `toLocal` smallint(6) unsigned NOT NULL, `travelMethod` enum('hike','bus','drive','fly') COLLATE utf8_bin NOT NULL, `stepsTotal` tinyint(3) unsigned NOT NULL, `stepsCurrent` tinyint(3) unsigned NOT NULL, `currentStepTime` mediumint(8) unsigned NOT NULL, `eventid` tinyint(3) unsigned NOT NULL DEFAULT '0', `optionid` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`userid`), KEY `toMain` (`toMain`,`toSub`,`toLocal`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; And the ability to travel between them. I based this of something I made a long time ago, and I had country population in the main table, but to make it more modular I removed it, and will rather have it another table.ngm_destinations_main.short is a shortcode used for getting country flags. just getting it working atm, so (trying) not to be concerned about the look yet, but ability to have images should be there, and if none defined show a default image. The images shows time used to travel, I changed that in my current version and uses AP instead, the skeleton version should allow for setting what stat to use for traveling. Hope this is readable, in a bit of a hurry