Post by fido-x » Sat Aug 09, 2008 11:40 pm

LOL yea, but remember contribs are supposed to keep to themselves. Not start modifying every file on your disk.
Fair point, but since the config files need to be edited before uploading the site to the hosting provider, I don't see a real problem.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Sun Aug 10, 2008 12:40 am

fido-x wrote:
LOL yea, but remember contribs are supposed to keep to themselves. Not start modifying every file on your disk.
Fair point, but since the config files need to be edited before uploading the site to the hosting provider, I don't see a real problem.
Hmm... config files should never be touched after the initial install is done. EVER. No cms or cart ever would promote that, and no coder "should" do it unless there's no other way. In fact, my override design idea is trying to make it so that no contrib ever touches a core file. Sure you could add a bunch of code all over to make things easier, but that defeats the purpose of making contribs easy to use for people. In my mind, the store owner shouldn't have to make any manual edits to code.

Contribs should be designed so that monkeys can use them.

The file path in this case is easy to get anyway. Just get the mainpath like my example above, then hardcode the 'catalog/controller/' onto the end of it. The structure of OpenCart isn't going to change from store to store.. only the domain and root path.
Last edited by Qphoria on Sun Aug 10, 2008 1:12 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Luvz2drv » Sun Aug 10, 2008 1:57 am

pull the the value from the config and remove the admin part from the path before using it

:)

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by Qphoria » Sun Aug 10, 2008 2:04 am

Luvz2drv wrote: pull the the value from the config and remove the admin part from the path before using it

:)
gotta replace "admin"
with "catalog" actually. :D

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by fido-x » Sun Aug 10, 2008 10:29 am

Hmm... config files should never be touched after the initial install is done. EVER.
I agree, after the initial install is done. But what you're talking about is adding something which would need to be verified in a test environment before uploading to your client's hosting provider.

For example,

Code: Select all

define('HTTP_SERVER', 'http://localhost/');
would be changed to

Code: Select all

define('HTTP_SERVER', 'http://www.domain.com/');
Similar changes are required to almost every line of both config files before uploading. So I don't see a problem with adding one line of code to one config file which has to be edited before uploading to a live environment anyway.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Qphoria » Sun Aug 10, 2008 10:36 am

But this is a contrib. Unless they are adding it to the official cart code. So this would be added after the cart exists. But like Luv2drv said, the easiest way would be just to get the path and replace admin with catalog. There are a few diff ways, adding one extra line to the config wouldn't hurt, but its also probably not necessary for something so small.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Hedphuq » Wed Aug 13, 2008 5:59 pm

Edit: Resolved it myself, seems the permissions for the group were not set automatically so i did that myself. Works like a dream. Thanks for this!
Sorry to bother you with this as a complete OpenCart newbie but I get this
Permission Denied!
You do not have permission to access this page, please refer to your system administrator.
error when trying to generate the URL aliasses. Any idea what's going on?
Last edited by Hedphuq on Wed Aug 13, 2008 6:23 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Aug 13, 2008 5:43 pm

Post by bruce » Wed Aug 13, 2008 6:43 pm

The following post should solve that problem for good.

http://forum.opencart.com/index.php/top ... ml#msg6177

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Qphoria » Wed Aug 13, 2008 7:23 pm

It should be like any other new contrib that you need to add access to the file through UserGroup
Last edited by Qphoria on Thu Aug 14, 2008 11:49 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ried » Thu Aug 14, 2008 11:34 pm

two languages installed...

Warning: vsprintf() [function.vsprintf]: Too few arguments in /home/mcdvorg/public_html/store/library/database/database.php on line 43
Error: Query was empty
Error No: 1065

crap! how to uninstall it?
WTF? store.com/?????????.html it's on second language...
Last edited by ried on Thu Aug 14, 2008 11:58 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Feb 13, 2008 5:45 pm

Post by Qphoria » Fri Aug 15, 2008 3:32 am

