When I share post viva whatsapp share button in codeigniter postted image not showing like thumlin and we image fetch form database - codeigniter

When I share post viva whatsapp share button in codeigniter postted image not showing like thumlin and we image fetch form database
and also I see view source to image name showing proparlly
View Source
<meta property="og:image:secure_url" content="htttp://statenews.co.in/images/product_images/1000raj.jpg" />
View
Head Meta tag
<meta name="description" content="The Fatest News Channel">
<meta property="og:title" content="StateNews ! Hosla Sach Karne Ka..">
<meta property="og:type" content="article">
<meta property="og:site_name" content="News">
<meta property="og:url" content="<?php echo base_url(); ?>" />
<?php $file=base_url()."homeassets/images/".$product_images->image;
if(file_exists($file)){
?>
<meta property="og:image" content="<?php echo base_url(); ?>images/product_images/<?php echo $product_images->image; ?>" />
<?php
}else{
?>
<meta property="og:image" content="<?php echo base_url(); ?>images/product_images/<?php echo $product_images->image; ?>" />
<?php
}
?>
Whatsapp Button
<li style="background: #71b733;">
<a href="https://api.whatsapp.com/send?text=<?php echo base_url() . $_SERVER['REQUEST_URI']; ?>" data-link="<?php echo base_url() . $_SERVER['REQUEST_URI']; ?>" target="_blank" style="color:inherit;">
<i class="fa fa-whatsapp"></i>
</a>
</li>
Controller
$data['products'] = $this->User_model->get_all_data_by2('products','product_images','product_id','master','Common',base_url(),'added_at','DESC',10);
$this->load->view('include/header',$data);
$this->load->view('home',$data);
$this->load->view('include/footer',$data);
Model
function get_all_data_by2($table1='',$table2='',$colum1='',$colum='',$value='',$value2='',$color='',$ord='',$limit=''){
if((!empty($value)) && (!empty($colum))) {
$this->db->where($colum, $value);
}
if(!empty($value2)){
$this->db->or_where($colum, $value2);
}
if((!empty($ord)) && (!empty($color))){
$this->db->order_by($color,$ord);
}
if(!empty($limit)){
$this->db->limit($limit);
}
$query = $this->db->select('*')
->from($table1)
->join($table2, "$table2.$colum1 = $table1.$colum1")
->get();
return $query->result();
}

Related

No able to change some word in English version of my site

I've an e-commerce site in Magento 1.9 with two version: English and French. I've to change some words in both English version and in the French. For example, in the English version, I've to change word "BAG" in the homepage menu.
I've to replace "BAG" with "SHOPPING BAG" but, inserting string "BAG", "SHOPPING BAG" (or "bag","shopping bag", or "Bag", "Shopping bag") into translate.csv of the theme (in the English folder) any change is shown in the frontend. Activating path hints for the English version I notice that the phtml file that builds the block that contains this menu is the following:
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle()?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<?php
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
if (preg_match('/^https/', $currentUrl)) {
$currentUrl = str_replace('https://', 'http://', $currentUrl);
}
$exclusions = array(
'checkout/',
'customer/account/'
);
$regexUrl = '/^' . str_replace(array('/', '.'), array('\\/', '\\.'), Mage::getBaseUrl() . '(?:(?:' . implode(')|(?:', $exclusions) . '))') . '/';
if (!preg_match($regexUrl, $currentUrl)) {
echo '<link rel="canonical" href="' . $currentUrl . '" />';
}
?>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->getIncludes() ?>
I think that there are some function (may be getHtmlChild()) that overwrites my translation because other words are translated adding new strings into traslate.csv.
Which file or function I've to change to see "shopping bag" in the frontend of my site? Why some words are changed with translate.csv and others not? Can you help me, please? Thank you very much!
First, all strings in the translation files are casesensitive.
When I look for a word to translate for example "add to my cart" then I usually do like this:
Open a terminal and go to the root of your magento shop and run:
cd app
git grep "add to my cart" | grep csv
This gets all the hits from all your translation files in your entire project.
My result looks like this:
design/frontend/fortis/eke/locale/sv_SE/translate.csv:1:"Add to Cart","add to my cart"
locale/sv_SE/Mage_Catalog.csv:33:"Add to Cart","add to my cart"
In the result, first you se the path to the file and then the translation.
In my example the string was already translated. But now you know exactly what the base string is. Use this in you own translation file.
If you don´t get a hit in the translation files then the word or sentence might come from a cms-block or cms-page. To search for it there you have to connect to your SQL server and run some querys like this (one at the time):
select * from cms_block where content like '%add to my cart%';
select * from cms_page where content like '%add to my cart%';
From the result you can see what the block or page with the string is named. Go the backend and edit it.

