Tutorial: Create a new page in Arfooo Directory

Propose here your templates, your plugins or ask one.
All tutorials available for Arfooo Directory are available in this category.

Moderator: effi

Tutorial: Create a new page in Arfooo Directory

Postby Arf » Sat Aug 09, 2008 11:53 am

This tutorial will allow you to create a functional new page in your directory.
The URL of this page will even be rewritten ;)

We will create a page that will be called: partners.html.
This is of course just one example and you can give it any name you want to slightly amend a few steps.
In short, after blabla, things turn serious :D

Step 1 :
Create the following file and give this name : "InfoController.php" :

Code: Select all
<?php
//////////////////////////////////////////////////////////////////////////////////
//                copyright (c) Arfooo Annuaire                                               //
//                   by Hocine Guillaume (c) 2007 - 2008                                            //
//                   http://www.arfooo.com/                                                    //
//    Licence Creative Commons http://creativecommons.org/licenses/by/2.0/fr/                 //
//////////////////////////////////////////////////////////////////////////////////

class InfoController extends Controller
{
    function partnersAction()
    {
   
    }
   
}
?>



To create another page you can simply add a new function like that by example:

Code: Select all
class InfoController extends Controller
{
    function partnersAction()
    {
   
    }

    function otherpageAction()
    {
   
    }
   
}
?>


Step 2 :
Place this file in the folder: "controllers"

Step 3 :
We must now create a folder called "info" in the folder : templates/arfooo/
You will have this: : templates/arfooo/info

Step 4 :
Create file ".tpl" who bear the same name as the prefix function created in step 1.
We must therefore create the file "partners.tpl"
This will therefore : templates/arfooo/info/partners.tpl

Step 5 :
We must fill out the file "partners.tpl" with the following code :
I will then explain how to give a title to your new page, how to rewrite the url... :

Code: Select all
{capture assign="headData"}
<script type="text/javascript" src="{'/javascript/config'|url}"></script>
<script type="text/javascript" src="{'/javascript/core/ajax.js'|resurl}"></script>
<script type="text/javascript" src="{'/javascript/site/VisitSite.js'|resurl}"></script>
{/capture}
   
{include file="includes/header.tpl" title="{'Title page partners'|lang}"}

<div class="show_arbo">
<a href="{$setting.siteRootUrl}" class="link_showarbo">{'Directory'|lang}</a> &gt;
<a href="{'/info/partners'|url}" class="link_showarbo">{'Title page partners'|lang}</a>
</div>

<div class="title_h_1">
<h1>{'Title page partners'|lang}</h1>
</div>

<div class="column_in">
The content of your page
</div>

{include file="includes/footer.tpl"}


Step 6 :
You'll find that this code in the page :
Code: Select all
{'Title page partners'|lang}


You can then modify the code as you want, add a code of the same type, it is sufficient just to change:
Code: Select all
Title page partners


Simply then modify the code by a sentence of your choice, a word...

Step 7 :
We must therefore open the file "languages/en.php" and add the following phrase this :

Code: Select all
//new pages
$language['Title page partners'] = '';



Step 8 :
It will rewrite the url in order to access the page a nice way.
We will have access by this url : -www.yourdomain.com/directory/partners.html
The great manner :D
We must therefore open the file "config/rewrite.php"

Search this code :
Code: Select all
// SEARCH
'#^/search-p([0-9]+).html$#' => '/site/search/\1',


and after add :
Code: Select all
// PARTNERS
'#^/partners.html$#' => '/info/partners',


Search this code :
Code: Select all
'#^/webmaster/submitWebsite$#' => '/webmaster-submit-website.html',


and after add :
Code: Select all
'#^/info/partners$#' => '/partners.html',


Your page work now you can try to go on :
-www.yourdomain.com/directory/partners.html

Step 9 :
We must now create a link in the menu on the left or right so your visitors can access this page.

It will create this link in the right menu, we must open the file templates/arfooo/menu/menuright/menuright.tpl

Search this code :
Code: Select all
<div class="menuright">
<ul>
<li class="header">{'Contact'|lang}</li>
<li class="last"><a href="{'/contact'|url}" title="{'Contact form'|lang}">{'Contact form'|lang}</a></li>
</ul>
</div>


