sitemap
|
contact
Home
Products
SEF Advance
AJAX Photo Album
AJAX Recommend
AJAX Scroller
AJAX Listing
Mambook
WAP Portal Server
Free Products
Support
Frequently Asked Questions
Forum
Download
Free Trial
Purchase
Services
Projects
TI-83 Graphing Calculator
Links
About
Sitemap
Affiliates
Guestbook
Contact
Sakic.Net Forum
07 January 2009, 21:12
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Introducing AJAX Scroller - Joomla News Slider Module:
http://www.sakic.net/news/introducing_ajax_scroller/
Home
Help
Search
Login
Register
Sakic.Net Forum
>
Products
>
SEF Advance
>
How to I create a sef_ext.php
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to I create a sef_ext.php (Read 7060 times)
divivo
Newbie
Posts: 1
How to I create a sef_ext.php
«
on:
17 January 2007, 15:17 »
I would like to create a sef_ext.php file for my component. Where can I find some instruction. Is it possible to have a demo version to try?
Thank you in advance
Logged
Saka
Administrator
Hero Member
Posts: 1,351
Re: How to I create a sef_ext.php
«
Reply #1 on:
17 January 2007, 15:45 »
Hello,
The
documentation
explains the basic principle of writing a SEF Advance extension. In the SEF Advance package you can find example sef_ext.php file which can be used as a template for writing your own. You can also look at the extensions for already available components like userlist, recommend or bookmarks.
There is also a nice written tutorial
here
.
The trial version of SEF Advance to test with can be downloaded here:
http://www.sakic.net/products/sef_advance/trial/
Good luck.
Logged
Emir Sakic
http://www.sakic.net
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #2 on:
30 March 2007, 10:10 »
Can you give some help to get started please.
I use the sample sef_ext.php included.
- I change the class name to joomap (for Joomla sitemap component).
All works good at this point using the sample. The SEF is the component name so the URL looks like
www.mysite.com/joomap
Now for example i want to change the SEF name, so i use
$custom_comp = array(
"joomap" => "sitemap"
);
Now the URL shows
www.mysite.com/sitemap
but the link takes me to the home page.
So, i obviously have something very basic wrong.
Logged
Saka
Administrator
Hero Member
Posts: 1,351
Re: How to I create a sef_ext.php
«
Reply #3 on:
30 March 2007, 10:21 »
Post your extension file.
Logged
Emir Sakic
http://www.sakic.net
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #4 on:
30 March 2007, 11:34 »
i figured it, thanks.....
Logged
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #5 on:
30 March 2007, 13:09 »
So i have another problem....
I am trying to make an extension for the gallery2 bridge.
The string passed to the create() only has the the component id.
i am therefore not able to process the remainder as it doesn't exist.
The component is successfully being proceed as "photos" from the URL
http://www.canza.cz/option,com_gallery2/Itemid,55/
Mouse over the photo produces the following URL
http://www.canza.cz/photos/?g2_itemId=17/
but it is not passed as the string when the mouse is clicked.
only the component part, thus making it impossible to fully process.
defined( '_VALID_MOS' ) or die( 'Restricted access' );
$custom_comp = array(
"gallery2" => "photos"
);
class sef_gallery2 {
function create ($string) {
return $sefstring;
}
function revert ($url_array, $pos) {
$QUERY_STRING = '';
return $QUERY_STRING;
}
}
Logged
Saka
Administrator
Hero Member
Posts: 1,351
Re: How to I create a sef_ext.php
«
Reply #6 on:
30 March 2007, 20:40 »
I can't say anything without looking at the actual component. And that fall under custom programming.
Note that API for 3rd party components is intended for expirienced developers, not for ordinary users.
Logged
Emir Sakic
http://www.sakic.net
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #7 on:
01 April 2007, 11:19 »
Amir
I am not asking you to write the component, i simply want enough information to be able to work it out myself.
You provide an API but don't provide any documentation and as i can't see your code, i can't reverse engineer.
i.e. a basic description of the two functions and in particular the relevance of var1 and var2 (does it have to be called that).
what is the relation to the $_REQUEST, $_GET, $_POST.
You could provide some basic functional documentation for the create() and revert functions. I don't think that is unreasonable when we buy the product.
Logged
Saka
Administrator
Hero Member
Posts: 1,351
Re: How to I create a sef_ext.php
«
Reply #8 on:
01 April 2007, 13:12 »
I don't understand anything of that you are asking.
$var1 and $var2 are just example variables, you change them to your own parameters. $_REQUEST, $_GET, $_POST are environment variables.
Example file itself with its comments and extensions for already available components are documentation enough for expirienced developers to create extensions for their components. Many developers were able to figure it out without asking anything, it is so simple.
Again API is not intended for ordinary users, it is for component authors only. If you want me to explain basic programming and specific things in relation to particular component then it falls under custom programming.
Logged
Emir Sakic
http://www.sakic.net
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #9 on:
03 April 2007, 15:36 »
Hi Emir
What i am asking is quite simple.
I have created a sef_ext.php for gallery2 bridge.
The revert() works fine when entering an SEF url in the address bar.
The create() produces the $sefstring correctly when clicking on an item.
However, the SEF Url is not generated for the album items when the mouse passes over.
As i don't have access to your code, i would like to know when and how the create() is called so i can try to understand how the urls are created for items on the page.
thank you.
Logged
Saka
Administrator
Hero Member
Posts: 1,351
Re: How to I create a sef_ext.php
«
Reply #10 on:
05 April 2007, 12:04 »
create() is called when SEF URL is created, meaning it has the task of converting non-sef URL to SEF Advance URL.
Let's say we have a string:
'index.php?option=com_example&Itemid=1&var1=foo&var2=bar'
which is supplied as argument to sefRelToAbs() function.
SEF Advance itself converts the first part of the string to:
http://www.domain.com/example/
Now your function create() is called to examine rest of the string and build the rest of the SEF URL. It should pick up all the parameters from the string and build the SEF string which should be returned (e.g 'foo/bar/'). The example sef_ext.php file included in SEF Advance package will give you a clue how to do this.
Now SEF Advance appends this returned string to the one that's already built and you end up with:
http://www.domain.com/example/foo/bar/
That's all you really need to know, I can't explain it better than that. And you most certainly don't need access to SEF Advance's source code to know how to write the extension. What you need to have though is certain programming knowledge and experience.
«
Last Edit: 05 April 2007, 12:09 by Saka
»
Logged
Emir Sakic
http://www.sakic.net
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #11 on:
06 April 2007, 07:50 »
Hi Saka
I created a working ext for g2bridge that can be downloaded from sjr.greatsouthernwines.com
It works whether gallery2 rewrite module is installed or not with the following points: -
G2 Rewrite Installed
- the g2 module appends .html to the end of the image file.
- i remove this internally but i can't figure out if it is possible to display the modified link status bar of the browser.
- sef works the same as g2 is configured and is setup from g2 save from the component name.
ToDo: clean url to remove .html from displaying in broswer status bar.
G2 Rewrite Not Installed
- the module works with the url, same as if rewrite was installed. url can be entered directly in address line.
- status bar however only shows non-sef address
- image mouseover only displays non-sef address
Most noticable issue with all of this is;
- the revert() doesn't work by just returning the non-sef url.
- i needed to hard code the $_GET variable to make it work.
Also, my observations from this and what i was trying to ask orginally; -
1) component name derived from customc=>cc without calling create()
(if changing the component name in this function() per the docs,
it is not displayed on the first access)
2) revert() is the first function called from the first click after entering the component page.
(return value - directly effects $string passed to create() - therefore, revert() needs to work correctly before create())
3) sef url returned from create() passed to revert().
In summary, the dummies guide to creating an sef_ext is: -
1) decide on the sef format for the component
2) create the revert() by using address bar entered urls for testing
3) create the create() for full working extension.
It is not rocket science, just helps to have a basic understanding of the flow.
The CB extension currently breaks groupjive, rather than trying to create a CB extension from scratch, it would be helpful if we had access to the source, as the current one is encrypted.
Is there any reason you don't want to make this source available? especially considering you state it is not supported.
thanks
Logged
Saka
Administrator
Hero Member
Posts: 1,351
Re: How to I create a sef_ext.php
«
Reply #12 on:
06 April 2007, 21:26 »
I don't know what is groupjive, but yes, there is a reason why CB extension is encoded and sorry, it's not possible for me to release it unencoded.
It is not supported but, as I said before, if there are problems with it post on the CB extension thread and I will have a look when I have time.
Logged
Emir Sakic
http://www.sakic.net
GwaiTsi
Newbie
Posts: 12
Re: How to I create a sef_ext.php
«
Reply #13 on:
07 April 2007, 08:04 »
groupjive.org is a cool component for joomla that integrates with CB.
It allows the creation of community groups for use in things like clubs, etc.
If you access the component through the page below
http://www.canza.cz/groupjive/
you can see the are no groups, which is not true.
There is actually a sports group.
If i remove the sef_ext from community builder, you can then see the groups.
I am happy to have a go at creating an sef_ext for groupjive, but i need to fix the issue with community builder first so it doesn't interfere with groupjive.
Thus, there are only three possibilities, you fix sef_ext, i fix it, or i have to create from scratch....not good....
Grateful, if you can have a look at the extension as i believe groupjive will become a popular component.
cheers
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Products
-----------------------------
=> SEF Advance
=> Mambook
=> AJAX series
=> WAP Portal Server
=> Vodes
=> Other products
-----------------------------
General
-----------------------------
=> Services
=> General Discussion
Loading...
W3C XHTML 1.0
W3C CSS
Copyright © Sakic.Net, 2001-2009.