Post by Qphoria » Fri Jan 14, 2011 12:34 am

qahar wrote:(i don't like the sound of vQmod Mods :laugh: )
yea if I could go back and change the name I might :)
I usually call them "vQmod scripts"

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Fri Jan 14, 2011 1:56 am

Hey Q,

I'd like to see a way to organize all the files and directories associated with VQMod. Right now there are 5 items in my root directory; vqcache, vqmod, vqmod.log, vqmod.php, vqprotect.txt. Could these be put in their own directory, perhaps in 'system', so the root directory is kept as clean as possible?

BTW, I really like the new version, especially:
- New "all" position to replace entire file
- Protected file list
- Added divider lines to logging

Thanks,
Marc

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Fri Jan 14, 2011 2:19 am

Yea i thought about having a parent "vqmod" folder and then inside that have
/mods/*.xml
/cache/
/vqmod.log
/vqmod.php

inside that, but that will of course break the current setup so I've refrained from doing so, But you are right, vqmod is starting to take over more than its share

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Fri Jan 14, 2011 2:30 am

Qphoria wrote:but that will of course break the current setup so I've refrained from doing so
You're right, but it's early enough in it's existence that, if you're going to do it, now is the time. If you wait until everyone finds out about it, Oy! :choke:

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Qphoria » Fri Jan 14, 2011 2:34 am

Actually I could move it like this:

Code: Select all

/vqmod
    /vqcache/
    /vqlog/
    /*.xml
without breaking anything.

You could even do that now.

1. EDIT: vqmod.php

2. FIND:

Code: Select all

public $logFilePath = './vqmod.log';
3. REPLACE WITH:

Code: Select all

public $logFilePath = './vqmod/vqlog/vqmod.log';
4. FIND:

Code: Select all

private $vqCacheDir = 'vqcache';
5. REPLACE WITH

Code: Select all

private $vqCacheDir = 'vqmod/vqcache';
6. FIND:

Code: Select all

public $protectedFilelist = 'vqprotect.txt';
7. REPLACE WITH:

Code: Select all

public $protectedFilelist = 'vqmod/vqprotect.txt';

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marc_cole » Fri Jan 14, 2011 2:48 am

That works. I also put vqmod.php in the vqmod folder and changed the reference in index.php to require_once('./vqmod/vqmod.php'); and also in admin/index.php to require_once('../vqmod/vqmod.php');

So now I have:

Code: Select all

/vqmod
    /vqcache/
    /vqlog/vqmod.log
    /*.xml
    /vqmod.php
    /vqprotect.txt
Much cleaner!

OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English


Active Member

Posts

Joined
Tue Dec 14, 2010 11:26 am
Location - Seattle, WA

Post by Lao » Fri Jan 14, 2011 5:42 am

I've done it too, I moved them all to a vqmod folder. One BIG question: how do you use "all" for replacing all content?

I'm using Open Cart 1.5.4.1 on http://www.importpieseauto.ro


User avatar
Lao
Active Member

Posts

Joined
Tue Nov 23, 2010 3:31 pm
Location - Craiova, Romania

Post by Qphoria » Fri Jan 14, 2011 5:46 am

Lao wrote: One BIG question: how do you use "all" for replacing all content?
:rtfm: ;)

position="all"

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Lao » Fri Jan 14, 2011 5:48 am

Don't get mad, I know about <search position="all">, but do I put all contents that needs to be changed in the file between <![CDATA[ ]]> ?

I tried it this way with no luck.

I'm using Open Cart 1.5.4.1 on http://www.importpieseauto.ro


User avatar
Lao
Active Member

Posts

Joined
Tue Nov 23, 2010 3:31 pm
Location - Craiova, Romania

Post by Xsecrets » Fri Jan 14, 2011 6:03 am

please we are already getting people trying to use it. PLEASE PLEASE PLEASE only use all as a last resort if you absolutely need to replace everything in a file. if everyone replaces the entire file everytime having more than one mod modifying the same file is going to become increasingly difficult, not to mention that if you are simply overwriting the file 10 times during load that can't be too good.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Fri Jan 14, 2011 6:06 am

Xsecrets wrote:please we are already getting people trying to use it. PLEASE PLEASE PLEASE only use all as a last resort if you absolutely need to replace everything in a file. if everyone replaces the entire file everytime having more than one mod modifying the same file is going to become increasingly difficult, not to mention that if you are simply overwriting the file 10 times during load that can't be too good.
Yea.. it was actually a request from Lao that I added it. just leave the search tags empty and set position="all"
For top, bottom, and all positions, the search data is ignored

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SapporoGuy » Fri Jan 14, 2011 6:23 am

huh?

I thought this was a write once and then use that file from cache or whatever?

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by Xsecrets » Fri Jan 14, 2011 6:35 am

SapporoGuy wrote:huh?

I thought this was a write once and then use that file from cache or whatever?
only if you turn caching on, but more than that if people just go erasing files and replacing them with whatever they feel like it then it is quite likely that any other mods will not work not to mention that if a mod that does it correctly gets applied first then someone comes along and does a replace all they will have just completely wiped out the other mod with no errors to show for it.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by SapporoGuy » Fri Jan 14, 2011 7:52 am

Thanks for the clarification.
That is awesome for modding! Now, I really am going to have to play with this!

However, I should have quoted X:
if you are simply overwriting the file 10 times during load that can't be too good.
So, I was wondering if vqm is being loaded per mod per page load ...

930sc ... because it is fun!


User avatar
Active Member

Posts

Joined
Mon Nov 01, 2010 7:29 pm

Post by Qphoria » Fri Jan 14, 2011 8:54 am

SapporoGuy wrote: So, I was wondering if vqm is being loaded per mod per page load ...
Looks like you gots some reading to do ;D

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by qahar » Fri Jan 14, 2011 4:19 pm

Xsecrets wrote:but more than that if people just go erasing files and replacing them with whatever they feel like it then it is quite likely that any other mods will not work not to mention that if a mod that does it correctly gets applied first then someone comes along and does a replace all they will have just completely wiped out the other mod with no errors to show for it.
Is there any "sort order" for vQmod file that modificating the same file ?
And I think it will better if vQmod able to duplicate the file, make a new pseudo-file, search and replace. Rather than "replace all".
Qphoria wrote:
SapporoGuy wrote: So, I was wondering if vqm is being loaded per mod per page load ...
Looks like you gots some reading to do ;D
If SapporoGuy misunderstood these, what you think the other (i.e: me :laugh: ).
You need to make Quick Explanation and put it on first post. I will add it on file collection.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by Qphoria » Fri Jan 14, 2011 9:00 pm

qahar wrote: Is there any "sort order" for vQmod file that modificating the same file ?
TODO:
============
Add sortability based on filename (or master sort control list file)
qahar wrote: And I think it will better if vQmod able to duplicate the file, make a new pseudo-file, search and replace. Rather than "replace all".
It does normally. I just added the option to replace "all" for specific moments. I don't recommend using it unless you know what you are doing. In this case, the initial request was for the footer.tpl file. While he should have just replaced or overwrote that file, he wanted to try just swapping the contents on his own personal site. But I agree, this is not something developers who are pushing these out to others should ever use.

I had the idea to add the option to support eval() from the modfile so that depending on certain conditions, the <add> code could change. But I only see that as a major security hole and a nightmare so I'm going to leave it out.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Fri Jan 14, 2011 11:39 pm

Qphoria wrote:
qahar wrote: Is there any "sort order" for vQmod file that modificating the same file ?
TODO:
============
Add sortability based on filename (or master sort control list file)
qahar wrote: And I think it will better if vQmod able to duplicate the file, make a new pseudo-file, search and replace. Rather than "replace all".
It does normally. I just added the option to replace "all" for specific moments. I don't recommend using it unless you know what you are doing. In this case, the initial request was for the footer.tpl file. While he should have just replaced or overwrote that file, he wanted to try just swapping the contents on his own personal site. But I agree, this is not something developers who are pushing these out to others should ever use.

I had the idea to add the option to support eval() from the modfile so that depending on certain conditions, the <add> code could change. But I only see that as a major security hole and a nightmare so I'm going to leave it out.
thank you for leaving out eval() that certainly would have opened up all kinds of security issues.

as for the all I still really don't like that it's in there it's like in an fps game you have three weapons available the pistol the sniper rifle and the bfg. Lots of people are going to just grab the bfg because it's easier for them and they don't have to think about aiming.

Besides you can always say in the case of the footer.tpl put <!-- at the top and --> at the bottom then add your code, which still poses the same problems as the all, but at least the developer still has to think, so I would say there is a little bit better chance they will only change what they need to.

Though that does bring up another question what happens if you do two bottom or two top additions on the same file in the same mod? Say for instance you did a bottom with "-->" then another bottom with "my crap here" would it add them both in the order that you put them in?

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Fri Jan 14, 2011 11:42 pm

Xsecrets wrote: Though that does bring up another question what happens if you do two bottom or two top additions on the same file in the same mod? Say for instance you did a bottom with "-->" then another bottom with "my crap here" would it add them both in the order that you put them in?
Yes, it does each operation individually and passes the newly changed data into the subsequent operations
so if the first bottom adds "-->" to the code, it takes that change and passes it as the new "source" for the next operation.
so then the second bottom adds "my new code" to the previous changes of the first operation

So the result will be:

Code: Select all

...........
...existing stuff...

-->
my new code

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Sat Jan 15, 2011 12:07 am

qahar wrote: If SapporoGuy misunderstood these, what you think the other (i.e: me :laugh: ).
You need to make Quick Explanation and put it on first post. I will add it on file collection.
Ok I cleaned up the first post to make it easier to understand (i hope):
http://forum.opencart.com/viewtopic.php ... 15#p120715

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 22 guests