How to I create a sef_ext.php
- Saka
- Offline
- Administrator
17 years 8 months ago #484
by Saka
Emir Sakic
www.sakic.net
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.
Note that API for 3rd party components is intended for expirienced developers, not for ordinary users.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.
- GwaiTsi
- Offline
- New Member
Less
More
- Thank you received: 0
17 years 8 months ago #485
by GwaiTsi
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.
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.
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
17 years 8 months ago #486
by Saka
Emir Sakic
www.sakic.net
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.
$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.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.
- GwaiTsi
- Offline
- New Member
Less
More
- Thank you received: 0
17 years 8 months ago #492
by GwaiTsi
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.
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.
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
17 years 7 months ago - 17 years 7 months ago #503
by Saka
Emir Sakic
www.sakic.net
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:
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:
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.
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:
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:
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.
Emir Sakic
www.sakic.net
Last Edit: 17 years 7 months ago by Saka.
Please Log in or Create an account to join the conversation.
- GwaiTsi
- Offline
- New Member
Less
More
- Thank you received: 0
17 years 7 months ago #507
by GwaiTsi
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
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
Please Log in or Create an account to join the conversation.