Here is my finalized version of the dynamic controller generation code tho I think you are working on some language based one. This one just takes the base name of the controller file and auto creates itself dynamically based on the name, instead of using static hard code. This means it will support any new controller files added after this.
(e.g.
controller=home.php                --> home.html
controller=account_access.php --> account-access.html
controller=custom_name.php     --> custom-name.html
etc.
)

It's here if you want it :)

Remove this:

Code: Select all

        //insert static information
        $this->_insert_url_alias('controller=home', 'index.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=contact', 'contact-us.html');  //NOT YET LOCALIZED
        $this->_insert_url_alias('controller=sitemap', 'sitemap.html');  //NOT YET LOCALIZED
        $this->_insert_url_alias('controller=search', 'search.html');  //NOT YET LOCALIZED   
        
        //Accounts
        $this->_insert_url_alias('controller=account', 'my-account.html');  //NOT YET LOCALIZED  
        $this->_insert_url_alias('controller=account_login', 'login.html');  //NOT YET LOCALIZED  
        $this->_insert_url_alias('controller=account_logout', 'logout.html');  //NOT YET LOCALIZED  
        $this->_insert_url_alias('controller=account_create', 'create-account.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=account_success', 'account-created.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=account_download', 'account-downloads.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=account_edit', 'edit-account.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=account_password', 'change-password.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=account_address', 'address-book.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=account_history', 'order-history.html');  //NOT YET LOCALIZED
        
        //Checkout
        $this->_insert_url_alias('controller=cart', 'cart.html');  //NOT YET LOCALIZED
        $this->_insert_url_alias('controller=checkout_shipping', 'checkout-shipping.html');  //NOT YET LOCALIZED  
        $this->_insert_url_alias('controller=checkout_address&action=shipping', 'change-shipping-address.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=checkout_payment', 'checkout-payment.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=checkout_address&action=payment', 'change-payment-address.html');  //NOT YET LOCALIZED 
        $this->_insert_url_alias('controller=checkout_confirm', 'checkout-confirm.html');  //NOT YET LOCALIZED
        $this->_insert_url_alias('controller=checkout_success', 'checkout-success.html');  //NOT YET LOCALIZED


Replace with This:

Code: Select all

        // generate controller list
        $arrControllers = array();
        $dir_cat_cont = str_replace('admin', 'catalog', DIR_CONTROLLER);
        if ($handle = opendir($dir_cat_cont)) {
            while (false !== ($file = readdir($handle))) {
              if ($file != '.' && $file != '..' && (!is_dir($dir_cat_cont . $file)) && substr($file,1) != '.') {
                 $arrControllers[] = $file;
              }
            }
            closedir($handle);
        }

        foreach ($arrControllers as $arrController) {
            $this->_insert_url_alias('controller=' . $arrController, str_replace('_', '-', str_replace('.php', '', $arrController)) . '.html');
        }

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ried » Fri Aug 15, 2008 5:41 am

how to uninstall it? i try replace files but it still here...
manual cleaning of sql help's...

this is mod no good. no instructions for uninstall and if the store have more than one (english) lanuages you got a problems. DO NOT INSTALL.
Last edited by ried on Fri Aug 15, 2008 6:17 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Feb 13, 2008 5:45 pm

Post by david.gilbert » Fri Aug 15, 2008 9:25 am

Ried!

The script works fine.. to disable it simply go to admin in the menu, click settings and then check no to use URL Alias!

One thing you must realize is that you should always backup your data before you change your opencart code. I have spent many hours writing, compiling and testing this contribution..

As noted above, changing the use url alias setting will restore your cart.

It is also a bad idea to make comments such as
ried wrote: this is mod no good. no instructions for uninstall and if the store have more than one (english) lanuages you got a problems. DO NOT INSTALL.
they are mis-leading and derogatory to the developers of the contribution. Multi-language support is available, I have got it to a point where it creates pages for each product/category/information/controller in the NATIVE language currently being used. A few db mods are required but it works very well. If you cannot get it to work and want to have it operational on your site, why not contact one of us developers for a quote on setting it up properly?

-Dave
Last edited by david.gilbert on Fri Aug 15, 2008 9:30 am, edited 1 time in total.

Professional Website Services - http://www.davidmgilbert.com/


