Tuesday 3 December 2013

Rss Fetcher Wordpress and PHP



One of the most important topic that consumed my whole night to build a RSS Fetcher.This code will guide you to convert rss feed into Wordpress Posts.There are lots of plugins which provide this facility but none of them does their job completely.

Here is a sample rss feed from clipsyndicate.

<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:syndi="http://clipsyndicate.com/rss/extension/mobileplayer"version="2.0">


<channel>


<title>Entertainment</title>


<description/>


<category>ns_entertainment</category>


<link>http://chic.clipsyndicate.com/rss/feed/12235</link>


<atom:link type="application/rss+xml" href="http://chic.clipsyndicate.com/rss/feed/12235" rel="self"/>


<item>


<guid>
http://eplayer.clipsyndicate.com/view/12235/4780626
</guid>


<title>Video: Locals React to Paul Walker's Death</title>


<description>
<table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td><a href="http://chic.clipsyndicate.com/video/playlist/12235/4780626?cpt=8&wpid=6474"><img src="http://video-static.clipsyndicate.com/zStorage/clipsyndicate/247/2013/12/02/02/29/yllttxabgqohbybsuhpo.jpg" width="120" height="90" border="0" /></a></td><td style="padding:5px;">Walker's neighbors placed flowers on the front porch of his Mesa home as a tribute.</td></tr></table>
</description>


<link>
http://chic.clipsyndicate.com/video/playlist/12235/4780626?cpt=8&wpid=6474
</link>


<pubDate>Mon, 02 Dec 2013 01:59:52 +0000</pubDate>


<media:thumbnail url="http://video-static.clipsyndicate.com/zStorage/clipsyndicate/247/2013/12/02/02/29/yllttxabgqohbybsuhpo.jpg" height="90" width="120"/>


<media:title>Locals React to Paul Walker's Death</media:title>


<media:description>
Walker's neighbors placed flowers on the front porch of his Mesa home as a tribute.
</media:description>


<media>
http://chic.clipsyndicate.com/video/playlist/12235/4780626?cpt=8&wpid=6474
</media>


<media:credit>KEYT Santa Barbara, CA</media:credit>


<media:text>
the community. 00-05 21-27 40-44 1:09-1:18 1:42-1:50 1:56-2:07 2:15-2:22trt - 2:38 nats "one of them is paul walkefrom the fast and the furious!." . it was supposed to be a quick joyride, but it ended in a fiery crash that killed actor and santa barbara resident paul walker and his friend roger rodas. nats of crash scene if any . walker and rodas were leaving a charity event justnorth of los angeles on saturday when their car wrecked. both were pronounced dead at the scene. sot jim torp/friend of walker "Paul wanted to go for a rideThat was the last that we saw of them." . rodas was behind the wheel and walker a passenger in the red porsche that apparently spun out of control and slammed into a tree and light pole. . walker's friends heard thecrash and tried desperately to put out the flames.. sot antonio HOLMES/friend There was nothing....we tried..we went thru fire extinguishers and...." . all that was left was the burned out wreckage..the carbarely recognizable... dissolve... NEWS OF HIS death spread quickly on social media and throughout santabarbara, where walker had a home. 30:56 LAUREL PEREZ he was just a very open sweet friendly guy. We'll miss him. 31:00 . walker's neighbors placed flowers on the front porch of his mesa home as a tribute. 32:05 LAUREL PEREZ it's a small token of our appreciation for himhumbleness and generosity to this community and to others." neighbors say even though walker was a celebrity, he was a part of the community.30:27 LAUREL PEREZ "He was very friendly. He really liked and engaged with the kids in the neighborhood. There are some fun stories teasing the boys as they wouldwalk the dogs past his house. 30:41 walker was often spotted AROUND TOWN. Nats bowling strike he was a regular at zodo's bowling alley in goleta. sot "steve davis/zodos" 26:0most of the people really knew who hewas.... the girls thought he was a nice looking man and went gaga over him"26:12 . THE 4 year-old's good looks made him one of hollywood's most bankablestars. . he rose to fame behind the wheels of fast cars in the blockbuster fast and furious movie franchise. nats from movie clips "Righ behind you."Universal Pictures "Fast an Furious 6" . WALKER WAS I the middle of filming the 7th installment ofthe series at the time of his death. . the l-a county coronersays because of the fiery collision, it will be awhile until he can positively identify the bodies. . sot ed winter/la county CORONER's officeIt's gonna take some time...dental and possible medical x-rays." . as the investigation into the crash continues, so does the shock over walker;s death...one that many say came WAY TOO SOON. Sot: 30:27 he was a great guy. We are all very saddened by his death. in santa barbara, alys martinez newschannel 3. . paul walker is survived byhis 15- year old daughter, meadow. . now
</media:text>