and after this code add:
Code: Select all
<div class="menuright">
<ul>
<li class="header">{'Title page partners'|lang}"}</li>
<li class="last"><a href="{'/info/partners'|url}" title="{'Title page partners'|lang}"}">{'Title page partners'|lang}"}</a></li>
</ul>
</div>


The tutorial is now finished, creating good :D
Arf
Site Admin
 
Posts: 212
Joined: Fri Mar 14, 2008 6:51 pm

Re: Tutorial: Create a new page in Arfooo Directory

Postby bighippo » Fri Feb 27, 2009 9:27 am

this didnt work on me? :(
is there any other tutorial like this? thanks a lot :D
bighippo
 
Posts: 1
Joined: Wed Feb 18, 2009 4:42 am

Re: Tutorial: Create a new page in Arfooo Directory

Postby saidbakr » Sun Apr 26, 2009 1:01 pm

I think that Arfooo is very powerful and completely Object Oriented driven application. However, It should has some kind of documentation for its API that allows developer's community to share in effective way to improve and in-rich Arfooo with features and customization.

For example, I want to create a new object that have method able to display all search tag clouds and then creating new page that will host this object. I don't know where to start and how.

Another notice: The forum seems to be frozen, i.e. there is no sufficient amount of posts and even posts has no replies. This situation do not reflects the great value of Arfooo.

About this, I suggest to add some wiki to manage this documentation.
Best Regards,
Said Bakr
Azzazi Anesthesia Web Directory, just another customized Arfooo directory.
دليل معمل الحياة
saidbakr
 
Posts: 66
Joined: Wed Jul 23, 2008 9:09 pm
Location: Egypt

Re: Tutorial: Create a new page in Arfooo Directory

Postby chadon » Mon Apr 27, 2009 12:23 pm

I think your idea about a Wiki would be great and I contacted Arf about it and he said he will start a documentation in French when the 2.0.0 version of Arfooo will be ready and the English version should be available soon after that.
chadon
 
Posts: 59
Joined: Mon Jan 19, 2009 10:29 pm
Location: NB Canada

Re: Tutorial: Create a new page in Arfooo Directory

Postby saidbakr » Tue Apr 28, 2009 8:37 am

Well, this is a great news. :)
Best Regards,
Said Bakr
Azzazi Anesthesia Web Directory, just another customized Arfooo directory.
دليل معمل الحياة
saidbakr
 
Posts: 66
Joined: Wed Jul 23, 2008 9:09 pm
Location: Egypt

Re: Tutorial: Create a new page in Arfooo Directory

Postby saidbakr » Sat Jun 20, 2009 5:59 pm

I just applied this tutorial and it is a real fun. It works properly. However, I would like to see another part for this tutorial about adding dynamic text to the page.

What I mean that is found in the administration area -> Settings -> Text. I'd like to know how to make another entry added to , Directory Description, Terms of Use and E-mails. I would like to have partners to add its text dynamically like description.
*****************
After one hour from posting this reply, I have abled to add Partners as custom text in the administration area, modifying the database to handle directoryPartners field in the customText table and every thing is working fine on the back-end.

However, In InfoController I could not able to set template variable that should be served in partners.tpl:
Code: Select all
function partnersAction()
    {
        $this->set("dirtxt", "hgh jgyh");
    }

and then in partners.tpl
Code: Select all
{$dirtxt}


I receive an error about :
Code: Select all
(8) Undefined index: dirtxt   class.template.php(764) : eval()'d code   line 29     21-6-09   2:03

The situiation seems as InfoController does not loaded, because I tried to write wrong syntex but there is no any errors related to it and just I receive the described error above.
I need to solve this problem, Please Help.

*******************
Finally and after a long night, In the morning I solved this problem, Really, I don't know how, but I think it was some letters wrong or the order in the rewrite.php. However, I submited a new tutorial to work in conjugation with this tutorial. The tuorial named Create a new custom text
Best Regards,
Said Bakr
Azzazi Anesthesia Web Directory, just another customized Arfooo directory.
دليل معمل الحياة
saidbakr
 
Posts: 66
Joined: Wed Jul 23, 2008 9:09 pm
Location: Egypt

