nestedSortable on codeigniter - php

I do sorting function with codeigniter for pages with "nestedSortable".. When i click submit button it doesnt find " {sortable: cSortable}"
my code example:
in views
$(document).ready(function() {
$.post('<?php echo site_url('admin/pages/order_ajax'); ?>', {}, function(data) {
$('#orderResult').html(data);
});
$('#save').click(function() {
oSortable = $('.sortable').nestedSortable('toArray');
$.post('<?php echo site_url('admin/pages/order_ajax'); ?>', {sortable: cSortable}, function(data) {
$('#orderResult').html(data);
});
});
});
in model file
public function save_order($pages) {
if (count($pages)) {
foreach ($pages as $order => $page) {
dump($page);
if ($page['item_id'] != '') {
$data = array('parent_id' => (int) $page['parent_id'], 'order' => $order);
$this->db->set($data)->where($this->_primary_key, $page['item_id'])->update($this->_table_name);
echo '<pre>' . $this->db->last_query() . '</pre>';
}
}
}
}
in the controller file
public function order_ajax() {
// save order from ajax call
if (isset($_POST['sortable'])) {
$this->page_m->save_order($_POST['sortable']);
}
//fetch all pages
$this->data['pages'] = $this->page_m->get_nested();
//fetch view
$this->load->view('admin/pages/order_ajax', $this->data);
}
I see this error http://i57.tinypic.com/2uj6wpd.jpg
another error:
<?php
echo get_ol($pages);
function get_ol($array, $child = FALSE) {
$str = '';
if (count($array)) {
$str .= $child == FALSE ? '<ol class="sortable">' : '<ol>';
foreach ($array as $item) {
$str .= '<li id="list_' . $item['id'] . '">';
$str .= '<div>' . $item['title'] . '</div>';
//do we have childrens ?
if (isset($item['children']) && count($item['children'])) {
$str .= get_ol($item['children'], TRUE);
}
$str .= '</li>' . PHP_EOL;
}
$str .= '</ol>' . PHP_EOL;
}
return $str;
}
?>
so i dont get it shows me on line 10 and 11 that could't find name and title
"TypeError: parentItem is null
pid = parentItem[2];"

Looks like a type, wrong variable name. Should cSortable actually be oSortable?

Related

CodeIgniter 3 - function search value in database return error 500

I try search value (ean) and if exist in database return title product assigned to this ean.
I've 2 tables:
products
product_details
in products table I have EAN and in product_details I've title.
products.id = product_details.product_id
View:
<div class="form-group">
<label><?= trans("search"); ?></label>
<input type="text" id="input_product_exist" class="form-control" placeholder="<?= trans("category_name"); ?>">
<div id="product_search_result" class="category-search-result"></div>
</div>
Script in view:
<script>
$(document).on("input", "#input_product_exist", function () {
var val = $(this).val();
val = val.trim();
if (val.length > 1) {
var data = {
"ean": val,
"sys_lang_id": sys_lang_id
};
data[csfr_token_name] = $.cookie(csfr_cookie_name);
$.ajax({
type: "POST",
url: base_url + "ajax_controller/search_products",
data: data,
success: function (response) {
var obj = JSON.parse(response);
if (obj.result == 1) {
document.getElementById("product_search_result").innerHTML = obj.content;
}
}
});
} else {
document.getElementById("product_search_result").innerHTML = "";
}
});
ajax_controller:
//search products
public function search_products()
{
$ean = $this->input->post('ean', true);
$products = $this->category_model->search_products_by_ean($product_ean);
$content = '<ul>';
if (!empty($products)) {
foreach ($products as $item) {
$content .= '<li>' . html_escape($item->name) . ' - <strong>' . trans("id") . ': ' . $item->id . '</strong></li>';
}
$content .= '</ul>';
} else {
$content = '<p class="m-t-15 text-center text-muted">' . trans("no_records_found") . '</p>';
}
$data = array(
'result' => 1,
'content' => $content
);
echo json_encode($data);
}
category_model.php
//search products by ean
public function search_products_by_ean($product_ean)
{
$this->db->select('products.id, product_details.title as name');
$this->db->join('product_details', 'product_details.product_id = products.id');
$this->db->like('name', clean_str($product_ean));
//$this->db->where('visibility', 1);
//$this->db->order_by('categories.parent_id');
$this->db->order_by('name');
$query = $this->db->get('products');
return $query->result();
}
Now I try start search: white page.
I check in log console:
jquery.min.js:4 POST https://thisismywebsite.com/ajax_controller/search_products 500
send # jquery.min.js:4
ajax # jquery.min.js:4
(anonymous) # add-product:1581
dispatch # jquery.min.js:3
q.handle # jquery.min.js:3
#update:
I think still I have any issue in step 3, category_model/search_products_by_ean
Here I build working query in phpmyadmin:
SELECT products.ean, product_details.title FROM products INNER JOIN product_details ON products.id = product_details.product_id;
and I get correct output:
#update
you can enable php errors with
error_reporting(E_ALL);
ini_set('display_errors', 1);
for view current error not 500
in ajax controller your must send $ean not $product_ean
//search products
public function search_products()
{
$ean = $this->input->post('ean', true);
// $products = $this->category_model->search_products_by_ean($product_ean);
$products = $this->category_model->search_products_by_ean($ean);//istead $product_ean
$content = '<ul>';
if (!empty($products)) {
foreach ($products as $item) {
$content .= '<li>' . html_escape($item->name) . ' - <strong>' . trans("id") . ': ' . $item->id . '</strong></li>';
}
$content .= '</ul>';
} else {
$content = '<p class="m-t-15 text-center text-muted">' . trans("no_records_found") . '</p>';
}
$data = array(
'result' => 1,
'content' => $content
);
echo json_encode($data);
}

