Jump to content

Search the Community

Showing results for tags 'hello world'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Help Support
    • Announcement And Help
    • Funday Chatroom
  • Poetry
    • Shair-o-Shaa'eri
    • Famous Poet
  • Islam - اسلام
    • QURAN O TARJUMA قرآن و ترجمہ
    • AHADEES MUBARIK آحدیث مبارک
    • Ramazan ul Mubarik - رمضان المبارک
    • Deen O Duniya - دین و دنیا
  • Other Forums
    • Quizzes
    • Chitchat and Greetings
    • Urdu Adab
    • Entertainment
    • Common Rooms
  • Science, Arts & Culture
    • Education, Science & Technology
  • IPS Community Suite
    • IPS Community Suite 4.1
    • IPS Download
    • IPS Community Help/Support And Tutorials

Blogs

There are no results to display.

There are no results to display.

Categories

  • IPS Community Suite 4.3
    • Applications 4.3
    • Plugins 4.3
    • Themes 4.3
    • Language Packs 4.3
    • IPS Extras 4.3
  • IPS Community Suite 4
    • Applications
    • Plugins
    • Themes
    • Language Packs
    • IPS Extras
  • Books
    • Urdu Novels
    • Islamic
    • General Books
  • XenForo
    • Add-ons
    • Styles
    • Language Packs
    • Miscellaneous XML Files
  • Web Scripts
  • PC Softwares

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook ID


FB Page/Group URL


Bigo Live


Website URL


Instagram


Skype


Interests


Location


ZODIAC

Found 1 result

  1. Hello dear users, not everyone know exactly how to create even a basic application in IPS 4x because of fact, that there is no HOW TO on Developers page yet. Most of 3x Developers have checked every each of Dev docs to create their own apps, i miss this "START HERE:" tutorial too so i'm about to tell all of You how to create Hello World app, i will be explaining every each of steps so there is no "why this isn't working? what i'm doing wrong?" but let me inform you that i am NOT a pro coder and I can explain some things wrong but i try my best. So, let's begin.. STEP 1: Enabling Developer mode I'm recommending creating own apps on forums located on localhost because of fact that the Developer Mode can mess up with your community if you do something wrong. You can download actual Developer Tools here, after downloading the files, upload them to your parent folder of your hosting (in most cases public_html). After you've uploaded files to your www hosting, create an constants.php file and put this code inside: <?php define( 'IN_DEV', TRUE ); to enable Dev Mode. More informations here: STEP 2: Creating an Application trough your Admin CP After completing first step, you'll need to go to your ACP and create application in ACP → System → Applications using the "+ Create new" button located on top right side of page. Now you can input an Application Name, Application Directory(which is required), Author Name, Author website, Update Check URL and set the Protected status. Let's input something like this for an Hello World app: After inputting some strings, let's go ahead and create app by clicking Save button. Now if you look inside applications folder on your www you'll see that folder (in my case)helloworld have been created. Application Directory is actually an app key too so, remember it. STEP 3: Developer Center Each of app has it's own Developer Center located in ACP → System → Applications → Your Application → Dropdown menu → Developer Center Inside the Developer Center is everything you need to build your own application, to set up your extensions, app settings, databases, ACP Tabs etc. There is also an /dev/ folder located in your app folder, there you can put an custom language strings for app(/dev/lang.php dev docs), custom templates (/dev/html/front/modulekey/filename.phtml step 3 of complete example of a plugin), custom css(/dev/css/), custom email templates(/dev/email), custom js scripts(/dev/js/) and many more.. STEP 4: Creating modules and controllers There are two types of modules, there are admin modules which are modules showed in ACP and there are front modules which are showed on public side of forums. Because of that is just an Hello World app example, i will be showing you only front modules, so let's begin.. Like you can see on app page (yourdomain.com/index.php?app=helloworld), there is showing an error on the font side It's because there is no front module and it can be easily fixed by creating an front module(which is logical), let's create one by clicking "+ Add Module" in Developer Center (STEP 3). There are only two inputs(forms), Module Key and again Protected, so let's set this like that: After putting some strings in inputs, click Save to create an module. Error isn't showing no more, but, there is no content either, there is just 2S100/1 error saying that requested page does not exist, that's because there is no controller created for this module, so let's create one by pressing + button on helloworld module. After doing that, you will see an window where you can put a filename (this is where you will be putting controller code) Let's just call it helloworld and Save it, after doing so you'll need to set it as default controller for this module so when you visit your app on front side, there will be showing default page(default controller for default module) After doing so, if you visit your app page, there will be showing an already build-in blank template Like you can se, there is already pre-configured an language string module__helloworld_helloworld which is an module_modulename_controllername, this can be configured in /dev/ folder(mentioned in step three), so you need to go to your FTP and go to www/applications/helloworld/dev/ and open up lang.php file, there is already something inside and it's language string for app name. <?php $lang = array( '__app_helloworld' => "Hello World" ); All you need to do is add another language string and call it "module__helloworld_helloworld" it will should be like that: <?php $lang = array( '__app_helloworld' => "Hello World", 'module__helloworld_helloworld' => "Hello World" ); save the file and re-upload it to the /dev/ folder, after doing so, refresh page and the title will be already there! but still, there is nothing inside and there is no page title. So, now we will be creating an "Hello world!" inside this page and we will add "Hello World" as page title. Open up your controller file located in yourdomain.com/applications/helloworld/modules/front/modulekey/controller.php there is already something inside it, it's automatically generated by Community Suite <?php namespace IPS\helloworld\modules\front\helloworld; /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } /** * helloworld */ class _helloworld extends \IPS\Dispatcher\Controller { /** * Execute * * @return void */ public function execute() { parent::execute(); } /** * ... * * @return void */ protected function manage() { // This is the default method if no 'do' parameter is specified } // Create new methods with the same name as the 'do' parameter which should execute it } More information about namespaces and classes can be found here all you need to do is add to function execute() before parent::execute() this code: \IPS\Output::i()->title = "Hello World"; \IPS\Output::i()->output = "Hello World!"; and it will be showing this: but let's put this inside an template, for this, we will be needing an file inside /dev/html/ folder. But not exactly inside /dev/html/ folder, you'll need to create folders for front/admin module, modulekey. So it will be looking like that: /dev/html/front/helloworld/, now you need to create an .phtml file for template. Let's create one and put this inside: <ips:template parameters="" /> <center><b>Hello World!</b></center> now save it and upload to yourapp/dev/html/front/helloworld/ and name it helloworld.phtml. Now all you need to do is change a source a little bit, so instead of this code: \IPS\Output::i()->title = "Hello World"; \IPS\Output::i()->output = "Hello World!"; You will have this code: \IPS\Output::i()->title = "Hello World"; $tmp = \IPS\Theme::i()->getTemplate( 'modulename', 'appkey(Directory Name)', 'front' )->filename(parameters); \IPS\Output::i()->output = $tmp; after saving it you'll see this: Great News! You have just created an basic Hello World app with custom language strings and custom templates! Great work! Cheers.
×