Is there a way to add code to either the beginning and/or the end of a file without having to do a search?
Something like:
Code: Select all
<search position="start">
Code: Select all
<search position="end">
Thanks,
Marc
Code: Select all
<search position="start">
Code: Select all
<search position="end">
OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
VirtualQMod is not an "OpenCart" tool. It was designed to work with ANY platform. Therefore there is no interface, at least not opencart admin-based. I could add a simple upload interface to the script itself that loads when you call it directly, but really mods are just a single .xml file now. There are no zip files to bother with. No folder structures or permissions. Just drop in the .xml file to apply the mod, and remove the .xml file to remove the mod. True plug-n-play with no dependencies. The concept can even be ported with platforms in other programming languages outside of php.Xsecrets wrote:looks like this is really starting to shape up. If it works well (which it appears to be) it would be very nice to get an admin gui and standardized zip/tgz format so that users could simply browse for the one file they downloaded and install from the admin.
Hmmm, does it read faster or something?- Updated Readme to be more robust
930sc ... because it is fun!
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Yes, readmes are fun when you read them! You can have unlimited files modding the same file, assuming all mods affect a different part of the file, they will all apply to that file. Meaning that if i have, lets say, 5 mods... all of them affect the product page.SapporoGuy wrote: Now, does this do mod on mod on a mod?
What I mean is it aware enough to know that you have several mods going at the same time?
I suppose a generic VirtualQMod upload module could be created. One with a basic upload field and perhaps a link to download from a master serverI also would like to see a simple interface to use via the admin.
With the ability to download via other site (ie, a forum or where ever the mods reside).
No.Does this store the mods in the db?
yes you are right I can make an admin module for uploading files into the \vqmod\ folder. I'll do thatXsecrets wrote:I get that it is not going to be opencart only and as such vqmod won't have a gui however for the purposes of opencart I think it would be nice for it to come bundled with a gui here for our users even if the core product is developed and expanded on another site.
Good man, straight up and honestQphoria wrote:Being a forum mod has its perks
930sc ... because it is fun!
Are u explaining mods to me?SapporoGuy wrote:
@ mods on mods
Sorry, but there are several mods here that mod the same sql queries.
I've moded 1 sql about 4 times now.
Code: Select all
ORDER BY p.date_added DESC LIMIT " . (int)$limit);
Code: Select all
ORDER BY rand() DESC LIMIT " . (int)$limit);
Code: Select all
ORDER BY p.date_added
Code: Select all
ORDER BY rand()
Code: Select all
<search> - Can only search one line!
Code: Select all
foreach ($results as $result) {
if (!$current_path) {
$new_path = $result['category_id'];
} else {
$new_path = $current_path . '_' . $result['category_id'];
}
Code: Select all
<search position="after" index="7"><![CDATA[
}
]]></search>
OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English
For that code you show above, why not search for the next line that comes after it which is:marc_cole wrote: What if we need to search for a section of code, like this:Code: Select all
foreach ($results as $result) { if (!$current_path) { $new_path = $result['category_id']; } else { $new_path = $current_path . '_' . $result['category_id']; }
Code: Select all
$output .= '<li>';
Code: Select all
if (!$current_path) {
$new_path = $result['category_id'];
} else {
$new_path = $current_path . '_' . $result['category_id'];
}
Code: Select all
<search lines="4">if (!$current_path) {</search>
I was actually thinking a little more long term with a zip or tgz file for upload, as just being able to upload an xml to the vqmod folder doesn't do you any good if your mod has completely new files. Like I said I was thinking long term it's not anything I was expecting right away.Qphoria wrote:yes you are right I can make an admin module for uploading files into the \vqmod\ folder. I'll do thatXsecrets wrote:I get that it is not going to be opencart only and as such vqmod won't have a gui however for the purposes of opencart I think it would be nice for it to come bundled with a gui here for our users even if the core product is developed and expanded on another site.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Hmm... why didn't I think of that??? Yes — that works.Qphoria wrote:why not search for the next line that comes after it
That sounds interesting! Looking forward to the next release.Qphoria wrote:Another though I had was to allow the search to blindly include lines.
OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English
Not sure what you mean.. sounds like you are looking more into extension and module zip installation for opencart mods that may or may not have a vqmod file with them. That would simply be a function of a generic package installer for opencart which both you and I have in the works. That isn't really related to VirtualQMod. I could certainly unzip a zip file that has the xml zipped inside of it, but virtualqmod isn't going to handle opencart or any other platforms files.Xsecrets wrote:I was actually thinking a little more long term with a zip or tgz file for upload, as just being able to upload an xml to the vqmod folder doesn't do you any good if your mod has completely new files. Like I said I was thinking long term it's not anything I was expecting right away.
Ok i've added a new attribute called "offset" in the <search> tag.marc_cole wrote:That sounds interesting! Looking forward to the next release.Qphoria wrote:Another though I had was to allow the search to blindly include lines.
Code: Select all
if (!$current_path) {
$new_path = $result['category_id'];
} else {
$new_path = $current_path . '_' . $result['category_id'];
}
930sc ... because it is fun!
Code: Select all
<modification>
<id>Do Not Show Main Categories</id>
<version>1.0b3</version>
<vqmver>1.0.4</vqmver>
<author>marc_cole</author>
<file name="catalog/controller/module/category.php">
<operation error="skip">
<search position="before" offset="1"><![CDATA[
$output .= '<li>';
]]></search>
<add trim="false"><![CDATA[
$path = '';
if (isset($this->request->get['path'])) {
$path = $this->request->get['path'];
}
$cat_array = explode ("_", $path);
$top_cat_id = $cat_array[0];
$sub_array = explode ("_", $new_path);
$sub_path_id = $sub_array[0];
if ($top_cat_id == $sub_path_id) {
]]></add>
</operation>
<operation error="skip">
<search position="before" index="2"><![CDATA[
if ($results) {
]]></search>
<add trim="false"><![CDATA[
}
]]></add>
</operation>
</file>
</modification>
OpenCart v1.4.9.4
VQMod | Categories Home | Cleaner By Default - 2 Column | Speak Good English
Users browsing this forum: No registered users and 5 guests