<media:playerurl="http://eplayer.clipsyndicate.com/cs_api/get_swf/3/&amp;auto_next=0&amp;auto_start=0&amp;cpt=8&amp;page_count=5&amp;pf_id=6477&amp;pl_id=12235&amp;va_id=4780626&amp;windows=1&amp;wpid=6474">
<iframe frameborder="0" scrolling="no" src="http://eplayer.clipsyndicate.com/embed/iframe?cpt=8&pf_id=6477&pl_id=12235&va_id=4780626&windows=1" width="320" height="280"></iframe>
</media:player>


<media:category label="cs_tickers"/>


<media:category label="cs_keywords">Paul Walker,Fast and Furious,Car Accident</media:category>


<media:category label="cs_categories">News,Local News,Entertainment,Movies,Celebrity</media:category>


<syndi:mobilePlayer url="http://play.syndi.tv/v1/player.html?pf_id=6477&va_id=4780626"/>
</item>


<item>



Here is the code which i used for fetching this rss and making it wordpress post


<?php
$url="http://www.clipsyndicate.com/rss/feed/27960?wpid=12780";
$rss = new DOMDocument();
$rss->load($url);
$feed = array();


foreach ($rss->getElementsByTagName('item') as $node) {
    $item = array ( 
        'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
        'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
        'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
        'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
'media' => $node->getElementsByTagNameNS("*","description")->item(0)->nodeValue,
'tags' => $node->getElementsByTagNameNS("*","category")->item(1)->nodeValue,
'video' => $node->getElementsByTagName('guid')->item(0)->nodeValue,
'image' => $node->getElementsByTagName('thumbnail')->item(0) ? $node->getElementsByTagName('thumbnail')->item(0)->getAttribute('url') : ''
        );
    array_push($feed, $item);
}
$limit =100;  <-------Set no. of post u want to make

