function api($apicode = null) { $user = performAction('logs', 'isLogin', array()); if ($apicode == null) { header('location:' . BASE_PATH . 'followers/api_guide'); } else { switch ($apicode) { case 'getFollower': $fol = $this->Follower->getFollower($user['id']); $arr = array(); foreach ($fol as $i) { $user = performAction('users', 'getUser', array($i['A']['to_id'])); print_r($user); array_push($arr, $user); } break; case 'getFollowing': $fol = $this->Follower->getFollowing($user['id']); $arr = array(); foreach ($fol as $i) { array_push($arr, performAction('users', 'getUser', array($i['A']['to_id']))); } break; case 'addFollower': $this->addFollower($user['id'], $_POST['id']); break; case 'blockFollower': $this->blockFollower($_POST['id'], $user['id']); break; case 'unfollow': $this->unfollow($user['id'], $_POST['id']); break; } echo json_encode(array('res' => $arr)); $this->doNotRenderHeader = 1; } }
function beforeAction() { performAction('webmaster', 'updateStatistics'); }
<li>Name: <input type="text" size="8" name="username" tabindex="1" /> </li> <li>Pass: <input type="password" size="7" name="password" tabindex="2" /> </li> <li><input type="submit" name="login_submit" value="Log in" tabindex="3" /> </li> </form> </ul> <?php } ?> </div><!-- end div#login --> <div id="content"> <div id="left"> <?php echo performAction('archmenu', 'index', true); ?> </div><!-- end #left --> <div id="right"> <?php if (isset($_SESSION['logged_in'])) { ?> <div id="blogAddForm"> <h2 id="addAnEntry">Add an Entry</h2> <div id="addForm"> <div class="main"> <p><input type="text" value="title" id="addFormTitle"/></p>
function upload() { if ($_FILES['img']['name'] != '') { // if fields not empty! $user = performAction('logs', 'isLogin', array()); $id = $user['id']; $title = $_POST['title']; $lat = $_POST['lat']; $lng = $_POST['lng']; $message = $_POST['message']; $query = "insert into events (title, account_id, lat, lng, message, category, datetime)\r\n\t\t\t\t\tvalues ('{$title}', '{$id}' , {$lat}, {$lng},'{$message}',{$category_id},now())"; $this->Event->custom($query); $lastid = mysql_insert_id(); $fileupload = $_FILES['img']['name']; $this->Event->custom($query); $filename = strtolower($fileupload); $exts = split("[/\\.]", $filename); $n = count($exts) - 1; $ext = $exts[$n]; $file_Big = "{$lastid}" . "." . $ext; $file_Thumb = "{$lastid}" . "_t." . $ext; $query = "update events set img_path ='{$file_Big}' where id = '{$lastid}'"; move_uploaded_file($_FILES['img']["tmp_name"], BASE_PATH . "public/images/" . $file_Big); return true; } else { return false; } }
function view_by_tag($queryArray) { $this->doNotRenderHeader = $queryArray[0]; # set to '0' in routing.php array_shift($queryArray); $this->set('isAjax', $this->doNotRenderHeader); # get the id for the tag_nm in the url $this->Tag->where('tag_nm', $queryArray[0]); $tagInfo = $this->Tag->search(); $id = $tagInfo[0]['Tag']['id']; # get the entries for this tag id $this->Tag->id = $id; $this->Tag->showHMABTM(); $data = $this->Tag->search(); //$this->set('blog', $data['Entry']); $this->set('tag', $data['Tag']); # build array of entryIds for this tag $entryIds = array(); foreach ($data['Entry'] as $entry) { array_push($entryIds, $entry['Entry']['id']); } # set the current page number if (count($queryArray) < 2 || $queryArray[count($queryArray) - 2] != 'page') { $currentPageNumber = 1; } else { $currentPageNumber = $queryArray[count($queryArray) - 1]; $queryArray = array_slice($queryArray, 0, -2); } # get blog data $data2 = performAction('blog', 'findBlogTagsForEntries', array('entryIds' => $entryIds, 'currentPageNumber' => $currentPageNumber)); # set variables for the view $this->set('totalPages', $data2['totalPages']); $this->set('currentPageNumber', $currentPageNumber); array_unshift($queryArray, 'tag'); $this->set('url', implode("/", $queryArray)); $this->set('blog', $data2['data']); #print_r($data); #Array ( [Tag] => # Array ( [id] => 37 # [tag_nm] => yoga ) # [Entry] => # Array ( [0] => # Array ( [Entry] => # Array ( [id] => 2011/02/01/clarity # [time] => blah # [title] => Clarity # [entry] = > blah # [category] => yoga ) # [blog_tags] => # Array ( [entry_id] => 2011/02/01/clarity # [tag_id] => 37 ) ) # [1] => # Array ( [Entry] => # Array ( [id] => 2011/12/05/teaching # [time] => blah # [title] => Teaching # [entry] = > blah # [category] => yoga ) # [blog_tags] => # Array ( [entry_id] => 2011/12/05/teaching # [tag_id] => 37 ) ) ) ) }
$action = getStringFromRequest('action'); $user_id = getStringFromRequest('user_id'); if ($action == 'delete') { performAction('D', "DELETED", $user_id); //plugin webcal //del webcal user plugin_hook('del_cal_user', $user_id); } else { if ($action == 'activate') { performAction('A', "ACTIVE", $user_id); //plugin webcal //create webcal user plugin_hook('add_cal_user', $user_id); } else { if ($action == 'suspend') { performAction('S', "SUSPENDED", $user_id); } } } // Add a user to this group if (getStringFromRequest('action') == 'add_to_group') { echo "ACTION NOT SUPPORTED"; } // Show list of users print "<p>" . _('User list for group:'); if (!$group_id) { $user_name_search = getStringFromRequest('user_name_search'); print "<strong>" . _('All Groups') . "</strong>"; print "\n</p>"; if ($user_name_search) { $sql = 'SELECT user_name,lastname,firstname,user_id,status,add_date FROM users WHERE user_name ';
function beforeAction() { session_start(); $user = performAction('logs', 'isLogin', array()); }
break; default: $tempMessage = $translator->getMessage('COMMON_MESSAGETAG_ERROR'); break; } if ( !empty($command) and ( isOption($command,$tempMessage) or isOption($command,$translator->getMessage('INDEX_ACTION_SEND_MAIL_BUTTON')) ) ) { $correct = $form->check(); if ( $correct or !isset($_POST['with_mail']) ) { performAction($environment,$action_array,$_POST); if($environment->getCurrentModule() != 'user'){ redirect($action_array['backlink']['cid'],$action_array['backlink']['mod'],$action_array['backlink']['fct'],$action_array['backlink']['par']); } else { if($mail_success) { $params = array(); $params['environment'] = $environment; $params['with_modifying_actions'] = false; $detail_view = $class_factory->getClass(MAIL_VIEW,$params); unset($params); $detail_view->setFormalData($formal_data); $page->add($detail_view); } else { $params = array(); $params['environment'] = $environment; $params['with_modifying_actions'] = true;
function beforeAction() { $user = performAction('logs', 'isLogin', array()); }