Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Need something cleaner..
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Jaden" data-source="post: 358198" data-attributes="member: 51705"><p>This what you looking for? </p><p></p><p>[PHP]<?php</p><p></p><p>class gWidget</p><p>{</p><p> const WIDGET_LOCATION = HABBO . "/Widgets/widget.";</p><p> const WIDGET_EXTENSION = ".txt";</p><p></p><p> public static function getWidget($Widget)</p><p> {</p><p> $Path = WIDGET_LOCATION . $Widget . WIDGET_EXTENSION;</p><p> if (!file_exists($Path)) {</p><p> echo "gCMS Templating Error ~ Could not find widget " . $Widget;</p><p> exit;</p><p> }</p><p> $Contents = file_get_contents($Path);</p><p> // Cache?</p><p> echo $Contents;</p><p> }</p><p>}[/PHP]</p></blockquote><p></p>
[QUOTE="Jaden, post: 358198, member: 51705"] This what you looking for? [PHP]<?php class gWidget { const WIDGET_LOCATION = HABBO . "/Widgets/widget."; const WIDGET_EXTENSION = ".txt"; public static function getWidget($Widget) { $Path = WIDGET_LOCATION . $Widget . WIDGET_EXTENSION; if (!file_exists($Path)) { echo "gCMS Templating Error ~ Could not find widget " . $Widget; exit; } $Contents = file_get_contents($Path); // Cache? echo $Contents; } }[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Need something cleaner..
Top