Re: Tutorial: Create a new page in Arfooo Directory

Postby seopositive » Sat Jul 04, 2009 8:00 am

hi

i checked this it really works for me.
seopositive
 
Posts: 5
Joined: Mon Jun 29, 2009 7:36 am

Re: Tutorial: Create a new page in Arfooo Directory

Postby JereManU » Sun Mar 07, 2010 6:04 pm

Uff, not so easy, but works. Thanks a lot for this tutorial! :D
JereManU
 
Posts: 7
Joined: Sun Mar 07, 2010 5:53 pm

Re: Tutorial: Create a new page in Arfooo Directory

Postby steven444 » Fri May 21, 2010 8:06 am

thanks for the informative post
steven444
 
Posts: 1
Joined: Fri May 21, 2010 7:40 am

Re: Tutorial: Create a new page in Arfooo Directory

Postby martinglover » Thu May 27, 2010 11:41 am

In the part that says:

<div class="menuright">
<ul>
<li class="header">{'Title page partners'|lang}"}</li>
<li class="last"><a href="{'/info/partners'|url}" title="{'Title page partners'|lang}"}">{'Title page partners'|lang}"}</a></li>
</ul>
</div>


It appears you have an extra
}"


in a couple of places.

In the code which is appearing in the title and link name. Make sure you remove it from the two places wrapped in the code. The correct layout should read:

<div class="menuright">
<ul>
<li class="header">{'Title page partners'|lang}</li>
<li class="last"><a href="{'/info/partners'|url}" title="{'Title page partners'|lang}">{'Title page partners'|lang}</a></li>
</ul>
</div>
Arfooo Web Hosting from £1.49 - http://www.andthenhost.com

Free UK Home Computer Help Forum - http://www.home-computer-help.co.uk
martinglover
 
Posts: 20
Joined: Wed May 19, 2010 8:41 am

Re: Tutorial: Create a new page in Arfooo Directory

Postby fysaldds » Mon Jun 07, 2010 3:37 pm

Arfooo Directory is an open source software combining all the features desired by webmasters.
Actual, easily administrable rallying simplicity and ease of use through the MVC architecture.

Arfooo Directory is developed with the latest technologies: PHP 5 (object-oriented programming), JavaScript and Ajax.

Arfooo Directory is compatible PHP 5, MySQL 4.1 + and uses UTF-8.
Your new directory is valid XHTML 1.0 Strict or transitionnal according to the needs and CSS 2.0
fysaldds
 
Posts: 1
Joined: Mon Jun 07, 2010 6:52 am

Re: Tutorial: Create a new page in Arfooo Directory

Postby disolmodo78 » Mon Nov 29, 2010 6:07 pm

However, there must be some form of documentation for its API, which allows the developer community to share in an efficient manner and to improve Arfooo rich in features and customization.
disolmodo78
 
Posts: 9
Joined: Mon Nov 29, 2010 6:05 pm

Re: Tutorial: Create a new page in Arfooo Directory

Postby Corrinla » Thu Dec 23, 2010 4:48 am

This is of course just one example and you can give it any name you want to slightly amend a few steps.
Corrinla
 
Posts: 9
Joined: Tue Dec 07, 2010 10:03 pm

Re: Tutorial: Create a new page in Arfooo Directory

Postby brazil » Mon Jan 10, 2011 9:02 am

I think it would be cool as a new feature we can create new pages automatically. Used the method mentioned here in the tutorial and it worked.
brazil
 
Posts: 1
Joined: Mon Jan 10, 2011 8:52 am

Re: Tutorial: Create a new page in Arfooo Directory

Postby steveb123 » Mon Jun 06, 2011 4:00 am

Thanks for sharing instruction and for sharing code. I have no more idea about arfooo directory, i am new and this is very useful data for me.
_______________________
Used cars for sale
steveb123
 
Posts: 3
Joined: Mon Jun 06, 2011 3:50 am

Next

Return to Templates, plugins and tutorials

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

 
Copyright © arfooo.net  2007 - 2010  -  All rights reserved.
Arfooo website group: petites annonces gratuites   voyance en direct - tirage tarot   Consultant en référencement
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | phpBB SEO