ป้องกันการ copy ใน wordpress

ใส่ code ข้างล่างนี้ที่ template theme ใน wordpress โดยเลือกจากเมนูซ้ายมือ รูปแบบบล็อก > การแก้ไข theme  แล้วเลือกรายการ ส่วนหัว (header) ที่เมนูขวามือ เข้าไปแก้ header.php  Ffp หำฟพแ้ หา <header> หรือ </header> เพราะต้องวาง code ข้างล่างไว้ระหว่าง <header> ..... </header>

<!-- Copyright protection script -->
<meta http-equiv="imagetoolbar" content="no">
<script language="Javascript">
/*<![CDATA[*/
document.oncontextmenu = function(){return false;};
/*]]>*/
</script>
<script type="text/javascript">
/*<![CDATA[*/
document.onselectstart=function(){
    if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password") {
        return false;
    }
    else {
         return true;
    }
};
if (window.sidebar) {
    document.onmousedown=function(e){
        var obj=e.target;
        if (obj.tagName.toUpperCase() == 'SELECT'
            || obj.tagName.toUpperCase() == "INPUT"
            || obj.tagName.toUpperCase() == "TEXTAREA"
            || obj.tagName.toUpperCase() == "PASSWORD") {
            return true;
        }
        else {
            return false;
        }
    };
}
document.body.style.webkitTouchCallout='none';
/*]]>*/
</script>
<script type="text/javascript" language="JavaScript1.1">
/*<![CDATA[*/
if (parent.frames.length > 0) { top.location.replace(document.location); }
/*]]>*/
</script>
<script language="Javascript">
/*<![CDATA[*/
document.ondragstart = function(){return false;};
/*]]>*/
</script>
<style type="text/css">
<!—-
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }

    img {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
-->
</style>
<!-- End Copyright protection script -->


การใส่ code ป้องกันการ copy อาจมีผลต่อการทำ seo ทำให้ต้องส่ง sitemap กับ webmaster บ่อยๆ

ลบข้อความ disable comment ใน wordpress

หลังจากปิด comment  comment box เพื่อหม่ให้มีการแสดงความคิดเห็นใน post แล้ว
template บางแบบจะขึ้น กรอบข้อความประเภท

การปิด ให้ไปที่ การแก้ไข theme

เลือกแก้ไข ความเห็น

ปิดคำสัง่แสดงข้อความด้วยเครื่องหมาย // หน้าบรรทัดนั้นๆ

แก้ไขหน้า security risk ใน virtuemart

ตอนที่สร้างเว็บ joomla 2.5 + virtuemart 2+ เมื่อทดสอบการทำงานแล้วพบปัญหา กดบางปุ่มบน fronend ของ virtuemart แล้ว เข้าสู่หน้า Untrust connection
เช่น ทดลองระบบสั่งซื้อสินค้า แล้ว กดปุ่มเลือกวิธีการจัดส่ง


กลับเป็นการเข้าไปที่ หน้า This connection is Untrust


ให้เข้าไปแก้ ที่ configuration ของ vituemart ตรง tab ร้านค้า


เอาติ๊กถูก ออกจาก check box หลัง ข้อความ
เปิดใช้งานระบบ SSL สำหรับพื้นที่ส่วนที่ต้องการความปลอดภัยสูง (แนะนำให้ใช้งาน) 

อย่างไรก็ตามมีคำเตือนเกี่ยวกับการไม่ใช้ option นี้ ที่เกี่ยวข้องกับการตั้งค่าใน joomla คือ

ดังนั้น หลังจาก run ระบบ และทดลองการส่งซื้อแล้ว ควรเช็คอีกครั้งว่า ถ้าเลือก option นี้ จะยังมีปัญหาเปิดหน้า This connection is Untrust อีกหรือไม่

แก้ไข รูป thumbnail ของ default template virtuemart

การแก้ไข รูป thumbnail ของ default template virtuemart ที่มีขนาดเล็กกว่าที่เราต้องการ และกำหนดไว้ใน backend
ต้องแก้ไขตามขั้นตอนที่แนะนำใน
http://www.webholism.com/blog/sara/virtuemart-2-0-how-to-change-the-thumbnail-size-of-your-products/
ดังนี้

VirtueMart 2.0 – How to Change the Thumbnail Size of Your Products

Below are the instructions to change the size of your product thumbnails to the size you really want:
Go to Components -> VirtueMart

Click the Configuration button

In the Templates tab, tick the Enable Dynamic Thumbnail Resizing? box and set Thumbnail Image Width and Thumbnail Image Height to your desired values
Save & Close

Using FTP, browse to your /images/stories/virtuemart/product and /images/stories/virtuemart/category folders, and delete the resized folder

Create a new folder structure: /templates/YOUR-TEMPLATE/html/com_virtuemart/category

Copy the file \components\com_virtuemart\views\category\tmpl\default.php and place the copy in /templates/YOUR-TEMPLATE/html/com_virtuemart/category

Open /templates/YOUR-TEMPLATE/html/com_virtuemart/category/default.php

Change div class=”width30 floatleft center” to div class=”width100 floatleft center” and change div class=”width70 floatright” to div class=”width100 floatright center”

Add the following code to your template CSS file: .browse-view .row .product .spacer img, .related-products-view .row .product .spacer img{max-width:100%;}
Admire your handiwork.


ทำตามขั้นตอนนี้ ได้ผลจริง ไฟลื thumbnail เปลี่ยนจากขนาดประมาณ 50x50 px เป็น 120x120 px ตามต้องการ 

product ไม่แสดงใน catergory virtuemart 2

วิธีที่ 1 จาก http://www.cheubake.com/joomla/20-how-to-get-virtuemart-category-product-image-to-link-to-product-page

How to get Virtuemart category product image to link to product page


After a lot of people having a issue with this. Here's a little helper on how to get Virtuemart category product image to link to product page.
You have to create a folder into your Joomla template:

/templates/your_template/html/com_virtuemart/

after that you should copy all default.php files from:
components/com_virtuemart/views/category/view.html.php
You then need to place in the your template and changing the name to default.php
/templates/your_template/html/com_virtuemart/default.php

You need to change this bit of code:
<?php /** @todo make image popup */ echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',false,'class="modal"');?>
to
<?php echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="catImage" border="0"',false));
                  ?>
If you still seem to be having problems with this. You might have a template override in the /html/ folder.
Get in touch if you have any issues.

วิธีนี้ทดลองแล้ว ไม่ได้ผล สุดท้ายใช้การ uninstall virtuemart ออกจากส่วนเสริมทั้งหมดแล้วลงใหม่ ได้ผล เพราะพอ run ปุ๊บ รูป product ขึ้นได้ตามปกติ

การ uninstall virtuemart ออก โดยไปที่ extension manager  เลือก ชนิดเป็น virtuemart แล้ว ย้ายไปถังขยะให้หมด search เพิ่มด้วยคำว่า vm ถ้ายังมีอยู่ ให้ลบออกหมด เช่นกัน แล้ว upload and install virtuemart package ลงไปใหม่