for($x=0;$x<$limit;$x++) {
    $title = str_replace(' & ', ' &amp; ', $feed[$x]['title']);
    $link = $feed[$x]['link'];
    $description = $feed[$x]['desc'];
$video = $feed[$x]['video'];
$image = $feed[$x]['image'];
$excerpt = $feed[$x]['media'];
$tag = $feed[$x]['tags'];
$uri = $video;
$pieces = explode("/", $uri);
    $uri_3 = $pieces[5];
$frame= '<iframe frameborder="0" scrolling="no" src="http://eplayer.clipsyndicate.com/embed/iframe?pf_id=&show_title=0&va_id='.$uri_3.'&windows=1" width="620" height="420"></iframe>';
$videolink='http://www.clipsyndicate.com/video/playlist/12235/'.$uri_3.'?title=entertainment&wpid=12780';


if($title!='' && $uri_3!=''){ <----------------Wordpress code to insert post $post_id = wp_insert_post(array ( 'post_title' => $title, 'post_content' =>$frame, 'post_status' => 'publish', 'post_author' => 1, 'tags_input' => $tag, 'post_excerpt'=> $excerpt, 'comment_status'=>'open', 'post_category' => array(760) )); if ($post_id) { // insert post meta add_post_meta($post_id, 'Featured Image', $image); add_post_meta($post_id, 'Video Link', $videolink); } }



 
 
}

?>


Hope this helps.Thnks








Tuesday 15 October 2013

Create Change Password Module in codeigniter

Simple change password in code ignitor,if you r using md5 to store password....

1.In your view folder,make a .php file with name changepassword. and add this content.

<?php $this->load->library('form_validation');?>
<?php echo validation_errors();?>
<div class="content">

<?php echo form_open('main/changepwd'); ?>
<table class=”table table-bordered”>

<tbody>

<tr>
<td><small><?php echo "Old Password:";?></small></td>
<td><?php echo form_password('opassword');?></td>

</tr>
<tr>
<td><small><?php echo "New Password:";?></small></td>
<td><?php echo form_password('npassword');?></td>

</tr>
<tr>
<td><small><?php echo "Confirm Password:";?></small></td>
<td><?php echo form_password('cpassword');?></td>
</tr>
</tbody>
</table>
&nbsp;&nbsp;<div id="some"style="position:relative;"><button type="submit" class="btn btn-primary"><i class=" icon-ok-sign icon-white"></i>&nbsp;Submit</button>

<?php

echo form_close();

?>
</div>

2.Now make a controller to check your password if it is correct or not.Name it main.php.place it in folder 'controller'.add this content.


<?php

class Main extends CI_Controller {

public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('form_validation');

}

    public function changepwd()

{

    $this->load->library('form_validation');
    $this->form_validation->set_rules('opassword','Old Password','required|trim|xss_clean|callback_change');
    $this->form_validation->set_rules('npassword','New Password','required|trim');
    $this->form_validation->set_rules('cpassword','Confirm Password','required|trim|matches[npassword]');

    if ($this->form_validation->run() == FALSE)

    {
         
  echo validation_errors();


    }

 
    }


     public function change() // we will load models here to check with database

 
{


     $session_data = $this->session->userdata('logged_in');

     $query=$this->db->query("select * from user where id=".$session_data['id']);

     foreach ($query->result() as $my_info) {

     $db_password = $my_info->password;

     $db_id = $my_info->id;


     }

     if ((md5($this->input->post('opassword',$db_password)) == $db_password) && ($this->input->post('npassword') != '') && ($this->input->post('cpassword')!='')) {

$fixed_pw = md5($this->input->post('npassword'));

     $update = $this->db->query("Update user SET password='$fixed_pw' WHERE id='$db_id'")or die(mysql_error());

     $this->form_validation->set_message('change','<div class="alert alert-success"><a href="#" class="close" data-dismiss="alert">&times;</a>
<strong>Password Updated!</strong></div>');
return false;
   

     }
   else  {
$this->form_validation->set_message('change','<div class="alert alert-error"><a href="#" class="close" data-dismiss="alert">&times;</a>
  <strong>Wrong Old Password!</strong> </div>');

return false;

}
}
}
?>

That's it. now run your view file(Changepassword.php) using an another function.
Please comment if this helpful.Goodluck

Tuesday 8 October 2013

How to fetch data from two tables in mysql (Codeignitor)?

How to fetch data from two tables in mysql (Codeignitor)?








$query = $this ->db->query("SELECT * FROM Table-1 WHERE id = (SELECT qid FROM Table-2  where post_status ='active' AND post_type= 'quick') ");
return $query->result_array();

Please like n share if this is helpful !!!

Tuesday 13 August 2013

Javascript email validation ..

For Javascript email validation

Put This in code
(Form onsubmit="return validateForm()") this should be the submit value for form and then this code

<input name="email" placeholder="Email" type="text" class="textField" id="email" value=""/>


Now javascript fuction

<script type="text/javascript">   
function validateForm()
{
var email = document.getElementById('email');
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value)) {
            alert('Please provide a valid email address');
            email.focus;
            return false;
 }
else {
  return true;     
     
  }
}
</script> 



Date picker in php

Js to be included in header or just before the end of body tag

<script>
    var datePickerDivID = "datepicker";
var iFrameDivID = "datepickeriframe";
var dayArrayShort = new Array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa');
var dayArrayMed = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var dayArrayLong = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
var monthArrayShort = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
var monthArrayMed = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');
var monthArrayLong = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var defaultDateSeparator = "-";
var defaultDateFormat = "dMy";
var dateSeparator = defaultDateSeparator;
var dateFormat = defaultDateFormat;
function displayDatePicker(dateFieldName, displayBelowThisObject, dtFormat, dtSep) {
var targetDateField = document.getElementsByName(dateFieldName).item(0);
if (!displayBelowThisObject) displayBelowThisObject = targetDateField;
if (dtSep) dateSeparator = dtSep;
else dateSeparator = defaultDateSeparator; if (dtFormat) dateFormat = dtFormat;
else dateFormat = defaultDateFormat;
var x = displayBelowThisObject.offsetLeft;
var y = displayBelowThisObject.offsetTop + displayBelowThisObject.offsetHeight;
var parent = displayBelowThisObject;
while (parent.offsetParent) {
parent = parent.offsetParent;
x += parent.offsetLeft;
y += parent.offsetTop
}
drawDatePicker(targetDateField, x, y)
}
function drawDatePicker(targetDateField, x, y) {
var dt = getFieldDate(targetDateField.value);
if (!document.getElementById(datePickerDivID)) {
var newNode = document.createElement("div");
newNode.setAttribute("id", datePickerDivID);
newNode.setAttribute("class", "dpDiv");
newNode.setAttribute("style", "visibility: hidden;");
document.body.appendChild(newNode)
}
var pickerDiv = document.getElementById(datePickerDivID);
pickerDiv.style.position = 'absolute';
pickerDiv.style.left = x + "px";
pickerDiv.style.top = y + "px";
pickerDiv.style.visibility = (pickerDiv.style.visibility == "visible" ? "hidden" : "visible");
pickerDiv.style.display = (pickerDiv.style.display == "block" ? "none" : "block");
pickerDiv.style.zIndex = 10000;
refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate())
}
function refreshDatePicker(dateFieldName, year, month, day) {
var thisDay = new Date();
if ((month >= 0) && (year > 0)) {
thisDay = new Date(year, month, 1)
} else {
day = thisDay.getDate();
thisDay.setDate(1)
}
var crlf = "\r\n";
var TABLE = "<table cols=7 class='dpTable'>" + crlf;
var xTABLE = "</table>" + crlf;
var TR = "<tr class='dpTR'>";
var TR_title = "<tr class='dpTitleTR'>";
var TR_days = "<tr class='dpDayTR'>";
var TR_todaybutton = "<tr class='dpTodayButtonTR'>";
var xTR = "</tr>" + crlf;
var TD = "<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' ";
var TD_title = "<td colspan=5 class='dpTitleTD'>";
var TD_buttons = "<td class='dpButtonTD'>";
var TD_todaybutton = "<td colspan=7 class='dpTodayButtonTD'>";
var TD_days = "<td class='dpDayTD'>";
var TD_selected = "<td class='dpDayHighlightTD' onMouseOut='this.className=\"dpDayHighlightTD\";' onMouseOver='this.className=\"dpTDHover\";' ";
var xTD = "</td>" + crlf;
var DIV_title = "<div class='dpTitleText'>";
var DIV_selected = "<div class='dpDayHighlight'>";
var xDIV = "</div>";
var html = TABLE;
html += TR_title;
html += TD_buttons + getButtonCode(dateFieldName, thisDay, -1, "&lt;") + xTD;
html += TD_title + DIV_title + monthArrayLong[thisDay.getMonth()] + " " + thisDay.getFullYear() + xDIV + xTD;
html += TD_buttons + getButtonCode(dateFieldName, thisDay, 1, "&gt;") + xTD;
html += xTR;
html += TR_days;
for (i = 0; i < dayArrayShort.length; i++) html += TD_days + dayArrayShort[i] + xTD;
html += xTR;
html += TR;
for (i = 0; i < thisDay.getDay(); i++) html += TD + "&nbsp;" + xTD;
curdate=new Date();
var nowdate=new Date(curdate.getFullYear(), curdate.getMonth(), curdate.getDate());
var mnthafter15=new Date(curdate.getFullYear(), curdate.getMonth(), curdate.getDate());
mnthafter15.setMonth(mnthafter15.getMonth()+12);
do {
dayNum = thisDay.getDate();
var curdivdate=new Date(thisDay.getFullYear(), thisDay.getMonth(), thisDay.getDate());
var staus=1;
if(curdivdate<nowdate || curdivdate>mnthafter15)
{
staus=0;
}
if(staus==1)
{
TD_onclick = " <td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' onclick=\"updateDateField('" + dateFieldName + "', '" + getDateString(thisDay) + "');var js=document.getElementById('" + dateFieldName + "');if(js.value!=js.defaultValue && js.value!=js.title){ht_bl1(js);}\";>";
}
else
{
TD_onclick = "<td class='dpTD' style='color:#cccccc' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' >";
}
if (dayNum == day) html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
else html += TD + TD_onclick + dayNum + xTD; if (thisDay.getDay() == 6) html += xTR + TR;
thisDay.setDate(thisDay.getDate() + 1)
} while (thisDay.getDate() > 1) if (thisDay.getDay() > 0) {
for (i = 6; i > thisDay.getDay(); i--) html += TD + "&nbsp;" + xTD
}
html += xTR;
var today = new Date();
var todayString = "Today is " + dayArrayMed[today.getDay()] + ", " + monthArrayMed[today.getMonth()] + " " + today.getDate();
html += TR_todaybutton + TD_todaybutton;
html += "<button class='dpTodayButton' onClick='refreshDatePicker(\"" + dateFieldName + "\");'>this month</button> ";
html += "<button class='dpTodayButton' onClick='updateDateField(\"" + dateFieldName + "\");'>close</button>";
html += xTD + xTR;
html += xTABLE;
document.getElementById(datePickerDivID).innerHTML = html
}
function getButtonCode(dateFieldName, dateVal, adjust, label) {
var newMonth = (dateVal.getMonth() + adjust) % 12;
var newYear = dateVal.getFullYear() + parseInt((dateVal.getMonth() + adjust) / 12);
if (newMonth < 0) {
newMonth += 12;
newYear += -1
}
return "<button class='dpButton' onClick='refreshDatePicker(\"" + dateFieldName + "\", " + newYear + ", " + newMonth + ");'>" + label + "</button>"
}
function getDateString(dateVal) {
var dayString = "00" + dateVal.getDate();
var monthString = "00" + (dateVal.getMonth() + 1);
dayString = dayString.substring(dayString.length - 2);
monthString = monthArrayShort[dateVal.getMonth()];
switch (dateFormat) {
case "dmy":
return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear();
case "dMy":
return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear();
case "ymd":
return dateVal.getFullYear() + dateSeparator + monthString + dateSeparator + dayString;
case "mdy":
default:
return monthString + dateSeparator + dayString + dateSeparator + dateVal.getFullYear()
}
}
function getFieldDate(dateString) {
var dateVal;
var dArray;
var d, m, y;
try {
dArray = splitDateString(dateString);
if (dArray) {
switch (dateFormat) {
case "dmy":
d = parseInt(dArray[0], 10);
m = parseInt(dArray[1], 10) - 1;
y = parseInt(dArray[2], 10);
break;
case "ymd":
d = parseInt(dArray[2], 10);
m = parseInt(dArray[1], 10) - 1;
y = parseInt(dArray[0], 10);
break;
case "mdy":
default:
d = parseInt(dArray[1], 10);
m = parseInt(dArray[0], 10) - 1;
y = parseInt(dArray[2], 10);
break
}
dateVal = new Date(y, m, d)
} else if (dateString) {
dateVal = new Date(dateString)
} else {
dateVal = new Date()
}
} catch (e) {
dateVal = new Date()
}
return dateVal
}
function splitDateString(dateString) {
var dArray;
if (dateString.indexOf("/") >= 0) dArray = dateString.split("/");
else if (dateString.indexOf(".") >= 0) dArray = dateString.split(".");
else if (dateString.indexOf("-") >= 0) dArray = dateString.split("-");
else if (dateString.indexOf("\\") >= 0) dArray = dateString.split("\\");
else return dArray
}
function getMonthindex(monthname) {
for (var i in monthArrayShort) {
if (monthArrayShort[i] == monthname) {
return i
}
}
}
function updateDateField(dateFieldName, dateString) {
if (typeof dateString != 'undefined') {
var mydate = new Date();
var m1 = mydate.getMonth();
var y1 = mydate.getFullYear();
var d1 = mydate.getDate();
var dateString_array = dateString.split("-");
if (dateString_array[2] < y1) {
alert('You can\'t select the date before Current Date');
updateDateField(dateFieldName);
document.getElementById(dateFieldName).focus();
return
} else {
if (dateString_array[2] == y1) {
if (getMonthindex(dateString_array[1]) < m1) {
alert(na86);
closeCalendar();
document.getElementById(formname).focus();
return
} else {
if (getMonthindex(dateString_array[1]) == m1) {
if (dateString_array[0] == d1) {
if (confirm(na87)) {} else {
updateDateField(dateFieldName);
document.getElementById(dateFieldName).focus();
return
}
} else if (dateString_array[0] < d1) {
alert(na86);
updateDateField(dateFieldName);
document.getElementById(dateFieldName).focus();
return
}
}
}
}
}
}
var targetDateField = document.getElementsByName(dateFieldName).item(0);
if (dateString) targetDateField.value = dateString;
var pickerDiv = document.getElementById(datePickerDivID);
pickerDiv.style.visibility = "hidden";
pickerDiv.style.display = "none";
targetDateField.focus();
if ((dateString) && (typeof (datePickerClosed) == "function")) datePickerClosed(targetDateField)
}
function adjustiFrame(pickerDiv, iFrameDiv) {
var is_opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
if (is_opera) return;
try {
if (!document.getElementById(iFrameDivID)) {
var newNode = document.createElement("iFrame");
newNode.setAttribute("id", iFrameDivID);
newNode.setAttribute("scrolling", "no");
newNode.setAttribute("frameborder", "0");
document.body.appendChild(newNode)
}
if (!pickerDiv) pickerDiv = document.getElementById(datePickerDivID);
if (!iFrameDiv) iFrameDiv = document.getElementById(iFrameDivID);
try {
iFrameDiv.style.position = "absolute";
iFrameDiv.style.width = pickerDiv.offsetWidth + 'px';
iFrameDiv.style.height = pickerDiv.offsetHeight + 'px';
iFrameDiv.style.top = pickerDiv.style.top;
iFrameDiv.style.left = pickerDiv.style.left;
iFrameDiv.style.zIndex = pickerDiv.style.zIndex - 1;
iFrameDiv.style.visibility = pickerDiv.style.visibility;
iFrameDiv.style.display = pickerDiv.style.display
} catch (e) {}
} catch (ee) {}
}
    </script>






Php Code to be used in Table for getting date and calender icon

 <span>
<input id="tarrival1" onclick="displayDatePicker('tarrival1');" name="tarrival1" readonly="readonly" placeholder="Arrival" style="width:110px;margin:0px;">
</span>

<span>
  <img id="#" align="top" style="cursor:pointer;padding-left:1px" onclick="displayDatePicker('tarrival1');return false;" src="<?php echo $this->baseurl ?>templates/home_template/calender/calendar.gif" alt="Pick a date."  readonly onclick="return check();>      </span>



Thats it View Demo

Saturday 3 August 2013

For showing faces with facebook like button in php page or html

For showing faces with facebook like button in php page or html


use this

<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2FYOURFACEBOOKPAGENAME&amp;width=270&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=false&amp;header=false&amp;height=330" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:270px; height:330px;" allowTransparency="true"></iframe>
How to get Article content ,article title and article alias in Joomla 1.5.19.

here is the solution

<?php
$article =& JTable::getInstance("content");
$article->load('Your article ID');
echo $article->get("title");
echo $article->get("introtext");
echo $article->get("alias");     
?>

Hope this will help !