Pages

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

  $url = explode('?', 'http://'.$_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);  
   $ID = url_to_postid($url[0]);  
   echo $ID;  

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

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


  1. user_id
  2. email
  3. username
  4. displayname
  5. photo_id
  6. status
  7. status_date
  8. password
  9. salt
  10. locale
  11. language
  12. timezone
  13. search
  14. show_profileviews
  15. level_id
  16. invites_used
  17. extra_invites
  18. enabled
  19. verified
  20. approved
  21. creation_date
  22. creation_ip
  23. modified_date
  24. lastlogin_date
  25. lastlogin_ip
  26. update_date
  27. member_count
  28. view_count

Tuesday, October 2, 2012

document.getElementByid(id)=>shortcut

Use eval(id)
for example

eval("myelement")

returns an element with id "myelement"