Active Member

Posts

Joined
Sun Jan 06, 2008 5:02 pm
Location - Mount Compass, South Australia

Post by david.gilbert » Fri Aug 15, 2008 9:35 am

Qphoria wrote: Here is my finalized version of the dynamic controller generation code tho I think you are working on some language based one. This one just takes the base name of the controller file and auto creates itself dynamically based on the name, instead of using static hard code. This means it will support any new controller files added after this.
(e.g.
controller=home.php                --> home.html
controller=account_access.php --> account-access.html
controller=custom_name.php     --> custom-name.html
etc.
)
I have with the help of Bruce got it to generate the controller pages in the selected language beyond this..

i.e ENG = contact-us.html
    GER = kontakt.html

This works for all products/cats/info and controller pages i'll get a demo up soon :)

-Dave

Professional Website Services - http://www.davidmgilbert.com/


Active Member

Posts

Joined
Sun Jan 06, 2008 5:02 pm
Location - Mount Compass, South Australia

Post by ried » Fri Aug 15, 2008 12:39 pm

david.gilbert wrote: Ried!

The script works fine.. to disable it simply go to admin in the menu, click settings and then check no to use URL Alias!

One thing you must realize is that you should always backup your data before you change your opencart code. I have spent many hours writing, compiling and testing this contribution..

As noted above, changing the use url alias setting will restore your cart.

It is also a bad idea to make comments such as
ried wrote: this is mod no good. no instructions for uninstall and if the store have more than one (english) lanuages you got a problems. DO NOT INSTALL.
they are mis-leading and derogatory to the developers of the contribution. Multi-language support is available, I have got it to a point where it creates pages for each product/category/information/controller in the NATIVE language currently being used. A few db mods are required but it works very well. If you cannot get it to work and want to have it operational on your site, why not contact one of us developers for a quote on setting it up properly?

-Dave
what is native language? i use two languages in full power, i translate items descriptions and categories at all. so i have no native language...

Newbie

Posts

Joined
Wed Feb 13, 2008 5:45 pm

Post by bruce » Fri Aug 15, 2008 12:48 pm

Hi reid,

I bet your mum would argue that you have a native language ;). Mine does.

After reading the previous posts, I understood that david really meant the "currently selected" language for the catalog.

cheers

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Qphoria » Fri Aug 15, 2008 6:28 pm

david.gilbert wrote:
Qphoria wrote: Here is my finalized version of the dynamic controller generation code tho I think you are working on some language based one. This one just takes the base name of the controller file and auto creates itself dynamically based on the name, instead of using static hard code. This means it will support any new controller files added after this.
(e.g.
controller=home.php                --> home.html
controller=account_access.php --> account-access.html
controller=custom_name.php     --> custom-name.html
etc.
)
I have with the help of Bruce got it to generate the controller pages in the selected language beyond this..

i.e ENG = contact-us.html
    GER = kontakt.html

This works for all products/cats/info and controller pages i'll get a demo up soon :)

-Dave
Ah Cool.... that does make more sense in the end result, but somehow there must be a way to make it work dynamically... Maybe I can pass the file name "account_login" to babelfish for the language and get it to return the correct translated version  ;D :o ;D :o
Last edited by Qphoria on Fri Aug 15, 2008 6:29 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mardon » Wed Aug 20, 2008 4:17 am

Hi,all
after installing this contribution after click Generate URL Alises I found this:

Permission Denied!
You do not have permission to access this page, please refer to your system administrator.

Newbie

Posts

Joined
Wed Aug 20, 2008 2:56 am

Post by Qphoria » Wed Aug 20, 2008 5:22 am

For all addons, you must goto Admin->Users->User Groups and include the new files.

I hope in future versions this is done a little more intuitively.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mardon » Wed Aug 20, 2008 5:16 pm

Yes thank you,
although now SEO URL not function ,  I give:

The requested URL /shop/about-us.html was not found on this server.

Newbie

Posts

Joined
Wed Aug 20, 2008 2:56 am
Who is online

Users browsing this forum: No registered users and 1 guest