Opencart 3.x version: cannot remove "powered by" - opencart

I cannot remove the "powered by opencart" on the footer in version 3.x. The new files are all twigg files and I don't know where or how to do it.
Any help on the path and configuration, please.
Thanks all.

The file catalog/language/en-gb/common/footer.php has
$_['text_powered'] = 'Powered By OpenCart<br /> %s © %s';
change this to
$_['text_powered'] = '';

Related

How to update AIML version from 1.0.1 to AIML 2.0

Current application is using AIML version 1.0.1 and I want to update it to 2.0 . The xml files are having the code like -
<aiml version = "1.0.1" encoding = "UTF-8">
<aiml>
<category>
<name>URL</name>
<pattern>Example link*</pattern>
<template>Here is the Link !
<hyperlink href="https://example.com"target="_blank">Click Here</hyperlink>
<id>URL1</id>
</template>
</category>
</aiml>
Which bot are you using?
AIML 2.0 is fully compatible with 1.0
Documentation about AIML (including AIML 2) is available here: https://pandorabots.com/docs/aiml-reference/
Your example category can now be simplified to this, using the <link> tag
<category>
<pattern>Example link</pattern>
<template>Here is the Link !
<link>
<text>Click here</text>
<url>https://example.com</url>
</link>
</template>
</category>

OCMOD searching whem i have line breaks or undefined whitespaces

im trying to make a OCmod for opencart 2.0.3.1
and when i try to find in catalog/view/theme/*/template/common/header.tpl
these two parts of html code the script dont find anything in error log its says NOT FOUND.
the first search is that
<search>
<![CDATA[
<?php } ?>
<?php } ?>
]]>
</search>
and the seccond serach if for that
</ul>
</div>
</nav>
both of this searchs not find any thing but i copied and pasted from the original file.
some one can help me to improve this serach whit regex or tell me how ocmod works to serach that?
Here is the sample OCMod code to do more better search in your opencart 2.x version.
<file path="catalog/view/theme/*/template/common/header.tpl">
<operation>
<search><![CDATA[}}]]></search>
<add position="after"><![CDATA[This is test ocmod]]></add>
</operation>
</file>
This is test ocmod text display after } }
Try this kind of code in your ocmod.

OCMOD Implementation OpenCart 2.0