Enable Demographics and Interests reports in Universal Analytics - Magento missing code

I am trying too Enable Demographics and Interests reports in Universal Analytics in my Magento site.
I have read through the already existing question on this and it does not answer my problem: Enable Demographics and Interests reports in Universal Analytics
I already have Universal Analytics set for my Magento site, which was done by simply entering my Google Analytics Account Number in the Magento Backend. It has been working fine for the last few months but I now want to Enable Demographics and Interests reports.
Google Analytics tells me "Your Demographics and Interest Reports have been enabled, but your Analytics tracking code does not include the necessary support to show them", and directs me to the following information page: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad
It tells me to simply add the following code into the existing tracking code:
ga('require', 'displayfeatures');
I found out that this code should be located at:
app/design/frontend/default/YOURTHEME/template/page/html/head.phtml
However when I open this file, the only code in it is as follows:
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle() ?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<?php if(Mage::getStoreConfig('milanoconfig/generaloptions/responsive') == 1): ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<?php endif; ?>
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<?php echo $this->getIncludes() ?>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
From what I have read, this file should also include the following Google Analytics code, but it doesn't:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXX-XX', 'example.com');
ga('send', 'pageview');
</script>
Does anyone know why this code isn't currently in this file even though my Google Analytics appears to be working fine, after simply adding the Google Analytics Account Number in the Magento Backend?
Does anyone also know what I should now do to Enable the Demographics and Interests reports. Should I simply add this code manually, or is there a reason why this code isn't already in place, maybe Magento is set up differently these days? I use Magento version 1.7.0.2.
Thanks

uncaught exception: Call to StartUpload failed in uploadify integration with codeigniter

i have integrated uploadify with codeigniter.i can't able select images while clicking the select photos.
MY View file
<!DOCTYPE HTML>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<title>Uploadify V3 & CodeIgniter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Capsone-System2" >
<!-- Styles -->
<link href="/assets/bootstrap/css/bootstrap.min.css" type="text/css" media="screen" rel="stylesheet"/>
<link href="<?php echo base_url;?>assets/js/jquery/uploadify_31/uploadify.css" type="text/css" media="screen" rel="stylesheet"/>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<!-- Main Content -->
<div class="container">
<h1 class="page-header">Uploadify V3 & CodeIgniter</h1>
<p>This is a simple tutorial demo showing Uploadify V3 working with CodeIgniter 2.1.2</p>
<?php echo form_open_multipart(); ?>
<ul class="unstyled">
<li>
<?php echo form_upload('userfile','','id="userfile"'); ?>
<?php echo (isset($error)) ? $error : ''; ?>
</li>
<li>
<?php echo form_button(array('content'=> 'Upload', 'id'=>'upload-file', 'class'=>'btn btn-large btn-primary')); ?>
</li>
</ul>
<?php echo form_close(); ?>
</div>
<!-- End Of Main Content -->
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>-->
<!--<script>window.jQuery || document.write('<script src="<?php echo base_url;?>assets/js/jquery/jquery-1.8.0.min.js"></script>')</script>-->
<script src="<?php echo base_url;?>assets/js/jquery/uploadify_31/jquery.uploadify-3.1.min.js" type="text/javascript"></script>
<!--<script src="<?php echo base_url;?>assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>-->
<script type="text/javascript">
$(document).ready(function () {
var base_url = '<?php echo base_url; ?>';
alert(base_url);
$('#upload-file').click(function (e) {
e.preventDefault();
$('#userfile').uploadify('upload', '*');
alert(base_url);
});
$('#userfile').uploadify({
'debug':true,
'auto':false,
'swf': base_url + 'assets/js/jquery/uploadify_31/uploadify.swf',
'uploader': base_url + 'uploadify_v3/do_upload',
'cancelImg': base_url + 'assets/javascript/jquery/uploadify_31/uploadify-cancel.png',
'fileTypeExts':'*.jpg;*.bmp;*.png;*.tif',
'fileTypeDesc':'Image Files (.jpg,.bmp,.png,.tif)',
'fileSizeLimit':'2MB',
'fileObjName':'userfile',
'buttonText':'Select Photo(s)',
'multi':true,
'removeCompleted':false,
'onUploadError' : function(file, errorCode, errorMsg, errorString) {
alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
}
});
});
</script>
</body>
</html>
My Controller File
I have error uncaught exception: Call to StartUpload failed
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* #property CI_Upload $upload
*/
class Uploadify_v3 extends CI_Controller
{
public $view_data = array();
private $upload_config;
function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->helper(array('url', 'form'));
$this->load->view('uploadify_v3', $this->view_data);
}
public function do_upload()
{
$this->load->library('upload');
$image_upload_folder = FCPATH . '/uploads';
if (!file_exists($image_upload_folder)) {
mkdir($image_upload_folder, DIR_WRITE_MODE, true);
}
$this->upload_config = array(
'upload_path' => $image_upload_folder,
'allowed_types' => 'png|jpg|jpeg|bmp|tiff',
'max_size' => 2048,
'remove_space' => TRUE,
'encrypt_name' => TRUE,
);
$this->upload->initialize($this->upload_config);
if (!$this->upload->do_upload()) {
$upload_error = $this->upload->display_errors();
echo json_encode($upload_error);
} else {
$file_info = $this->upload->data();
echo json_encode($file_info);
}
}
}
/* End of file uploadify_v3.php */
/* Location: ./application/controllers/uploadify_v3.php */
I have spent more time..still now i can't fix this error..please help me.
I too had the same problem, it was a security issue because I was hosting the flash .swf file on a separate domain eg: static.mysite.com
Make sure your swf file and post handler script are hosted on the same domain that you are accessing the site from.
Or if you need to add cross domain posting then see here:
http://www.adobe.com/devnet/adobe-media-server/articles/cross-domain-xml-for-streaming.html