WordPress and Ajax - reload shortcode content

In a custom plugin, I generate a demoConnectors shortcode and initialize its content. This one contains PHP variables in input of type select. The user must therefore select the parameters and the PHP variables are updated via ajax. Depending on the selected parameters, the content of the shortcode is modified.
The problem is that I don't know how to update the shortcode content after the Ajax is triggered.
Here is my PHP code:
<?php
/**
* Plugin Name: demoConnecteurs
* Description: Plugin de démo des connecteurs Jenkins et Mantis
**/
require_once(file_with_external_fonctions.php);
$inst_demoConnecteurs = new demoConnecteurs();
if (isset($inst_demoConnecteurs)){
}
class demoConnecteurs{
private $projects;
private $versions;
private $project_id;
private $project_name;
private $version_id;
function __construct(){
$this->setProjects();
$this->initAjaxActions();
add_action('admin_enqueue_scripts', array($this,'demo_scripts'));
add_action('wp_enqueue_scripts', array($this,'demo_scripts'));
$this->init();
}
function initAjaxActions(){
add_action('wp_ajax_setProjectChosen', array($this,'setProjectChosen'));
add_action('wp_ajax_nopriv_setProjectChosen', array($this,'setProjectChosen'));
}
function demo_scripts(){
wp_register_script( 'ajaxHandle', plugins_url() . '/DemoConnecteurs/buttons_ajax.js');
wp_localize_script( 'ajaxHandle', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
wp_enqueue_script( 'ajaxHandle');
}
function init(){
add_shortcode( 'demoConnecteurs', array($this,'demoConnecteurs_shortcode') );
}
function demoConnecteurs_shortcode () {
return $this->contentDemoConnecteurs();
}
public function setProjects(){
$this->projects = getProjects();
}
public function setProjectChosen(){
if (isset ($_POST['demo_projet_name']))$this->project_name = $_POST['demo_projet_name'];
$this->project_id = getProjectIdFromName($this->mantisClient, $_SESSION['username'], $_SESSION['password'], $this->project_name);
$this->setVersions();
echo $this->contentDemoConnecteurs();
wp_die();
}
public function setVersions(){
$this->versions = getVersionsOfProjectChosen($this->project_id);
}
function contentDemoConnecteurs(){
$html = "";
$html .= 'Choix du projet : ';
$html .= '<select id="projectChosen" name="project">';
foreach($this->projects as $p) {
$selected = ($p->id == $this->project_id) ? 'selected="selected"' : '';
$html .= '<option value="' . $p->name .'" '. $selected . ' >' . $p->name . '</option>';
}
$html .= '</select><br>';
$html .= 'Choix de la version : ';
if (isset ($this->versions)){
$html .= '<select id="versionChosen" name="version">';
foreach($this->versions as $v) {
$selected = ($v->id == $this->version_id) ? 'selected="selected"' : '';
$html .= '<option value="' . $v->id .'" '. $selected . ' >' . $v->id . '</option>';
}
$html .= '</select>';
}
return $html;
}
}
And here my jQuery code:
jQuery(document).ready(function($) {
$('#projectChosen').on('change', function () {
jQuery.ajax({
type: "POST",
url: ajax_object.ajaxurl,
data: {
'action': 'setProjectChosen',
'demo_projet_name': $('#projectChosen option:selected').val()
},
success: function (output) {
//how can I update the content of my shortcode with my variable output
},
error: function(errorThrown){
console.log(errorThrown);
}
});
} );
} );
EDITS
I'm trying to use the filter do_shortcode_tag to update the content of the shortcode, I don't manage to make this work.. It just does not update the content
public function setProjectChosen(){
if (isset ($_POST['demo_projet_name']))$this->project_name = $_POST['demo_projet_name'];
$this->project_id = getProjectIdFromName($this->mantisClient, $_SESSION['username'], $_SESSION['password'], $this->project_name);
$this->setVersions();
apply_filters( 'do_shortcode_tag', array($this, 'contentDemoConnecteurs'), 'demoConnecteurs',10,3 );
wp_die();
}
I would wirte a comment, but my current reputation only lets me to write an answer. Here id my solution to reprint the content of the AJAX output.
On PHP, add a container div with ID:
function contentDemoConnecteurs(){
$html = '<div id="projectSelector">';
$html .= 'Choix du projet : ';
$html .= '<select id="projectChosen" name="project">';
foreach($this->projects as $p) {
$selected = ($p->id == $this->project_id) ? 'selected="selected"' : '';
$html .= '<option value="' . $p->name .'" '. $selected . ' >' . $p->name . '</option>';
}
$html .= '</select><br>';
$html .= 'Choix de la version : ';
if (isset ($this->versions)){
$html .= '<select id="versionChosen" name="version">';
foreach($this->versions as $v) {
$selected = ($v->id == $this->version_id) ? 'selected="selected"' : '';
$html .= '<option value="' . $v->id .'" '. $selected . ' >' . $v->id . '</option>';
}
$html .= '</select>';
}
$html .= '</div>';
return $html;
}
On JQuery:
jQuery(document).ready(function($) {
$('#projectChosen').on('change', function () {
jQuery.ajax({
type: "POST",
url: ajax_object.ajaxurl,
data: {
'action': 'setProjectChosen',
'demo_projet_name': $('#projectChosen option:selected').val()
},
success: function (output) {
$( "div#projectSelector" ).replaceWith(output);
},
error: function(errorThrown){
console.log(errorThrown);
}
});
} );
} );
I hope that's what you need.
I finally made it, I got confused about what I wanted to do...
<?php
/**
* Plugin Name: demoConnecteurs
* Description: Plugin de démo des connecteurs Jenkins et Mantis
**/
require_once(file_with_external_fonctions.php);
$inst_demoConnecteurs = new demoConnecteurs();
if (isset($inst_demoConnecteurs)){
}
class demoConnecteurs{
private $projects;
private $versions;
private $project_id;
private $project_name;
private $version_id;
function __construct(){
$this->setProjects();
$this->initAjaxActions();
add_action('admin_enqueue_scripts', array($this,'demo_scripts'));
add_action('wp_enqueue_scripts', array($this,'demo_scripts'));
$this->init();
}
function initAjaxActions(){
add_action('wp_ajax_setProjectChosen', array($this,'setProjectChosen'));
add_action('wp_ajax_nopriv_setProjectChosen', array($this,'setProjectChosen'));
}
function demo_scripts(){
wp_register_script( 'ajaxHandle', plugins_url() . '/DemoConnecteurs/buttons_ajax.js');
wp_localize_script( 'ajaxHandle', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
wp_enqueue_script( 'ajaxHandle');
}
function init(){
add_shortcode( 'demoConnecteurs', array($this,'demoConnecteurs_shortcode') );
}
function demoConnecteurs_shortcode () {
return $this->contentDemoConnecteurs();
}
public function setProjects(){
$this->projects = getProjects();
}
public function setProjectChosen(){
if (isset ($_POST['demo_projet_name']))$this->project_name = $_POST['demo_projet_name'];
$this->project_id = getProjectIdFromName($this->mantisClient, $_SESSION['username'], $_SESSION['password'], $this->project_name);
$this->setVersions();
echo $this->contentDemoConnecteurs();
wp_die();
}
public function setVersions(){
$this->versions = getVersionsOfProjectChosen($this->project_id);
}
function contentDemoConnecteurs(){
$html = '<div id="contentDemoConnecteurs">';
$html .= 'Choix du projet : ';
$html .= '<select id="projectChosen" name="project">';
foreach($this->projects as $p) {
$selected = ($p->id == $this->project_id) ? 'selected="selected"' : '';
$html .= '<option value="' . $p->name .'" '. $selected . ' >' . $p->name . '</option>';
}
$html .= '</select><br>';
$html .= 'Choix de la version : ';
if (isset ($this->versions)){
$html .= '<select id="versionChosen" name="version">';
foreach($this->versions as $v) {
$selected = ($v->id == $this->version_id) ? 'selected="selected"' : '';
$html .= '<option value="' . $v->id .'" '. $selected . ' >' . $v->id . '</option>';
}
$html .= '</select>';
}
$html .= '</div>';
return $html;
}
}
jQuery(document).ready(function($) {
$('#projectChosen').on('change', function () {
jQuery.ajax({
type: "POST",
url: ajax_object.ajaxurl,
data: {
'action': 'setProjectChosen',
'demo_projet_name': $('#projectChosen option:selected').val()
},
success: function (output) {
$('#contentDemoConnecteurs').replaceWith(output);
},
error: function(errorThrown){
console.log(errorThrown);
}
});
} );
} );

Codeigniter getting multiple data in foreach in controller

I have a problem regarding my foreach loop wherein i cannot access the first array or the array[0] and i dont know the problem.
here is the controller:
$this->SessionCheck();
$this->user->initialize($this->session->userdata('userid'));
$this->load->model('project_model', 'Project');
$ProjectID = $this->input->post('ProjectID');
/***************** Intialize Project model ******************/
$this->Project->Initialize($ProjectID);
$Options = Work_breakdown_structure::$WithBaseTaskID;
//$PhaseTaskID = (int)$this->input->get_post('TaskID',TRUE);
$PhaseTaskID = $this->Project->getPhaseBaseTaskID($ProjectID);
$postlist->PhaseTaskID = $this->Project->getPhaseBaseTaskID($ProjectID);
$postlist->phaseList = $this->Project->LatestApplicablePlan->WBS->GetPhaseList($Options);
if($PhaseTaskID == null)
{ }
else
{
foreach($PhaseTaskID as $index=>$value)
{
$finalArr[$value['TaskName']] = $value['BasetaskID'];
$postlist->taskList = $this->Project->LatestApplicablePlan->WBS->GetWBS($finalArr[$value['TaskName']], $Options);
}
echo print_r($finalArr);
for($x = 1 ; $x < 2 ; $x++)
{
//$postlist->taskList = $this->Project->LatestApplicablePlan->WBS->GetWBS($phaseID, $Options);
}
}
$postlist->project = $ProjectID;
return $this->load->view('MyToDoPhaseDropdown', $postlist);
here is my view:
echo '<td style="padding-top:5x;font-size:14px;" colspan="2"> <br> Phases : ';
echo '<select id="phases_select" style="width:400px;" onchange="search_filter()" >';
echo '<option value="0" selected="selected"> Select Project Phase </option>';
foreach($phaseList as $row)
{
if(preg_match("/^CYCLE/", strtoupper($row['TaskName'])))
{
foreach($row['Child'] as $child)
{
echo '<option value="'. $child['TaskID']. '">';
echo $row['TaskName'].' > '.$child['TaskName'] . '</option>';
}
}
else
{
if($Iterate['BaseTaskID'] != $row['TaskID'])
{
echo '<option value="'. $row['TaskID']. '">';
echo $row['TaskName'].'</option>';
}
foreach($taskList as $Iterate)
{
if($row['TaskID'] == $Iterate['BaseTaskID'] )
{
echo '<option value="'. $row['TaskID']. '">';
echo $Iterate['TaskName'].' '.$Iterate['IterationNumber']. '</option>';
}
}
}
}
echo '</select>';
echo '</td>';
The problem is that i need to get all the values into an array to pass it to the view. but i only get the latest value which is the 2nd data that i retrieve in the database.
What you are doing wrong is :
return $this->load->view('MyToDoPhaseDropdown', $postlist);
You need to set the data in a variable to be accessible in view : http://codeigniter.com/user_guide/general/views.html
$data = array('title' => 'My Title',
'heading' => 'My Heading',
'message' => 'My Message');
$this->load->view('MyToDoPhaseDropdown', $data);
And in view file : MyToDoPhaseDropdown.php
<html>
<?php
//Access them like so
echo $title.$heading.$message; ?>
</html>

php echo mysql array result in ajax

the below function is my controller code which is called by an ajax request:
function search_featured_candidates() {
$skills = $this->input->post('skills');
$this->load->model('Featured_candidate', 'featured', TRUE);
$result = $this->featured->get_featured_candidates_by_skills($skills);
if ($result) {
$str = "";
foreach ($result as $row) {
$str .= "Name: " . $row->candidate_name . "<br/>";
$str .= "Exp: " . $row->experience . "<br/>";
$str .= "Skills: " . $row->skills . "<hr/>";
}
$html = $str;
echo json_encode(array('html' => $html, 'success' => TRUE));
} else {
$html = 'No Candidates Found!';
echo json_encode(array('html' => $html, 'success' => FALSE));
}
}
my view code:
<script>
$(function() {
$("#featured_candidates").on("change paste keyup", function() {
$.ajax({
type: "POST",
url: "<?php echo base_url(); ?>mypage/search_featured_candidates/",
data: {skills: $(this).val()},
dataType: "json",
success: function(data) {
if (data.success === true) {
$("#featured").html(data.html);
} else {
$("#featured").html(data.html);
}
}
});
});
});
</script>
<div class="panel-body">
<div>
<input type="text" style="width: 100%"
name="featured_candidates" id="featured_candidates"
placeholder="keyword / skills" title="Featured Candidates"
/>
<br/><hr/>
</div>
<div id="featured">
<?php
foreach ($result as $row) {
echo "Name: " . $row->candidate_name . "<br/>";
echo "Exp: " . $row->experience . "<br/>";
echo "Skills: " . $row->skills . "<hr/>";
}
?>
</div>
</div>
now i am trying to display the result array using ajax like i have displayed in my view code using foreach. so to display it using ajax i have concatenated the array in my controller method in $str but it is not working while when i updated my controller method to this:
function search_featured_candidates() {
$skills = $this->input->post('skills');
$html = $skills ;
echo json_encode(array('html' => $html, 'success' => TRUE));
}
it is working fine..any help or suggesttion would be a great help...thanks in advance..
You have a mistake here
foreach ($result as $row) {
echo "Name: " . $row->candidate_name . <br/>";
echo "Exp: " . $row->experience . "<br/>";
echo "Skills: " . $row->skills . "<hr/>";
}
You forgot the "
. $row->candidate_name . "<br/>";
// ^ You forgot the "
The formulation of your question makes it difficult to know where your problem really is. But from a quick look you normally have to set proper headers in order to output json formatted data with PHP.
Try adding this before you do your echo, maybe this solves your problem:
header('Content-Type: application/json');

Item not getting selected through javascript file

I have simple jquery file which slide news, but now some problem has occurred and it's not selecting element. while debugging it shos null value in triggers.
Code for Php file
<?php
/**
* copyright (C) 2008 GWE Systems Ltd - All rights reserved
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
/**
* HTML View class for the module frontend
*
* #static
*/
include_once(JPATH_SITE."/modules/mod_jevents_latest/tmpl/default/latest.php");
class GeraintModLatestView extends DefaultModLatestView
{
function displayLatestEvents(){
$document = JFactory::getDocument();
$this->getLatestEventsData();
$content = "";
$var=count($this->eventsByRelDay);
$testVar=1;
if(isset($this->eventsByRelDay) && count($this->eventsByRelDay)){
$content .='<html>';
$content.='<body>';
$urls= "http://localhost/Mineral/modules/mod_jevents_latest/tmpl/myjs/jquery.min.js";
$content.='<script src="'.$urls.'"></script>';
$urls= "http://localhost/Mineral/modules/mod_jevents_latest/tmpl/myjs/slideshow.js";
$content.='<script src="'.$urls.'"></script>';
$content.='<script> jQuery.noConflict(true);</script>';
$content.='<div style="height:200px; width=300px; overflow: hidden; position:relative; top:0; border:5px double #206BA4; border-radius:7px; text-align:center; ">';
$content .= '<ul class="triggers" width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
// Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array
// and work our way up.
$firstTime=true;
$lastElem=false;
// initialize name of com_jevents module and task defined to view
// event detail. Note that these could change in future com_event
// component revisions!! Note that the '$this->itemId' can be left out in
// the link parameters for event details below since the event.php
// component handler will fetch its own id from the db menu table
// anyways as far as I understand it.
$task_events = 'icalrepeat.detail';
$this->processFormatString();
foreach($this->eventsByRelDay as $relDay => $daysEvents){
reset($last);
reset($daysEvents);
// get all of the events for this day
foreach($daysEvents as $dayEvent){
if($testVar==$var)
$lastTime=true;
if(($dayEvent->bgcolor()=='#FF0000')&&($lastTime))
$dst = "text-decoration:blink;border-color:".$dayEvent->bgcolor();
else
$dst = "border-color:".$dayEvent->bgcolor();
if($firstTime) $content .= '<li style="'.$dst.'">';
else $content .= '<li style="'.$dst.'">';
// generate output according custom string
foreach($this->splitCustomFormat as $condtoken) {
if (isset($condtoken['cond'])) {
if ( $condtoken['cond'] == 'a' && !$dayEvent->alldayevent()) continue;
else if ( $condtoken['cond'] == '!a' && $dayEvent->alldayevent()) continue;
else if ( $condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent())) continue;
else if ( $condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent())) continue;
else if ( $condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate()!=$dayEvent->getUnixEndDate() ) continue;
else if ( $condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate()==$dayEvent->getUnixEndDate() ) continue;
}
foreach($condtoken['data'] as $token) {
unset($match);
unset($dateParm);
$dateParm="";
$match='';
if (is_array($token)) {
$match = $token['keyword'];
$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : "";
}
else if (strpos($token,'${')!==false){
$match = $token;
}
else {
$content .= $token;
continue;
}
$this->processMatch($content, $match, $dayEvent, $dateParm,$relDay);
} // end of foreach
} // end of foreach
$content .= "</li>\n";
$firstTime=false;
$testVar++;
} // end of foreach
} // end of foreach
//$content=var_dump($var);
$content .="</ul>";
$content .="</div>";
$content .="</body>";
$content .="</html>";
} else {
$content.='<div style="height:200px; width=300px; overflow: hidden; position:relative; top:0; border:5px double #206BA4; border-radius:7px; text-align:center; ">';
$content .= '<ul class="mod_events_latest_table" width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
$content .= '<li class="mod_events_latest_first" >'. JText::_('JEV_NO_EVENTS') . '</li>' . "\n";
$content .="</ul>\n";
$content.='</div>';
}
$callink_HTML = '<div class="mod_events_latest_callink">'
.$this->getCalendarLink()
. '</div>';
if ($this->linkToCal == 1) $content = $callink_HTML . $content;
if ($this->linkToCal == 2) $content .= $callink_HTML;
if ($this->displayRSS){
$rssimg = JURI::root() . "media/system/images/livemarks.png";
$callink_HTML = '<div class="mod_events_latest_rsslink">'
.'<a href="'.$this->rsslink.'" title="'.JText::_("RSS_FEED").'" target="_blank">'
.'<img src="'.$rssimg.'" alt="'.JText::_("RSS_FEED").'" />'
.JText::_("SUBSCRIBE_TO_RSS_FEED")
. '</a>'
. '</div>';
$content .= $callink_HTML;
}
return $content;
} // end of function
} // end of class
Jquery file
$(window).load(function ()
{
jQuery.noConflict();
var triggers = $('ul.triggers li');
var lastElem = triggers.length-1;
var target;
triggers.first().addClass('selected');
triggers.hide().first().show();
function sliderResponse(target)
{
triggers.removeClass('selected').
fadeOut(9000).eq(target).addClass('selected').fadeIn(9000);
}
function sliderTiming()
{
if(triggers.length==1)
{
triggers.first().show();
clearInterval(timingRun);
}
else
{
target = $('ul.triggers li.selected').index();
if ( target === lastElem )
{ target = 0; }
else
{ target = target+1; }
sliderResponse(target);
}
}
var timingRun = setInterval(function() { sliderTiming(); },9000);
function resetTiming()
{
clearInterval(timingRun);
timingRun = setInterval(function() { sliderTiming(); },9000);
}
});
The same file working correctly in other joomla template. and i think their must not be problem of any conflict as i have checked it by disabling other model.

Categories