var $ = jQuery.noConflict();
$(document).ready(function() {
var url = window.location.href;
var a = window.location.pathname;
c = a.substring(1);
//console.log(c);
if(c==''||c=='bienvenue-langue'||c=='bienvenue'||c=='welcome'){
//console.log('need to remove header section');
$('#header-block').css("cssText", "display:none !important;");
$('#top-b').css("cssText", "display:none !important;");
}
//$('#maininner').css("cssText", "min-height: 1400px !important;");
});
Tuesday, August 29, 2017
Wednesday, June 28, 2017
Tuesday, June 27, 2017
how to upload image in laravel
in main function
if (Input::hasFile('image'))
{
$getUpload = $this->uploadFile($imageNameWanted);
if($getUpload){
$UpdateProductImage = PackProduct::find($productId)->update(array('image' =>$imageNameWanted));
}
else {
return Redirect::back()->withErrors('Wrong format of image file')->withInput();;
}
}
use this function in main function
public function uploadFile($imageNameWanted)
{
$destinationPath=base_path().'/public/awesome-assets/img/pdfs/';
$uploadResult = Input::file('image')->move($destinationPath,$imageNameWanted);
if($uploadResult)
{
return true;
}
else {
return false;
}
}
Monday, June 19, 2017
Short relationship in laravel
In usersubscription model
class UserSubscription extends Ardent {
use SoftDeletingTrait;
protected $softDelete = true;
protected $dates = ['deleted_at'];
public static $rules = array(
'user_id' => 'required|numeric',
'order_id' => 'numeric',
'product_id' => 'numeric',
'currency' => 'required',
'shipping_amount' => 'required|numeric',
'net_amount' => 'required|numeric',
'pst_amount' => 'required|numeric',
'gst_amount' => 'required|numeric',
'discount_amount' => 'numeric',
'total_amount' => 'required|numeric',
'start_date' => 'required|date',
'next_date' => 'required|date',
'last_date' => 'date',
'end_date' => 'date',
'completed_orders' => '',
'repeat_unit_type' => '',
'repeat_every_x_units' => 'numeric',
'is_active' => 'required|in:0,1',
'number_of_attempts' => 'numeric',
'last_error_text' => '',
'cancellation_reason_id'=> '',
'custom_cancellation_reason'=> '',
);
{
return $this->belongsTo('CancellationReason', 'cancellation_reason_id');
}
//END OF Usersubscription model
// BEGIN OF CANCELLATION REASON MODEL
class CancellationReason extends Eloquent {
use SoftDeletingTrait;
protected $softDelete = true;
protected $dates = ['deleted_at'];
public static $rules = array(
'reason' => 'required',
'has_custom_text' => '',
);
protected $fillable = array(
'reason',
'has_custom_text',
);
public function userSubscriptions()
{
return $this->hasMany('UserSubscription');
}
/**
* Model bootstrap
*/
public static function boot()
{
// make the parent (Eloquent) boot method run
parent::boot();
}
}
@if($subscription->cancellationReason)
{{$subscription->cancellationReason->reason}}
@endif
Tuesday, June 13, 2017
Needed component
needed component
how to create theme in joomla
https://code.tutsplus.com/tutorials/how-to-build-a-joomla-template-start-to-finish--net-15511How do you add a new module position?
Inserting the code
- Open the index.php file of the Template you wish to edit
- Locate the place in the Template where you wish to put the new position.
- Insert
<jdoc:include type="modules" name="newposition" />
- The variable can be used (between existing tags) to replace an image by replacing the <img src="xxx" border="0" alt="">. Or By creating a new tag with its own class/id.
- Open the Template's TemplateDetails.xml file and locate the
<positions></positions> Start and end tags
- Then add
<position>newposition</position>
- Example
<positions> <position>debug</position> <position>position-0</position> <position>position-1</position> <position>position-2</position> <position>position-3</position> <position>position-4</position> <position>position-5</position> <position>position-6</position> <position>position-7</position> <position>position-8</position> <position>position-9</position> <position>position-10</position> <position>position-11</position> <position>position-12</position> <position>position-13</position> <position>position-14</position> <position>position-15</position> <position>newposition</position> </positions>
https://docs.joomla.org/How_do_you_add_a_new_module_position%3F
How to display horizontally menu in protostar Joomla template
protostar template
want to display the main menu at the navigation section
go to the module and change the position at the right position
then go the menu assigement section and add class ' nav-pills' into the class
It will shows the pills menus.
want to display the main menu at the navigation section
go to the module and change the position at the right position
then go the menu assigement section and add class ' nav-pills' into the class
It will shows the pills menus.
Friday, June 9, 2017
how to reset joomla password
- Find your admin user and click on Edit.
- Copy d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199 into the password field and click on Go.
3.use 'secret' as password and username is:libing
How to include custom js code in joomla
/layouts/template.php in your template
<?php
// bing add this 20170609
$document = JFactory::getDocument();
$document->addScript('templates/fontaine_j3/js/custom.js');
?>
custom.js code
/* Bing added it in 20170421 to get horizontal display */
var $ = jQuery.noConflict();
$(document).ready(function() {
window.onload = function () {
$('#toTop').css("cssText", "text-transform: none !important;");
$('#toTop').text('Retour en haut');
// console.log('set the value to it');
}
});
Monday, June 5, 2017
Custom module
two ways to use module
{loadposition my_address}
{module address}
create custom module
select position as "my_address"
title is address.
How to include article in module
{article 304}[text]{/article}
{loadmodule mod_login,Login Form}
{loadposition my_address}
{module address}
create custom module
select position as "my_address"
title is address.
How to include article in module
{article 304}[text]{/article}
{loadmodule mod_login,Login Form}
Friday, May 19, 2017
window.onload
var $ = jQuery.noConflict();
jQuery(document).ready(function ($) {
window.onload = function () {
setTimeout(function () {
var windowsize = $(window).width();
//alert(windowsize);
if (windowsize < 1100 && windowsize >1000) {
// if the window is greater than 1021 wide and less than 1025then turn on jScrollPane..
$('#engine_box .gbTab_holder li').css("cssText", "width: 15% !important;");
console.log('by default change the tab width');
}
else {
$('#engine_box .gbTab_holder li').css("width","");
console.log('set to default width then it is not ipad pro by defauly');
}
$(window).resize(function() {
windowsize = $(window).width();
// alert('changed screen');
if (windowsize < 1100 && windowsize > 1000) {
// if the window is greater than 1021 wide and less than 1025then turn on jScrollPane..
$('#engine_box .gbTab_holder li').css("cssText", "width: 15% !important;");
console.log('changed screen after change the tab width');
}
else {
$('#engine_box .gbTab_holder li').css("width","");
console.log('set to default width then it is not ipad pro by defauly');
}
});
}, 4000);
};
});
Tuesday, May 2, 2017
Sunday, April 30, 2017
Saturday, April 29, 2017
SMTP connect() failed Solution: change to $mail->isMail() instead of isSMTP()
SMTP connect() failed Solution: change to $mail->isMail() instead of isSMTP()
ob_start to include file
ob_start ();
include 'email_template/'.$pdf_card[$choose_template];
$output = ob_get_contents ();
ob_end_clean ();
include 'email_template/'.$pdf_card[$choose_template];
$output = ob_get_contents ();
ob_end_clean ();
Thursday, April 27, 2017
- 1. Log into your Joomla 3.0 administrative dashboard
- 2. In the top menu, click Extensions and then click Template Manager
- 3. In the tabs at the top of the page, click the Options tab
- 4. Under the Templates tab, find the following setting:
Preview Module Positions
Enable the preview of the module positions in the template by appending tp=1 to the web address. Also enables the Preview button in the list of templates. Please refresh the page after changing this setting.
Click Enabled next to this option, and then click the Save & Close button at the top of the page. - 5. Once again, in the top menu, click Extensions and then click Template Manager
- 6. Now that we have the Preview Module Positions setting enabled, you will see a preview icon next to your Site Templates. Click the preview icon next to the template you would like to view.
- 7. After clicking the preview icon, you'll see a new window appear that looks similar to the below (we are previewing the prostart template):
As you can see in the screenshot above, the red arrow points to position-7. If you wanted a module to show in this position, you would assign the module to position-7.
Tuesday, April 4, 2017
Subscribe to:
Posts (Atom)