Wordpress header imgage won't display in IE

Image in header displays in Safari, FFX and Opera, but not in IE (on 9, btw).
Not sure if this matters, but when using IE's developer tools, it shows "Empty Text Node" all over the place.
I don't even know what other code to attach to this post...let me know.
site url: http://glassinfusion.accountsupport.com/
Header Code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<?php if (is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title("Tag Archive for ""); echo '" - '; }
elseif (is_archive()) {
wp_title(''); echo ' Archive - '; }
elseif (is_search()) {
echo 'Search for "'.wp_specialchars($s).'" - '; }
elseif (!(is_404()) && (is_single()) || (is_page())) {
wp_title(''); echo ' - '; }
elseif (is_404()) {
echo 'Not Found - '; }
if (is_home()) {
bloginfo('name'); echo ' - '; bloginfo('description'); }
else {
bloginfo('name'); }
if ($paged>1) {
echo ' - page '. $paged; }
?>
</title>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<link rel="icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" type="image/x-icon" />
<?php if ( is_singular() ) wp_enqueue_script('comment-reply'); ?>
<?php wp_head(); ?>
</head>
<body>
<div id="wrapper">
<div id="header">
<!-- start logo -->
<h1><a href="<?php echo get_option('home'); ?>/"><span><?php bloginfo('name'); ?></span>
<img src="<?php bloginfo('template_directory'); ?>/images/logo3.jpg" width="" height=""alt="<?php bloginfo('name'); ?>"/>
</a></h1>
<!-- End Logo -->
<?php
/* A sidebar on top of the content? Yep. You can can customize
* your top with three columns of widgets.
*/
get_sidebar('navigation');
?>
</div><!--end header -->
<!-- start middle -->
<div id="middle">
Try with different format image like gif instead of jpg in the case of those images which are not displaying.

why target="blank" doesn't open a new window

I am going to show $Content in a new window. after some searches I found the following code. but it doesn't open a new window and echoes $content in the same page.
<form method="POST" action=" <?php echo $Content; ?> " target="blank"></form>
update:
THIS IS THE CODE:
<?php
if(isset($_POST['submit']))
{
include 'library/config.php';
include 'library/opendb.php';
$Unit_Code = $_POST['Unit_Code'];
$File_Name = $_POST['File_Name'];
$_SESSION['Unit'] =$Unit_Code;
$_SESSION['file'] =$File_Name;
$query = "SELECT Unit_Code,File_Name, type,size, Content FROM Units WHERE ((Unit_Code = '$Unit_Code')&&(File_Name='$File_Name'))";
$result = mysql_query($query) or die(mysql_error());
list($Unit_Code, $File_Name, $type, $size, $Content) = mysql_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$File_Name");
?>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="dblclick.js"></script>
</head>
<body>
<form method="POST" action=" <?php echo $Content; ?> " target="_blank"></form>
</body>
</html>
<?php
include 'library/closedb.php';
exit;
}
?>
It's target="_blank". The underscore is important.
You missed the _
<form action="URL TO POST THE FORM" method="POST" target="_blank">
<?php echo $Content; ?>
</form>
Missing: _ before targetin your HTML attribute: < .. target="_blank">

Resources