Have anybody have implemented OCMOD for plugin development in opencart 2.0 ?
Do we need to install VQMOD to execute OCMOD?
I found https://github.com/opencart/opencart/wiki/Modification-System but still
unable to get clear idea.
Any help would be really appreciated.
Thanks
No, You need not to install VQMOD to execute OCMOD. OCMOD works independently.
You have to create ocmod xml file with ".ocmod.xml" extension, then you can upload that file using "Extension Installer" from admin panel of opencart.
You have to clear and refresh the modification cache to update the system and make the extension work.
You can clear and refresh by top right buttons on Extension > Modification page in admin panel.
OCMod is essentially a poor mans VQMod. there are a number of features missing that aren't/won't be in it that are in VQMod, the biggest of which is being able to add content before/after a certain line match and as such would really recommend just sticking with VQMod which works just fine (version 2.5 and above)
I've used ocmod and released a few free oc extensions.
VQMOD and OCMOD are two separate things (as already commented).
Both will not interfere with each other.
You can load ocmod .ocmod.xml scripts from the administration panel (extensions and modifications).
A suggestion is to not invest too much work right now since ocmod is still a bit limited and probably is going to change in the near future.
A few persons are suggesting to implement quite all the functionalities of vqmod and the whole system/methods can change in the near future
https://github.com/opencart/opencart/issues/2045
I personally prefer vqmod since the development can be faster and you can edit the xml on the fly and refresh the browser.
I've done 3 different vqmods in around one hour while in ocmod i've spent the same time only to upload/edit/remove the (3) modifications with different tags (required by ocmod).
Caching in ocmod seems to be slower on my system (with a modification on a lot of of php files) and sometimes the modifications are not appearing (in the browser) immediately. I don't know if it's a problem on my specific system.
The logs of ocmod are not giving too much informations in case of errors.
I've been trying to get an OCMOD installed today on version 2.0.1.0 of OpenCart.
Did not figure it out and the forums and documentation did not provide adequate help.
While the install may be broken or my environment is bugging it, VQMODs and OCMODs are separate entities and don't depend on one another.
For example, VQMOD uses XML files to store the modifications, and builds a cache with the modified core files.
OCMOD stores the code changes in the database directly without saving the uploaded XML, and seems to build a cache from there (I hope it does the cache part, haven't found proof yet).
The install code for the OCMOD is found in \admin\controller\extension\installer.php
public function xml() {
So you don't need to mess with VQMOD to get OCMOD working unless you have old VQMODs and don't want to reupload them.
I tried OCMOD now, it's pretty easy if you know what files you need to change and how you want to change them. You can find some official documentation here and a good regexp tester here.
If you click Extensions / Modifications / Add in admin you can just paste your XML, select Activated, Save and then Update modifications, then click Log to check log messages, then check your modified files below the directory system/modifications.
Something to remember is to delete your modification and add it as a new one when changing it, it seems that just updating it isn't enough to reload it's XML.
Here is an example module I made to remove wish-list buttons
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Remove wishlist buttons</name>
<code>cjohanssonremovewishlistbutons</code>
<version>1.0</version>
<author>Christian Johansson</author>
<link></link>
<file path="catalog/view/theme/default/template/product/product.tpl">
<operation>
<search trim="true">
<![CDATA[<button type="button" data-toggle="tooltip" class="btn btn-default" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product_id; ?>');"><i style="color:<?php echo html_entity_decode($config->get('ekometcss_css_wishlist_color'), ENT_QUOTES, 'UTF-8'); ?>;" <i class="<?php global $config; echo $config->get('ekometcss_custom_icons_wishlist') ? 'fa fa-' . $config->get('ekometcss_custom_icons_wishlist') : 'fa fa-star'; ?>"></i></button>]]>
</search>
<add position="replace">
<![CDATA[]]>
</add>
</operation>
</file>
<file path="catalog/view/theme/default/template/module/*.tpl">
<operation>
<search trim="true">
<![CDATA[<button style="width: 80%;" type="button" class="cat-cart"]]>
</search>
<add position="replace">
<![CDATA[<button style="width: 100%;" type="button" class="cat-cart"]]>
</add>
</operation>
<operation>
<search trim="true">
<![CDATA[<button style="width: 20%;" type="button" class="cat-wishlist" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i style="color:<?php echo html_entity_decode($config->get('ekometcss_css_wishlist_color'), ENT_QUOTES, 'UTF-8'); ?>;" <i class="<?php global $config; echo $config->get('ekometcss_custom_icons_wishlist') ? 'fa fa-' . $config->get('ekometcss_custom_icons_wishlist') : 'fa fa-star'; ?>"></i></button>]]>
</search>
<add position="replace">
<![CDATA[]]>
</add>
</operation>
</file>
<file path="catalog/view/theme/default/template/product/category.tpl">
<operation>
<search trim="true">
<![CDATA[<button style="width: 80%;" type="button" class="cat-cart"]]>
</search>
<add position="replace">
<![CDATA[<button style="width: 100%;" type="button" class="cat-cart"]]>
</add>
</operation>
<operation>
<search trim="true">
<![CDATA[<button style="width: 20%;" type="button" class="cat-wishlist" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i style="color:<?php echo html_entity_decode($config->get('ekometcss_css_wishlist_color'), ENT_QUOTES, 'UTF-8'); ?>;" <i class="<?php global $config; echo $config->get('ekometcss_custom_icons_wishlist') ? 'fa fa-' . $config->get('ekometcss_custom_icons_wishlist') : 'fa fa-star'; ?>"></i></button>]]>
</search>
<add position="replace">
<![CDATA[]]>
</add>
</operation>
</file>
</modification>
Have anybody have implemented OCMOD for plugin development in opencart 2.0 ?
Ans: Yes
Do we need to install VQMOD to execute OCMOD?
Ans: No
OCMOD Folder structure like this for Opencart
-upload -admin...(if you have required)
-catalog..(if you have required)
- - - -
- install.xml
Zip these and named like this .ocmod.zip
Then You can able to install with Opencart Installer
No
VQMOD is seperated Plugin that depend on file system XML Files
OCMOD Depend on DB when you install new ocmod plugin it stored in modifications table

IPTC data in coldfusion 9

I am using coldfusion's imageGetIPTCMetadata() function to get the iptc keywords.
I used Photomechanics to insert some keywords in a hierarchical fashion like this
Personnel | Appointments | Assistant Chief of General Staff (ACGS), Personnel | Ranks | Royal Marine | Colour Sergeant (CSgt), Personnel | Ranks | Royal Navy | Chief Petty Officer (CPO), Personnel|Ranks|Army|Field Marshall (Fd Marshall) (FM)
But after I call the method in my CFC I get this -
How can I get the keywords with a delimeter or something so that I can reuse them in my code.
If I understand your question correctly, you can use one of the List functions like ListGetAt to get the keywords with a delimiter. Or if you prefer working with arrays you can use the ListToArray function keywordsArray = ListToArray(data.Keywords,"|")
<cfscript>
data = ImageGetIPTCMetadata(myImage);
for( i=1; i LTE ListLen(data.Keywords,"|"); i++ )
{
WriteOutput( Trim( ListGetAt(data.Keywords, i, "|") ) & "<br />" );
}
</cfscript>
I use CFX_OpenImage to read and write IPTC_ data in .jpg files in CF8 thru CF11. I also use this for image resize and rotation.
More CFX_OPENIMAGE INFO go to http://www.kolumbus.fi/jukka.manner/cfx_openimage/
It GraphicsMagick 1.3.17.
GraphicsMagick (www.graphicsmagick.org) maintains a stable release branch, maintains a detailed Change Log, and maintains a stable source repository with complete version history so that changes are controlled, and changes between releases are accurately described. GraphicsMagick provides continued support for a release branch.
More INSTALLATION INFO:
Note: If you are installing 64bit version of the tag, please download and install Microsoft Visual C++ 2010 Redistributable Package (x64) from Microsoft (http://www.microsoft.com/download/en/details.aspx?id=14632). The x64 version has been compiled and written in Visual Studio 2010.
CFX_OPENIMAGE installation steps common to both versions:
Create an environment variable Since GraphicsMagick needs read configuration files (*.mgk files), we need to tell the tag where those files are located. In order to do that, a system or cold fusion runtime user specific environment variable must be set. The name of this variable is CFX_OPENIMAGE_FULLPATH.
CFX_OPENIMAGE_FULLPATH environment variable should contain full pathname which points to a directory where all mgk-files and cfx_openimage.ini file are kept. A default value for this is “c:\cfx_openimage\”. Notice that the last “\” character is needed too.
You may install the actual dll where ever you like, it’s up to you to register is anyway via CF admin page. For keeping the security settings for all the files equal, it is recommended to keep cfx_openimage.dll in the same directory that the *.mgk and cfx_openimage.ini directory.
I found the solution here:
<cfparam name="URL.source" default="xmp-asset.jpg">
<cffile action="readbinary" file="#ExpandPath(URL.source)#" variable="data">
<!-- encode the binary data to hex -->
<cfset hex_data = BinaryEncode(data,"hex") />
<!-- string indicating beginning of packet '<x:xmpmeta' -->
<cfset xmp_string_begin = "3C783A786D706D657461" />
<!-- string indicating end of packet '</x:xmpmeta>' -->
<cfset xmp_string_end = "3C2F783A786D706D6574613E" />
<!-- find the starting index in the hex string -->
<cfset idx_start = FindNoCase(xmp_string_begin,hex_data) />
<!-- find the ending index in the hex string -->
<cfset idx_end = FindNoCase(xmp_string_end,hex_data,idx_start) + Len(xmp_string_end) />
<!-- using the start and end indices, extract the xmp packet -->
<cfset xmp_hex = Mid(hex_data,idx_start,Evaluate(idx_end-idx_start)) />
<!-- convert the hex to readable characters -->
<cfset xmp_string = ToString(BinaryDecode(xmp_hex,"hex")) />
<!-- parse the xml string to and xml structure -->
<cfset xmp_xml = XmlParse(xmp_string) />
<cfcontent type="text/xml">
<cfoutput>#xmp_string#</cfoutput>
Now I can get the entire XMP xml and do all I want to do with the data there.

How to generate PDF from .cfm page in Mac

I am using <cfdocument> tag of coldfusion 7. Using CFEclipse and working on MacOS.
I have written the following code:
<cfdocument format="pdf">
SitePoint.com - Introduction to ColdFusion 7
PDF Generation
This is an example of PDF generation using ColdFusion 7.
</cfdocument>
But instead of asking me to save this file in .pdf format, its trying to open it in .cfm format.
How can I save it in .pdf format? Thanks!
Unless you tell it otherwise, the webserver returns the results of a CFM call as text. You need to use CFContent with CFHeader to alert the browser that the results it will be recieving are of a different type. Something like:
<cfheader name="Content-Disposition" value="inline; filename=document.pdf">
<cfcontent type="application/x-pdf">
<cfdocument>...</cfdocument>
I may have the MIME type wrong there. I'm doing this from memory. Check the docs for more help.
If you are on CF8 or higher then use the saveAsName attribute:
<cfdocument saveAsName=""
Either that or the method suggested by Ben above should work
You might also need to import the style sheet as well. So you can get the desired formatting. It needs to be imported after cfdocument.
<cfdocument
format="pdf"
filename = "canwriteurfile.pdf"
overwrite = "yes"
marginBottom = ".2"
marginLeft = ".4"
marginRight = ".4"
marginTop = ".2">
<style type="text/css">#import "pdf.css";</style>
BLAHHH BLAHHH PDF FORMATTING STUFF
</cfdocument>
Try:
<cfdocument format="PDF" name="myPDF">
<html>
<body>
SitePoint.com - Introduction to ColdFusion 7
PDF Generation
This is an example of PDF generation using ColdFusion 7.
</body>
</html>
</cfdocument>
<cfpdf action = "write" destination = "pdf_path" source = "myPDF" overwrite = "yes"/>
<cflocation url="pdf_path"/>
Whis this you save the PDF on disk