$url = explode('?', 'http://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
$ID = url_to_postid($url[0]);
echo $ID;
Showing posts with label Id. Show all posts
Showing posts with label Id. Show all posts
Thursday, January 2, 2014
Wordpress-Get Post ID in functions.php
Labels:
functions.php,
Id,
post,
postid,
to,
url,
url_to_postid,
wordpress
Sunday, June 9, 2013
Cakephp/PHP-Maintaing Pagination id's in sequance for each page
Cakephp/PHP-Logic,Setting Pagination id's in sequance
$paginationdata=$this->Paginator->params();
$currentpage=$this->Paginator->current();
foreach($data as ($key=>$value))
{
echo ($paginationdata['limit']*($currentPage-1))+$key+1;
}
Now for any page id's will start according to selected page for example for first page on a limit 5...1,2,3,4,5
on second page limit 5.....6,7,8,9.10
Sunday, May 12, 2013
Social Engine-Get User level,id
Social Engine 4
Get User level
//Get User Level
$userEngine_Api::_()->user()->getViewer()->level_id.
//Get User Id
$UserEngine_Api::_()->user()->getViewer()->getIdentity
Get User level
//Get User Level
$userEngine_Api::_()->user()->getViewer()->level_id.
//Get User Id
$UserEngine_Api::_()->user()->getViewer()->getIdentity
Friday, May 3, 2013
Social Engine 4-Get User Info
$user_id=Engine_Api::()_->user()->getviewer()->getIdentity();
$user_info=Engine_Api::_()->user()->getUser($user_id);
Then you get an array $user_info
Now to get let us suppose email of user we use
$user_info['email'];
print_r($user_info) to get data array and check other key's
The other keys are
$user_info=Engine_Api::_()->user()->getUser($user_id);
Then you get an array $user_info
Now to get let us suppose email of user we use
$user_info['email'];
print_r($user_info) to get data array and check other key's
The other keys are
- user_id
- username
- displayname
- photo_id
- status
- status_date
- password
- salt
- locale
- language
- timezone
- search
- show_profileviews
- level_id
- invites_used
- extra_invites
- enabled
- verified
- approved
- creation_date
- creation_ip
- modified_date
- lastlogin_date
- lastlogin_ip
- update_date
- member_count
- view_count
Tuesday, October 2, 2012
document.getElementByid(id)=>shortcut
Use eval(id)
for example
eval("myelement")
returns an element with id "myelement"
for example
eval("myelement")
returns an element with id "myelement"
Subscribe to:
Posts (Atom)