query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Set a flickr API key
public function setSecret($secret) { if (!empty($secret)) { $this->api_secret = $secret; return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAPIKey($key){\r\n\t\t$this->apiKey = $key;\r\n\t}", "public function setApikey()\n {\n $this->apiKey = Config::get('leanpub.API_KEY');\n }", "function update_flickr_api ($old_key, $new_key) {\n\t$rsp_obj = call_flickr_api_method(array(\n\t\t'api_key'\t=> $new_key,\n\t\t'method'\t=> 'flickr.test.echo'\n\t));\n\t_log($rsp_obj['stat']);\n\t// check if flickr saw the api key as valid and update if so\n\tif ($rsp_obj['stat'] == 'ok') {\n\t\t$_GLOBALS['flickr'] = new phpFlickr($new_key);\n\t\treturn $new_key;\n\t} else {\n\t\treturn $old_key;\n\t}\n}", "function set_api_key($api_key)\n\t{\n\t\t$this->api_key = $api_key;\n\t}", "function setApiKey($key){\n $this->key = $key;\n }", "public function setKey($key) {\n\t\t\tif(!empty($key)) $this->apiKey = $key;\n\t\t}", "public function setApiKey(string $api_key): void\n {\n $this->api_key = $api_key;\n }", "public function set_api_key($api_key)\n {\n $this->api_key = $api_key;\n }", "public static function setApiKey($key)\n {\n static::$key = $key;\n }", "private function set_key($sApiKey) {\r\n $this->key = $sApiKey;\r\n }", "public static function setApiKey($key)\n {\n self::$apiKey = (string) $key;\n }", "public function registerAPIKey()\n {\n acf_update_setting('google_api_key', $this->apiKey);\n }", "private function set_key($sApiKey) {\n $this->key = $sApiKey;\n }", "function auth_apikey($key){\n\t\n}", "public function setApiKey($apiKey);", "public function setApiKey($apiKey);", "public function setApiKey($api_key)\n {\n $this->api_key = $api_key;\n }", "private function setApikey($apikey) {\n\t\t$this->_apikey = (string) $apikey;\n\t}", "public function setAPIKey($domain, $key)\n\t{\n\t\t$this->getGMapClient()->setAPIKey($domain, $key, true);\n\t}", "public function setKey($apiKey)\n {\n $this->key = $apiKey;\n }", "public function setApiKey(string $apiKey): void\n {\n $this->apiKey = strval($apiKey);\n }", "public function setApiKey($apiKey){\n $this->apiKey=$apiKey;\n }", "private function setApiKey( $apiKey ) {\n\n $this->apiKey = $apiKey;\n }", "public function setApiKey($apiKey){\n\t\t$this->apiKey = $apiKey;\n\t}", "function it_gets_and_sets_the_key()\n {\n $this->getKey()->shouldReturn('apikey');\n\n // Set the api key\n $this->setKey('keyapi');\n\n // Get the current key\n $this->getKey()->shouldReturn('keyapi');\n }", "public function setKey(string $key);", "public static function setRandomApiKey()\n {\n if (!empty(self::getSetting('API_KEY'))) {\n return;\n }\n\n $randomKey = bin2hex(openssl_random_pseudo_bytes(16));\n\n Registry::getConfig()->saveShopConfVar('str', 'AVSHOPGUARDIANS_API_KEY', $randomKey, null, 'module:AvShopguardians');\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setAPIKey($value)\n {\n return $this->set('APIKey', $value);\n }", "public function setApiKey($api)\n {\n $this->api_key = $api;\n }", "public function applyNewApiKey()\n {\n $this->attributes['api_key'] = KeyGenerator::generateRandomKey();\n }", "final public function setApi($keys)\n {\n $keys = (array) $keys;\n\n $this->apiKey = $keys[array_rand($keys, 1)];\n }", "public function setKey($key);", "public function SetKey($key = ''){\n \tself::$userKey = $key;\n }", "public function setApiKey($apiKey) {\n\t\t$this->apiKey = $apiKey;\n\t}", "function __construct($api_key)\n {\n \\Tinify\\setKey($api_key);\n }", "public function setKey( $key )\r\n {\r\n $this->key = $key;\r\n }", "public function setAuth($key, $secret)\n {\n $this->apiKey = $key;\n $this->apiSecret = $secret;\n }", "function my_acf_init() {\t\n\tacf_update_setting('google_api_key', 'YOURAPIKEY');\n}", "public function setApiKey($apiKey)\n {\n $this->apiKey = $apiKey;\n }", "public function setApiKey($apiKey)\n {\n $this->apiKey = $apiKey;\n }", "public function setApiKey($value)\n {\n return $this->setParameter('apiKey', $value);\n }", "public function setApiKey($value)\n {\n return $this->setParameter('apiKey', $value);\n }", "public function setKey(?string $key): void\n {\n $this->key = $key;\n }", "public static function setKey($key){\n\t\tself::$_key = $key;\n\t}", "public function setKey($key)\n {\n $this->_key = $key;\n }", "public function setKey(?string $key): void\n {\n }", "public function setKey(string $key) : void {\n\t\t$this->key = $key;\n\t}", "public function setAPIKey($api_key)\n\t{\n\t\t$this->api_key = $api_key;\n\t\treturn $this;\n\t}" ]
[ "0.6859302", "0.67704034", "0.67102283", "0.66116", "0.65883595", "0.63411176", "0.6259039", "0.6244748", "0.6236644", "0.6233616", "0.62138116", "0.6138467", "0.6126337", "0.6103883", "0.6089475", "0.6089475", "0.6069907", "0.60031533", "0.5976162", "0.59668875", "0.5937213", "0.592876", "0.589566", "0.58795714", "0.5870868", "0.5831078", "0.58101755", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.5793242", "0.57436407", "0.5723456", "0.57016957", "0.56986594", "0.568541", "0.56787413", "0.56703097", "0.56555235", "0.5635134", "0.5587671", "0.5565601", "0.5565601", "0.5559656", "0.5559656", "0.5551346", "0.55428433", "0.5537602", "0.55326927", "0.55288595", "0.5512475" ]
0.0
-1
Set a flickr error
public function setError($message, $code = 0) { if (!empty($message)) { $this->err_message = $message; $this->err_code = $code; return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setError($err);", "function setError( $state);", "function set_error() \n {\n $this->error_state = FORMEX_FIELD_ERROR;\n }", "function error(){}", "public function errorOccured();", "private function setErrors()\n {\n $this->errors = [\n 'error_no' => curl_errno($this->curl),\n 'error' => curl_error($this->curl),\n ];\n }", "function set_error($err) {\n # Set Current Error Message\n $this->error_message = $err;\n\n # Add to Error Log\n $this->error_log[] = $err;\n\n # Increment Error Counter\n $this->error_count++;\n }", "protected function _set_error($error) {\r\n $this->error = $error;\r\n }", "public function error();", "public function set_error($error) {\n $this->error = $error;\n }", "private function setError($error) {\n $this->error = $error;\n }", "private function setError($value) {\r\n $this->debug('setError() was called with value: ' . $value);\r\n $this->error = $value;\r\n }", "public function setError($error)\n\t{\n\t\t$this->error = $error;\n\t}", "public function setError(PhingFile $f)\n {\n $this->error = $f;\n }", "function setError($message) {\n global $error;\n $error = (object) array(\n 'message' => $message\n );\n }", "protected function setError($error) {\n $this->error = $error;\n }", "public function markAsFailed();", "public function markError()\n {\n $this->setStatus(self::STATE_ERROR);\n }", "protected function setError($error) {\n self::$error = $error;\n }", "public static function setError($message)\n {\n self::put(\"error\", $message);\n }", "function setError($message)\n{\n\t$args = array_slice(func_get_args(), 1) ;\n\t$message = vsprintf($this->t($message), $args);\n\n\tif ($this->throwsExceptions) {\n\t\tthrow new AuthException($message);\n\t}\n\telse {\n\t\t$this->errors[] = $message;\n\t\t$this->onError($message);\n\t}\n}", "protected function setError($error) {\r\n $this->error = $error;\r\n }", "public function setErrors($error) {\n\t\t$params = $this->controller->request->params; \n\t\t$message = $error->getMessage();\n\t\t$url = $this->controller->request->here();\n\t\t$code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500;\n\t\t$this->controller->response->statusCode($code);\n\t\t$this->controller->set(array(\n\t\t\t'name' => $message,\n\t\t\t'message' => h($url),\n\t\t\t'error' => $error,\n\t\t));\n\t\tif(isset($params['admin'])){\n\t\t\t$this->controller->render('/Errors/admin_error','admin_login');\n\t\t}else{\n\t\t\techo \"asdsadsadsa\"; die;\n\t\t\t$this->controller->render('/Errors/error','error');\n\t\t}\n\t}", "public function setError($error)\n {\n $this->error = $error;\n }", "public function setError($error)\n {\n $this->error = $error;\n }", "public function setError($error)\n {\n $this->error = $error;\n }", "protected function error($message) { \n\t\t$this->error_found = true; \n\t\t$this->error_message = $message; \n\t}", "function add_settings_error($setting, $code, $message, $type = 'error')\n {\n }", "protected function setErrorsExist() {}", "public function setError($error) {\n \t$dbg = debug_backtrace();\n $caller = next($dbg);\n \t$this->error = sprintf('[%s::%s - %s] %s', basename($caller['file']), $caller['function'], $caller['line'], $error);\n }", "protected function setError($error) {\n $this->error = $error;\n }", "abstract public function error();", "public static function error($callback) {\n self::$error_callback = $callback;\n }", "protected function _error($error = '')\n {\n $this->_error = $error;\n }", "public function set_404()\n {\n }", "public static function set_error($error = NULL)\n\t{\n\t\tSession::instance()->set_flash('error', $error);\n\t}", "function getError();", "function getError();", "public function setError($value) {\n return $this->set(self::ERROR, $value);\n }", "public function setError($value) {\n return $this->set(self::ERROR, $value);\n }", "function error($code_or_codes, $callback = NULL)\n{\n\n}", "public function get_error();", "public function get_error();", "function setOnOptionsError($error) {\n\t\t$this->on_options_error = $error;\n\t}", "function PushError($fctname, $msg, $desc = \\false)\n {\n }", "public function errorMode(){}", "private function error($response) {\n\t\tif(property_exists($response, \"error\") AND $response->code != 200) {\n\t\t\tthrow new MystoreAPI_exception(\"Error \".$response->code.\"<br />\".$response->error->message);\n\t\t}\n\t}", "protected function setErrorClassAttribute() {}", "private function setLastError($err) {\n $_SESSION['last_login_error']=$err;\n }", "public function error(){\n\t}", "private function _set_error($error)\n {\n // set error message in $_error property\n $this->_error = $error;\n\n return;\n }", "public function setError(string $name, string $error): void\n {\n $this->getInputFilter()->setMessage($name, $error);\n }", "protected function setError($message, $code)\n\t{\n\t\t$this->error = true;\n\t\t$this->errorMessage = $message;\n\t\t$this->errorCode = $code;\n\t}", "function __set_error($error_code = null, $error_message = null,\n $error_details = null) {\n\n $this->error_code = $error_code;\n $this->error_message = $error_message;\n $this->error_details = $error_details;\n\n}", "protected function errorAction() {}", "protected function setError(string $err, $value)\n {\n if (!Util::isNumeric($value))\n $value = '\"' . $value . '\"';\n\n $this->_error_bag[$this->_field] = preg_replace_callback(\n '/\\{([^}]+)\\}/', function($matches) use ($value) {\n $capture = $matches[1];\n\n switch(strtolower($capture))\n {\n case 'this':\n return $value;\n\n case '_this':\n return $this->_field;\n\n case '_index':\n return $this->_index + 1;\n }\n }, $err);\n $this->_succeeds = false;\n return false;\n }", "protected function set_error( $code, $message) {\n\t\t$this->errors->add($code, $message);\n\t}", "public function setErr($value)\n {\n return $this->set(self::ERR, $value);\n }", "public function setErr($value)\n {\n return $this->set(self::ERR, $value);\n }", "protected function setError($error) {\n global $database;\n $this->error = $error;\n $this->log[self::LOG_STATUS] = self::STATUS_ERROR;\n $this->log[self::LOG_MESSAGE] = addslashes($error);\n $this->writeLog();\n }", "function setErrors( array $errors );", "public function setError($error) {\n if (is_array($this->errors)) {\n $this->errors = $error;\n }\n }", "protected function setError($msg)\n {\n }", "function pushError( $error );", "public function error()\n\t{\n\t}", "function rest_show_error($code = NULL, $message = NULL, $override = FALSE)\r\n\t{\r\n\t\tif ($override == FALSE) {\r\n\t\t\tif (array_key_exists ( $code, $this->errors )) {\r\n\t\t\t\t$message = $this->errors [$code];\r\n\t\t\t} else {\r\n\t\t\t\t$message = ($code != NULL) ? ($message != NULL) ? $message : 'Unknown error.' : $this->errors ['400'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($this->response_format == \"json\"){\r\n\t\t\texit(json_encode(\r\n\t\t\t\t\tarray (\r\n\t\t\t\t\t'code' => $code, \r\n\t\t\t\t\t'message' => $message \r\n\t\t\t\t\t)\r\n\t\t\t));\t\r\n\t\t}\r\n\t\t$result = $this->load->view ( 'api/rest/error', array (\r\n\t\t\t\t'code' => $code, \r\n\t\t\t\t'message' => $message \r\n\t\t), TRUE );\r\n\t\texit($result);\r\n\t}", "protected function getLastError() {}", "public function setERROR($ERROR)\n {\n $this->ERROR = $ERROR;\n }", "public function setException($err) {\n $this->exception = $err;\n }", "public function setFailed()\n {\n $this->update(['status' => static::STATUS_FAILED]);\n }", "public function Access_error ()\n\t\t{\n\t\t\t$errMsg[0]['error'] = \"Invalid URL!\";\n\t\t\treturn json_encode ($errMsg);\n\t\t}", "public function errors();", "public function errors();", "public function error(BaseResponse $response);", "function setError($code = 1, $message = 'An unknown error occured.', $debug = '') {\r\n\t\t$this->errorCode = $code;\r\n\t\t$this->errorMessage = $message;\r\n\t\tif (DEBUG) {\r\n\t\t\t$this->errorMessage .= $debug;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function setErrorKey($name)\n\t{\n\t\treturn $this->setKey('errors', $name);\n\t}", "public function getLastError();", "public static function setErrorPage($page)\n {\n static::$errorPage = $page;\n }", "function lastError();", "function setStdError($error_short_name){\r\n\t\t$select = \"SELECT err_str, error_code FROM error_codes\r\n\t\t\tWHERE err_str = ?\";\r\n global $pdo;\r\n\t\t$stmt = $pdo->prepare($select);\r\n\t\t$stmt->execute(array($error_short_name));\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$this->setError($row['err_str']);\r\n\t\t$this->setErrorCode($row['error_code']);\r\n\t}", "function gtk_error($str) {\n\t\t// http://aspn.activestate.com/ASPN/Mail/Message/php-gtk-general/2253469\n\t\t$red=&new GdkColor('#FF0000');\n\t\t$style=$this->label_filename->style;\n\t\t$style=$style->copy();\n\t\t$style->fg[0] = $red;\n\t\t$this->label_filename->set_style($style);\n\t\t// change text\n\t\t$this->label_filename->set_text($str);\n\t\techo 'Fatal error : '.$str.\"\\n\";\n\t\t// define IN_ERROR so all events will stop\n\t\tdefine('IN_ERROR',true);\n\t}", "function PopError()\n {\n }", "function customError($errno, $errstr)\n {\n echo \"<b>Error:</b> [$errno] $errstr\";\n }", "function customError($errno, $errstr)\n {\n echo \"<b>Error:</b> [$errno] $errstr\";\n }", "private function setError() {\n\t\t$this->is_valid = false;\n\n\t\t// Remove the last invalid interval.\n\t\tarray_pop($this->intervals);\n\n\t\tif (!isset($this->source[$this->pos])) {\n\t\t\t$this->error = _('unexpected end of interval');\n\n\t\t\treturn;\n\t\t}\n\n\t\tfor ($i = $this->pos, $chunk = '', $maxChunkSize = 50; isset($this->source[$i]); $i++) {\n\t\t\tif (0x80 != (0xc0 & ord($this->source[$i])) && $maxChunkSize-- == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$chunk .= $this->source[$i];\n\t\t}\n\n\t\tif (isset($this->source[$i])) {\n\t\t\t$chunk .= ' ...';\n\t\t}\n\n\t\t$this->error = _s('incorrect syntax near \"%1$s\"', $chunk);\n\t}", "public function errorPull() {}", "function setErrorCode($error_code){\r\n\t\t$this->error_code = $error_code;\r\n\t}", "abstract public function getLastError();", "abstract public function getLastError();", "public function setError($msg) {\n $this->__isError = true;\n $this->__errorMsg = $msg;\n }", "function magpie_error ($errormsg=\"\") {\n global $MAGPIE_ERROR;\n \n if ( isset($errormsg) and $errormsg ) { \n $MAGPIE_ERROR = $errormsg;\n }\n \n return $MAGPIE_ERROR; \n}", "function msgsrv_last_error () {}", "function Error($error)\n {\n \t$override = 0;\n \t\n \t//-----------------------------------------\n \t// Showing XML / AJAX functions?\n \t//-----------------------------------------\n \t\n \tif ( $this->input['act'] == 'xmlout' )\n \t{\n \t\t@header( \"Content-type: text/plain\" );\n\t\t\tprint 'error';\n\t\t\texit();\n\t\t}\n \t\n \t//-----------------------------------------\n \t// Initialize if not done so yet\n \t//-----------------------------------------\n \t\n \tif ( isset($error['INIT']) AND $error['INIT'] == 1)\n \t{\n \t\t$this->quick_init();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session_id = $this->my_session;\n\t\t}\n\t\t\n\t\tif ( !isset($this->compiled_templates['skin_global']) OR !is_object( $this->compiled_templates['skin_global'] ) )\n\t\t{\n\t\t\t$this->load_template('skin_global');\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get error words\n\t\t//-----------------------------------------\n\t\t\n \t$this->load_language('lang_error');\n \t\n \tlist($em_1, $em_2) = explode( '@', $this->vars['email_in'] );\n \t\n \t$msg = $this->lang[ $error['MSG'] ];\n \t\n \t//-----------------------------------------\n \t// Extra info?\n \t//-----------------------------------------\n \t\n \tif ( isset($error['EXTRA']) AND $error['EXTRA'] )\n \t{\n \t\t$msg = str_replace( '<#EXTRA#>', $error['EXTRA'], $msg );\n \t}\n \t\n \t//-----------------------------------------\n \t// Show error\n \t//-----------------------------------------\n \t\n \t$html = $this->compiled_templates['skin_global']->Error( $msg, $em_1, $em_2, 1);\n \t\n \t//-----------------------------------------\n \t// If we're a guest, show the log in box..\n \t//-----------------------------------------\n \t\n \tif ($this->member['id'] == \"\" and $error['MSG'] != 'server_too_busy' and $error['MSG'] != 'account_susp')\n \t{\n \t\t$safe_string = $this->base_url . str_replace( '&amp;', '&', $this->parse_clean_value($this->my_getenv('QUERY_STRING')) );\n \t\t\n \t\t$html = str_replace( \"<!--IBF.LOG_IN_TABLE-->\", $this->compiled_templates['skin_global']->error_log_in( str_replace( '&', '&amp;', $safe_string ) ), $html);\n \t\t$override = 1;\n \t}\n \t\n \t//-----------------------------------------\n \t// Do we have any post data to keepy?\n \t//-----------------------------------------\n \t\n \tif ( $this->input['act'] == 'Post' OR $this->input['act'] == 'Msg' OR $this->input['act'] == 'calendar' )\n \t{\n \t\tif ( $_POST['Post'] )\n \t\t{\n \t\t\t$post_thing = $this->compiled_templates['skin_global']->error_post_textarea($this->txt_htmlspecialchars($this->txt_stripslashes($_POST['Post'])) );\n \t\t\t\n \t\t\t$html = str_replace( \"<!--IBF.POST_TEXTAREA-->\", $post_thing, $html );\n \t\t}\n \t}\n \t\n \t//-----------------------------------------\n \t// Update session\n \t//-----------------------------------------\n \t\n \t$this->DB->do_shutdown_update( 'sessions', array( 'in_error' => 1 ), \"id='{$this->my_session}'\" );\n \t\n \t//-----------------------------------------\n \t// Print\n \t//-----------------------------------------\n \t\n \t$print = new display();\n \t$print->ipsclass =& $this;\n \t\n \t$print->add_output($html);\n \t\t\n \t$print->do_output( array( 'OVERRIDE' => $override, 'TITLE' => $this->lang['error_title'] ) );\n }", "public function error($str);", "public function errorcode();", "public function setErrorCode($value)\n {\n $this->_errorCode = $value;\n }", "public function setError(string $value = ''): Response {\n\t\t$this->error = $value;\n\n\t\treturn $this;\n\t}", "private function error()\n {\n $json = array_merge($this->data, ['message' => $this->error, 'class' => 'error']);\n wp_send_json($json);\n }", "function crit_error($error) { }", "public function Error($err){\n\t\t$this->Add($err->getMessage());\n\t}", "public function Error($err){\n\t\t$this->Add($err->getMessage());\n\t}" ]
[ "0.6887219", "0.6399024", "0.63132185", "0.6237573", "0.61199003", "0.61127436", "0.6044766", "0.59785855", "0.59755397", "0.5969495", "0.59621996", "0.5954956", "0.5916016", "0.59156513", "0.59107554", "0.5904835", "0.59013087", "0.58662814", "0.585276", "0.58182335", "0.581349", "0.5803114", "0.5788736", "0.57875085", "0.57875085", "0.57875085", "0.5780969", "0.5751453", "0.57496786", "0.5737077", "0.5729345", "0.5719968", "0.5682651", "0.5678005", "0.5648652", "0.56138164", "0.5603956", "0.5603956", "0.5592171", "0.5592171", "0.5562957", "0.5549932", "0.5549932", "0.5549183", "0.5546557", "0.55448866", "0.5531944", "0.55280155", "0.55192816", "0.5517008", "0.5513895", "0.5507553", "0.55051774", "0.5503347", "0.5503218", "0.55009645", "0.54970187", "0.54887664", "0.54887664", "0.5478329", "0.54744285", "0.5453624", "0.54092", "0.53991544", "0.5396937", "0.5394931", "0.5393933", "0.53916353", "0.5384855", "0.53788006", "0.5374408", "0.53710085", "0.53710085", "0.5367458", "0.536679", "0.5364069", "0.5357468", "0.5350354", "0.5350128", "0.5348754", "0.53368294", "0.53296447", "0.5327513", "0.5327513", "0.53202266", "0.53167", "0.5313637", "0.53113306", "0.53113306", "0.53103876", "0.5308071", "0.5305146", "0.5305001", "0.5303884", "0.53001285", "0.5299912", "0.52982676", "0.5297477", "0.52913886", "0.5281901", "0.5281901" ]
0.0
-1
Get a flickr error
public function getError() { $error = array(); $error['message'] = $this->err_message; $error['code'] = $this->err_code; return $error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastError();", "public function get_error();", "public function get_error();", "function getError();", "function getError();", "public function error()\n {\n return curl_error($this->curl);\n }", "public function error()\n {\n return curl_error($this->curl);\n }", "abstract public function getLastError();", "abstract public function getLastError();", "public function getLastError() {}", "protected function getLastError() {}", "public function getError();", "public function getError();", "public function getError();", "public function get_error()\n\t{\n\t\treturn curl_error($this->ch);\n\t}", "public function errorOccured();", "public function getError() {}", "public function Access_error ()\n\t\t{\n\t\t\t$errMsg[0]['error'] = \"Invalid URL!\";\n\t\t\treturn json_encode ($errMsg);\n\t\t}", "public function get_error()\n {\n return curl_error($this->ch); \n }", "public function error(): string{\n return curl_error($this->handler);\n }", "public function getErr() {}", "public function getErrorMessage() {\n return curl_error($this->curl_handle);\n }", "public function error();", "function get_error_msg()\n\t{\n\t\t//$this->error_no=curl_errno($this->ch);\n\t\techo \"Error: \" .curl_errno($this->ch) .\"\\n\";\n\t\techo \"Message3: \" .curl_error($this->ch).\"\\n\";\n\n\t\treturn $err;\n\t}", "function error()\n\t{\n\t\treturn $this->errorsrv->return_error();\n\t}", "function msgsrv_last_error () {}", "public function errNo()\n {\n return curl_errno($this->curl);\n }", "function lastError();", "public function error()\n {\n return curl_error($this->_session);\n }", "public function errno()\n {\n return curl_errno($this->curl);\n }", "function mapit_get_error($e) {\n if (!rabx_is_error($e))\n return FALSE;\n else\n return $e->text;\n}", "public function getLastError()\n {\n return 0;\n }", "public function getError()\n {\n return imap_last_error();\n }", "function error(){}", "public function uriError()\n {\n header(\"HTTP/1.0 404\");\n exit();\n }", "public function getErrorNo()\n {\n return curl_errno($this->ch);\n }", "function GetError() \r\n{ \r\n$theerror = $this->LastError; \r\n$this->ClearError(); \r\nreturn $theerror; \r\n}", "public function errorInfo();", "public function errorInfo();", "public function getError() {\n return imap_last_error();\n }", "public function errorcode();", "public function errno(): int{\n return curl_errno($this->handler);\n }", "function returnWithError( $err ) {\r\n\t\t$retValue = array('error' => $err);\r\n\t\tsendResultInfoAsJson( $retValue );\r\n\t}", "public function errorCode();", "public function errorCode();", "function errorInfo($p_full=false)\n {\n if (PCLZIP_ERROR_EXTERNAL == 1) {\n return(PclErrorString());\n }\n else {\n if ($p_full) {\n return($this->errorName(true).\" : \".$this->error_string);\n }\n else {\n return($this->error_string.\" [code \".$this->error_code.\"]\");\n }\n }\n }", "function returnWithError($err)\n\t{\n\t\t$retVal = '{\"id\" : -1, \"error\":\"' . $err . '\"}';\n\t\tsendResultInfoAsJson($retVal);\n\t}", "public static function error_response() {\r\n header(\"HTTP/1.1 404 Recurso no encontrado\");\r\n exit();\r\n }", "function getError()\r\n\t{\r\n\t\treturn $this->error_code;\r\n\t}", "public function getError()\n {\n return $this->fileInfo['error'];\n }", "public function getErrorType() {\n if (curl_error($this->query['ch'])) {\n return 'network';\n }\n\n if ($this->getHttpCode() >= 400) {\n return 'http';\n }\n\n return null;\n }", "function evel_get_error($e) {\n if (!rabx_is_error($e))\n return FALSE;\n else\n return $e->text;\n}", "function returnWithError( $err )\n\t{\n\t\t$retValue = json_encode($err);\n\t\tsendResultInfoAsJson( $retValue, JSON_FORCE_OBJECT);\n\t}", "abstract public function getErrorType(): string;", "function error_not_found()\n{\n\n}", "function get_errors()\n {\n }", "public function getLastErrorResponse() {\n if (!empty($this->rawResponses)) {\n foreach (array_reverse($this->rawResponses) as $x) {\n if (isset($x['error'])) {\n return $x;\n }\n }\n }\n }", "public function get_errno()\n\t{\n\t\treturn curl_errno($this->ch);\n\t}", "public function transactionGetResultsError ($message);", "function APIerror() {\n\t\t$session = JFactory::getSession();\n\n\t\t$order_id = $session->get('wbtypayments.order_id', 0);\n\n\t\t// Initialize database\n\t\t$db = JFactory::getDBO();\n\n\t\tsession_start();\n\t\t$resArray=$_SESSION['reshash'];\n\n\t\t// Get any URL errors\n\t\tif(isset($_SESSION['curl_error_no'])) {\n\t\t\t$errorCode= $_SESSION['curl_error_no'] ;\n\t\t\t$errorMessage=$_SESSION['curl_error_msg'] ;\n\t\t\tsession_unset();\n\t\t} else {\n\t\t\t// Create a new row in the errors table with this order ID\n\t\t\t$query = \"INSERT INTO #__wbty_payments_errors (`number`,`message`,`order_id`) VALUES ('\".$resArray['L_ERRORCODE0'].\"','\".$resArray['L_LONGMESSAGE0'].\"','$order_id')\";\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t$error_id = $db->insertid();\n\n\t\t\tforeach($resArray as $key => $value) {\n\t\t\t\tswitch ($key) {\n\t\t\t\t\tcase 'L_ERRORCODE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'L_LONGMESSAGE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$query = \"INSERT INTO #__wbty_payments_error_extra_items (`error_id`,`name`,`value`) VALUES ('\".$error_id.\"','\".$key.\"','\".$value.\"')\";\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public function get_error_code()\n {\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getErrors()\n {\n if(curl_errno($this->ch))\n return curl_error($this->ch);\n return null;\n }", "public static function error() {\n\t\treturn $this->_error;\n\t}", "public function getError()\n {\n }", "public function getErr()\n {\n return $this->get(self::ERR);\n }", "public function getErr()\n {\n return $this->get(self::ERR);\n }", "public function formatNotFoundError()\n {\n return 'Given resource could not be found.';\n }", "public function get_error() {\r\n return $this->error;\r\n }", "public function getNotFoundOk() {}", "public function get_error()\n\t\t{\n\t\t\treturn $this->error;\n\t\t}", "abstract public function getLastError($return_number = false);", "private function error($response) {\n\t\tif(property_exists($response, \"error\") AND $response->code != 200) {\n\t\t\tthrow new MystoreAPI_exception(\"Error \".$response->code.\"<br />\".$response->error->message);\n\t\t}\n\t}", "abstract public function error();", "public function getErrorNumber() {\n return curl_errno($this->_getCommHandler());\n }", "public function getLastError() {\n\t\t\treturn $this->lastError;\n\t\t}", "public static function error($status,$message){\r\n throw new \\Luracast\\Restler\\RestException($status, $message);\r\n }", "public function get_error() {\n return $this->error;\n }", "function getError(){\n\t\t\treturn $this->error;\n\t\t}", "function get_photos($groupid, $photo_number=1) {\n\n //parameters to use\n $params = array(\n 'api_key' => $this->flickr_api_key,\n 'method' => 'flickr.groups.pools.getPhotos',\n 'group_id' => $groupid,\n 'per_page' => $this->photos_per_page,\n 'page' => (string) $photo_number,\n 'extras' => 'url_m,path_alias,url_t,url_s,url_o',\n 'format' => 'php_serial',\n );\n //make the parameters nice for api call\n $url_params = array();\n foreach ($params as $k => $v) {\n $url_params[] = urlencode($k) . '=' . urlencode($v);\n }\n \n //make the api call\n $url = 'http://api.flickr.com/services/rest/?' . implode('&', $url_params);\n $response = file_get_contents($url);\n \n $resp_array = unserialize($response);\n\n if ($resp_array['stat'] == 'ok') {\n //Everything ok! Return the photo object\n return $resp_array['photos']['photo'];\n } else {\n //Something went wrong with the flickr call\n //We say this by returning NULL\n \n //Temporary error message\n echo \"Nu blev det nåt fel med flickr! Ojojoj!\";\n \n return NULL;\n \n }\n}", "function getErrPage(){\n}", "public function getLastError()\n {\n return $this->lastError;\n }", "public function getLastError()\n {\n return $this->lastError;\n }", "public function error(BaseResponse $response);", "public function errorOccured() {\n return $this->error;\n }", "public function errorOccured() {\n return $this->error;\n }", "public function getError()\r\n\t\t{\r\n\t\t\treturn $this->_errores;\r\n\t\t}", "function fetchErrorCode($error)\n{\n if (method_exists($error, 'getStatusCode')) {\n return $error->getStatusCode();\n }\n\n if (method_exists($error, 'getCode')) {\n return $error->getCode();\n }\n\n return 0;\n}", "public function get_last_error() {\n\t\treturn $this->_error;\n\t}", "private function getErrorPage($url){\r\n header(\"HTTP/1.0 404 Not Found\");\r\n die(strtoupper(\"error 404 $url not found\"));\r\n }", "public function message()\n {\n return 'wrong photo status';\n }", "function api_error($err_code, $err_message, $err_data = null, $id = null) {\n $err = ['code'=>$err_code, 'message'=>$err_message];\n if (!is_null($err_data)) $err['data'] = $err_data;\n return api_return($err, $id, 'error');\n}", "public function testImageSearchExceptionAdultOkInvalid()\n {\n try {\n $this->_yahoo->imageSearch('php', ['adult_ok' => -1]);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString('error occurred sending request', $e->getMessage());\n }\n }", "function crystal_pear_error($err)\n{\n error_log(sprintf(\"%s (%s): %s\",\n $err->getMessage(),\n $err->getCode(),\n $err->getUserinfo()), 0);\n}", "public function getErrorMessage()\n {\n if (! $this->executed) {\n throw new Exception('Curl request not executed');\n }\n\n return '';\n }", "protected function getLastError()\n {\n return error_get_last();\n }", "public function get_error(){\n return $this->error;\n }", "public function errorCode() {}", "public function error()\n {\n if(is_resource($this->link))\n {\n return pg_last_error($this->link);\n }\n else\n {\n return '';\n }\n }", "public function getLastError()\n {\n return $this->lastErrorMsg;\n }" ]
[ "0.6585086", "0.65485984", "0.65485984", "0.6456594", "0.6456594", "0.6335348", "0.6335348", "0.6320712", "0.6320712", "0.63068753", "0.627433", "0.6249992", "0.6249992", "0.6249992", "0.62350756", "0.6191612", "0.61540943", "0.6150432", "0.6131768", "0.61248064", "0.6058678", "0.597384", "0.59527344", "0.59466016", "0.5911602", "0.5897467", "0.5884815", "0.58417445", "0.58169854", "0.5789232", "0.5788172", "0.57732993", "0.575598", "0.574806", "0.5712113", "0.5691837", "0.5691403", "0.56875885", "0.56875885", "0.5685806", "0.567107", "0.5659598", "0.56545895", "0.5644079", "0.5644079", "0.5628283", "0.56206125", "0.560433", "0.55939645", "0.5531371", "0.5526141", "0.5524093", "0.5522384", "0.5518565", "0.5517439", "0.55169666", "0.5516369", "0.5516305", "0.5498537", "0.5497209", "0.54881984", "0.5484082", "0.5484082", "0.5479388", "0.54598355", "0.54596883", "0.54583544", "0.54583544", "0.5457335", "0.5445818", "0.5439256", "0.54387975", "0.54330647", "0.5432972", "0.54304194", "0.5412446", "0.5410431", "0.54057634", "0.54056364", "0.54000074", "0.53999513", "0.5398224", "0.5391316", "0.5391316", "0.53903127", "0.5379179", "0.5379179", "0.5378432", "0.5377884", "0.5375102", "0.53719676", "0.5361184", "0.5360295", "0.53548", "0.5348446", "0.5342177", "0.53396165", "0.5337188", "0.53361505", "0.53341377", "0.5333664" ]
0.0
-1
Submit a POST request with to the specified URL with given parameters.
static function submitHttpPost($url, $postParams = null, $timeout = 50) { $ch = curl_init(); // set up the request curl_setopt($ch, CURLOPT_URL, $url); // make sure we submit this as a post curl_setopt($ch, CURLOPT_POST, true); if (isset($postParams)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams); }else{ curl_setopt($ch, CURLOPT_POSTFIELDS, ""); } // make sure problems are caught curl_setopt($ch, CURLOPT_FAILONERROR, 1); // return the output curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // set the timeouts curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($ch, CURLOPT_TIMEOUT,$timeout); // set the PHP script's timeout to be greater than CURL's set_time_limit($timeout + 25); $result = curl_exec($ch); // check for errors if (0 == curl_errno($ch)) { curl_close($ch); return $result; } else { $this->modx->log(MODX_LOG_LEVEL_ERROR,'XFlickr Request failed. '.curl_errno($ch).': '. curl_error($ch).' URL:'.$url); curl_close($ch); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _post($url = null, array $parameters = []);", "public function post($url, $body = array(), $query = array(), $headers = array());", "public function Post( $sUrl, array $aFields );", "private function POST($url,$params=false){\n return $this->Request($url,$params,HTTP_POST);\n }", "public function post($url, array $params = []) \n {\n return $this->request('POST', $url, $params);\n }", "public function post($url, $params = null)\n {\n return $this->request('POST', $url, $params);\n }", "public function post($url, $body){\n\t\t\n\t\t// do we even need this?\n\t\t// $headers = array('Content-Type: application/x-www-form-urlencoded')\n\t\t\n\t\treturn $this->doRequest('POST', $url, $body);\n }", "public function post($requestUrl, $requestBody, array $requestHeaders = []);", "public function post($url, $params = [])\n {\n return $this->request($url, 'POST', $params);\n }", "function httpPOST($url, array $data, $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n $query = http_build_query($data, '', '&');\n ($headers = trim($headers) === '') or $headers .= \"\\r\\n\";\n\n $headers = \"POST $url HTTP/1.0\\r\\n\".\n $headers.\n \"Content-Type: application/x-www-form-urlencoded\\r\\n\".\n \"Content-Length: \".strlen($query).\"\\r\\n\".\n \"$query\\r\\n\";\n\n $this->write($headers);\n return $this->readAllAndClose();\n }", "public function post ($url, $data = null, $headers = null, $options = null);", "public function post($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config, Request::METHOD_POST);\n\t}", "function post_to_url($url, $data) {\r\n\t\t$fields = '';\r\n\t\tforeach($data as $key => $value) {\r\n\t\t\t$fields .= $key . '=' . $value . '&';\r\n\t\t}\r\n \r\n\t\trtrim($fields, '&');\r\n\t\t$post = curl_init();\r\n \r\n\t\t curl_setopt($post, CURLOPT_URL, $url);\r\n\t\t curl_setopt($post, CURLOPT_POST, count($data));\r\n\t\t curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\r\n\t\t curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $result = curl_exec($post);\r\n\t\t curl_close($post);\r\n\t}", "function postRequest( $url, $fields, $optional_headers = null ) {\n\t\t// http_build_query is preferred but doesn't seem to work!\n\t\t// $fields_string = http_build_query($fields, '', '&', PHP_QUERY_RFC3986);\n\t\t\n\t\t// Create URL parameter string\n\t\tforeach( $fields as $key => $value )\n\t\t\t$fields_string .= $key.'='.$value.'&';\n\t\t\t\n\t\t$fields_string = rtrim( $fields_string, '&' );\n\n//\t\techo \"controlKey.php : postRequest() : URL = $url\";\n//\t\techo \"controlKey.php : postRequest() : Fields_string = $fields_string\";\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_POST, count( $fields ) );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $fields_string );\n\t\t\n\t\t$result = curl_exec( $ch );\n\t\t\n\t\tcurl_close( $ch );\n\t}", "public function post(string $url, array $input = [], $headers = null);", "function post($url, $args = array()) {\n\t\t$defaults = array('method' => 'POST');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "function post($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'POST', 'body' => $data), $options));\n\t}", "public function post(array $parameters);", "public function post(array $parameters);", "public function post(array $parameters);", "public function post($url, $params=array(), $token='', $secret='') {\n return $this->request('POST', $url, $params, $token, $secret);\n }", "private function submitRequest($url, $data) { \n\t\t$accessToken = $this->getAccessToken();\n\t\tif($accessToken == '' || $accessToken == FALSE) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: Bearer '.$accessToken));\n\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\n\t\treturn $response;\n\t}", "public static function post($url,array $params = array()) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n $data = curl_exec($ch);\n curl_close($ch);\n\n return $data;\n }", "public function post($url, $params = array(), $options = array())\n\t{\n\t\t$field_string = '';\n\t\t\n\t\tif ( iterable($params) ) {\n\t\t\tforeach ( $params as $key => $value ) {\n\t\t\t\t$field_string .= urlencode($key) . '=' . urlencode($value) . '&';\n\t\t\t}\n\t\t\t\n\t\t\trtrim($field_string, '&');\n\t\t}\n\t\t\n\t\t$options[CURLOPT_URL] = $url;\n\t\t$options[CURLOPT_RETURNTRANSFER] = array_ensure($options, CURLOPT_RETURNTRANSFER, 1);\n\t\t$options[CURLOPT_HEADER] = array_ensure($options, CURLOPT_HEADER, 0);\n\t\t$options[CURLOPT_USERAGENT] = array_ensure($options, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');\n\t\t$options[CURLOPT_IPRESOLVE] = array_ensure($options, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);\n\t\t$options[CURLOPT_POST] = sizeof($params);\n\t\t$options[CURLOPT_SSL_VERIFYPEER] = false;\n\t\t$options[CURLOPT_SSL_VERIFYHOST] = 0;\n\t\t$options[CURLOPT_POSTFIELDS] = $field_string;\n\t\t//$options[CURLOPT_HEADER] = strlen($field_string);\n\t\t\n\t\t$curl = curl_init();\n\t\t\n\t\tcurl_setopt_array($curl, $options);\n\t\t\n\t\t$response = curl_exec($curl);\n\t\t\n\t\tif ( false === $response ) {\n\t\t\techo curl_error($curl);\n\t\t}\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn $response;\n\t}", "function http_post($url, $params = array()) {\n $postData = '';\n //create name value pairs seperated by &\n foreach ($params as $k => $v) {\n $postData .= $k . '=' . $v . '&';\n }\n $postData = rtrim($postData, '&');\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n $output = curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "public function post(array $params);", "function doPost($url, $post = array() , $format = 'plain')\n{\n return curlExecute($url, 'post', $post, $format);\n}", "public function postCurlCall($url, $post_params){\n return $this->utilities->curlPost($url, $post_params);\n }", "function do_post_request($url, $data, $optional_headers = null)\n{\n $params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n return $response;\n}", "function httpPOST($url, $data)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n}", "function h_POST(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n $payload = json_encode($data);\n\n // Prepare new cURL resource\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n \n // Set HTTP Header for POST request \n curl_setopt(\n $ch,\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($payload)\n ]\n );\n \n // Submit the POST request\n $response = curl_exec($ch);\n curl_close($ch);\n\n return $response;\n}", "public function post($url, $params = false, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, $params, self::POST, $options, $timeout);\n\t\t}", "public function post( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'POST', $headers, $data );\n }", "protected function makePostRequest($uri, $params) {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL,$this->server_url . $uri);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS,\n http_build_query($params));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($curl);\n $this->response = $output;\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close ($curl);\n }", "protected function post($url, $params) {\n $client = new Emory_Http_Client($url,\n array('timeout' => 60)\t// increase timeout to 60 seconds (default is 10)\n );\n $client->setParameterPost($params);\n $client->setEncType(Zend_Http_Client::ENC_FORMDATA);\n $client->setMethod(Zend_Http_Client::POST);\n $response = $client->request();\n if ($response->isSuccessful())\n return $response->getRawBody();\t// don't do any decoding, etc\n else {\n // FIXME: is this exception-worthy?\n throw new SolrException($response->getMessage());\n }\n }", "public function post($url, array $data = [], array $headers = [])\n {\n return $this->sendRequest($url, 'POST', $data, $headers);\n }", "protected function post($url, $parameters)\n {\n return $this->createHttpClient()->post($url, $parameters);\n }", "public function post($url, $data = array()) {\n\t\treturn $this->request($url, $data, true);\n\t}", "public function post($url, $payload = array(), $do_not_exit = true)\n {\n if($do_not_exit)\n {\n $this->do_not_exit = true;\n }\n\n $this->url = $url;\n $this->curl_handle = curl_init();\n $payload = http_build_query($payload);\n curl_setopt($this->curl_handle, CURLOPT_URL, $this->url);\n curl_setopt($this->curl_handle, CURLOPT_POST, true);\n curl_setopt($this->curl_handle, CURLOPT_HTTPHEADER, $this->header);\n curl_setopt($this->curl_handle, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($this->curl_handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this->curl_handle, CURLOPT_HEADER, true);\n $this->curl_response = curl_exec($this->curl_handle);\n\n $this->parse_curl_response();\n return $this->http_body;\n }", "static function post($url, $body = null, $headers = array()) {\n $request = new NiceHTTP\\PostRequest($url, $body, $headers);\n return $request->send();\n }", "function post($url,$fields){\n curl_setopt($this-> ch,CURLOPT_POST,1);\n curl_setopt($this-> ch,CURLOPT_POSTFIELDS,$fields);\n curl_setopt($this-> ch,CURLOPT_URL,$url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, COOKIE_FILE); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION,true);\n // 返回跳转后的页面 如果只提交表单,则返回1表示成功\n return $this-> html = curl_exec($this-> ch);\n }", "public static function Post($url, $vars, $auth = false) \r\n {\r\n return self::doRequest('POST', $url, $vars, $auth);\r\n }", "public function post($url = null, array $data = [])\n {\n $this->init($url);\n\n curl_setopt($this->handler, CURLOPT_POST, count($data));\n curl_setopt($this->handler, CURLOPT_POSTFIELDS, http_build_query($data));\n\n return $this->exec();\n }", "public static function post($uri,$params=[],$options=[]) {\n return self::request('POST',$uri,$params,$options);\n }", "function post(Request &$request, Response &$response);", "public function post($url, $payload, $options = [])\n {\n $request = new Client();\n $request->init();\n\n $request->setopt(CURLOPT_URL, $url);\n\n foreach ($this->options as $optionKey => $optValue) {\n $request->setopt($optionKey, $optValue);\n }\n\n foreach ($options as $optionKey => $optValue) {\n $request->setopt($optionKey, $optValue);\n }\n\n $request->setopt(CURLOPT_POSTFIELDS, $payload);\n $request->setopt(\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: ' . $this->dataType,\n 'Content-Length: ' . strlen($payload)\n ]\n );\n\n if (!$this->body = $request->exec()) {\n $this->error = $request->error();\n }\n\n $info = $request->getinfo();\n $this->status = isset($info['http_code']) ? $info['http_code'] : null;\n\n $request->close();\n }", "function PostURL($url, $postData, $options = array())\n\t{\n\t\t//\t\t$postString = '';\n\t\t//\t\tforeach ($postData as $key => $value) { $postString .= \"$key=$value&\"; }\n\n//\t\t\n//\t\t$options['post_string'] = http_build_query($postData);\n\t\t$options['post_array'] = $postData;\n\t\treturn self::FetchURL($url, $options);\n\t\t\n\t}", "function make_post_call($mid_url, $post_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($post_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "public static function curlPost($url,$params)\n {\n $postData = '';\n //create name value pairs seperated by &\n foreach($params as $k => $v)\n {\n $postData .= $k . '='.$v.'&';\n }\n rtrim($postData, '&');\n\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($ch,CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n\n }", "public function post(\n $url,\n ParametersBagInterface $parameters = null,\n $cacheLifeTime = 500\n ) {\n return $this->request('POST', $url, $parameters, $cacheLifeTime);\n }", "function do_post_request($url, $data, $optional_headers = null)\n {\n\t \n$params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n\t //print_r($response);\n return $response;\n }", "private function doPost($url, $data) {\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n Logger::info(\"Got result from GW: \". $result);\n }", "public static function post($url, $data)\n {\n return self::fetch($url, array (\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $data\n )\n );\n }", "function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}", "public static function submit($url, $params) {\n $Config = GiroCheckout_SDK_Config::getInstance();\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));\n\n // For Windows environments\n if( defined('__GIROSOLUTION_SDK_CERT__') ) {\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_CAINFO, str_replace('\\\\', '/', __GIROSOLUTION_SDK_CERT__));\n }\n\n // For Windows environments\n if( defined('__GIROSOLUTION_SDK_SSL_VERIFY_OFF__') && __GIROSOLUTION_SDK_SSL_VERIFY_OFF__ ) {\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n }\n\n if ($Config->getConfig('CURLOPT_SSL_VERIFYPEER')) {\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $Config->getConfig('CURLOPT_SSL_VERIFYPEER'));\n }\n\n if ($Config->getConfig('CURLOPT_CAINFO')) {\n curl_setopt($ch, CURLOPT_CAINFO, $Config->getConfig('CURLOPT_CAINFO'));\n }\n\n if ($Config->getConfig('CURLOPT_SSL_VERIFYHOST')) {\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $Config->getConfig('CURLOPT_SSL_VERIFYHOST'));\n }\n\n if ($Config->getConfig('CURLOPT_CONNECTTIMEOUT')) {\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $Config->getConfig('CURLOPT_CONNECTTIMEOUT'));\n }\n\n // Begin Proxy\n if( $Config->getConfig('CURLOPT_PROXY') && $Config->getConfig('CURLOPT_PROXYPORT') ) {\n curl_setopt($ch, CURLOPT_PROXY, $Config->getConfig('CURLOPT_PROXY'));\n curl_setopt($ch, CURLOPT_PROXYPORT, $Config->getConfig('CURLOPT_PROXYPORT'));\n\n if($Config->getConfig('CURLOPT_PROXYUSERPWD')) {\n curl_setopt($ch, CURLOPT_PROXYUSERPWD, $Config->getConfig('CURLOPT_PROXYUSERPWD'));\n }\n }\n // End Proxy\n\n if ($Config->getConfig('DEBUG_MODE')) {\n curl_setopt($ch, CURLINFO_HEADER_OUT, 1);\n }\n\n $result = curl_exec($ch);\n\n if($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logRequest(curl_getinfo($ch),$params); }\n if($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logReply($result, curl_error($ch)); }\n\n if($result === false) {\n throw new Exception('cURL: submit failed.');\n }\n\n curl_close($ch);\n\n return self::getHeaderAndBody($result);\n }", "private function callPostMethod($url, $data) {\n\t\t$options = array(\n\t\t\t'http' => array(\n\t\t\t\t'timeout' => 3600,\n\t\t\t\t'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t\t\t'method' => 'POST',\n\t\t\t\t'content' => http_build_query($data),\n\t\t\t),\n\t\t);\n\t\t$context = stream_context_create($options);\n\t\t$result = file_get_contents($url, false, $context);\n\t}", "public function post($url)\n {\n $this->requestType = Client::REQUEST_POST;\n $this->url = $url;\n return $this;\n }", "function forwardPostRequest($url, $data) {\n\t\t\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => $url,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_POST => 1,\n\t\t\tCURLOPT_POSTFIELDS => $data,\n\t\t\tCURLOPT_HTTPHEADER => array(\"cache-control: no-cache\"),\n\t\t\tCURLOPT_SSL_VERIFYPEER => false\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\tif ($response === false) echo \"Bad response\";\n\n\t\tcurl_close($curl);\n\t\treturn $response;\n\n\t}", "public function testUpdateUrlUsingPOST()\n {\n }", "function curl_post($url, array $post = NULL, array $options = array())\n{\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch))\n {\n echo \"curl_exec failed \" . $url;\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "function post (string $url, array $args = []): string {\n\t$curlCall = curl_init($url);\n\n\tcurl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curlCall, CURLOPT_POST, true);\n\tcurl_setopt($curlCall, CURLOPT_POSTFIELDS, $args);\n\n\t$return = curl_exec($curlCall);\n\tcurl_close($curlCall);\n\n\treturn $return;\n}", "private function _api_call_post( $url, $params = array() ) {\n\n $connection = new OAuthDamnit( $this->_config['consumer_key'], $this->_config['consumer_secret'],\n $this->_token['token1'], $this->_token['token2'] );\n\n $data_json = $connection->post($url, $params);\n $data = json_decode($data_json);\n return $data;\n }", "function web_hook_post($url, $fields) {\n // url-ify the data for the POST\n foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n rtrim($fields_string,'&');\n\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return ($result);\n}", "protected function post($url, $params)\n {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, urldecode(http_build_query($params)));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n $result = curl_exec($curl);\n curl_close($curl);\n\n return $result = json_decode($result, true);\n }", "public static function post($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //Set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }", "public static function doPost(Array $params) {\n $params['requestMethod'] = 'POST';\n $params['tryNum'] = 5;\n return self::doGet($params);\n }", "function new_post($request,$url) {\n ##Data Post\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n return curl_exec($ch);\n}", "public function post($t);", "function curl_post($url, array $post = NULL, array $headers = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $_defaults = defaults;\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "public static function sendPost($_url, $_data, $_headers = [],\n $_return_header = true)\n {\n return self::sendCurl($_url,\n array(\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_FOLLOWLOCATION => 0,\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $_data,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => $_headers,\n CURLOPT_HEADER => $_return_header\n ));\n }", "public function post($url, $path)\n\t{\n\t\t$path = str_replace('--', '/', $path);\n\t\t$data['url'] = $url . $path;\n\t\t$this->render($data, NULL, 'post');\n\t}", "public function request_post($uri, array $options = array()) {\n $options['method'] = 'POST';\n return $this->request($uri, $options);\n }", "private function _httpPost($fields)\n {\n $fields_string = http_build_query($fields);\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$this->_getFullUrl());\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return $result;\n }", "function post($url, $data) {\n $options = array(\n\t\t 'http' => array(\n\t\t\t\t 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t\t\t 'method' => 'POST',\n\t\t\t\t 'content' => http_build_query($data),\n\t\t\t\t ),\n\t\t );\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n return $result;\n}", "function Curl_Post_Login($url, $params = array()) {\n $data_string = json_encode($params);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n\n $result = curl_exec($ch);\n return $result;\n }", "public function post($url, $params) {\n foreach ($params as $key => $value) {\n if ($value == null) {\n unset( $params[$key] );\n }\n }\n\n $params['api_secret'] = $this->config->apiSecret;\n $params = 'enc_request=' . urlencode($this->_encrypt($params)) . '&appID=' . $this->config->appId . '&v=2.0&s=php';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->config->endpoint . $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Cert'. DIRECTORY_SEPARATOR .'ip_gd_bundle.crt');\n curl_setopt($ch, CURLOPT_MAXREDIRS, 3);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , 2);\n curl_setopt($ch, CURLOPT_SSLVERSION, 0 );\n\n $response = new Response();\n $response->rawResponse = curl_exec($ch);\n $response->httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $response->parse();\n curl_close($ch); //If the session option is not set, close the session.\n return $response;\n }", "public function submit() {\r\n\t\t$name_value_pairs = array();\r\n\t\tforeach ( $this->request_data as $key => $value ) {\r\n\t\t\t$name_value_pairs[] = $key . '=' . rawurlencode( $value );\r\n\t\t}\r\n\r\n\t\t$url = 'https://mms.paymentsensegateway.com/Pages/PublicPages/PaymentForm.aspx';\r\n\t\t$params = implode( '&', $name_value_pairs );\r\n\t\theader( 'Location: ' . $url . '?' . $params, false );\r\n\t\texit();\r\n\t}", "function http_post_data($url, $data = null, ?array $options = null, ?array &$info = null) {}", "private function _post_data($url, $data)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t$ret = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $ret;\n\t}", "public function post();", "public function post();", "public function post();", "public function post( array $postFields );", "private function submit($url, $data)\n {\n $response = $this->get_content($url, $data);\n return $response;\n }", "private function post (string $url)\r\n\t{\r\n\t\ttry {\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t$handle = curl_init();\t\t\t\r\n\t\t\tcurl_setopt_array($handle, array(\r\n\t\t\t\tCURLOPT_URL => $url,\r\n\t\t\t\tCURLOPT_CONNECTTIMEOUT => 5,\r\n\t\t\t\tCURLOPT_TIMEOUT => 60,\r\n\t\t\t\tCURLOPT_RETURNTRANSFER => true,\r\n\t\t\t\tCURLOPT_POST => true,\r\n\t\t\t\tCURLOPT_POSTFIELDS => $this->paramUrl\r\n\t\t\t\t));\t\t\r\n\t\t\t//curl_setopt($ch, CURLOPT_ENCODING ,\"\");\r\n\t\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded; charset=UTF-8'));\r\n\t\t\t\r\n\t\t\t$response = curl_exec($handle);\t\t\r\n\t\t\t$resp = json_decode($response);\t\t\t\r\n\t\t\tif ($resp['ok'] == false)\r\n\t\t\t\tthrow new \\Exception($resp['description']);\t\t\t\r\n\t\t\t\r\n\t\t} catch ( \\Exception $e) {\r\n\t\t\t$Logger = new \\Logger('TelegramMain.txt');\r\n\t\t\t$Logger -> log($response, $url.$this->paramUrl);\r\n\t\t}finally{\t\t\t\r\n\t\t\tcurl_close($handle);\t\t\r\n\t\t\treturn $response;\t\t\t\r\n\t\t}\r\n\r\n\t}", "public function post($url, $params) {\n $params['api_secret'] = $this->config->apiSecret;\n $params['appID'] = $this->config->appId;\n $params['t'] = time();\n $params['v'] = '4.0'; // Version for \n $params['s'] = 'php'; // SDK version \n\n // Removing all 'null' values to reduce parameters sendt.\n foreach ($params as $key => $value) {\n if ($value == null) {\n unset( $params[$key] );\n }\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->config->endpoint . $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n curl_setopt($ch, CURLOPT_MAXREDIRS, 3);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n $response = new Response();\n $response->rawResponse = curl_exec($ch);\n $response->httpStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $response->parse();\n curl_close($ch); //If the session option is not set, close the session.\n\n return $response;\n }", "public function doPostRequest($url, $data, $headers = array('Content-Type: application/x-www-form-urlencoded')) {\r\n $php_errormsg = '';\r\n if (is_array($data)) {\r\n $data = http_build_query($data, '', '&');\r\n }\r\n $params = array('http' => array(\r\n 'method' => 'POST',\r\n 'content' => $data)\r\n );\r\n if ($headers !== null) {\r\n $params['http']['header'] = $headers;\r\n }\r\n $ctx = stream_context_create($params);\r\n $fp = fopen($url, 'rb', false, $ctx);\r\n if (!$fp) {\r\n return \"Error: gateway is inaccessible\";\r\n }\r\n //stream_set_timeout($fp, 0, 250);\r\n try {\r\n $response = stream_get_contents($fp);\r\n if ($response === false) {\r\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\r\n }\r\n return $response;\r\n } catch (Exception $e) {\r\n $response = $e->getMessage();\r\n return $response;\r\n }\r\n}", "public function _POST($url, $params = null, $username = null, $password = null, $contentType = null)\n {\n $response = $this->call($url, 'POST', $params, $username, $password, $contentType);\n //$this->convertEncoding($response,'utf-8',$this->_encode)\n return $this->json_foreach($this->parseResponse($response));\n }", "protected function postHttpRequest(array $data, string $url)\n {\n // TODO use CurlWrapper\n $options = [\n 'http' => [\n 'header' => \"Content-Type: application/x-www-form-urlencoded\\r\\n\" .\n \"User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0\\r\\n\" .\n ($this->sessionId !== '' ? \"Cgi-Authorization: Basic \" . $this->sessionId . \"\\r\\n\" : '') .\n ($this->headers !== null ? implode(\"\\r\\n\", $this->headers) . \"\\r\\n\" : ''),\n 'method' => 'POST',\n 'content' => http_build_query($data)\n ]\n ];\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n $this->assertErrors($result, 'Request have returned warnings/errors');\n\n return json_decode($result);\n }", "function post($url, $parameters = array(), $multi = false) {\n\t\t$response = $this->oAuthRequest($url, 'POST', $parameters, $multi );\n\t\tif ($this->format === 'json' && $this->decode_json) {\n\t\t\treturn json_decode($response, true);\n\t\t}\n\t\treturn $response;\n\t}", "public static function POST($url, $data)\n {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n\n $Response = curl_exec($curl);\n $Result = json_decode($Response, true);\n\n curl_close($curl);\n\n return $Result;\n }", "function postURL($diffID, $url) {\n assert(strlen($diffID) > 0);\n assert(is_numeric($diffID));\n assert(strlen($url) > 0);\n\n $cmd = 'echo \\'{\"diff_id\": ' . $diffID . ', '\n . '\"name\":\"click here for sandcastle tests for D' . $diffID . '\", '\n . '\"link\":\"' . $url . '\"}\\' | '\n . 'arc call-conduit '\n . 'differential.updateunitresults';\n shell_exec($cmd);\n}", "private function doRequest($url, $params) {\n $request= new HttpRequest(new URL($url));\n $request->setHeader('Accept', 'application/json');\n $request->setMethod(HttpConstants::POST);\n $request->setParameters(array_merge(array(\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret\n ), $params));\n\n $conn= new HttpConnection($url);\n\n $this->cat && $this->cat->debug($this->getClassName(), '>>> ', $request->getRequestString());\n return $conn->send($request);\n }", "private function send($url, $fields)\n {\n $res = $this->GuzzleClient->post($url, [\n 'form_params' => [\n 'payload' => json_encode($fields)\n ]\n ]);\n\n return true;\n }", "function postDataToUrl($url, $data) {\r\n $curl = curl_init();\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n curl_setopt($curl, CURLOPT_HEADER, 1);\r\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n $response = curl_exec ($curl);\r\n curl_close ($curl);\r\n\treturn $response;\r\n}", "function submitForm($path, $params) {\r\n $url = $this->host . $path;\r\n $q = $this->serializeParams($params);\r\n \r\n curl_setopt($this->ch, CURLOPT_POST, 1);\r\n curl_setopt($this->ch, CURLOPT_URL, $url);\r\n curl_setopt($this->ch, CURLOPT_POSTFIELDS, $q);\r\n $res = curl_exec($this->ch);\r\n return $res;\r\n }", "function post($url, $fields = array(), $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_POST] = true;\n $http_options[CURLOPT_POSTFIELDS] = $fields;\n if (is_array($fields)) {\n $http_options[CURLOPT_HTTPHEADER] = array(\"Content-Type: multipart/form-data\");\n }\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "function post_to_url($url, $data) {\n $fields = '';\n foreach ($data as $key => $value) {\n $fields .= $key . '=' . $value . '&';\n }\n rtrim($fields, '&');\n $post = curl_init();\n curl_setopt($post, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($post, CURLOPT_URL, $url);\n curl_setopt($post, CURLOPT_POST, count($data));\n curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($post); //result from mobile seva server \n return $result; //output from server displayed \n curl_close($post);\n}", "public static function post($url, $data = array())\r\n\t{\r\n\t\t$ch = curl_init();\r\n\t\t\r\n\t\tif ( ! empty( $data ) )\r\n\t\t\t$data = http_build_query($data);\r\n\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output \r\n\t\t\r\n\t\t$result = curl_exec($ch);\r\n\r\n\t\tcurl_close ($ch);\r\n\t\t\r\n\t\tif ( false !== $result )\r\n\t\t\t$result = json_decode( $result );\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "abstract public function post($data);" ]
[ "0.749609", "0.7195303", "0.70692456", "0.70639855", "0.7028074", "0.6959787", "0.6894018", "0.68926907", "0.68706506", "0.68541133", "0.6829719", "0.6765395", "0.6746321", "0.6722926", "0.66961485", "0.6692714", "0.65653485", "0.6564171", "0.6564171", "0.6564171", "0.65296084", "0.651829", "0.65127033", "0.6504193", "0.64741856", "0.64671403", "0.64665", "0.6464455", "0.6463146", "0.64626455", "0.64556783", "0.6454157", "0.6399291", "0.6388099", "0.63871294", "0.6366852", "0.63591284", "0.6353638", "0.63534015", "0.6335792", "0.6261398", "0.62532103", "0.62466455", "0.6243452", "0.6225501", "0.6225436", "0.6217079", "0.621398", "0.61987954", "0.6197847", "0.6192169", "0.6190429", "0.61903197", "0.61845034", "0.6172795", "0.6170609", "0.6131635", "0.61209464", "0.61098176", "0.61062306", "0.60974765", "0.6091526", "0.6089553", "0.60720426", "0.6069901", "0.60686564", "0.6061775", "0.6059857", "0.6052462", "0.6048027", "0.6043272", "0.60331386", "0.60325134", "0.6030656", "0.6008039", "0.60045606", "0.59892213", "0.5989122", "0.5988835", "0.59823817", "0.59823817", "0.59823817", "0.59597087", "0.59528327", "0.594759", "0.5944216", "0.5937759", "0.593556", "0.591037", "0.58990896", "0.58983904", "0.5888849", "0.58869874", "0.5886142", "0.5883752", "0.58812296", "0.58759505", "0.5864328", "0.58594", "0.5856044" ]
0.6448467
32
Create a signed signature of the parameters. Return a parameter string that can be tacked onto the end of a URL.
public function signParams($params) { $signing = ''; $values = array(); $secret = $this->getSecret(); ksort($params); foreach($params as $key => $value) { $signing .= $key . $value; $values[] = $key . '=' . urlencode($value); } $values[] = 'api_sig=' . md5($secret . $signing); return implode('&', $values); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_signable_parameters()\n {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n if (isset($params['oauth_signature']))\n unset($params['oauth_signature']);\n\n // Urlencode both keys and values\n $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));\n $values = OAuthUtil::urlencode_rfc3986(array_values($params));\n $params = array_combine($keys, $values);\n\n // Sort by keys (natsort)\n uksort($params, 'strcmp');\n\n // Generate key=value pairs\n $pairs = array();\n foreach ($params as $key=>$value )\n {\n if (is_array($value))\n {\n // If the value is an array, it's because there are multiple\n // with the same key, sort them, then add all the pairs\n natsort($value);\n foreach ($value as $v2)\n $pairs[] = $key . '=' . $v2;\n }\n else\n $pairs[] = $key . '=' . $value;\n }\n\n // Return the pairs, concated with &\n return implode('&', $pairs);\n }", "function get_signable_parameters($params){\n $sorted = $params;\n ksort($sorted);\n\n $total = array();\n foreach ($sorted as $k => $v) {\n if ($k == 'oauth_signature') {\n continue;\n }\n\n $total[] = rawurlencode($k) . '=' . rawurlencode($v);\n }\n return implode('&', $total);\n }", "public function get_signable_parameters() {\n\t\t// Grab all parameters\n\t\t$params = $this->params;\n\n\t\t// Remove oauth_signature if present\n\t\t// Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n\t\tif ( isset( $params[ static::prefix . 'signature' ] ) ) {\n\t\t\tunset( $params[ static::prefix . 'signature' ] );\n\t\t}\n\n\t\treturn \\OAuthSignature::build_http_query( $params );\n\t}", "private function _generateSignature($params, $request_method = 'GET', $url = self::API_REST_URL)\n {\n uksort($params, 'strcmp');\n $params = self::url_encode_rfc3986($params);\n\n // Make the base string\n $base_parts = array(\n strtoupper($request_method),\n $url,\n urldecode(http_build_query($params, '', '&'))\n );\n $base_parts = self::url_encode_rfc3986($base_parts);\n $base_string = implode('&', $base_parts);\n\n // Make the key\n $key_parts = array(\n $this->_consumer_secret,\n ($this->_token_secret) ? $this->_token_secret : ''\n );\n $key_parts = self::url_encode_rfc3986($key_parts);\n $key = implode('&', $key_parts);\n\n // Generate signature\n return base64_encode(hash_hmac('sha1', $base_string, $key, true));\n }", "public function getSignatureBaseString()\n {\n $parts = array(\n $this->getNormalizedHttpMethod(),\n $this->getNormalizedHttpUrl(),\n $this->getSignableParameters()\n );\n\n $parts = Utils::urlencodeRfc3986($parts);\n\n return implode('&', $parts);\n }", "public function get_signature_base_string() {\n\t\t$parts = \\OAuthSignature::urlencode_rfc3986( array(\n\t\t\t$this->get_normalized_http_method(),\n\t\t\t$this->get_normalized_http_url(),\n\t\t\t$this->get_signable_parameters(),\n\t\t) );\n\n\t\treturn implode( '&', $parts );\n\t}", "public function get_signature_base_string() {\n $parts = array(\n $this->get_normalized_http_method(),\n $this->get_normalized_http_url(),\n $this->get_signable_parameters()\n );\n\n $parts = OAuthUtil::urlencode_rfc3986($parts);\n\n return implode('&', $parts);\n }", "public function get_signature_base_string()\n {\n $parts = array(\n $this->get_normalized_http_method(),\n $this->get_normalized_http_url(),\n $this->get_signable_parameters()\n );\n\n $parts = OAuthUtil::urlencode_rfc3986($parts);\n\n return implode('&', $parts);\n }", "private function generate_signature()\n {\n $phrase = implode('', func_get_args());\n /**\n * Sign data and make final signature\n */\n $signature = '';\n $private_key_id = openssl_pkey_get_private($this->private_key);\n if (!openssl_sign($phrase, $signature, $private_key_id, OPENSSL_ALGO_SHA1)) {\n throw new BankException('OPEN SSL SIGN ERROR');\n }\n\n return $signature;\n }", "protected function generateSignature()\n {\n // set the expire time to 5 minutes\n $expires = time() + 300;\n\n // put the parameters in a different line\n $stringToSign = $this->accessID.\"\\n\".$expires;\n\n // get the binary output of the hmac has\n $binarySignature = hash_hmac('sha1', $stringToSign, $this->secretKey, true);\n\n // Base64-encode and url-encode\n $urlSafeSignature = urlencode(base64_encode($binarySignature));\n\n return array('expires' => $expires, 'signature' => $urlSafeSignature);\n }", "function _calculateStringToSignV2(array $parameters) {\n $data = 'POST';\n $data .= \"\\n\";\n $endpoint = parse_url ($this->_config['ServiceURL']);\n $data .= $endpoint['host'];\n $data .= \"\\n\";\n $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;\n if (!isset ($uri)) {\n $uri = \"/\";\n }\n $uriencoded = implode(\"/\", array_map(array($this, \"_urlencode\"), explode(\"/\", $uri)));\n $data .= $uriencoded;\n $data .= \"\\n\";\n uksort($parameters, 'strcmp');\n $data .= $this->_getParametersAsString($parameters);\n return $data;\n }", "public function get_signable_parameters() {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n if (isset($params['oauth_signature'])) {\n unset($params['oauth_signature']);\n }\n\n return OAuthUtil::build_http_query($params);\n }", "protected static function _sign($parameters)\n\t{\n\t\t// Fixup our private key, copy-pasting the key might lead to whitespace faults\n\t\tif(!preg_match('/-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/si', Transip_ApiSettings::$privateKey, $matches))\n\t\t\tdie('<p>Could not find your private key, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');\n\n\t\t$key = $matches[2];\n\t\t$key = preg_replace('/\\s*/s', '', $key);\n\t\t$key = chunk_split($key, 64, \"\\n\");\n\n\t\t$key = \"-----BEGIN PRIVATE KEY-----\\n\" . $key . \"-----END PRIVATE KEY-----\";\n\n\t\t$digest = self::_sha512Asn1(self::_encodeParameters($parameters));\n\t\tif(!@openssl_private_encrypt($digest, $signature, $key))\n\t\t\tdie('<p>Could not sign your request, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');\n\n\t\treturn base64_encode($signature);\n\t}", "public function getSignedUrl(): string\n {\n $query = base64_encode(json_encode($this->buildQuery()));\n $signature = hash_hmac('sha256', $this->templateId . $query, $this->token);\n\n return $this->signedUrlBase . $this->templateId . '.png?' . http_build_query(['s' => $signature, 'v' => $query]);\n }", "protected function prepareSignature($uri, &$params)\n {\n $paramsToBeSigned = $params;\n $stringToBeSigned = '';\n\n // 1. Extract all query param EXCEPT ' sign ', ' access_token ', reorder the params based on alphabetical order.\n unset($paramsToBeSigned['sign'], $paramsToBeSigned['access_token']);\n ksort($paramsToBeSigned);\n\n // 2. Concat all the param in the format of {key}{value}\n foreach ($paramsToBeSigned as $k => $v) {\n if (!is_array($v)) {\n $stringToBeSigned .= \"$k$v\";\n }\n }\n\n // 3. Append the request path to the beginning\n $stringToBeSigned = $uri . $stringToBeSigned;\n\n // 4. Wrap string generated in step 3 with app_secret.\n $stringToBeSigned = $this->getAppSecret() . $stringToBeSigned . $this->getAppSecret();\n\n // Encode the digest byte stream in hexadecimal and use sha256 to generate sign with salt(secret).\n $params['sign'] = hash_hmac('sha256', $stringToBeSigned, $this->getAppSecret());\n }", "private function buildSigningBase(): string {\r\n $parameterString = http_build_query($this->clientParams);\r\n return \"$this->httpMethod&\" . urlencode($this->host . $this->endpoint) . \"&\" . urlencode($parameterString);\r\n }", "public static function generateSignature($params)\n {\n $queryParams = $params . getenv('API_KEY') . getenv('API_SECRET');\n $signature = md5($queryParams);\n\n return $signature;\n }", "function sign($param,$key){\n\n $sign = \"\";\n foreach($param as $k => $v){\n $sign .= $k.\"=\".$v.\"&\";\n }\n\n $sign .= \"key=\".$key;\n $sign = strtoupper(md5($sign));\n return $sign;\n\n}", "protected function generate_signature($method = null, $url = null, $params = null)\n\t{\n\t\tif (empty($method) || empty($url))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// concatenating\n\t\t$concat_params = '';\n\n\t\tforeach ($params as $k => $v)\n\t\t{\n\t\t\t$v = $this->encode_rfc3986($v);\n\t\t\t$concat_params .= \"{$k}={$v}&\";\n\t\t}\n\n\t\t$concat_params = $this->encode_rfc3986(substr($concat_params, 0, -1));\n\n\t\t// normalize url\n\t\t$normalized_url = $this->encode_rfc3986($this->normalize_url($url));\n\t\t$method = $this->encode_rfc3986($method); // don't need this but why not?\n\n\t\treturn $this->sign_string(\"{$method}&{$normalized_url}&{$concat_params}\");\n\t}", "private function getSignature()\n\t{\n\t\t$string_to_sign = mb_convert_encoding(\n\t\t\t$this->http_verb . $this->uri . $this->timestamp . $this->nonce,\n\t\t\t'UTF-8'\n\t\t);\n\t\treturn base64_encode(\n\t\t\thash_hmac(\n\t\t\t\t'sha1',\n\t\t\t\t$string_to_sign,\n\t\t\t\t$this->secret,\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t}", "protected function generate_signature($payload_params, $timestamp)\n {\n $payload = \"timestamp:{$timestamp}\"; \n foreach ($payload_params as $key => $value) {\n $payload = \"{$payload},{$key}:{$value}\";\n }\n $tmp_signature = hash_hmac(\"sha256\", $payload, $this->client_secret);\n $base64_signature = trim(base64_encode($tmp_signature));\n return $base64_signature;\n }", "public function getSignableParameters()\n {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n if (isset($params['oauth_signature'])) {\n unset($params['oauth_signature']);\n }\n\n return Utils::buildHttpQuery($params);\n }", "public function signature() {\r\n\t\t$signature = \"\";\r\n\t\tif ($this->isFinal) {\r\n\t\t\t$signature .= \"final \";\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->isPublic) {\r\n\t\t\t$signature .= \"public \";\r\n\t\t}\r\n\t\telseif ($this->isPrivate) {\r\n\t\t\t$signature .= \"private \";\r\n\t\t}\r\n\t\telseif ($this->isProtected) {\r\n\t\t\t$signature .= \"protected \";\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->isStatic) {\r\n\t\t\t$signature .= \"static \";\r\n\t\t}\r\n\t\t$signature .= \"function \".$this->name.\" \";\r\n\t\t$signature .= \"(\";\r\n\t\t$params = array();\r\n\t\tforeach($this->parameters as $parameter) {\r\n\t\t\t$params[] = $parameter->signature();\r\n\t\t}\r\n\t\t$signature .= implode(\", \",$params);\r\n\t\t$signature .= \")\";\r\n\t\treturn $signature;\r\n\t}", "public function getSignature()\n {\n $input = $this->getArgs();\n\n $str = \"\";\n foreach ($input as $key => $val) {\n $str .= $key . \"=\" . $val . \"&\";\n }\n\n $str .= \"password=\" . $this->config->password;\n return $this->hashFunction($str);\n }", "public static function generateSignatureBase(\\OAuth\\Request $request){\n\t\t$encoded_parameters = $request->encodeAndSortParameters();\n\n\t\t// apparently you don't use the multi-part params in auth, just the oauth params\n\t\tif($request->getMultipartFlag() === true){\n\t\t\t$new_params = [];\n\t\t\tforeach($encoded_parameters as $k=>$v){\n\t\t\t\tif(strpos($k, 'oauth') !== false)\n\t\t\t\t\t$new_params[$k] = $v;\n\t\t\t}\n\t\t\t$encoded_parameters = $new_params;\n\t\t}\n\t\t\n\t\t// start out signature_base with the parameters\n\t\t$signature_base = array();\n\t\tforeach($encoded_parameters as $k=>$v){\n\t\t\t$signature_base[] = $k.'='.$v;\n\t\t}\n\t\t$signature_base = implode('&', $signature_base);\n\n\t\treturn $request->getMethod().'&'.rawurlencode($request->getUrl()).'&'.rawurlencode($signature_base);\n\t}", "private function getSignature(): string {\r\n return base64_encode(hash_hmac(\"sha1\", $this->buildSigningBase(), $this->buildSigningKey(), true));\r\n }", "public static function getSignatureString($params, $secret) {\n $values = array();\n self::extractParamValues($params, $values);\n sort($values, SORT_STRING);\n $string = $secret . implode('', $values);\n return $string;\n }", "public function sign($http_method, $url, $params, $secret) {\n $sig = array(\n strtoupper($http_method),\n preg_replace('/%7E/', '~', rawurlencode($url)),\n rawurlencode($this->get_signable_parameters($params)),\n );\n\n $base_string = implode('&', $sig);\n $sig = base64_encode(hash_hmac('sha1', $base_string, $secret, true));\n return $sig;\n }", "function signUrl($myUrlToSign, $privateKey)\n{\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "public function buildSignatureString($httpmethod, $params, $oauth, $baseUrl) {\n $encodedParams = array();\n\n // Merge this query parameters array with the Oauth values array\n $mergedParams = array_merge($params, $oauth);\n\n // Sort alphabetically by key\n ksort($mergedParams);\n\n // Percent encode all these values\n foreach($mergedParams as $key => $value) {\n $encodedParams[] = rawurlencode($key) . '=' . rawurlencode($value);\n }\n\n // Append method with base URL and then split out all the key/values from array and percent encode them all as per docs\n return $signature = strtoupper($httpmethod) . '&' . rawurlencode($baseUrl) . '&' . rawurlencode(implode('&', $encodedParams));\n }", "protected function signRequest(array $wheres, $secret)\n {\n ksort($wheres);\n\n $parsedWheres = http_build_query($wheres, false, '&', PHP_QUERY_RFC3986);\n\n $signature = rawurlencode(\n base64_encode(\n hash_hmac('SHA1', strtolower($parsedWheres), $secret, true)\n )\n );\n\n return $parsedWheres . '&signature=' . $signature;\n }", "public function getSignature(RequestInterface $request, array $params)\r\n {\r\n\r\n // Remove oauth_signature if present\r\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\r\n unset($params['oauth_signature']);\r\n\r\n // Add POST fields if the request uses POST fields and no files\r\n $body = $request->getBody();\r\n if ($body instanceof PostBodyInterface && !$body->getFiles()) {\r\n $query = Query::fromString($body->getFields(true));\r\n $params += $query->toArray();\r\n }\r\n\r\n // Parse & add query string parameters as base string parameters\r\n $query = Query::fromString((string)$request->getQuery());\r\n $query->setEncodingType(Query::RFC1738);\r\n $params += $query->toArray();\r\n\r\n $baseString = $this->createBaseString(\r\n $request,\r\n $this->prepareParameters($params)\r\n );\r\n\r\n // changed code\r\n return base64_encode(hash_hmac('sha1', $baseString, $this->consumer_secret, true));\r\n }", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "protected function calculateStringToSign(array $parameters)\r\n {\r\n $stringToSign = 'GET' . \"\\n\";\r\n $stringToSign .= 'mws.amazonservices.com' . \"\\n\";\r\n $stringToSign .= '/Orders/2013-09-01' . \"\\n\";\r\n $stringToSign .= $this->getParameterString($parameters);\r\n\r\n return $stringToSign;\r\n }", "function signUrl($myUrlToSign, $privateKey) {\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "abstract public function build_signature($request, $consumer, $token);", "abstract public function build_signature($request, $consumer, $token);", "function _signParameters(array $parameters, $key) {\n $signatureVersion = $parameters['SignatureVersion'];\n $algorithm = \"HmacSHA1\";\n $stringToSign = null;\n if (2 === $signatureVersion) {\n $algorithm = $this->_config['SignatureMethod'];\n $parameters['SignatureMethod'] = $algorithm;\n $stringToSign = $this->_calculateStringToSignV2($parameters);\n } else {\n throw new Exception(\"Invalid Signature Version specified\");\n }\n return $this->_sign($stringToSign, $key, $algorithm);\n }", "public function signature( $oauth_params, $resource, $rest_method, &$request_params=null, $param_filter='', $encode=true )\n {\n // open data\n $data = strtoupper($rest_method) . \"&\" . urlencode($resource) . \"&\";\n\n // build request params\n $sig_params = $oauth_params->signature_parameters();\n //print_r($sig_params);\n\n // append params, no overwrite\n if( $request_params != null && is_array($request_params) )\n {\n\tforeach( $request_params as $k=>$v )\n\t{\n\t $uk = urlencode($k);\n\t if( !isset($sig_params[$uk]) && \n\t !isType($param_filter, $k) && \n\t !isType('oauth_signature|oauth_token_secret', $k))\n\t $sig_params[ $uk ] = $encode ? urlencode($v) : $v;\n\t}\n }\n\n // sort\n ksort( $sig_params, SORT_STRING );\n //print_r($sig_params);\n\n // key=value\n array_walk( $sig_params, create_function('&$i,$k', '$i = \"{$k}={$i}\";') );\n\n // delimit &\n $data .= implode( \"&\", $sig_params );\n\n //echo '<br />' . $data . '<br />';\n\n // sign with params\n return $oauth_params->sign( $data );\n }", "public function createSignature($base, $key)\r\n\t{\r\n\t\tif (function_exists('hash_hmac'))\r\n\t\t{\r\n\t\t\treturn base64_encode(hash_hmac('sha1', $base, $key, true));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn base64_encode($this->hmacsha1('sha1', $base, $key));\r\n\t\t}\r\n\t}", "private static function signRequest($key, $secret, $method, $request_url, $bodyHash, $timestamp, $nonce)\n {\n $signature = base64_encode(hash_hmac(\"sha256\", self::normalizeRequest($key, $method, $request_url, $bodyHash, $timestamp, $nonce), $secret, True));\n return $signature;\n }", "public function signResource( $url )\n\t{\n\t\tif ( $this->OAuthSecret ) {\n\t\t\t$sig = $this->generate_signature( null, null, $url );\n\t\t\t$oauth_params = array (\n\t\t\t\t'oauth_version' => '1.0',\n\t\t\t\t'oauth_nonce' => $this->oauth_nonce,\n\t\t\t\t'oauth_timestamp' => $this->oauth_timestamp,\n\t\t\t\t'oauth_consumer_key' => $this->APIKey,\n\t\t\t\t'oauth_signature_method' => $this->oauth_signature_method,\n\t\t\t\t'oauth_token'\t\t\t\t=> $this->oauth_token,\n\t\t\t\t'oauth_signature' => $sig\n\t\t\t\t);\n\n\t\t\t// Build and return the query string.\n\t\t\treturn $url . '?' . http_build_query( $oauth_params );\n\t\t}\n\t}", "protected function calculateSignature($stringToSign)\r\n {\r\n $signature = hash_hmac(\"sha256\", $stringToSign, $this->secretKey, true);\r\n return urlencode(base64_encode($signature));\r\n }", "protected function _signParameters(array $parameters, $key) {\n $algorithm = $this->options['SignatureMethod'];\n $stringToSign = null;\n if (2 === $this->options['SignatureVersion']) {\n $stringToSign = $this->_calculateStringToSignV2($parameters);\n// var_dump($stringToSign);\n } else {\n throw new Exception(\"Invalid Signature Version specified\");\n }\n return $this->_sign($stringToSign, $key, $algorithm);\n }", "public function sign($uri)\n {\n $url = parse_url($uri);\n if (isset($url['query'])) {\n parse_str($url['query'], $params);\n } else {\n $params = array();\n }\n\n $uri = $this->buildUrl($url, $params);\n\n return $uri.(false === (strpos($uri, '?')) ? '?' : '&').'_hash='.$this->computeHash($uri);\n }", "public function generateSignature(string $toSign): GenerateSignatureResponse;", "public static function getSignature($params, $apiKey)\n {\n if (is_object($params)) {\n $params = (array) $params;\n }\n\n $signature = '';\n if (is_array($params)) {\n // set keys to lower case\n $params = array_change_key_case($params, CASE_LOWER);\n // order by alpha.\n ksort($params);\n\n foreach ($params as $name => $valeur) {\n // if object, cast as array, we are in node\n if (is_object($valeur)) {\n $valeur = (array) $valeur;\n }\n\n // if key is not \"Signature\"\n if (strcasecmp($name, 'signature') != 0) {\n // if object\n if (is_array($valeur)) {\n // set values to lower case\n $valeur = array_change_key_case($valeur, CASE_LOWER);\n // order by alpha.\n ksort($valeur);\n\n // parse node values and assign value\n foreach ($valeur as $v) {\n $signature .= $v . '$';\n }\n } else {\n // if it's a value\n $signature .= $valeur . '$';\n }\n }\n }\n } else {\n $signature = $params . '$';\n }\n\n $signature .= $apiKey;\n return sha1($signature);\n }", "protected function _calculateStringToSignV2(array $parameters) {\n $data = 'POST';\n $data .= \"\\n\";\n $endpoint = parse_url ($this->urlbase.$this->urlbranch);\n $data .= $endpoint['host'];\n $data .= \"\\n\";\n $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;\n if (!isset ($uri)) {\n \t$uri = \"/\";\n }\n $uriencoded = implode(\"/\", array_map(array($this, \"_urlencode\"), explode(\"/\", $uri)));\n $data .= $uriencoded;\n $data .= \"\\n\";\n uksort($parameters, 'strcmp');\n $data .= $this->_getParametersAsString($parameters);\n return $data;\n }", "private function generate_signature( $apicall, $apiargs = NULL, $url = NULL )\n\t {\n\t\t$this->oauth_timestamp = time();\n\t\t$this->oauth_nonce = md5(time() . mt_rand());\n\n\t\tif ( !is_null( $apicall ) && $apicall != 'Upload' ) {\n\t\t\tif ( substr( $apicall,0,8 ) != 'smugmug.' ) {\n\t\t\t\t$apicall = 'smugmug.' . $apicall;\n\t\t\t}\n\t\t}\n\t\tif ( $this->oauth_signature_method == 'PLAINTEXT' ) {\n\t\t\treturn phpSmug::urlencodeRFC3986( $this->OAuthSecret ).'&'.phpSmug::urlencodeRFC3986( $this->oauth_token_secret );\n\t\t} else {\n\t\t\t$this->oauth_signature_method = 'HMAC-SHA1';\n\t\t\t$encKey = phpSmug::urlencodeRFC3986( $this->OAuthSecret ) . '&' . phpSmug::urlencodeRFC3986( $this->oauth_token_secret );\n\t\t\t\n\t\t\tif ( is_null( $apicall ) && !is_null( $url ) ) {\n\t\t\t\t$endpoint = $url;\n\t\t\t} else if ( strpos( $apicall, 'Token' ) || $this->secure && $apicall != 'Upload' ) {\n\t\t\t\t$endpoint = \"https://secure.smugmug.com/services/api/php/{$this->APIVer}/\";\n\t\t\t} else if ( $apicall == 'Upload' ) {\n\t\t\t\t//$proto = ( $this->oauth_signature_method == 'PLAINTEXT' || $this->secure ) ? 'https' : 'http';\n\t\t\t\t//$endpoint = $proto . '://upload.smugmug.com/'.$apiargs['FileName'];\t// No support for secure uploads yet\n\t\t\t\t$endpoint = 'http://upload.smugmug.com/'.$apiargs['FileName'];\n\t\t\t} else {\n\t\t\t\t$endpoint = \"http://api.smugmug.com/services/api/php/{$this->APIVer}/\";\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_null( $apicall ) ) {\n\t\t\t\t$method = 'GET';\n\t\t\t} else if ( $apicall == 'Upload' ) {\n\t\t\t\t$method = 'PUT';\n\t\t\t} else {\n\t\t\t\t$method = 'POST';\n\t\t\t}\n\t\t\t$params = array (\n\t\t\t\t'oauth_version' => '1.0',\n\t\t\t\t'oauth_nonce' => $this->oauth_nonce,\n\t\t\t\t'oauth_timestamp' => $this->oauth_timestamp,\n\t\t\t\t'oauth_consumer_key' => $this->APIKey,\n\t\t\t\t'oauth_signature_method' => $this->oauth_signature_method\n\t\t\t\t);\n\t\t\tif ( !is_null( $apicall ) && $apicall != 'Upload' ) $params = array_merge( $params, array('method' => $apicall ) );\n\t\t\t$params = ( !empty( $this->oauth_token ) ) ? array_merge( $params, array( 'oauth_token' => $this->oauth_token ) ) : $params;\n\t\t\tif ( $apicall != 'Upload' ) $params = ( !empty( $apiargs ) ) ? array_merge( $params, $apiargs ) : $params;\n\t\t $keys = array_map( array( 'phpSmug', 'urlencodeRFC3986' ), array_keys( $params ) );\n\t\t $values = array_map( array( 'phpSmug', 'urlencodeRFC3986' ), array_values( $params ) );\n\t\t\t$params = array_combine( $keys, $values );\n\t\t // Sort by keys (natsort)\n\t\t uksort( $params, 'strnatcmp' );\n\t\t\t// We can't use implode() here as it plays havoc with array keys with empty values.\n\t\t\t$count = count( $params );\n\t\t\t$string = '';\n\t\t\tforeach ( $params as $key => $value ) {\n\t\t\t\t$count--;\n\t\t\t\t$string .= $key . '=' . $value;\n\t\t\t\tif ( $count )\t{\n\t\t\t\t\t$string .= '&';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$base_string = $method . '&' . phpSmug::urlencodeRFC3986( $endpoint ) . '&' . phpSmug::urlencodeRFC3986( $string );\n\t\t\t$sig = base64_encode( hash_hmac( 'sha1', $base_string, $encKey, true ) );\n\t\t\treturn $sig;\n\t\t}\n\t }", "protected function _getSignature($httpMethod, $url, $oauthTokenSecret, $oauthParameters, $parameters = array()) {\n\t\t$encodedParameters = array();\n\t\tforeach ($parameters as $key => $value) {\n\t\t\t$encodedParameters[rawurlencode($key)] = rawurlencode($value);\n\t\t}\n\t\tforeach ($oauthParameters as $key => $value) {\n\t\t\t$encodedParameters[rawurlencode($key)] = rawurlencode($value);\n\t\t}\n\t\tksort($encodedParameters, SORT_STRING);\n\n\t\t$parameterString = \"\";\n\t\t$numberOfParameters = count($encodedParameters);\n\t\tforeach ($encodedParameters as $key => $value) {\n\t\t\t$parameterString .= \"$key=$value\";\n\t\t\t$numberOfParameters--;\n\t\t\tif ($numberOfParameters > 0) {\n\t\t\t\t$parameterString .= '&';\n\t\t\t}\n\t\t}\n\t\t$signatureBaseString = strtoupper($httpMethod) . '&' . rawurlencode($url) . '&' . rawurlencode($parameterString);\n\t\t$signingKey = rawurlencode(Configure::Read('TWITTER_SECRET')) . '&' . rawurlencode($oauthTokenSecret);\n\t\t$signature = base64_encode(hash_hmac('sha1', $signatureBaseString, $signingKey, true));\n\t\treturn $signature;\n\t}", "function create_signature($data, $private_key) {\n\topenssl_sign($data, $raw_signature, $private_key);\n return base64_encode($raw_signature);\n}", "public function getSignature() : string\n {\n\n return $this->httpMethod . ':' . $this->uri;\n }", "public function getSignature()\n {\n $signString= sprintf(\"%s\\n%s\\n%s\\n%d\", $this->topic, $this->consumerId, $this->message->getMessageHandle(), $this->time);\n return base64_encode(hash_hmac('sha1', $signString, $this->getAuthorization()->getAccessSecret(), true));\n }", "public function build_signature($request, $consumer, $token) {\n $key_parts = array(\n $consumer->secret,\n ($token) ? $token->secret : \"\"\n );\n\n $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);\n $key = implode('&', $key_parts);\n $request->base_string = $key;\n\n return $key;\n }", "private function signQuery($query)\n {\n $stringToSign = \"GET\\n$this->host\\n$this->requestURI\\n$query\";\n $signature = base64_encode(hash_hmac('sha256', $stringToSign, $this->AWSSecretKey, true));\n $signature = str_replace(\"%7E\", \"~\", rawurlencode($signature));\n \n return $signature;\n }", "private function _sign_signature_v4($bodyParams)\n\t{\n $ldt = gmdate(self::ISO8601_BASIC);\n $sdt = substr($ldt, 0, 8);\n $parsed = [\n 'method' => 'POST',\n 'path' => '/',\n 'query' => [],\n\t\t\t'uri' => 'https://email.' . $this->region . '.amazonaws.com/',\n 'headers' => [\n\t\t\t\t\t\t\t'host' => ['email.' . $this->region . '.amazonaws.com'],\n\t\t\t\t\t\t\t'x-amz-date' => [date(DATE_RSS)],\n\t\t\t\t\t\t\t],\n 'body' => $bodyParams,\n 'version' => 'HTTP/1.1'\n ];\n\t\t$cs = $this->createScope($sdt, $this->region, $this->service);\n\t\t$this->credentialScope = $cs;\n\t\t$payload = http_build_query($bodyParams); \n\n $context = $this->createContext($parsed, hash('sha256', $payload));\n\t\t$toSign = $this->createStringToSign($ldt, $cs, $context['creq']);\n\n $signingKey = $this->getSigningKey(\n $sdt,\n \\Config::get('ses.region'),\n 'ses',\n \\Config::get('ses.secret_key')\n\t\t);\n\t\t\n\t\t$signature = hash_hmac('sha256', $toSign, $signingKey);\n\t\t$accessKey = \\Config::get('ses.access_key');\n $parsed['headers']['Authorization'] = [\n \"AWS4-HMAC-SHA256 \"\n . \"Credential={$accessKey}/{$cs}, \"\n . \"SignedHeaders=host;x-amz-date, Signature={$signature}\"\n\t\t];\n\t\t\n\t\treturn implode(\"\", $parsed['headers']['Authorization']);\n\t}", "protected function generateSignature($pathQueryString)\n\t\t\t{\n\t\t\t\t$decodedSigningKey = self::base64DecodeUrlSafe($this->getSigningKey());\n\n\t\t\t\t$signature = hash_hmac('sha1', $pathQueryString, $decodedSigningKey, true);\n\t\t\t\t$signature = self::base64EncodeUrlSafe($signature);\n\n\t\t\t\treturn $signature;\n\t\t\t}", "function BASE64URL_digital_generate($dato, $privatekey)\n \t{\n $privres = openssl_pkey_get_private(array($privatekey,null));\n\n if (!$privres)\n {\n die(\"Private key is not valid\");\n\n }\n\n $firma = \"\";\n\n $resp = openssl_sign($dato,$firma,$privres);\n\n openssl_free_key($privres);\n\n if($resp){\n\n $base64 = base64_encode($firma);\n\n $crypttext = preg_replace('/(\\\\/)/' ,'_',$base64);\n $crypttext = preg_replace('/(\\+)/','-',$crypttext);\n $crypttext = preg_replace('/(=)/' ,'.',$crypttext);\n\n //$urlencoded = urlencode($base64);\n return $crypttext;\n }\n else{\n die(\"RSA Signature was unsuccesful\");\n }\n\n \t}", "protected function getRequestSignature($fields)\n {\n $hash = $this->generateHash($fields);\n\n $keyId = openssl_get_privatekey($this->privateKey);\n openssl_sign($hash, $signature, $keyId);\n openssl_free_key($keyId);\n\n $result = base64_encode($signature);\n return $result;\n }", "public function getSignature();", "protected function getRequestSignature($fields)\n {\n $hash = $this->generateHash($fields);\n\n $keyId = openssl_get_privatekey($this->privateKey);\n openssl_sign($hash, $signature, $keyId);\n openssl_free_key($keyId);\n\n $result = base64_encode($signature);\n\n return $result;\n }", "function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }", "public function createRequestSignature(Request $request, $salt);", "function __sign_query($verb, $uri, $query, $headers, $expires=5) {\n\t\t\t/* make sure all of query and headers uses lowercased s3objects for us */\n\t\t\t$query = array_change_key_case($query, CASE_LOWER);\n\t\t\t$headers = array_change_key_case($headers, CASE_LOWER);\n\t\t\t\n\t\t\t/* nat sort our header s3objects */\n\t\t\tuksort($headers, Array($this, '__nat'));\n\n\t\t\t/* build string to sign */\n\t\t\t$parts = Array();\n\t\t\t\n\t\t\t$parts[] = strtoupper($verb);\n\t\t\t$parts[] = $headers['content-md5'];\n\t\t\t$parts[] = $headers['content-type'];\n\t\t\t\n\t\t\t/* figure out the seconds since epoch right now, and add expires seconds to it,\n\t\t\t\tthats our expires time */\n\t\t\t$expires += time();\n\t\t\t$parts[] = $expires;\n\t\t\t\n\t\t\t/* go through all headers */\n\t\t\tforeach($headers AS $s3object=>$val) {\n\t\t\t\tif (substr($s3object, 0, 6) == 'x-amz-') {\n\t\t\t\t\t/* trim $val */\n\t\t\t\t\t$val = trim($val);\n\t\t\t\t\t/* add to parts */\n\t\t\t\t\t$parts[] = $s3object.':'.$val;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (in_array('acl', $query) || array_key_exists('acl', $query)) $uri .= '?acl';\n\t\t\tif (in_array('torrent', $query) || array_key_exists('torrent', $query)) $uri .= '?torrent';\n\n\t\t\t$parts[] = $uri;\n\t\t\t\n\t\t\t$string = implode(\"\\n\", $parts);\n\t\t\t\n\t\t\t/* return the (rest of the) query string */\n\t\t\treturn ((strpos($uri, '?') !== FALSE)?'&':'?').'Signature='.\n\t\t\t\turlencode(base64_encode(hash_hmac('sha1', $string, $this->GetSecretKey(), TRUE))).\n\t\t\t\t'&Expires='.$expires.'&AWSAccesss3objectId='.$this__awss3objectid;\n\t\t}", "public function prepareUrl(&$parameters, $upload = FALSE) {\n $parameters['apiKey'] = variable_get('issuu_global_apikey', '');\n $parameters['format'] = 'json';\n \n $this->signRequest($parameters);\n \n $get_array = array();\n foreach ($parameters as $key => $val) {\n $get_array[] = $key . '=' . urlencode($val);\n }\n $get_string = implode('&', $get_array);\n \n $base = ISSUU_URI;\n if ($upload) {\n return array(ISSUU_URI_UPLOAD, $get_string);\n }\n\n return sprintf('%s?%s', $base, $get_string);\n }", "public function sign($url) {\n $url_parts = parse_url($url);\n $name_value_pairs = isset($url_parts['query']) ? explode(\"&\",$url_parts['query']) : array();\n $query_string_params = array();\n foreach($name_value_pairs as $nvp) {\n $param = explode('=',$nvp);\n $query_string_params[urldecode($param[0])] = count($param>1) ? urldecode($param[1]) : \"\";\n }\n\n if(!isset($url_parts['port'])) \n $port = \"\";\n else \n $port = \":\".$url_parts['port'];\n\n $url_no_params = $url_parts['scheme'].\"://\".$url_parts['host'].$port.$url_parts['path'];\n $req = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, \"GET\", $url_no_params, $query_string_params);\n $req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, $this->access_token);\n $signed_url = $req->to_url();\n // dbg(\"Authorized $url as $signed_url\");\n return $signed_url;\n }", "function payment_sign($query, $api_key) {\n $clear_text = '';\n ksort($query);\n foreach ($query as $key => $value) {\n if (substr($key, 0, 2) === \"x_\") {\n $clear_text .= $key . $value;\n }\n }\n $hash = hash_hmac(\"sha256\", $clear_text, $api_key);\n return str_replace('-', '', $hash);\n }", "public function getSha1Sign ()\n {\n $arrayToHash = array();\n foreach ($this->_params as $key => $value) {\n if ($value != '' && $this->isValidParam($key)) {\n $arrayToHash[] = strtoupper($key) . '=' . $value .\n $this->_config['sha1InPassPhrase'];\n }\n }\n asort($arrayToHash);\n $stringToHash = implode('', $arrayToHash);\n return sha1($stringToHash);\n }", "public static function formatSimpleSignature(string $signature, int $length): string\n {\n return 's--' . substr($signature, 0, $length) . '--';\n }", "private function signature(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\t\n\t\t\t$data = $this->_request['data'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$sig_name = strtolower(preg_replace(\"/[\\W\\s+]/\",\"\", $first_name.'_'.$last_name.'_'.$current_datetime->format('Y-m-d_His')));\n\t\t\t$signature = base64_decode(str_replace(\"data:image/png;base64,\",\"\",$data));\n\t\t\t$result=file_put_contents(\"../signatures/\".$sig_name.\".png\",$signature);\t\n\t\t\tif($result){\n\t\t\t\t $this->response($sig_name.'.png', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Signature Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\n\t\t}", "public function SetSignatureParameter() {\n $signature_text = $this->signature->build_signature($this->request, $this->consumer, $this->token);\n $this->request->set_parameter('signature', $signature_text);\n return $this;\n }", "function sign($date) {\n $key = base64_decode('MIIEowIBAAKCAQEA5NmI8GIsupuvOMXR4yfs8hK2RUmX/CKlHmLEr/b1mPr/gx+fenafOSKoXs7OUvUxF/CR0EW6iUJvJ9lmTACTZFsTfF+mSJZ76dpuh6J8BQj9lpnH+AEp05LqLr2zvlzkksrjYSW4hfaZqfUZDk8YvGsdBqDpWrEykD16R5Jv5Iw/Y13Jd99F5zYU+Z3M+XdBSrFSaDwU5GeiOQVyl8q/Bt9gY7O1HfqYY9udXmAzPfEaZdCqCj7B8V8Sj7Wc92TZ/fHabZFKzfhVwfHCAzK4mQZ1be8snJd1f9R2peqjzBEINGdOnAnm0rGItKZJY91LMYi5H6Wh/Qh21CYY4Ne2wwIDAQABAoIBAEKXQg+goZ9TOfNtLJvKvFncNAmJVp5Zfm6PEuiZFfID52HCS+eYqNA5U4Dy8HqXOkfbCrLt90+Fc07HJcsrx7fGAK+KLZqlnzz3AH6bOzdD3HZ8HQH/ZKpZ76bWMH1ODnzgaLWWAlGI5kHcPgQ549q/2FxbakunkC0ElpZI+CIqWEf0zNfTXOpExMWx+FENntk/qpHijE+zcbh1/cy8Bsmj0WcXZ3aTDElG3XCC21rPd7zgrFeL6Sy26Br0eqxqddatghZHB5PhZYE4BYM3AlZTZVfuDHogXn4BXILTyV+oQHNUzHKjStfVryJnslnWVAF5whaXGm1fyRY3WBAEmuECgYEA+AivBccqnKfgB7BTDTUMCdt7v+vVbR7CEZc5/jCRy+N0R6NN/L/+LdAAjsodjzVmkLOUzPbZhw72hHXA63RijAhSDeg8IdCUY1YVygyr5KZpHRnn96XJOucPCCFWFfiToJ2Qz+JfZMBUt9HhsSWGS2jF2hUGjixhRwFwTd5xtYsCgYEA7DMe0bJeF336UtgrY9MNVC1sc/A8sEeYtlr47rcLlRDboaO9PRsuIMssxiZ/9uRkYP1FDmS3S8pgwg4UuoVUYHg5Tt95iq3aK0BRQnpKuGIerbBCwFUBZMwpP1DW3fMKtOQ5pjoV74tqR+df7gD0hWlfMFV8WUP9vXLa+XBcWqkCgYEA85sbw3IEsQ3UY9jTCSKzqy7NUQcgfGb8NmiwBa7QU08XUpDatMYgsAAdvCBYfeH11WL7X3+G0DZq+lfo3ZhWfbBiXtRb0t5YD2RqTCK75PtoO7PI95r1lAuB4PtU4Ile/R4kL3jnNj4MNupFX0Y6qu/BetqxsIt4E1QfZ+t1BNcCgYBrDiCB2t5at3al5eSEsjvwU0Y8pj5bh5fnzwPU7pIJVkK12IkFETSvGGeKyBhnxszYSPLruyp455lDWy55+8RqlRMkdJWaDYI86EHsZ5FGUPKmtqUKl3yyOvbXA8TfhDDuHCMk/F7E2+OoA26vaS9q6H+EYLqjmvV+0Hf/ZrX1QQKBgGd8r9wi+fPG3IgGXHBQjmnVgaPNsvQzBKFmHrER0/iLZuA9A2R5x7DxZdHUSRWaPADIaHiU1O9jbNJCk7Jtnqn7M85Q0SRsqZhA2+28/1bmqrTkQmT7T9Q4+hUEN+qehZx83BkRYaP1QWuH11UcRxFr+O3HNXlC9mAG/zt6HhuV');\n $sig = hash_hmac('SHA1', $date, $key, true);\n $sig = base64_encode($sig);\n return $sig;\n }", "public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string\n {\n $aUrl = parse_url($sUrlToSign);\n $aUrl['query'] .= '&client=' .$sClientId;\n\n $aUrlToSign = $aUrl['path'].\"?\".$aUrl['query'];\n\n $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey));\n\n $sSignature = hash_hmac(\"sha1\", $aUrlToSign, $decodedKey, true);\n\n $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature));\n\n $sOriginalUrl = $aUrl['scheme'].\"://\".$aUrl['host'].$aUrl['path'] . \"?\".$aUrl['query'];\n\n return $sOriginalUrl. '&signature='. $sEncodedSignature;\n }", "private function GenerateSignData()\n {\n $sign_data = [\n isset($this->form_parameters['merchantId']) ? $this->form_parameters['merchantId'] : '',\n isset($this->form_parameters['orderRef']) ? $this->form_parameters['orderRef'] : '',\n isset($this->form_parameters['currCode']) ? $this->form_parameters['currCode'] : '',\n isset($this->form_parameters['amount']) ? $this->form_parameters['amount'] : '',\n isset($this->form_parameters['payType']) ? $this->form_parameters['payType'] : '',\n isset($this->form_parameters['secureHashSecret']) ? $this->form_parameters['secureHashSecret'] : '',\n ];\n\n return implode('|', $sign_data);\n }", "public static function sign_base_string($algo, $string_to_sign, $consumer_secret, $token_secret)\n\t{\n\t\t$algo = strtoupper($algo);\n\n\t\t$key = SPUtils::join_encoded3896($consumer_secret, $token_secret);\n\n\t\tif ($algo == \"HMAC-SHA1\")\n\t\t{\n\t\t\treturn base64_encode(hash_hmac(\"sha1\", $string_to_sign, $key, true));\n\t\t}\n\t\telse if ($algo == \"PLAINTEXT\")\n\t\t{\n\t\t\treturn SPOAuthClient::rfc3986_encode($key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrigger_error(\"$algo signature method not supported\");\n\t\t}\n\t}", "private static function generateSignature() {\n $result = microtime(true);\n return substr($result, -7);\n }", "public function generateSignature($signingString, $secret)\n {\n // base64-encode the binary result of the HMAC computation.\n\n return base64_encode(hash_hmac(\n 'sha256',\n $signingString,\n pack(\"H*\", $secret),\n true\n ));\n }", "private static function sign($value)\n {\n return config('encoder_service.sign') . $value;\n }", "protected function createCanonicalRequest()\n {\n $allheaders = array_merge($this->options[\"headers\"], $this->headers);\n\n // get all parts\n $method = $this->options[\"method\"];\n $path = $this->encodePath($this->options[\"path\"]);\n $query = $this->createQueryString($this->options[\"query\"]);\n $headers = $this->createHeaderString($allheaders);\n $this->signedHeaders = $this->createSignedHeaderString($allheaders); // save to $this as it will be used later\n $body = hash($this->algo, $this->options[\"body\"]);\n\n $canonical = \"{$method}\\n{$path}\\n{$query}\\n{$headers}\\n{$this->signedHeaders}\\n{$body}\";\n\n return hash($this->algo, $canonical);\n }", "public function createSignature($data, $method = 'sha1') : string\n {\n $hash = $method(rtrim(implode('.', [\n $data[static::TIMESTAMP],\n $data[static::MERCHANT_ID],\n $data[static::ORDER_ID],\n $data[static::AMOUNT],\n $data[static::CURRENCY],\n ]), '.'));\n\n return $method($hash . '.' . $this->getSharedSecret());\n }", "private function sign_url( $myUrlToSign, $privateKey ) {\n\t\t\t// parse the url\n\t\t\t$url = parse_url( $myUrlToSign );\n\n\t\t\t$urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n\t\t\t// Decode the private key into its binary format\n\t\t\t$decodedKey = $this->decode_Base64UrlSafe( $privateKey );\n\n\t\t\t// Create a signature using the private key and the URL-encoded\n\t\t\t// string using HMAC SHA1. This signature will be binary.\n\t\t\t$signature = hash_hmac( \"sha1\", $urlPartToSign, $decodedKey, true );\n\n\t\t\t$encodedSignature = $this->encode_Base64UrlSafe( $signature );\n\n\t\t\treturn $myUrlToSign . \"&signature=\" . $encodedSignature;\n\t\t}", "private function signRequest($auth_header) {\r\n\t\t$signature = $this->makeBase64HmacSha256(\r\n\t\t\t\t$this->makeDataToSign($auth_header), $this->makeSigningKey($this->timestamp)\r\n\t\t);\r\n\r\n\t\t$this->verbose('signature', $signature);\r\n\t\treturn $signature;\r\n\t}", "public static function getSignature($string)\n\t{\n\t\treturn 'AWS '.self::$__accessKey.':'.self::getHash($string);\n\t}", "public function sign(array $args);", "static public function getRequestString($params)\n {\n // Create token header as a JSON string\n $header = json_encode(['alg' => 'HS256', 'typ' => 'JWT']);\n\n // Encode Header to Base64Url String\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($header));\n\n $payload = json_encode($params);\n\n // Encode Payload to Base64Url String\n $base64UrlPayload = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($payload));\n\n // Create Signature Hash\n $signature = hash_hmac('sha256', $base64UrlHeader . \".\" . $base64UrlPayload, getenv('AMTEL_SECRET'), true);\n\n // Encode Signature to Base64Url String\n $base64UrlSignature = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($signature));\n\n // Create JWT\n return $base64UrlHeader . \".\" . $base64UrlPayload . \".\" . $base64UrlSignature;\n }", "public function signedRoute($name, $parameters = [], $expiration = null)\n {\n \t\n $parameters = $this->formatParameters($parameters);\n\n if ($expiration) {\n $parameters = $parameters + ['expires' => $this->availableAt($expiration)];\n }\n\n ksort($parameters);\n\n $key = call_user_func($this->keyResolver);\n\n return $this->route($name, $parameters + [\n 'signature' => hash_hmac('sha1', $this->route($name, $parameters), $key),\n ]);\n }", "function apiGenerateKey( $http_method, $url, $query, $headers )\n {\n // ordered and scrubbed headers: date,content-type,content-length;\n $canonicalizedHeaders = '';\n $desiredHeaders = array('date','content-type','content-length');\n $headerData = array();\n rsort($headers);\n foreach ( $headers as $header )\n {\n $pos = strpos($header,':');\n if ( $pos )\n {\n $name = strtolower(trim(substr($header,0,$pos)));\n $value = substr($header,$pos+1);\n $headerData[$name] = trim($value);\n if ( in_array($name,$desiredHeaders) )\n {\n $canonicalizedHeaders .= $name .':'. trim(str_replace(array('\\n','\\r'),' ',$value)).\"\\n\";\n }\n }\n }\n $canonicalizedHeaders = trim($canonicalizedHeaders);\n\n // just the clean url path - JS LOGIC IS DIFF - gets up to ? OR all url - this is prob wrong on zack's part, ignoring fragment\n // js logic would include fragment if no ? is found\n $url_parts = $this->parseUrl($url);\n $canonicalizedResource = ( !empty($url_parts) && !empty($url_parts['path']) ) ? trim($url_parts['path']) : '';\n\n // array of: date,content-type,http method;\n $requestMethod = strtoupper($http_method);\n\n /// hash of the body - md5\n $hashedData = md5($query);\n $signingString = \"{$requestMethod}\\n\".\n \"{$hashedData}\\n\".\n \"{$canonicalizedHeaders}\\n\".\n \"{$canonicalizedResource}\";\n $computedHash = base64_encode(hash_hmac('md5', $signingString, $this->api['key_secret'], true ));\n\n /// share public key are our hash\n return \"{$this->api['key_public']}:{$computedHash}\";# \\n\\n header order: $h \\n\\n Signing String:\\n $signingString\";\n }", "private function buildSigningKey(): string {\r\n return \"$this->secret&$this->userSecret\";\r\n }", "public function createSignUrl ($file_ext) {\n\n // create a signed url for video upload\n $credentials = new Aws\\Credentials\\Credentials($this->settings['s3_bucket']['access_key'], $this->settings['s3_bucket']['secret_key']);\n $client = new S3Client([\n 'version' => 'latest',\n 'region' => 'eu-west-1',\n 'credentials' => $credentials\n ]);\n $bucket = $this->settings['s3_bucket']['bucket_tmp'];\n $filename = uniqid() . \".\" .$file_ext;\n\n $cmd = $client->getCommand('PutObject', [\n 'Bucket' => $bucket,\n 'Key' => $filename,\n ]);\n\n $aws_request = $client->createPresignedRequest($cmd, '+20 minutes');\n\n // Get the actual presigned-url\n $presignedUrl = (string) $aws_request->getUri();\n\n $data = [\n \"signedUrl\" => $presignedUrl,\n \"key\" => $filename\n\n ];\n\n return $data;\n }", "public function createPackageStr($params)\n {\n $out_trade_no = $params['productid'];\n $fee = $params['money_paid'];\n $opts = array(\n 'bank_type' => 'WX',\n 'body' => $params['subject'],\n 'partner' => $this->getPartner(),\n 'out_trade_no' => $out_trade_no,\n 'total_fee' => abs($fee) * 100,\n 'fee_type' => 1,\n 'notify_url' => isset($params['notify_url']) ? $params['notify_url'] : $this->getNotifyUrl(),\n 'spbill_create_ip' => '127.0.0.1',\n 'input_charset' => 'UTF-8'\n );\n ksort($opts);\n $qstr = http_build_query($opts);\n $sign = strtoupper(md5(urldecode($qstr) . '&key=' . $this->getPartnerKey()));\n\n return $qstr . '&sign=' . $sign;\n }", "public function createSignature($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->createSignatureWithOptions($request, $runtime);\n }", "public function createSignatureWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->signatureKey)) {\n $query['SignatureKey'] = $request->signatureKey;\n }\n if (!Utils::isUnset($request->signatureName)) {\n $query['SignatureName'] = $request->signatureName;\n }\n if (!Utils::isUnset($request->signatureSecret)) {\n $query['SignatureSecret'] = $request->signatureSecret;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'CreateSignature',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return CreateSignatureResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function getSign($fields)\n {\n }", "public function signPayload($payload, $secret, $timestamp = 'now')\n {\n if ($timestamp == 'now') {\n $timestamp = time();\n }\n\n $payload = is_string($payload) ? $payload : json_encode($payload);\n $timedPayload = \"$timestamp.$payload\";\n $value = $this->computeSignature($timedPayload, $secret);\n\n $signature = \"t=$timestamp,v=$value\";\n return $signature;\n }", "public function buildUrl(array $params) {\n $params = array_merge(\n $this->getParamsForRequest(),\n $params\n );\n\t\tif (!isset($params['format']))\n\t\t\t$params['format'] = 'php_serial';\n return $this->rest_url . '?' . $this->signParams($params);\n }", "final public static function generateGroomerSignature(...$strings) : string {\n\n // Initialize the string.\n $signature = '';\n\n // Append all the strings, separated by \".\".\n end($strings);\n $last_key = key($strings);\n foreach ($strings as $key => $text) {\n $signature .= $text;\n if ($key !== $last_key) {\n $signature .= '.';\n }\n }\n\n // Return the signature from the function call.\n return $signature;\n }", "protected function sign($operation) {\r\n\t\r\n\t\t$params = array(\r\n\t\t\t'AWSAccessKeyId' => $this->accesskey,\r\n\t\t\t'Timestamp' => gmdate('Y-m-d\\TH:i:s.000\\Z'),\r\n\t\t);\r\n\r\n\t\t$sign_str = 'AmazonS3' . $operation . $params['Timestamp'];\r\n\t\t\r\n\t\t$params['Signature'] = base64_encode(hash_hmac('sha1', $sign_str, $this->secretkey, TRUE));\r\n\t\t\r\n\t\treturn $params;\r\n\t}", "public function sign()\n {\n }", "protected function genQuery(){\n $secretKey = $this->store->getSecretAccessKey();\n \n unset($this->options['Signature']);\n $this->options['Timestamp'] = $this->genTime();\n $this->options['Signature'] = $this->_signParameters($this->options, $secretKey);\n return $this->_getParametersAsString($this->options);\n }", "function signPolicy($policy) {\n if (!function_exists('binsha1'))\n {\n if (version_compare(phpversion(), \"5.0.0\", \">=\")) {\n function binsha1($d) { return sha1($d, true); }\n } else {\n function binsha1($d) { return pack('H*', sha1($d)); }\n }\n }\n\n $aws_secret = $this->_secretAccessKey;\n\n if (strlen($aws_secret) == 40)\n $aws_secret = $aws_secret.str_repeat(chr(0), 24);\n\n $ipad = str_repeat(chr(0x36), 64);\n $opad = str_repeat(chr(0x5c), 64);\n\n $hmac = binsha1(($aws_secret^$opad).binsha1(($aws_secret^$ipad).$policy));\n return base64_encode($hmac);\n }" ]
[ "0.7193946", "0.7172373", "0.70695317", "0.70535463", "0.7001584", "0.6977871", "0.6973665", "0.69485575", "0.68774813", "0.6853568", "0.68328834", "0.67862785", "0.6766751", "0.6756242", "0.6714858", "0.67004675", "0.6683943", "0.6654663", "0.6631227", "0.6628554", "0.6587536", "0.65629697", "0.65353197", "0.65093225", "0.6507445", "0.6489216", "0.6415837", "0.6322645", "0.63178617", "0.62796086", "0.62750906", "0.6270834", "0.62680274", "0.6267227", "0.6257955", "0.6212603", "0.6212603", "0.61679685", "0.6160763", "0.61097515", "0.60987306", "0.60453236", "0.60399926", "0.60306543", "0.60261256", "0.60169524", "0.60140914", "0.60107386", "0.5983961", "0.59830135", "0.5976451", "0.59721494", "0.59550136", "0.5933808", "0.5898985", "0.5892989", "0.58788", "0.5872878", "0.5844894", "0.58308506", "0.58136153", "0.58047897", "0.5792253", "0.5777948", "0.57625103", "0.575447", "0.575409", "0.5741103", "0.573486", "0.5718644", "0.57171434", "0.57153845", "0.5713111", "0.57104796", "0.5703316", "0.5695807", "0.5679472", "0.56645834", "0.56522363", "0.5647592", "0.5647573", "0.56443864", "0.563809", "0.558029", "0.55735815", "0.557074", "0.5561525", "0.555821", "0.5526379", "0.5517082", "0.5516464", "0.5513039", "0.55053073", "0.5498024", "0.5493347", "0.5492959", "0.54910916", "0.54686856", "0.54682094", "0.5468134" ]
0.73691624
0
Return an array of the API's parameters for use with a flickr request.
public function getParamsForRequest() { $params['api_key'] = $this->api_key; if ($this->token) { $params['auth_token'] = $this->token; } return $params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getApiParameters();", "private function getParams()\n {\n $params = array(\n 'name' => uniqid('test_api_book_'),\n 'author' => 'Test Author',\n 'last_read' => '12.07.2006',\n 'downloadable' => false,\n );\n\n return $params;\n }", "public static function getAuthenticationParameters(): array\n {\n return FoodDatabase::getApiCredentials();\n }", "protected function getParameters(): array\n {\n return array(\n \"offset\" => $this->offset,\n \"max\" => $this->limit,\n );\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams(): array;", "function getParameters(): array;", "public function parameters()\n {\n return array_merge($this->get, $this->post);\n }", "protected function queryParameters()\n {\n return [\n 'access_key' => $this->accessKey,\n 'base' => $this->defaultCurrency,\n 'symbols' => implode(',', $this->currencies()),\n ];\n }", "public function getRequestParams();", "public static function get_parameters() { \r\n $retVal = array_merge(\r\n parent::get_parameters(),\r\n array(\r\n array(\r\n 'name' => 'square_location_type_id',\r\n 'caption' => 'Square location type id',\r\n 'description' => 'ID of the NPMS square location type.',\r\n 'type'=>'string',\r\n 'group' => 'IDs',\r\n ),\r\n array(\r\n 'name' => 'user_square_attr_id',\r\n 'caption' => 'User square attr id',\r\n 'description' => 'ID of the person attribute that holds user square allocations.',\r\n 'type'=>'string',\r\n 'group' => 'IDs',\r\n ),\r\n )\r\n );\r\n return $retVal;\r\n }", "public function getRequestParameters() {\n return array();\n }", "public function getParams() {}", "public function getParams() :array;", "public function getParameters()\n {\n return array();\n }", "private function getParams() : array\n {\n return [\n 'includeTeamDriveItems' => false,\n 'pageSize' => 1000,\n 'fields' => 'nextPageToken, files(id, name, createdTime, size)',\n 'spaces' => 'drive',\n 'q' => 'trashed = false AND visibility = \\'limited\\'' . $this->getParentsFilter(),\n ];\n }", "protected function getRequestParameters()\n {\n return [\n 'sector' => $this->sector,\n 'amount' => $this->amount,\n 'currency' => $this->currency,\n 'password' => $this->password,\n 'id' => $this->id,\n 'endPoint' => 'https://endpoint.test/',\n ];\n }", "protected function queryParameters()\n {\n return [\n 'app_id' => $this->accessKey,\n 'base' => $this->defaultCurrency,\n 'symbols' => collect($this->currencies())->implode(','),\n ];\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "private function getParams()\n {\n $queryParams = $this->request->getQueryParams();\n\n $params = [\n 'openid.assoc_handle' => array_get($queryParams,self::OPENID_ASSOC_HANDLE),\n 'openid.signed' => array_get($queryParams,self::OPENID_SIGNED),\n 'openid.sig' => array_get($queryParams,self::OPENID_SIG),\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'check_authentication',\n ];\n\n $signedParams = explode(',', array_get($queryParams,self::OPENID_SIGNED));\n\n foreach ($signedParams as $item) {\n $value = array_get($queryParams,'openid_'.str_replace('.', '_', $item));\n $params['openid.'.$item] = $value;\n }\n\n return $params;\n }", "public function getParameters(): array;", "public function getQueryParameters(): array\n {\n return $this->filterParameters(array_merge([\n 'upc' => $this->upc(),\n 'page' => $this->page(),\n 'ingr' => $this->ingredient(),\n 'calories' => $this->calories(),\n 'category' => $this->category(),\n 'health' => $this->healthLabel(),\n 'categoryLabel' => $this->categoryLabel(),\n 'nutrition-type' => $this->nutritionType(),\n ], $this->getAuthenticationParameters()));\n }", "public function getUrlParams() {\n\t\t\n\t\t$consumerParams = $this->getConsumerParams();\n\t\t$params = array();\n\t\t\n\t\tif (!empty($consumerParams)) {\n\t\t\t$wrapper = RublonSignatureWrapper::wrap(\n\t\t\t\t$this->getRublon()->getSecretKey(),\n\t\t\t\t$consumerParams\n\t\t\t);\n\t\t\t$params[self::FIELD_CONSUMER_PARAMS] = $wrapper;\n\t\t}\n\t\t\n\t\treturn $params;\n\t\t\n\t}", "public function getQueryParameters(): array;", "public function getParameters() {}", "function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }", "final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }", "public function getRequestParams()\n {\n return array_merge(\n array(\n 'page' => $this->getPage(),\n 'pageSize' => $this->getPageSize(),\n 'filter' => urldecode($this->getFiltersString())\n ),\n $this->getAdditionalParams()\n );\n }", "public function parameters()\n {\n return [\n 'dir' => $this->input('dir'),\n 'hash' => $this->input('hash', ''),\n 'data' => $this->input('data'),\n 'name' => $this->input('name'),\n 'type' => $this->input('type'),\n 'offset' => $this->input('offset'),\n 'eof' => $this->input('eof'),\n ];\n }", "public function parameters()\n {\n $this->isSecured();\n\n return [\n 'original' => $this->getUri(),\n 'hash' => $this->getHash(),\n 'secured' => $this->getIsSecured(),\n\n 'uri' => $this->getIdentifier(),\n 'url' => $this->getLocator(),\n 'urn' => $this->getName(),\n\n 'scheme' => $this->getScheme(),\n 'protocol' => $this->getProtocol(),\n 'user' => $this->getUser(),\n 'pass' => $this->getPass(),\n\n 'host' => $this->getHost(),\n 'registrable_domain' => $this->getRegistrableDomain(),\n 'subdomain' => $this->getSubdomain(),\n 'hostname' => $this->getHostname(),\n 'tld' => $this->getTld(),\n 'isValidDomain' => $this->getIsValidDomain(),\n 'isIp' => $this->getIsIp(),\n\n 'port' => $this->getPort(),\n 'path' => $this->getPath().$this->getFile(),\n 'segments' => $this->getSegments(),\n 'file' => $this->getFile(),\n 'dirname' => $this->getDirname(),\n 'filename' => $this->getFilename(),\n 'extension' => $this->getExtension(),\n // 'segment_1' => $this->getSegment(1),\n // 'segment_2' => $this->getSegment(2),\n // 'segment_4' => $this->getSegment(4),\n\n 'query' => $this->getQuery(),\n 'parameters' => $this->getParameters(),\n // 'parameters_p2' => $this->getParameter('p2'),\n\n 'fragment' => $this->getFragment(),\n 'fragments' => $this->getFragments(),\n // 'fragmentsParameter_p2' => $this->getFragmentsParameter('p2'),\n ];\n }", "protected function getRequestParameters()\n {\n return [\n 'orderNumber' => $this->orderNumber,\n 'amount' => $this->amount,\n 'returnUrl' => $this->returnUrl,\n 'currency' => $this->currency\n ];\n }", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "public function params(): array;", "protected function getParams(): array\n {\n return $this->params;\n }", "function getParameters();", "function getParameters();", "public function getParams() : array {\n return $this->params;\n }", "function getParams()\n {\n }", "protected function getQueryParameters(): array\n {\n return [\n // not hidden.\n 'H' => false,\n // add, not only generate hash.\n 'n' => false,\n // no progress.\n 'p' => false,\n // pin file\n 'pin' => true,\n // not recursive (single file).\n 'r' => false,\n // no tickle\n 't' => false,\n // no wrap.\n 'w' => false,\n ];\n }", "public static function parameters()\n {\n $fields = array('name', 'amount');\n return array_intersect_key(self::fields(), array_flip($fields));\n }", "public function all()\n {\n return $this->params;\n }", "private static function getParams(): array\n {\n $getParams = [];\n\n if (!empty($_GET)) {\n $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT);\n }\n\n return $getParams;\n }", "private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }", "public function getParams(): array\n {\n return $this->params;\n }", "public function getParams(): array\n {\n return $this->params;\n }", "public function getParams(): array\n {\n return $this->params;\n }", "public function getParams(): array\n {\n return $this->params;\n }", "public function getParams(): array\n {\n return $this->params;\n }", "public function getParams() :array\n \t{\n \t\treturn $this->finalParams;\n \t}", "static public function getAddressbookSearchParams()\n {\n $src = json_decode($GLOBALS['prefs']->getValue('search_sources'));\n if (!is_array($src)) {\n $src = array();\n }\n\n $fields = json_decode($GLOBALS['prefs']->getValue('search_fields'), true);\n if (!is_array($fields)) {\n $fields = array();\n }\n\n return array(\n 'fields' => $fields,\n 'sources' => $src\n );\n }", "public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParameters()\n {\n return $this->parameters->all();\n }", "abstract function getPairsFromAPI();", "function getParams()\n {\n }", "public function getSignableParameters()\n {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n if (isset($params['oauth_signature'])) {\n unset($params['oauth_signature']);\n }\n\n return Utils::buildHttpQuery($params);\n }", "public function getParams() {\n\t\treturn $this -> v_params;\n\t}", "public function get_request_arguments();", "function get_params_array()\n {\n $values = array(\n 'paged' => (isset($_GET['paged'])?$_GET['paged']:(isset($_POST['paged'])?$_POST['paged']:1)),\n 'l' => (isset($_GET['l'])?$_GET['l']:(isset($_POST['l'])?$_POST['l']:'all')),\n 'group' => (isset($_GET['group'])?$_GET['group']:(isset($_POST['group'])?$_POST['group']:'')),\n 'ip' => (isset($_GET['ip'])?$_GET['ip']:(isset($_POST['ip'])?$_POST['ip']:'')),\n 'vuid' => (isset($_GET['vuid'])?$_GET['vuid']:(isset($_POST['vuid'])?$_POST['vuid']:'')),\n 'sdate' => (isset($_GET['sdate'])?$_GET['sdate']:(isset($_POST['sdate'])?$_POST['sdate']:'')),\n 'edate' => (isset($_GET['edate'])?$_GET['edate']:(isset($_POST['edate'])?$_POST['edate']:'')),\n 'type' => (isset($_GET['type'])?$_GET['type']:(isset($_POST['type'])?$_POST['type']:'all')),\n 'search' => (isset($_GET['search'])?$_GET['search']:(isset($_POST['search'])?$_POST['search']:'')),\n 'sort' => (isset($_GET['sort'])?$_GET['sort']:(isset($_POST['sort'])?$_POST['sort']:'')),\n 'sdir' => (isset($_GET['sdir'])?$_GET['sdir']:(isset($_POST['sdir'])?$_POST['sdir']:''))\n );\n\n return $values;\n }", "public function getParams()\n {\n // TODO: Implement getParams() method.\n }", "public function getParametersList(){\n return $this->_get(2);\n }", "function getParameters()\r\n {\r\n }", "public function getParameters() : array\n {\n return $this->parameters;\n }", "static function getParams(){\n\t\t\tif (count(self::$query)>0){\n\t\t\t\t//comprovar si és parell\n\t\t\t\tif((count(self::$query)%2)==0){\n\t\t\t\t\tCoder::codear(self::$query);\n\t\t\t\t\treturn self::$query;\n\n\t\t\t\t}else{\n\t\t\t\t\techo 'ERROR in params array';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "protected function _params()\n {\n $all = array_flip(Whups::getSearchResultColumns());\n unset($all['id']);\n return array('columns' => array(\n 'type' => 'multienum',\n 'name' => _(\"Columns\"),\n 'default' => array_values(Whups::getSearchResultColumns('block')),\n 'values' => $all,\n ));\n }", "protected function getParametros(){\n\t\t\n\t\t$parametros = array();\t\t\t\n\t\t\n\t\t$parametros[\":nickname\"] \t\t= $this->nickName;\n\t\t$parametros[\":nombrecompleto\"] \t= $this->nombreCompleto;\n\t\t$parametros[\":apellidos\"] \t\t= $this->apellidos;\n\t\t$parametros[\":email\"] \t\t\t= $this->email;\n\t\t$parametros[\":password\"] \t\t= $this->password;\n\t\t$parametros[\":fkGrupoUsuario\"] \t= $this->fkGrupoUsuario;\n\n\t\treturn $parametros;\n\t}", "public function get_params() {\n\t\treturn $this->params;\n\t}", "public function getAuthParams() {\n\t\t$settings = array_filter($this->settings['facebook'], function($k){\n\t\t\treturn !is_null($k) OR $k == true;\n\t\t});\n\n\t\tif(isset($settings['scope']) && is_array($settings['scope'])){\n\t\t\t$settings['scope'] = implode(',', $settings['scope']);\n\t\t}\n\n\t\treturn $settings;\n\t}", "public function parameters(): array;", "public static function get_parameters() {\n return array(\n array(\n 'name' => 'termlist_id',\n 'caption' => 'Term List',\n 'description' => 'The term list being edited.',\n 'type' => 'select',\n 'table' => 'termlist',\n 'captionField' => 'title',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n ),\n array(\n 'name' => 'language_id',\n 'caption' => 'Language',\n 'description' => 'The language that terms are created in.',\n 'type' => 'select',\n 'table' => 'language',\n 'captionField' => 'language',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n )\n );\n }", "public static function getParams()\n {\n return self::$params;\n }", "public function getActionParams()\n\t{\n static $params = null;\n if($params === null)\n {\n if(isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'json'))\n $params = (array)CJSON::decode(Yii::app()->request->getRawBody());\n else\n {\n if($_SERVER['REQUEST_METHOD'] == 'GET')\n $params = $_GET;\n elseif($_SERVER['REQUEST_METHOD'] == 'POST')\n $params = $_POST;\n else\n $params = Yii::app()->request->getRestParams();\n }\n\n if(isset($_GET['id']))\n $params = array_merge(array('id' => $_GET['id']), $params);\n $_REQUEST = $params;\n }\n return $params;\n\t}", "private function getParameters() {\n $raw_parameters = $this->routeMatch->getRawParameters();\n $parameters = $this->routeMatch->getParameters();\n\n $return_params = [];\n foreach ($parameters as $key => $value) {\n if ($raw_value = $raw_parameters->get($key)) {\n $return_params[$key] = $raw_value;\n continue;\n }\n\n $return_params[$key] = $parameters->get($key);\n }\n\n return $return_params;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getRequestParameters()\n\t{\n\t\treturn $this->aParameters;\n\t}", "function getParams()\n {\n $params = array();\n $params['username'] = array('label' => _(\"Username\"), 'type' => 'text');\n $params['password'] = array('label' => _(\"Password\"), 'type' => 'text');\n $params['unicode'] = array('label' => _(\"Unicode message flag\"), 'type' => 'int');\n $params['max_length'] = array('label' => _(\"Maximum messages to be sent at once\"), 'type' => 'int');\n\n return $params;\n }", "public function url_parameters()\n {\n return $this->_params;\n }", "public function getParameters()\n {\n $parameters = \"\";\n \n foreach($this->params as $param => $value)\n {\n $parameters .= urlencode($param.\"=\".$value).\";\"; \n }\n \n $parameters = trim($parameters, \";\");\n \n return($parameters);\n }", "public function get_signable_parameters() {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n // Ref: Spec: 9.1.1 (\"The oauth_signature parameter MUST be excluded.\")\n if (isset($params['oauth_signature'])) {\n unset($params['oauth_signature']);\n }\n\n return OAuthUtil::build_http_query($params);\n }", "public function getParameters()\n {\n return $this->params;\n }" ]
[ "0.75181955", "0.7292549", "0.6891161", "0.6832733", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6785787", "0.6725031", "0.6714696", "0.6688645", "0.6673788", "0.6669637", "0.66542166", "0.66317034", "0.6623512", "0.6598812", "0.6597916", "0.6588993", "0.65737194", "0.65539014", "0.6546987", "0.6546987", "0.6546987", "0.6546987", "0.6546987", "0.6546987", "0.6546987", "0.6546987", "0.6538923", "0.6499823", "0.64943993", "0.6456468", "0.64556825", "0.6395408", "0.63850766", "0.6367247", "0.6342151", "0.63415", "0.6320753", "0.63187903", "0.6283029", "0.6272933", "0.62713474", "0.6267599", "0.6267599", "0.62535214", "0.62282515", "0.62258995", "0.6224953", "0.621895", "0.62188435", "0.62187886", "0.6213838", "0.6213838", "0.6213838", "0.6213838", "0.6213838", "0.62022746", "0.61942047", "0.6184969", "0.6182376", "0.6182376", "0.6179305", "0.6170161", "0.6169263", "0.61644495", "0.6161528", "0.61523515", "0.614964", "0.6148438", "0.6142284", "0.61412024", "0.6135293", "0.6123128", "0.6111085", "0.6109804", "0.6105035", "0.6103225", "0.61025834", "0.6101069", "0.60976404", "0.6092241", "0.6084263", "0.6080563", "0.6080563", "0.6080563", "0.6080563", "0.6075525", "0.6074746", "0.6069724", "0.6069442", "0.60673416", "0.6063752" ]
0.70522976
2
Build a signed URL for flickr request.
public function buildUrl(array $params) { $params = array_merge( $this->getParamsForRequest(), $params ); if (!isset($params['format'])) $params['format'] = 'php_serial'; return $this->rest_url . '?' . $this->signParams($params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSignedUrl(): string\n {\n $query = base64_encode(json_encode($this->buildQuery()));\n $signature = hash_hmac('sha256', $this->templateId . $query, $this->token);\n\n return $this->signedUrlBase . $this->templateId . '.png?' . http_build_query(['s' => $signature, 'v' => $query]);\n }", "function buildAuthUrl($frob ='', $key = '', $secret = '', $perms = 'delete') {\n\t\t$params = array();\n if ($frob != '') {\n $params['frob'] = $frob;\n }\n\t\tif ($key == '') {\n\t\t\t$key = $this->modx->getOption('xflickr.api_key');\n\t\t}\n\t\tif ($secret == '') {\n\t\t\t$secret = $this->modx->getOption('xflickr.api_secret');\n\t\t}\n\t\t$params['api_key'] = $key;\n\t\t$params['perms'] = $perms;\n //return 'http://flickr.com/services/auth/?'.$this->signParams($params);\n $signing = '';\n $values = array();\n ksort($params);\n foreach($params as $key => $value) {\n\t\t\t$signing .= $key . $value;\n\t\t\t$values[] = $key . '=' . urlencode($value);\n }\n $values[] = 'api_sig=' . md5($secret . $signing);\n return 'http://flickr.com/services/auth/?'.implode('&', $values);\n }", "private function buildSigningBase(): string {\r\n $parameterString = http_build_query($this->clientParams);\r\n return \"$this->httpMethod&\" . urlencode($this->host . $this->endpoint) . \"&\" . urlencode($parameterString);\r\n }", "public function signResource( $url )\n\t{\n\t\tif ( $this->OAuthSecret ) {\n\t\t\t$sig = $this->generate_signature( null, null, $url );\n\t\t\t$oauth_params = array (\n\t\t\t\t'oauth_version' => '1.0',\n\t\t\t\t'oauth_nonce' => $this->oauth_nonce,\n\t\t\t\t'oauth_timestamp' => $this->oauth_timestamp,\n\t\t\t\t'oauth_consumer_key' => $this->APIKey,\n\t\t\t\t'oauth_signature_method' => $this->oauth_signature_method,\n\t\t\t\t'oauth_token'\t\t\t\t=> $this->oauth_token,\n\t\t\t\t'oauth_signature' => $sig\n\t\t\t\t);\n\n\t\t\t// Build and return the query string.\n\t\t\treturn $url . '?' . http_build_query( $oauth_params );\n\t\t}\n\t}", "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "public function sign($url) {\n $url_parts = parse_url($url);\n $name_value_pairs = isset($url_parts['query']) ? explode(\"&\",$url_parts['query']) : array();\n $query_string_params = array();\n foreach($name_value_pairs as $nvp) {\n $param = explode('=',$nvp);\n $query_string_params[urldecode($param[0])] = count($param>1) ? urldecode($param[1]) : \"\";\n }\n\n if(!isset($url_parts['port'])) \n $port = \"\";\n else \n $port = \":\".$url_parts['port'];\n\n $url_no_params = $url_parts['scheme'].\"://\".$url_parts['host'].$port.$url_parts['path'];\n $req = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, \"GET\", $url_no_params, $query_string_params);\n $req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, $this->access_token);\n $signed_url = $req->to_url();\n // dbg(\"Authorized $url as $signed_url\");\n return $signed_url;\n }", "function MakeSignedRequest()\n{\n $user_id = 1;\n $request_uri = SERVER_BASE . 'services.php';\n\n // Parameters, appended to the request depending on the request method.\n // Will become the POST body or the GET query string.\n $params = array(\n 'service' => 'rest',\n 'method' => 'Version',\n 'response' => RESPONSE\n );\n\n // Obtain a request object for the request we want to make\n $req = new OAuthRequester($request_uri, 'GET', $params);\n\n // Sign the request, perform a curl request and return the results, throws OAuthException exception on an error\n $result = $req->doRequest($user_id);\n\n // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string)\n var_dump($result);\n echo $result['body'];\n}", "protected function createCanonicalRequest()\n {\n $allheaders = array_merge($this->options[\"headers\"], $this->headers);\n\n // get all parts\n $method = $this->options[\"method\"];\n $path = $this->encodePath($this->options[\"path\"]);\n $query = $this->createQueryString($this->options[\"query\"]);\n $headers = $this->createHeaderString($allheaders);\n $this->signedHeaders = $this->createSignedHeaderString($allheaders); // save to $this as it will be used later\n $body = hash($this->algo, $this->options[\"body\"]);\n\n $canonical = \"{$method}\\n{$path}\\n{$query}\\n{$headers}\\n{$this->signedHeaders}\\n{$body}\";\n\n return hash($this->algo, $canonical);\n }", "function flickr($args) {\n\t$endpoint = isset($args['endpoint']) ? $args['endpoint'] : 'http://api.flickr.com/services/rest/';\n\t$secret = isset($args['api_secret']) ? $args['api_secret'] : null;\n\tunset($args['endpoint'], $args['api_secret']);\n\tif ($secret != null) {\n\t\tksort($args);\n\t\t$api_sig = $secret;\n\t\tforeach($args as $k => $v) $api_sig .= $k . $v;\n\t\t$api_sig = md5($api_sig);\n\t\t$args['api_sig'] = $api_sig;\n\t}\n\t$url = $endpoint . '?' . http_build_query($args);\n\tif (substr($endpoint, -15) === '/services/auth/') return $url;\n\t$response = file_get_contents($url);\n\treturn isset($args['format']) && $args['format'] === 'php_serial' ? unserialize($response) : $response;\n}", "private function _buildUrl() {\n $url = OPENDIGI_API_ENDPOINT;\n $url .= '?Vcollection=' . implode('+', $this->_collections);\n if ($this->_languages)\n $url .= '&Vlanguages=' . implode('+', $this->_languages);\n if ($this->_subjectIds)\n $url .= '&Vsubjectids=' . implode('+', $this->_subjectIds);\n\n return $url;\n }", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "function genAuthURL($perms)\n\t{\n\t\t$args['perms'] = $perms;\n\t\t$api_sig = md5($this->api_sig(false,$args));\n\t\treturn 'http://www.rememberthemilk.com/services/auth/?api_key='.$this->apikey.'&perms='.$perms.'&api_sig='.$api_sig;\n\t}", "public function get_signature_base_string() {\n\t\t$parts = \\OAuthSignature::urlencode_rfc3986( array(\n\t\t\t$this->get_normalized_http_method(),\n\t\t\t$this->get_normalized_http_url(),\n\t\t\t$this->get_signable_parameters(),\n\t\t) );\n\n\t\treturn implode( '&', $parts );\n\t}", "public function get_signature_base_string() {\n $parts = array(\n $this->get_normalized_http_method(),\n $this->get_normalized_http_url(),\n $this->get_signable_parameters()\n );\n\n $parts = OAuthUtil::urlencode_rfc3986($parts);\n\n return implode('&', $parts);\n }", "public function get_signature_base_string()\n {\n $parts = array(\n $this->get_normalized_http_method(),\n $this->get_normalized_http_url(),\n $this->get_signable_parameters()\n );\n\n $parts = OAuthUtil::urlencode_rfc3986($parts);\n\n return implode('&', $parts);\n }", "function generate_api_url(){\n\t\t$parameters = array(\n\t\t\t'uid' \t\t => $this->uid,\n\t\t\t'pswd' \t\t => $this->pswd,\n\t\t\t'api' \t\t => $this->api,\n\t\t\t'apiversion' => $this->apiversion\t\t\t\n\t\t);\n\t\t\n\t\tif(!empty($this->sid) && !empty($this->encrypted_pswd)){\n\t\t\t$parameters['sid'] = $this->sid;\n\t\t\t$parameters['pswd'] = $this->encrypted_pswd;\n\t\t}\n\t\t\n\t\t//var_dump($parameters);\n\t\t\n\t\treturn self::api_end_point . '?' . http_build_query($parameters);\n\t}", "public function getSignatureBaseString()\n {\n $parts = array(\n $this->getNormalizedHttpMethod(),\n $this->getNormalizedHttpUrl(),\n $this->getSignableParameters()\n );\n\n $parts = Utils::urlencodeRfc3986($parts);\n\n return implode('&', $parts);\n }", "function signUrl($myUrlToSign, $privateKey)\n{\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "function signUrl($myUrlToSign, $privateKey) {\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "public function authenticationUrl($secret, $frob = null, $perms = self::PERMS_READ, array $options = array())\n {\n \tstatic $baseUrl = \"http://flickr.com/services/auth/?\";\n $defaultOptions = array(\n \t'api_key' => $this->apiKey,\n \t'frob' => (null !== $frob) ? $frob : ($frob = $this->getFrob($secret)),\n \t'perms' => (string)$perms\n );\n $options = array_merge($defaultOptions, $options);\n $options = $this->signOptions($secret, $options);\n\n $url = $baseUrl . http_build_query($options);\n\n return $url;\n }", "private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }", "public function createUrl()\n\t{\n\t\tif (!$this->getOption('authurl') || !$this->getOption('clientid'))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Authorization URL and client_id are required');\n\t\t}\n\n\t\t$url = $this->getOption('authurl');\n\n\t\tif (strpos($url, '?'))\n\t\t{\n\t\t\t$url .= '&';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url .= '?';\n\t\t}\n\n\t\t$url .= 'response_type=code';\n\t\t$url .= '&client_id=' . urlencode($this->getOption('clientid'));\n\n\t\tif ($this->getOption('redirecturi'))\n\t\t{\n\t\t\t$url .= '&redirect_uri=' . urlencode($this->getOption('redirecturi'));\n\t\t}\n\n\t\tif ($this->getOption('scope'))\n\t\t{\n\t\t\t$scope = is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope');\n\t\t\t$url .= '&scope=' . urlencode($scope);\n\t\t}\n\n\t\tif ($this->getOption('state'))\n\t\t{\n\t\t\t$url .= '&state=' . urlencode($this->getOption('state'));\n\t\t}\n\n\t\tif (is_array($this->getOption('requestparams')))\n\t\t{\n\t\t\tforeach ($this->getOption('requestparams') as $key => $value)\n\t\t\t{\n\t\t\t\t$url .= '&' . $key . '=' . urlencode($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $url;\n\t}", "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}", "public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }", "public function getUri()\n {\n return 'https://'.$this->getAuth().'@'.self::BASE_URI.'/v1/';\n }", "protected function generateString()\n\t{\n\t\t// start with the scheme\n\t\t$url = $this->scheme . '://';\n\t\t\n\t\t// user and password\n\t\tif( !empty( $this->user ) )\n\t\t{\n\t\t\t$url .= $this->user;\n\t\t\tif( !empty( $this->pass ) ) $url .= ':'.$this->pass.'@';\n\t\t\telse $url .= '@';\n\t\t}\n\t\t\n\t\t// add the host and path\n\t\t$url .= $this->host . '/';\n\t\t$url .= $this->path;\n\t\t\n\t\t// add the URL-encoded parameters\n\t\tif( !empty( $this->params ) )\n\t\t{\n\t\t\t$url .= '?';\n\t\t\tforeach( $this->params as $f => $v ) $url .= $f . '=' . urlencode( $v ) . '&';\n\t\t\t$url = rtrim( $url, '&' );\n\t\t}\n\t\t\n\t\t// add the anchor if any\n\t\tif( !empty( $this->anchor ) ) $url .= '#' . $this->anchor;\n\t\t\n\t\t$this->url = $url;\n\t\t$this->modified = false;\n\t\treturn $url;\n\t}", "public function sign($uri)\n {\n $url = parse_url($uri);\n if (isset($url['query'])) {\n parse_str($url['query'], $params);\n } else {\n $params = array();\n }\n\n $uri = $this->buildUrl($url, $params);\n\n return $uri.(false === (strpos($uri, '?')) ? '?' : '&').'_hash='.$this->computeHash($uri);\n }", "public function makeSignedRequest($url, $options = array(), $parseResponse = true) {\n\t\tif (!isset($options['query']['alt'])) {\n\t\t\t$options['query']['alt'] = 'json';\n\t\t}\n\t\treturn parent::makeSignedRequest($url, $options, $parseResponse);\n\t}", "public static function signUrlForGoogle(string $sUrlToSign, string $sClientId, string $sPrivateKey) : string\n {\n $aUrl = parse_url($sUrlToSign);\n $aUrl['query'] .= '&client=' .$sClientId;\n\n $aUrlToSign = $aUrl['path'].\"?\".$aUrl['query'];\n\n $decodedKey = base64_decode(str_replace(array('-', '_'), array('+', '/'), $sPrivateKey));\n\n $sSignature = hash_hmac(\"sha1\", $aUrlToSign, $decodedKey, true);\n\n $sEncodedSignature = str_replace(array('+', '/'), array('-', '_'), base64_encode($sSignature));\n\n $sOriginalUrl = $aUrl['scheme'].\"://\".$aUrl['host'].$aUrl['path'] . \"?\".$aUrl['query'];\n\n return $sOriginalUrl. '&signature='. $sEncodedSignature;\n }", "public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }", "protected function buildRequestUri()\n {\n $requestParameters = array();\n\n // add entity\n if (!empty($this->defaultOptions['entity'])) {\n $tmp = array_keys($this->defaultOptions['entity']);\n $key = array_pop($tmp);\n $requestParameters[] = 'entity=' . $this->defaultOptions['entity'][$key];\n }\n\n // add media type\n if (!empty($this->defaultOptions['mediaType'])) {\n $requestParameters[] = 'media=' . $this->defaultOptions['mediaType'];\n }\n\n // add attribute\n if (!empty($this->defaultOptions['attribute'])) {\n $requestParameters[] = 'attribute=' . $this->defaultOptions['attribute'];\n }\n\n // add language\n if (!empty($this->defaultOptions['language'])) {\n $requestParameters[] = 'lang=' . $this->defaultOptions['language'];\n }\n\n // add limit\n if ($this->defaultOptions['limit'] <> 100) {\n $requestParameters[] = 'limit=' . $this->defaultOptions['limit'];\n }\n\n // add country\n if ($this->defaultOptions['country'] != 'us') {\n $requestParameters[] = 'country=' . $this->defaultOptions['country'];\n }\n\n // add callback\n if (!empty($this->defaultOptions['callback'])) {\n $requestParameters[] = 'callback=' . $this->defaultOptions['callback'];\n }\n\n // add version\n if ($this->defaultOptions['version'] <> 2) {\n $requestParameters[] = 'version=' . $this->defaultOptions['version'];\n }\n\n // add explicity\n if ($this->defaultOptions['explicit'] != 'yes') {\n $requestParameters[] = 'explicit=' . $this->defaultOptions['explicit'];\n }\n\n return implode('&', $requestParameters);\n }", "protected function buildRequestUrl($action = \"url\"){\n return \"https://{$this->host}/urlshortener/{$this->version}/{$action}?key={$this->token}\";\n }", "public function getAuthUrl ()\n {\n\n $url = 'https://oauth.vk.com/authorize?client_id='.$this->client_id.'&scope=photos,friends&redirect_uri='.$this->redirect_uri.'&response_type=code&v=5.0';\n return $url;\n }", "public function getUrl ()\n {\n $url = $this->_config['formAction'] . '?';\n \n foreach ($this->_params as $key => $value) {\n if ($value != '') {\n $url .= $key . '=' . $value . '&';\n }\n }\n \n $url .= 'SHASign=' . $this->getSha1Sign();\n \n return $url;\n }", "private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }", "public function createSignUrl ($file_ext) {\n\n // create a signed url for video upload\n $credentials = new Aws\\Credentials\\Credentials($this->settings['s3_bucket']['access_key'], $this->settings['s3_bucket']['secret_key']);\n $client = new S3Client([\n 'version' => 'latest',\n 'region' => 'eu-west-1',\n 'credentials' => $credentials\n ]);\n $bucket = $this->settings['s3_bucket']['bucket_tmp'];\n $filename = uniqid() . \".\" .$file_ext;\n\n $cmd = $client->getCommand('PutObject', [\n 'Bucket' => $bucket,\n 'Key' => $filename,\n ]);\n\n $aws_request = $client->createPresignedRequest($cmd, '+20 minutes');\n\n // Get the actual presigned-url\n $presignedUrl = (string) $aws_request->getUri();\n\n $data = [\n \"signedUrl\" => $presignedUrl,\n \"key\" => $filename\n\n ];\n\n return $data;\n }", "function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'] );\n\t\tunset( $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) )\n\t\t\treturn '';\n\n\t\treturn Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );\n\t}", "protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "private function sign_url( $myUrlToSign, $privateKey ) {\n\t\t\t// parse the url\n\t\t\t$url = parse_url( $myUrlToSign );\n\n\t\t\t$urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n\t\t\t// Decode the private key into its binary format\n\t\t\t$decodedKey = $this->decode_Base64UrlSafe( $privateKey );\n\n\t\t\t// Create a signature using the private key and the URL-encoded\n\t\t\t// string using HMAC SHA1. This signature will be binary.\n\t\t\t$signature = hash_hmac( \"sha1\", $urlPartToSign, $decodedKey, true );\n\n\t\t\t$encodedSignature = $this->encode_Base64UrlSafe( $signature );\n\n\t\t\treturn $myUrlToSign . \"&signature=\" . $encodedSignature;\n\t\t}", "public function getUrl()\n {\n return $this->api\n . '?method='\n . $this->getMethod()\n . '&api_key='\n . $this->getApiKey()\n . '&tags='\n . $this->getTag()\n . '&per_page='\n . $this->getPerPage()\n . '&page='\n . $this->getPage()\n . '&format='\n . $this->getFormat()\n . '&photo_id='\n . $this->getPhotoId()\n . '&nojsoncallback=1';\n }", "abstract protected function buildSpecificRequestUri();", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "public function url()\n\t{\n\t\treturn ($this->secure() ? 'https' : 'http') . '//' . $this->domainName() . $this->uri();\n\t}", "public function buildPhotoUrl () {\n\t\t\n\t}", "public function getUrl() {\n $url = $this->request->get_normalized_http_url() . '?';\n $url .= http_build_query($this->request->get_parameters(), '', '&');\n\n return $url;\n }", "public function getAuthUrl();", "public function to_url()\n {\n $out = $this->get_normalized_http_url() . \"?\";\n $out .= $this->to_postdata();\n return $out;\n }", "public static function build_oauth_url() {\n\n\t\t$response = \"https://login.live.com/oauth20_authorize.srf?client_id=\".client_id.\"&scope=wl.signin%20wl.offline_access%20wl.skydrive_update%20wl.basic&response_type=code&redirect_uri=\".urlencode(callback_uri);\n\n\t\treturn $response;\n\n\t}", "function access($unsigned_url) {\n$token = new OAuthToken($token, $token_secret);\n// Consumer object built using the OAuth library\n$consumer = new OAuthConsumer($consumer_key, $consumer_secret);\n// Yelp uses HMAC SHA1 encoding\n$signature_method = new OAuthSignatureMethod_HMAC_SHA1();\n// Build OAuth Request using the OAuth PHP library. Uses the consumer and token object created above.\n$oauthrequest = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $unsigned_url);\n// Sign the request\n$oauthrequest->sign_request($signature_method, $consumer, $token);\n// Get the signed URL\n$signed_url = $oauthrequest->to_url();\n// Send Yelp API Call\n$ch = curl_init($signed_url);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\n$data = curl_exec($ch); // Yelp response\ncurl_close($ch);\nreturn($data);\n}", "public function urlCanonical() {\n\t\t$httpurl = _v('cmsrt.httpurl');\n\t\t$aliasID = _v('cmsrt.userUrlAlias');\n\t\t$klistcmd = _v('cmsrt.klistcmd');\n\t\t$kshowcmd = _v('cmsrt.kshowcmd');\n\t\t$cat = GetReq('cat');\n\t\t$id = GetReq('id');\t\n\t\t$t = GetReq('t');\n\t\t\n\n\t\t\t\tswitch ($t) {\n\t\t\t\t\t\n\t\t\t\t\tcase 'product' :\n\t\t\t\t\tcase 'kshow' :\n\t\t\t\t\tcase $kshowcmd : if ($aliasID)\n\t\t\t\t\t\t\t\t\t\t$ret = $httpurl . \"/$kshowcmd/$cat/\". $this->getRealItemCode($id, $aliasID) .\"/\";\n\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t\t$ret = $httpurl . \"/$kshowcmd/$cat/$id/\";\n\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\tcase 'kfilter' : if ($this->use_canonical_for_filters) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$filter = implode(',', $this->reset_input);\n\t\t\t\t\t\t\t\t\t\t$ret = $httpurl . \"/kfilter/$cat/$filter/\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t }//else continue to use klist/products as canonical url\n\t\t\t\t\tcase 'products':\n\t\t\t\t\tcase 'klist' :\n\t\t\t\t\tcase $klistcmd : $ret = $httpurl . \"/\".$klistcmd.\"/$cat/\"; \n\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\n\t\t\t\t\tdefault \t : $ret = $httpurl . _m('cmsrt.php_self');\n\t\t\t\t}\t\t\t\n\t\t\n\t\treturn $ret;\n\t}", "abstract public function getRawSignedRequest();", "abstract public function getRawRequestUrl();", "function __sign_query($verb, $uri, $query, $headers, $expires=5) {\n\t\t\t/* make sure all of query and headers uses lowercased s3objects for us */\n\t\t\t$query = array_change_key_case($query, CASE_LOWER);\n\t\t\t$headers = array_change_key_case($headers, CASE_LOWER);\n\t\t\t\n\t\t\t/* nat sort our header s3objects */\n\t\t\tuksort($headers, Array($this, '__nat'));\n\n\t\t\t/* build string to sign */\n\t\t\t$parts = Array();\n\t\t\t\n\t\t\t$parts[] = strtoupper($verb);\n\t\t\t$parts[] = $headers['content-md5'];\n\t\t\t$parts[] = $headers['content-type'];\n\t\t\t\n\t\t\t/* figure out the seconds since epoch right now, and add expires seconds to it,\n\t\t\t\tthats our expires time */\n\t\t\t$expires += time();\n\t\t\t$parts[] = $expires;\n\t\t\t\n\t\t\t/* go through all headers */\n\t\t\tforeach($headers AS $s3object=>$val) {\n\t\t\t\tif (substr($s3object, 0, 6) == 'x-amz-') {\n\t\t\t\t\t/* trim $val */\n\t\t\t\t\t$val = trim($val);\n\t\t\t\t\t/* add to parts */\n\t\t\t\t\t$parts[] = $s3object.':'.$val;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (in_array('acl', $query) || array_key_exists('acl', $query)) $uri .= '?acl';\n\t\t\tif (in_array('torrent', $query) || array_key_exists('torrent', $query)) $uri .= '?torrent';\n\n\t\t\t$parts[] = $uri;\n\t\t\t\n\t\t\t$string = implode(\"\\n\", $parts);\n\t\t\t\n\t\t\t/* return the (rest of the) query string */\n\t\t\treturn ((strpos($uri, '?') !== FALSE)?'&':'?').'Signature='.\n\t\t\t\turlencode(base64_encode(hash_hmac('sha1', $string, $this->GetSecretKey(), TRUE))).\n\t\t\t\t'&Expires='.$expires.'&AWSAccesss3objectId='.$this__awss3objectid;\n\t\t}", "private function buildClientUrl() {\n // protocol\n $s = &$_SERVER;\n $ssl = (array_key_exists('HTTPS', $s) && !empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;\n $sp = array_key_exists('SERVER_PROTOCOL', $s) ? strtolower($s['SERVER_PROTOCOL']) : 'http';\n $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n\n // port\n $port = array_key_exists('SERVER_PORT', $s) ? $s['SERVER_PORT'] : '';\n $port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;\n\n // host\n $host = array_key_exists('HTTP_X_FORWARDED_HOST', $s) && isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (array_key_exists('HTTP_HOST', $s) && isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);\n $host = isset($host) ? $host : (array_key_exists('SERVER_NAME', $s) ? $s['SERVER_NAME'] : $s['USER']) . $port;\n\n // build the uri\n return $protocol . '://' . $host . (array_key_exists('REQUEST_URI', $s) ? $s['REQUEST_URI'] : 'localhost');\n }", "protected function getSignatureCertificateUrl()\n\t{\n\t\t$url_string = $this->request->header($this->config['cert_chain_url_header'], null);\n\n\t\tif (is_null($url_string) || $url_string === '') {\n\t\t\tthrow new AlexaVerificationException('Request signature verification failed: no URL specified.');\n\t\t}\n\n\t\treturn new URL($url_string);\n\t}", "public function sign($url, $expiration, $timeunit);", "protected function buildQueryString()\n {\n $parameters = $this->_queryParameters;\n $parameters['USER'] = $this->_username;\n $parameters['PWD'] = $this->_password;\n $parameters['SIGNATURE'] = $this->_signature;\n $parameters['VERSION'] = self::VERSION;\n $parameters['METHOD'] = $this::METHOD;\n return http_build_query($parameters);\n }", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "private function signQuery($query)\n {\n $stringToSign = \"GET\\n$this->host\\n$this->requestURI\\n$query\";\n $signature = base64_encode(hash_hmac('sha256', $stringToSign, $this->AWSSecretKey, true));\n $signature = str_replace(\"%7E\", \"~\", rawurlencode($signature));\n \n return $signature;\n }", "private function build_url($endpoint, array $query = array())\n {\n $url = $this->base_url.$endpoint;\n\n if (!empty($query)) {\n $url .= '?'.http_build_query($query);\n }\n\n return $url;\n }", "public function url() {\n if (empty($this->parameters)) {\n return $this->url;\n }\n\n return $this->url . '?' . http_build_query($this->parameters);\n }", "public function to_url() {\n $post_data = $this->to_postdata();\n $out = $this->get_normalized_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n return $out;\n }", "abstract protected function auth_url();", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "public function buildUrl(string $method, string $version, array $query = []) {\n $query = array_merge(['access_token' => $this->accessToken], $query);\n return sprintf(self::URL.'%s/%s?%s', $method, $version, http_build_query($query));\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "public function testRequestSigning() {\n\t\t$signer = new Auth_OAuth_Signer();\n\n\t\t// test 1\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array('PLAINTEXT', 'HMAC-SHA1') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertEquals('PLAINTEXT', $request->getSignatureMethod());\n\t\t$this->assertEquals('kd94hf93k423kf44&pfkkdhi9sl3r4s00', $request->getSignature());\n\n\n\t\t// test 2\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk',\n\t\t\t\t\t'oauth_timestamp'=>'1191242096', 'oauth_nonce'=>'kllo9940pd9333jh');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array( 'INVALID-METHOD', 'HMAC-SHA1', 'PLAINTEXT') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertEquals('HMAC-SHA1', $request->getSignatureMethod());\n\t\t$this->assertEquals('tR3+Ty81lMeYAr/Fid0kMTYa/WM=', $signer->getSignature($request, $server, $token));\n\t}", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "protected function buildRequestUrl($uri)\n {\n return $this->apiUrl . $uri . '&fmt=json';\n }", "public function getSignature() : string\n {\n\n return $this->httpMethod . ':' . $this->uri;\n }", "public function signRequestUrl(\n\t\t$requestUrl = '',\n\t\t$resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,\n\t\t$requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ\n\t) {\n\t return $requestUrl;\n\t}", "public function authenticateUri()\n {\n $args = array(\n 'client_id' => $this->_clientId,\n 'client_secret' => $this->_clientSecret,\n 'response_type' => 'code',\n 'redirect_url' => $this->_redirectUri,\n );\n\n return 'https://untappd.com/oauth/authenticate/?' . http_build_query($args);\n }", "private function signedRequest($url) {\r\n\t\tGLOBAL $wgYammerConsumerKey, $wgYammerConsumerSecret, $wgYammerAccessKey, $wgYammerAccessSecret;\r\n\t\t$resp = $this->oauth_get($url, $wgYammerConsumerKey, $wgYammerConsumerSecret, $wgYammerAccessKey, $wgYammerAccessSecret, false, 'PLAINTEXT', 'GET');\r\n\t\treturn $resp[1];\r\n\t}", "public function makeUrlFromRequest()\n {\n $id = __Request::get('id', null);\n $resolvedVO = $this->createResolvedVO($id);\n return $resolvedVO->url;\n }", "function oauth_urlencode($uri) {}", "abstract public function signRequestUrl(\n\t\t$requestUrl = '',\n\t\t$resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,\n\t\t$requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ\n\t);", "function _http_signed_request($app, $secret, $url, array $post = null, $timeout=30) {\n $body = $post !== null ? http_build_query($post) : '';\n\n $checksum = sha1($body . $secret);\n\n $headers = \"X-App: \". $app. \"\\r\\n\".\n \"X-Hash: \". $checksum . \"\\r\\n\";\n\n if ($post !== null)\n $options = [\n 'http' => [\n 'header' => $headers.\"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'timeout' => $timeout,\n 'method' => 'POST',\n 'content' => $body\n ]\n ];\n else\n $options = [ \n 'http' => [\n 'header' => $headers,\n 'timeout' => $timeout,\n 'method' => 'GET'\n ] \n ];\n\n $context = stream_context_create($options);\n\n return file_get_contents($url, false, $context);\n}", "function elgg_http_build_url(array $parts) {\n\t// build only what's given to us.\n\t$scheme = isset($parts['scheme']) ? \"{$parts['scheme']}://\" : '';\n\t$host = isset($parts['host']) ? \"{$parts['host']}\" : '';\n\t$port = isset($parts['port']) ? \":{$parts['port']}\" : '';\n\t$path = isset($parts['path']) ? \"{$parts['path']}\" : '';\n\t$query = isset($parts['query']) ? \"?{$parts['query']}\" : '';\n\n\t$string = $scheme . $host . $port . $path . $query;\n\n\treturn $string;\n}", "function _http_build_url($parts) { \n return implode(\"\", array(\n isset($parts['scheme']) ? $parts['scheme'] . '://' : '',\n isset($parts['user']) ? $parts['user'] : '',\n isset($parts['pass']) ? ':' . $parts['pass'] : '',\n (isset($parts['user']) || isset($parts['pass'])) ? \"@\" : '',\n isset($parts['host']) ? $parts['host'] : '',\n isset($parts['port']) ? ':' . intval($parts['port']) : '',\n isset($parts['path']) ? $parts['path'] : '',\n isset($parts['query']) ? '?' . $parts['query'] : '',\n isset($parts['fragment']) ? '#' . $parts['fragment'] : ''\n ));\n}", "public function getAuthUrl()\n {\n return $this->client->createAuthUrl();\n }", "public static function getURL()\r\n {\r\n $url = 'https://accounts.google.com/o/oauth2/auth?client_id=' . self::$details['client_id'] . '&redirect_uri=' . self::$details['redirect'] . '&scope=https://www.google.com/m8/feeds/&response_type=code';\r\n return $url;\r\n }", "public function get_bitbucket_auth_url(){\n\t\tif( empty($this->unauth_token) ){\n\t\t\t$this->request_unauth_token();\n\t\t}\n\t\t\n\t\t$auth_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, \"GET\", $this->oauth_urls['login']);\n\t\t$auth_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token);\n\t\treturn $auth_req->to_url();\n\t}", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}", "private static function assemble_url() {\n\t\t$nerdpress_options = get_option( 'blog_tutor_support_settings' );\n\t\t$cloudflare_zone = $nerdpress_options['cloudflare_zone'];\n\t\tif ( $cloudflare_zone === 'dns1' ) {\n\t\t\tself::$cloudflare_zone = 'cc0e675a7bd4f65889c85ec3134dd6f3';\n\t\t} elseif ( $cloudflare_zone === 'dns2' ) {\n\t\t\tself::$cloudflare_zone = 'c14d1ac2b0e38a6d49d466ae32b1a6d7';\n\t\t} elseif ( $cloudflare_zone === 'dns3' ) {\n\t\t\tself::$cloudflare_zone = '2f9485f19471fe4fa78fb51590513297';\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\treturn self::$cloudflare_api_url . self::$cloudflare_api_version . self::$cloudflare_zones_directory . self::$cloudflare_zone . '/';\n\t}", "public static function generatePhotoApiUrl($photo, $sizeType = '') {\n $farmId = $photo->farm;\n $serverId = $photo->server;\n $photoId = $photo->id;\n $secretId = $photo->secret;\n\n if ($sizeType != 'o') {\n return \"https://farm\" . $farmId . \".staticflickr.com/\" . $serverId . \"/\" . $photoId . \"_\" . $secretId . \"_\". $sizeType .\".jpg\";\n }\n\n return \"https://farm\" . $farmId . \".staticflickr.com/\" . $serverId . \"/\" . $photoId . \"_\" . $secretId . \".jpg\";\n }", "public function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'], $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn esc_url_raw( WC_Tracks_Client::PIXEL . '?' . http_build_query( $validated ) );\n\t}", "public static function generateSignatureBase(\\OAuth\\Request $request){\n\t\t$encoded_parameters = $request->encodeAndSortParameters();\n\n\t\t// apparently you don't use the multi-part params in auth, just the oauth params\n\t\tif($request->getMultipartFlag() === true){\n\t\t\t$new_params = [];\n\t\t\tforeach($encoded_parameters as $k=>$v){\n\t\t\t\tif(strpos($k, 'oauth') !== false)\n\t\t\t\t\t$new_params[$k] = $v;\n\t\t\t}\n\t\t\t$encoded_parameters = $new_params;\n\t\t}\n\t\t\n\t\t// start out signature_base with the parameters\n\t\t$signature_base = array();\n\t\tforeach($encoded_parameters as $k=>$v){\n\t\t\t$signature_base[] = $k.'='.$v;\n\t\t}\n\t\t$signature_base = implode('&', $signature_base);\n\n\t\treturn $request->getMethod().'&'.rawurlencode($request->getUrl()).'&'.rawurlencode($signature_base);\n\t}", "public function buildUrl(string $ip_address, string $req_for) : string\n {\n $url = self::API_BASE_URL;\n $url .= \"/\".$req_for.\"?ip=$ip_address\";\n\n return $url;\n }", "private function buildSigningKey(): string {\r\n return \"$this->secret&$this->userSecret\";\r\n }", "public function get_signable_parameters()\n {\n // Grab all parameters\n $params = $this->parameters;\n\n // Remove oauth_signature if present\n if (isset($params['oauth_signature']))\n unset($params['oauth_signature']);\n\n // Urlencode both keys and values\n $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));\n $values = OAuthUtil::urlencode_rfc3986(array_values($params));\n $params = array_combine($keys, $values);\n\n // Sort by keys (natsort)\n uksort($params, 'strcmp');\n\n // Generate key=value pairs\n $pairs = array();\n foreach ($params as $key=>$value )\n {\n if (is_array($value))\n {\n // If the value is an array, it's because there are multiple\n // with the same key, sort them, then add all the pairs\n natsort($value);\n foreach ($value as $v2)\n $pairs[] = $key . '=' . $v2;\n }\n else\n $pairs[] = $key . '=' . $value;\n }\n\n // Return the pairs, concated with &\n return implode('&', $pairs);\n }", "public function getSecureApiUrl()\n {\n $this->urlHelper->setData('secure_is_forced', true);\n $url = $this->urlHelper->getUrl('magemail/jsonApi', array('_nosid' => true, '_secure' => true));\n\n return $url;\n }", "protected function buildRequestURL()\n {\n $this->requestUrl = $this->url.$this->serviceUrl.$this->requestEndPoint.'?';\n $this->requestUrl .= http_build_query($this->params);\n\n return $this;\n }", "protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }", "public function url()\n\t{\n\t\t$this->buildImage();\n\t\treturn $this->buildCachedFileNameUrl;\n\t}", "abstract public function getAuthUri(): string;", "public function getRequestUri() {}", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function getRequestURL() {\n\t\t$scheme = $this->getScheme();\n\t\t$port = $this->getServerPort();\n\t\t$url = $scheme . '://';\n\t\t$url .= $this->getServerName();\n\t\tif(($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {\n\t\t\t$url .= ':' . $port;\n\t\t}\n\t\t$url .= $this->getRequestURI();\n\t\treturn $url;\n\t}" ]
[ "0.7263769", "0.7020377", "0.63803285", "0.636727", "0.6337195", "0.6240419", "0.6235192", "0.61872196", "0.60908484", "0.60836595", "0.6077506", "0.6035037", "0.5987572", "0.59493124", "0.59480983", "0.59096295", "0.5876858", "0.586672", "0.58180976", "0.5817182", "0.5816738", "0.58068013", "0.57985646", "0.5759276", "0.5717552", "0.57107294", "0.56837296", "0.566805", "0.564485", "0.5641162", "0.5614595", "0.5613564", "0.5602421", "0.5595584", "0.5584042", "0.5581739", "0.557942", "0.55766195", "0.5553251", "0.5542818", "0.55336183", "0.55327", "0.5532187", "0.5531182", "0.5512531", "0.54978037", "0.5496859", "0.5493551", "0.5477198", "0.5451289", "0.5438941", "0.5438535", "0.54211015", "0.5418195", "0.5411077", "0.5400234", "0.53885424", "0.53849643", "0.53733796", "0.5370911", "0.533118", "0.5311118", "0.5310237", "0.53100044", "0.52945435", "0.5292116", "0.528686", "0.5283447", "0.52758884", "0.5269032", "0.526403", "0.5260698", "0.52488667", "0.5246307", "0.52432066", "0.5240452", "0.52387184", "0.5231566", "0.52225727", "0.5215667", "0.5210586", "0.52070695", "0.51971674", "0.5192988", "0.5189464", "0.51883245", "0.51871425", "0.51844", "0.51842797", "0.5183155", "0.51784885", "0.5177027", "0.516168", "0.5161013", "0.51529", "0.5144086", "0.51432705", "0.51401645", "0.51394844", "0.5135047" ]
0.5525105
44
Build a URL to request a token.
function buildAuthUrl($frob ='', $key = '', $secret = '', $perms = 'delete') { $params = array(); if ($frob != '') { $params['frob'] = $frob; } if ($key == '') { $key = $this->modx->getOption('xflickr.api_key'); } if ($secret == '') { $secret = $this->modx->getOption('xflickr.api_secret'); } $params['api_key'] = $key; $params['perms'] = $perms; //return 'http://flickr.com/services/auth/?'.$this->signParams($params); $signing = ''; $values = array(); ksort($params); foreach($params as $key => $value) { $signing .= $key . $value; $values[] = $key . '=' . urlencode($value); } $values[] = 'api_sig=' . md5($secret . $signing); return 'http://flickr.com/services/auth/?'.implode('&', $values); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTokenUrl();", "abstract protected function getTokenUrl();", "abstract protected function token_url();", "abstract protected function getTokenUrl(): string;", "public function joinTokenUrl()\n {\n return sprintf('%s?applicationId=%s', $this->site, $this->token);\n }", "protected function getTokenUrl()\n {\n return $this->baseUrl.'/oauth2.0/token';\n }", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "public function getTokenUrl()\n {\n return $this->withStoreName('oauth/v2/token');\n }", "protected function getApiTokenUrl()\n {\n return \"api/Token\";\n }", "private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }", "protected function getTokenUrl()\n {\n return 'https://login.eveonline.com/oauth/token';\n }", "protected function getTokenUrl()\n {\n return 'https://auth.kodular.io/oska/access_token';\n }", "protected function getTokenUrl()\n\t{\n\t\t$this->initConfig();\n\t\treturn $this->config['access_token_url'];\n\t}", "public function getRequestTokenUrl()\n {\n if (! $this->requestTokenUrl && $this->siteUrl) {\n return rtrim($this->siteUrl, '/') . '/request_token';\n }\n return $this->requestTokenUrl;\n }", "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}", "function url_with_auth_token($url) {\n // use global $query_params that was initialized during auth check on page load\n global $query_params;\n\n // no auth info, return original url\n if ($query_params['token'] == \"\" || $query_params['uuid'] == \"\") {\n echo $url;\n return;\n }\n\n $uri_parts = explode('?', $url, 2);\n if (isset($uri_parts[1]) && ($uri_parts[1] == \"\")) {\n $url .= \"?\";\n } else {\n $url .= \"&\";\n }\n\n $url .= \"token=\".$query_params['token'].\"&uuid=\".$query_params['uuid'];\n echo $url;\n}", "public static function build_oauth_url() {\n\n\t\t$response = \"https://login.live.com/oauth20_authorize.srf?client_id=\".client_id.\"&scope=wl.signin%20wl.offline_access%20wl.skydrive_update%20wl.basic&response_type=code&redirect_uri=\".urlencode(callback_uri);\n\n\t\treturn $response;\n\n\t}", "abstract public function url_access_token();", "protected function build_callback_url($token = NULL)\n\t{\n\t\tif( ! session('callback_url'))\n\t\t\treturn '/';\n\t\t\n\t\t// Allow the callback_url to use query params\n\t\treturn session('callback_url') . ((strpos(session('callback_url'), '?') === FALSE) ? '?' : '&'). \"key=$token\";\n\t}", "static function addTokenToURL($url) {\n $token = Security::generateToken();\n new Cache(\"token\", $token);\n if (strpos($url, '?') !== false) {\n $url .= \"&token=$token\";\n } else {\n $url .= \"?token=$token\";\n }\n return $url;\n }", "public function getRequestTokenURL() {\n\t\treturn $this->selectedEndpoint['request_token_url'];\n\t}", "protected function getTokenUrl()\n {\n return 'https://bitbucket.org/site/oauth2/access_token';\n }", "protected function getTokenUrl()\n {\n return 'https://api.weixin.qq.com/sns/oauth2/access_token';\n }", "public function urlAccessToken() {\n return $this->host . '/oauth/token';\n }", "protected function buildRequestUrl($action = \"url\"){\n return \"https://{$this->host}/urlshortener/{$this->version}/{$action}?key={$this->token}\";\n }", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "public function get_access_token_url() {\n\t\t$access_token_url = self::$_access_token_url;\n\n\t\t/**\n\t\t * Filter access_token_url\n\t\t *\n\t\t * @since 1.3\n\t\t *\n\t\t * @param string $access_token_url\n\t\t */\n\t\t$access_token_url = apply_filters( 'forminator_addon_aweber_oauth_access_token_url', $access_token_url );\n\n\t\treturn $access_token_url;\n\t}", "public function getAuthUrl()\n {\n $return = $this->baseUrl .\n '/' . $this->authNamespace .\n '/' . $this->authVersion .\n '/token?url=' . $this->baseUrl . '/' . $this->apiNamespace;\n\n return $return;\n }", "public function createUrl()\n\t{\n\t\tif (!$this->getOption('authurl') || !$this->getOption('clientid'))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Authorization URL and client_id are required');\n\t\t}\n\n\t\t$url = $this->getOption('authurl');\n\n\t\tif (strpos($url, '?'))\n\t\t{\n\t\t\t$url .= '&';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url .= '?';\n\t\t}\n\n\t\t$url .= 'response_type=code';\n\t\t$url .= '&client_id=' . urlencode($this->getOption('clientid'));\n\n\t\tif ($this->getOption('redirecturi'))\n\t\t{\n\t\t\t$url .= '&redirect_uri=' . urlencode($this->getOption('redirecturi'));\n\t\t}\n\n\t\tif ($this->getOption('scope'))\n\t\t{\n\t\t\t$scope = is_array($this->getOption('scope')) ? implode(' ', $this->getOption('scope')) : $this->getOption('scope');\n\t\t\t$url .= '&scope=' . urlencode($scope);\n\t\t}\n\n\t\tif ($this->getOption('state'))\n\t\t{\n\t\t\t$url .= '&state=' . urlencode($this->getOption('state'));\n\t\t}\n\n\t\tif (is_array($this->getOption('requestparams')))\n\t\t{\n\t\t\tforeach ($this->getOption('requestparams') as $key => $value)\n\t\t\t{\n\t\t\t\t$url .= '&' . $key . '=' . urlencode($value);\n\t\t\t}\n\t\t}\n\n\t\treturn $url;\n\t}", "public function generateUserTokenUrl(AccountInterface $account);", "function generate_api_url(){\n\t\t$parameters = array(\n\t\t\t'uid' \t\t => $this->uid,\n\t\t\t'pswd' \t\t => $this->pswd,\n\t\t\t'api' \t\t => $this->api,\n\t\t\t'apiversion' => $this->apiversion\t\t\t\n\t\t);\n\t\t\n\t\tif(!empty($this->sid) && !empty($this->encrypted_pswd)){\n\t\t\t$parameters['sid'] = $this->sid;\n\t\t\t$parameters['pswd'] = $this->encrypted_pswd;\n\t\t}\n\t\t\n\t\t//var_dump($parameters);\n\t\t\n\t\treturn self::api_end_point . '?' . http_build_query($parameters);\n\t}", "public function token()\n {\n if( !isset( $this->config['oauth_id'] ) || !isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth' );\n\n // Skip if we're already set up\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n \n $this->url = $_SERVER['HTTP_HOST'].$this->baseURL;\n }", "function getAuthorizeURL($token,$callback='') {\n\t\tif (is_array($token)) {\n\t\t\t$token = $token['oauth_token'];\n\t\t}\n\t\treturn $this->authorizeURL() . \"?oauth_token={$token}&oauth_callback=\".urlencode($callback);\n\t}", "abstract public function getUrlForAuthorizeInTokenService($mode = 'modal');", "public function uri()\n {\n return static::BASE_URI.'/oauth/v3/token';\n }", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "public function getRequestToken($request_token_url, $callback_url = null, $http_method = 'GET') {}", "function getAuthorizeURL($token,$callback = '') {\n\t\tif (is_array ( $token ))\n\t\t\t$token = $token ['oauth_token'];\n\t\tif(!empty($callback)) {\n\t\t\t$callback = \"&oauth_callback=\".urlencode($callback);\n\t\t}\n\t\treturn $this->authorizeURL () . '?oauth_token=' . $token . $callback;\n\t}", "protected function _build_url() {\n\n $params = array_filter([\n 'name' => $this->_names,\n 'country_id' => $this->_country_id,\n 'language_id' => $this->_language_id,\n ], function($v) {\n if (!is_array($v)) {\n return strlen(trim($v)) > 0;\n } else {\n return $v;\n }\n });\n //Only pass apikey if there is one set\n if ($api_key = $this->get_api_key()) {\n $params['apikey'] = trim($api_key);\n }\n\n return self::BASE . '?' . http_build_query($params);\n }", "public function generateLoginUrl(): string\n {\n // This is why we 'fake' the username to a uniqid, to use the test system's token storage.\n return sprintf(\n '%s/login/%s',\n $this->accountEndpoint,\n $this->generateToken(\"login\" . uniqid())\n );\n }", "protected function buildUrl()\n {\n $basePath = env('SLACK_API_HOST');\n $postUri = \"chat.postMessage\";\n $this->url = $basePath . $postUri;\n }", "public function urlTokenCredentials()\n {\n return 'https://api.twitter.com/oauth/access_token';\n }", "public function generate(\\WP_User $User, $token) {\n $url = \\home_url();\n $url = \\add_query_arg( self::USER_PARAM, $User->ID, $url );\n $url = \\add_query_arg( self::TOKEN_PARAM, $token, $url );\n $url = \\add_query_arg( self::NONCE_PARAM, \\wp_create_nonce(self::NONCE_ACTION), $url );\n return $url;\n }", "protected function buildToken() {\n }", "public function buildLoginUrl(Request $request): string;", "function genAuthURL($perms)\n\t{\n\t\t$args['perms'] = $perms;\n\t\t$api_sig = md5($this->api_sig(false,$args));\n\t\treturn 'http://www.rememberthemilk.com/services/auth/?api_key='.$this->apikey.'&perms='.$perms.'&api_sig='.$api_sig;\n\t}", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "public function generateToken();", "public function urlAccessToken()\n {\n return 'https://accounts.google.com/o/oauth2/token';\n }", "protected function generateString()\n\t{\n\t\t// start with the scheme\n\t\t$url = $this->scheme . '://';\n\t\t\n\t\t// user and password\n\t\tif( !empty( $this->user ) )\n\t\t{\n\t\t\t$url .= $this->user;\n\t\t\tif( !empty( $this->pass ) ) $url .= ':'.$this->pass.'@';\n\t\t\telse $url .= '@';\n\t\t}\n\t\t\n\t\t// add the host and path\n\t\t$url .= $this->host . '/';\n\t\t$url .= $this->path;\n\t\t\n\t\t// add the URL-encoded parameters\n\t\tif( !empty( $this->params ) )\n\t\t{\n\t\t\t$url .= '?';\n\t\t\tforeach( $this->params as $f => $v ) $url .= $f . '=' . urlencode( $v ) . '&';\n\t\t\t$url = rtrim( $url, '&' );\n\t\t}\n\t\t\n\t\t// add the anchor if any\n\t\tif( !empty( $this->anchor ) ) $url .= '#' . $this->anchor;\n\t\t\n\t\t$this->url = $url;\n\t\t$this->modified = false;\n\t\treturn $url;\n\t}", "public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getRequestToken();\n\t\treturn rtrim($this->_authoriseUrl,'/').'?'.$tokenData;\n\t}", "public function generateAuthUrl(Request $request)\n {\n return $this->setCurrentBankInSession($request, 'monzo')->authorizer->generateAuthUrl('https://auth.monzo.com/');\n }", "public function generate_url()\n {\n }", "function generateSubTokenUrl($nextUrl = null)\n{\n $secure = false;\n $session = true;\n\n if (!$nextUrl) {\n $nextUrl = OPERATIONS_URL;\n }\n\n $url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, GDATA_SCOPE, $secure, $session);\n \n return $url;\n}", "public function createOpenIdUrl(){\n $format = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect';\n $orderId = \"order123\";\n $paymentId = \"payment999\";\n\n $appId = \\WxPayConfig::APPID;\n $scope = \"snsapi_base\";\n $state = $orderId.\"\".$orderId;\n $redirectUrl = \"http://zyoutrip.com/wechat/payment/redirect\";\n\n $url = sprintf($format, $appId, urlencode($redirectUrl), $scope, $state);\n\n return $url;\n }", "function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }", "public function oauthUrl(string $oauthToken): string\n {\n return sprintf('%s/%s?%s', self::API_URL, 'oauth/authorize', http_build_query([\n 'oauth_token' => $oauthToken,\n ]));\n }", "public function ajax_make_token() {\n $invoice = $this->charge->fetch($_POST['invoice_id']);\n\n if (!$invoice) return status_header(404);\n if ($invoice->status !== 'paid') return status_header(402);\n if (!$invoice->metadata->post_id) return status_header(500); // should never actually happen\n\n $post_id = $invoice->metadata->post_id;\n $token = self::make_token($post_id);\n $url = add_query_arg('publisher_access', $token, get_permalink($post_id));\n\n wp_send_json([ 'post_id' => $post_id, 'token' => $token, 'url' => $url ]);\n }", "protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public static function getURL()\r\n {\r\n $url = 'https://accounts.google.com/o/oauth2/auth?client_id=' . self::$details['client_id'] . '&redirect_uri=' . self::$details['redirect'] . '&scope=https://www.google.com/m8/feeds/&response_type=code';\r\n return $url;\r\n }", "function buildUrl($action, $credentials, $params) {\n $query = http_build_query(array_merge($credentials, $params));\n return \"https://m2web.talk2m.com/t2mapi/\" . $action . \"?\" . $query;\n}", "abstract protected function buildSpecificRequestUri();", "protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}", "public function getBaseAuthorizationUrl()\n {\n return 'https://redbooth.com/oauth2/authorize';\n }", "public function buildUrl(array $params) {\n $params = array_merge(\n $this->getParamsForRequest(),\n $params\n );\n\t\tif (!isset($params['format']))\n\t\t\t$params['format'] = 'php_serial';\n return $this->rest_url . '?' . $this->signParams($params);\n }", "public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "public function urlUserDetails(AccessToken $token) {\n return $this->host . '/api';\n }", "static function getRedirectUri()\n {\n return admin_url('admin-ajax.php') . '?action=set_google_access_token'; \n }", "public function url()\n {\n if (empty($this->parameters)) {\n return $this->url;\n }\n $total = array();\n foreach ($this->parameters as $k => $v) {\n if (is_array($v)) {\n foreach ($v as $va) {\n $total[] = HttpClient::urlencodeRFC3986($k).\"[]=\".HttpClient::urlencodeRFC3986($va);\n }\n } else {\n $total[] = HttpClient::urlencodeRFC3986($k).\"=\".HttpClient::urlencodeRFC3986($v);\n }\n }\n $out = implode(\"&\", $total);\n\n return $this->url.'?'.$out;\n }", "public function generateRegisterUrl(): string\n {\n // This is why we 'fake' the username to a uniqid, to use the test system's token storage.\n return sprintf(\n '%s/register/%s',\n $this->accountEndpoint,\n $this->generateToken(\"register_\" . uniqid())\n );\n }", "public function authenticationURL()\n {\n $clientId = config('twitch-api.client_id');\n $scopes = implode('+', config('twitch-api.scopes'));\n $redirectURL = config('twitch-api.redirect_url');\n return config('twitch-api.api_url') . '/kraken/oauth2/authorize?api_version=5&response_type=code&client_id=' . $clientId . '&redirect_uri=' . $redirectURL . '&scope=' . $scopes;\n }", "public function getAccessTokenUrl() {\n return Mage::helper('adminhtml')->getUrl('adminhtml/aw_vidtest_authsub/auth', array('api_model_code' => $this->getApiModelCode()));\n }", "public function buildUrl(string $ip_address, string $req_for) : string\n {\n $url = self::API_BASE_URL;\n $url .= \"/\".$req_for.\"?ip=$ip_address\";\n\n return $url;\n }", "protected function buildRequestURL()\n {\n $this->requestUrl = $this->url.$this->serviceUrl.$this->requestEndPoint.'?';\n $this->requestUrl .= http_build_query($this->params);\n\n return $this;\n }", "private function buildClientUrl() {\n // protocol\n $s = &$_SERVER;\n $ssl = (array_key_exists('HTTPS', $s) && !empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;\n $sp = array_key_exists('SERVER_PROTOCOL', $s) ? strtolower($s['SERVER_PROTOCOL']) : 'http';\n $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n\n // port\n $port = array_key_exists('SERVER_PORT', $s) ? $s['SERVER_PORT'] : '';\n $port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;\n\n // host\n $host = array_key_exists('HTTP_X_FORWARDED_HOST', $s) && isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (array_key_exists('HTTP_HOST', $s) && isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);\n $host = isset($host) ? $host : (array_key_exists('SERVER_NAME', $s) ? $s['SERVER_NAME'] : $s['USER']) . $port;\n\n // build the uri\n return $protocol . '://' . $host . (array_key_exists('REQUEST_URI', $s) ? $s['REQUEST_URI'] : 'localhost');\n }", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public static function generateURL()\n {\n return $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n }", "public function url()\r\t{\r\t\treturn 'http://morningpages.net/mail/show/'.$this->token;\r\t\t//return url::site('mail/show/' . $this->token, 'http');\r\t}", "function request_url($method){\r\n global $TOKEN;\r\n \r\n\treturn \"https://api.telegram.org/bot\" . $TOKEN . \"/\". $method;\r\n}", "public function generateKey()\n {\n return 'do.' . $this->token->user->id . '.' . preg_replace('/\\//', '.', $this->getUrl());\n }", "public function issueRequestToken()\n {\n // 2legged OAuth\n $this->authenticate();\n\n // Check parameter\n $this->getRequest()->checkParameters(self::$_3l_request_params);\n $callback = $this->getRequest()->getParameter('oauth_callback');\n if (!preg_match('#^https?://.#', $callback)) {\n throw new HTTP_OAuthProvider_Exception('400 oauth_callback is not correct: '.$callback, 400);\n }\n\n // make token\n $store = $this->getStore();\n $store->issueRequestToken($this);\n $ok = $store->save();\n if (!$ok) {\n throw new HTTP_OAuthProvider_Exception('500 Store error', 500);\n }\n\n // response\n $resp = array(\n 'oauth_token' => $store->getToken(),\n 'oauth_token_secret' => $store->getSecret(),\n 'oauth_callback_confirmed' => 'true'\n );\n return http_build_query($resp);\n }", "public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }", "function _http_inject_url($url, array $data) {\n // Parse the url\n $url_parts = parse_url($url);\n\n // Explicitly parse the query part as well\n if (isset($url_parts['query']))\n parse_str($url_parts['query'], $url_query);\n else\n $url_query = array();\n\n // Splice in the token authentication\n $url_query = array_merge($data, $url_query);\n\n // Rebuild the url\n $url_parts['query'] = http_build_query($url_query);\n return _http_build_url($url_parts);\n}", "private function _buildUrl() {\n $url = OPENDIGI_API_ENDPOINT;\n $url .= '?Vcollection=' . implode('+', $this->_collections);\n if ($this->_languages)\n $url .= '&Vlanguages=' . implode('+', $this->_languages);\n if ($this->_subjectIds)\n $url .= '&Vsubjectids=' . implode('+', $this->_subjectIds);\n\n return $url;\n }", "public function getURLLogin() {\r\n $this->initGoogleClient();\r\n $url = $this->client->createAuthUrl();\r\n Log::message(Language::getMessage('log', 'debug_google_get_url', array('url' => $url)), 2);\r\n return $url;\r\n }", "public function buildUrl(string $method, string $version, array $query = []) {\n $query = array_merge(['access_token' => $this->accessToken], $query);\n return sprintf(self::URL.'%s/%s?%s', $method, $version, http_build_query($query));\n }", "final private function constructApiUrl()\r\n {\r\n\t\trequire_once 'bset.php';\r\n $this->apiUrl = 'https://api.telegram.org/bot' . BOT_TOKEN;\r\n }", "public function buildFrontendUri() {}", "public function createToken();", "public function getAuthUrl();", "private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }" ]
[ "0.77741575", "0.7695987", "0.75612605", "0.73174584", "0.7237561", "0.7200556", "0.70561534", "0.6987807", "0.6853787", "0.68435276", "0.6838871", "0.6818387", "0.67675596", "0.6746642", "0.6692429", "0.66108197", "0.659547", "0.6540462", "0.6535929", "0.6501052", "0.6497419", "0.64782804", "0.6465332", "0.64456445", "0.64291", "0.6379243", "0.6350421", "0.63494575", "0.6347909", "0.6347329", "0.6338494", "0.63349646", "0.62998277", "0.6284184", "0.6277767", "0.62081397", "0.61905915", "0.61805826", "0.6169725", "0.6157229", "0.6152412", "0.61256504", "0.61254114", "0.6093147", "0.6093124", "0.60458463", "0.6041089", "0.6029813", "0.60077596", "0.60052925", "0.59944284", "0.59570086", "0.59389913", "0.5925274", "0.5909218", "0.59022427", "0.5895498", "0.5894236", "0.58782375", "0.58726895", "0.58669126", "0.58669126", "0.58669126", "0.58669126", "0.58493954", "0.5848695", "0.5833296", "0.582561", "0.58255446", "0.5805333", "0.58050597", "0.58043224", "0.5800465", "0.5800328", "0.5799295", "0.5797947", "0.578619", "0.57856095", "0.5783534", "0.5772879", "0.5759821", "0.57517403", "0.57470715", "0.57470715", "0.57470715", "0.57470715", "0.5746561", "0.57378066", "0.57102275", "0.5707614", "0.5701556", "0.57004154", "0.5700031", "0.56979895", "0.5687473", "0.5686512", "0.56814706", "0.56683075", "0.566325", "0.5648787", "0.564314" ]
0.0
-1
Execute a Flickr API method. All requests are cached using md5($url) as key.
public function execute(array $params, $lifetime = 7200) { $url = $this->buildUrl($params); $cache = $this->modx->getCacheManager(); $cache_key = md5($url); if ($this->use_cache == TRUE) { if ($cache->get('xflickr/'.$cache_key)) { $result = $cache->get('xflickr/'.$cache_key); } else { $result = $this->submitHttpPost($url); $cache->set('xflickr/'.$cache_key, $result, $lifetime); } } else { $result = $this->submitHttpPost($url); $cache_result = $cache->replace('xflickr/'.$cache_key, $result, $lifetime); if($cache_result == FALSE) { $cache->set('xflickr/'.$cache_key, $result, $lifetime); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flickr($args) {\n\t$endpoint = isset($args['endpoint']) ? $args['endpoint'] : 'http://api.flickr.com/services/rest/';\n\t$secret = isset($args['api_secret']) ? $args['api_secret'] : null;\n\tunset($args['endpoint'], $args['api_secret']);\n\tif ($secret != null) {\n\t\tksort($args);\n\t\t$api_sig = $secret;\n\t\tforeach($args as $k => $v) $api_sig .= $k . $v;\n\t\t$api_sig = md5($api_sig);\n\t\t$args['api_sig'] = $api_sig;\n\t}\n\t$url = $endpoint . '?' . http_build_query($args);\n\tif (substr($endpoint, -15) === '/services/auth/') return $url;\n\t$response = file_get_contents($url);\n\treturn isset($args['format']) && $args['format'] === 'php_serial' ? unserialize($response) : $response;\n}", "function flickr_api($url,$params,$response_tag=\"\",$method=\"GET\")\n\t{\n\n\t# Build query and sign it\n\t$url.=\"?\" . flickr_sign($params);\n\t\n\t# Run query\n\t\n\t$opts = array(\n\t 'http'=>array(\n\t 'method'=>$method\n\t )\n\t);\n\n\t$context = stream_context_create($opts);\n\n\t\n\t$xml=file_get_contents($url,false,$context);\n\tglobal $last_xml;$last_xml=$xml;\n\t\n\tif ($response_tag==\"\")\n\t\t{\n\t\treturn true;\n\t\t}\n\telse\n\t\t{\n\t\treturn flickr_get_response_tag($xml,$response_tag);\n\t\t}\n\t}", "function call_flickr_api_method ($arguments) {\n\t// use the arguments to build the parameter array and construct the url\n\t$params = array_merge(array('format'=>'php_serial'),$arguments);\n\t$encoded_params = array();\n\tforeach ($params as $k => $v)\n\t\t$encoded_params[] = urlencode($k).'='.urlencode($v);\n\t$url = \"http://api.flickr.com/services/rest/?\".implode('&', $encoded_params);\n\t// return response array\n\treturn unserialize( file_get_contents($url) );\n}", "function askFlickr($method, $query){\n\n\t\t/* Build URL */\n\t\t$query = 'http://api.flickr.com/services/rest/?method=flickr.'.$method.'&api_key='.$this->api_key.'&'.$query.'&format=json';\n\n\t\t/* Set CURL options */\n\t\t$ch = curl_init(); // open curl session\n\t\tcurl_setopt($ch, CURLOPT_URL, $query);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$data = curl_exec($ch); // execute curl session\n\t\tcurl_close($ch); // close curl session\n\n\t\t$data = str_replace( 'jsonFlickrApi(', '', $data );\n\t\t$data = substr( $data, 0, strlen( $data ) - 1 ); //strip out last paren\n\n\t\treturn $object = json_decode( $data ); // returns standard class object.\n\t}", "function hash_call($methodName,$nvpStr)\n\t{\n\t\tsession_start();\n\t\t// form header string\n\t\t$nvpheader=$this->nvpHeader();\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//in case of permission APIs send headers as HTTPheders\n\t\tif(!empty($this->AUTH_token) && !empty($this->AUTH_signature) && !empty($this->AUTH_timestamp))\n\t\t {\n\t\t\t$headers_array[] = \"X-PP-AUTHORIZATION: \".$nvpheader;\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers_array);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nvpStr=$nvpheader.$nvpStr;\n\t\t}\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php\n\t\tif($this->USE_PROXY == TRUE)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST.\":\".$this->PROXY_PORT);\n\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->version) . $nvpStr;\n\t\t}\n\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\n\t\t if (curl_errno($ch) == 60) {\n\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO,\n\t\t\tdirname(__FILE__) . '/cacert.pem');\n\t\t\t$response = curl_exec($ch);\n\t\t}\n\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray=$this->deformatNVP($response);\n\t\t$nvpReqArray=$this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t $_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t $_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t $this->APIerror();\n\t\t\t //$location = \"APIError.php\";\n\t\t\t //header(\"Location: $location\");\n\t\t } else {\n\t\t\t //closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t }\n\n\t\treturn $nvpResArray;\n\t}", "function update_flickr_api ($old_key, $new_key) {\n\t$rsp_obj = call_flickr_api_method(array(\n\t\t'api_key'\t=> $new_key,\n\t\t'method'\t=> 'flickr.test.echo'\n\t));\n\t_log($rsp_obj['stat']);\n\t// check if flickr saw the api key as valid and update if so\n\tif ($rsp_obj['stat'] == 'ok') {\n\t\t$_GLOBALS['flickr'] = new phpFlickr($new_key);\n\t\treturn $new_key;\n\t} else {\n\t\treturn $old_key;\n\t}\n}", "function executeREST ($rest_url, $method, $params, $access_token) {\n $url = $rest_url.$method.'.json';\n return executeHTTPRequest($url, array_merge($params, array(\"auth\" => $access_token)));\n}", "public function fetch($url);", "public function executeMethod($method, $params = array(), $timeout = 30) {\n\t\t$cache = new FileCache(array(\n\t\t\t'dir' => Config::getInstance()->get('cache_dir').'/twitter',\n\t\t\t'timeout' => Config::getInstance()->get('cache_timeout', 60) * 60 * 24,\n\t\t\t'ext' => '.cache',\n\t\t));\n\t\t$url = $this->buildUrl($method, $params);\n\t\t$data = $cache->get(md5($url));\n\t\tif (!$data) {\n\t\t\t$ch = curl_init();\n\t\t\t\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n\t\t\t\n\t\t\t// bump PHP's timeout\n\t\t\tset_time_limit($timeout + $timeout + 5);\n\t\t\t\n\t\t\t$data = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t\n\t\t\t$cache->set(md5($url), $data);\n\t\t}\n\t\t\n\t\treturn new TwitterFeed($this, simplexml_load_string($data));\n\t}", "public function request($url);", "function updateCurl($url,$method){\r\n \r\n $curl = curl_init();\r\n // Set some options - we are passing in a useragent too here\r\n curl_setopt_array($curl, array(\r\n CURLOPT_RETURNTRANSFER => 1,\r\n CURLOPT_URL => $url,\r\n CURLOPT_USERAGENT => 'Codular Sample cURL Request'\r\n ));\r\n // Send the request & save response to $resp\r\n $resp = curl_exec($curl);\r\n // Close request to clear up some resources\r\n curl_close($curl);\r\n return $resp;\r\n \r\n \r\n}", "function sync_flickr($search,$new_only=false,$photoset=0,$photoset_name=\"\",$private=0)\n\t{\n\t\n\tglobal $flickr_api_key, $flickr_token, $flickr_caption_field, $flickr_keywords_field, $flickr_prefix_id_title, $lang;\n\t\t\t\n\t$results=do_search($search);\n\t\n\tforeach ($results as $result)\n\t\t{\n\t\tglobal $view_title_field;\n\n\t\t# Fetch some resource details.\n\t\t$title=i18n_get_translated($result[\"field\" . $view_title_field]);\n\t\t$description=sql_value(\"select value from resource_data where resource_type_field=$flickr_caption_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$keywords=sql_value(\"select value from resource_data where resource_type_field=$flickr_keywords_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$photoid=sql_value(\"select flickr_photo_id value from resource where ref='\" . $result[\"ref\"] . \"'\",\"\");\n\n\t\t# Prefix ID to title?\n\t\tif ($flickr_prefix_id_title)\n\t\t\t{\n\t\t\t$title=$result[\"ref\"] . \") \" . $title;\n\t\t\t}\n\t\t\t\n\t\tif (!$new_only || $photoid==\"\")\n\t\t\t{\n\t\t\techo \"<li>\" . $lang[\"processing\"] . \": \" . $title . \"\\n\";\n\t\n\t\t\t$im=get_resource_path($result[\"ref\"],true,\"scr\",false,\"jpg\");\n\t\n\t\t\t# If replacing, add the photo ID of the photo to replace.\n\t\t\tif ($photoid!=\"\")\n\t\t\t\t{echo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"updating_metadata_for_existing_photoid\"]);\n\t\t\t\t\n\t\t\t\t# Also resubmit title, description and keywords.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setTags\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"tags\"=>$keywords));\n\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setMeta\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"title\"=>$title, \"description\"=>$description));\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t# New uploads only. Send the photo file.\n\t\t\tif ($photoid==\"\")\t\n\t\t\t\t{\n\n\t\t\t\t$url=\"http://api.flickr.com/services/upload/\";\n\n\t\t\t\t# Build paramater list for upload\n\t\t\t\t$data=array(\n\t\t\t\t\"photo\"=>\"@\" . $im,\n\t\t\t\t\"api_key\"=>$flickr_api_key,\n\t\t\t\t\"auth_token\" => $flickr_token,\n\t\t\t\t\"title\" => $title,\n\t\t\t\t\"description\" => $description,\n\t\t\t\t\"tags\" => $keywords\n\t\t\t\t);\n\n\t\t\t\t# Add the signature by signing the data...\n\t\t\t\t$data[\"api_sig\"]=flickr_sign($data,array(\"photo\"),true);\n\t\t\t\t\n\t\t\t\t# Use CURL to upload the photo.\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\t$photoid=flickr_get_response_tag(curl_exec($ch),\"photoid\");\n\t\t\t\t\n\t\t\t\techo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"photo-uploaded\"]);\n\n\t\t\t\t# Update Flickr tag ID\n\t\t\t\tsql_query(\"update resource set flickr_photo_id='\" . escape_check($photoid) . \"' where ref='\" . $result[\"ref\"] . \"'\");\n\t\t\t\t}\n\n\t\t\t$created_new_photoset=false;\n\t\t\tif ($photoset==0)\n\t\t\t\t{\n\t\t\t\t# Photoset must be created.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.create\",\"auth_token\"=>$flickr_token, \"title\"=>$photoset_name, \"primary_photo_id\"=>$photoid),\"\",\"POST\");\n\t\t\t\tglobal $last_xml;\n\t\t\t\t#echo htmlspecialchars($last_xml);\n\t\t\t\t$pos_1=strpos($last_xml,\"id=\\\"\");\n\t\t\t\t$pos_2=strpos($last_xml,\"\\\"\",$pos_1+5);\n\t\t\t\t$photoset=substr($last_xml,$pos_1+4,$pos_2-$pos_1-4);\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoset_name\", \"%photoset\"), array($photoset_name, $photoset), $lang[\"created-new-photoset\"]);\n\t\t\t\t$created_new_photoset=true;\n\t\t\t\t}\n\n\t\t\t# Add to photoset\n\t\t\tif (!$created_new_photoset) # If we've just created a photoset then this will already be present within it as the primary photo (added during the create photoset request).\n\t\t\t\t{\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.addPhoto\",\"auth_token\"=>$flickr_token, \"photoset_id\"=>$photoset, \"photo_id\"=>$photoid));\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoid\", \"%photoset\"), array($photoid, $photoset), $lang[\"added-photo-to-photoset\"]);\n\t\t\t\t#global $last_xml;echo nl2br(htmlspecialchars($last_xml));\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t# Set permissions\n\t\t\techo \"<li>\" . str_replace(\"%permission\", $private==0 ? $lang[\"flickr_public\"] : $lang[\"flickr_private\"], $lang[\"setting-permissions\"]);\n\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setPerms\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"is_public\"=>($private==0?1:0),\"is_friend\"=>0,\"is_family\"=>0,\"perm_comment\"=>0,\"perm_addmetadata\"=>0),\"\",\"POST\");\n\n\t\t\t\n\t\t\t}\n\t\t}\n\techo \"<li>\" . $lang[\"done\"];\n\t}", "public function curl_execute($method, $_query)\r\n {\r\n \t$api_url = \"{$this->base_url}{$method}?\".http_build_query($_query).\"&user_key={$this->user_key}\";\r\n \r\n\t\tif (isset($this->order_by) && isset($this->sort_order))\r\n\t\t{\r\n\t\t\t$api_url .= \"&order={$this->order_by}+$this->sort_order\";\r\n\r\n\t\t\t// Unset parameters for further requests\r\n\t\t\tunset($this->order_by);\r\n\t\t\tunset($this->sort_order);\r\n\t\t}\r\n\r\n\t\t$ch = curl_init($api_url);\r\n curl_setopt_array($ch, array(\tCURLOPT_RETURNTRANSFER\t=> TRUE,\r\n\t\t\t\t\t\t\t\t\t\tCURLOPT_TIMEOUT \t\t=> 5));\r\n\r\n $response\t\t= curl_exec($ch);\r\n $http_status \t= curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n \r\n if ($http_status !== 200)\r\n {\r\n echo \"HTTP call failed with error {$http_status}.\";\r\n }\r\n elseif ($response === FALSE)\r\n {\r\n \techo \"HTTP call failed empty response.\";\r\n }\r\n \r\n\t\treturn ($this->format === 'json') ? $response : json_decode($response, TRUE);\r\n }", "public function hash_call($method_name, $nvpstr)\n\t{\n\t $settings = $this->pex_settings;\n\t $nvpheader = \"&PWD=\".urlencode($settings['api_password']).\"&USER=\".urlencode($settings['api_username']).\"&SIGNATURE=\".urlencode($settings['api_signature']);\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$settings['api_endpoint']);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t$nvpstr=$nvpheader.$nvpstr;\n\t\t//check if version is included in $nvpstr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpstr))) == strlen($nvpstr)) {\n\t\t\t$nvpstr = \"&VERSION=\" . urlencode($settings['api_version']) . $nvpstr;\t\n\t\t}\n\t\t$nvpreq=\"METHOD=\".urlencode($method_name).$nvpstr;\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpresarray = $this->deformat_nvp($response);\n\t\t$nvpreqarray = $this->deformat_nvp($nvpreq);\n\t\t$_SESSION['nvpreqarray']=$nvpreqarray;\n\t\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no'] = curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg'] = curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} \n\t\telse {\n\t\t\t//closing the curl\n\t\t\tcurl_close($ch);\n\t\t}\n\t\treturn $nvpresarray;\n\t}", "private function invoke() {\n global $user;\n $req =& $this->request;\n try {\n\n if ($req) {\n if (isset($req->uri) && preg_match(\"/^([^\\?]*)(\\?(.*))?$/\", $req->uri, $match)) {\n $this->q = $match[1];\n parse_str($match[3], $_GET);\n }\n }\n \n if (isset($req) && !is_object($req))\n throw new Exception(\"Invalid Request.\", -32600);\n \n \n if (!preg_match(\"/^(?:(\\D\\w*)[\\.\\/])?(\\D\\w*)\\/?(.*)$/\", $this->q, $match))\n throw new Exception(\"Invalid Request.\", -32600);\n \n list(, $c, $m, $a) = $match;\n \n\t\t\n\t\t//if (!$c)\n\t\t//\t$c = jsonrpc_load_class_by_method($m, TRUE);\n \n\n\t\t\n \n if (!($c && class_exists($c, FALSE))) {\n $c = jsonrpc_load_class($c, $m, TRUE);\n }\n \n if (isset($a) && is_string($a) && FALSE !== strpos($a, ','))\n $a = explode(',', $a);\n if (isset($_GET['id']))\n $req->id = $_GET['id'];\n $is_super = $user->uid == 1;\n if ($user->uid == 0 && $_SERVER['REMOTE_ADDR'] == '127.0.0.1' && !isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $is_super = TRUE;\n $user->uid = 1;\n }\n \n //echo $c;\n \n if (!method_exists($c, $m))\n throw new Exception('Method does not exists.', -32601);\n if (variable_get('site_offline', 0) && !$is_super)\n throw new Exception('Site if offline');\n $refl = new ReflectionMethod($c, $m);\n \n\t//$args = array();\n \n if (!isset($req->params)) {\n if ($a)\n $args = $a;\n elseif (isset($_GET['params']))\n $args = explode(',', $_GET['params']);\n elseif (isset($_GET['param']))\n $args = explode(',', $_GET['param']);\n }\n else\n $args = $req->params;\n \n //if(!is_array($args))\n \t\n\n\t//var_dump(count($args) <= $refl->getNumberOfParameters());\n\n //if ($refl->getNumberOfRequiredParameters() <= 1 && is_array($args) && count($args) > $refl->getNumberOfParameters() )\n \n //if($refl->getNumberOfRequiredParameters\n \n $np = $refl->getNumberOfParameters();\n $nr = $refl->getNumberOfRequiredParameters();\n\n\t\t//if ($np == 1 && count($args)\n//var_dump($args);\n//die;\n \n \n \n if ($nr <= 1 && !(is_array($args) && count($args) == $np && $np > 1 ) && isset($req->params))\n $args = array($args);\n\n\n//var_dump($args);\n\n switch (TRUE) {\n case $refl->isStatic():\n $req->result = call_user_func_array(array($c, $m), $args);\n break;\n case $refl->isPublic():\n $inst = $this->instance($c);\n $req->result = call_user_func_array(array($inst, $m), $args);\n break;\n case $refl->isProtected() && $is_super:\n $refl->setAccessible(TRUE);\n $req->result = $refl->invokeArgs(new $c, $args);\n break;\n default:\n throw new Exception(\"Method not found or permission denied on launching $c::$m.\");\n }\n } catch (Exception $e) {\n if (!is_object($req))\n $req = $this->request = (object)NULL;\n $data = isset($e->data) ? $e->data : get_class($e);\n $req->error = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'data' => $data);\n }\n }", "protected function _cached( $method ) {\n\n\t\t$signature = $method;\n\t\t$args = [ ];\n\n\t\tif ( func_num_args( ) > 1 ) {\n\t\t\t$args = array_slice( func_get_args( ), 1 );\n\t\t\t$signature .= json_encode( $args );\n\t\t}\n\n\t\t$key = $this->_cacheKey( $signature );\n\n\t\tif ( $this->_Cache->has( $key )) {\n\t\t\treturn $this->_Cache->get( $key );\n\t\t}\n\n\t\t$result = call_user_func_array( [ $this, $method ], $args );\n\t\t$this->_Cache->set( $key, $result );\n\n\t\treturn $result;\n\t}", "public function execute($url, $data = array(), $method = 'GET', $headers = array()) {\n if (empty($url)) {\n throw new Exception('Invalid url');\n }\n \n if ($method !== 'GET' && $method !== 'POST') {\n throw new Exception(\"Method not supported\");\n }\n \n if ($method == 'GET') {\n $str = '';\n if (!empty($data)) {\n foreach($data as $k => $v) {\n $str = $str . '&' . $k . '=' . $v;\n }\n $str = trim($str, '&');\n $this->client->setGetfield($str);\n $this->client->buildOauth($url, $method);\n }\n } else {\n $this->client->buildOauth($str, $method);\n if(!empty($data)) {\n $this->client->setPostfields($data);\n }\n }\n return $this->client->performRequest();\n }", "abstract function do_api_request();", "public function execute($method, $location);", "public function fetchResult($url);", "function cacheThisImage($img)\n{\n\trequire_once 'externalLibraries/ImageCache.php';\n\t$baseurl=base_url();\n\t$imagecache = new ImageCache();\n\t//$imagecache->cached_image_directory = $baseurl. 'entreprenity/api/cachedImages/';\n\t$imagecache->cached_image_directory = dirname(__FILE__) . '/cachedImages';\n\n\t$cached_src_one = $imagecache->cache($img);\n\t//return $imagecache->cached_image_directory;\n\treturn $cached_src_one;\n\n}", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n if (version_compare(phpversion(), '5.4.0', '<')) {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\r\n } else {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);\r\n }\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, TRUE);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if ( isset($this->access_token) && $this->access_token )\r\n $headers[] = \"Authorization: OAuth2 \".$this->access_token;\r\n\r\n if ( !empty($this->remote_ip) ) {\r\n if ( defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\r\n } else {\r\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\r\n }\r\n } else {\r\n if ( !defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n curl_setopt($ci, CURLOPT_URL, $url );\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo \"=====headers======\\r\\n\";\r\n print_r($headers);\r\n\r\n echo '=====request info====='.\"\\r\\n\";\r\n print_r( curl_getinfo($ci) );\r\n\r\n echo '=====response====='.\"\\r\\n\";\r\n print_r( $response );\r\n }\r\n curl_close ($ci);\r\n return $response;\r\n }", "function http($url, $method, $postfields = NULL, $headers = array()) {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n $this->postdata = $postfields;\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n if (isset($this->access_token) && $this->access_token)\n $headers[] = \"Authorization: OAuth2 \" . $this->access_token;\n if (!empty($this->remote_ip)) {\n if (defined('SAE_ACCESSKEY')) {\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\n } else {\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\n }\n } else {\n if (!defined('SAE_ACCESSKEY')) {\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\n }\n }\n curl_setopt($ci, CURLOPT_URL, $url);\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n $this->url = $url;\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n echo \"=====headers======\\r\\n\";\n print_r($headers);\n echo '=====request info=====' . \"\\r\\n\";\n print_r(curl_getinfo($ci));\n echo '=====response=====' . \"\\r\\n\";\n print_r($response);\n }\n curl_close($ci);\n return $response;\n }", "public static function execute($url)\n {\n if(isset(self::$routes[$url])) {\n $cont = self::$routes[$url];\n $cont['vars']['method'] = $_SERVER['REQUEST_METHOD'];\n return parent::dispatch(new $cont['name'](self::$vars = $cont['vars']));\n }\n \n return parent::execute($url);\n }", "protected function _execute($url = '', $method = self::DEFAULT_METHOD, array $data = array())\n {\n $this->_result = null;\n\n if (!is_string($method) || $method === '') {\n $method = self::DEFAULT_METHOD;\n }\n\n $url = rtrim($url, '/') . '/';\n\n $method = strtoupper($method);\n $host = $this->getUrl();\n\n if (!is_string($url) || $url === '') {\n $url = $host;\n }\n\n if (strpos($url, '/') === 0) {\n $url = $host . ltrim($url, '/');\n }\n\n if (strpos($url, $host) !== 0) {\n throw new Api_Odr_Exception('Wrong host for URL ('. $url .')');\n }\n\n $ch = curl_init($url);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n\n if (count($data) > 0) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n }\n\n if (count($this->_headers) > 0) {\n $headers = array();\n\n foreach ($this->_headers as $k => $v) {\n if ($v) {\n $headers[] = $k . ': ' . $v;\n }\n }\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n\n $result = curl_exec($ch);\n\n $this->_error = curl_error($ch);\n\n if (empty($this->_error)) {\n $this->_result = json_decode($result, true);\n }\n\n $this->log('Executed [' . $method . '] ' . $url);\n\n curl_close($ch);\n\n if (!empty($this->_error)) {\n throw new Api_Odr_Exception($this->_error);\n }\n\n return $this;\n }", "function run() {\n global $url;\n session_start();\n\n if (class_exists('AppHelper')) {\n $url = AppHelper::validate_and_authorize($url);\n } else {\n error_log ('this app has no AppHandler defined, hence no secutiy ');\n }\n\n # Parse our 3 part URL\n # Format: controller[/action[.type][/query_string]] \n # Example: login/get/3\n # Example: login/listall.json\n list($controller, $action, $content_type, $query_string) = parse_rest_url($url);\n\n $controller = ucwords($controller).'Controller';\n $dispatch = new $controller($action, $content_type);\n\n if ((int)method_exists($controller, $action)) {\n call_user_func_array(array($dispatch,$action),array($query_string));\n } else {\n AppHelper::not_found($dispatch, $url); \n }\n}", "function CallAPI($method, $url, $data = false){\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\t\t\n\t\t$update_json = json_encode($data);\t\n\t\tcurl_setopt($curl, CURLOPT_URL, $url . \"?\" . http_build_query($data));\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSLVERSION, 4);\n\t\t$result = curl_exec($curl); \n\t\t$api_response_info = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\treturn $result;\n}", "private function request( $method, $args )\n\t\t{\n\n\t\t\t$args['method'] = $method;\n\t\t\t$args['format'] = 'json';\n\t\t\t$args['api_key'] = 'd348e6e1216a46f2a4c9e28f93d75a48';\n\t\t\t$args['nojsoncallback'] = 1;\n\t\t\t$url = esc_url_raw( add_query_arg( $args, 'http://api.flickr.com/services/rest/' ) );\n\n\t\t\t$response = wp_remote_get( $url );\n\t\t\tif ( is_wp_error( $response ) )\n\t\t\t\treturn false;\n\n\t\t\t$body = wp_remote_retrieve_body( $response );\n\t \t\t$obj = json_decode( $body );\n\n\t\t\tif ( $obj && $obj->stat == 'fail' )\n\t\t\t\treturn new WP_Error( 'error', $obj->message );\n\n\t\t\treturn $obj ? $obj : false;\n\n\t\t}", "abstract public function get_url_update();", "function fetchFromServer($method, $data){\n global $DB;\n $server_url = $DB->get_field_sql('SELECT value FROM {config} WHERE name = \"bigbluebuttonbn_server_url\"');\n $salt = $DB->get_field_sql('SELECT value FROM {config} WHERE name = \"bigbluebuttonbn_shared_secret\"');\n // $server_url = \"https://api.mynaparrot.com/bigbluebutton/iqdevelopment/\";\n // $salt = \"gTdddGZCzDgPhFXpiqON\";\n\n ksort($data);\n $params = \"\";\n foreach ($data as $key => $value) {\n $params .= $key . '=' . urlencode($value) . \"&\";\n }\n $params = rtrim($params, \"&\");\n $params = ltrim($params, \"=\");\n\n $sign = sha1($method . $params . $salt);\n\n $url = $server_url . \"api/\". $method . \"?\" . $params .'&checksum=' . $sign;\n\n //echo $url . \"<br>\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90); //timeout in seconds\n $response = curl_exec($ch);\n curl_close ($ch);\n\n if(!$response){\n return curl_error($ch);\n }\n\n try {\n $xml = simplexml_load_string($response);\n return json_decode(json_encode($xml));\n } catch (Exception $e) {\n return $e->getMessage();\n }\n}", "function cacheImage($url) {\r\n\t\ttry {\r\n\t\t\t$cacheDir = dirname(__FILE__) . '/img/cache/';\r\n if (!file_exists($cacheDir)) {\r\n mkdir($cacheDir, 0777, true);\r\n }\r\n \t$cached_filename = md5($url);\r\n\t\t\t$files = glob($cacheDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\r\n\t\t\t$now = time();\r\n\t\t\tforeach ($files as $file) {\r\n\t\t\t\tif (is_file($file)) {\r\n\t\t\t\t\tif ($now - filemtime($file) >= 60 * 60 * 24 * 5) { // 5 days\r\n\t\t\t\t\t\tunlink($file);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($files as $file) {\r\n\t\t\t\t$fileName = explode('.',basename($file));\r\n\t\t\t\tif ($fileName[0] == $cached_filename) {\r\n\t\t\t\t $path = getRelativePath(dirname(__FILE__),$file);\r\n\t\t\t\t\t return $path;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$image = file_get_contents($url);\r\n\t\t\tif ($image) {\r\n\t\t\t\t$tempName = $cacheDir . $cached_filename;\r\n\t\t\t\tfile_put_contents($tempName,$image);\r\n\t\t\t\t$imageData = getimagesize($tempName);\r\n\t\t\t\t$extension = image_type_to_extension($imageData[2]);\r\n\t\t\t\tif($extension) {\r\n\t\t\t\t\t$filenameOut = $cacheDir . $cached_filename . $extension;\r\n\t\t\t\t\t$result = file_put_contents($filenameOut, $image);\r\n\t\t\t\t\tif ($result) {\r\n\t\t\t\t\t\trename($tempName,$filenameOut);\r\n\t\t\t\t\t\treturn getRelativePath(dirname(__FILE__),$filenameOut);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunset($tempName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (\\Exception $e) {\r\n\t\t\twrite_log('Exception: ' . $e->getMessage());\r\n\t\t}\r\n\t\treturn $url;\r\n\t}", "function cachefile($url = false) {\n\t\tif(!$url) {\n\t\t\t$url = uniqid();\n\t\t}\n\t\t\n\t\t$request_hash = sha1($url);\n\t\t\n\t\t$tmp_path = sys_get_temp_dir();\n\t\t\n\t\t$cache_name = 'wmjapi-' . $this->token_hash . '-' \n\t\t\t. sha1($url) . '.json';\n\t\t\n\t\tif(substr($tmp_path, -1) !== '/') {\n\t\t\t$tmp_path = $tmp_path . '/';\n\t\t}\n\t\t\n\t\t$cache_file = $tmp_path . $cache_name;\n\t\t\n\t\treturn $cache_file;\n\t}", "function hash_call($methodName,$nvpStr){\n\t\t//declaring of global variables\n\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->PAYPAL_API_ENDPOINT);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t\t//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \n\t\tif($this->PAYPAL_USE_PROXY)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PAYPAL_PROXY_HOST.\":\".$this->PAYPAL_PROXY_PORT); \n\t\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->PAYPAL_VERSION) . $nvpStr;\t\n\t\t}\n\t\t\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\t\t\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\t\t$nvpReqArray = $this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t}\n\t\n\treturn $nvpResArray;\n\t}", "public static function fetch($method, $cacheKey, $duration = CACHE_MEDIUM) {\r\n\t\t\t$retVal = self::Get($cacheKey);\r\n\t\t\tif ($retVal === false && is_callable($method)) {\r\n\t\t\t\t$retVal = $method();\r\n\t\t\t\tself::Set($cacheKey, $retVal, $duration);\r\n\t\t\t}\r\n\t\t\treturn $retVal;\r\n\t\t}", "protected function _execute(){\n\t\t\t$this->_getUrl();\n\n\t\t\t$c = curl_init($this->_url);\n\t\t\tob_start();\n\t\t\tif(!empty($this->_postFields)) {\n\t\t\t\tcurl_setopt($c, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($c, CURLOPT_POSTFIELDS, json_encode($this->_postFields));\n\t\t\t}\n\n\t\t\tcurl_exec($c);\n\t\t\tcurl_close($c);\n\t\t\t$this->_result = trim(ob_get_contents());\n\t\t\tob_end_clean();\n\t\t}", "private function makeRequestOrLoadFromCache(string $method, string $url) : array\n {\n $key = $this->createCacheKey($url);\n\n if (Craft::$app->cache->exists($key)){\n return Craft::$app->cache->get($key);\n }else{\n $response = $this->makeRequest($method, $url);\n Craft::$app->cache->set($key, $response, CraftUKCrimeStats::getInstance()->getSettings()->cache); \n return $response;\n }\n }", "public function get($url, $fn) {\n $this->rutasGET[$url] = $fn;\n }", "function CallAPI($method, $url, $data = false)\n\t{\n\t\t$curl = curl_init();\n\t\tswitch ($method)\n\t\t{\n\t\t\tcase \"POST\":\n\t\t\t\tcurl_setopt($curl, CURLOPT_POST, 1);\n\n\t\t\t\tif ($data)\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($data)\n\t\t\t\t\t$url = sprintf(\"%s?%s\", $url, http_build_query($data));\n\t\t}\n\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$result = curl_exec($curl);\n\n\t\tcurl_close($curl);\n\n\t\treturn $result;\n\t}", "public function onRequestUrl(&$url)\n {\n // if hash match, handle request\n if (substr($url, 0, strlen($this->hash)) === $this->hash) {\n // check user rights\n if (!$this->setRights()) {\n $url = '403';\n header('HTTP/1.1 403 Forbidden');\n exit;\n }\n $method = $_SERVER['REQUEST_METHOD'];\n switch($method) {\n case 'POST':\n $save = $this->createFile();\n if ($save) {\n echo 'ok';\n } else {\n header('HTTP/1.1 400 Bad Request');\n echo $this->info;\n }\n break;\n case 'PUT':\n $save = $this->editFile();\n if ($save) {\n echo 'ok';\n } else {\n header('HTTP/1.1 400 Bad Request');\n echo $this->info;\n }\n break;\n case 'DELETE':\n $save = $this->deleteFile();\n if ($save) {\n echo 'ok';\n } else {\n header('HTTP/1.1 400 Bad Request');\n echo $this->info;\n }\n break;\n case 'GET':\n // read file content and output\n if (file_exists(CONTENT_DIR . $_GET['path'] . CONTENT_EXT)) {\n readFile(CONTENT_DIR . $_GET['path'] . CONTENT_EXT);\n } else {\n echo $this->formatContent(file_get_contents(CONTENT_DIR . $this->template));\n }\n break;\n }\n exit; // stop everything!\n }\n }", "abstract protected function apiInternal($accessToken, $url, $method, array $params);", "private static function urlCache(array $_proc) {\n\t\t// Get HTTP request headers\n\t\t$_req=array();\n\t\tif (PHP_SAPI!='cli' && !self::$global['QUIET']) {\n\t\t\t$_req=function_exists('getallheaders')?\n\t\t\t\tgetallheaders():self::getHeaders();\n\t\t}\n\t\t// Content divider\n\t\t$_div=chr(0);\n\t\t// Get hash code for this Web page\n\t\t$_hash='url.'.self::hashCode(\n\t\t\t$_SERVER['REQUEST_METHOD'].' '.$_SERVER['REQUEST_URI']\n\t\t);\n\t\t$_cached=Cache::cached($_hash);\n\t\t// Regex pattern for Content-Type\n\t\t$_regex='/'.self::HTTP_Content.'.+/';\n\t\t$_time=time();\n\t\tif ($_cached && ($_time-$_cached['time'])<$_proc[1]) {\n\t\t\t// Activate cache timer\n\t\t\tself::httpCache($_cached['time']+$_proc[1]-$_time);\n\t\t\tif (!isset($_req[self::HTTP_IfMod]) ||\n\t\t\t\t$_cached['time']>strtotime($_req[self::HTTP_IfMod])) {\n\t\t\t\t// Retrieve from cache and decompress\n\t\t\t\t$_buffer=gzinflate(Cache::fetch($_hash));\n\t\t\t\t$_type=strstr($_buffer,$_div,TRUE);\n\t\t\t\tif (preg_match($_regex,$_type,$_match) &&\n\t\t\t\t\tPHP_SAPI!='cli' && !self::$global['QUIET'] &&\n\t\t\t\t\t!headers_sent())\n\t\t\t\t\t\theader($_match[0]);\n\t\t\t\t// Save response\n\t\t\t\tself::$global['RESPONSE']=substr(strstr($_buffer,$_div),1);\n\t\t\t}\n\t\t\telse\n\t\t\t\t// No need to serve page; client-side cache is fresh\n\t\t\t\tself::httpStatus(304);\n\t\t}\n\t\telse {\n\t\t\t// Cache this page\n\t\t\tob_start();\n\t\t\tself::call($_proc[0]);\n\t\t\tself::$global['RESPONSE']=ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\tif (!self::$global['ERROR'] && self::$global['RESPONSE']) {\n\t\t\t\t$_type='';\n\t\t\t\tforeach (headers_list() as $_hdr)\n\t\t\t\t\tif (preg_match($_regex,$_hdr,$_match)) {\n\t\t\t\t\t\t// Add Content-Type header to buffer\n\t\t\t\t\t\t$_type=$_match[0];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t// Compress and save to cache\n\t\t\t\tCache::store($_hash,\n\t\t\t\t\tgzdeflate($_type.$_div.self::$global['RESPONSE'])\n\t\t\t\t);\n\t\t\t\t// Activate cache timer\n\t\t\t\tself::httpCache($_proc[1]);\n\t\t\t\tif (PHP_SAPI!='cli' && !self::$global['QUIET'] &&\n\t\t\t\t\t!headers_sent())\n\t\t\t\t\t\theader(self::HTTP_LastMod.': '.date('r',$_time));\n\t\t\t}\n\t\t}\n\t}", "private function dispatch(): void {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"{$this->apiUrl}/{$this->endpoint}\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => \"CURL_HTTP_VERSION_1_1\",\n CURLOPT_CUSTOMREQUEST => $this->method\n ));\n\n $this->response = curl_exec($curl); \n curl_close($curl);\n }", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n\t\t//print_r($postfields);exit;\r\n\t\t$this->http_info = array();\r\n\t\t$ci = curl_init();\r\n\t\t/* Curl settings */\r\n\t\t\r\n\t\tcurl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 3);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, 3);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);\t\t\r\n\t\tcurl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n\t\tcurl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n\t\tcurl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n\t\tcurl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t\tswitch ($method) {\r\n\t\t\tcase 'POST':\r\n\t\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\r\n\t\t\t\tif (!empty($postfields)) {\r\n\t\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t\t\t\t$this->postdata = $postfields;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'DELETE':\r\n\t\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n\t\t\t\tif (!empty($postfields)) {\r\n\t\t\t\t\t$url = \"{$url}?{$postfields}\";\r\n\t\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t$headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n\t\tcurl_setopt($ci, CURLOPT_URL, $url );\r\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n\t\tcurl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n\t\t$response = curl_exec($ci);\r\n\t\t\r\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n\t\t$this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n\t\t$this->url = $url;\r\n\r\n\t\tif ($this->debug) {\r\n\t\t\techo \"=====post data======\\r\\n\";\r\n\t\t\tvar_dump($postfields);\r\n\r\n\t\t\techo '=====info====='.\"\\r\\n\";\r\n\t\t\tprint_r( curl_getinfo($ci) );\r\n\r\n\t\t\techo '=====$response====='.\"\\r\\n\";\r\n\t\t\tprint_r( $response );\r\n\t\t}\r\n\t\tcurl_close ($ci);\r\n\t\treturn $response;\r\n\t}", "function CallAPI($method, $url, $data = false)\r\n{\r\n $curl = curl_init();\r\n\r\n switch ($method)\r\n {\r\n case \"POST\":\r\n curl_setopt($curl, CURLOPT_POST, 1);\r\n\r\n if ($data)\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n break;\r\n case \"PUT\":\r\n curl_setopt($curl, CURLOPT_PUT, 1);\r\n break;\r\n default:\r\n if ($data)\r\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n }\r\n\r\n // Optional Authentication:\r\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\r\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\r\n\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n $result = curl_exec($curl);\r\n\r\n curl_close($curl);\r\n\r\n return $result;\r\n}", "public static function cacheData($sid, $Name, $URL, $content, $status, $method)\n {\n if (strpos($URL,'/UI/')===false && strtoupper($method)=='GET'){ // ??????\n $uTag = md5($URL);\n\n if (!isset(self::$cachedData[$uTag])){\n self::$cachedData[$uTag] = new DataObject($content,$status);\n $eTag = self::generateETag($content);\n if ($sid===self::$currentBaseSID)\n self::storeData('data_'.$eTag,$content);\n }\n }\n \n if ($sid===self::$currentBaseSID){\n self::finishRequest($sid, null, 'BEGIN', null, $content, $status, null, null);\n self::savePath($URL,$method);\n }\n }", "public function makeRequest( $url, $method = 'GET', $headers = null );", "private function http($url, $method = \"GET\", $postfields=NULL){\n $this->http_info = array();\n $handle = curl_init();\n /* Curl settings */\n curl_setopt($handle, CURLOPT_HEADER, FALSE);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);\n curl_setopt($handle, CURLOPT_HTTPHEADER, array('Expect:'));\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, $this->verifypeer);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($handle, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($handle, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($handle, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n \n if ($this->proxy_settings['behind_proxy']){\n curl_setopt($ci, CURLOPT_PROXY, $this->proxy_settings['host']);\n curl_setopt($ci, CURLOPT_PROXYPORT, $this->proxy_settings['port']);\n curl_setopt($ci, CURLOPT_PROXYUSERPWD, \"{$this->proxy_settings['user']}:{$this->proxy_settings['pass']}\");\n curl_setopt($ci, CURLOPT_PROXYTYPE, $this->proxy_settings['type']);\n curl_setopt($ci, CURLOPT_PROXYAUTH, $this->proxy_settings['auth']);\n }\n \n switch($method){\n case self::$METHOD_POST:\n curl_setopt($handle, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($handle, CURLOPT_POSTFIELDS, $postfields);\n }\n break;\n case self::$METHOD_DELETE:\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)){\n $url .= \"?\".OAuthUtil::build_http_query($postfields);\n }\n break;\n }\n curl_setopt($handle, CURLOPT_URL, $url);\n $response = curl_exec($handle);\n $this->http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($handle));\n $this->url = $url;\n curl_close($handle);\n return $response;\n }", "public function processApi() {\r\n\tif($this->securedRest){\r\n\t if(!isset($this->requestSecure) || !isset($this->requestPublicKey)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t if(!$this->verifyKeys($this->requestPublicKey, $this->requestSecure)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t}\r\n\t\r\n\t$func = $this->_method;\r\n\tif ((int) method_exists($this, $func) > 0){\r\n\t $this->$func();\r\n\t}else{\r\n\t $this->response('', 404);\r\n\t}\r\n\t\r\n }", "function fetch_url($url, $expiry = CACHE_EXPIRY_TIMESPAN, $post_params = null) {\n global $cookie;\n global $calendar_url;\n\n if ($post_params) {\n $post = array();\n foreach ($post_params as $key => $value) {\n $post []= $key.'='.htmlentities($value);\n }\n $post = implode('&', $post);\n } else {\n $post = '';\n }\n\n $cache_path = CACHE_PATH.md5($calendar_url).md5($url.$post);\n echo 'Fetching '.$url.'...memory: '.memory_get_usage().'...';\n if (file_exists($cache_path) &&\n filemtime($cache_path) >= time() - $expiry) {\n echo 'from cache.'.\"\\n\";\n $data = file_get_contents($cache_path);\n } else {\n echo 'from web...';\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n //curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n curl_setopt($ch, CURLOPT_USERAGENT, 'UWDataSpider/1.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7)');\n if ($post_params) {\n curl_setopt($ch, CURLOPT_POST, count($post_params));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n }\n $data = curl_exec($ch);\n\n/*\n $context = stream_context_create(array(\n 'http' => array(\n 'method'=>\"GET\",\n 'header'=>\"Accept-language: en-us,en;q=0.5\\r\\n\".\n \"Referrer: http://uwdata.ca\\r\\n\".\n \"User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7\\r\\n\"\n )\n ));\n $data = file_get_contents($url, 0, $context);*/\n if ($data) {\n file_put_contents($cache_path, $data);\n }\n echo 'done.'.\"\\n\";\n }\n return $data;\n}", "protected static function run($url, $method = 'GET', $data = [])\n\t{\n\t\t$ch = curl_init();\n\n\t\t// set URL and other appropriate options\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\n\t\tif ($data)\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t}\n\n\t\t// grab URL and pass it to the browser\n\t\t$results = curl_exec($ch);\n\n\t\t// close cURL resource, and free up system resources\n\t\tcurl_close($ch);\n\n\t\treturn json_decode($results);\n\t}", "function quick_curl( $url, $user_auth = null, $rest = 'GET', $input = null, $type = 'JSON'){\n if( function_exists('curl_init') ){\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url ); // The URL we're using to get/send data\n\n if( $user_auth ){\n curl_setopt( $ch, CURLOPT_USERPWD, $user_auth ); // Add the authentication\n }\n\n if( $rest == 'POST' ){\n curl_setopt( $ch, CURLOPT_POST, true ); // Send a post request to the server\n } elseif( $rest == 'PATCH' ){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // Send a patch request to the server to update the listing\n } elseif( $rest == 'PUT'){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // Send a put request to the server to update the listing\n } // If POST or PATCH isn't set then we're using a GET request, which is the default\n\n curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 15 ); // Timeout when connecting to the server\n curl_setopt( $ch, CURLOPT_TIMEOUT, 30 ); // Timeout when retrieving from the server\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // We want to capture the data returned, so set this to true\n //curl_setopt( $ch, CURLOPT_HEADER, true ); // Get the HTTP headers sent with the data\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // We don't want to force SSL incase a site doesn't use it\n\n if( $rest !== 'GET' ){\n\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: ' . mime_type( $type ), 'Content-Length: ' . strlen( $input ) ) ); // Tell server to expect the right content type and the content length\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); // Send the actual data\n }\n\n // Get the response\n $response = curl_exec( $ch );\n\n // Check if there's an error in the header\n $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\n // If there's any cURL errors\n if( curl_errno( $ch ) || ( $httpcode < 200 || $httpcode >= 300 ) ){\n $data = 'error';\n } else {\n \n // Turn response into stuff we can use\n if( $type == 'JSON' ){\n $data = json_decode( $response, true );\n } elseif( $type == 'csv' ){\n $data = csv_to_array( $response );\n } else {\n $data = $response;\n }\n\n }\n\n // Close curl\n curl_close( $ch );\n \n // Send the data back to the function calling the cURL\n return $data;\n \n } else {\n \n // cURL not installed so leave\n return false;\n \n }\n\n\t\n}", "public function execute(Rest_Request $request)\n\t{\n\t\tif (! $this->_cache instanceof Rest_Cache)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// If this is a destructive request, by-pass cache completely\n\t\tif (in_array($request->request_method,\n\t\t\tarray(\n\t\t\t 'POST',\n\t\t\t 'PUT',\n\t\t\t 'DELETE'\n\t\t\t))\n\t\t)\n\t\t{\n\t\t\t// Kill existing caches for this request\n\t\t\t$this->invalidate_cache($request);\n\n\t\t\t$response = $request->execute();\n\n\t\t\t$cache_control = Rest_HTTP_Header::create_cache_control(\n\t\t\t\tarray(\n\t\t\t\t 'no-cache',\n\t\t\t\t 'must-revalidate'\n\t\t\t\t));\n\n\t\t\t// Ensure client respects destructive action\n\t\t\treturn $response->headers('Cache-Control', $cache_control);\n\t\t}\n\n\t\t// Create the cache key\n\t\t$cache_key = $this->create_cache_key($request, $this->_cache_key_callback);\n\n\t\t// Try and return cached version\n\t\tif (($response = $this->cache_response($cache_key, $request)) instanceof Rest_Response)\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\n\t\t// Start request time\n\t\t$this->_request_time = time();\n\n\t\t// Execute the request with the Request client\n\t\t$response = $request->execute();\n\n\t\t// Stop response time\n\t\t$this->_response_time = (time() - $this->_request_time);\n\n\t\t// Cache the response\n\t\t$this->cache_response($cache_key, $request, $response);\n\n\t\t$response->headers(Rest_HTTP_Cache::CACHE_STATUS_KEY,\n\t\t\tRest_HTTP_Cache::CACHE_STATUS_MISS);\n\n\t\treturn $response;\n\t}", "public function execute() {\n\n $this->parseRequestHeaders();\n\n $uri = $this->loadUrl(); // Loads the called URL\n String::arrayTrimNumericIndexed($uri); // Trim the URL array indexes\n\n /**\n * When server is running as a RESTful server\n */\n if (RESTFUL == '1') {\n RestServer::runRestMethod($uri);\n $this->terminate();\n }\n\n /**\n * When the request is not running over ajax,\n * then call the home for full page rendering\n * before calling the requested method\n */\n if (!$this->isAjax()) {\n\n $this->controller = $this->requireHome();\n $this->controller->itStarts($uri);\n $this->terminate();\n }\n\n /**\n * Normal Ajax Request, call the method only\n */\n $this->runMethod($uri);\n $this->terminate();\n }", "function CallAPI($method, $url, $data = false)\n{\n $curl = curl_init();\n\n switch ($method)\n {\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_PUT, 1);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // Optional Authentication:\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n\n// echo \"<pre>\",print_r($result);\n return $result;\n}", "public function run() {\n if (isset($_GET['category'])) {\n $userCategory = $_GET['category'];\n $url = \"https://pixabay.com/api/?key=5523270-b155c70c398287d555674f79a&q=$userCategory\";\n try {\n $result = @file_get_contents($url, 0);\n if ($result === FALSE)\n die(\"Error\");\n } catch (Exception $ex) {\n echo $e->getMessage();\n }\n $parsed_json = json_decode($result);\n $json = [\n \"images\" => array(),\n ];\n for ($i = 0; $i < 20; $i++) {\n $images = $parsed_json->{'hits'}[$i]->{'webformatURL'};\n $tags = $parsed_json->{'hits'}[$i]->{'tags'};\n $json[\"images\"][$i] = [\n \"image\" => $images,\n \"tag\" => $tags\n ];\n }\n echo json_encode($json);\n }\n }", "function callAPI($method, $url, $data){\n $curl = curl_init();\n switch ($method){\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\t\t\t \t\t\t\t\t\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n // EXECUTE:\n $result = curl_exec($curl);\n curl_close($curl);\n return $result;\n}", "function repetitive_function()\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"httpbin/get?key=value\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n error_log('Received response: ' . var_export($output, 1));\n curl_close($ch);\n}", "private function _getImage($url) {\n //$headers[] = 'Connection: Keep-Alive'; \n //$headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8'; \n $user_agent = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.04 Chromium/16.0.912.77 Chrome/16.0.912.77 Safari/535.7'; \n //$user_agent = 'Mozilla';\n //$process = curl_init($url); \n //curl_setopt($this->_ch, CURLOPT_HTTPHEADER, $headers); \n curl_setopt($this->_ch, CURLOPT_URL, $url);\n curl_setopt($this->_ch, CURLOPT_HEADER, 0);\n curl_setopt($this->_ch, CURLOPT_NOBODY, 0);\n curl_setopt($this->_ch, CURLOPT_USERAGENT, $user_agent); \n curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt($this->_ch, CURLOPT_FOLLOWLOCATION, 1); \n curl_setopt($this->_ch, CURLOPT_TIMEOUT, 30);\n //$return = curl_exec($this->_ch); \n //curl_close($process); \n return curl_exec($this->_ch); \n }", "public static function makeCacheableRequest($method, $url, array $headers = null, $body = null) {\n\t\t$signature = \\sha1(\\json_encode(\\func_get_args()));\n\n\t\tif (!isset(self::$requestCache[$signature])) {\n\t\t\tself::$requestCache[$signature] = self::makeRequest($method, $url, $headers, $body);\n\t\t}\n\n\t\treturn self::$requestCache[$signature];\n\t}", "public function processApi(){\r\n\t\t\t$service = explode(\"/\", $_GET['x']);\r\n\t\t\t$this->entity = ucfirst($service[0]);\r\n\t\t\t$this->methode = $service[1];\r\n\t\t\t$func = $this->methode.$this->entity;\r\n\t\t\t$this->addLog('--'.$this->methode.$this->entity);\r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t\t$this->$func();\r\n\t\t\telse\r\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\r\n\t\t\t\t\r\n\t\t}", "function request($url,$hookdata,$cookie,$method='GET'){\r\n $ch = curl_init();\r\n\r\n curl_setopt($ch, CURLOPT_URL, \"https://i.instagram.com/api\".$url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_HEADER, 1);\r\n if($method == 'POST'){\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $hookdata);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n }else{\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\r\n }\r\n\r\n $headers = array();\r\n $headers[] = \"Accept: */*\";\r\n $headers[] = \"Content-Type: application/x-www-form-urlencoded\";\r\n $headers[] = 'Cookie2: _ENV[\"Version=1\"]';\r\n $headers[] = \"Accept-Language: en-US\";\r\n $headers[] = \"User-Agent: Instagram 24.0.0.12.201 Android (28/9; 320dpi; 720x1280; samsung; SM-J530Y; j5y17ltedx; samsungexynos7870; in_ID;)\";\r\n $headers[] = \"Host: i.instagram.com\";\r\n if($cookie !== \"0\"){\r\n $headers[] = \"Cookie: \".$cookie;\r\n }\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\r\n $result = curl_exec($ch);\r\n $httpcode = curl_getinfo($ch);\r\n $header = substr($result, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));\r\n $body = substr($result, curl_getinfo($ch, CURLINFO_HEADER_SIZE));\r\n\r\n if(curl_errno($ch)){\r\n echo 'Error:' . curl_error($ch);\r\n }\r\n curl_close ($ch);\r\n return array($header, $body, $httpcode,$result,$url,$hookdata); // body itu response body\r\n}", "private function _request($method, $call_params = array(), $request_method = 'GET', $url = self::API_REST_URL, $cache = true, $use_auth_header = true)\n {\n // Prepare oauth arguments\n $oauth_params = array(\n 'oauth_consumer_key' => $this->_consumer_key,\n 'oauth_version' => '1.0',\n 'oauth_signature_method' => 'HMAC-SHA1',\n 'oauth_timestamp' => time(),\n 'oauth_nonce' => $this->_generateNonce()\n );\n\n // If we have a token, include it\n if ($this->_token) {\n $oauth_params['oauth_token'] = $this->_token;\n }\n\n // Regular args\n $api_params = array('format' => 'php');\n if (!empty($method)) {\n $api_params['method'] = $method;\n }\n\n // Merge args\n foreach ($call_params as $k => $v) {\n if (strpos($k, 'oauth_') === 0) {\n $oauth_params[$k] = $v;\n }\n else {\n $api_params[$k] = $v;\n }\n }\n\n // Generate the signature\n $oauth_params['oauth_signature'] = $this->_generateSignature(array_merge($oauth_params, $api_params), $request_method, $url);\n\n // Merge all args\n $all_params = array_merge($oauth_params, $api_params);\n\n // Returned cached value\n if ($this->_cache_enabled && ($cache && $response = $this->_getCached($all_params))) {\n return $response;\n }\n\n // Curl options\n if ($use_auth_header) {\n $params = $api_params;\n }\n else {\n $params = $all_params;\n }\n\n if (strtoupper($request_method) == 'GET') {\n $curl_url = $url.'?'.http_build_query($params, '', '&');\n $curl_opts = array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30\n );\n }\n else if (strtoupper($request_method) == 'POST') {\n $curl_url = $url;\n $curl_opts = array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => http_build_query($params, '', '&')\n );\n }\n\n // Authorization header\n if ($use_auth_header) {\n $curl_opts[CURLOPT_HTTPHEADER] = array($this->_generateAuthHeader($oauth_params));\n }\n\n // Call the API\n $curl = curl_init($curl_url);\n curl_setopt_array($curl, $curl_opts);\n $response = curl_exec($curl);\n $curl_info = curl_getinfo($curl);\n curl_close($curl);\n\n // Cache the response\n if ($this->_cache_enabled && $cache) {\n $this->_cache($all_params, $response);\n }\n\n // Return\n if (!empty($method)) {\n $response = unserialize($response);\n if ($response->stat == 'ok') {\n return $response;\n }\n else if ($response->err) {\n throw new VimeoAPIException($response->err->msg, $response->err->code);\n }\n\n return false;\n }\n\n return $response;\n }", "function access($unsigned_url) {\n$token = new OAuthToken($token, $token_secret);\n// Consumer object built using the OAuth library\n$consumer = new OAuthConsumer($consumer_key, $consumer_secret);\n// Yelp uses HMAC SHA1 encoding\n$signature_method = new OAuthSignatureMethod_HMAC_SHA1();\n// Build OAuth Request using the OAuth PHP library. Uses the consumer and token object created above.\n$oauthrequest = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $unsigned_url);\n// Sign the request\n$oauthrequest->sign_request($signature_method, $consumer, $token);\n// Get the signed URL\n$signed_url = $oauthrequest->to_url();\n// Send Yelp API Call\n$ch = curl_init($signed_url);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\n$data = curl_exec($ch); // Yelp response\ncurl_close($ch);\nreturn($data);\n}", "public static function apiCall($url, $data = '', $params = array())\n {\n // add params to service url such as ?expand=metadata,bitstreams\n if (array_key_exists('options', $params)) {\n $i = 0;\n foreach ($params['options'] as $key => $value) {\n $url .= ($i == 0) ? '?' : '&';\n $url .= $key . '=' . $value;\n $i++;\n }\n }\n // generate a unique cache identifier based on the URL after we added the various options\n $id = md5($url);\n\n $stream = false;\n\n if (\\Config::get('app.apiCache') > 0) { // only try to read from the cache if we have set an apiCache > 0 in app.php\n $stream = \\Cache::get($id);\n }\n\n $method = strtoupper(array_key_exists('method', $params) ? $params['method'] : 'get');\n\n if (!$stream) { // if we have no cached copy then fetch it\n if (isset($params['headers'])) {\n if (self::$httpAccept == 'application/xml') {\n $response = \\Httpful\\Request::$method($url)\n ->addHeaders($params['headers']) // Or use the addHeader method\n ->expectsXml()\n ->parseWith(function ($body) {\n return $body;\n })\n ->send();\n\n } else {\n $response = \\Httpful\\Request::$method($url)\n ->addHeaders($params['headers']) // Or use the addHeader method\n ->expectsJson()\n ->parseWith(function ($body) {\n return $body;\n })\n ->send();\n }\n } else {\n if (self::$httpAccept == 'application/xml') {\n $response = \\Httpful\\Request::$method($url)\n ->expectsXml()\n ->parseWith(function ($body) {\n return $body;\n })\n ->expectsXml()\n ->send();\n } else {\n $response = \\Httpful\\Request::$method($url)\n ->expectsJson()\n ->parseWith(function ($body) {\n return $body;\n })\n ->send();\n }\n }\n\n if (!$response->hasErrors()) {\n $stream = $response->body;\n\n if (\\Config::get('app.apiCache') > 0) {\n $expiresAt = \\Carbon\\Carbon::now()->addSeconds(\\Config::get('app.apiCache'));\n \\Cache::put($id, $stream, $expiresAt);\n }\n } else {\n throw new \\Exception(\"CURL problems $url \");\n }\n return ($response->body);\n } else {\n self::setCached(true);\n }\n return $stream;\n }", "private function _execute($method, $retries)\n\t {\n\t\t$this->_cacheCleanup();\n\t\t$params = $this->prepareParameters();\n\t\t$params = (is_array($params) === false) ? $params : \"\";\n\n\t\t$result = $this->_db->exec(\n\t\t \"SELECT `response`, `headers` FROM `HTTPcache` \" .\n\t\t \"WHERE `method` = \" . $this->_db->sqlText($method) . \" AND `url` = \" . $this->_db->sqlText($this->url) . \" AND `params` = \" . $this->_db->sqlText($params)\n\t\t);\n\t\tif ($result->getNumRows() > 0)\n\t\t {\n\t\t\t$row = $result->getRow();\n\t\t\t$this->lastresult = bzdecompress($row[\"response\"]);\n\t\t\t$this->lastcode = 200;\n\t\t\t$this->lastheaders = unserialize(bzdecompress($row[\"headers\"]));\n\t\t\treturn $this->lastresult;\n\t\t }\n\t\telse\n\t\t {\n\t\t\t$response = (($method === \"GET\") ? parent::get($retries) : parent::post($retries));\n\t\t\tif ($this->lastcode === 200)\n\t\t\t {\n\t\t\t\t$this->_cacheStore($method, $this->url, $params, $response, $this->lastheaders);\n\t\t\t }\n\n\t\t\treturn $response;\n\t\t }\n\t }", "public function run($url = null) {\n if ($url) {\n $this->curl->setUrl($url);\n }\n\n if ($this->curl instanceof MultiCurl) {\n $this->curl->start();\n } else {\n $this->curl->exec();\n }\n\n return $this->fetch();\n }", "public function processApi(){\n\t\t\t$func = explode('/', trim($_SERVER['PATH_INFO'],'/'))[0];\n\n\t\t\t$good = false;\n\t\t\tforeach ($this->AUTHORIZED_FUNCTION as $authorizedFunc){\n\t\t\t\tif($authorizedFunc == $func){\n\t\t\t\t\t$good = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(! $good) $this->response('', 404);\n\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->sendMessage('', 404);\n\t\t}", "function http_method($base_url, $method='GET', $cookie_file='', $postfields=array(), $headers=array()){\n\n $return = array();\n $query = http_build_query($postfields);\n $url = ($method === 'GET')?($base_url.'?'.$query):$base_url;\n\n $ch= curl_init();\n if($method === 'GET') {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n }\n if($method === 'POST') {\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $query);\n }\n if(!empty($cookie_file)) {\n curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); // read from\n curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); // write to\n }\n curl_setopt($ch, CURLOPT_URL, $base_url);\n $user_agents = array(\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.142 Safari/535.19',\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0',\n 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50',\n 'Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.10.229 Version/11.62'\n );\n curl_setopt($ch, CURLOPT_USERAGENT, $user_agents[rand(0, 3)]);\n if(!empty($headers)) {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n $html = curl_exec($ch);\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n $return['http_code'] = $http_code;\n $return['html'] = $html;\n\n return $return;\n}", "protected function hash_call($methodName, $nvpStr) {\n $API_Endpoint = Config::get('paypal.api_endpoint');\n\n //'------------------------------------\n //' PayPal API Credentials\n //' Replace <API_USERNAME> with your API Username\n //' Replace <API_PASSWORD> with your API Password\n //' Replace <API_SIGNATURE> with your Signature\n //'------------------------------------\n $API_UserName = Config::get('paypal.api_username');\n $API_Password = Config::get('paypal.api_password');\n $API_Signature = Config::get('paypal.api_signature');\n\n // BN Code \tis only applicable for partners\n $sBNCode = \"PP-ECWizard\";\n\n $PROXY_HOST = '127.0.0.1';\n $PROXY_PORT = '808';\n\n $USE_PROXY = false;\n $version = \"93\";\n\n //setting the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n //turning off the server and peer verification(TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php\n if ($USE_PROXY)\n curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . \":\" . $PROXY_PORT);\n\n //NVPRequest for submitting to server\n $nvpreq = \"METHOD=\" . urlencode($methodName) . \"&VERSION=\" . urlencode($version) . \"&PWD=\" . urlencode($API_Password) . \"&USER=\" . urlencode($API_UserName) . \"&SIGNATURE=\" . urlencode($API_Signature) . $nvpStr . \"&BUTTONSOURCE=\" . urlencode($sBNCode);\n\n //setting the nvpreq as POST FIELD to curl\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n //getting response from server\n $response = curl_exec($ch);\n\n //convrting NVPResponse to an Associative Array\n $nvpResArray = $this->deformatNVP($response);\n $nvpReqArray = $this->deformatNVP($nvpreq);\n $_SESSION['nvpReqArray'] = $nvpReqArray;\n\n if (curl_errno($ch)) {\n // moving to display page to display curl errors\n $_SESSION['curl_error_no'] = curl_errno($ch);\n $_SESSION['curl_error_msg'] = curl_error($ch);\n\n //Execute the Error handling module to display errors.\n } else {\n //closing the curl\n curl_close($ch);\n }\n\n return $nvpResArray;\n }", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "public function processApi(){\n\t\t\t$piece = explode(\"/\", $_SERVER['REQUEST_URI']); \n\t\t\t$func = end($piece);\n\t\t\tif((int)method_exists($this,$func) > 0){\n\t\t\t\t$con = mysqli_connect(\"localhost\",\"root\",\"\",\"playlist\"); \n\t\t\t\t// Check connection\n\t\t\t\tif (mysqli_connect_errno()){\n\t\t\t\t echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t$this->$func($con); \n\t\t\t}else\n\t\t\t\t$this->response('',404);// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}", "function callApi($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt ($ch, CURLOPT_URL, $url);\n\n // Get the response and close the channel.\n $response = curl_exec ( $ch );\n\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n }\n\n curl_close($ch);\n\n return $response;\n}", "private function getCacheKey($url) {\n\t\treturn 'amo_api_' . md5($url);\n\t}", "public function run() {\n require_once \"function_utilities.php\";\n $response=0;\n\n $file = $this->getCacheLocation();\n\n $concept = $this->getConcepts();\n\n $key = strtolower(key($concept)); $value = strtolower($concept[$key]);\n\n //check before ask to Freebase\n if(!sluToFb($key,$value)){\n usleep(1000000);\n $response = ask_Freebase($this->getClass(), $concept, 20);\n //print_r(\"I asked to Fb\\n\");\n }\n\n\n //print_r($response);\n //print_r(\"\\nKey = \" . $key . \" \" . \" value = \". $value);\n //print_r(\" class = \". $this->getClass());\n $response_ok = $this->checkResponse($response, $value);\n if(is_array($response) && !empty($response) && !sluToFb($key,$value) && $response_ok){\n $row = $key . \"\\t\" . $value . \"\\t\" . implode(\"\\t\",$response) . \"\\n\";\n file_put_contents($file, $row, FILE_APPEND | LOCK_EX);\n }elseif($response==0 || $response==1)\n return;\n\n }", "function get_photos($groupid, $photo_number=1) {\n\n //parameters to use\n $params = array(\n 'api_key' => $this->flickr_api_key,\n 'method' => 'flickr.groups.pools.getPhotos',\n 'group_id' => $groupid,\n 'per_page' => $this->photos_per_page,\n 'page' => (string) $photo_number,\n 'extras' => 'url_m,path_alias,url_t,url_s,url_o',\n 'format' => 'php_serial',\n );\n //make the parameters nice for api call\n $url_params = array();\n foreach ($params as $k => $v) {\n $url_params[] = urlencode($k) . '=' . urlencode($v);\n }\n \n //make the api call\n $url = 'http://api.flickr.com/services/rest/?' . implode('&', $url_params);\n $response = file_get_contents($url);\n \n $resp_array = unserialize($response);\n\n if ($resp_array['stat'] == 'ok') {\n //Everything ok! Return the photo object\n return $resp_array['photos']['photo'];\n } else {\n //Something went wrong with the flickr call\n //We say this by returning NULL\n \n //Temporary error message\n echo \"Nu blev det nåt fel med flickr! Ojojoj!\";\n \n return NULL;\n \n }\n}", "public static function callAPI($method, $url, $data){\n\t \t$curl = curl_init();\n\t \tswitch ($method){\n\t \tcase \"POST\":\n\t \tcurl_setopt($curl, CURLOPT_POST, 1);\n\t \tif ($data)\n\t \tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\t \tbreak;\n\t \tcase \"PUT\":\n\t \tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t \tif ($data)\n\t \tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data); \n\t \tbreak;\n\t \tdefault:\n\t \tif ($data)\n\t \t$url = sprintf(\"%s?%s\", $url, http_build_query($data));\n\t \t}\n\t \n\t \t// OPTIONS:\n\t \tcurl_setopt($curl, CURLOPT_URL, $url);\n\t \tcurl_setopt($curl, CURLOPT_HTTPHEADER, array(\n\t 'Content-Type: application/json',\n\t \t));\n\t \tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n\t \t// EXECUTE:\n\t \t$result = curl_exec($curl);\t \n\t \tif (!$result || curl_errno($curl) !== CURLE_OK){\n\t\t echo 'cURL error (' . curl_errno($curl) . '): ' . curl_error($curl);\n\t\t}\n\t \tif(!$result){die(\"Connection Failure\");}\n\t \tcurl_close($curl);\n\t \treturn $result;\n\t}", "public function request($method, $url, array $body = [], array $headers = [], $version = '1.1');", "function httpRequest($url, $post=null, $headers=null, $method='GET', $timeout=1800)\n{\n Log::debug(\"$url \".anyToString($post).\" $method\",'exthttp');\n $httpMethod = 'GET';\n //$cookie_jar = tempnam('/tmp','cookie');\n $url = (string) $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, 1); // To get only the headers use CURLOPT_NOBODY\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); //TODO get seconds from ini files\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); //TODO get seconds from ini files\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible;)\");\n curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookie.php.dat'); // TODO add hostname to filename\n curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookie.php.dat');\n\n if ($headers)\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // !array\n }\n\n // TODO clear cookie curl_setopt($ch, CURLOPT_COOKIELIST, \"ALL\");\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n if (count($post) && $method != 'PUT')\n {\n $method = 'POST';\n $httpMethod = 'POST';\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n }\n elseif ($post && $method == 'PUT')\n {\n $httpMethod = 'PUT';\n $fp = fopen('php://temp/maxmemory:256000', 'w');\n if (!$fp)\n die('could not open temp memory data');\n fwrite($fp, $post);\n fseek($fp, 0);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($ch, CURLOPT_INFILE, $fp);\n curl_setopt($ch, CURLOPT_INFILESIZE, strlen($post));\n }\n $output = curl_exec($ch);\n if (curl_errno($ch))\n {\n $errno = curl_errno($ch);\n $error = curl_error($ch).' ('.$errno.')';\n curl_close($ch);\n throw new Exception($error, (int)$errno);\n }\n // {httpcode: 200, url: '/login', effectiveurl: '/account', 'totaltime': 2, data: '<html>', 'headers': [k:v,..], redirectcount: 1, receivedbytes: 1000, 'method': post, 'contenttype': 'html'}\n $meta = array();\n $meta['effectiveurl'] = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n $meta['httpcode'] = (integer) curl_getinfo($ch, CURLINFO_HTTP_CODE); // last\n $meta['totaltime'] = (float) curl_getinfo($ch, CURLINFO_TOTAL_TIME);\n $meta['dnstime'] = (float) curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME);\n $meta['connecttime'] = (float) curl_getinfo($ch, CURLINFO_CONNECT_TIME);\n $meta['starttransfertime'] = (float) curl_getinfo($ch, CURLINFO_STARTTRANSFER_TIME);\n $meta['redirectcount'] = (integer) curl_getinfo($ch, CURLINFO_REDIRECT_COUNT);\n $meta['receivedbytes'] = (integer) curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD);\n $meta['contenttype'] = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n $headersBytes = (integer) curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n $meta['url'] = $url;\n $meta['method'] = $httpMethod;\n $header = substr($output, 0, $headersBytes);\n $body = substr($output, $headersBytes);\n $headersarray = explode(\"\\r\\n\", $header);\n $headersclean = array();\n foreach ($headersarray as $headervalue)\n {\n $hstruct = explode(':', $headervalue); //$headerkey\n if ($hstruct[0] && $hstruct[1])\n $headersclean[$hstruct[0]] = $hstruct[1];\n }\n $meta['headers'] = $headersclean;\n // cookies\n $pattern = \"#Set-Cookie:\\\\s+(?<cookie>[^=]+=[^;]+)#m\";\n preg_match_all($pattern, $header, $matches);\n $cookiesOut = implode(\"; \", $matches['cookie']);\n foreach (explode(';',$cookiesOut) as $kv)\n {\n list($k,$v) = explode('=',$kv);\n $k = trim($k);\n $v = trim($v);\n $meta['newcookies'][$k] = urldecode($v);\n }\n unset($meta['headers']['Set-Cookie']);\n\n $meta['data'] = $body;\n //unset($body);\n curl_close($ch);\n if ($meta['httpcode'] == 200)\n {\n // $meta['contenttype'] == 'text/html'\n $aa = explode(';', $meta['contenttype']);\n if (count($aa) == 1)\n {\n if ($meta['contenttype'] == 'text/html') $ishtml = true;\n }\n else { // 2 or more\n if ($aa[0] == 'text/html') $ishtml = true;\n $aa[1] = trim($aa[1]);\n //println($aa[1],1,TERM_RED);\n $enc = explode('=', $aa[1]);\n //println($enc);\n if ($enc[0] == 'charset')\n {\n //println($enc[1],1,TERM_YELLOW);\n if ($enc[1] == 'windows-1251')\n {\n $meta['data'] = mb_convert_encoding($meta['data'], \"utf-8\", \"windows-1251\");\n }\n }\n }\n// printlnd($meta['contenttype']);\n if (explode(';', $meta['contenttype'])[0] == 'application/json') $isjson = true;\n\n if ($ishtml) {\n $d = new DOMDocument;\n $d->loadHTML($body);\n $meta['html'] = $d;\n }\n elseif ($isjson)\n {\n\n $meta['json'] = json_decode($body, true);\n }\n }\n return $meta;\n}", "public static function invoke() {\n\t\tswitch ($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'POST': \n\t\t\t\tstatic::post();\n\t\t\t\tbreak;\n\t\t\tcase 'PUT':\n\t\t\t\tstatic::put();\n\t\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\tstatic::delete();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstatic::get();\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function execute()\n {\n $authMethod = '?access_token=' . $this->params['access_token'];\n $endpoint = Constants::API_VERSION . $this->path . (('GET' === $this->method) ? '?' . http_build_query($this->params) : $authMethod);\n $endpoint .= (strstr($endpoint, '?') ? '&' : '?') . 'sig=' . static::generateSignature($this->instagram->getApp(), $this->path, $this->params);\n\n $request = HelperFactory::getInstance()->request($this->instagram->getHttpClient(), $endpoint, $this->params, $this->method);\n\n if ($request === null) {\n throw new InstagramResponseException('400 Bad Request: instanceof InstagramResponse cannot be null', 400);\n }\n $this->response = new InstagramResponse($request);\n $this->xRateLimitRemaining = $this->response->getHeader('X-Ratelimit-Remaining');\n }", "public function processApi()\n {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n } \n else\n {\n $data = array('code' => \"404\", 'status' => \"failure\", \"msg\" => \"requested method not available\", \"data\" => array());\n $this->response($this->json($data)); \n }\n \n // If the method not exist with in this class, response would be \"Page not found\".\n }", "function http($url, $method = 'GET', $postfields = NULL, $headers = array()) {\n\t\t$ci = curl_init();\n\t\t/* Curl settings */\n\t\tcurl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n\t\tcurl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, array_merge(array('Expect:'),$headers));\n\t\tcurl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n\n\t\tswitch ($method) {\n\t\tcase 'POST':\n\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\t\tif (!empty($postfields)) {\n\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tif (!empty($postfields)) {\n\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t}\n\t\t}\n\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ($ci);\n\t\treturn $response;\n\t}", "public function serve() {\n\n\t\tif (headers_sent()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$this->url || !$this->handle || !$this->dir_guid || !$this->hmac) {\n\t\t\theader(\"HTTP/1.1 400 Bad request\");\n\t\t\texit;\n\t\t}\n\n\t\t$etag = md5($this->url . $this->handle . $this->ts);\n\t\tif (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == \"\\\"$etag\\\"\") {\n\t\t\theader(\"HTTP/1.1 304 Not Modified\");\n\t\t\texit;\n\t\t}\n\n\t\t$this->openDbLink();\n\t\t$values = $this->getDatalistValue(array('dataroot', '__site_secret__'));\n\t\t$this->closeDbLink();\n\n\t\tif (empty($values)) {\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\texit;\n\t\t}\n\n\t\t$data_root = $values['dataroot'];\n\t\t$key = $values['__site_secret__'];\n\n\t\t$hmac = hash_hmac('sha256', $this->url . $this->handle, $key);\n\n\t\tif ($this->hmac != $hmac) {\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t\texit;\n\t\t}\n\n\t\t$locator = new EntityDirLocator($this->dir_guid);\n\t\t$filename = $data_root . $locator->getPath() . 'scraper_cache/thumbs/' . md5($this->url) . '.' . $this->handle . '.jpg';\n\n\t\terror_log($this->url);\n\t\terror_log($filename);\n\n\t\tif (!file_exists($filename)) {\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\texit;\n\t\t}\n\n\t\t$filesize = filesize($filename);\n\n\t\theader(\"Content-type: image/jpeg\");\n\t\theader('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime(\"+6 months\")), true);\n\t\theader(\"Pragma: public\");\n\t\theader(\"Cache-Control: public\");\n\t\theader(\"Content-Length: $filesize\");\n\t\theader(\"ETag: \\\"$etag\\\"\");\n\t\treadfile($filename);\n\t\texit;\n\t}", "public function execute($url)\n { if (!function_exists('curl_init')) {\n die('Sorry cURL is not installed!');\n }\n\n // OK cool - then let's create a new cURL resource handle\n $this->ch = curl_init();\n\n // Now set some options (most are optional)\n\n // Set URL to download\n curl_setopt($this->ch, CURLOPT_URL, $url);\n\n foreach ($this->curlOptions as $key=>$value) {\n curl_setopt($this->ch, $key, $value);\n }\n\n // Download the given URL, and return output\n $output = curl_exec($this->ch);\n\n // Close the cURL resource, and free system resources\n curl_close($this->ch);\n\n return $output;\n }", "function executeRequest() {\n\n\t\t// curl general\n\t\t$curl_options = [\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => true,\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->_requestType\n\t\t];\n\n\t\t// set to post\n\t\tif($this->_requestType == 'POST') {\n\t\t\t$curl_options[CURLOPT_POST] = true;\n\t\t}\n\n\t\t// build url and append query params\n\t\t$url = $this->url($this->_url);\n\t\t$this->_params[$this->_oauth2->getAccessTokenName()] = $this->_oauth2->getAccessToken();\n\t\tif(count($this->_params) > 0) {\n\t\t\t$url->setQuery($this->_params);\n\t\t}\n\t\t$curl_options[CURLOPT_URL] = $url->val();\n\n\t\t// check request headers\n\t\tif(count($this->_headers) > 0) {\n\t\t\t$header = [];\n\t\t\tforeach ($this->_headers as $key => $parsed_urlvalue) {\n\t\t\t\t$header[] = \"$key: $parsed_urlvalue\";\n\t\t\t}\n\t\t\t$curl_options[CURLOPT_HTTPHEADER] = $header;\n\t\t}\n\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $curl_options);\n\n\t\t// https handling\n\t\tif($this->_certificateFile != '') {\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, $this->_certificateFile);\n\t\t} else {\n\t\t\t// bypass ssl verification\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t}\n\n\t\t// execute the curl request\n\t\t$result = curl_exec($ch);\n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n\t\tif($curl_error = curl_error($ch)) {\n\t\t\tthrow new OAuth2Exception($curl_error);\n\t\t} else {\n\t\t\t$json_decode = $this->jsonDecode($result, true);\n\t\t}\n\t\tcurl_close($ch);\n\n\t\treturn [\n\t\t\t'result' => (null === $json_decode) ? $result : $json_decode,\n\t\t\t'code' => $http_code,\n\t\t\t'content_type' => $content_type\n\t\t];\n\t}", "function get_image_info($db,$id,$mode='url') {\n\n\t$card_deck = CARD_DECK; // database table for photos\n\t\n\t// get the url for a flickr image of a given id\t\n\t$query = \"SELECT * FROM $card_deck WHERE id=$id\";\n\n\t\n\t$result = mysqli_query($db, $query);\t\n\tif (mysqli_error($db) ) echo 'Ouch! Database problem:' . mysqli_error($db);\n\t\n\t$row = mysqli_fetch_array($result);\n\t\n\tif ($mode=='url') {\n\t\t// return just url for medium\n\t\treturn \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_m.jpg\";\n\t\t\n\t} elseif ($mode=='sq') {\n\t// return just url for thumbnail\n\t\treturn \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_s.jpg\";\n\t\t\n\t\t\n\t\t\n\t} elseif ($mode=='p') {\n\t// pecha moder return just url for medium 640 size\n\t\treturn \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_d.jpg\";\t\n\t\n\t} else {\n\t\t// return all photo info\n\t\t$pic= array();\n\n \t$pic['url']= \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_m.jpg\";\n \t\n \t$pic['med'] = \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_d.jpg\";\n \t\n \t// build link to flickr page for this photo\n\t\t$pic['link']=\"https://www.flickr.com/photos/\" . $row['nsid'] . \"/\" . $row['fid'] . \"/\";\n\t\t\n\t\t$pic['credit']=stripslashes($row['username']);\n\t\t\n\t\t// url for square icon\n\t\t$pic['sq'] = \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_s_d.jpg\";\n\n\t\treturn $pic;\n\t}\n\n}", "function doRequest($opContext,$method,$request,$data = null){\n\tglobal $errorArray;\n\t$ch = curl_init();\n\t$options = array(\n\t CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false\n\t );\n\n\tcurl_setopt_array($ch, $options);\n\n\t$tryAgain = true;\n\t$numAttempts = 1;\n\twhile ($tryAgain && $numAttempts < 5) {\n\t $uri = $opContext->createAuthenticatedUri($request, $method);\n\t curl_setopt($ch, CURLOPT_URL, $uri);\n\t switch($method) {\n\t case 'POST':\n\t curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t 'Content-Type: application/json',\n\t 'Content-Length: ' . strlen($data))\n\t );\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t break;\n\t case 'PUT':\n\t curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t 'Content-Type: application/json',\n\t 'Content-Length: ' . strlen($data))\n\t );\n\t curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t break;\n\t case 'DELETE':\n\t curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t break;\n\t case 'GET':\n\t break;\n\t }\n\t $response = curl_exec($ch);\n\n\t $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n\t $responseCode = $opContext->handleResult($response, $httpCode, $contentType);\n\n\t if ($responseCode == D2LUserContext::RESULT_OKAY) {\n\t $ret = \"$response\";\n\t $tryAgain = false;\n\t } elseif ($responseCode == D2LUserContext::RESULT_INVALID_TIMESTAMP) {\n\t // Try again since time skew should now be fixed.\n\t $tryAgain = true;\n\t } else {\n\t if($httpCode == 302) {\n\t // This usually happens when a call is made non-anonymously prior to logging in.\n\t // The D2L server will send a redirect to the log in page.\n\t throw new d2lException('Redirect encountered (need to log in for this API call?) (HTTP status 302)',$httpCode,$method . ': ' . $request,$response);\n\t } else {\n\t throw new d2lException($errorArray[$responseCode],$httpCode,$method . ': ' . $request,$response);\n\t }\n\t $tryAgain = false;\n\t $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n\t throw new d2lException($protocol . ' ' . '400 Bad Request',$httpCode,$method . ': ' . $request,$response);\n\t //$GLOBALS['http_response_code'] = $httpCode;\n\t }\n\t $numAttempts++;\n\t}\n\tcurl_close($ch);\n\t//Parse result into object from JSON data\n\t$json_result = json_decode($ret,true);\n\tif($json_result == null){\n\t\tthrow new d2lException('Error decoding JSON results: ' . json_last_error(),$httpCode,$method . ': ' . $request,$response);\n\t}\n\treturn $json_result;\n}", "function execute_request($http_request_method, $url, $data = null, $number_redirects = 0)\n\t{\n\t\t$this->oauth_nonce = md5(str_shuffle($this->auth_secret) . time() . rand());\n\t\t$this->oauth_timestamp = time();\n\t\t$this->oauth_signature = null;\n\n\t\t$this->__url_encoded_data = null;\n\t\t$this->__request_http_method = strtoupper($http_request_method);\n\n\t\tif ($this->auth_http_method == SPOAuthClient::HTTP_AUTH_POST)\n\t\t{\n\t\t\t//! if the auth http method has been set to POST convert a GET request to a POST request\n\t\t\tif ($http_request_method == SPConstants::HTTP_METHOD_GET)\n\t\t\t{\n\t\t\t\t$http_request_method = SPConstants::HTTP_METHOD_POST;\n\t\t\t}\n\t\t\telse if ($http_request_method == SPConstants::HTTP_METHOD_POST && $data)\n\t\t\t{\n\t\t\t\t//! if request is post and auth method is post assume data is provided for url encoded form content type\n\t\t\t\t$this->__url_encoded_data = is_string($data) ? SPUtils::parse_query($data) : $data;\n\t\t\t\t//! convert data to url encoded string before passing it to the base execute_request\n\t\t\t\t$data = SPUtils::join_key_values_assoc(\"=\", \"&\", SPUtils::array_map_assoc($this->__encoding_callback, $data));\n\t\t\t}\n\t\t}\n\n\t\treturn parent::execute_request($http_request_method, $url, $data, $number_redirects);\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}", "function ciniki_web_getScaledImageURL($ciniki, $image_id, $version, $maxwidth, $maxheight, $quality='60') {\n\n if( $maxwidth == 0 && $maxheight == 0 ) {\n $size = 'o';\n } elseif( $maxwidth == 0 ) {\n $size = 'h' . $maxheight;\n } else {\n $size = 'w' . $maxwidth;\n }\n\n //\n // NOTE: The cache.db was an attempt to speed up EFS(nfs) on Amazon AWS. It did not appear\n // help performance at all and should not be enabled. The code remains in here incase\n // it can be useful in the future.\n //\n\n //\n // Load last_updated date to check against the cache\n //\n $reload_image = 'no';\n/* if( isset($ciniki['config']['ciniki.web']['cache.db']) && $ciniki['config']['ciniki.web']['cache.db'] == 'on' ) {\n $strsql = \"SELECT ciniki_images.id, \"\n . \"ciniki_images.type, \"\n . \"UNIX_TIMESTAMP(ciniki_images.last_updated) AS last_updated, \"\n . \"UNIX_TIMESTAMP(ciniki_web_image_cache.last_updated) AS cache_last_updated \"\n . \"FROM ciniki_images \"\n . \"LEFT JOIN ciniki_web_image_cache ON (\"\n . \"ciniki_images.id = ciniki_web_image_cache.image_id \"\n . \"AND ciniki_web_image_cache.tnid = '\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"' \"\n . \"AND ciniki_web_image_cache.size = '\" . ciniki_core_dbQuote($ciniki, $size) . \"' \"\n . \") \"\n . \"WHERE ciniki_images.id = '\" . ciniki_core_dbQuote($ciniki, $image_id) . \"' \"\n . \"AND ciniki_images.tnid = '\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"' \"\n . \"\";\n $reload_image = 'yes';\n } else { */\n $strsql = \"SELECT id, type, UNIX_TIMESTAMP(ciniki_images.last_updated) AS last_updated \"\n . \"FROM ciniki_images \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $image_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"' \"\n . \"\";\n/* } */\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.images', 'image');\n if( $rc['stat'] != 'ok' ) { \n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.web.103', 'msg'=>'Unable to load image', 'err'=>$rc['err']));\n }\n if( !isset($rc['image']) ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.web.104', 'msg'=>'The image you requested does not exist.'));\n }\n $img = $rc['image'];\n\n //\n // Build working path, and final url\n //\n if( $img['type'] == 2 ) {\n $extension = 'png';\n } else {\n $extension = 'jpg';\n }\n if( $maxwidth == 0 && $maxheight == 0 ) {\n// $filename = '/' . sprintf('%02d', ($ciniki['request']['tnid']%100)) . '/'\n// . sprintf('%07d', $ciniki['request']['tnid'])\n// . '/o/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $filename = '/o/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $size = 'o';\n } elseif( $maxwidth == 0 ) {\n// $filename = '/' . sprintf('%02d', ($ciniki['request']['tnid']%100)) . '/'\n// . sprintf('%07d', $ciniki['request']['tnid'])\n// . '/h' . $maxheight . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $filename = '/h' . $maxheight . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $size = 'h' . $maxheight;\n } else {\n// $filename = '/' . sprintf('%02d', ($ciniki['request']['tnid']%100)) . '/'\n// . sprintf('%07d', $ciniki['request']['tnid'])\n// . '/w' . $maxwidth . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $filename = '/w' . $maxwidth . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $size = 'w' . $maxwidth;\n }\n $img_filename = $ciniki['tenant']['web_cache_dir'] . $filename;\n $img_url = $ciniki['tenant']['web_cache_url'] . $filename;\n $img_domain_url = 'http://' . $ciniki['request']['domain'] . $ciniki['tenant']['web_cache_url'] . $filename;\n\n //\n // Check db for cache details\n //\n if( isset($ciniki['config']['ciniki.web']['cache.db']) && $ciniki['config']['ciniki.web']['cache.db'] == 'on'\n && isset($img['cache_last_updated']) && $img['cache_last_updated'] >= $img['last_updated']\n ) {\n return array('stat'=>'ok', 'url'=>$img_url, 'domain_url'=>$img_domain_url);\n }\n\n //\n // Check last_updated against the file timestamp, if the file exists\n //\n if( $reload_image == 'yes' || !file_exists($img_filename) || filemtime($img_filename) < $img['last_updated'] ) {\n\n //\n // Load the image from the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'private', 'loadImage');\n $rc = ciniki_images_loadImage($ciniki, $ciniki['request']['tnid'], $img['id'], $version);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $image = $rc['image'];\n\n //\n // Scale image\n //\n if( $maxwidth > 0 || $maxheight > 0 ) {\n $image->scaleImage($maxwidth, $maxheight);\n }\n\n //\n // Apply a border\n //\n // $image->borderImage(\"rgb(255,255,255)\", 10, 10);\n\n //\n // Check if directory exists\n //\n if( !file_exists(dirname($img_filename)) ) {\n mkdir(dirname($img_filename), 0755, true);\n }\n\n //\n // Write the file\n //\n $h = fopen($img_filename, 'w');\n if( $h ) {\n if( $img['type'] == 2 ) {\n $image->setImageFormat('png');\n } else {\n $image->setImageCompressionQuality($quality);\n }\n fwrite($h, $image->getImageBlob());\n fclose($h);\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.web.105', 'msg'=>'Unable to load image'));\n }\n\n //\n // Update database\n //\n/* if( isset($ciniki['config']['ciniki.web']['cache.db']) && $ciniki['config']['ciniki.web']['cache.db'] == 'on' ) {\n $strsql = \"INSERT INTO ciniki_web_image_cache (tnid, image_id, size, last_updated) \" \n . \"VALUES('\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"'\"\n . \", '\" . ciniki_core_dbQuote($ciniki, $img['id']) . \"'\"\n . \", '\" . ciniki_core_dbQuote($ciniki, $size) . \"'\"\n . \", UTC_TIMESTAMP()) \"\n . \"ON DUPLICATE KEY UPDATE last_updated = UTC_TIMESTAMP() \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n $rc = ciniki_core_dbInsert($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log('CACHE: Unable to save ' . $img_filename . ' to ciniki_web_cache');\n return $rc;\n }\n } */\n }\n\n return array('stat'=>'ok', 'url'=>$img_url, 'domain_url'=>$img_domain_url, 'filename'=>$img_filename);\n}", "public function run()\n {\n $requested_url = explode('/', $this->requestUrl);\n\n if (!empty($this->definedRoutes[$this->requestMethod])) {\n foreach ($this->definedRoutes[$this->requestMethod] as $route => $action) {\n $route = explode('/', $route);\n $route_depth = count($route);\n\n // Check for defined route parameters\n for( $i = 0; $i < $route_depth; $i++) {\n if (preg_match('/\\{([\\w?]+?)\\}/',$route[$i])) {\n if (isset($requested_url[$i])) {\n array_push($this->requestParameters, $requested_url[$i]);\n // replace defined route parameters with peer request url parameter for final comparison\n $route[$i] = $requested_url[$i];\n }\n }\n }\n\n // Check for unreplaced route parameters and delete them if are optional parameters (for final comparison)\n for ($j = 0; $j < $route_depth; $j++) {\n if (preg_match('/\\{([\\w]+?)\\?}/', $route[$j])) {\n unset($route[$j]);\n }\n }\n\n $route = implode('/', $route);\n\n // Final comparision. Check requested url is equal to current checking route\n if ($route == $this->requestUrl) {\n $this->matched = true;\n\n if ($action instanceof Closure) {\n return call_user_func_array($action, $this->requestParameters);\n } else if($this->isController($action)) {\n return $this->loadController($action);\n } else {\n throw new Exception('Invalid action for route');\n }\n break; // Route found, stop the operations\n } else {\n $this->reset();\n }\n }\n }\n\n if ($this->matched === false) {\n return $this->exception->notFound();\n }\n }", "public function perform()\n\t{\n\t\t$uri = isset($_REQUEST['uri']) ? $_REQUEST['uri'] : '/';\n\t\t$uri = trim($uri, $this->_trim);\n\n\t\t$replacementValues = array();\n\n\t\t/**\n\t\t* List through the stored URI's\n\t\t*/\n\t\tforeach ($this->uriPatterns as $listKey => $listUri)\n\t\t{\n\t\t\t/**\n\t\t\t* See if there is a match\n\t\t\t*/\n // var_dump($listKey);\n // var_dump($listUri);\n\t\t\tif (preg_match(\"#^$listUri$#\", $uri))\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t* Replace the values\n\t\t\t\t*/\n\t\t\t\t$realUri = explode('/', $uri);\n\t\t\t\t$fakeUri = explode('/', $listUri);\n // var_dump($realUri);\n // var_dump($fakeUri);\n\t\t\t\t/**\n\t\t\t\t* Gather the .+ values with the real values in the URI\n\t\t\t\t*/\n\t\t\t\tforeach ($fakeUri as $key => $value)\n\t\t\t\t{\n\t\t\t\t\tif ($value == '.+') {\n\t\t\t\t\t\t$replacementValues[] = $realUri[$key];\n\t\t\t\t\t}\n\t\t\t\t}\n\n // print_r($replacementValues);\n\t\t\t\t/**\n\t\t\t\t* Pass an array for arguments\n\t\t\t\t*/\n $className = $this->uriCallbacks[$listKey][0];\n $instance = new $className;\n print_r($instance);\n $method = $this->uriCallbacks[$listKey][1];\n\t\t\t\tcall_user_func_array(array($instance, $method), $replacementValues );\n\t\t\t}\n\t\t}\n\n\t}", "public function call($url, $params) {\n $req = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, \"GET\", $url, $params);\n $req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $this->consumer, $this->access_token);\n error_log(\"executing OAuth call: \".$req->to_url());\n $result = @file_get_contents($req->to_url());\n\n list($version,$status_code,$msg) = explode(' ',$http_response_header[0], 3);\n if($status_code >= 400)\n throw new Exception(\"Error \".$status_code.\" returned when attempting call $url\");\n return $result;\n }", "function execute($url, $options)\n\t{\n\t\t$curl = curl_init($url);\n\t\tcurl_setopt_array($curl, $options);\n\t\treturn curl_exec($curl);\n\t}", "private function veriFyMethodOnUrl()\n {\n if ($this->urlParameters && array_key_exists(1, $this->urlParameters)) {\n $this->method = $this->urlParameters[1];\n $nameAndAliases = $this->urlParameters;\n array_shift($nameAndAliases);\n $nameAndAliases = implode('/', $nameAndAliases);\n $this->methodNameAliases = $nameAndAliases;\n }\n }", "public function api_connect($url);", "function callAPI($method, $url, $data){\n $curl = curl_init();\n\n switch ($method){\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n ));\n\n // EXECUTE:\n $result = curl_exec($curl);\n if(!$result){die(\"Connection Failure\");}\n curl_close($curl);\n return $result;\n}", "private function _run($method,$params = null) {\n $result = $this->client->_run($method, $params);\n return $result;\n }", "public function doRequests();" ]
[ "0.62752736", "0.6166769", "0.6058745", "0.59150404", "0.57925904", "0.5527909", "0.5473728", "0.5361868", "0.5319926", "0.53050023", "0.5284823", "0.52828175", "0.5280759", "0.5261799", "0.52494353", "0.5244645", "0.52324027", "0.5227923", "0.52237046", "0.5158485", "0.51571286", "0.5143162", "0.51246184", "0.5118836", "0.5117803", "0.5114412", "0.5111397", "0.51055205", "0.5100837", "0.5074671", "0.5059472", "0.50425255", "0.5031912", "0.5029215", "0.50243914", "0.50103104", "0.49951303", "0.49884108", "0.498637", "0.4984128", "0.49753657", "0.49721667", "0.497043", "0.49672136", "0.49645534", "0.49597588", "0.49554422", "0.4952038", "0.49396452", "0.49386138", "0.4937", "0.49357927", "0.4935719", "0.49357095", "0.49339756", "0.49326074", "0.49325085", "0.49304092", "0.4925952", "0.49175888", "0.49153423", "0.4911213", "0.49102652", "0.4908039", "0.48774323", "0.4864115", "0.48560345", "0.48534545", "0.48533785", "0.48407578", "0.48388523", "0.48372415", "0.48372287", "0.4836455", "0.48345143", "0.48326477", "0.48323604", "0.4831322", "0.48250633", "0.48206782", "0.4818587", "0.48137102", "0.48112562", "0.48003286", "0.4799993", "0.4797818", "0.4796516", "0.4793237", "0.47930145", "0.47930145", "0.47920656", "0.47864428", "0.4783827", "0.4772782", "0.4768874", "0.47599146", "0.47402453", "0.47367457", "0.47348446", "0.47348183" ]
0.5806074
4
Clear the cache for xflickr
public function clear_cache() { $cache = $this->modx->getCacheManager(); if ($cache->clearCache(array('xflickr/'))) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearCache () {\n $this->clearThumbCache ();\n $this->clearPreviewCache ();\n }", "public function clear_cache(): void;", "private function clearCache() {\n\t\t\n\t\tCore\\Cache::clear();\n\t\t\n\t}", "public function clearCache() {}", "public function clearCache() {}", "public function clearCache(): void;", "protected function _clear_cache() {\n\t\t$this->_attrs = array();\n\t\t$this->_options = array();\n\t}", "public static function resetCache();", "abstract protected function clearCache();", "public function clearCache()\n {\n }", "public static function clearCache()\n {\n self::$cache = array();\n }", "public static function clearCache() {\n $cached=sugar_cached('include/externalAPI.cache.php');\n if ( file_exists($cached) ) {\n unlink($cached);\n }\n $cached=sugar_cached('include/externalAPI.cache.js');\n if ( file_exists($cached) ) {\n unlink($cached);\n }\n }", "public static function clearCache()\n\t{\n\t\tself::$definitions = null;\n\t}", "function tilemmetry_clear_cache()\n{\n theme_reset_all_caches();\n}", "protected function clearProxyCache()\n {\n $configuration = Shopware()->Models()->getConfiguration();\n $metaDataCache = $configuration->getMetadataCacheImpl();\n if (method_exists($metaDataCache, 'deleteAll')) {\n $metaDataCache->deleteAll();\n }\n\n // Clear Shopware Proxies\n Shopware()->Hooks()->getProxyFactory()->clearCache();\n\n // Clear classmap\n $classMap = Shopware()->Hooks()->getProxyFactory()->getProxyDir() . 'ClassMap_' . \\Shopware::REVISION . '.php';\n @unlink($classMap);\n\n // Clear Doctrine Proxies\n $files = new GlobIterator(\n $configuration->getProxyDir() . '*.php',\n FilesystemIterator::CURRENT_AS_PATHNAME\n );\n\n foreach ($files as $filePath) {\n @unlink($filePath);\n }\n\n // Clear Anotation file cache\n $files = new GlobIterator(\n $configuration->getFileCacheDir() . '*.php',\n FilesystemIterator::CURRENT_AS_PATHNAME\n );\n\n foreach ($files as $filePath) {\n @unlink($filePath);\n }\n }", "private function flushImageCache()\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "public function clearCached()\n {\n $this->cached = null;\n }", "public function clear_cache() {\n\t\tif (file_exists($this->cache_path)) {\n\t\t\tunlink($this->cache_path);\n\t\t}\n\t}", "public function clearCachefiles () {\r\n\t\r\n\t}", "function clearPreviewCache () {\n files::deleteFile($this->previewDir . $this->file);\n }", "protected function _clearDataCache() {}", "function reset_caches() {\n \n $this->ext->reset_caches();\n \n }", "public function clear () {\n array_map('unlink', glob(CACHE.\"*.cache\"));\n /*\n $files = scandir(CACHE);\n foreach ($files as $file){\n if (pathinfo($file, PATHINFO_EXTENSION) == 'cache') @unlink(CACHE.$file);\n }\n */\n }", "private function flushImageCache(): void\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "public function delete_cache()\r\n {\r\n $this->clear_file_cache();\r\n }", "private static function CLEAR_CACHE() {\n\t\tclearstatcache();\n\t}", "protected function _clearCache() {\n\t\t\tCache::clear(false, '_cake_model_');\n\t\t\tClassRegistry::flush();\n\t\t}", "public function clearCache(){\n if(file_exists($this->file)){\n @unlink($this->file);\n }\n }", "public static function reset_caches() {\n self::$instance = null;\n }", "public static function clean_cached_data()\n {\n }", "function clear_cache()\n\t{\n\t\treturn true;\n\t}", "public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }", "public function clear()\n {\n $this->_cache->clearByNamespace('/');\n }", "public static function clearCache()\n\t{\n\t\tparent::clearCache(__CLASS__);\n\t}", "private function cleanCache()\n {\n // clean config cache\n $this->typeList->cleanType('config');\n\n // remove bookmarks\n $this->searchCriteriaBuilder->addFilter(BookmarkInterface::BOOKMARKSPACE, self::REPORT_BOOKMARK. '%', 'like');\n $bookmarks = $this->bookmarkRepository->getList($this->searchCriteriaBuilder->create());\n foreach ($bookmarks->getItems() as $bookmark) {\n $this->bookmarkRepository->deleteById($bookmark->getId());\n }\n }", "public function clearCachedDefinitions();", "private function clearCache()\n {\n $this->cache->tags('item')->flush();\n }", "public function dettachCache()\n {\n if (!is_null($this->_cache)) {\n unset($this->_cache);\n }\n }", "private function _clearCache()\n {\n Cache::forget(\"roaddamage-resource:{$this->id}\");\n foreach ($this->getReports() as $report) {\n Cache::forget(\"report-resource:{$report->id}\");\n }\n }", "function wp_cache_reset()\n {\n }", "public static function clear(): void\n {\n static::getCache()->clear();\n }", "public static function removeCache() {\n\t}", "public function clearCacheData(){\n $cacheKey = $this->getCacheKey();\n $this->clearCache($cacheKey);\n }", "protected function cleanCache()\n\t{\n\t\tparent::cleanCache('com_projectfork');\n\t}", "public static function purgeCaches() {}", "protected function purgeCache() {\n\t\tConfigboxCacheHelper::purgeCache();\n\t}", "public function clearCache()\n {\n flush_model_cache($this);\n }", "public static function clearCache() {\n self::$steamIds = array();\n }", "function _deleteCache() {\n require_once(\"Cache/Output.php\");\n $cache = new Cache_Output($GLOBALS[\"BX_config\"][\"popoon\"][\"cacheContainer\"], $GLOBALS[\"BX_config\"][\"popoon\"][\"cacheParams\"] );\n \n // for the time being, just flush everything...\n @$cache->flush('outputcache');\n $cache->flush('');\n }", "public function clearCache()\n\t{\n\t\t$e107 = e107::getInstance();\n\t\t$e107->ecache->clear_sys(UC_CACHE_TAG);\n\t}", "public static function flushCache()\n {\n self::$cache = array();\n }", "public function clearCache()\n {\n $this->userAgentCache->clear();\n $this->deviceCache->clear();\n $this->clientCache->clear();\n }", "public function cleanContrexxCaching()\n {\n $this->_deleteAllFiles();\n }", "public function clearCache()\n {\n $keys = array_keys($this->cache);\n\n foreach ($keys as $key) {\n unset($this->cache[$key]);\n }\n\n $this->cache = [];\n }", "public function clearInternalCache()\n {\n $this->_cached = null;\n }", "function clear_cache() {\n $this->output->set_header(\"cache-control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0\");\n $this->output->set_header(\"Pragma:no-cache\");\n }", "public function clear_cache()\r\n\t{\r\n\t\tif ($this->_use_cache)\r\n\t\t{\r\n\t\t\t$this->cache->delete('settings');\r\n\t\t}\r\n\r\n\t\t$this->_settings = array();\r\n\t}", "public function cleanComponentCache() {\r\n\t\t$cache =& JFactory::getCache('com_hwdphotoshare');\r\n\t\t$cache->clean('com_hwdphotoshare');\r\n }", "public function clear()\n {\n sfToolkit::clearDirectory($this->getConfigCacheDir());\n }", "function wp_clear_object_cache() {\n\tglobal $wpdb, $wp_object_cache;\n\n\t$wpdb->queries = array(); // or define( 'WP_IMPORTING', true );\n\n\tif ( ! is_object( $wp_object_cache ) ) {\n\t\treturn;\n\t}\n\n\t$wp_object_cache->group_ops = array();\n\t$wp_object_cache->stats = array();\n\t$wp_object_cache->memcache_debug = array();\n\t$wp_object_cache->cache = array();\n\n\tif ( is_callable( $wp_object_cache, '__remoteset' ) ) {\n\t\t$wp_object_cache->__remoteset(); // important\n\t}\n}", "public function purgeCache()\n\t{\n\t\t$objFolder = new Folder(self::CACHE_DIR);\n\t\t$objFolder->purge();\n\t\t\n\t\tstatic::$arrIsCached = array();\t\t\n\t}", "public function clearCache()\n {\n $this->cache->deleteAll();\n }", "function clear_object_cache() {\n\tglobal $wpdb, $wp_object_cache;\n\n\t$wpdb->queries = [];\n\n\tif ( ! is_object( $wp_object_cache ) ) {\n\t\treturn;\n\t}\n\n\t$wp_object_cache->group_ops = [];\n\t$wp_object_cache->stats = [];\n\t$wp_object_cache->memcache_debug = [];\n\t$wp_object_cache->cache = [];\n\n\tif ( method_exists( $wp_object_cache, '__remoteset' ) ) {\n\t\t$wp_object_cache->__remoteset();\n\t}\n}", "public function forgetCache();", "public function clearCache() {\r\n if ($this->getProperty('clearCache')) {\r\n $this->modx->cacheManager->refresh();\r\n }\r\n }", "public function flushCache() {\n\t\t// is deleted. If it cleared our static cache variables\n\t\t// here, they would in effect be useless.\n\t}", "public static function clearCache(){\n\t\t\n\t\t\\GO::config()->getCacheFolder(false)->delete();\t\t\n\t\t\n\t\t\\GO::cache()->flush();\n\n\t\t\\GO\\Base\\Model::clearCache();\n\t}", "public function ResetCache ( )\r\n\t {\r\n\t\t$this -> CacheData\t= [] ;\r\n\t }", "public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}", "public function clearCache()\n\t{\n\t\tYii::app()->cache->delete('customurlrules');\n\t}", "public function clearCache()\n\t{\n\t\tYii::app()->cache->delete('customurlrules');\n\t}", "public function removeCache() {\r\n $files = $this->caches;\r\n while (count($files) > 0) {\r\n @unlink(array_shift($files));\r\n }\r\n\r\n }", "function eve_api_clear_page_cache($name) {\n ctools_include('object-cache');\n ctools_object_cache_clear('eve_api', $name);\n}", "public function resetCaches() {\n $this->datasource = NULL;\n $this->server_object = NULL;\n $this->callbacks = NULL;\n $this->processors = NULL;\n $this->added_properties = NULL;\n $this->fields = array();\n $this->fulltext_fields = array();\n }", "public static function clear_cache() {\n $cacheFolder = self::$cache_folder ? self::$cache_folder : self::relative_client_helper_path() . 'cache/';\n if (!$dh = @opendir($cacheFolder)) {\n return;\n }\n while (FALSE !== ($obj = readdir($dh))) {\n if ($obj != '.' && $obj != '..')\n @unlink($cacheFolder . '/' . $obj);\n }\n closedir($dh);\n }", "public static function clearCache() {\n static::$cachedChecks = [];\n }", "public function clearCache()\n {\n $this->entities = null;\n $this->entitiesAreLoaded = false;\n $this->fields = [];\n\n $em = $this->getEntityManager();\n $em->clear('Oro\\Bundle\\EntityConfigBundle\\Entity\\FieldConfigModel');\n $em->clear('Oro\\Bundle\\EntityConfigBundle\\Entity\\EntityConfigModel');\n }", "public static function resetCache()\n\t{\n\t\tTagDependency::invalidate(Yii::$app->cache, static::getCacheTag());\n\t}", "public static function resetCache()\n\t{\n\t\tTagDependency::invalidate(Yii::$app->cache, static::getCacheTag());\n\t}", "public function cleanLookupCache(){\n\t\t$this->lookup = [];\n\t}", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "public function clear_caches() {\n\n\t\t\tif ( empty( $_GET['clear_meta_cache'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$cache = new Wapu_Core_Meta_Cache( get_the_ID() );\n\t\t\t$cache->delete( esc_attr( $_GET['clear_meta_cache'] ) );\n\n\t\t}", "function object_cache_reset() {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->reset();\n}", "public static function clear()\n\t{\n\t\treturn Cache::forget('settings');\n\t}", "public function purgeNSUrlCache()\n {\n $this->cacheProvider->deleteAll();\n }", "protected function cleanCache()\n {\n parent::cleanCache('com_projectfork');\n }", "public function clearCache()\n {\n if ($this->clear_cache && !empty($this->pageinfo)) {\n $dataHandler = GeneralUtility::makeInstance(DataHandler::class);\n $dataHandler->start([], []);\n $dataHandler->clear_cacheCmd($this->id);\n }\n }", "public function forgetCached() {\n lRedis::del(Helpers::cacheKey($this) . \":properties\");\n }", "public function clearCache()\n {\n $files = $this->ls('/', 'cache');\n foreach ($files as $file)\n {\n if (is_dir($this->cachePath . '/' . $file))\n {\n $this->$this->recurciveDelete($this->cachePath . '/' . $file);\n } else\n {\n unlink($this->cachePath . '/' . $file);\n }\n }\n }", "public function _cacheClear() {\n\t\t$content = null;\n\t\tif ( ZC_CACHE == 'apc' ) {\n\t\t\t$info = apc_cache_info( 'user' );\n\t\t\tforeach ( $info[ 'cache_list' ] as $item ) {\n\t\t\t\tif ( preg_match( '/^\\Q'. ZC_CACHE_PREFIX. '\\E/', $item[ 'info' ] ) )\n\t\t\t\t\tapc_delete( $item[ 'info' ] );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ( ( $dh = opendir( ZC_CACHE_DIR ) ) !== false ) {\n\t\t\t\twhile( ( $file = readdir( $dh ) ) !== false ) {\n\t\t\t\t\tif ( ! preg_match( '/\\.cache$/', $file ) || is_dir( $file ) ) continue;\n\t\t\t\t\tunlink( ZC_CACHE_DIR. '/'. $file );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function cache_delete()\n {\n }", "function clearCache()\n {\n $cacheDir = $this->container->getParameter('kernel.cache_dir');\n\n $kernel = $this->container->get('kernel');\n\n $cacheDir = realpath($cacheDir.'/../');\n\n\n foreach (array (/*'frontdev','frontprod',*/'dev','prod') as $env)\n {\n foreach (array ('UrlGenerator','UrlMatcher') as $file)\n {\n $cachedFile = $cacheDir.'/'.$env.'/app'.ucfirst($env).$file.'.php';\n //print '<br>'.$cachedFile;\n if (file_exists($cachedFile)) @unlink ($cachedFile);\n\n\n $cachedFile = $cacheDir.'/'.$env.'/app'.$env.$file.'.php';\n //print '<br>'.$cachedFile;\n if (file_exists($cachedFile)) @unlink ($cachedFile);\n }\n }\n\n\n if (function_exists('apc_clear_cache')) apc_clear_cache('user');\n //exit();\n\n }", "protected function emptyCache()\n {\n $this->container->get('cache')->clear();\n }", "private function _cacheCleanup()\n\t {\n\t\t$this->_db->exec(\n\t\t \"DELETE FROM `HTTPcache` WHERE \" .\n\t\t \"`datetime` < DATE_SUB(NOW(), INTERVAL \" . $this->_expiry . \" SECOND) OR `expiry` < NOW()\"\n\t\t);\n\t }", "public function cleanFileCache()\n {\n if (is_callable(array('SugarAutoLoader', 'buildCache'))) {\n SugarAutoLoader::buildCache();\n } else {\n // delete dangerous files manually\n @unlink(\"cache/file_map.php\");\n @unlink(\"cache/class_map.php\");\n }\n }", "protected function clearSearchCache()\n {\n $sql = \"SELECT `id` FROM `s_core_config_elements` WHERE `name` LIKE 'fuzzysearchlastupdate'\";\n $elementId = Shopware()->Db()->fetchOne($sql);\n\n $sql = 'DELETE FROM s_core_config_values WHERE element_id=?';\n Shopware()->Db()->query($sql, array($elementId));\n }", "public function clearCacheAndStats() {\n\t\tif (Shop::isFeatureActive()) {\n\t\t\tforeach (Shop::getContextListShopID() as $id_shop) {\n\t\t\t\tif (file_exists(_PS_CACHE_DIR_ . 'pagecache/' . $id_shop)) {\n\t\t\t\t\tTools::deleteDirectory(_PS_CACHE_DIR_ . 'pagecache/' . $id_shop, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tPageCacheDAO::resetCache(Shop::getContextListShopID());\n\t\t}\n\t\telse {\n\t\t\tif (file_exists(_PS_CACHE_DIR_ . 'pagecache/')) {\n\t\t\t\tTools::deleteDirectory(_PS_CACHE_DIR_ . 'pagecache', false);\n\t\t\t}\n\t\t\tPageCacheDAO::resetCache();\n\t\t}\n\t}", "public static function initCache()\n {\n// $cache->delete('config');\n }", "public function removeCache()\n {\n $this->getHttpClientBuilder()->removeCache();\n }", "public function flushCache();" ]
[ "0.7637364", "0.7595558", "0.7451692", "0.73944116", "0.73944116", "0.7363321", "0.7226416", "0.72154593", "0.72098416", "0.72050965", "0.7134312", "0.7061853", "0.7061725", "0.7050175", "0.7030799", "0.7025625", "0.7006017", "0.6990051", "0.69688284", "0.6958389", "0.6951649", "0.69157225", "0.69155324", "0.6911391", "0.6883634", "0.6882888", "0.6858232", "0.6840558", "0.68372476", "0.6817312", "0.6798319", "0.6797951", "0.6777343", "0.6769924", "0.67625195", "0.67541367", "0.6739142", "0.67116207", "0.6695893", "0.6692626", "0.66882336", "0.668274", "0.66813576", "0.66546106", "0.6646786", "0.6645945", "0.66393733", "0.66382605", "0.66248745", "0.6624544", "0.6613444", "0.6609522", "0.6605205", "0.65965235", "0.65892035", "0.6574539", "0.6574363", "0.6571217", "0.65704256", "0.65691173", "0.65671766", "0.656331", "0.655953", "0.65565574", "0.65523475", "0.6543316", "0.65431315", "0.6538753", "0.6529089", "0.65290564", "0.65290564", "0.6528477", "0.648697", "0.6467728", "0.6460666", "0.64591956", "0.64568454", "0.6456179", "0.6456179", "0.6455356", "0.64478934", "0.64449954", "0.64331186", "0.6427152", "0.6425824", "0.6423941", "0.64226526", "0.6421952", "0.6421101", "0.64081347", "0.6401731", "0.6395723", "0.63950896", "0.63911915", "0.63772166", "0.6368673", "0.6367066", "0.6363553", "0.6363138", "0.6363022" ]
0.7251864
6
Check if current authentication info is valid.
public function isAuthValid() { if (is_null($this->getUserId())) { return FALSE; } else { return TRUE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkAuthentication() {}", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "public function checkAuth() {\n\n /*\n * Dummy stuff - just to test the authentication loop\n */\n if ($_SERVER['PHP_AUTH_USER'] === $this->config['general']['admin']['user'] && $_SERVER['PHP_AUTH_PW'] === $this->config['general']['admin']['password']) {\n return true;\n }\n\n return false;\n }", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "public function isAuthenticated()\n {\n if (!is_null($this->_authResult)) {\n return $this->_authResult->isValid();\n }\n\n // this is CLI environment, not web -- we don't require any\n // authentication\n if ($this->_runner->isCliEnvironment()) {\n return $this->_validated(true)->isValid();\n }\n\n // there are a number of possible authentication scenarios\n switch (true) {\n case ($result = $this->_tryHttpPost()):\n break;\n\n case ($result = $this->_tryHttpGet()):\n break;\n\n case ($result = $this->_tryHttpCookie()):\n break;\n\n case ($result = $this->_tryPlainAuth());\n break;\n\n default:\n // no authinfo, chances are that site is not protected\n $result = array('login' => false, 'hash'=> false);\n }\n $this->_authResult = $this->authenticate($result['login'], $result['hash'], true);\n return $this->_authResult->isValid();\n }", "public function isValid()\n {\n if (!$this->isAuthenticate())\n {\n return false;\n }\n return !$this->access_token->isExpired();\n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "public function checkAuthentication()\n {\n if (!$this->hash) {\n throw new OnePilotException('no-verification-key', 403);\n }\n\n if (!$this->private_key) {\n throw new OnePilotException('no-private-key-configured', 403);\n }\n\n $hash = hash_hmac('sha256', $this->stamp, $this->private_key);\n\n if (!$this->checkKey($hash, $this->hash)) {\n throw new OnePilotException('bad-authentification', 403);\n }\n\n $this->validateTimestamp();\n\n return true;\n }", "public function checkAuth();", "public function checkAuth();", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthenticate()\n {\n return !empty($this->access_token);\n }", "public function isAuthenticated()\n {\n //get headers from postMan\n $this->headers = getallheaders();\n //cut the first word from the header, ex:Bearer, the space before and after the token\n $token = !empty($this->headers['Authorization']) ? trim(substr($this->headers['Authorization'], 6)) : null;\n\n //request in the database to take the token\n $tokenDataBase = $this->authToken->getToken();\n\n //the token in the header must exist and be the same as in the base date in order to make the request\n if (!$token || $token !== $tokenDataBase) {\n http_response_code(401);\n echo json_encode(array(\"message\" => \"Unauthorized\"));\n exit;\n }\n }", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function isAuthenticated(): bool {\n return $this->check('id');\n }", "public function isAuth()\n {\n return !empty($this->getAuth());\n }", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "protected function hasAuth()\n {\n return !! $this->options['authentication'];\n }", "protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "function authenticationNeeded()\n {\n\n // define all the global variables\n global $user;\n\n // check if user has 2-factor authentication enabled\n if (!$user->twoFactorEnabled()) {\n return false;\n }\n\n // check if secret key has been setup\n if ($user->get2FactorCode() == \"\") {\n return false;\n }\n\n // check if current session has been authenticated\n if (isset($_SESSION[\"authenticated\"])) {\n if ($_SESSION[\"authenticated\"] == true) {\n return false;\n }\n }\n\n // if no errors then ask for authentication\n return true;\n }", "private static function has_credentials() {\r\n\t\t\t$credentials = self::get_credentials();\r\n\r\n\t\t\treturn is_array($credentials)\r\n\t\t\t\t\t&& isset($credentials['api-key'])\r\n\t\t\t\t\t&& isset($credentials['email'])\r\n\t\t\t\t\t&& isset($credentials['id'])\r\n\t\t\t\t\t&& !empty($credentials['api-key'])\r\n\t\t\t\t\t&& !empty($credentials['email'])\r\n\t\t\t\t\t&& !empty($credentials['id']);\r\n\t\t}", "public static function isAuth() : bool\n {\n return null !== self::$fullUser;\n }", "private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public static function checkCredentials()\n {\n if (null === self::username() || null === self::password()) {\n echo self::errorMessage();\n die(1);\n }\n\n return true;\n }", "public function isAuth() {}", "function isAuth()\n {\n $db = $this->getDatabaseConnection();\n $sesPrefix = $db->dsn['database'];\n if (empty($_SERVER['PHP_AUTH_USER'])) {\n @session_start();\n }\n if (!empty($_SESSION[__CLASS__][$sesPrefix .'-auth'])) {\n // in session...\n $a = unserialize($_SESSION[__CLASS__][$sesPrefix .'-auth']);\n $u = DB_DataObject::factory('core_company');\n if ($u->get($a->id)) { //&& strlen($u->passwd)) {\n return true;\n }\n $_SESSION[__CLASS__][$sesPrefix .'-auth'] = '';\n \n }\n // not in session or not matched...\n \n \n return false;\n \n }", "public function isAuth() {\n\t\tif($this->auth === null) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function check_auth( )\n\t{\n\t\t$page = $this->uri->segment( 2);\n\t\t$section = $this->uri->segment(1);\t\t\n\t\t$function = $this->uri->segment(3);\n\t\t\n\t\tif( $section == 'api' and $page == 'users' and $function == 'login' )\n\t\t\treturn;\n\n\t\t$logged_in = $this->is_logged_in();\n\t\t$excused_uri = array('login' , 'recover_password' , 'auth_help' , 'token_login');\n\t\tif( ! $logged_in )\n\t\t{\n\t\t\t//if in app mode\n\t\t\tif( $this->_app_mode == 'json' and $section != 'admin' )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->output->set_status_header('401');\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//check if is login page\n\t\t\tif( $section == 'admin' and ( ! in_array($page, $excused_uri) ) )\n\t\t\t{\n\t\t\t\theader('Location: /admin/login');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\treturn;\n\t}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function hasAuthenticationInformation(): bool\n {\n return $this->has(AuthenticationInfoAttributeValue::OID);\n }", "public function isAuth();", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public function isValid()\n\t{\n\t\t$username = $this->getCurrent('username');\n\t\t\n\t\tif ( ! $username)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check if user is a valid system user\n\t\tif ( ! $this->validUser($username))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check if ip address matches\n\t\tif ($this->getPrevious('ipAddress') != $this->getCurrent('ipAddress'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check if the user agents matches\n\t\tif ($this->getPrevious('userAgent') != $this->getCurrent('userAgent'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check idle time\n\t\t$idleTime = $this->getCurrent('timestamp') - $this->getPrevious('timestamp');\n\t\t\n\t\treturn true;\n\t}", "public function IsAuth()\n {\n if ($this->mSystemLogin || $this->mFacebookId || $this->mTwitterId)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function valid()\n {\n return $this->validateUsername()\n and $this->validatePassword()\n and $this->validateHost()\n and $this->validatePort()\n and $this->validatePath()\n and $this->validateQuery()\n and $this->validateFragment();\n }", "public function checkAuthentication() \n {\n if(!isset($this->userInfo['admin_id']) && empty($this->userInfo['admin_id'])) \n {\n redirect('login/loginPage');\n }\n }", "public function isUserValid() {\n $user = self::getUserFromDb($this->login, $this->password, $this->authKey);\n return $user != null;\n }", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function isAValidUser()\n {\n return !isset($this->username) || empty($this->username) ||\n !isset($this->email) || empty($this->email) ||\n !isset($this->password) || empty($this->password);\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "public function isAuthenticated()\n {\n return $this->getUser() !== null;\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "private function is_authenticated()\n {\n if($this->mode == rabkTwttr::MODE_APP)\n return isset($_SESSION['access_token']);\n \n if($this->mode == rabkTwttr::MODE_USER)\n return isset($_SESSION['access_token']) && isset($_SESSION['access_token_secret']);\n }", "public function isAuthenticated() {\n\t}", "public static function check()\n {\n if(isset($_SESSION['auth_user'])) {\n return true;\n }\n\n return false;\n }", "private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthenticated()\n\t{\n\t\t$token = $this->getToken();\n\n\t\tif (!$token || !array_key_exists('access_token', $token))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isLoginDataFilled()\n {\n $client = $this->Client();\n $credentials = $client->getCredentials();\n\n if (!empty($credentials['bearerToken']) || !empty($credentials['login']) || !empty($credentials['password'])) {\n return true;\n }\n\n return false;\n }", "private function _fail_auth_check($data_array)\r\n {\r\n $checker = true;\r\n \r\n $user = $this->_get_array_value($data_array,\"user\");\r\n $password = $this->_get_array_value($data_array,\"password\");\r\n \r\n if($user == \"root\" && $password == \"1234abcd*\")\r\n {\r\n $checker = false;\r\n }\r\n \r\n return $checker;\r\n }", "public function isAuth( ) {\n\t\tif( $this->getName() == null || $this->getId() == -1 ) {\n\t\t\treturn false;\n\t\t} elseif( isset($_SESSION) ) {\n\t\t\t// Make sure we have all the required session values.\n\t\t\tforeach( $this->SESSION_KEYS_USED as $key ){\n\t\t\t\tif( ! array_key_exists($key, $_SESSION) ){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function checkAuth() {\n $slack_correct_token = (0 == strcmp($this->input->token, $_ENV['SLACK_APPTOKEN']));\n //Check correct channel\n// $slack_correct_channel = (0 == strcmp($this->input->channel_id, $_ENV['SLACK_CHANNEL']));\n $slack_correct_channel = TRUE;\n return ($slack_correct_channel && $slack_correct_token);\n }", "protected function authRequired()\n {\n return true;\n }", "private function isCorrectCredentials ()\n {\n\n try {\n $this->httpClient->request (\"GET\", \"http://livescore-api.com/api-client/users/pair.json?key=\" . $this->apiKey . \"&secret=\" . $this->apiSecret);\n } catch (ClientException $e) {\n $response = json_decode ((string) $e->getResponse ()->getBody (), true);\n\n throw new WrongAPICredentialsException($response['error'], $e->getResponse ()->getStatusCode ());\n }\n }", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "protected function authorizationKeyNotValid()\n {\n return !session()->has('EAPISessionKey.' . $this->clientCode . '.' . $this->username . '') ||\n !session()->has('EAPISessionKeyExpires.' . $this->clientCode . '.' . $this->username . '') ||\n session()->get('EAPISessionKeyExpires.' . $this->clientCode . '.' . $this->username . '') < time();\n }", "public function auth(){\n\t\tif( !isset($_SESSION) || !isset($_SESSION['userId']) ) {\n\t\t\treturn false;\n\t\t} elseif( !parent::fetchFromDB($_SESSION['userId']) ){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn ( $this->checkIp() && $this->checkSessionId() );\n\t\t}\n\t}", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function isAuthenticated(): bool\n {\n return null !== $this->getUser();\n }", "public function is_auth_required() {\r\n\r\n\t\treturn false;\r\n\t}", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "public function _isConnected()\n {\n /* If either one of the user or pass vars are empty, then return false; */\n if (empty($this->_USER)) {\n return false;\n }\n\n /* Are we authenticated? */\n if ($this->_data[ strtolower($this->_USER) ] != md5($this->_PASS)) {\n return false;\n }\n\n return true;\n }", "public function isValid()\n {\n // check scheme, user/password & host syntax (in general)\n if (parent::isValid() === false) {\n return false;\n }\n\n // check scheme\n if ($this->url['scheme'] !== 'ldap' && $this->url['scheme'] !== 'ldaps') {\n return false;\n }\n\n // check dn\n if (isset($this->url['base_dn']) === false || preg_match('/^([A-Za-z0-9]+=[A-Za-z0-9 ]+,?)*$/', $this->url['base_dn']) === 0) {\n return false;\n }\n\n // (optional) attributes & (optional) filters are passed through only scope is checked\n if ($this->getParam('scope') !== null\n && (self::SCOPE_ONE !== $this->getParam('scope')\n && self::SCOPE_BASE !== $this->getParam('scope')\n && self::SCOPE_SUB !== $this->getParam('scope'))) {\n return false;\n }\n\n return true;\n }", "public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}", "public function checkAuth()\n\t{\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI\";\n\t\t$authinfo = json_decode($this->curlObj->fetch_url($url),true);\n\t\treturn $authinfo;\n\t}", "public static function checkAuth() {\n if(session(\"auth_token\", null) == null){ return false; }\n \n $apiresponse = ApiController::doRequest(\"GET\", \"/users/me\", [\"bearer\" => session(\"auth_token\")], []);\n if($apiresponse->getStatusCode() == 200) {\n $apibodystr = (string)$apiresponse->getBody();\n $apibody = \\GuzzleHttp\\json_decode($apibodystr);\n session([\"auth_user\" => new User($apibody)]);\n return true; \n }\n \n return false;\n }", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "public function getAuthenticationAvailable();", "public function isAuthenticated()\n {\n return $this->authenticator->isAuthenticated();\n }", "private function isOAuthAuthenticated() {\r\n\t\tGLOBAL $wgYammerAccessKey, $wgYammerAccessSecret;\r\n\t\treturn !empty($wgYammerAccessKey) && !empty($wgYammerAccessSecret);\r\n\t}", "public function isValid()\n {\n return !empty($this->_data[OAuth::PARAM_TOKEN])\n && !empty($this->_data[OAuth::PARAM_VERIFIER]);\n }", "public function check()\n {\n if ($this->checkSuspended()) {\n throw new AuthException(sprintf(\n 'Пользователь [%s] был заморожен. Попробуйте позже.', $this->user->getLogin()\n ));\n }\n\n return true;\n }", "public function authenticate()\n\t{\n\t if($this->pop_authenticate($this->username, $this->password,\"192.168.121.26\"))\n {\n\t\t\t$this->errorCode=self::ERROR_NONE;\n }\n else\n {\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n }\n\t\treturn !$this->errorCode;\n\t}", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "public function authentic()\n {\n return $this->authentic === true;\n }", "public function valid(): bool\n {\n return !empty($this->clientId) || !empty($this->clientSecret);\n }", "public function checkAccess()\n {\n if (!$this->isAuthenticated()) {\n header('HTTP/1.1 401 Unauthorized');\n exit();\n }\n }", "public function is_auth()\r\n\t{\r\n\t\tstatic $authorized = null;\r\n\r\n\t\tif(isset($authorized))\r\n\t\t\treturn $authorized;\r\n\r\n\t\t$authorized = false;\r\n\t\t$token = Options::get('picasa_token_' . User::identify()->id);\r\n\r\n\t\tif($token != null)\r\n\t\t\t$authorized = true;\r\n\r\n\t\treturn $authorized;\r\n\t}", "function is_user_valid()\n{\n\tif(!isset($_SESSION['username'])\n\t|| !isset($_SESSION['password'])\n\t|| !isset($_SESSION['host'])\n\t|| !isset($_SESSION['ftp_port'])\n\t|| !isset($_SESSION['fingerprint'])\n\t|| !isset($_SESSION['current_dir'])\n\t|| $_SESSION['fingerprint'] !== sha1($_SERVER['HTTP_USER_AGENT']))\n\t\treturn false;\n\treturn true;\n}", "public function validate()\n\t{\n\t\treturn (strlen(trim($this->username)) > 0) &&\n\t\t\t(strlen(trim($this->password)) > 0) &&\n\t\t\t(strlen(trim($this->emailAddr)) > 0) &&\n\t\t\t(strlen(trim($this->firstName)) > 0) &&\n\t\t\t(strlen(trim($this->lastName)) > 0);\n\t}", "public function isAuthorized(){\n\t\t// Check that username is not empty and exists\n\t\t;return ($username = $_SERVER['PHP_AUTH_USER']) && array_key_exists($username, $this->users_pwds)\n\t\t// Check passord validity\n\t\t&& $this->users_pwds[$username] === $_SERVER['PHP_AUTH_PW']\n\t\t;\n\t}", "function is_authenticated()\n{\n global $app;\n return (is_object($app->auth) && $app->auth->isValid());\n}", "function Check()\n\t\t{\n\t\t\t$token = $this->token;\n\t\t\tif(empty($token))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Invalid token supplied.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$decode = JWT::decode(\n\t\t\t\t\t$token,\n\t\t\t\t\tself::$secret_key,\n\t\t\t\t\tself::$encrypt\n\t\t\t\t);\n\t\t\t\t\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t// throw new Exception(\"Invalid user logged in.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$decode)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Invalid user logged in.\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "public static function checkAuthentication() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::checkAuthentication();\t\t\n\t}", "public function authenticate() {\n\t\treturn FALSE;\n\t}" ]
[ "0.73553157", "0.72912556", "0.725669", "0.7117654", "0.7028989", "0.7020556", "0.69796604", "0.6951495", "0.68943995", "0.68943995", "0.6885874", "0.6842124", "0.68379045", "0.68327427", "0.68282396", "0.6806901", "0.6798327", "0.67606795", "0.6740837", "0.6719962", "0.6696053", "0.66918534", "0.66834044", "0.66717464", "0.66527826", "0.66479313", "0.66466725", "0.66207176", "0.66198117", "0.66194695", "0.66108626", "0.6604414", "0.65935606", "0.6549087", "0.65451604", "0.6540892", "0.653648", "0.653648", "0.6519179", "0.64988244", "0.6488733", "0.6482425", "0.64668006", "0.64655024", "0.64655024", "0.646131", "0.6460737", "0.645442", "0.64540076", "0.64469886", "0.64366186", "0.6436182", "0.64352757", "0.642987", "0.6427302", "0.64182156", "0.6413622", "0.64050907", "0.63991046", "0.6397383", "0.6389714", "0.63848144", "0.6373794", "0.6365206", "0.6341745", "0.6333601", "0.6321103", "0.6304689", "0.6302068", "0.6301055", "0.6298715", "0.6298715", "0.6298715", "0.6298715", "0.6274889", "0.62660533", "0.6263578", "0.62521386", "0.6250798", "0.6249515", "0.6240686", "0.62405217", "0.6228244", "0.6224094", "0.6222526", "0.62169373", "0.62098515", "0.6189095", "0.6188292", "0.6184052", "0.61830443", "0.6177609", "0.617489", "0.6173661", "0.6163282", "0.6156962", "0.61525905", "0.6148617", "0.6139954", "0.6132398" ]
0.7251719
3
Check if current authentication info is valid.
public function isPro($user_id = NULL) { if (is_null($user_id)) { $user_id = $this->getUserId(); } $user_info = $this->people_getInfo($user_id); if ($user_info['ispro'] == 1) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkAuthentication() {}", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "public function checkAuth() {\n\n /*\n * Dummy stuff - just to test the authentication loop\n */\n if ($_SERVER['PHP_AUTH_USER'] === $this->config['general']['admin']['user'] && $_SERVER['PHP_AUTH_PW'] === $this->config['general']['admin']['password']) {\n return true;\n }\n\n return false;\n }", "public function isAuthValid() {\n if (is_null($this->getUserId())) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "public function isAuthenticated()\n {\n if (!is_null($this->_authResult)) {\n return $this->_authResult->isValid();\n }\n\n // this is CLI environment, not web -- we don't require any\n // authentication\n if ($this->_runner->isCliEnvironment()) {\n return $this->_validated(true)->isValid();\n }\n\n // there are a number of possible authentication scenarios\n switch (true) {\n case ($result = $this->_tryHttpPost()):\n break;\n\n case ($result = $this->_tryHttpGet()):\n break;\n\n case ($result = $this->_tryHttpCookie()):\n break;\n\n case ($result = $this->_tryPlainAuth());\n break;\n\n default:\n // no authinfo, chances are that site is not protected\n $result = array('login' => false, 'hash'=> false);\n }\n $this->_authResult = $this->authenticate($result['login'], $result['hash'], true);\n return $this->_authResult->isValid();\n }", "public function isValid()\n {\n if (!$this->isAuthenticate())\n {\n return false;\n }\n return !$this->access_token->isExpired();\n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "public function checkAuthentication()\n {\n if (!$this->hash) {\n throw new OnePilotException('no-verification-key', 403);\n }\n\n if (!$this->private_key) {\n throw new OnePilotException('no-private-key-configured', 403);\n }\n\n $hash = hash_hmac('sha256', $this->stamp, $this->private_key);\n\n if (!$this->checkKey($hash, $this->hash)) {\n throw new OnePilotException('bad-authentification', 403);\n }\n\n $this->validateTimestamp();\n\n return true;\n }", "public function checkAuth();", "public function checkAuth();", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthenticate()\n {\n return !empty($this->access_token);\n }", "public function isAuthenticated()\n {\n //get headers from postMan\n $this->headers = getallheaders();\n //cut the first word from the header, ex:Bearer, the space before and after the token\n $token = !empty($this->headers['Authorization']) ? trim(substr($this->headers['Authorization'], 6)) : null;\n\n //request in the database to take the token\n $tokenDataBase = $this->authToken->getToken();\n\n //the token in the header must exist and be the same as in the base date in order to make the request\n if (!$token || $token !== $tokenDataBase) {\n http_response_code(401);\n echo json_encode(array(\"message\" => \"Unauthorized\"));\n exit;\n }\n }", "public static function check()\n {\n return (new Authenticator(request()))->isAuthenticated();\n }", "public function isAuthenticated(): bool {\n return $this->check('id');\n }", "public function isAuth()\n {\n return !empty($this->getAuth());\n }", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function checkAuth ()\n {\n if ($this->storage->isAvailable()) {\n if ($this->storage->get(self::$prefix . 'userId') !== NULL) {\n return true;\n } else {\n $this->logout();\n return false;\n }\n }\n\n return false;\n }", "protected function hasAuth()\n {\n return !! $this->options['authentication'];\n }", "protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "function authenticationNeeded()\n {\n\n // define all the global variables\n global $user;\n\n // check if user has 2-factor authentication enabled\n if (!$user->twoFactorEnabled()) {\n return false;\n }\n\n // check if secret key has been setup\n if ($user->get2FactorCode() == \"\") {\n return false;\n }\n\n // check if current session has been authenticated\n if (isset($_SESSION[\"authenticated\"])) {\n if ($_SESSION[\"authenticated\"] == true) {\n return false;\n }\n }\n\n // if no errors then ask for authentication\n return true;\n }", "private static function has_credentials() {\r\n\t\t\t$credentials = self::get_credentials();\r\n\r\n\t\t\treturn is_array($credentials)\r\n\t\t\t\t\t&& isset($credentials['api-key'])\r\n\t\t\t\t\t&& isset($credentials['email'])\r\n\t\t\t\t\t&& isset($credentials['id'])\r\n\t\t\t\t\t&& !empty($credentials['api-key'])\r\n\t\t\t\t\t&& !empty($credentials['email'])\r\n\t\t\t\t\t&& !empty($credentials['id']);\r\n\t\t}", "public static function isAuth() : bool\n {\n return null !== self::$fullUser;\n }", "private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public static function checkCredentials()\n {\n if (null === self::username() || null === self::password()) {\n echo self::errorMessage();\n die(1);\n }\n\n return true;\n }", "public function isAuth() {}", "function isAuth()\n {\n $db = $this->getDatabaseConnection();\n $sesPrefix = $db->dsn['database'];\n if (empty($_SERVER['PHP_AUTH_USER'])) {\n @session_start();\n }\n if (!empty($_SESSION[__CLASS__][$sesPrefix .'-auth'])) {\n // in session...\n $a = unserialize($_SESSION[__CLASS__][$sesPrefix .'-auth']);\n $u = DB_DataObject::factory('core_company');\n if ($u->get($a->id)) { //&& strlen($u->passwd)) {\n return true;\n }\n $_SESSION[__CLASS__][$sesPrefix .'-auth'] = '';\n \n }\n // not in session or not matched...\n \n \n return false;\n \n }", "public function isAuth() {\n\t\tif($this->auth === null) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function check_auth( )\n\t{\n\t\t$page = $this->uri->segment( 2);\n\t\t$section = $this->uri->segment(1);\t\t\n\t\t$function = $this->uri->segment(3);\n\t\t\n\t\tif( $section == 'api' and $page == 'users' and $function == 'login' )\n\t\t\treturn;\n\n\t\t$logged_in = $this->is_logged_in();\n\t\t$excused_uri = array('login' , 'recover_password' , 'auth_help' , 'token_login');\n\t\tif( ! $logged_in )\n\t\t{\n\t\t\t//if in app mode\n\t\t\tif( $this->_app_mode == 'json' and $section != 'admin' )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->output->set_status_header('401');\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//check if is login page\n\t\t\tif( $section == 'admin' and ( ! in_array($page, $excused_uri) ) )\n\t\t\t{\n\t\t\t\theader('Location: /admin/login');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\treturn;\n\t}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function hasAuthenticationInformation(): bool\n {\n return $this->has(AuthenticationInfoAttributeValue::OID);\n }", "public function isAuth();", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public function isValid()\n\t{\n\t\t$username = $this->getCurrent('username');\n\t\t\n\t\tif ( ! $username)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check if user is a valid system user\n\t\tif ( ! $this->validUser($username))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check if ip address matches\n\t\tif ($this->getPrevious('ipAddress') != $this->getCurrent('ipAddress'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check if the user agents matches\n\t\tif ($this->getPrevious('userAgent') != $this->getCurrent('userAgent'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Check idle time\n\t\t$idleTime = $this->getCurrent('timestamp') - $this->getPrevious('timestamp');\n\t\t\n\t\treturn true;\n\t}", "public function IsAuth()\n {\n if ($this->mSystemLogin || $this->mFacebookId || $this->mTwitterId)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function valid()\n {\n return $this->validateUsername()\n and $this->validatePassword()\n and $this->validateHost()\n and $this->validatePort()\n and $this->validatePath()\n and $this->validateQuery()\n and $this->validateFragment();\n }", "public function checkAuthentication() \n {\n if(!isset($this->userInfo['admin_id']) && empty($this->userInfo['admin_id'])) \n {\n redirect('login/loginPage');\n }\n }", "public function isUserValid() {\n $user = self::getUserFromDb($this->login, $this->password, $this->authKey);\n return $user != null;\n }", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function isAValidUser()\n {\n return !isset($this->username) || empty($this->username) ||\n !isset($this->email) || empty($this->email) ||\n !isset($this->password) || empty($this->password);\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "public function isAuthenticated()\n {\n return $this->getUser() !== null;\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "private function is_authenticated()\n {\n if($this->mode == rabkTwttr::MODE_APP)\n return isset($_SESSION['access_token']);\n \n if($this->mode == rabkTwttr::MODE_USER)\n return isset($_SESSION['access_token']) && isset($_SESSION['access_token_secret']);\n }", "public static function check()\n {\n if(isset($_SESSION['auth_user'])) {\n return true;\n }\n\n return false;\n }", "public function isAuthenticated() {\n\t}", "private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthenticated()\n\t{\n\t\t$token = $this->getToken();\n\n\t\tif (!$token || !array_key_exists('access_token', $token))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telseif (array_key_exists('expires_in', $token) && $token['created'] + $token['expires_in'] < time() + 20)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isLoginDataFilled()\n {\n $client = $this->Client();\n $credentials = $client->getCredentials();\n\n if (!empty($credentials['bearerToken']) || !empty($credentials['login']) || !empty($credentials['password'])) {\n return true;\n }\n\n return false;\n }", "private function _fail_auth_check($data_array)\r\n {\r\n $checker = true;\r\n \r\n $user = $this->_get_array_value($data_array,\"user\");\r\n $password = $this->_get_array_value($data_array,\"password\");\r\n \r\n if($user == \"root\" && $password == \"1234abcd*\")\r\n {\r\n $checker = false;\r\n }\r\n \r\n return $checker;\r\n }", "public function isAuth( ) {\n\t\tif( $this->getName() == null || $this->getId() == -1 ) {\n\t\t\treturn false;\n\t\t} elseif( isset($_SESSION) ) {\n\t\t\t// Make sure we have all the required session values.\n\t\t\tforeach( $this->SESSION_KEYS_USED as $key ){\n\t\t\t\tif( ! array_key_exists($key, $_SESSION) ){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function checkAuth() {\n $slack_correct_token = (0 == strcmp($this->input->token, $_ENV['SLACK_APPTOKEN']));\n //Check correct channel\n// $slack_correct_channel = (0 == strcmp($this->input->channel_id, $_ENV['SLACK_CHANNEL']));\n $slack_correct_channel = TRUE;\n return ($slack_correct_channel && $slack_correct_token);\n }", "protected function authRequired()\n {\n return true;\n }", "private function isCorrectCredentials ()\n {\n\n try {\n $this->httpClient->request (\"GET\", \"http://livescore-api.com/api-client/users/pair.json?key=\" . $this->apiKey . \"&secret=\" . $this->apiSecret);\n } catch (ClientException $e) {\n $response = json_decode ((string) $e->getResponse ()->getBody (), true);\n\n throw new WrongAPICredentialsException($response['error'], $e->getResponse ()->getStatusCode ());\n }\n }", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "protected function authorizationKeyNotValid()\n {\n return !session()->has('EAPISessionKey.' . $this->clientCode . '.' . $this->username . '') ||\n !session()->has('EAPISessionKeyExpires.' . $this->clientCode . '.' . $this->username . '') ||\n session()->get('EAPISessionKeyExpires.' . $this->clientCode . '.' . $this->username . '') < time();\n }", "public function auth(){\n\t\tif( !isset($_SESSION) || !isset($_SESSION['userId']) ) {\n\t\t\treturn false;\n\t\t} elseif( !parent::fetchFromDB($_SESSION['userId']) ){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn ( $this->checkIp() && $this->checkSessionId() );\n\t\t}\n\t}", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function is_auth_required() {\r\n\r\n\t\treturn false;\r\n\t}", "public function isAuthenticated(): bool\n {\n return null !== $this->getUser();\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "public function _isConnected()\n {\n /* If either one of the user or pass vars are empty, then return false; */\n if (empty($this->_USER)) {\n return false;\n }\n\n /* Are we authenticated? */\n if ($this->_data[ strtolower($this->_USER) ] != md5($this->_PASS)) {\n return false;\n }\n\n return true;\n }", "public function isValid()\n {\n // check scheme, user/password & host syntax (in general)\n if (parent::isValid() === false) {\n return false;\n }\n\n // check scheme\n if ($this->url['scheme'] !== 'ldap' && $this->url['scheme'] !== 'ldaps') {\n return false;\n }\n\n // check dn\n if (isset($this->url['base_dn']) === false || preg_match('/^([A-Za-z0-9]+=[A-Za-z0-9 ]+,?)*$/', $this->url['base_dn']) === 0) {\n return false;\n }\n\n // (optional) attributes & (optional) filters are passed through only scope is checked\n if ($this->getParam('scope') !== null\n && (self::SCOPE_ONE !== $this->getParam('scope')\n && self::SCOPE_BASE !== $this->getParam('scope')\n && self::SCOPE_SUB !== $this->getParam('scope'))) {\n return false;\n }\n\n return true;\n }", "public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}", "public function checkAuth()\n\t{\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI\";\n\t\t$authinfo = json_decode($this->curlObj->fetch_url($url),true);\n\t\treturn $authinfo;\n\t}", "public static function checkAuth() {\n if(session(\"auth_token\", null) == null){ return false; }\n \n $apiresponse = ApiController::doRequest(\"GET\", \"/users/me\", [\"bearer\" => session(\"auth_token\")], []);\n if($apiresponse->getStatusCode() == 200) {\n $apibodystr = (string)$apiresponse->getBody();\n $apibody = \\GuzzleHttp\\json_decode($apibodystr);\n session([\"auth_user\" => new User($apibody)]);\n return true; \n }\n \n return false;\n }", "private function checkUserAuthenticated () {\n if (empty($this->userIdentifier)) {\n #yes 403 - 401 is not appropriate for X509 authentication\n $this->exceptionWithResponseCode(403,\n \"You need to be authenticated to access this resource. \" .\n \"Please provide a valid IGTF X509 Certificate\"\n );\n }\n }", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "public function getAuthenticationAvailable();", "public function isAuthenticated()\n {\n return $this->authenticator->isAuthenticated();\n }", "private function isOAuthAuthenticated() {\r\n\t\tGLOBAL $wgYammerAccessKey, $wgYammerAccessSecret;\r\n\t\treturn !empty($wgYammerAccessKey) && !empty($wgYammerAccessSecret);\r\n\t}", "public function isValid()\n {\n return !empty($this->_data[OAuth::PARAM_TOKEN])\n && !empty($this->_data[OAuth::PARAM_VERIFIER]);\n }", "public function check()\n {\n if ($this->checkSuspended()) {\n throw new AuthException(sprintf(\n 'Пользователь [%s] был заморожен. Попробуйте позже.', $this->user->getLogin()\n ));\n }\n\n return true;\n }", "private function validate () {\n $payload = $this->payload;\n // Unset fields that don't match the spec\n foreach (array_keys($payload) as $field) {\n if (!in_array($field, $this->fields)) {\n unset($payload[$field]);\n }\n }\n\n // If the user is signing up manually (I.e. not via a social network), then\n // we also need a password\n if ($this->method === 'manual' && empty($payload['password'])) {\n return false;\n }\n\n $this->payload = $payload;\n return true;\n }", "public function authenticate()\n\t{\n\t if($this->pop_authenticate($this->username, $this->password,\"192.168.121.26\"))\n {\n\t\t\t$this->errorCode=self::ERROR_NONE;\n }\n else\n {\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n }\n\t\treturn !$this->errorCode;\n\t}", "public function valid(): bool\n {\n return !empty($this->clientId) || !empty($this->clientSecret);\n }", "public function authentic()\n {\n return $this->authentic === true;\n }", "public function checkAccess()\n {\n if (!$this->isAuthenticated()) {\n header('HTTP/1.1 401 Unauthorized');\n exit();\n }\n }", "public function is_auth()\r\n\t{\r\n\t\tstatic $authorized = null;\r\n\r\n\t\tif(isset($authorized))\r\n\t\t\treturn $authorized;\r\n\r\n\t\t$authorized = false;\r\n\t\t$token = Options::get('picasa_token_' . User::identify()->id);\r\n\r\n\t\tif($token != null)\r\n\t\t\t$authorized = true;\r\n\r\n\t\treturn $authorized;\r\n\t}", "function is_user_valid()\n{\n\tif(!isset($_SESSION['username'])\n\t|| !isset($_SESSION['password'])\n\t|| !isset($_SESSION['host'])\n\t|| !isset($_SESSION['ftp_port'])\n\t|| !isset($_SESSION['fingerprint'])\n\t|| !isset($_SESSION['current_dir'])\n\t|| $_SESSION['fingerprint'] !== sha1($_SERVER['HTTP_USER_AGENT']))\n\t\treturn false;\n\treturn true;\n}", "public function validate()\n\t{\n\t\treturn (strlen(trim($this->username)) > 0) &&\n\t\t\t(strlen(trim($this->password)) > 0) &&\n\t\t\t(strlen(trim($this->emailAddr)) > 0) &&\n\t\t\t(strlen(trim($this->firstName)) > 0) &&\n\t\t\t(strlen(trim($this->lastName)) > 0);\n\t}", "public function isAuthorized(){\n\t\t// Check that username is not empty and exists\n\t\t;return ($username = $_SERVER['PHP_AUTH_USER']) && array_key_exists($username, $this->users_pwds)\n\t\t// Check passord validity\n\t\t&& $this->users_pwds[$username] === $_SERVER['PHP_AUTH_PW']\n\t\t;\n\t}", "function Check()\n\t\t{\n\t\t\t$token = $this->token;\n\t\t\tif(empty($token))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Invalid token supplied.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t$decode = JWT::decode(\n\t\t\t\t\t$token,\n\t\t\t\t\tself::$secret_key,\n\t\t\t\t\tself::$encrypt\n\t\t\t\t);\n\t\t\t\t\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t// throw new Exception(\"Invalid user logged in.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$decode)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Invalid user logged in.\");\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "function is_authenticated()\n{\n global $app;\n return (is_object($app->auth) && $app->auth->isValid());\n}", "public static function checkAuthentication() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::checkAuthentication();\t\t\n\t}", "public function authenticate() {\n\t\treturn FALSE;\n\t}" ]
[ "0.73547834", "0.7289918", "0.72547805", "0.7249486", "0.7117125", "0.70271903", "0.7021168", "0.69783115", "0.69510335", "0.6894084", "0.6894084", "0.688464", "0.68404955", "0.6837999", "0.68316936", "0.68278015", "0.6807058", "0.6797271", "0.67585087", "0.67386746", "0.67186683", "0.6693771", "0.66905946", "0.6682406", "0.6670702", "0.66514117", "0.66492", "0.6647172", "0.66194147", "0.66189295", "0.6618083", "0.66084236", "0.6603879", "0.65928274", "0.65472496", "0.6543918", "0.6538957", "0.6535441", "0.6535441", "0.65199435", "0.64977926", "0.64897895", "0.6481562", "0.64652586", "0.6465075", "0.6465075", "0.6459654", "0.6458589", "0.64542365", "0.6452119", "0.6447066", "0.6435776", "0.6434733", "0.6434668", "0.6429333", "0.6425819", "0.6417278", "0.64125866", "0.64021474", "0.6397786", "0.63970697", "0.6389821", "0.63845", "0.63736975", "0.6363955", "0.63415027", "0.63341093", "0.63215965", "0.6302885", "0.6300285", "0.6300193", "0.62967694", "0.62967694", "0.62967694", "0.62967694", "0.62760985", "0.62656575", "0.6264327", "0.62514776", "0.6250517", "0.62491584", "0.6239044", "0.62381023", "0.62281525", "0.62220937", "0.6221099", "0.6218263", "0.62101215", "0.618965", "0.61884737", "0.6184831", "0.61828905", "0.61764634", "0.6173436", "0.6172479", "0.61632526", "0.6153953", "0.6150908", "0.6150464", "0.6138251", "0.61314934" ]
0.0
-1
Return the Flickr user id of the current authenticated user. If the authentication info is incorrect, NULL will be returned.
public function getUserId() { $response = $this->execute(array('method' => 'flickr.auth.checkToken'), 60); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['auth']['user']['nsid']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAuthUserId() {\r\n global $app, $log;\r\n $email = $app->request->headers(\"PHP_AUTH_USER\");\r\n $password = $app->request->headers(\"PHP_AUTH_PW\");\r\n\r\n if ($email && $password) {\r\n $row = DB::queryFirstRow(\"SELECT * FROM users WHERE email=%s\", $email);\r\n if ($row && $row['password'] == $password) {\r\n return $row['ID'];\r\n }\r\n }\r\n\r\n $log->debug(\"BASIC authentication failed for user \" . $email . \" from \" . $_SERVER['REMOTE_ADDR']);\r\n $app->response->status(401);\r\n return FALSE;\r\n}", "public function getUserId() {\n\t\tif ($this->logged()) {\n\t\t\treturn $_SESSION['auth']['id'];\n\t\t}\n\t\treturn false;\n\t}", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public function getUserId()\r\n\t{\r\n\t\t$user = parent::getUser();\r\n\t\tif(!($user instanceof User))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $user->getId();\r\n\t}", "public function getUserId() {\n if (isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_USER_ID])) {\n return $_SESSION[self::SESSION_FIELD_USER_ID];\n } else {\n return null;\n }\n }", "public function getUserId(){\n \n if ($user = JWTAuth::parseToken()->authenticate()) {\n $userId = $user->id;\n return $userId;\n }\n }", "public function get_user_id();", "public static function getUserId(): ?string\n {\n if (Self::checkIsLogged()) {\n if (!isset($auth)) {\n $auth = new Auth(DbManager::openDB(), null, null, false);\n }\n return $auth->getUserId();\n } else {\n return null;\n }\n\n }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "public function getUserId()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $userId = $CI->session->userdata('user_id');\n return $userId;\n }\n }", "public function getUserId() {\n\t\t\tif ($this->getUser() !== null) {\n\t\t\t\treturn $this->getUser()->getId();\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public function getAuthUserId() {\n\t\treturn (!empty($this->authUserId)?$this->authUserId:Mage::getSingleton('admin/session')->getUser()->getId());\n\t}", "public function getUserId()\n {\n return $this->authenticator->getUserId();\n }", "public function getUserId() {\n\t\treturn $this->Session->read('UserAuth.User.id');\n\t}", "public function getUserIdFromAPI() {\n $facebook = $this->facebookService->getFacebook();\n $userId = $facebook->getUser();\n\n if ($userId) {\n try {\n // Proceed knowing you have a logged in user who's authenticated.\n $user_profile = $facebook->api('/me');\n } catch (FacebookApiException $e) {\n error_log($e);\n $userId = null;\n }\n }\n return $userId;\n }", "public function id()\n {\n if ($this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n return null;\n }", "public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }", "public static function getUserId() {\n if(self::$_identity) {\n return self::$_identity->userid;\n }\n return null;\n }", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function get_user_id()\n {\n return self::getUser();\n }", "public function user_id()\n\t{\n\t\tif ($this->logged_in())\n\t\t{\n\t\t\treturn $this->_facebook->getUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->login_url();\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }", "function getAuthenticatedUser()\n {\n if (isset($_SESSION['MFW_authenticated_user'])) {\n return $_SESSION['MFW_authenticated_user'];\n }\n\n return null;\n }", "public function getUserID($context)\n {\n if(isset($context['user'])) {\n return $context['user']->id;\n }\n if(isset($context['user_id'])) {\n return $context['user_id'];\n }\n if(isset($GLOBALS['current_user'])) {\n return $GLOBALS['current_user']->id;\n }\n return null;\n }", "public function getUserId() {\n return $this->user === null ? null : $this->user->id;\n }", "public function getLoginUserId(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity())\n {\n return $loginUserId = $auth->getStorage()->read()->id;\n }\n }", "protected function getUserId(): int|string|null\n {\n if (!isset($this->userId)) {\n $this->userId = Auth::guard(config('nova.guard'))->id() ?? null;\n }\n\n return $this->userId;\n }", "public function getUserId()\r\r\n {\r\r\n return $this->signedRequest ? $this->signedRequest->getUserId() : null;\r\r\n }", "public function get_id_user()\n {\n return (isset($this->_id_user)) ? $this->_id_user : null;\n }", "static public function get_user_id()\n\t{\n\t\tif (isset($_SESSION[self::$cookie_name_prefix .self::USER_ID]))\n\t\t\treturn $_SESSION[self::$cookie_name_prefix .self::USER_ID];\n\t\telse\n\t\t\treturn null;\n\t}", "public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}", "public static function getCurrentUserId(){\n $user_data = parent::getSession('curent_user');\n $_get_id_user = isset($_GET['id_user']) ? $_GET['id_user'] : null;\n $_post_id_user = isset($_POST['id_user']) ? $_POST['id_user'] : null;\n return\n self::is_SuperUserSession()\n ? ($_post_id_user ? $_post_id_user : ( $_get_id_user ? $_get_id_user : $user_data['id_user'] ))\n : parent::getSession('id_user');\n }", "function user_id() {\n isset($this->_user_id) || $this->_load_from_session();\n return $this->_user_id;\n }", "public static function getLoggedInUserId(): ?int\n {\n // Check whether user is logged in\n if (!self::loggedIn()) {\n return null;\n }\n // If loggedIn return ID\n return self::getUser()->id;\n }", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public static function resolveId()\n\t{\n\t\treturn auth()->guard('api')->check() ? auth()->guard('api')->user()->getAuthIdentifier() : null;\n\t}", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserID() {\n\t\treturn $this->_user_id;\n\t}", "function get_current_user_id()\n {\n }", "public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }", "public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}", "public static function resolveId()\n {\n return Auth::check() ? Auth::user()->getAuthIdentifier() : null;\n }", "protected static function getUserID()\r\n {\r\n $userID = \\CAT\\Helper\\Validate::sanitizePost('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = \\CAT\\Helper\\Validate::sanitizeGet('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = self::router()->getParam(-1);\r\n\r\n if(!$userID || !is_numeric($userID) || !\\CAT\\Helper\\Users::exists($userID))\r\n Base::printFatalError('Invalid data')\r\n . (self::$debug ? '(\\CAT\\Backend\\Users::getUserID())' : '');;\r\n\r\n return $userID;\r\n }", "public function getUserId()\n {\n return (int) $this->_getVar('user_id');\n }", "public static function getUserId()\n {\n // sfGuardPlugin detection and guard user id retrieval\n $session = sfContext::getInstance()->getUser();\n if (class_exists('sfGuardSecurityUser') && $session instanceof sfGuardSecurityUser && method_exists($session, 'getGuardUser'))\n {\n $guard_user = $session->getGuardUser();\n if (!is_null($guard_user))\n {\n $guard_user_id = $guard_user->getId();\n if (!is_null($guard_user_id))\n {\n return $guard_user_id;\n }\n }\n }\n\t\treturn null;\n\t}", "public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}", "public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "static public function getUserId(){\n if (!isset($_SESSION['id']) || empty($_SESSION['id']) ){\n return false;\n } else {\n return $_SESSION['id'];\n }\n }", "private function getUserID($auth) {\r\n $username = explode(\":\", base64_decode(substr($auth, 6)))[0];\r\n $sql = \"SELECT * FROM databaseuser WHERE username = '{$username}' LIMIT 1\";\r\n $result_array = DatabaseUser::find_by_sql($sql);\r\n $userId = array_shift($result_array)->id;\r\n return $userId;\r\n }", "public function getUserID () {\n return $this->id;\n }", "public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }", "public function getSystemUserId()\n {\n $systemUser = $this->getSystemUser();\n\n if (is_null($systemUser)) {\n return $systemUser;\n }\n\n try {\n if (is_array($systemUser)) {\n if (isset($systemUser['id'])) {\n return $systemUser['id'];\n }\n }\n\n throw new \\Exception('No `id` found for the authenticated system user.');\n } catch (\\Exception $e) {\n $this->reportException($e);\n }\n\n return null;\n }", "public function getLoginUserId(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity())\n {\n return $loginUserId = $auth->getStorage()->read()->id;\n }else{\n\t\t\treturn 1;\n\t\t}\n }", "public function getUserId()\n {\n return $this->accessToken->user_id;\n }", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "public function user_id()\n {\n if($this->logged_in())\n {\n $this->uid = $this->fb->getUser();\n\n return $this->uid;\n } \n else \n {\n return FALSE;\n }\n }", "public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }", "public function getUserId()\n {\n $this->checkIfKeyExistsAndIsInteger('user_id');\n\n return $this->data['user_id'];\n }", "public function getUserId()\n {\n if ($this->validateUser()) {\n return $this->user->getId();\n }\n\n return false;\n }", "public function get_logged_in_user_id()\n\t\t{\n\t\t\treturn $this->session->userdata('usr_id');\n\t\t}", "public function getUid()\n {\n if (true === is_array($this->auth) && true === isset($this->auth[1])) {\n return $this->auth[1];\n }\n\n return null;\n }", "function getMyID()\n{\n $ci =& get_instance();\n $user = $ci->ion_auth->user()->row();\n if(isset($user->id)) {\n return $user->id;\n }else{\n \treturn null;\n }\n}", "public function getUserId()\n {\n if (array_key_exists(\"userId\", $this->_propDict)) {\n return $this->_propDict[\"userId\"];\n } else {\n return null;\n }\n }", "protected function userID ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n //var_dump($datosUsers);\n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n $id=0;\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n return $id; \n } \n }", "public static function GetUserID()\n\t{\n\t\treturn self::GetFB()->getUser();\n\t}", "public function getLoggedUserId()\n {\n if (isset($this->user_data['id_user'])) {\n return intval($this->user_data['id_user']);\n } else {\n return false;\n }\n }", "public function get_user_id( $context = 'view' ) {\n\t\treturn $this->get_prop( 'user_id', $context ) ;\n\t}", "public static function GetCurrentUserId() {\n try {\n $token = Helper::GetCookies('token');\n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if(!isset($token) || $token == '' || $token == null) {\n return 0;\n }\n else {\n $userDB = DB::table('users')\n ->where('token', $token)\n ->where('timeout', '>=', $now)\n ->where('deleted_at', null)\n ->select('id')\n ->get()->toArray();\n if (isset($userDB) && !empty($userDB)) {\n return $userDB[0]->id;\n }\n }\n return 0;\n }\n catch(Exception $e) {\n throw $e;\n }\n }", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public static function get_current_user_id() {\n\n if( is_user_logged_in() ) {\n return get_current_user_id();\n }\n\n return false;\n }", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "private static function get_current_user_id() {\r\n\t\t//print_r($_SESSION);\r\n\t\t$mysqli = Database::connection();\r\n\t\tif (!isset($_SESSION['user_id']) || !is_numeric($_SESSION['user_id'])) {\r\n\t\t\t//Check for a cookie\r\n\t\t\tif (!empty($_COOKIE['token']) && is_numeric($_COOKIE['user_id'])) {\r\n\t\t\t\t$token = $_COOKIE['token'];\r\n\t\t\t\t$user_id = $_COOKIE['user_id'];\r\n\t\t\t\t$sql = \"SELECT token FROM users WHERE user_id = '$user_id'\";\r\n\t\t\t\t$result = $mysqli->query($sql)\r\n\t\t\t\tor die($mysqli->error);\r\n\t\t\t\tif ($result->num_rows == 1) {\r\n\t\t\t\t\t//Attempt to verify the token\r\n\t\t\t\t\t$token_hashed = mysqli_fetch_row($result)[0];\r\n\t\t\t\t\t$verify = password_verify($token, $token_hashed);\r\n\t\t\t\t\tif ($verify) {\r\n\t\t\t\t\t\t//Create the session again\r\n\t\t\t\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t\t\t\t\treturn $user_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn 'None';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn 'None';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 'None';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn $_SESSION['user_id'];\r\n\t\t}\r\n\t}", "protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }", "public function getUserId()\n {\n return $this->idTokenClaims[$this->userIdKey] ?? null;\n }", "public function getCurrentUserId();", "public function identity()\r\n {\r\n\t\t$storage = $this->get_storage();\r\n\r\n if ($storage->is_empty()) {\r\n return null;\r\n }\r\n if( is_null(self::$login_user) ){\r\n $u = $storage->read();\r\n\t\t\tself::$login_user = Model_User::instance()->user($u['uid']);\r\n \r\n global $VIEW_AUTH_USERID;\r\n $VIEW_AUTH_USERID = idtourl(self::$login_user['uid']);\r\n }\r\n return self::$login_user; \r\n }", "public function getUserLoginId()\n {\n if ($this->_hasVar('user_login_id')) {\n return $this->_getVar('user_login_id');\n }\n return 0;\n }", "public function getUserID() {\n if($this->oa_user_id)\n return $this->oa_user_id;\n\n $response = $this->_connectAndGrabUserData();\n\n if($response) {\n $this->oa_user_id = $response['id'];\n\n return $this->oa_user_id;\n }\n\n return false;\n }", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "public function get_user_id() {\n\t\treturn $this->user_id;\n\t}", "public function getUserID() {\n\t\t\treturn $this->iUser; \t\n\t\t}", "function get_current_user_id(){\n\t\t$sd=$this->session->all_userdata();\n\t\t$fa=$sd['flexi_auth'];\n\t\t//$this->firephp->log($fa);\n\t\t//$this->firephp->log($fa['user_id']);\n\t\t//$this->firephp->log(\"Current user= \".intval($fa['user_id']));\n\t\treturn $fa['user_id'];\n\t}", "protected static function getCurrentUserId()\n {\n return null;\n }", "protected function _getLogedUserId()\r\n\t{\r\n\t\t// check if user is authenticated\r\n\t\tif (!Zend_Registry::get('Authenticated')) {\r\n\t\t\tthrow new Exception('User not authenticated!');\r\n\t\t}\r\n\t\t$user = Zend_Registry::get('User');\r\n\t\treturn $user->Id;\r\n\t}", "private function getLoggedInUser()\n {\n if (null !== $token = $this->securityContext->getToken()) {\n return $token->getUser();\n }\n\n return null;\n }", "public function getUserFromAuth() {\n\n $auth = Zend_Auth::getInstance();\n $identity = $auth->getIdentity();\n\n return $identity;\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUser_ident()\n {\n return $this->user_ident;\n }", "public static function getUserId() {\n $returnValue = 0;\n if (isset($_SESSION[\"userid\"])) {\n $returnValue = $_SESSION[\"userid\"];\n }\n return $returnValue;\n }", "function getLoggedInId()\n{\n\tif(isLoggedIn()) {\n\t\treturn auth()->user()->id;\n\t}\n\treturn null;\n}" ]
[ "0.72362965", "0.72320545", "0.7120621", "0.7111939", "0.70952225", "0.7031982", "0.70226246", "0.7022301", "0.7006451", "0.6980121", "0.6977634", "0.696011", "0.6945364", "0.6943848", "0.69334257", "0.6903515", "0.6890438", "0.6879291", "0.6871221", "0.6869946", "0.68442464", "0.68398803", "0.6829923", "0.68156683", "0.68150985", "0.68129283", "0.68095315", "0.6802125", "0.67931044", "0.67908686", "0.6788574", "0.67851424", "0.67717767", "0.6769198", "0.67526025", "0.6732692", "0.6721793", "0.6710186", "0.6710186", "0.6710186", "0.6709765", "0.6702687", "0.6702132", "0.6698245", "0.6698245", "0.6698245", "0.66980034", "0.669197", "0.66864765", "0.66819996", "0.6680463", "0.66738826", "0.6658728", "0.6650534", "0.663777", "0.663473", "0.66318715", "0.66279715", "0.66229266", "0.6619358", "0.66122705", "0.661079", "0.6609746", "0.65939677", "0.65900034", "0.65869194", "0.65757126", "0.6569327", "0.6560029", "0.65592545", "0.65499705", "0.6549788", "0.65452605", "0.65401715", "0.65345424", "0.65342844", "0.6528384", "0.65200466", "0.6476816", "0.64625543", "0.64554036", "0.6454788", "0.64509696", "0.64490455", "0.6446532", "0.6444508", "0.6442715", "0.6437785", "0.6426353", "0.64225394", "0.6420179", "0.6417937", "0.6411239", "0.6405653", "0.6404203", "0.63924325", "0.63924325", "0.6388531", "0.63859916", "0.63852876" ]
0.7762619
0
Request a frob used to get a token.
function requestFrob() { $response = $this->execute(array('method' => 'flickr.auth.getFrob', 'perms' => 'delete'), 60); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['frob']['_content']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "public function request_token() : object\n {\n $this->parameters = [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n 'User-Agent' => $this->config['DISCOGS_USER_AGENT'],\n 'Authorization' => 'OAuth oauth_consumer_key=' . $this->config['DISCOGS_CONSUMER_KEY']\n . ',oauth_nonce=' . time() . ',oauth_signature=' . $this->config['DISCOGS_CONSUMER_SECRET']\n . '&,oauth_signature_method=PLAINTEXT,oauth_timestamp=' . time() . ',oauth_callback='\n . $this->config['OAUTH_CALLBACK'],\n ],\n ];\n\n return $this->response('GET', \"/oauth/request_token\");\n }", "protected function request_token() {\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/request_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_callback' => SocialHelper::php_self()\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$_SESSION['oauth'] = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->authorize();\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}", "function getRequestToken() {\n\t\t$r = $this->oAuthRequest ( $this->requestTokenURL () );\n\t\t$token = $this->oAuthParseResponse ( $r );\n\t\t$this->token = new OAuthConsumer ( $token ['oauth_token'], $token ['oauth_token_secret'] );\n\t\treturn $token;\n\t}", "public function getTokenFromFrob($frob) {\n $response = $this->execute(array('method' => 'flickr.auth.getToken', 'frob' => $frob), 5);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['auth']['token']['_content'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n }", "public function request_token() {\n\t\tif ($this->token->validate(\"request_token\")) {\n\t\t\t$co = new Config();\n\t\t\t$co->setPackageObject(Package::getByHandle('rest_wordpress'));\n\t\t\t$wp_rest_api_url = $co->get('WP_REST_API_URL');\n\t\t\t$oauth_key = $co->get('WP_REST_API_OAUTH_KEY');\n\t\t\t$oauth_secret = $co->get('WP_REST_API_OAUTH_SECRET');\n\t\t\t\n\t\t\t// Get Zend_Oauth_Consumer object\n\t\t\t$consumer = $this->getOauthConsumer($wp_rest_api_url, $oauth_key, $oauth_secret);\n\t\t\t\n\t\t\tif (is_object($consumer)) {\n\t\t\t\ttry {\n\t\t\t\t\t// Get Zend_Oauth_Token_Request object\n\t\t\t\t\t$token = $consumer->getRequestToken();\n\t\t\t\t\t$this->set('token', $token);\n\t\t\t\t\t$_SESSION['REQUEST_TOKEN'] = serialize($token);\n\t\t\t\t\t$consumer->redirect(array(\n\t\t\t\t\t\t'oauth_callback' => $this->getCollbackUrl()\n\t\t\t\t\t));\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tthrow new Exception($e->getMessage());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->redirect('/dashboard/wp_rest_api/settings','required');\n\t\t\t}\n\t\t} else {\n\t\t\t$this->set('error', array($this->token->getErrorMessage()));\n\t\t}\n\t}", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function request_token() {\n $this->sign_secret = $this->consumer_secret.'&';\n\n if (empty($this->oauth_callback)) {\n $params = [];\n } else {\n $params = ['oauth_callback' => $this->oauth_callback->out(false)];\n }\n\n $params = $this->prepare_oauth_parameters($this->request_token_api, $params, 'GET');\n $content = $this->http->get($this->request_token_api, $params, $this->http_options);\n // Including:\n // oauth_token\n // oauth_token_secret\n $result = $this->parse_result($content);\n if (empty($result['oauth_token'])) {\n throw new moodle_exception('oauth1requesttoken', 'core_error', '', null, $content);\n }\n // Build oauth authorize url.\n $result['authorize_url'] = $this->authorize_url . '?oauth_token='.$result['oauth_token'];\n\n return $result;\n }", "public function get_request_token($callback);", "private function tokenRequest() \n {\n $url='https://oauth2.constantcontact.com/oauth2/oauth/token?';\n $purl='grant_type=authorization_code';\n $purl.='&client_id='.urlencode($this->apikey);\n $purl.='&client_secret='.urlencode($this->apisecret);\n $purl.='&code='.urlencode($this->code);\n $purl.='&redirect_uri='.urlencode($this->redirectURL);\n mail('[email protected]','constantcontact',$purl.\"\\r\\n\".print_r($_GET,true));\n $response = $this->makeRequest($url.$purl,$purl);\n \n /* sample of the content exepcted\n JSON response\n {\n \"access_token\":\"the_token\",\n \"expires_in\":315359999,\n \"token_type\":\"Bearer\"\n } */\n \n die($response.' '.$purl);\n $resp = json_decode($response,true);\n $token = $resp['access_token'];\n \n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n //delete any old ones\n $query = $db->prepare('DELETE FROM ctct_email_cache WHERE email LIKE :token;');\n $query->execute(array('token' => 'token:%'));\n\n //now save the new token\n $query = $db->prepare('INSERT INTO ctct_email_cache (:token);');\n $query->execute(array('token' => 'token:'.$token));\n\n $this->token=$token;\n return $token;\n }", "function requestToken() {\n\t\t$conn = new Connection('DB-Name');\n\n\t\t//instantiate login information, api_key, username, and password\n\t\t$api = $conn->tokenGrab(x);\n\t\t$user = $conn->tokenGrab(x);\n\t\t$pass = $conn->tokenGrab(x);\n\n\t\t//build fields to send to the token giver\n\t\t$fields = array(\n\t\t\t'grant_type' \t=> urlencode('password')\n\t\t\t, 'client_id' \t=> urlencode($api)\n\t\t\t, 'username' \t=> urlencode($user)\n\t\t\t, 'password'\t=> urlencode($pass));\n\n\t\t$fields_string = '';\n\t\tforeach ($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//send the request to token giver via cURL\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $conn->tokenGrab(x));\n\t\tcurl_setopt($ch, CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t 'Content-Type' => urlencode('application/x-www-form-urlencoded')\n\t\t\t, 'Content-Length' => urlencode(strlen($fields_string))\n\t\t));\n\n\t\t$cherwellApiResponse = json_decode(curl_exec($ch), TRUE);\n\t\treturn $cherwellApiResponse['access_token'];\n\t}", "public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken($secret, $frob = null, array $options = array())\n {\n static $method = 'flickr.auth.getToken';\n $defaultOptions = array(\n \t'frob' => (null !== $frob) ? $frob : ($frob = $this->getFrob($secret))\n );\n\n $options = $this->_prepareOptions($method, $options, $defaultOptions);\n $options = $this->signOptions($secret, $options);\n\n // now search for photos\n $restClient = $this->getRestClient();\n $restClient->getHttpClient()->resetParameters();\n $response = $restClient->restGet('/services/rest/', $options);\n\n if ($response->isError()) {\n /**\n * @see Zend_Service_Exception\n */\n require_once 'Zend/Service/Exception.php';\n throw new Zend_Service_Exception('An error occurred sending request. Status code: '\n . $response->getStatus());\n }\n\n $dom = new DOMDocument();\n $dom->loadXML($response->getBody());\n\n self::_checkErrors($dom);\n \n return new Gtwebdev_Service_Flickr_Auth($dom, $this);\n }", "public function getRequestToken()\n\t{\n\t\tif(!$this->hasRequestToken()){\n\t\t\t//reset all the parameters\n\t\t\t$this->resetParams();\n\t\t\t\n\t\t\t// make signature and append to params\n\t\t\t//$this->setSecret($this->_consumerSecret);\n\t\t\t$this->setRequestUrl($this->_requestTokenUrl);\n\t\t\t$this->_buildSignature();\n\t\t\t\n\t\t\t//get the response\n\t\t\t$response = $this->_send($this->_requestTokenUrl)->getBody();\n\t\t\t\n\t\t\t//format the response\n\t\t\t$responseVars = array();\n\t\t\tparse_str($response, $responseVars);\n\t\t\t$response = new BaseOAuthResponse($responseVars);\n\t\t\t$this->setRequestToken($response);\n\t\t}\n\t\t\n\t\t//send the query\n\t\treturn $this->getData('request_token');\n\t}", "public function token()\n {\n\n\t\t$this->server->handleTokenRequest(OAuth2\\Request::createFromGlobals())->send();\n }", "private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }", "public function getRequestToken($request_token_url, $callback_url = null, $http_method = 'GET') {}", "private function getRequestToken() {\n \n // send request for a request token\n $this->tmhOAuth->request('POST', $this->tmhOAuth->url('oauth/request_token', ''), array(\n\n // pass a variable to set the callback\n 'oauth_callback' => $this->tmhOAuth->php_self()\n ));\n\n\n if($this->tmhOAuth->response['code'] == 200) {\n\n // get and store the request token\n $response = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\n\t error_log($response);\n $_SESSION['authtoken'] = $response['oauth_token'];\n $_SESSION['authsecret'] = $response['oauth_token_secret'];\n\n // state is now 1\n $_SESSION['authstate'] = 1;\n\n // redirect the user to Twitter to authorize\n $url = $this->tmhOAuth->url('oauth/authorize', '') . '?oauth_token=' . $response['oauth_token'];\n header('Location: ' . $url);\n exit;\n }\n\n return false;\n }", "public function requestToken() {\n\t\t$this->verify(false);\n\n\t\t// Optional TTL\n\t\t$options = array();\n\t\t$ttl = $this->getParam(self::XOAUTH_TOKEN_TTL, false);\n\t\tif($ttl) {\n\t\t\t$options['token_ttl'] = $ttl;\n\t\t}\n\n\t\t// 1.0a Compatibility : associate callback url to the request token\n\t\t$callbackUrl = $this->getParam(self::OAUTH_CALLBACK, true);\n\t\tif($callbackUrl) {\n\t\t\t$options['callback_url'] = $callbackUrl;\n\t\t}\n\n\t\t// Create a request token\n\t\t$consumerKey = $this->getParam(self::OAUTH_CONSUMER_KEY, true);\n\n\t\tif(! isset($this->storages['request_token'])) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t'You must supply a storage object implementing ' .\n\t\t\t\t\t $this->storageMap['request_token']);\n\t\t}\n\n\t\t// MUST be included with an empty value to indicate this is a two-legged request.\n\t\t$is2Legged = $this->getParam(self::OAUTH_CALLBACK) === '';\n\t\tif($is2Legged) {\n\t\t\t// Create pre-authorized request token\n\t\t}\n\n\t\t$requestToken = $this->storages['request_token']->createRequestToken($consumerKey,\n\t\t\t$options);\n\n\t\t$data = [];\n\t\t$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($requestToken['token']);\n\t\t$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode(\n\t\t\t$requestToken['token_secret']);\n\t\t$data[self::OAUTH_CALLBACK_CONFIRMED] = '1';\n\n\t\tif(! empty($requestToken['expires_at']) && is_numeric($requestToken['expires_at'])) {\n\t\t\t$expiresAt = Carbon::createFromTimestamp(intval($requestToken['expires_at']));\n\n\t\t\t$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function getOAuthRequestToken()\n\t{\n\t\t$params = $this->getParams();\n\t\t$consumerKey = $params->get('oauth_consumer_key');\n\t\t$app = JFactory::getApplication();\n\t\t$tokenParams = array(\n\t\t\t'oauth_callback' => OAUTH_CALLBACK_URL,\n\t\t\t'oauth_consumer_key' => $consumerKey\n\t\t);\n\n\t\t$curlOpts = $this->getOAuthCurlOpts();\n\n\t\t$tokenResult = XingOAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', array(), $curlOpts);\n\t\t$requestOpts = array('http_error_codes' => array(200, 201));\n\t\t//$tokenResult = OAuthRequester::requestRequestToken($consumerKey, 0, $tokenParams, 'POST', $requestOpts, $curlOpts);\n\t\t$uri = OAUTH_AUTHORIZE_URL . \"?btmpl=mobile&oauth_token=\" . $tokenResult['token'];\n\t\t$app->redirect($uri);\n\t}", "abstract public function getAuthToken();", "function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t} \n\t\t$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);\n\t\t$token = OAuthUtil::parse_parameters($request);\n\t\t$this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);\n\t\treturn $token;\n\t}", "protected function get_token()\n\t{\n\t\t$args = func_get_args();\n\t\t$url = \"\";\n\t\t$auto_load_response = false;\n\n\t\tforeach ($args as $v)\n\t\t{\n\t\t\tif (is_string($v))\n\t\t\t{\n\t\t\t\t$url = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_bool($v))\n\t\t\t{\n\t\t\t\t$auto_load_response = $v;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (!$url)\n\t\t{\n\t\t\ttrigger_error(\"Method get_token expects a url.\");\n\t\t}\n\n\t\t$this->execute_request($this->auth_http_method == SPOAuthClient::HTTP_AUTH_HEADER ? SPOAuthClient::HTTP_AUTH_GET : $this->auth_http_method, $url);\n\n\t\t//! remove oauth_token and oauth_secret, they will be loaded (if any returned) in the next lines of code)\n\t\t$this->oauth_token = null;\n\t\t$this->oauth_token_secret = null;\n\t\t$this->__oauth_access_token = null;\n\n\t\tif ($auto_load_response && $this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\t$response_data = SPUtils::parse_query($this->http_response_body);\n\n\t\t\tif (is_array($response_data))\n\t\t\t{\n\t\t\t\tforeach ($response_data as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$this->__oauth[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->http_response_code == SPConstants::HTTP_OK)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function getTokenRequest($options)\n {\n // unbox the parameters from the associative array\n $token_id = array_key_exists('token_id', $options) ? $options['token_id'] : null;\n\n // verify the required parameter 'token_id' is set\n if ($token_id === null || (is_array($token_id) && count($token_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $token_id when calling getToken'\n );\n }\n\n $resourcePath = '/tokens/{token_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($token_id !== null) {\n $resourcePath = str_replace(\n '{' . 'token_id' . '}',\n ObjectSerializer::toPathValue($token_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function makeAuth()\n {\n $url = $this->environment->getApiUrl() . \"auth/oauth/v2/token\";\n\n $client = new Client();\n\n try {\n $guzzleReturn = $client->request('POST', $url, [\n 'headers' => [\n 'Authorization' => 'Basic ' . $this->authString\n ],\n 'form_params' => [\n 'scope' => 'oob',\n 'grant_type' => 'client_credentials',\n ]\n ]);\n\n $return = json_decode($guzzleReturn->getBody(), true);\n\n $this->getnetResponse = new GetNetResponse(true, $guzzleReturn->getStatusCode(), '');\n\n $this->accessToken = $return['access_token'];\n $this->tokenType = $return['token_type'];\n $this->expiresIn = $return['expires_in'];\n $this->scope = $return['scope'];\n\n } catch (RequestException $e) {\n $this->getnetResponse = new GetNetResponse(false, $e->getCode(), $e->getMessage());\n }\n\n return $this;\n }", "public function requestAction() {\n $this->api->login('request')->post()->loadTokenFromResponse();\n $_SESSION['request_token'] = $this->api->getOAuthToken();\n return $this->api->goRedirect('login');\n }", "private function get_token() {\n $uri = $this->settings->hostname.\"oauth/token\";\n //echo \"POST $uri\\n\";\n\n $data = array(\n \"grant_type\" => \"password\",\n \"client_id\" => $this->settings->client_id,\n \"client_secret\" => $this->settings->client_secret,\n \"username\" => $this->settings->username,\n \"password\" => $this->settings->password\n );\n $postdata = http_build_query($data);\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $uri);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/x-www-form-urlencoded'));\n\n $curl_response = curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $curl_error_number = curl_errno($ch);\n $curl_error = curl_error($ch);\n\n //echo $curl_response.\"\\n\"; // output entire response\n //echo $http_code.\"\\n\"; // output http status code\n\n curl_close($ch);\n $token = NULL;\n if ($http_code == 200) {\n $token = json_decode($curl_response);\n //var_dump($token); // print entire token object\n }\n return $token;\n }", "public function getTokenCurrentRequest($options)\n {\n // unbox the parameters from the associative array\n\n\n $resourcePath = '/tokens/self';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function issueRequestToken()\n {\n // 2legged OAuth\n $this->authenticate();\n\n // Check parameter\n $this->getRequest()->checkParameters(self::$_3l_request_params);\n $callback = $this->getRequest()->getParameter('oauth_callback');\n if (!preg_match('#^https?://.#', $callback)) {\n throw new HTTP_OAuthProvider_Exception('400 oauth_callback is not correct: '.$callback, 400);\n }\n\n // make token\n $store = $this->getStore();\n $store->issueRequestToken($this);\n $ok = $store->save();\n if (!$ok) {\n throw new HTTP_OAuthProvider_Exception('500 Store error', 500);\n }\n\n // response\n $resp = array(\n 'oauth_token' => $store->getToken(),\n 'oauth_token_secret' => $store->getSecret(),\n 'oauth_callback_confirmed' => 'true'\n );\n return http_build_query($resp);\n }", "public function createTokenRequest($options)\n {\n // unbox the parameters from the associative array\n\n\n $resourcePath = '/tokens';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function request()\n\t{\n\t\treturn Phpfox::getLib('request');\t\n\t}", "public function fetch_request_token(&$request) {\n $this->get_version($request);\n\n $consumer = $this->get_consumer($request);\n\n // no token required for the initial token request\n $token = NULL;\n\n $this->check_signature($request, $consumer, $token);\n\n // Rev A change\n $callback = $request->get_parameter('oauth_callback');\n $new_token = $this->data_store->new_request_token($consumer, $callback);\n\n return $new_token;\n }", "public function getOAuthToken(Request $request)\n {\n $bridgedRequest = \\OAuth2\\HttpFoundationBridge\\Request::createFromRequest($request->instance());\n\n $bridgedResponse = new \\OAuth2\\HttpFoundationBridge\\Response();\n\n /*Log::info('$bridgedRequest'. print_r($bridgedRequest, true));\n Log::info('$bridgedResponse'. print_r($bridgedResponse, true));*/\n\n\n $bridgedResponse = \\App::make('oauth2')->handleTokenRequest($bridgedRequest, $bridgedResponse);\n\n return $bridgedResponse;\n }", "public function getToken()\n\t{\n\n\t}", "public function getToken()\n\t{\n\t\t$this->setCurlHeaders(false);\n\t\t\n\t\t$request_params = array\n\t\t(\n\t\t\t'client_key' => $this->client_key,\n\t\t\t'client_secret' => $this->client_secret\n\t\t);\n\t\t\n\t\treturn $this->makeCurlRequest($this->public_api_url . \"v1/token/generate\", false, \"POST\", $request_params);\n\t}", "public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n )),\n 'code' => $code\n );\n $client->setUri(self::OAUTH_CALLBACK);\n $client->setParameterGet($queryParams);\n\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) {\n return;\n }\n\n $result = Zend_Json::decode($response->getBody());\n if (isset($result['access_token'])) {\n $token = $result['access_token'];\n return $token;\n }\n return;\n }", "public function token()\n {\n $token = null;\n if (!empty(getallheaders()['Authorization'])) {\n $token = getallheaders()['Authorization'];\n }\n\n if (!$token) {\n $token = $this->request->query->get('token');\n }\n\n if (!$token) {\n throw new \\Exception(\"'token' is required in URL or header Authorization\");\n }\n\n return $token;\n\n }", "public function getToken()\n {\n $params = array(\n 'client_id' => $this->client_id,\n 'client_secret' => $this->client_secret,\n 'code' => $this->code,\n 'redirect_uri' => $this->redirect_uri\n );\n $res = $this->getRequest('oauth/access_token',$params);\n //$token = $res['access_token'];\n return $this->res = $res;\n\n\n }", "public function getToken()\n\t{\n\t\treturn static::createFormToken($this->target_form_id ? $this->target_form_id : $this->id);\n\t}", "public function getRequestToken($oauth_callback = NULL) {\n\t\t$parameters = array();\n\t\tif (!empty($oauth_callback)) {\n\t\t\t$parameters['oauth_callback'] = $oauth_callback;\n\t\t}\n\t\ttry {\n\t\t\t$request = $this->fetch(self::URI_REQUEST_TOKEN, $parameters);\n\t\t\t$token = DropBox_OAuthUtil::parse_parameters($request['body']);\n\t\t\t$this->setToken($token['oauth_token'], $token['oauth_token_secret']);\n\t\t\treturn $token;\n\t\t} catch (DropBox_OAuthException $e) {\n\t\t\tthrow new Dropbox_Exception_RequestToken('We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.', 0, $e);\n\t\t}\n\t}", "function procapi_get_oauth2_client_token() {\n $server_domain = variable_get('procapi_procurios_server_domain');\n $client_id = variable_get('procapi_oauth_client_id');\n $client_secret = variable_get('procapi_oauth_client_secret');\n $scope = variable_get('procapi_oauth_scope', '');\n\n if (\n !empty($server_domain) &&\n !empty($client_id) &&\n !empty($client_secret) &&\n !empty($scope)\n ) {\n $oauth2_config = array(\n 'token_endpoint' => 'https://' . $server_domain . PROCAPI_OAUTH_TOKEN_PATH,\n 'auth_flow' => 'client-credentials',\n 'client_id' => $client_id,\n 'client_secret' => $client_secret,\n 'scope' => $scope,\n );\n\n try {\n $oauth2_client = new OAuth2\\ProcClient($oauth2_config, $client_id);\n $access_token = $oauth2_client->getAccessToken();\n }\n catch (Exception $e) {\n drupal_set_message($e->getMessage(), 'error');\n } \n if (!empty($access_token)) {\n return $access_token;\n }\n }\n drupal_set_message('Failed to get token from Procurios');\n return FALSE;\n}", "public function & GetRequest ();", "private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}", "public final function get($token)\n {\n }", "public function getToken()\n {\n // curl:Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld\n // flags:0\n // forcedownlevel:0\n // formdir:3\n // username:<xxx>\n // password:<password>\n // SubmitCreds:Aanmelden\n // trusted:0\n\n $client = new \\GuzzleHttp\\Client(['cookies' => true]);\n $response = $client->request('POST', $_ENV['HANZE_LOGON_URL'], [\n 'headers' => [\n 'Origin' => 'https://www.hanze.nl',\n 'Refer' => 'https://www.hanze.nl/CookieAuth.dll?GetLogon?curl=Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld&reason=0&formdir=3',\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'\n ],\n 'allow_redirects' => false,\n 'form_params' => [\n 'curl' => 'Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld',\n 'flags' => 0,\n 'forcedownlevel' => 0,\n 'formdir' => 3,\n 'username' => $_ENV['HANZE_USERNAME'],\n 'password' => $_ENV['HANZE_PASSWORD'],\n 'SubmitCreds' => 'Aanmelden',\n 'trusted' => 0\n ]\n ]);\n return $client; \n }", "function request_url($method){\r\n global $TOKEN;\r\n \r\n\treturn \"https://api.telegram.org/bot\" . $TOKEN . \"/\". $method;\r\n}", "private function get_token() {\n\n\t\t$query = filter_input( INPUT_GET, 'mwp-token', FILTER_SANITIZE_STRING );\n\t\t$header = filter_input( INPUT_SERVER, 'HTTP_AUTHORIZATION', FILTER_SANITIZE_STRING );\n\n\t\treturn ( $query ) ? $query : ( $header ? $header : null );\n\n\t}", "public function loadAccessToken()\n {\n $this->setHeader(self::HEADER_TYPE_BASIC, self::TOKEN_HEADER);\n\n $curl = new Curl;\n\n $opt = [\n 'grant_type' => $this->grant,\n 'username' => $this->username,\n 'password' => $this->password,\n 'scope' => $this->scope\n ];\n\n $token = $curl->post(self::BASE_API_URL.self::TOKEN_END_POINT, $opt, $this->getHeader());\n\n $this->saveAccessToken($token);\n }", "public function getToken(): TokenInterface;", "public function getToken(): TokenInterface;", "public function getPartnerRequestToken()\n {\n $uri = $this->urlRequestToken();\n\n $client = $this->createHttpClient();\n\n $header = $this->temporaryPartnerRequestTokenProtocolHeader($uri);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n //echo \"dump data\";\n //var_dump($data);\n\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n //echo 'DECODE<br/>';\n //echo \"oauth_token: \" . $oauth_token.'<br/>';\n //echo \"oauth_secret\" . $oauth_token_secret.'<br/>';\n\n\n\n //////////////////////////////\n $uri = $this->urlAccessToken();\n\n $client = $this->createHttpClient();\n\n $credentials = $this->createClientCredentials(['identifier' => $oauth_token, 'secret' => $oauth_token_secret]);\n\n $header = $this->temporaryPartnerAccessTokenProtocolHeader($uri, $credentials);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n //var_dump($e);\n //exit;\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n\n //echo \"final:<br/>\";\n //var_dump($data);\n $resp = $data;\n\n return $resp;\n }", "function ExchangeRequestForAccess()\n{\n $consumer_key = $_GET['consumer_key'];\n $oauth_token = $_GET['oauth_token'];\n $user_id = $_GET['usr_id'];\n\n try\n {\n OAuthRequester::requestAccessToken($consumer_key, $oauth_token, $user_id);\n }\n catch (OAuthException $e)\n {\n // Something wrong with the oauth_token.\n // Could be:\n // 1. Was already ok\n // 2. We were not authorized\n die($e->getMessage());\n }\n \n echo 'Authorization Given. <a href=\"index.php?action=Request\">Click to make a signed request</a>.';\n}", "public function gettoken()\n{\n if (isset($_GET['code'])) {\n // Check that state matches\n if (isset($_GET['state']) && isset($_SESSION['oauth_state'])) {\n if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth_state'])) {\n exit('State provided in redirect does not match expected value.');\n } \n // Clear saved state\n unset($_SESSION['oauth_state']); \n }\n\n // Initialize the OAuth client\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => $this->config->item('OAUTH_APP_ID'),\n 'clientSecret' => $this->config->item('OAUTH_APP_PASSWORD'),\n 'redirectUri' => $this->config->item('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => $this->config->item('OAUTH_AUTHORITY').$this->config->item('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => $this->config->item('OAUTH_SCOPES')\n ]);\n\n try {\n\n // Make the token request\n $accessToken = $oauthClient->getAccessToken('authorization_code', [\n 'code' => $_GET['code']\n ]);\n\n //echo 'Access token: '.$accessToken->getToken();\n return $accessToken->getToken();\n }\n catch (League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException $e) {\n exit('ERROR getting tokens: '.$e->getMessage());\n }\n exit();\n }\n elseif (isset($_GET['error'])) {\n exit('ERROR: '.$_GET['error'].' - '.$_GET['error_description']);\n }\n}", "private static function getGFusionOAuthRefreshToken() {\n\t\treturn '1/zuRSQC5Q12yBoJ1idPljEw4xlolOWXrp4hyoKSC1C2o';\n\t}", "public function get_request_token()\n {\n $sess_id = $_COOKIE[ini_get('session.name')];\n if (!$sess_id) $sess_id = session_id();\n $plugin = $this->plugins->exec_hook('request_token', array('value' => md5('RT' . $this->get_user_id() . $this->config->get('des_key') . $sess_id)));\n return $plugin['value'];\n }", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public static function getFastlinkToken()\n\t\t{\n\t\t\t$url = \"https://developer.api.yodlee.com/ysl/restserver/v1/user/accessTokens?appIds=10003600\";\n\n\t\t\t$curl = curl_init();\n\n\t\t\tcurl_setopt_array($curl, array(\n\t\t\t CURLOPT_SSL_VERIFYPEER => false,\n\t\t\t CURLOPT_URL => $url,\n\t\t\t CURLOPT_RETURNTRANSFER => 1,\n\t\t\t CURLOPT_TIMEOUT => 360,\n\t\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Authorization: {cobSession='.self::$cobSession.',userSession='.self::$userSession.'}'\n\t\t\t )\n\t\t\t));\n\n\t\t\t$response = json_decode(curl_exec($curl), TRUE);\n\n\t\t\tif ($response) {\n\t\t\t\tself::$fastlinkAppId = $response['user']['accessTokens'][0]['appId'];\n\t\t\t\tself::$fastlinkUrl = $response['user']['accessTokens'][0]['url'];\n\t\t\t\tself::$fastlinkValue = $response['user']['accessTokens'][0]['value'];\n\t\t\t}\n\t\t}", "private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }", "public function getRequestAuthorization(RequestInterface $request, AccessToken $token):RequestInterface;", "function new_request_token($consumer) {\n }", "function getRequest();", "public function getToken(){\n\n if( $this->hasToken() )\n return $this->token;\n\n $token = $this->asObj('/authorize', self::POST);\n\n if( $token and isset($this->data) )\n return new Token($token);\n\n throw new ClientException(\"Could not retrieve token. Please check your credentials and try again.\");\n\n }", "private function getToken()\n {\n\n try {\n $result = $this->makeRequest($this->api_url.'/token','POST', [],[\n 'Accept: application/json',\n 'ClientKey: ' . $this->client_key,\n 'ClientSecret: ' . $this->client_secret\n ]);\n $this->token = $result['body']['data'];\n return $this;\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n\n }", "public function token() {\n\t\t$this->autoRender = false;\n\t\t$this->OAuth->setVariable('access_token_lifetime', 60);\n\t\ttry {\n\t\t\t$this->OAuth->grantAccessToken();\n\t\t} catch (OAuth2ServerException $e) {\n\t\t\t$e->sendHttpResponse();\n\t\t}\n\t}", "public function token()\n {\n if( !isset( $this->config['oauth_id'] ) || !isset( $this->config['oauth_secret'] ) )\n $this->redirect( 'oauth' );\n\n // Skip if we're already set up\n if( isset( $this->config['oauth_id'] ) && isset( $this->config['oauth_secret'] ) && isset( $this->config['oauth_token'] ) )\n $this->redirect( '' );\n \n \n $this->url = $_SERVER['HTTP_HOST'].$this->baseURL;\n }", "public function getToken( $token = null )\n\t{\n if (is_null($token)) $this->app->abort(404);\n foreach($this->app['fluentkit.messages']->all() as $m){\n echo $m; \n }\n echo $this->app['form']->open(array('url' => 'login/token'));\n echo $this->app['form']->hidden('token', $token);\n echo $this->app['form']->label('email', 'Email Address');\n echo $this->app['form']->email('email', $this->app['request']->get('email'));\n echo $this->app['form']->label('password', 'Password');\n echo $this->app['form']->password('password', $this->app['request']->get('password'));\n echo $this->app['form']->label('password_confirmation', 'Password Confirmation');\n echo $this->app['form']->password('password_confirmation', $this->app['request']->get('password_confirmation'));\n echo $this->app['form']->submit('Reset Password');\n echo $this->app['form']->close();\n\t}", "public function createToken();", "abstract protected function token_url();", "public function newToken(Request $request)\n {\n// $forPage = $request->input('forPage');\n \n $applicationSid = config('services.twilio')['applicationSid'];\n $accountSid = config('services.twilio')['accountSid'];\n $authToken = config('services.twilio')['authToken'];\n // // $appSid = env('TWILIO_APPLICATION_SID');\n \n $clientToken = new ClientToken($accountSid,$authToken);\n \n $clientToken->allowClientOutgoing($applicationSid);\n\n // if ($forPage == '/cats') {\n $clientToken->allowClientIncoming('support_agent');\n // } else {\n // $clientToken->allowClientIncoming('customer');\n // }\n\n $token = $clientToken->generateToken();\n return response()->json($token);\n }", "#[\n OpenApi\\Operation(\n tags: ['Auth/Tokens'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: ShowAuthTokensParameters::class)]\n #[OpenApi\\Response(factory: TokenShowResponse::class, statusCode: 200)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[OpenApi\\Response(factory: NotFoundResponse::class, statusCode: 404)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function show(AuthToken $authToken) {\n $this->verifyNoDemo();\n\n $this->authorizeAnonymously('view', $authToken);\n\n return AuthTokenResource::make($authToken);\n }", "public function readToken() {}", "public function get_request_token()\n\t{\n\t\t$this->auth_user_authorized = false;\n\n\t\t$url = $this->auth_url_request;\n\n\t\t$this->get_token($url, true);\n\n\t\t//! we got token which needs to be authorized by external redirect\n\t\tif ($this->oauth_token)\n\t\t{\n\t\t\t$this->auth_oauth_response = SPOAuthClient::OAUTH_USER_AUTH;\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->auth_oauth_response = SPOAuthClient::OAUTH_RESPONSE_UNKNOWN;\n\t\treturn false;\n\t}", "function &get_gticket_token()\n{\n\tglobal $xoopsGTicket;\n\t$name = \"XOOPS_G_TICKET\";\n\tif ( is_object($xoopsGTicket) )\n\t{\n\t\t$salt = $this->_FORM_NAME;\n\t\t$val = $xoopsGTicket->issue( $salt );\n\t}\n\telse\n\t{\n\t\t$val = 0;\n\t}\n\t$arr = array($name, $val);\n\treturn $arr;\n}", "public static function get_oauth_token($auth) {\n\n\t\t$arraytoreturn = array();\n\n\t\t$output = \"\";\n\n\t\ttry {\n\n\t\t\t$ch = curl_init();\n\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://login.live.com/oauth20_token.srf\");\n\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\n\t\t\t\t'Content-Type: application/x-www-form-urlencoded',\n\n\t\t\t\t));\n\n\t\t\tcurl_setopt($ch, CURLOPT_POST, TRUE);\n\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\t\t\n\n\t\t\t$data = \"client_id=\".client_id.\"&redirect_uri=\".urlencode(callback_uri).\"&client_secret=\".urlencode(client_secret).\"&code=\".$auth.\"&grant_type=authorization_code\";\t\n\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n\t\t\t$output = curl_exec($ch);\n\n\t\t} catch (Exception $e) {\n\n\t\t}\n\n\t\n\n\t\t$out2 = json_decode($output, true);\n\n\t\t$arraytoreturn = Array('access_token' => $out2['access_token'], 'refresh_token' => $out2['refresh_token'], 'expires_in' => $out2['expires_in']);\n\n\t\treturn $arraytoreturn;\n\n\t}", "public function generateToken();", "public function access_token() {\n\t\ttry {\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\t$this->OAuth2Lib->grantAccessToken();\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}", "private function getRequestToken($request_token_uri) {\n $client = new Client($request_token_uri);\n $oauth = new OauthPlugin(array(\n 'consumer_key' => $this->consumer_key,\n 'consumer_secret' => $this->consumer_secret,\n ));\n $client->addSubscriber($oauth);\n\n $request = $client->get();\n $response = $request->send()->getBody(TRUE);\n\n $data = $this->parseResponse($response);\n return $data;\n }", "public function getToken() {\n return $this->accessToken;\n }", "public function resource(){\n\t\tif (!$this->server->verifyResourceRequest(OAuth2\\Request::createFromGlobals())) {\n\t\t $this->server->getResponse()->send();\n\t\t echo json_encode(array('status' => false, 'message' => 'NO ACCESS TOKEN'));\n\t\t die;\n\t\t}\t\t\n }", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function token(Request $request) {\n global $base_url;\n\n $payload = Json::decode($request->getContent());\n\n $response = \\Drupal::httpClient()->post($base_url . '/oauth/token', [\n 'verify' => TRUE,\n 'form_params' => [\n 'grant_type' => 'password',\n 'client_id' => $payload['client_id'],\n 'client_secret' => $payload['client_secret'],\n 'scope' => 'skyword',\n 'username' => 'admin',\n 'password' => 'drupaladm1n',\n ],\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ],\n ])->getBody()->getContents();\n\n return new JsonResponse(Json::decode($response));\n }", "function curl_getToken($login, $password)\n{\n $url = set_url('auth');\n $postRequest = \"grant_type=password&username={$login}&password={$password}\";\n\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $postRequest);\n curl_setopt($cURLConnection, CURLOPT_USERPWD, otomoto_api());\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n\n $apiResponse = json_decode(curl_exec($cURLConnection));\n\n curl_close($cURLConnection);\n\n $_SESSION['token'] = $apiResponse->access_token;\n}", "public function getRequest() {}", "public function getRequest() {}" ]
[ "0.7091383", "0.70495623", "0.6727452", "0.6679473", "0.6634289", "0.6550899", "0.64725983", "0.645734", "0.64572644", "0.6387603", "0.6317136", "0.6307831", "0.62783587", "0.62783587", "0.62783587", "0.62783587", "0.623214", "0.62187135", "0.61912924", "0.6168655", "0.61445355", "0.6092688", "0.6007463", "0.59871125", "0.59521025", "0.59338397", "0.5872288", "0.5853299", "0.58017546", "0.57856005", "0.5766967", "0.5745265", "0.5712956", "0.5705228", "0.5705228", "0.5705228", "0.5705228", "0.56812155", "0.5666403", "0.56521034", "0.5629512", "0.55971533", "0.5591443", "0.5586517", "0.5576715", "0.553674", "0.55032396", "0.55016154", "0.54988235", "0.5495565", "0.5493403", "0.54925257", "0.54899436", "0.5484255", "0.54781276", "0.5477504", "0.5472117", "0.54508", "0.54508", "0.5448367", "0.5445748", "0.5443074", "0.5438003", "0.5432083", "0.5420886", "0.5419107", "0.5416364", "0.54157573", "0.541556", "0.54065573", "0.539939", "0.53712785", "0.5360787", "0.5352661", "0.5351272", "0.53456515", "0.5341019", "0.53297365", "0.5325149", "0.53242326", "0.5321857", "0.5320761", "0.53203523", "0.5319986", "0.53156555", "0.5314823", "0.5306186", "0.530157", "0.5297661", "0.5297661", "0.5297661", "0.5297661", "0.5297661", "0.5297661", "0.5297661", "0.5297661", "0.529687", "0.52960306", "0.52869475", "0.52869475" ]
0.58748573
26
Set the auth token from a frob. The user needed to authenticate the frob.
public function getTokenFromFrob($frob) { $response = $this->execute(array('method' => 'flickr.auth.getToken', 'frob' => $frob), 5); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['auth']['token']['_content']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }", "function setAuthToken($AuthToken)\n {\n \t$this->_authToken =$AuthToken;\n }", "public function setToken()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $this->oauth_token = $args['id'];\n\t\t $this->oauth_token_secret = $args['Secret'];\n\t}", "public function setAuthToken($token)\n {\n $this->authToken = $token;\n }", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "protected abstract function grant_token($user, $token);", "public function setToken()\n {\n if (session()->has('drive-access-token')) {\n $accessToken = session()->get('drive-access-token');\n $this->setAccessToken($accessToken);\n if ($this->isAccessTokenExpired()) {\n $accessToken = $this->fetchAccessTokenWithRefreshToken($this->getRefreshToken());\n session()->put('drive-access-token', $accessToken);\n }\n }\n }", "public function setToken() {\n $base_uri = $this->remoteSite->get('protocol') . '://' . $this->remoteSite->get('host');\n $options = array(\n 'base_uri' => $base_uri,\n 'allow_redirects' => TRUE,\n 'timeout' => 5,\n 'connect_timeout' => 5,\n );\n\n $token = $this->httpClient->request('get', 'rest/session/token', $options)->getBody();\n return $token->__toString();\n }", "public function set_auth_code() {\n\t\t$tokens = new Token_User( '_indieauth_code_' );\n\t\t$tokens->set_user( self::$author_id );\n\t\treturn $tokens->set( static::$test_auth_code, 600 );\n\t}", "public function setAuthorization()\n\t{\n\t\t// @TODO We don't deal with a case where during your session the token expires\n\t\tif (is_null($this->access_token))\n\t\t{\n\t\t\t$response = $this->getToken();\n\t\t\t$this->access_token = $response->access_token;\n\t\t\t$this->authorization = \"Bearer \" . $this->access_token;\n\t\t}\n\t}", "function token_set($name) {\r\n\t$session=Zend_Auth::getInstance()->getStorage();\r\n\t$token=auth();\r\n\t$session->set($name,$token);\r\n\r\n\treturn $token;\r\n}", "public function setAuthenticated();", "public function setAuthToken($value)\n {\n return $this->set(self::auth_token, $value);\n }", "public function setaccess_token($value);", "public function setAuth($userId, $authToken)\n {\n $this->setRequestHeaders([\n 'X-User-Id' => $userId,\n 'X-Auth-Token' => $authToken,\n ]);\n }", "private function set_user_token( $user_id, $token ) {\n\t\treturn update_option( 'livechat_user_' . $user_id . '_token', $token );\n\t}", "public function setToken($token);", "public function userByToken();", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "public function setToken($token)\n {\n $this->token = $token;\n $this->username = '';\n $this->password = '';\n $this->accessToken = '';\n return $this;\n }", "public function withAuthToken()\n {\n $user = Auth::user();\n return $this->withToken($user->access_token)->withRefreshToken($user->refresh_token);\n }", "public function set($token);", "protected function _setOauthToken()\n {\n $this->_initHttpClient($this->_endpointUrls['access_token'], CurlHttpClient::POST);\n $this->_httpClient->setPostParam('client_id', $this->_config['client_id']);\n $this->_httpClient->setPostParam('client_secret', $this->_config['client_secret']);\n $this->_httpClient->setPostParam('grant_type', $this->_config['grant_type']);\n $this->_httpClient->setPostParam('redirect_uri', $this->_config['redirect_uri']);\n $this->_httpClient->setPostParam('code', $this->getAccessCode());\n $this->_oauthToken = $this->_getHttpClientResponse();\n }", "public function setAccessToken($token);", "private function __setUser() {\n // Create the (helper) user object from the authenticated subject if present\n $subject = \\Native5\\Identity\\SecurityUtils::getSubject();\n if ($subject->isAuthenticated()) {\n $this->user = \\Akzo\\User\\Service::getInstance()->getUser(\n $subject->getPrincipal()['username'],\n $subject\n );\n }\n }", "function __get_auth_token() {\n\n if ($this->auth_token === null) {\n\n $this->auth_token =\n $this->__create_auth_token($this->email,\n $this->password,\n $this->auth_account_type,\n $this->auth_service);\n\n }\n\n return $this->auth_token;\n\n}", "public static function setAuth(&$ch, $auth)\n {\n curl_setopt($ch, CURLOPT_USERPWD, $auth);\n }", "public function setToken($config)\n {\n $this->_token = Yii::createObject($config);\n }", "public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }", "public function setAuthParams()\n {\n if( $this->getUseSession() )\n {\n // FIXME Need to add session functionality\n }\n else\n {\n $this->getHttpClient()->setParameterGet( 'user', $this->getUsername() );\n $this->getHttpClient()->setParameterGet( 'password', $this->getPassword() );\n $this->getHttpClient()->setParameterGet( 'api_id', $this->getApiId() );\n }\n }", "public function setBasicAuth()\n {\n $auth = $this->auth;\n\n if (null !== $auth['user']) {\n $this->mink->getSession()->setBasicAuth(\n $auth['user'],\n $auth['password']\n );\n }\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "public static function authCookie(string $token) : void\n {\n setcookie('NameYourGoat_User_Token', $token, time() + 3600*24*30, '/');\n }", "public function __construct()\n {\n $this->user = JWTAuth::parseToken()->authenticate();\n }", "protected function setAuthtoken($authToken)\n {\n $this->header .= \"X-Auth-Token: \" . $authToken . \"\\r\\n\";\n }", "private function setToken(UserModel $user)\n {\n\t\t$this->token = JWTAuth::AddJWTToken($user);\n\t}", "public function setToken($token, $token_secret) {}", "function setTokenFromCookie($token) {\n\t\t\t$this->tokenFromCookie = $token;\n\t\t}", "public function authClientUser(){\n\n\t\t$token = Input::get('token');\n\t\t$tokenExists = TokenModel::where('token = ?', $token)\n\t\t\t\t\t\t\t\t\t->all();\n\t\t//invalid token used/no access token provided\n\t\tif (!$tokenExists->num_rows()) {\t\t \n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!1');\n\t\t}\n\t\t//check for expired token\n\t\telseif ($tokenExists->result_array()[0]['logout'] === true) {\n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!2');\n\t\t}\n\t\t//unathorized user access to admin controller\n\t\telseif ($tokenExists->result_array()[0]['user_role'] != 3 AND $tokenExists->result_array()[0]['user_role'] != 4) {\n\t\t\theader('HTTP/1.0 401 Unauthorized'); \n\t\t\tdie('Restricted access!');\n\t\t}\n\t\telse {\n\t\t\t//check for expired timestamp\n\t\t\t$token = $tokenExists->result_array()[0];\n\t\t\t$timestamp = strtotime($token['date_modified'] OR $token['date_created']);\n\n\t\t\tif (($timestamp + $token['duration']) > time()) {\n\t\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\t\tdie('Login required!3');\n\t\t\t}\n\n\t\t\t//extend token lifespan\n\t\t\tTokenModel::where('id = ?', $token['id'])\n\t\t\t\t\t\t->save(array(\n\t\t\t\t\t\t\t'duration' => 3600\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t//set the value of the client id\n\t\t\t$this->client_id = $token['client_id'];\n\n\t\t}\n\n\t}", "public function setOAuthToken($token)\n {\n $this->oauthToken->setToken($token);\n }", "public function setSessionTokenFromRegistry() {}", "public function setToken($token)\n {\n return $this->accessToken = $token;\n }", "function setToken($_token) {\n $this->token = $_token;\n return $this;\n }", "public function authenticate($token);", "function set_laravel_passport_grant_client_token()\n {\n DB::table('oauth_clients')\n ->where('id', 2)\n ->update(['secret' => 'dLdsIf3nPMWJC4gOCNcsUn5pBSv5tTPSaU51Gu2F']);\n }", "public function getAuthenticatedUser()\n {\n return JWTAuth::parseToken()->authenticate();\n }", "public function auth()\n {\n\n if (Auth::attempt(['email' => $this->request->header('email'), 'password' => $this->request->header('password')])) {\n $this->user = Auth::user();\n\n } else {\n echo json_encode(['error' => 'Unauthorised']);\n die();\n }\n }", "public function setCredentials($b64_user=\"\")\n\t{\t\n\t\t// It is possible to retrieve information form any user specified in here.\n\t\t// If no user is specified, the system will take the current one.\n\t\tif (empty($b64_user))\n\t\t{\n\t\t\tif (isset($_SESSION[\"USER\"]))\n\t\t\t{\n\t\t\t\t$this->curlObj->set_credentials($_SESSION[\"USER\"]);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->curlObj->set_credentials($b64_user);\n\t\t}\n\t}", "public function getUserToken()\n {\n return !is_null($this->authToken) ? $this->authToken : $this->cookieHelper->getRequestCookie('auth');\n }", "public function actionSetToken()\n {\n if (isset($this->request['token'])) {\n /* @var $userDetails UserDetails */\n $userDetails = UserDetails::model()->findByAttributes(['user_id' => $this->user->id]);\n $userDetails->push_token = $this->request['token'];\n if ($userDetails->save())\n $this->_sendResponse(200, CJSON::encode(['status' => true]));\n else\n $this->_sendResponse(400, CJSON::encode(['status' => false]));\n } else\n $this->_sendResponse(400, CJSON::encode(['status' => false, 'message' => 'Token variable is required.']));\n }", "public function setToken($token){\n $this->token = $token;\n }", "public function setUser($p_mVal) { $this->m_mUser = $p_mVal; }", "public function setToken($value)\n\t{\n\t\tif (is_array($value) && !array_key_exists('expires_in', $value) && array_key_exists('expires', $value))\n\t\t{\n\t\t\t$value['expires_in'] = $value['expires'];\n\t\t\tunset($value['expires']);\n\t\t}\n\t\t$this->setOption('accesstoken', $value);\n\n\t\treturn $this;\n\t}", "abstract public function setNextAuthToken($token);", "public function setRememberToken($value)\n {\n $_token = $value;\n }", "public function setToken($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->token !== $v) {\n\t\t\t$this->token = $v;\n\t\t\t$this->modifiedColumns[] = UsuarioPeer::TOKEN;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getSessionAuthToken();", "function getAuthToken()\n {\n \treturn $this->_authToken;\n }", "function setToken($token)\n {\n $this->token = $token;\n }", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function login()\n {\n $token = $this->guzzleClient()->post($this->getTokenBaseUrl(), [\n 'form_params' => [\n 'grant_type' => 'password',\n 'client_id' => $this->config['client_id'],\n 'client_secret' => $this->config['client_secret'],\n 'username' => $this->config['username'],\n 'password' => $this->config['password'],\n 'redirect_uri' => $this->getRedirectUri()\n ]\n ]);\n\n $token = $this->toArray($token->getBody());\n $this->setToken($token['access_token']);\n $this->setRefreshToken($token['refresh_token']);\n $this->setExpiresAt(strtotime('now') + $token['expires_in']);\n\n return $this;\n }", "function auth_set($sess)\n{\n _app('auth', $sess);\n session_set(auth_namespace(), $sess, true);\n}", "public function authenticate(TokenInterface $token, UserProviderInterface $userProvider);", "public function setRememberToken($value){\n $this->token=$value;\n }", "public function init()\n {\n $this->accessToken = 'EAAPgIZBacbTMBAJnVjjmoOW3tjZClqcJDUP3NZB5Dbi72zA2Ix8tE5qviZAE4BF3UqluxlZCLAOnlqe0WYeTXGZBTesuyGPQXb7iPZAC2qOWnX376GvrvZAiO34bcEJ7TYyPqgqV2uLZAkvHD8DkjuPZC7OEpS91ydHnNXbEPpclLSQQZDZD';\n }", "public function doAuthentication( $api_token = null ) { \t\n\n $url = $this->_base_url . 'me';\n $this->_callAPI($url);\n }", "public function authorize(){\n $token = $this->retrieveToken(); $this->setToken($token);\n }", "public function setToken($token) {\n $this->accessToken = $token;\n return $this;\n }", "private function use_token()\n\t\t{\n\t\t\tif (!isset($_COOKIE['auth_token']) || isset($_SESSION['token_used']))\n\t\t\t\treturn false;\n\n\t\t\t$_SESSION['token_used'] = true;\n\t\t\t$token = explode(';', $_COOKIE['auth_token']);\n\t\t\t$user = $this->users->getUser(null, null, $token[0]);\n\n\t\t\tif (!$user)\n\t\t\t\treturn false;\n\n\t\t\tswitch($this->token_validate($user, $token))\n\t\t\t{\n\t\t\t\tcase -1:\n\t\t\t\t\treturn false;\n\n\t\t\t\tcase 0:\n\t\t\t\t\t$this->grant_token($user, $this->get_token($user));\n\t\t\t\t\t$_SESSION['verified'] = false;\n\t\t\t\t\t$_SESSION['userid'] = $user->id;\n\t\t\t\t\t$_SESSION['state'] = $this->multifactor ? AUTH_MULTIFACTOR : AUTH_NONE;\n\t\t\t\t\treturn $user;\n\n\t\t\t\tcase 1:\n\t\t\t\t\t$_SESSION['verified'] = true;\n\t\t\t\t\t$_SESSION['userid'] = $user->id;\n\t\t\t\t\t$_SESSION['state'] = $this->users->getState($user);\n\t\t\t\t\treturn $user;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }", "abstract protected function getUserByToken($token);", "public function setBotToken(string $token): BasicUser\n {\n $this->botToken = $token;\n return $this;\n }", "public function setRememberToken($token)\n {\n $this->user[$this->getRememberTokenName()] = $token;\n }", "public function setUser(OAuthUserInterface $user);", "public function setAccessToken($token) {\n $this->oauth_token = $token;\n $this->client->setAccessToken($this->oauth_token);\n }", "abstract public function getAuthToken();", "public function setUser(Authenticatable $user)\n {\n $this->session->put('google_guard_user', $user);\n $this->session->put('socialite_token', $user->token);\n }", "public function setToken()\n {\n $this->token = Token::generate($this->email);\n\n return $this;\n }", "public function set() {\n\t\t$this->token = uniqid(rand(), true);\n\n\t\t$this->time = time();\n\n\t\t$this->$referer = $_SERVER['HTTP_REFERER'];\n\n\t\tif ($this->isEnable()) {\n\t\t\t$_SESSION['token'] = $this->token;\n\t\t\t$_SESSION['token_time'] = $this->time;\n\t\t\t$_SESSION['token_referer'] = $this->$referer;\n\t\t}\n\t}", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public static function auth() : ?object\n {\n // Retrieve the \"full user\" just one time\n if (self::$fullUser) {\n return self::$fullUser;\n }\n\n if (! $token = $_COOKIE['NameYourGoat_User_Token'] ?? null) {\n return null;\n }\n\n if (! $user = Repository\\User::byToken($token)) {\n setcookie('NameYourGoat_User_Token', null, 0, '/');\n return null;\n }\n\n self::authCookie($token);\n\n return self::$fullUser = $user;\n }", "public function testAuthenticateTokenParameter()\n {\n $request = new ServerRequest();\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => '[email protected]',\n 'created' => new FrozenTime('2014-03-17 01:18:23'),\n 'updated' => new FrozenTime('2014-03-17 01:20:31'),\n ];\n $request = new ServerRequest(['url' => 'posts/index?token=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $this->auth->setConfig('parameter', 'tokenname');\n $request = new ServerRequest(['url' => 'posts/index?tokenname=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = new ServerRequest(['url' => 'posts/index?wrongtoken=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }", "private function authenticate()\n {\n $this->client->authenticate($this->token, null, Client::AUTH_HTTP_TOKEN);\n }", "protected function _initAuth()\n {\n $dm = Registry::getInstance()->get('dm');\n $user = $dm->getRepository('Domain\\User\\Entity\\User')->find('4de999713eecad69a02e4145');\n \n // Simulate logged in User.\n Registry::getInstance()->set('user', $user);\n }", "private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}", "public function setRememberToken($value) {\n dd('asd2f');\n if (! empty($this->getRememberTokenName())) {\n $this->{$this->getRememberTokenName()} = $value;\n }\n }", "public function setPandaAuth($value);", "public function token()\n {\n\n\t\t$this->server->handleTokenRequest(OAuth2\\Request::createFromGlobals())->send();\n }", "public function user(Request $request)\n\t\t{\n\t\t\t$token = $request->bearerToken();\n\t\t\tif (empty($token))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$firebaseToken = $this->verifier->verifyIdToken($token);\n\t\t\t\t$targetProvider = config('firebase-token-authentication.target_provider');\n\t\t\t\t\n\t\t\t\treturn app(config('auth.providers.'.$targetProvider.'.model'))\n\t\t\t\t\t->resolveByClaims($firebaseToken)\n\t\t\t\t\t->setFirebaseAuthenticationToken($token);\n\t\t\t}\n\t\t\tcatch (\\Exception $exception)\n\t\t\t{\n\t\t\t\tif ($exception instanceof \\Firebase\\Auth\\Token\\Exception\\ExpiredToken)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (config('app.debug'))\n\t\t\t\t{\n\t\t\t\t\tthrow $exception;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function exchange_token($token)\r\n\t{\r\n\t\t$ch = curl_init();\r\n\r\n\t\tcurl_setopt($ch, CURLOPT_URL, (PicasaAPI::$QUERY_URLS['auth_sub_session']));\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); \r\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: AuthSub token=\"' . $token . '\"'));\r\n\r\n\t\t$result = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t// store the session token\r\n\t\t$parsed_result = explode(\"=\", $result);\r\n\t\tOptions::set('picasa_token_' . User::identify()->id, $parsed_result[1]);\r\n\t}", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function authToken ($appToken)\n {\n $bits = $this->parseToken($appToken);\n if (!isset($bits)) return; // invalid token.\n $format = $this->formatCode();\n $sid = $bits[0];\n $ahash = $bits[1];\n $uhash = $this->authHash($sid, $ahash);\n $len = sprintf('%02d', strlen($sid));\n $token = $format . $len . $sid . $uhash;\n return $token;\n }", "public static function setToken($token, $iswebhook=false)\n {\n self::$_token = $token;\n self::$_iswebhook = $iswebhook;\n }", "public function authorize(UserToken $token);", "public function setAccessToken($token)\n {\n $this->_accessToken = $token;\n }", "private function setCredentials()\n\t{\n\t\t$this->credentials['app_token'] = $this->settings_repo->getSiteSetting('facebook', 'app_token');\n\t\t$this->credentials['page_id'] = $this->settings_repo->getSiteSetting('facebook', 'page_id');\n\t}", "protected function authenticate(){\n $user = User::create([\n 'name' => 'test',\n 'email' => '[email protected]',\n 'password' => Hash::make('secret1234'),\n ]);\n $this->user = $user;\n $token = JWTAuth::fromUser($user);\n return $token;\n }", "public function testTokenGetterAndSetter()\n {\n $user = new User();\n $user->setToken('foo');\n\n $this->assertEquals('foo', $user->getToken());\n $this->assertEquals('foo', $user->getAccessToken());\n }", "public function doTokenAuth($token)\n {\n $userModel = new \\BAServer\\Models\\User();\n $userData = $userModel->getUserByToken($token);\n\n var_dump($userData);\n return 'Authenticating token ' . $token;\n }" ]
[ "0.64652884", "0.6378963", "0.62759393", "0.6218334", "0.61952335", "0.61389565", "0.6135895", "0.6127911", "0.61194396", "0.60878533", "0.6031323", "0.59725666", "0.59594107", "0.59294873", "0.58727777", "0.5854219", "0.58130145", "0.5760244", "0.5752557", "0.57476526", "0.5703039", "0.56995404", "0.56924784", "0.5684256", "0.5666446", "0.5655057", "0.5643199", "0.5638938", "0.5597115", "0.559586", "0.5594518", "0.55747044", "0.5571857", "0.55581385", "0.5552147", "0.5545632", "0.55420953", "0.5539145", "0.5537364", "0.55141574", "0.55057824", "0.550482", "0.5502494", "0.549784", "0.5493987", "0.5484845", "0.5480235", "0.54784495", "0.54695445", "0.54647255", "0.5461986", "0.54558504", "0.54517126", "0.5449774", "0.5437668", "0.5431033", "0.5428487", "0.54193723", "0.541763", "0.54166687", "0.54098636", "0.54081285", "0.54066217", "0.540599", "0.54055804", "0.53968847", "0.5382316", "0.5377863", "0.53750443", "0.5358157", "0.5355921", "0.5355687", "0.5355012", "0.53518057", "0.5346083", "0.53394485", "0.5335617", "0.5334581", "0.5332981", "0.5330481", "0.5326062", "0.53204685", "0.53165084", "0.53059196", "0.5303049", "0.5297994", "0.5297928", "0.5295166", "0.52898014", "0.52874553", "0.52805567", "0.52805567", "0.52780867", "0.52767324", "0.52678925", "0.5267092", "0.52663606", "0.52662677", "0.5262996", "0.5253986" ]
0.5814421
16
/ Contacts methods Get a list of contacts for the calling user.
function contacts_getList ($per_page = 25, $page = 1, $filter = NULL) { $response = $this->execute(array('method' => 'flickr.contacts.getList', 'per_page' => $per_page, 'page' => $page, 'filter' => $filter)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['contacts']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserContacts()\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count'] = 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/contacts', $parameters);\n\n\t\tif ( $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User contacts request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif ( !$response->contacts->contact && ( $response->errcode != 0 ) )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$contacts = array();\n\n\t\tforeach( $response->contacts->contact as $item ) {\n\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t$uc->identifier = $this->selectGUID( $item );\n\t\t\t$uc->email = $this->selectEmail( $item->fields );\n\t\t\t$uc->displayName = $this->selectName( $item->fields );\n\t\t\t$uc->photoURL = $this->selectPhoto( $item->fields );\n\n\t\t\t$contacts[] = $uc;\n\t\t}\n\t\t\n\t\treturn $contacts;\n\t}", "public function getContacts();", "function getUserContacts()\n\t{\n\t\t$parameters = array( 'page' => 1 );\n\t\t$response = $this->api->get( 'user/list_friends.json', $parameters );\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User contacts request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif( ! $response || ! count( $response->friends ) ){\n\t\t\treturn ARRAY();\n\t\t}\n\n\t\t$max_page = (property_exists($response,'max_page'))?$response->max_page:1;\n\t\tfor ($i = 0; $i<$max_page; $i++) {\n\t\t\tif( $i > 0 ) {\n\t\t\t\t$parameters = array( 'page' => $i );\n\t\t\t\t$response = $this->api->get( 'user/list_friends.json', $parameters );\n\t\t\t\t// check the last HTTP status code returned\n\t\t\t\tif ( $this->api->http_code != 200 ){\n\t\t\t\t\tthrow new Exception( \"User contacts request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $response && count( $response->friends ) ){\n\t\t\t\tforeach( $response->friends as $item ){\n\t\t\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t\t\t$uc->identifier = (property_exists($item,'id_user'))?$item->id_user:\"\";\n\t\t\t\t\t$uc->displayName = (property_exists($item,'username'))?$item->username:\"\";\n\t\t\t\t\t$uc->profileURL = (property_exists($item,'user_url'))?$item->user_url:\"\";\n\t\t\t\t\t$uc->photoURL = (property_exists($item,'avatar_url'))?$item->avatar_url:\"\";\n\t\t\t\t\t//$uc->description = (property_exists($item,'description'))?$item->description:\"\";\n\n\t\t\t\t\t$contacts[] = $uc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $contacts;\n\t}", "public function getContactsList() {\n return $this->_get(7);\n }", "public function getContactsList() {\n return $this->_get(6);\n }", "public function getContactList()\r\n {\r\n return $this->exec('contact_list');\r\n }", "public function showMyContacts()\n {\n $myContacts = $this->userRequest->userContacts();\n return response()->json($myContacts);\n }", "public function getContacts()\n\t{\n\t\treturn $this->contacts; \n\n\t}", "public function getContacts() {\n return $this->contacts;\n }", "public function getContacts()\r\n {\r\n return $this->_contacts;\r\n }", "public function contactsAction()\n {\n $this->view->pageTitle = 'Member Contact List';\n\t$service = new App_Service_Member();\n $users = $service->getActiveUsers();\n\n $this->view->users = array();\n $lastRowLetter = null;\n\t\n\t// remove inactive memebers\n\t$users = array_filter($users, function($usr) { return $usr->isActive();} );\n\t\n foreach ($users as $userId => $user) {\n $firstName = $user->getFirstName();\n\n if ($lastRowLetter !== $firstName[0]) {\n $lastRowLetter = $rowLetter = $firstName[0];\n } else {\n $rowLetter = null;\n }\n\n $this->view->users[$userId] = array(\n 'user' => $user,\n 'rowLetter' => $rowLetter,\n );\n }\n }", "public function fetchContacts()\n {\n return $this->contacts;\n }", "public function getContacts(): Collection\n {\n return $this->hasMany(UserContact::class, 'user_id', 'id')->get();\n }", "function get_all_contacts() {\n //get all the users\n $task = Doctrine_Query::create()\n ->from('Zim_Model_User');\n $exec = $task->execute();\n $contacts = $exec->toArray();\n //return the array of contacts\n return $contacts;\n\n }", "public function index()\n {\n // Get the authenticated user\n $user = auth()->user();\n\n // Get contacts for the authenticated user\n $contacts = Contact::where('user_id', $user->id)->get();\n\n return response($contacts, 200);\n }", "public function index(Request $request)\n {\n return $request->user()->contacts;\n }", "public function getContacts() {\n $sforce = $this->getDataSource();\n $SOQL = $sforce->getConfigSOQL();\n $resultSet = $this->queryBatch($SOQL);\n \n return $resultSet;\n }", "public function getContacts(){\n\t\t// ***\n\t\t// the following code should be ported\n\t\t// so multiple backends are allowed\n\t\t$userOnlineMapper = $this->app['UserOnlineMapper'];\n\t\t$usersOnline = $userOnlineMapper->getOnlineUsers();\n\t\t$syncOnline = $this->app['SyncOnlineCommand'];\n\t\t$syncOnline->execute();\n\t\t// ***\n\n\t\tif(count(self::$contacts) == 0){\n\t\t\t$cm = \\OC::$server->getContactsManager();\n\n\t\t\t$result = $cm->search('',array('FN'));\n\t\t\t$receivers = array();\n\t\t\t$contactList = array();\n\t\t\t$contactsObj = array();\n\t\t\tforeach ($result as $r) {\n\t\t\t\t$data = array();\n\n\t\t\t\t$contactList[] = $r['FN'];\n\n\t\t\t\t$data['id'] = $r['id'];\n\t\t\t\t$data['online'] = in_array($r['id'], $usersOnline);\n\t\t\t\t$data['displayname'] = $r['FN'];\n\n\t\t\t\tif(!isset($r['EMAIL'])){\n\t\t\t\t\t$r['EMAIL'] = array();\n\t\t\t\t}\n\n\t\t\t\tif(!isset($r['IMPP'])){\n\t\t\t\t\t$r['IMPP'] = array();\n\t\t\t\t}\n\t\t\t\t$data['backends'] = $this->contactBackendToBackend($r['EMAIL'], $r['IMPP']);\n\t\t\t\tlist($addressBookBackend, $addressBookId) = explode(':', $r['addressbook-key']);\n\t\t\t\t$data['address_book_id'] = $addressBookId;\n\t\t\t\t$data['address_book_backend'] = $addressBookBackend;\n\t\t\t\t$receivers[] = $data;\n\t\t\t\t$contactsObj[$r['id']] = $data;\n\t\t\t}\n\t\t\tself::$contacts = array('contacts' => $receivers, 'contactsList' => $contactList, 'contactsObj' => $contactsObj);\n\t\t}\n\t\treturn self::$contacts;\n\t}", "public function list()\n {\n $contact = ContactService::getList(Input::all());\n return response()->json(array(\n 'contacts' => $contact\n ),200);\n }", "public function getContacts(){\n\t\n\t\t$db\t\t= $this->getDbo();\n\t\t\n\t\t$query\t= $db->getQuery( true );\n\t\t$query->select( '*' );\n\t\t$query->from( '#__zbrochure_providers_contacts as c' );\n\t\t$query->join( 'LEFT','#__zbrochure_providers as p on p.provider_id = c.provider_id' );\n\t\t\n\t\t$db->setQuery( $query );\n\t\t$contacts = $db->loadObjectList();\n\t\t\n\t\treturn $contacts;\n\t}", "public function contacts()\n {\n return $this->hasMany('App\\Models\\User\\Contact', 'user_id');\n }", "public function getContacts(): stdClass {\n\n\t\treturn $this->greenApi->request( 'GET',\n\t\t\t'{{host}}/waInstance{{idInstance}}/GetContacts/{{apiTokenInstance}}' );\n\t}", "public function getContacts( $params = array() ) {\n\t\treturn $this->call( 'contacts?' . $this->setParams( $params ) );\n\t}", "public function getMyContacts()\r\n {\r\n $contacts=$this->plugin->getMyContacts();\r\n //if ($contacts!==false) $this->statsRecordImport(count($contacts));\r\n return $contacts;\r\n }", "public function getMyContacts()\n\t\t{\n\t\tif (!$this->login_ok)\n\t\t\t{\n\t\t\t$this->debugRequest();\n\t\t\t$this->stopPlugin();\n\t\t\treturn false;\n\t\t\t}\n\t\telse $url=$this->login_ok;\n\t\t$res=$this->get($url,true);\n\t\tif ($this->checkResponse(\"get_friends\",$res))\n\t\t\t$this->updateDebugBuffer('get_friends',\"{$url}\",'GET');\n\t\telse\n\t\t\t{\n\t\t\t$this->updateDebugBuffer('get_friends',\"{$url}\",'GET',false);\n\t\t\t$this->debugRequest();\n\t\t\t$this->stopPlugin();\n\t\t\treturn false;\n\t\t\t}\n\n\t\t$res=str_replace(PHP_EOL,\"\",$res);\n\t\tpreg_match_all(\"#mailto\\:(.+)\\\"#U\",$res,$emails);\n\t\tpreg_match_all(\"#252Fcontacts\\\"\\>(.+)\\<\\/#U\",$res,$names);\t\t\n\t\t$contacts=array();\n\t\tif (!empty($emails[1])) foreach($emails[1] as $key=>$email) if (!empty($names[1][$key])) $contacts[$email]=$names[1][$key];\t\t\t\t\n\t\tforeach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);\n\t\treturn $contacts;\n\t\t}", "public function getContacts()\n {\n if (! isset($this->contacts)) {\n $this->contacts = new AddressBook\\Model\\Collection\\ContactCollection();\n }\n return $this->contacts;\n }", "public function getContacts(){\n\t\t$db = Dbconn::getDB();\n\t\t$sql = \"SELECT * FROM contacts\";\n\t\t$result = $db->query($sql);\n\n\t\t$contacts = array();\n\n\t\tforeach ($result as $row){\n\t\t\t$contact = new Contact(\n\t\t\t\t$row['contact_fname'],\n\t\t\t\t$row['contact_lname'],\n\t\t\t\t$row['contact_email'],\n\t\t\t\t$row['contact_phone'],\n\t\t\t\t$row['contact_msg']\n\t\t\t\t);\n\t\t\t$contacts[] = $contact;\n\t\t}\n\n\t\treturn $contacts;\n\t}", "public function getContacts($options = null){\n $email = isset($options[\"email\"]) ? $options[\"email\"] : null;\n $tag = isset($options[\"tag\"]) ? $options[\"tag\"] : null;\n $ids = isset($options[\"ids\"]) ? $options[\"ids\"] : null;\n\n $request = $this->GET(\"/v2.1/Contacts\");\n\n // handle standard OData options\n $this->buildODataQuery($request, $options);\n\n // handle other options\n if($email != null){\n $request->queryParam(\"email\", $email);\n }\n if($tag != null){\n $request->queryParam(\"tag\", $tag);\n }\n if($ids != null){\n $s = \"\";\n foreach($ids as $key => $value){\n if($key > 0){\n $s = $s . \",\";\n }\n $s = $s . $value;\n }\n $request->queryParam(\"ids\", $s);\n }\n\n return $request->asJSON();\n }", "public function index(Request $request)\n {\n $contacts = $request->user()->contacts()->orderBy('updated_at', 'DESC')->get();\n return ContactResource::collection($contacts);\n }", "public function getAll()\r\n {\r\n // Query the database and return an array of contacts\r\n return $this->getEntityManager()\r\n ->createQuery(\r\n 'SELECT c FROM AppBundle:Contact c ORDER BY c.firstName, c.lastName ASC'\r\n )\r\n ->getResult();\r\n }", "public function index()\n\t{\n\t\tif (!$this->commons->hasPermission('contacts')) {\n\t\t\tNot_foundController::show('403');\n\t\t\texit();\n\t\t}\n\n\t\t/*Get User name and role*/\n\t\t$data = $this->commons->getUser();\n\t\t/**\n\t\t * Get all User data from DB using User model \n\t\t **/\n\t\tif ($id = $this->commons->checkUser()) {\n\t\t\t$data['admin'] = false;\n\t\t\t$data['result'] = $this->contactModel->getContacts($id);\n\t\t} else {\n\t\t\t$data['admin'] = true;\n\t\t\t$data['result'] = $this->contactModel->getContacts();\n\t\t}\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER . 'language/' . $data['info']['language'] . '/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER . 'language/' . $data['info']['language'] . '/contact.php';\n\t\t$data['lang']['contact'] = $contact;\n\n\t\t/* Set confirmation message if page submitted before */\n\t\tif (isset($this->session->data['message'])) {\n\t\t\t$data['message'] = $this->session->data['message'];\n\t\t\tunset($this->session->data['message']);\n\t\t}\n\t\t/* Set page title */\n\t\t$data['page_title'] = $data['lang']['common']['text_contacts'];\n\n\t\t/*Render User list view*/\n\t\t$this->view->render('contact/contact_list.tpl', $data);\n\t}", "public function myContacts($userId)\n {\n $sql = \"SELECT * FROM `contacts` WHERE `userid`=?\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute([$userId]);\n return $stmt->fetchAll();\n }", "public function index(ContactUserRequest $request)\n {\n $this->repository->pushCriteria(new \\Lavalite\\Contact\\Repositories\\Criteria\\ContactUserCriteria());\n $contacts = $this->repository->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n $this->theme->prependTitle(trans('contact::contact.names').' :: ');\n\n return $this->theme->of('contact::user.contact.index', compact('contacts'))->render();\n }", "public function searchMyContacts() {\n $criteria = new CDbCriteria;\n\n $accessLevel = Yii::app()->user->checkAccess('ContactsView') ? 1 : 0;\n $conditions = $this->getAccessConditions($accessLevel);\n foreach ($conditions as $arr) {\n $criteria->addCondition($arr['condition'], $arr['operator']);\n $criteria->params = array_merge($criteria->params, $arr['params']);\n }\n\n // $condition = 'assignedTo=\"'.Yii::app()->user->getName().'\"';\n // $parameters=array('limit'=>ceil(Profile::getResultsPerPage()));\n // $parameters['condition']=$condition;\n // $criteria->scopes=array('findAll'=>array($parameters));\n\n return $this->searchBase($criteria);\n }", "public function index() {\n $contacts = \\App\\Models\\UserContacts::where('user_id', \\Auth::user()->id);\n return view('modules.contacts.index')\n ->with('contacts', $contacts->paginate(15));\n }", "static function getContacts($user = null)\r\n {\r\n if ($user === null)\r\n {\r\n return null;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n $tableUser = DatabaseManager::getNameTable('TABLE_USER');\r\n $idUser = $user->getId();\r\n \r\n $query = \"SELECT DISTINCT u.* \r\n FROM (SELECT * FROM $tableMessage ORDER BY time DESC) AS m \r\n JOIN $tableUser as u \r\n ON u.id = m.idUserTo OR m.idUserFrom = u.id\r\n WHERE m.idUserTo = $idUser OR m.idUserFrom = $idUser\";\r\n\r\n $arrayMessages = DatabaseManager::multiFetchAssoc($query);\r\n $messages = array();\r\n\r\n if ($arrayMessages === null)\r\n {\r\n return null;\r\n }\r\n\r\n foreach ($arrayMessages as $Message) \r\n {\r\n $messages[] = self::ArrayToUser($Message);\r\n }\r\n\r\n return $messages;\r\n }", "function getUserContacts() \r\n\t{\r\n\t\t# to access this area, the user have to be loggedin with an IDp an has a HybridAuth session\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\tHybrid_Auth::addWarning( Hybrid_Auth::text( \"GET_USER_CONTACTS_UNSUPPORTED_WARNING\" ) ); \r\n\r\n\t\treturn NULL;\r\n\t}", "public function getUserContacs(int $userId)\n\t{\n\t\t$plsql = $this->dbManager->buildSql(\"FN_USERCONTACTS\",\"{$userId},'{$this->language}'\");\n \t\t$data = $this->dbManager->returnMultiData($plsql);\n\t\treturn $data;\n\t}", "public function getContacts(){\n // $contacts = DB::table('contacts')->get(); /* -->Query Builder */\n\t\t\t$contacts = DB::select('SELECT * FROM contacts'); /* -->Query Builder Select */\n return response()->json(['contacts' => $contacts], 200);\n }", "function getcontacts() {\n \t\t\n \t\t$this->checkAccess('bulksms');\n \t\t\n \t\t$group_id = filter_var(trim($_POST['group_id']), FILTER_SANITIZE_STRING);\n \t\t$c['conditions']['BulkAddressbook.status'] = '0';\n\t\t$c['conditions']['BulkAddressbook.bulk_group_id'] = $group_id;\n\t\t$c['fields'] = array('BulkAddressbook.id', 'BulkAddressbook.mobile', 'CONCAT(BulkAddressbook.firstname, \\' \\', BulkAddressbook.lastname) as full_name');\n\t\t$data = $this->BulkAddressbook->find('all', $c);\n \t\tforeach($data as $v) {\n \t\t\t$return_data[$v['BulkAddressbook']['id']]['name'] = (empty($v['0']['full_name'])) ? 'no name' : $v['0']['full_name'];\n \t\t\t$return_data[$v['BulkAddressbook']['id']]['mobile'] = $v['BulkAddressbook']['mobile'];\n \t\t}\n \t\techo json_encode($return_data);\n \t\t\n \t\t$this->autoRender = false;\n \t}", "public function getContacts()\n {\n if (array_key_exists(\"contacts\", $this->_propDict)) {\n return $this->_propDict[\"contacts\"];\n } else {\n return null;\n }\n }", "public function get_contacts($domain) {\n \n }", "public function getMyContacts()\n\t\t{\n\t\tif (!$this->login_ok)\n\t\t\t{\n\t\t\t$this->debugRequest();\n\t\t\t$this->stopPlugin();\n\t\t\treturn false;\n\t\t\t}\n\t\telse $user_id=$this->login_ok;\n\t\t$url_request_friends=\"http://www.plurk.com/Friends/getFriendsByOffset\";\n\t\t$post_elements=array('offset'=>0,'user_id'=>$user_id);\n\t\t$res=$this->post($url_request_friends,$post_elements,true);\n\t\tif ($this->checkResponse(\"get_contacts\",$res))\n\t\t\t$this->updateDebugBuffer('get_contacts',$url_request_friends,'POST',true,$post_elements);\n\t\telse\n\t\t\t{\n\t\t\t$this->updateDebugBuffer('get_contacts',$url_request_friends,'POST',false,$post_elements);\n\t\t\t$this->debugRequest();\n\t\t\t$this->stopPlugin();\n\t\t\treturn false;\n\t\t\t}\n\t\t\n\t\t$contacts=array();\n\t\twhile(strpos($res,'\"nick_name\": \"')!==false)\n\t\t\t{\n\t\t\t$name=$this->getElementString($res,'\"nick_name\": \"','\"');\n\t\t\t$name_delete='\"nick_name\": \"'.$name;\n\t\t\t$uid=$this->getElementString($res,'\"uid\": ',',');\n\t\t\t$uid_delete='\"uid\": '.$uid;\n\t\t\t$res=str_replace($name_delete,'',str_replace($uid_delete,'',$res));\n\t\t\tif(isset($uid)) $contacts[$uid]=(isset($name)?$name:false);\n\t\t\t}\n\t\treturn $contacts;\t\n\t\t}", "public function get_contacts()\n {\n \t$query=$this->db->query(\"SELECT A.*,B.Client_Company_Name FROM ibt_client_contacts A INNER JOIN ibt_client B on A.Contact_Client_Icode = B.Client_Icode \"); \n return $query->result_array();\n }", "public function all()\n {\n\n $this->authorize('all', Contact::class);\n\n $data = [];\n\n $contacts = Auth::user()->account->contacts();\n\n jqxFilters($contacts, function (Builder $q, $filter) {\n switch ($filter['field']) {\n case 'name':\n $filter['field'] = DB::raw(\"CONCAT(first_name, ' ' ,last_name)\");\n break;\n }\n\n return $filter;\n });\n\n $data['TotalRows'] = $contacts->count();\n\n $contacts->orderBy(request('sortdatafield', 'id'), request('sortorder', 'asc'))\n ->skip(request('recordstartindex', 0))\n ->take(request('recordendindex', 50));\n\n $data['Rows'] = $contacts->get(['*', DB::raw(\"CONCAT(first_name, ' ' ,last_name) as 'name'\")]);\n\n return response()->json($data);\n }", "public abstract function get_list_contacts($list_id);", "public function getAll()\r\n {\r\n return $this->contactManager->fetchAll(true, null, null);\r\n }", "public function get_contacts($contacts)\n {\n $query = $this->db->from('users');\n $query = $this->db->where_in('mobile', $contacts);\n $query = $this->db->get();\n \n return $query->result_array();\n }", "function user_get_contacts($uid){\n\t\t$queryText = 'SELECT user_accounts.first_name, user_accounts.last_name FROM user_accounts INNER JOIN user_contacts ON user_contacts.uid = :uid AND user_contacts.contact_uid = user_accounts.Uid';\n\t\t\n\t\t$query = $this->connection->prepare($queryText);\n\t\t$query->execute(array(':uid'=>$uid));\n\t\t\n\t\treturn $query;\n\t}", "public function getContacts(){\n $contacts = [];\n if ($this->data instanceof IPPCustomer){\n $newContact = $this->parseData($this->data);\n $contacts[] = $newContact;\n }\n else {\n foreach ($this->data as $contact) {\n $newContact = $this->parseData($contact);\n $contacts[] = $newContact;\n }\n }\n\n return $contacts;\n }", "public function list(?string $query = ''): Collection\n {\n $contacts = $this->request(\n method: 'get',\n path: 'contacts?'.$query,\n responseKey: 'contacts'\n );\n\n return collect($contacts)\n ->map(fn ($contact) => ContactFactory::make($contact));\n }", "public function get()\n {\n $contacts = $this->contact->orderBy('name', 'asc')->get();\n\n foreach ($contacts as $contact){\n array_add($contact, 'get_company', $contact->getCompany);\n }\n\n return json_encode($contacts);\n }", "public function getContacts($value)\n {\n $contacts = Contact::getContacts($value);\n\n if ($contacts->count() > 0) {\n return new ContactResource($contacts);\n }\n\n return response()->json([\"status\" => \"error\", \"message\" => \"No se encontraron resultados!\"]);\n }", "public function contact()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('contact');\n\n return $this->loadPublicView('user.contact', $breadCrumb['data']);\n }", "public function all()\n\t{\n\t\treturn $this->contact->currentUser()->orderBy('lastName', 'asc')->orderBy('email', 'asc')->paginate( $this->perPage );\n\t}", "public function index()\n {\n //for some reason this worked better when I treated $contacts as if multiple\n //records were received, though there is only one per user. I display using\n // @foreach and they work. Is it the 'compact' portion of the return view?\n \n $auth_user = Auth::user()->id;\n \n $contacts = DB::table('contacts')->where('user_id',$auth_user)->get();\n \n return view('layouts.contacts',compact('contacts'));\n }", "public function index()\n {\n // $users = User::orderBy('id', 'DESC')\n // ->paginate(10);\n return view('contacts-list');\n }", "public function getContacts($id) {\n\n $contacts = DB::table('contacts')\n ->select('contacts.*', 'social_contacts.*')\n ->join('social_contacts','contacts.id','=','social_contacts.id')\n ->where('social_contacts.id', '=', $id)\n ->first();\n\n return $contacts;\n }", "public function get_contacts($list_id = self::SENDGRID_FXPROTOOLS_LIST_ID)\n\t\t{\n\t\t\t$sg = new \\SendGrid( self::SENDGRID_API_KEY );\n\t\t\t$query_params = json_decode('{\"page\": 1, \"page_size\": 1, }');\n\t\t\t$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->get(null, $query_params);\n\t\t\treturn $response->body();\n\t\t}", "public function contacts()\n {\n return $this->hasMany(Contact::class);\n }", "public function index()\n {\n $result = $this->contactService->getAllContact();\n\n return response()->json($result, 200);\n }", "public function contacts()\n {\n return $this->hasManyThrough(Contact::class, Profile::class);\n }", "public function getContactsForAdding()\n {\n return $this->contactsForAdding;\n }", "public function contacts()\r\n {\r\n // autorender off for view\r\n $this->autoRender = false;\r\n\r\n //--------- Post request -----------\r\n if ($this->request->is('post')) {\r\n //file name\r\n $filename = 'contacts' . \"_\" . date(\"Y-m-d_H-i\", time()) . \".csv\";\r\n //force csv download\r\n header('Content-type: text/csv');\r\n header('Content-Disposition: attachment; filename=\"' . $filename . '\";');\r\n\r\n //get all contacts\r\n $contacts = $this->Contact->find('all', array('order' => array('name' => 'ASC')));\r\n\r\n //Create file and add contacts in csv file for download\r\n $file = fopen('php://output', 'w');\r\n $data = array('Name', 'Title', 'Email', 'Phone', 'Address', 'Location', 'Company', 'Facebook', 'Twitter', 'LinkedIn', 'Skype');\r\n fputcsv($file, $data, ',', '\"');\r\n foreach ($contacts as $row) {\r\n if ($row['Contact']['company_id']) {\r\n $comapny = $this->Company->find('first', array('conditions' => array('Company.id' => $row['Contact']['company_id']), 'fields' => array('Company.name')));\r\n }\r\n $data = array();\r\n $data[] = $row['Contact']['name'];\r\n $data[] = $row['Contact']['title'];\r\n $data[] = $row['Contact']['email'];\r\n $data[] = $row['Contact']['phone'];\r\n $data[] = $row['Contact']['address'];\r\n $data[] = $row['Contact']['location'];\r\n $data[] = (isset($comapny['Company']['name'])) ? $comapny['Company']['name'] : '';\r\n $data[] = $row['Contact']['facebook'];\r\n $data[] = $row['Contact']['twitter'];\r\n $data[] = $row['Contact']['linkedIn'];\r\n $data[] = $row['Contact']['skype'];\r\n fputcsv($file, $data, ',', '\"');\r\n }\r\n fclose($file);\r\n }\r\n }", "public function index()\n {\n return Contact::latest()->get();\n }", "public function forUser(User $user)\n {\n return Contact::where('user_id', $user->id)\n ->where('is_active','1')\n ->orderBy('created_at', 'asc')\n ->get();\n }", "public function getAllContacts($view_type = FALSE)\n\t{\n\t\t$sql = $this->db->select();\n\t\t\n\t\tif(is_numeric($view_type))\n\t\t{\n\t\t\t$sql = $sql->where(array('type' => $view_type));\n\t\t}\n\t\t\n\t\treturn $this->getRows($sql);\t\t\n\t}", "public function index()\n {\n $contacts = Contacts::all();\n return ResponseHelper::json($contacts, 200, 'Contacts Retrieve');\n }", "public function index()\n {\n $contacts = Contact::all()->load('users');\n return view('contacts.index',compact('contacts'));\n }", "function get_contactsforol($user_name)\n{\n\tglobal $log,$adb;\n\tglobal $current_user;\n\trequire_once(\"modules/Users/Users.php\");\n\t$seed_user=new Users();\n\t$user_id=$seed_user->retrieve_user_id($user_name);\n\t$current_user=$seed_user;\n\t$current_user->retrieve_entity_info($user_id, 'Users');\n\trequire('user_privileges/user_privileges_'.$current_user->id.'.php');\n\trequire('user_privileges/sharing_privileges_'.$current_user->id.'.php');\n\n\tif($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0)\n {\n $sql1 = \"select tablename,columnname from vtiger_field where tabid=4 and vtiger_field.presence in (0,2)\";\n\t$params1 = array();\n }else\n {\n $profileList = getCurrentUserProfileList();\n $sql1 = \"select tablename,columnname from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid where vtiger_field.tabid=4 and vtiger_field.displaytype in (1,2,4,3) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)\";\n\t$params1 = array();\n\tif (count($profileList) > 0) {\n\t\t$sql1 .= \" and vtiger_profile2field.profileid in (\". generateQuestionMarks($profileList) .\")\";\n\t\tarray_push($params1, $profileList);\n\t}\n }\n $result1 = $adb->pquery($sql1, $params1);\n for($i=0;$i < $adb->num_rows($result1);$i++)\n {\n $permitted_lists[] = $adb->query_result($result1,$i,'tablename');\n $permitted_lists[] = $adb->query_result($result1,$i,'columnname');\n if($adb->query_result($result1,$i,'columnname') == \"accountid\")\n {\n $permitted_lists[] = 'vtiger_account';\n $permitted_lists[] = 'accountname';\n }\n }\n\t$permitted_lists = array_chunk($permitted_lists,2);\n\t$column_table_lists = array();\n\tfor($i=0;$i < count($permitted_lists);$i++)\n\t{\n\t $column_table_lists[] = implode(\".\",$permitted_lists[$i]);\n }\n\n\t$log->debug(\"Entering get_contactsforol(\".$user_name.\") method ...\");\n\t$query = \"select vtiger_contactdetails.contactid as id, \".implode(',',$column_table_lists).\" from vtiger_contactdetails\n\t\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\t\t\tleft join vtiger_customerdetails on vtiger_customerdetails.customerid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tleft join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid\n\t\t\t\t\t\tleft join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tleft join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid\n left join vtiger_campaigncontrel on vtiger_contactdetails.contactid = vtiger_campaigncontrel.contactid\n left join vtiger_campaignrelstatus on vtiger_campaignrelstatus.campaignrelstatusid = vtiger_campaigncontrel.campaignrelstatusid\n\t\t\t LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\twhere vtiger_crmentity.deleted=0 and vtiger_users.user_name='\".$user_name.\"'\";\n $log->debug(\"Exiting get_contactsforol method ...\");\n\treturn $query;\n}", "function get_contacts_by_company($id) {\n return get_view_data_where('org_contact_list', $id);\n}", "public function index()\n {\n // get logged in user id\n $id = Auth::user()->id;\n // dd($id);\n\n $data['all'] = Contact::Where('user_id', $id)->orWhere('type', 'public')->orderBy('fname')->get();\n $data['auto_search'] = $this->makeAutocompleteSearch($data['all']);\n \n return view(\"contacts\", compact(\"data\"));\n }", "public function contacts()\n {\n return $this->hasMany('Contact');\n }", "public function getContacts()\n {\n // Perform query\n $this->connect();\n $result = $this->conn -> query(\"SELECT * FROM contatti ORDER BY nome\");\n if($result==false){\n echo \"getItems fallita\";\n $this->disconnect();\n return false;\n }\n $rows = array();\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n $this->disconnect();\n return $rows;\n }", "public function contacts($parameters = array())\n {\n $url = self::contacts_uri(self::id());\n $response = new Response(ContactList::get($url, $parameters));\n foreach ($response->items as &$value) {\n $value = new Contact(new Response($value));\n }\n return $response;\n }", "public function index()\n {\n $contacts = auth()->user()->contacts;\n\n return view('users.index', compact('contacts'));\n }", "function get_all_contacts_of_client($client_id) {\n\n $client_access_info = $this->get_access_info(\"client\");\n if ($client_id && ($this->login_user->is_admin || $client_access_info->access_type == \"all\")) {\n $client_contacts = $this->Users_model->get_all_where(array(\"status\" => \"active\", \"client_id\" => $client_id, \"deleted\" => 0))->getResult();\n $client_contacts_array = array();\n\n if ($client_contacts) {\n foreach ($client_contacts as $contacts) {\n $client_contacts_array[] = array(\"type\" => \"contact\", \"id\" => \"contact:\" . $contacts->id, \"text\" => $contacts->first_name . \" \" . $contacts->last_name);\n }\n }\n echo json_encode($client_contacts_array);\n }\n }", "function cmail_contacts_list($attrib)\n {\n global $CONTACTS, $OUTPUT;\n \n // count contacts for this user\n $result = $CONTACTS->list_records();\n \n // add id to message list table if not specified\n if (!strlen($attrib['id']))\n $attrib['id'] = 'rcmAddressList';\n \n // define list of cols to be displayed\n $a_show_cols = array('name');\n\n // create XHTML table\n $out = cmail_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key);\n \n // set client env\n $OUTPUT->add_gui_object('contactslist', $attrib['id']);\n $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page);\n $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size));\n $OUTPUT->include_script('list.js');\n \n // add some labels to client\n $OUTPUT->add_label('deletecontactconfirm');\n \n return $out;\n }", "public function getContacts(array $filters = array())\n {\n $data = array();\n\n if (!empty($filters)) {\n $data['filter'] = $filters;\n }\n\n return $this->_execute('/contact/', self::METHOD_GET, $data);\n }", "function get_all_online_contacts() {\n //get the table and select everything.\n $task = Doctrine_Query::create()\n ->from('Zim_Model_User user')\n ->where('user.status != 0')\n ->andWhere('user.status != 3')\n ->andWhere('user.timedout != 1');\n $exec = $task->execute();\n $contacts = $exec->toArray();\n\n foreach ($contacts as $key => $contact) {\n //if the contacts username is not set then get it from Zikula\n if (!isset($contact['uname']) || empty($contact['uname'])) {\n $contacts[$key]['uname'] = UserUtil::getVar('uname', $contact['uid']);\n }\n }\n\n //return the array of contacts\n return $contacts;\n }", "public function getContact()\n {\n $userId = Yii::$app->user->id;\n\n if ($userId == $this->author_id) {\n return $this->recipient;\n } elseif ($userId == $this->recipient_id) {\n return $this->author;\n }\n\n }", "function get_contacts($action = 'contacts')\n\t{\n\t\t$xml = $this->load_url($action);\n\n\t\tif(!$xml):\n\t\t\treturn false;\n\t\tendif;\n\n\t\t// parse into nicer array\n\t\t$contacts = array();\n\t\t$_contacts = (isset($xml['feed']['entry'])) ? $xml['feed']['entry'] : false;\n\n\n\t\tif(isset($xml['feed']['link']['2_attr']['rel']) && $xml['feed']['link']['2_attr']['rel'] == 'first'):\n\t\t\t$this->contact_meta_data->first_page = $this->get_id_from_link($xml['feed']['link']['2_attr']['href']);\n\t\t\t$this->contact_meta_data->current_page = $this->get_id_from_link($xml['feed']['link']['3_attr']['href']);\n\t\t\t$this->contact_meta_data->next_page = '';\n\t\telseif(isset($xml['feed']['link']['2_attr']['rel']) && $xml['feed']['link']['2_attr']['rel'] == 'next'):\n\t\t\t$this->contact_meta_data->next_page = $this->get_id_from_link($xml['feed']['link']['2_attr']['href']);\n\t\t\t$this->contact_meta_data->current_page = $this->get_id_from_link($xml['feed']['link']['3_attr']['href']);\n\t\t\t$this->contact_meta_data->first_page = $this->get_id_from_link($xml['feed']['link']['4_attr']['href']);\n\t\tendif;\n\n\n\t\tif(is_array($_contacts)):\n\t\t\tif(isset($_contacts[0]['link_attr']['href'])):\n\t\t\t\tforeach($_contacts as $k => $v):\n\t\t\t\t\t$id = $this->get_id_from_link($v['link_attr']['href']);\n\t\t\t\t\t$contact = $v['content']['Contact'];\n\t\t\t\t\t$contact['id'] = $id;\n\t\t\t\t\t$contacts[] = $contact;\n\t\t\t\tendforeach;\n\t\t\telse:\n\t\t\t\t$id = $this->get_id_from_link($_contacts['link_attr']['href']);\n\t\t\t\t$contact = $_contacts['content']['Contact'];\n\t\t\t\t$contact['id'] = $id;\n\t\t\t\t$contacts[] = $contact;\n\t\t\tendif;\n\t\tendif;\n\n\t\treturn $contacts;\n\t}", "public function getContacts(int $page = 1, int $pageSize = 15)\n {\n return $this->doRequest('GET', \"contacts?page={$page}&pageSize={$pageSize}\", []);\n }", "function get_accounts($user_id) {\n\t if ($this->ensure_portal() != -1) {\n\t\t $this->login();\n\t\t\t$ger_params = array(\n\t\t\t 'session' => $this->session,\n\t\t\t 'module_name' => 'Contacts',\n\t\t\t 'module_id' => $user_id,\n\t\t\t 'link_field_name' => 'accounts',\n\t\t\t 'related_module_query' => '',\n\t\t\t 'related_fields' => array(\n\t\t\t 'id',\n\t\t\t 'name',\n\t\t\t ),\n\t\t\t 'related_module_link_name_to_fields_array' => array(\n\t\t\t ),\n\t\t\t 'deleted'=> '0',\n\t\t\t 'order_by' => '',\n\t\t\t 'offset' => 0,\n\t\t\t 'limit' => 5,\n\t\t );\n\n\t\t $ger_result = $this->call(\"get_relationships\", $ger_params);\n\t\t $accounts = [];\n\n\t\t foreach($ger_result->entry_list as $entry) {\n\t\t \t$id = $entry->name_value_list->id->value;\n\t \t\t$name = $entry->name_value_list->name->value;\n\t \t\t$accounts[]= array(\"id\" => $id, \"name\" => $name);\n\t \t}\n\t \treturn $accounts;\n\t } else {\n\t $this->kick();\n\t }\n\t}", "public function index()\n {\n $contacts = Contact::all();\n\n return new ContactResource($contacts);\n }", "public function index()\n {\n $Contacts = $this->ContactModel->all();\n\n return view('admin.contact_list', compact('Contacts'));\n }", "public function contactList(Request $request)\n {\n $order = explode(\" \", $request->get('jtSorting', 'id asc'));\n\n $data = $this->contact->orderBy($order[0], $order[1])\n ->take($request->get('jtPageSize', 10))\n ->skip($request->get('jtStartIndex', 0));\n\n return response()->json([\n 'Result' => 'OK',\n 'TotalRecordCount' => $data->count(),\n 'Records' => $data->get()->toArray()\n ]);\n }", "public function getContacts(): JsonResponse\n {\n return response()->json(Contact::latest()->get());\n }", "public function contacts()\n {\n return $this->hasMany('App\\Contact');\n }", "public function contacts()\n {\n return $this->morphedByMany('App\\Contact', 'taggable');\n }", "public function getContactsByCompanyId($id)\n\t{\n\t\t$sql = $this->db->select()->from(array('c'=>'company_contacts'));\n\t\t\n\t\t$sql = $sql->where(array('c.company_id' => $id));\n\t\t$sql = $sql->join(array('u' => 'users'), 'u.id = c.creator', array('creator_first_name' => 'first_name', 'creator_last_name' => 'last_name'), 'left');\n\t\t\n\t\treturn $this->getRows($sql);\t\t\t\n\t}", "function getContactList($type) {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// the URL expects the type to have a capital first letter - lets force this\n\t$type = ucfirst($type);\n\n\t// use the getURL function to call the URL - remember we are calling the vars we need from the session vars\n\t$response = getURL($apiBaseURL.$_SESSION['companyFileGUID'].'/Contact/'.$type.'/', $_SESSION['username'], $_SESSION['password']);\n\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\n\t// return the response\n\treturn($response);\n\n}", "public function index()\n {\n //$contacts = Contact::paginate(5);\n $contacts = Contact::orderBy('firstName', 'asc')->paginate(5);\n return ContactResource::collection($contacts);\n }", "public function index()\n {\n $contacts = Contact::orderBy('last_name', 'ASC')->paginate(25);\n return view('apps.listmanager.contacts.index', compact('contacts'));\n }", "public function contacts()\n {\n return $this->hasOne(Contact::class);\n }", "public function index()\n {\n // $current_user=auth()->user();\n $contacts=Contact::all();\n return view('contacts.index')\n ->with('contacts',$contacts);\n }", "public function get() {\n\t\t$request = $this->send(\"GET\", \"contacts/\" . $this->contactId, [\n\t\t\t'headers' => [\n\t\t\t\t'Accept' => 'application/json, */*',\n\t\t\t]\n\t\t]);\n\t\treturn $request;\n\t}", "public function actionIndex()\n {\n $query = Contact::find()\n ->userOwner()\n ->user();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort' => [\n 'defaultOrder' => [\n 'name' => SORT_ASC,\n ],\n ],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index(): JsonResponse\n {\n return ContactResource::collection(\n $this->phoneBookService->contactsList()\n )\n ->response();\n }", "public function getContactsForRemoving()\n {\n return $this->contactsForRemoving;\n }" ]
[ "0.84056926", "0.7956069", "0.7780156", "0.77772766", "0.7696533", "0.76697344", "0.7575623", "0.7485982", "0.7482095", "0.7473542", "0.7431012", "0.7427027", "0.73860365", "0.7341294", "0.733686", "0.7322364", "0.72895104", "0.7230536", "0.72249645", "0.72197455", "0.71319115", "0.7121987", "0.71154904", "0.70977557", "0.70362234", "0.69341904", "0.68727946", "0.68098634", "0.67883474", "0.6761516", "0.67460734", "0.6745505", "0.6736854", "0.6736786", "0.66954607", "0.66877675", "0.6683717", "0.66818345", "0.66735697", "0.6661283", "0.6656139", "0.6655113", "0.661396", "0.660942", "0.6586978", "0.6586363", "0.65560895", "0.65379965", "0.6519736", "0.6516134", "0.65103847", "0.6447346", "0.64470434", "0.6442122", "0.64073443", "0.6392564", "0.63897496", "0.63663846", "0.6330007", "0.6320264", "0.63045913", "0.6285481", "0.6268546", "0.6261244", "0.62607735", "0.62536776", "0.62522006", "0.6239308", "0.62334996", "0.6228707", "0.62263733", "0.6216179", "0.6212094", "0.6207952", "0.62018806", "0.61997694", "0.6195021", "0.61448646", "0.61439204", "0.61334294", "0.6116826", "0.61143965", "0.6093536", "0.6086678", "0.6076635", "0.6061172", "0.60546374", "0.60392153", "0.60389763", "0.6026011", "0.60233456", "0.6022376", "0.60136014", "0.60068816", "0.600426", "0.6003032", "0.60020185", "0.60010356", "0.5992799", "0.59815097" ]
0.6700153
34
/ Favorites methods Adds a photo to a user's favorites list.
function favorites_add ($photo_id) { $response = $this->execute(array('method' => 'flickr.favorites.add', 'photo_id' => $photo_id), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function favorites($user, $options = []);", "public function favorite(){\n $attributes = ['user_id' => auth()->id()];\n\n if(! $this->favorites()->where($attributes)->exists()){\n return $this->favorites()->create($attributes);\n }\n }", "public function favorite()\n {\n $attributes = ['user_id' => auth()->id()];\n\n if (! $this->favorites()->where($attributes)->exists()) {\n return $this->favorites()->create($attributes);\n }\n }", "public function addToFavorites($data);", "function addToFavorites() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $data = json_decode(file_get_contents(\"php://input\"),true);\n $userId = $data[\"user_id\"];\n $videoId = $data[\"video_id\"];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($userId, $auth)) {\n $this->response('', 400);\n }\n \n $query = \"insert into favorites (user_id, video_id) values($userId, $videoId);\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Added to Favorites.\", \"data\" => $data);\n $this->response(json_encode($success),200);\n }", "public static function add_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if ( ! empty( $_GET['id'] ) ) {\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n $favorites = ! is_array( $favorites ) ? array() : $favorites;\n\n if ( empty( $favorites ) ) {\n $favorites = array();\n }\n\n $post = get_post( $_GET['id'] );\n $post_type = get_post_type( $post->ID );\n\n if ( 'property' != $post_type ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'This is not property ID.', 'realia-favorites' ),\n );\n } else {\n $found = false;\n\n foreach ( $favorites as $property_id ) {\n if ( $property_id == $_GET['id']) {\n $found = true;\n break;\n }\n }\n\n if ( ! $found ) {\n $favorites[] = $post->ID;\n update_user_meta( get_current_user_id(), 'favorites', $favorites );\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property is already in list', 'realia-favorites' ),\n );\n }\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property ID is missing.', 'realia-favorites' ),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "function favorites() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n if ($id > 0) {\n $query = \"select * from favorites where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n } \n }", "public function favorite($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\tif($userId) {\n\t\t\t$favorite = $this->favorites()\n\t\t\t\t->where('user_id', '=', $userId)\n\t\t\t\t->first();\n\n\t\t\tif($favorite) return;\n\n\t\t\t$favorite = new Favorite();\n\t\t\t$favorite->user_id = $userId;\n\t\t\t$this->favorites()->save($favorite);\n\t\t}\n\n\t\t$this->incrementFavoriteCount();\n\t}", "public function favorite($userId=null)\n {\n if (is_null($userId)) {\n $userId = Auth()->id();\n }\n \n if ($userId) {\n $favorite = $this->favorites()\n ->where('user_id', '=', $userId)\n ->first();\n \n if ($favorite) {\n return;\n }\n\n $favoriteClass = config('favorable.favorite_model');\n\n $favorite = new $favoriteClass();\n $favorite->user_id = $userId;\n $this->favorites()->save($favorite);\n }\n\n $this->incrementFavoriteCount();\n }", "public function favorite(Request $request)\n {\n // check for login\n if(!Auth::user()){\n // error message\n Session::flash('error', 'Onbevoegde toegang');\n return redirect('/home');\n }\n\n // validate the form data that we got via POST request\n $this->validate($request, [\n 'favoriteCarId' => 'required|string'\n ]);\n \n // Get id of current car we are adding as favorite\n $favoriteCarId = $request->input('favoriteCarId');\n // find the current user by id and get his data\n $user = User::findOrFail(auth()->user()->id);\n // Get current favorites\n $userFavorites = json_decode($user->favorites);\n\n // if user does not have favorites create array of favorites and add the car to add\n if ($userFavorites == '' or $userFavorites == []){\n // add id to favorites when user has no favorites \n $userFavorites[] = $favoriteCarId;\n Session::flash('success', 'Aan favorieten toegevoegd');\n }\n //if user has favorites save the favorites\n else {\n // If the id already exists in favorites remove it\n if (in_array($favoriteCarId, $userFavorites)){\n // remove the id\n $userFavorites = array_diff($userFavorites, array($favoriteCarId));\n // Reindex the array\n $userFavorites = array_values($userFavorites);\n Session::flash('success', 'Uit favorieten verwijderd');\n }\n // If the id does not exist add to favorites\n else {\n $userFavorites[] = $favoriteCarId;\n Session::flash('success', 'Aan favorieten toegevoegd');\n }\n }\n\n // Save changes to database\n $user->favorites = json_encode($userFavorites, JSON_NUMERIC_CHECK);\n $user->save();\n\n //redirect\n return redirect()->route('occasions.index');\n }", "public function addFavourite(Request $request){\n \t$this->validate($request, [\n \t\t'job_id' => 'required|integer',\n \t]);\n\n \t// Find the currently authenticated user\n \t$user = Auth::user();\n\n \t$favourite = new Favourite();\n \t$favourite->job_id = $request->input('job_id');\n\n \t$user->favourites()->save($favourite);\n\n \treturn redirect('/jobs/'.$request->input('job_id'))->with('success', 'Favourite added');\n }", "public function favorite($id)\n {\n\n $uid = Auth::user()->id;\n $user = \\App\\User::where('id', $uid)->first();\n $recipe = \\App\\Recipe::where('id', $id)->first();\n $hasfavorited = \\App\\User::whereHas('favorites', function($q) use($uid, $id) {\n $q->where ('favorited', '1');\n $q->where ('recipe_id', $id);\n })->exists();\n\n $user->favorites()->attach($recipe->id, ['favorited' => '1']);\n return redirect()->route('recipes.show',$recipe->id)->with('message', 'You succesfully favorited the recipe.');\n}", "public function actionFavorites()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\t\n\t\t$unfavorite = Yii::app()->request->getParam('unfavorite');\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\n\t\tif($unfavorite && $user_id) {\n\t\t\t\n\t\t\t$record = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $unfavorite));\n\t\t//\tdie(print_r($record));\n\t\t\tif($record)\n\t\t\t\t$record->delete();\n\t\t//\t$this->redirect('/cabinet/favorites');\n\t\t//\t Yii::app()->end();\n\n\t\t}\t\n\n\n\t\t\n\t\tif($user_id) {\n\t\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\t\n\t\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t\t if ($fruit_name == 1) {\n\t\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t\t }\n\t\t\t next($cookie_favorite);\n\t\t\t}\n\t\t\t\n\t\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\t\tif(!$favorite) {\n\t\t\t\t\t$record = new Favorited;\n\t\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t\t$record->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$this->checkUser();\n\t\t$favarray = array();\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\t//echo print_r($cookie_favorite, true);\n\t\t\n\t\tforeach($cookie_favorite as $cookie_key => $cookie_value) {\n\t\t\t\n\t\t if ($cookie_value && $unfavorite != $cookie_key) {\n\t\t $cookie_fav_wrap[] = $cookie_key;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\tif ($unfavorite != $fav_item) \n\t\t\t\t$favarray[] = $fav_item;\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\n\t\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t\tif($fav->object_id == $unfavorite)\n\t\t\t\t$fav->delete();\n\t\t}\t\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\tif($unfavorite != $favorite->object_id) {\n\t\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\tunset($_COOKIE['favorite']);\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t$cookie->path = '/';\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t} else {\n\t\t\tif(!$user_id && $unfavorite) {\n\t\t\t\tforeach($favarray as $favorite) {\n\t\t\t\t\t$cookie_fav_wrap[$favorite] = true;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\t\tunset($_COOKIE['favorite']);\n\t\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t\t$cookie->path = '/';\n\t\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t}\n\n\t\t\n\t\t$this->render('favorites',array('objects'=>$objects,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "public function addToFavorite($account_id, $item_id);", "private function addFavorite()\n {\n try\n {\n $request = $_POST;\n\n if (!isset($request['type'])) {\n throw_error_msg(\"Type not provided\");\n }\n\n if ($request['type'] == 'video' || $request['type'] == 'collection') {\n //check if video id provided\n if( !isset($request['type_id']) || $request['type_id']==\"\" )\n throw_error_msg(\"type_id not provided.\");\n\n if( !is_numeric($request['type_id']) )\n throw_error_msg(\"invalid type_id\");\n\n $type_id = mysql_clean($request['type_id']);\n if ($request['type'] == 'video') {\n global $cbvid;\n $cbvid->action->add_to_fav($type_id);\n }\n\n if ($request['type'] == 'collection') {\n global $cbcollection;\n $cbcollection->action->add_to_fav($type_id);\n }\n \n }\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n { \n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'added to favorites', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function getAllFavorites($user_id);", "public function favorite()\n\t{\n\t\t$service = $this->lib->input_post('service');\n\t\t$service = $this->services[$service];\n\n\n\t\t$video_page = $this->lib->input_post('video_page');\n\n\t\t$video_id = $service->get_video_id($video_page);\n\n\n\t\t// check if already a fav\n\n\t\t$already_fav = $service->is_favorite($video_id);\n\n\n\t\tif($already_fav)\n\t\t{\n\t\t\t// remove favorite if it is\n\t\t\t\n\t\t\t$service->remove_favorite($video_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// add favorite if it's not\n\n\t\t\t$service->add_favorite($video_id);\n\t\t}\n\t}", "public function add_favorite() {\n\t\t\tif ($this->userInfo['users']['id']) {\n\t\t\t\t$uid = $this->userInfo['users']['id'];\n\t\t\t}\n\t\t\tif ($this->request->is('get')) {\n\t \t\t\t$user_id = $_GET['user_id'];\n\t\t\t\t$favorite = $_GET['favorite'];\n\t \t\t$content_id = $_GET['content_id'];\n\t\t\t\t$created = date(\"Y-m-d H:i:s\");\n\t\t\t\t$content_type = \"tweets\";\n\t\t\t\t$this->request->data = '';\n\t\t\t\t$this->loadModel('Favorite');\n\t\t\t\t$checkInDB = $this->Favorite->find('first',array('fields'=>array('Favorite.id'),'conditions'=>array('Favorite.content_id='.$content_id)));\n\t\t\t\tif ($checkInDB) {\n\t\t\t\t\t$id = $checkInDB['Favorite']['id'];\n\t\t\t\t\t$this->Favorite->id = $id;\n\t\t\t\t\t$this->request->data['Favorite']['created'] = $created;\n\t\t\t\t\t$this->request->data['Favorite']['favorite'] = $favorite;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->request->data['Favorite']['user_id'] = $user_id;\n\t\t\t\t\t$this->request->data['Favorite']['content_type'] = $content_type;\n\t\t\t\t\t$this->request->data['Favorite']['content_id'] = $content_id;\n\t\t\t\t\t$this->request->data['Favorite']['created'] = $created;\n\t\t\t\t\t$this->request->data['Favorite']['favorite'] = $favorite;\n\t\t\t\t}\n\t\t\t\tif (ClassRegistry::init('Favorite')->save($this->request->data)){\n\t\t\t\t//echo \"field value saved\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\n\t\t\t\techo \"field value not saved\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t$this->set('favorite',$favorite);\n\t\t\t$this->set('content_id',$content_id);\n\t\t\t$this->autorender = false;\n\t \t$this->layout = false;\n\t \t$this->render('add_favorite');\n\t\t}", "public function getFavorites()\n {\n $tricks = $this->tricks->findAllFavorites($this->user);\n\n $this->view('user.favorites', compact('tricks'));\n }", "public function addToFavorites($objid);", "public function favourite()\n {\n return $this->belongsToMany('App\\User', 'favourite', 'media_id', 'user_id');\n }", "public function user_favorites() {\n\t\t\tif ($this->request->is('get')) {\n\t\t\t\t$user_id = $_GET['user_id'];\n\n\t\t\t$tweet_favorites = ClassRegistry::init('tweets')->find('all', array('fields' => array('tweets.tweet,tweets.photo, tweets.created ,users_profiles.firstname, users_profiles.lastname,users_profiles.photo,users_profiles.user_id,users_profiles.handler,favorites.favorite,favorites.content_id,favorites.id ,favorites.user_id'),'order'=>'favorites.id DESC',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites', 'table' => 'favorites', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('favorites.content_id = tweets.id ')),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('favorites.user_id ='.$user_id.' AND favorites.content_type=\"tweets\"')));\n\t\t\n\t\t$this->set('tweet_favorites',$tweet_favorites);\n\t\t\n\t\t/*user friends start*/\t\n\t$reqUser = ClassRegistry::init('connections')->find('all',array('fields'=>array('connections.friend_id,connections.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('(connections.user_id='.$user_id.' OR connections.friend_id='.$user_id.') AND connections.request=1')));\n\t\t\t\n\t\tforeach ($reqUser as $rfid) {\n\t\t\t\tif ($rfid['connections']['friend_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['friend_id'];\n\t\t\t\t}\n\t\t\t\tif ($rfid['connections']['user_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['user_id'];\n\t\t\t\t} \n\t\t}\n\t\t/*user friends end*/\n\t\t\n\t\tif($comResult){\n\t\t\tif (sizeof($comResult)>1) {\n\t\t\t \t$result =@implode(',',$comResult);\n\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\tforeach ($comResult as $key=>$value) {\n\t\t\t\t\t\t\t\t\t$result = $value;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$user_tweet_comments = ClassRegistry::init('Tweet_comment')->find('all', array('fields' => array('\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.tweet_comment,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.created,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.firstname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.lastname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.photo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.user_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.tags,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.favorite,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.user_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'Tweet_comment.id DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.id = favorites.content_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.user_id = users_profiles.user_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('Tweet_comment.user_id IN ('.$result.','.$user_id.')'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Tweet_comment.comment_type = \"tweets\"'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'group' => 'Tweet_comment.id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\n\t\t$this->set('user_tweet_comments',$user_tweet_comments);\n\t\t}\n\t\t\n\t\t\t/*********************************** Retweeted tweets by user **********/\n\t$retweeted_tweets = ClassRegistry::init('tweets')->find('all',array('fields'=>array('tweets.parent_id,tweets.id,tweets.user_id,users_profiles.firstname, users_profiles.lastname, users_profiles.handler, users_profiles.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'joins'=>array(array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('tweets.parent_id !=0 AND tweets.status=2')));\n\t\t$this->set('retweeted_tweets',$retweeted_tweets);\n\t\t\n\t\t\n\t\t if ($user_id) {\n\t\t$favorites_on_Tweet = ClassRegistry::init('favorites')->find('all', array('fields'=>array('favorites.user_id,favorites.favorite,favorites.content_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'favorites.id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorites.content_type=\"tweets\" AND favorites.user_id='.$user_id)));\n\n\t\t$this->set('favorites_on_Tweet',$favorites_on_Tweet);\n\t\t\n\t\t/*Tweet count for current user*/\n\t$tweets_count_added_user= ClassRegistry::init('tweets')->find('all',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('conditions'=>array('tweets.user_id='.$user_id.' AND tweets.status=2')));\n\t\t\n\t$this->set('tweets_count_added_user',sizeof($tweets_count_added_user));\n\n\t\t\t\t\t/************************************** To show user following and followers ***********************/\n\t\t\t\t$userFollowings = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status, count(users_followings.following_id) as total_following'),'conditions'=>array('users_followings.user_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t$userFollows = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status ,count(users_followings.user_id) as total_follow'),'conditions'=>array('users_followings.following_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t\n\t\t$userFollowingsbyYou = $userFollowings[0][0];\n\t\t$userFollowingsbyYou = $userFollowingsbyYou['total_following'];\n\t\t$this->set('following',$userFollowingsbyYou);\n\t\t\n\t\t$userFollowYou = $userFollows[0][0];\n\t\t$userFollowYou = $userFollowYou['total_follow'];\n\t\t$this->set('followers',$userFollowYou);\t\t\n\t\t$this->set('userName',$this->userInfo['users_profiles']);\n\n\t\t }\n\t\t\n\t\t\n\t\t$this->autorender = false;\n\t $this->layout = false;\n\t $this->render('user_favorites');\n\t\t}\n\t}", "function bp_activity_action_mark_favorite() {\n\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'mark_favorite' );\n\n\tif ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )\n\t\tbp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' );\n\n\tbp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );\n}", "public function addFavourite(User $user)\n {\n $favourite = $user->favourites()\n ->where('favourite_id', $this->id)\n ->first();\n\n if(isset($favourite->id))\n {\n return $favourite->delete();\n }\n\n return $this->favourites()->create([\n 'user_id' => $user->id\n ]);\n }", "public function favoritePost(Post $post){\n\t Auth::user()->favorites()->attach($post->id);\n\t return back();\n\t}", "public function favorite(Request $request)\n\t{\n\t\t// Ajax request so no debugbar on the response\n\t\t\\Debugbar::disable();\n\t\t\n\t\t// Check if it exists, cause we're going to undo it if it's there\n\t\t$favorite = Favorite::where('user_id', '=', Auth::user()->id)->where('listing_id', '=', $request->listing_id)->first();\n\t\t\n\t\tif(isset($favorite)){\n\t\t\t// Delete it\n\t\t\t$favorite->delete();\n\t\t} else {\n\t\t\t// Add it\n\t\t\t$favorite = new Favorite();\n\t\t\t$favorite->listing_id = $request->listing_id;\n\t\t\t$favorite->user_id = Auth::user()->id;\n\t\t\t$favorite->save();\n\t\t}\n\t\t\n\t\treturn 200;\n\t}", "public function getFavorites();", "function bp_activity_action_favorites_feed() {\n\tif ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {\n\t\treturn false;\n\t}\n\n\t// get displayed user's favorite activity IDs\n\t$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );\n\t$fav_ids = implode( ',', (array) $favs );\n\n\t// setup the feed\n\tbuddypress()->activity->feed = new BP_Activity_Feed( array(\n\t\t'id' => 'favorites',\n\n\t\t/* translators: User activity favorites RSS title - \"[Site Name] | [User Display Name] | Favorites\" */\n\t\t'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),\n\n\t\t'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',\n\t\t'description' => sprintf( __( \"Activity feed of %s's favorites.\", 'buddypress' ), bp_get_displayed_user_fullname() ),\n\t\t'activity_args' => 'include=' . $fav_ids\n\t) );\n}", "public function favorited($userId=null)\n {\n if (is_null($userId)) {\n $userId = Auth()->id();\n }\n \n return (bool) $this->favorites()\n ->where('user_id', '=', $userId)\n ->count();\n }", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function favoriteAction ()\n {\n /* @var $em \\Doctrine\\ORM\\EntityManager */\n $em = $this->get('doctrine')->getManager();\n \n $user = $this->getUser();\n if(!$user) {\n throw new UnauthorizedHttpException('You must be logged in to comment.');\n }\n \n $request = $this->getRequest();\n $decklist_id = filter_var($request->get('id'), FILTER_SANITIZE_NUMBER_INT);\n \n /* @var $decklist \\Netrunnerdb\\BuilderBundle\\Entity\\Decklist */\n $decklist = $em->getRepository('NetrunnerdbBuilderBundle:Decklist')->find($decklist_id);\n if (! $decklist)\n throw new NotFoundHttpException('Wrong id');\n \n $author = $decklist->getUser();\n \n $dbh = $this->get('doctrine')->getConnection();\n $is_favorite = $dbh->executeQuery(\"SELECT\n\t\t\t\tcount(*)\n\t\t\t\tfrom decklist d\n\t\t\t\tjoin favorite f on f.decklist_id=d.id\n\t\t\t\twhere f.user_id=?\n\t\t\t\tand d.id=?\", array(\n $user->getId(),\n $decklist_id\n ))\n ->fetch(\\PDO::FETCH_NUM)[0];\n \n if ($is_favorite) {\n $decklist->setNbfavorites($decklist->getNbfavorites() - 1);\n $user->removeFavorite($decklist);\n if ($author->getId() != $user->getId())\n $author->setReputation($author->getReputation() - 5);\n } else {\n $decklist->setNbfavorites($decklist->getNbfavorites() + 1);\n $user->addFavorite($decklist);\n $decklist->setTs(new \\DateTime());\n if ($author->getId() != $user->getId())\n $author->setReputation($author->getReputation() + 5);\n }\n $this->get('doctrine')\n ->getManager()\n ->flush();\n \n return new Response(count($decklist->getFavorites()));\n \n }", "public function favorited($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\treturn (bool) $this->favorites()\n\t\t\t->where('user_id', '=', $userId)\n\t\t\t->count();\n\t}", "function add_to_fav($id)\r\n\t{\r\n\t\t global $db;\r\n\t\t $id = mysql_clean($id);\r\n\t\t //First checking weather object exists or not\r\n\t\t if($this->exists($id))\r\n\t\t {\r\n\t\t\tif(userid())\r\n\t\t\t{\r\n\t\t\t\tif(!$this->fav_check($id))\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t$db->insert(tbl($this->fav_tbl),array('type','id','userid','date_added'),array($this->type,$id,userid(),NOW()));\r\n\t\t\t\t\taddFeed(array('action'=>'add_favorite','object_id' => $id,'object'=>'video'));\r\n\t\t\t\t\t//adding according to type\r\n\t\t\t\t\tswitch ($this->type) {\r\n\t\t\t\t\t\tcase 'cl':\r\n\t\t\t\t\t\t\t# code...\r\n\t\t\t\t\t\t\t$the_type = 'collection';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'p':\r\n\t\t\t\t\t\t\t# code...\r\n\t\t\t\t\t\t\t$the_type = 'photo';\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t# code...\r\n\t\t\t\t\t\t\t$the_type = 'video';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//Logging Favorite\r\n\t\t\t\t\t$log_array = array(\r\n\t\t\t\t\t\t'success'=>'yes',\r\n\t\t\t\t\t\t'details'=> \"added \".$this->name.\" to favorites\",\r\n\t\t\t\t\t\t'action_obj_id' => $id,\r\n\t\t\t\t\t\t'action_done_id' => $db->insert_id()\r\n\t\t\t\t\t);\r\n\t\t\t\t\tinsert_log($this->name.'_favorite',$log_array);\r\n\r\n\t\t\t\t\te('<div class=\"alert alert-success\">'.sprintf(lang('add_fav_message'), lang($this->name)).'</div>', \"m\" );\r\n\t\t\t\t} else {\r\n\t\t\t\t\te(sprintf(lang('already_fav_message'), lang($this->name)));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\te(lang(\"you_not_logged_in\"));\r\n\t\t\t}\r\n\t\t } else {\r\n\t\t\t e(sprintf(lang(\"obj_not_exists\"),$this->name));\r\n\t\t }\r\n\t }", "public function addUserFavorite(UserFavorite $l)\n\t{\n\t\tif ($this->collUserFavorites === null) {\n\t\t\t$this->initUserFavorites();\n\t\t}\n\t\tif (!in_array($l, $this->collUserFavorites, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collUserFavorites, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "public function actionFavorites()\n {\n $this->pageTitle = 'Your Favorite Pages';\n\n $data['favorites'] = Favorites::model()->all();\n $this->render('//content/favorites', $data);\n\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t\t\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t if ($fruit_name == 1) {\n\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t }\n\t\t next($cookie_favorite);\n\t\t}\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\tif(!$favorite) {\n\t\t\t\t$record = new Favorited;\n\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t$record->save();\n\t\t\t}\n\t\t}\n\t\tunset(Yii::app()->request->cookies['favorite']);\n\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\t\n\t\t$favarray = array();\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t}\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t}\n\t\t\n\t\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t}\t\n\n\t\t\t\n\t\t$flats = Estate::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id),array('order'=>$order_field.' '.$order_dir));\n\t\t\n\t\t$this->render('index',array('flats'=>$flats, 'favarray'=>$favarray,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "public function favourites($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif(!$user = User::findUser(array('user_id' => $id)))\n\t\t{\n\t\t\t// something has gone wrong with db request\n\t\t\theader(\"Location: /myrecipe/users/\".$id);\n\t\t\texit;\n\t\t}\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t// find all the favourites\n\t\t$data = array('favourites.user_id'=>$id, 'recipe_images.is_cover'=>'yes');\n\t\t$favourites = Favourites::findFavourites($data);\n\t\t$this->template->favourites = $favourites;\n/*\t\techo \"<pre>\";\n\t\tprint_r($favourites);\n\t\techo \"</pre>\";\n*/\n\t\t$this->template->display('favourites.html.php');\n\t}", "public function favorite($id, $options = []);", "public function favorite($imageHash)\n {\n $this->setEndpoint(Endpoint::IMAGE_FAVORITE);\n\n $this->setQueryImageHash($imageHash);\n\n return $this->post();\n }", "public function userFavorites() {\n return $this->belongsToMany('App\\User');\n }", "public function favourites(){\n return $this->hasMany('App\\Favourite', 'user_id');\n }", "public function addFavorite() {\r\n $video_id = Input::get('video_id');\r\n $user_id = Input::get('user_id');\r\n\r\n $favorite = VideoFavorites::where('video_id', $video_id)\r\n ->where('user_id', $user_id)\r\n ->first();\r\n if ($favorite) {\r\n $data = ['result' => 'already_exist'];\r\n } else {\r\n $favorite = new VideoFavorites();\r\n $favorite->video_id = $video_id;\r\n $favorite->user_id = $user_id;\r\n if ($favorite->save())\r\n $data = ['result' => 'success'];\r\n else\r\n $data = ['result' => 'error'];\r\n }\r\n\r\n return response()->json($data);\r\n }", "public function set_fav($username = '', $id = '') {\n\t\t\n\t\tif ($username == '') return 0;\n\t\tif ($id == '') return 0;\n\t\t\n\t\t$key = $this->_get_user_fav_key($username);\n\t\t\n\t\t// check whether it is already set\n\t\t$score = Redis::zscore($key, $id);\n\t\tif ($score != '') \n\t\t\treturn 1;\n\t\t//\n\t\t\n\t\t//use current time as score\n\t\t$ret = Redis::zadd($key, time(), $id); \n\t\t\n\t\tif ($ret == 1)\n\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t }", "public function favorites(){\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function saveFavorite()\n {\n\n $this->addFavorite();\n\n return redirect('/search')->withInput();\n\n }", "public function addToFavoritesBooks()\n {\n $objectModel = \"addToFavoritesBooks\";\n $errorMessage = \"Oups, désolé mais il est impossible d'ajouter le livre à vos favoris.\";\n $successMessage = \"Le livre a bien été ajouté à vos favoris.\";\n\n $this->structureMethodAddOrRemoveFlags($objectModel, $errorMessage, $successMessage);\n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function favorites()\n {\n $favoriteClass = config('favorable.favorite_model');\n\n return $this->morphMany($favoriteClass, 'favoriteable');\n }", "public function favorites() {\n\t\t$favoriteSounds = Sound::whereHas('favorite', function($query) {\n\t\t\t$user = Auth::user();\n\n\t\t\t$query->where('userId', '=', $user->id);\n\t\t});\n\n\t\treturn Responder::success([\n\t\t\t'favoriteSounds' => $favoriteSounds->get()\n\t\t]);\n\t}", "public function favourites()\n {\n return $this->morphMany(Favourite::class, 'favourite');\n }", "public function user_can_add_news_into_favorite()\n {\n //Arrange\n $user = User::create([\n \"email\"=>\"[email protected]\",\n \"name\" =>\"test\",\n \"date_of_birth\"=>\"2000-12-12\",\n \"password\"=>bcrypt(\"12345678\")\n ]);\n $this->post('api/login',[\"email\"=>\"[email protected]\",\"password\"=>\"12345678\"]);\n\n //Act\n $response = $this->post('api/favorite',[\n \"url\"=>\"test.com\",\n \"urlToImage\"=>\"test.com/a.jpg\",\n \"title\"=>\"test\",\n \"description\"=>\"testing\",\n \"author\"=>\"tester\",\n \"publishedAt\"=>\"2001-12-12\"\n ]);\n \n $favorite = Favorite::where('url','test.com')->first();\n \n //Assert\n\n // Check a new record for the favorite inserted in the favorite table\n $this->assertDatabaseHas('favorites',['url'=>'test.com']);\n // Check a new record holds relation bewteen favorite and user\n $this->assertDatabaseHas('user_favorite',['user_id'=>$user->id,'favorite_id'=>$favorite->id]);\n $response->assertStatus(201);\n }", "function addconfig_to_favoritesAction()\n\t{\n\t\t$session = Mage::getSingleton('customer/session');\n\t\t $this->_customerId = $session->getCustomer()->getId();\n\t\t $list = Mage::getModel('amlist/list');\n\t \t $listId = $this->getRequest()->getParam('list');\n\t\t $post = $this->getRequest()->getPost();\n\t\t $products = $post['product'];\n\t\t if (!$listId){ //get default - last\n\t $listId = Mage::getModel('amlist/list')->getLastListId($this->_customerId);\n\t \t }\n\t \t if (!$listId) \n\t\t { \n\t\t //create new\n\t\t //print_r($post['selected_productid']);\n\t\t //exit;\n\t Mage::getSingleton('amlist/session')->setAddProductId($post['selected_productid']);\n\t\t Mage::getSingleton('amlist/session')->setAddAllProductId($products);\n\t $this->_redirect('amlist/list/edit/');\n\t return;\n\t }\n\t\t\tif($post['selected_productid'])\n\t\t\t{\n\t\t\t\t\n\t\t\t\tforeach($products as $_product)\n\t\t\t\t{\n\t\t\t\t\tif($post['selected_productid']==$_product[product]):\n\t\t\t\t\t\t$item = Mage::getModel('amlist/item')\n\t\t\t\t\t\t->setProductId($_product[product])\n\t\t\t\t\t\t->setListId($listId) \n\t\t\t\t\t\t->setQty($_product[qty])\n\t\t\t\t\t\t->setBuyRequest(serialize($_product));\n\t\t\t\t\t\t$item->save();\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t}\n\t\t\t\t Mage::getSingleton('core/session')->addSuccess($this->__('Product has been successfully added to the folder.'));\n\t\t\t\t $this->_redirectReferer();\n\t\t\t}\n\t}", "public function add( $args, $assoc_args ) {\n\t\t$user = $this->get_user_id_from_identifier( $assoc_args['user-id'] );\n\n\t\t// Check if topic exists.\n\t\t$topic_id = $assoc_args['topic-id'];\n\t\tif ( ! bbp_is_topic( $topic_id ) ) {\n\t\t\t\\WP_CLI::error( 'No topic found by that ID.' );\n\t\t}\n\n\t\t// True if added.\n\t\tif ( bbp_add_user_favorite( $user->ID, $topic_id ) ) {\n\t\t\t\\WP_CLI::success( 'Favorite successfully added.' );\n\t\t} else {\n\t\t\t\\WP_CLI::error( 'Could not add favorite.' );\n\t\t}\n\t}", "public function favorite(Post $post)\n {\n if (Groupe::findOrFail($post->groupe_id)->is_member())\n return $post->favorited_users()->toggle(Auth::user());\n \n return response()->json(['message' => 'Not a member'], 200);\n /*if (empty($post->favorited_users()->find(Auth::id()))) {\n $post->favorited_users()->attach(Auth::id());\n return response()->json(['message' => 'Le post a été aimé avec succès'], 200);\n } else {\n DB::table('favorises')->where('compte_id', Auth::id())->where('post_id', $post->id)->delete();\n return response()->json(['message' => 'Le post a été - avec succès'], 200);\n }*/\n }", "public function favourite($id){\n $category = CategoryModel::instantiate()->findOrFail($id);\n $user = auth_user();\n\n // Store that user searched this product\n // If user visited before, increment count\n $userCategory = $category->stats();\n\n if (!$userCategory){\n $userCategory = new UserCategoriesModel([\n 'user_id' => $user->id,\n 'category_id' => $category->id,\n 'followed' => (bool) false,\n 'count' => 0\n ]);\n $userCategory->save();\n }\n $userCategory->followed = !$userCategory->followed;\n $userCategory->update();\n\n $msg = new \\Plasticbrain\\FlashMessages\\FlashMessages();\n if (!$userCategory->followed){\n $msg->success( 'Category removed from favourites categories!' );\n } else {\n $msg->success( 'Category added to favourites categories!' );\n }\n\n return $this->redirectBack();\n\n }", "public function store(Request $request)\n {\n $model = new FavoritesModel();\n $model->id = UUID::generate();\n $model->users_id = $request->input('users_id');\n $model->news_id = $request->input('news_id');\n if($model->save()){\n return Common::returnErrorResult(200,'收藏成功','');\n }\n else{\n return Common::returnErrorResult(400,'传参错误','');\n }\n // $result = \\Auth::user()->favorites()->attach($request->get('news_id'));\n }", "public function favorites() {\n return $this->hasMany(Favorite::class);\n }", "public function action_add(){\n\t\t$monumentId = $this->request->param('id');\n\t\t$user = Auth::instance()->get_user();\n\t\t\n\t\t// Add the monument to the favorite list of the current user\n\t\t$favoriteList = new Model_List_Favorite();\t\t\n\t\t$favoriteList->add($monumentId, $user->UserID);\n\t\t\n\t\t// Redirect the user back to the monument page\n\t\t$this->request->redirect('monument/view/' . $monumentId);\n\t}", "public function get_favorites()\n {\n return view('content.favorites')\n ->with('page_title', 'Your Favorite Pages')\n ->with('titles', Favorite::all());\n }", "public static function loop_my_favorites() {\n $paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n if( ! is_array( $favorites ) || count( $favorites ) == 0 ) {\n $favorites = array( '', );\n }\n\n query_posts( array(\n 'post_type' => 'property',\n 'paged' => $paged,\n 'post__in'\t\t=> $favorites,\n 'post_status' => 'publish',\n ) );\n }", "protected function favorited($username)\n {\n $user = User::whereUsername($username)->first();\n\n $presentIds = $user ? $user->favorites()->pluck('id')->toArray() : [];\n\n return $this->builder->whereIn('id', $presentIds);\n }", "public function initUserFavorites()\n\t{\n\t\t$this->collUserFavorites = array();\n\t}", "function favorites_page_handler ($page) {\n\tgatekeeper();\n\n\tif (empty($page[0])) {\n\t\t$user = elgg_get_logged_in_user_entity();\n\t} else {\n\t\t$user = get_user_by_username($page[0]);\n\n\t\tif (!$user) {\n\t\t\tregister_error(elgg_echo('favorites:notfound'));\n\t\t\tforward(REFERER);\n\t\t}\n\t}\n\n\tif ($user->guid == elgg_get_logged_in_user_guid()) {\n\t\t$title = elgg_echo('favorites:own');\n\t} else {\n\t\t$title = elgg_echo('favorites:user', array($user->name));\n\t}\n\n\t$content = elgg_list_entities_from_relationship(array(\n\t\t'relationship_guid' => $user->getGUID(),\n\t\t'relationship' => 'favorite',\n\t\t'inverse_relationship' => true,\n\t\t'full_view' => false,\n\t\t'order_by' => 'r.time_created DESC',\n\t));\n\n\tif (!$content) {\n\t\t$content = elgg_echo('favorites:none');\n\t}\n\n\t$params = array(\n\t\t'title' => \t$title,\n\t\t'content' => $content,\n\t\t'filter' => '',\n\t);\n\n\t$body = elgg_view_layout('content', $params);\n\techo elgg_view_page($title, $body);\n}", "public static function favourite ( $type = 'create', $id = '' ) {\n\n\t\tif ( ! in_array($type, array('destroy', 'create'))) {\n\t\t\t$type = 'create';\n\t\t}\n\n\t\tstatic::api()->request('POST', static::api()->url('1.1/favorites/' . $type), array(\n\t\t\t'id' => $id,\n\t\t\t'include_entities' => false\n\t\t));\n\n\t\t$response = static::api()->response['response'];\n\t\t$code = static::api()->response['code'];\n\n\t\tif ($code === 200) {\n\t\t\treturn json_decode($response, false, 512, JSON_BIGINT_AS_STRING);\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function favorites()\n\t{\n\t\treturn $this->morphMany(Favorite::class, 'favoriteable');\n\t}", "public function favourites()\n {\n return $this->hasMany(Favourite::class);\n }", "public function favorites()\n {\n return $this->belongsToMany(Question::class, 'favorites', 'user_id', 'question_id')->withTimestamps();\n }", "public function showFavorites()\n {\n\n $favorites = Auth::user()->favorites()->orderBy('company_name')->get();\n\n $allFavoritesTags = Favorite::getTagsForFavorites();\n\n return view('pages.favorites')->with([\n 'favoritesList' => $favorites,\n 'favorites' => $favorites,\n 'allFavoritesTags' => $allFavoritesTags,\n ]);\n\n }", "public function favorites()\n {\n return $this->belongsToMany(Product::class, 'favorites');\n }", "public function FavoriteAdd($idItem){\n try{\n $this->executeQuery([\"idUser\"=>$this->idUser,\"idItem\"=>$idItem],\"favoriteAdd\",\"/[^0-9]/\");\n }catch(Exception $e){\n\n }\n }", "public function actionRequestFavorite() {\n $data = array();\n if(!Yii::$app->user->isGuest && isset($_POST['stuff_id'])) {\n $model = new FavoriteForm();\n $model->user_id = Yii::$app->user->getId();\n $model->stuff_id = $_POST['stuff_id'];\n \n if($model->validate() && $model->requestFavorite()) {\n $this->createNotificationPostThanks($_POST['stuff_id']);\n $data['status'] = 1;\n return json_encode($data);\n }\n } \n\n $data['status'] = 0;\n return json_encode($data);\n }", "public static function remove_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if (!empty($_GET['id'])) {\n $favorites = get_user_meta(get_current_user_id(), 'favorites', true);\n\n if (!empty($favorites) && is_array($favorites)) {\n foreach ($favorites as $key => $property_id) {\n if ($property_id == $_GET['id']) {\n unset($favorites[$key]);\n }\n }\n\n update_user_meta(get_current_user_id(), 'favorites', $favorites);\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __('No favorite properties found.', 'realia-favorites'),\n );\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __('Property ID is missing.', 'realia-favorites'),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "public function favorite()\n {\n $mentor = User::leftJoin('review_mentor', 'user_id_mentor', '=', 'users.id')\n ->where('mentor', 'Y')\n ->groupBy('users.id')\n ->select('users.id', 'users.first_name', 'users.last_name', 'users.photo',\n DB::raw(\"SUM(CASE WHEN is_like = 'Y' THEN 1 ELSE 0 END) as islike \"),\n DB::raw(\"SUM(CASE WHEN is_like = 'N' THEN 1 ELSE 0 END) as unlike \")\n )\n ->get();\n return MentorFavorite::collection($mentor);\n }", "public function getUserFavorites($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collUserFavorites === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collUserFavorites = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(UserFavoritePeer::USER_ID, $this->id);\n\n\t\t\t\tUserFavoritePeer::addSelectColumns($criteria);\n\t\t\t\t$this->collUserFavorites = UserFavoritePeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(UserFavoritePeer::USER_ID, $this->id);\n\n\t\t\t\tUserFavoritePeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastUserFavoriteCriteria) || !$this->lastUserFavoriteCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collUserFavorites = UserFavoritePeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastUserFavoriteCriteria = $criteria;\n\t\treturn $this->collUserFavorites;\n\t}", "public function favorite($favid = '', $params = null)\n {\n if (is_array($favid) && $params == null)\n {\n $params = $favid;\n $favid = '';\n }\n $this->core->_appendUri('/favorite/%s', $favid);\n $this->core->_setParamList($params);\n }", "public static function addFavorite($item, $member)\n\t{\n\t\t$db = new CSF\\Modules\\Data(\"nutrition\");\n\n\t\t$selectParam = array(\n\t\t\t\t\"table\"=>\"users\",\n\t\t\t\t\"columns\"=>array(\"favorites\")\n\t\t\t);\n\n\t\t$selectCheck = $db->selectData($selectParam)\n\t\t\t\t\t\t ->where(array(\"member\"=>$member))\n\t\t\t\t\t\t ->execute();\n\n\t\t$itemCheck = explode(\",\", $selectCheck[0][\"favorites\"]);\n\n\t\tif(in_array($item, $itemCheck)) {\n\t\t\techo '2';\n\t\t} else {\n\t\t\tif(strlen($selectCheck[0][\"favorites\"]) == 0) {\n\t\t\t\t$query = \"UPDATE users SET favorites='\" . $item . \"' WHERE member='\" . $member . \"'\";\n\n\t\t\t\t$check = $db->rawRequest($query);\n\t\t\t} else {\n\t\t\t\t$query = \"UPDATE users SET favorites=CONCAT_WS(',', favorites, '\" . $item . \"') WHERE member='\" . $member . \"'\";\n\n\t\t\t\t$check = $db->rawRequest($query);\n\t\t\t}\n\n\t\t\tif($check) {\n\t\t\t\techo '1';\n\t\t\t} else {\n\t\t\t\techo '0';\n\t\t\t}\n\t\t}\n\t}", "public function favourites()\n {\n return $this->hasManyThrough('App\\Favourite', 'favorite_tbl');\n }", "public function addToFavoriteList(Request $request)\n {\n $result = DB::table('favorite_supervision_list')->where('userId', '=', \\Auth::user()->id)->where('supervision_id', '=', $request->supervisionsId)->get();\n if ($result->isEmpty()) {\n DB::table('favorite_supervision_list')->insert(['userId' => \\Auth::user()->id, 'supervision_id' => $request->supervisionsId, 'created_at' => \\Carbon\\Carbon::now()]);\n return (new \\Illuminate\\Http\\Response)->setStatusCode(200, 'Supervison successfuly added.');\n }\n return (new \\Illuminate\\Http\\Response)->setStatusCode(409, 'Supervison already in list.');\n }", "public function find_favorites() {\n\t\tstatic $favorites;\n\n\t\tif (!is_array($favorites)) {\n\t\t\t$favorites = array();\n\t\t\tif ($this->loaded()) {\n\t\t\t\t$users = db::build()->select('user_id')->from('favorites')->where('event_id', '=', $this->id)->execute()->as_array();\n\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t$favorites[(int)$user['user_id']] = (int)$user['user_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $favorites;\n\t}", "function photos_getFavorites ($photo_id, $page = 1, $per_page = 20) {\n $response = $this->execute(array('method' => 'flickr.photos.getFavorites', 'photo_id' => $photo_id, 'page' => $page, 'per_page' => $per_page));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo']['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function show(FavoritesModel $favoritesModel)\n {\n //\n }", "public function favorite($id)\n {\n $product = Product::findOrFail($id);\n $favorite = new Favorite;\n\n $favorite->product_id = $product->id;\n $favorite->user_id = Auth::id();\n\n $favorite->save();\n\n return back();\n }", "public function myFavoriteAction()\n {\n $em = $this->getDoctrine()->getManager();\n $favoriteRepo = $em->getRepository('BORAdvertBundle:Favorite');\n $favorites = $favoriteRepo->findByUser($this->getUser());\n $adverts = array();\n\n foreach ($favorites as $favorite) {\n $adverts[] = $favorite->getAdvert();\n }\n\n return array(\n 'entities' => $adverts,\n 'favorites' => $favorites,\n );\n }", "function fanwood_dim_favorite () {\n\t$user_id = bbp_get_current_user_id();\n\t$id = intval( $_POST['id'] );\n\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\tdie( '-1' );\n\n\tif ( !$topic = bbp_get_topic( $id ) )\n\t\tdie( '0' );\n\n\tcheck_ajax_referer( \"toggle-favorite_$topic->ID\" );\n\n\tif ( bbp_is_user_favorite( $user_id, $topic->ID ) ) {\n\t\tif ( bbp_remove_user_favorite( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t} else {\n\t\tif ( bbp_add_user_favorite( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t}\n\n\tdie( '0' );\n}", "function addFavorite($name,$recipe){\n\t\t\t$str_query=\"INSERT INTO cuisine_favorite SET username='$name', fav_recipe_id='$recipe'\";\n\t\t\treturn $this->query($str_query);\n\t\t}", "public function myfavorites_get()\n {\n $user = $this->getCurrentUser();\n $criteria = new \\Doctrine\\Common\\Collections\\Criteria();\n //AQUI TODAS LAS EXPRESIONES POR LAS QUE SE PUEDE BUSCAR CON TEXTO\n $expresion = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"favorite\", \\Doctrine\\Common\\Collections\\Expr\\Comparison::EQ, 1);\n $criteria->where($expresion);\n $criteria->orderBy(array(\"visited_at\"=>\"DESC\"));\n $relacion = $user->getUserservices()->matching($criteria)->toArray();\n $result[\"desc\"] = \"Listado de los servicios marcados como favoritos por el usuario\";\n $result[\"data\"] = array();\n foreach ($relacion as $servicerel) {\n $service_obj = $servicerel->getService();\n $service_obj->loadRelatedData($user, null, site_url());\n $result[\"test\"] = $service_obj->loadRelatedUserData($user);\n $result[\"data\"][] = $service_obj;\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n\n }", "static public function getFavorites() {\r\n self::initFav();\r\n return self::$FAV;\r\n }", "public function ajax_favorite() {\n\n\t\t// Bail if favorites are not active\n\t\tif ( ! bbp_is_favorites_active() ) {\n\t\t\tbbp_ajax_response( false, __( 'Favorites are no longer active.', 'bbpress' ), 300 );\n\t\t}\n\n\t\t// Bail if user is not logged in\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\tbbp_ajax_response( false, __( 'Please login to make this topic a favorite.', 'bbpress' ), 301 );\n\t\t}\n\n\t\t// Get user and topic data\n\t\t$user_id = bbp_get_current_user_id();\n\t\t$id = !empty( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;\n\n\t\t// Bail if user cannot add favorites for this user\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\tbbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );\n\t\t}\n\n\t\t// Get the topic\n\t\t$topic = bbp_get_topic( $id );\n\n\t\t// Bail if topic cannot be found\n\t\tif ( empty( $topic ) ) {\n\t\t\tbbp_ajax_response( false, __( 'The topic could not be found.', 'bbpress' ), 303 );\n\t\t}\n\n\t\t// Bail if user did not take this action\n\t\tif ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-favorite_' . $topic->ID ) ) {\n\t\t\tbbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );\n\t\t}\n\n\t\t// Take action\n\t\t$status = bbp_is_user_favorite( $user_id, $topic->ID ) ? bbp_remove_user_favorite( $user_id, $topic->ID ) : bbp_add_user_favorite( $user_id, $topic->ID );\n\n\t\t// Bail if action failed\n\t\tif ( empty( $status ) ) {\n\t\t\tbbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );\n\t\t}\n\n\t\t// Put subscription attributes in convenient array\n\t\t$attrs = array(\n\t\t\t'topic_id' => $topic->ID,\n\t\t\t'user_id' => $user_id\n\t\t);\n\n\t\t// Action succeeded\n\t\tbbp_ajax_response( true, bbp_get_user_favorites_link( $attrs, $user_id, false ), 200 );\n\t}", "public function store(Request $request)\n {\n //\n $userFavorite = new UserFavorite;\n $userFavorite->create($request->all());\n }", "function theme_profile_favourites($profile_pid, $post_page, $post_tab, $post_type) {\n\n\t// note: Favourites are viewable by everyone!\n\t\n\t$profile_author = get_user_by('slug', $profile_pid);\n\n\tglobal $wpdb, $post, $current_user, $current_site, $gp;\n\t$geo_currentlocation = $gp->location;\n\t$ns_loc = $gp->location['country_iso2'] . '\\\\Edition';\n\t$edition_posttypes = $ns_loc::getPostTypes();\n\t\n\t$post_type_filter = \"\";\n\t$post_type_key = getPostTypeID_by_Slug($post_type);\n\t\n\tif ( $post_type_key ) {\n\t\t$post_type_filter = \"\" . $wpdb->prefix . \"posts.post_type = '{$post_type_key}'\";\n\t} else {\n\t foreach ($edition_posttypes as $value) {\n\t\t if ( $value['enabled'] === true ) {\n\t\t\t $post_type_filter .= $wpdb->prefix . \"posts.post_type = '{$value['id']}' or \";\n\t\t }\n\t\t}\n\t\t$post_type_filter = substr($post_type_filter, 0, -4);\n\t}\n\n\t$total = \"SELECT COUNT(*) as count\n\t\t\t\tFROM \" . $wpdb->prefix . \"posts \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"usermeta as m0 on REPLACE(m0.meta_key, 'likepost_', '')=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"postmeta as m1 on m1.post_id=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tWHERE post_status='publish' \n\t\t\t\t\tAND (\" . $post_type_filter . \")\n\t\t\t\t\tAND m0.meta_value > 0 \n\t\t\t\t\tAND m0.user_id = $profile_author->ID \n\t\t\t\t\tAND m0.meta_key LIKE 'likepost%' \n\t\t\t\t\tAND m1.meta_value >= 1;\";\n\t\t\t\t\n\t$totalposts = $wpdb->get_results($total, OBJECT);\n\t\n\t#$ppp = intval(get_query_var('posts_per_page'));\n\t$ppp = 20;\n\t$wp_query->found_posts = $totalposts[0]->count;\n\t$wp_query->max_num_pages = ceil($wp_query->found_posts / $ppp);\t\t\n\t#$on_page = intval(get_query_var('paged'));\t\n\t$on_page = $post_page;\n\n\tif($on_page == 0){ $on_page = 1; }\t\t\n\t$offset = ($on_page-1) * $ppp;\n\n\t$querystr = \"SELECT DISTINCT \" . $wpdb->prefix . \"posts.*\n\t\t\t\t\t, m1.meta_value as _thumbnail_id \n\t\t\t\tFROM \" . $wpdb->prefix . \"posts \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"usermeta as m0 on REPLACE(m0.meta_key, 'likepost_', '')=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"postmeta as m1 on m1.post_id=\" . $wpdb->prefix . \"posts.ID\n\t\t\t\tWHERE post_status='publish'\n\t\t\t\t\tAND (\" . $post_type_filter . \") \n\t\t\t\t\tAND m0.meta_value > 0 \n\t\t\t\t\tAND m0.user_id = $profile_author->ID \n\t\t\t\t\tAND m0.meta_key LIKE 'likepost%' \n\t\t\t\t\tAND m1.meta_value >= 1 \n\t\t\t\tORDER BY m0.meta_value DESC\n\t\t\t\tLIMIT \" . $ppp . \" \n\t\t\t\tOFFSET \" . $offset;\n\t\t\t\t\t\n\t $pageposts = $wpdb->get_results($querystr, OBJECT);\n\n if ( $post_type_key ) {\n foreach ($edition_posttypes as $newposttype) {\n if ( $newposttype['enabled'] === true ) {\n if ($newposttype['id'] == $post_type_key) {\n if ($newposttype['plural'] === true) {\n $post_type_name = \" \" . $newposttype['name'] . \"s\";\n } else {\n $post_type_name = \" \" . $newposttype['name'];\n }\n }\n }\n }\n }\n \n if ($post_type_name) {\n echo \"<div class=\\\"total-posts\\\">Favourite{$post_type_name}</div>\";\n } else {\n echo \"<div class=\\\"total-posts\\\">Favourites</div>\";\n }\t \n\t \n\t\t$previous_post_title = '';\n\t\tforeach ($pageposts as $post) {\n\t\t\n\t\t\tsetup_postdata($post);\n\t\t\tif ($post->post_title != $previous_post_title) {\n\t\t\t theme_index_feed_item();\n\t\t\t $previous_post_title = $post->post_title;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $wp_query->max_num_pages > 1 ) {\n\t\t\ttheme_tagnumpagination( $on_page, $wp_query->max_num_pages, $post_tab, $post_type );\n\t\t}\n}", "public function add($id){\n $user = \\Auth::user();\n $user->festivals()->syncWithoutDetaching($id);\n\n return redirect('/favorites');\n }", "public function markBeauticianFavourite(MarkBeauticianFavouriteRequest $request) {\n $beauticianId = $request->input('beauticianId');\n $response = CustomerServiceProvider::markBeauticianFavourite($beauticianId);\n return $this->sendJsonResponse($response);\n }", "function bibdk_favourite_form_user_profile_form_alter(&$form, $form_state){\n $form['#submit'][] = 'bibdk_favourite_add_favourite_message';\n}", "public function index()\n {\n //\n return UserFavorite::get();\n }", "public function create()\n {\n //\n return view('favorites.create');\n }", "public function addToFavorites(Request $request)\n {\n $input = array();\n $input['common_id']= $request->id;\n $input['type']= $request->type;\n $exist = Favorites::where(['common_id'=>$request->id,\"type\"=>$request->type]);\n if($exist->count()>0)\n {\n $response = ['success' => false,'status'=> 404,'message' => 'Favorites already exist']; \n }\n else\n {\n Favorites::unguard();\n $favorites = Favorites::create($input);\n \n if($favorites)\n {\n $response = ['success' => true,'status' => 200,'message' => 'Added to favorites successfully.','data'=>$favorites];\n }\n else{\n $response = ['success' => false,'status'=> 404,'message' => 'Something Wrong, Not able to add as favorites']; \n }\n }\n return response()->json($response);\n }", "public function Favourite(Request $request)\n {\n if(auth()->check()){\n $products = Products::where('id',$request->product_id)->first();\n if($products){\n $favourite = Favourite::where('product_id',$request->product_id)->where('type',$products->type)->where('user_id',auth()->id())->first();\n if($favourite){\n $favourite->delete();\n return response()->json('2');\n }else{\n Favourite::create([\n 'product_id' => $request->product_id,\n 'type' => $products->type,\n 'user_id' => auth()->id(),\n ]);\n return response()->json('1');\n }\n }\n }else{\n session()->flash('error', trans(\"admin.must_login\"));\n return redirect()->back();\n }\n\n }", "public function favorite()\n {\n return $this->hasMany('Favorite');\n }", "function updateFavorites() {\n try {\n $favorites_table = TABLE_PREFIX . 'favorites';\n $starred_objects_table = TABLE_PREFIX . 'starred_objects';\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n\n // Starred objects\n $rows = DB::execute(\"SELECT DISTINCT $project_objects_table.type AS 'parent_type', $project_objects_table.id AS 'parent_id', $starred_objects_table.user_id AS 'user_id' FROM $project_objects_table, $starred_objects_table WHERE $project_objects_table.id = $starred_objects_table.object_id\");\n\n if($rows) {\n $to_insert = array();\n\n foreach($rows as $row) {\n $to_insert[] = DB::prepare('(?, ?, ?)', $row['parent_type'], $row['parent_id'], $row['user_id']);\n } // foreach\n\n DB::execute(\"INSERT INTO $favorites_table (parent_type, parent_id, user_id) VALUES \" . implode(', ', $to_insert));\n } // if\n\n // Pinned projects to favorites\n $rows = DB::execute('SELECT project_id, user_id FROM ' . TABLE_PREFIX . 'pinned_projects');\n if($rows) {\n $to_insert = array();\n\n foreach($rows as $row) {\n $to_insert[] = DB::prepare(\"('Project', ?, ?)\", $row['project_id'], $row['user_id']);\n } // foreach\n\n DB::execute(\"INSERT INTO $favorites_table (parent_type, parent_id, user_id) VALUES \" . implode(', ', $to_insert));\n } // if\n\n // Drop old tables\n DB::execute(\"DROP TABLE $starred_objects_table\");\n DB::execute('DROP TABLE ' . TABLE_PREFIX . 'pinned_projects');\n\n return true;\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n }", "public function an_authenticated_user_can_toggle_favourite_any_reply()\n {\n $post = factory(Post::class)->create();\n $post->comments()->create(factory(Comment::class)->make()->toArray());\n $user = factory(User::class)->create();\n\n $this->actingAs($user);\n\n $this->actingAs($user)->get('/posts/' . $post->id . '/comments/' . $post->comments()->first()->id . '/favourites');\n $this->assertCount(1, $post->comments()->first()->favourites);\n\n $this->actingAs($user)->get('/posts/' . $post->id . '/comments/' . $post->comments()->first()->id . '/favourites');\n $this->assertCount(0, $post->comments()->first()->favourites);\n }" ]
[ "0.69210327", "0.6606201", "0.6501669", "0.64900607", "0.648094", "0.639324", "0.6358247", "0.6317602", "0.62909055", "0.6288108", "0.6281173", "0.62334174", "0.6222342", "0.6188321", "0.6070393", "0.60458714", "0.5985902", "0.59834856", "0.5903112", "0.5871392", "0.58690184", "0.586301", "0.5818918", "0.5792935", "0.5792769", "0.57851714", "0.57824314", "0.57754844", "0.57344645", "0.5732456", "0.5725967", "0.5722556", "0.5706857", "0.5672514", "0.56488794", "0.56435907", "0.5641505", "0.5633184", "0.5622491", "0.5610651", "0.5586678", "0.55776745", "0.55741125", "0.5573445", "0.5572655", "0.55613965", "0.55159414", "0.55158347", "0.55108386", "0.5504893", "0.54986024", "0.54930794", "0.54901284", "0.54646194", "0.5458234", "0.5457208", "0.5441627", "0.5435732", "0.54335505", "0.54172474", "0.5409416", "0.5407965", "0.54041815", "0.540259", "0.5401878", "0.53959155", "0.5382542", "0.5376404", "0.537564", "0.5372618", "0.5354678", "0.53480387", "0.5346703", "0.5346557", "0.5333867", "0.5318285", "0.53173834", "0.5313985", "0.5304964", "0.5287003", "0.5286999", "0.52827495", "0.5271948", "0.525865", "0.5245796", "0.52450186", "0.524471", "0.5235731", "0.5219861", "0.5219855", "0.5216008", "0.5203886", "0.52015656", "0.5196593", "0.5194672", "0.5180869", "0.5168841", "0.5161343", "0.5157587", "0.5156314" ]
0.61224455
14
Returns a list of the user's favorite photos. Only photos which the calling user has permission to see are returned.
function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) { $params = array(); $params['method'] = 'flickr.favorites.getList'; if ($user_id) $params['user_id'] = $user_id; $params['per_page'] = $per_page; $params['page'] = $page; if ($extras) $params['extras'] = $extras; $response = $this->execute($params, 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function favorites() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n if ($id > 0) {\n $query = \"select * from favorites where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n } \n }", "public function getFavorites();", "function photos_getFavorites ($photo_id, $page = 1, $per_page = 20) {\n $response = $this->execute(array('method' => 'flickr.photos.getFavorites', 'photo_id' => $photo_id, 'page' => $page, 'per_page' => $per_page));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo']['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function favorites() {\n\t\t$favoriteSounds = Sound::whereHas('favorite', function($query) {\n\t\t\t$user = Auth::user();\n\n\t\t\t$query->where('userId', '=', $user->id);\n\t\t});\n\n\t\treturn Responder::success([\n\t\t\t'favoriteSounds' => $favoriteSounds->get()\n\t\t]);\n\t}", "static public function getFavorites() {\r\n self::initFav();\r\n return self::$FAV;\r\n }", "public function favorites()\n {\n $favoriteClass = config('favorable.favorite_model');\n\n return $this->morphMany($favoriteClass, 'favoriteable');\n }", "public function find_favorites() {\n\t\tstatic $favorites;\n\n\t\tif (!is_array($favorites)) {\n\t\t\t$favorites = array();\n\t\t\tif ($this->loaded()) {\n\t\t\t\t$users = db::build()->select('user_id')->from('favorites')->where('event_id', '=', $this->id)->execute()->as_array();\n\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t$favorites[(int)$user['user_id']] = (int)$user['user_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $favorites;\n\t}", "function getRandomFavoritePhoto($userEmail) {\n $api = new Phlickr_Api(FLICKR_API_KEY, FLICKR_API_SECRET);\n // load a saved cache file if it exists, set the expiration limit to a week.\n $api->setCache(Phlickr_Cache::createFrom(CACHE_FILE, 60*60*24*7));\n\n // select a random favorite photo\n $user = Phlickr_User::findByEmail($api, $userEmail);\n $favlist = $user->getFavoritePhotoList();\n $photo = $favlist->getRandomPhoto();\n\n assert(!is_null($photo));\n\n // serialize and save the cache file\n $api->getCache()->saveAs(CACHE_FILE);\n\n return $photo;\n}", "public function favorite()\n {\n $mentor = User::leftJoin('review_mentor', 'user_id_mentor', '=', 'users.id')\n ->where('mentor', 'Y')\n ->groupBy('users.id')\n ->select('users.id', 'users.first_name', 'users.last_name', 'users.photo',\n DB::raw(\"SUM(CASE WHEN is_like = 'Y' THEN 1 ELSE 0 END) as islike \"),\n DB::raw(\"SUM(CASE WHEN is_like = 'N' THEN 1 ELSE 0 END) as unlike \")\n )\n ->get();\n return MentorFavorite::collection($mentor);\n }", "public function myfavorites_get()\n {\n $user = $this->getCurrentUser();\n $criteria = new \\Doctrine\\Common\\Collections\\Criteria();\n //AQUI TODAS LAS EXPRESIONES POR LAS QUE SE PUEDE BUSCAR CON TEXTO\n $expresion = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"favorite\", \\Doctrine\\Common\\Collections\\Expr\\Comparison::EQ, 1);\n $criteria->where($expresion);\n $criteria->orderBy(array(\"visited_at\"=>\"DESC\"));\n $relacion = $user->getUserservices()->matching($criteria)->toArray();\n $result[\"desc\"] = \"Listado de los servicios marcados como favoritos por el usuario\";\n $result[\"data\"] = array();\n foreach ($relacion as $servicerel) {\n $service_obj = $servicerel->getService();\n $service_obj->loadRelatedData($user, null, site_url());\n $result[\"test\"] = $service_obj->loadRelatedUserData($user);\n $result[\"data\"][] = $service_obj;\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n\n }", "public function getAllFavorites($user_id);", "public function favorites($user, $options = []);", "public function my_favs(){\n $current_user=Auth::user();\n if(!$current_user){ return false; }\n\n $favorites=Favorites::where('user_id',$current_user->id)->orderBy('id', 'desc')->get();\n\n $return=[];\n foreach ($favorites as $key => $value) {\n $data = json_decode(app('App\\Http\\Controllers\\GiphyController')->single($value->gif_uid));\n $return[]=($data->data);\n }\n\n return $return;\n\n }", "public function getFavorites()\n {\n $tricks = $this->tricks->findAllFavorites($this->user);\n\n $this->view('user.favorites', compact('tricks'));\n }", "public function favorite()\n {\n $attributes = ['user_id' => auth()->id()];\n\n if (! $this->favorites()->where($attributes)->exists()) {\n return $this->favorites()->create($attributes);\n }\n }", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorited');\n }", "function getFavouriteTags(){\n //first we get all the info on tags that belong to tasks that the current user has clicked on\n $clickInfo = $this->qh->getClickTagInfo($_SESSION['userID']);\n return $this->getFavourites($clickInfo, 'TagID');\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function favorite(){\n $attributes = ['user_id' => auth()->id()];\n\n if(! $this->favorites()->where($attributes)->exists()){\n return $this->favorites()->create($attributes);\n }\n }", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function index()\n {\n //\n return UserFavorite::get();\n }", "public function favourite()\n {\n return $this->belongsToMany('App\\User', 'favourite', 'media_id', 'user_id');\n }", "private function get_user_favorite_publics(){\r\n global $USER;\r\n\r\n if(isset($USER) && $USER->id > 0) {\r\n $publics = new PublicsByFunctionUser($USER->id, $this->tab);\r\n if($this->tab == 'formation'){\r\n return $publics->get_favorite_formation_publics();\r\n } else {\r\n return $publics->get_favorite_course_publics();\r\n }\r\n }\r\n return false;\r\n }", "public function favourites()\n {\n return $this->morphMany(Favourite::class, 'favourite');\n }", "public function favorites()\n\t{\n\t\treturn $this->morphMany(Favorite::class, 'favoriteable');\n\t}", "function getAllFoodpornsByFavorite()\n {\n $stmt = self::$_db->prepare(\"SELECT fp.* FROM favorit AS fav LEFT JOIN foodporn AS fp On fav.fs_foodporn = fp.id_foodporn AND fav.fs_user=:uid WHERE id_foodporn IS NOT NULL\");\n $uid = self::getUserID();\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function getFavorites(){\n\n\t$id = getUserID();\n\t$query = \"SELECT networks.area, networks.state, activities.activity_name FROM favorites, networks, activities, unique_networks WHERE user_id = \".$id.\"\"\n\t.\" AND favorites.unique_network_id = unique_networks.unique_network_id\"\n\t.\" AND unique_networks.activity_id = activities.activity_id\"\n\t.\" AND unique_networks.network_id = networks.network_id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favs[] = $row['area']. \", \". $row['state']. \" - \" .$row['activity_name'];\n\t}\n\treturn $favs;\n}", "public function index() {\n return response()->json([\n 'posts' => auth()->user()->favorites()->orderBy('created_at', 'DESC')->get(),\n ]);\n }", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function get_favorites()\n {\n return view('content.favorites')\n ->with('page_title', 'Your Favorite Pages')\n ->with('titles', Favorite::all());\n }", "function get_favorites($user_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_favorites' => true, //a flag to execute the right code in App-Logic! \n 'user_id' => $user_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "function getFavoritesWithIDs(){\n\n\t$id = getUserID();\n\t$query = \"SELECT unique_networks.unique_network_id, networks.area, networks.state, activities.activity_name FROM favorites, networks, activities, unique_networks WHERE user_id = \".$id.\"\"\n\t.\" AND favorites.unique_network_id = unique_networks.unique_network_id\"\n\t.\" AND unique_networks.activity_id = activities.activity_id\"\n\t.\" AND unique_networks.network_id = networks.network_id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favs[] = $row;\n\t}\n\treturn $favs;\n}", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "public static function loop_my_favorites() {\n $paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n if( ! is_array( $favorites ) || count( $favorites ) == 0 ) {\n $favorites = array( '', );\n }\n\n query_posts( array(\n 'post_type' => 'property',\n 'paged' => $paged,\n 'post__in'\t\t=> $favorites,\n 'post_status' => 'publish',\n ) );\n }", "public function actionFavorites()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\t\n\t\t$unfavorite = Yii::app()->request->getParam('unfavorite');\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\n\t\tif($unfavorite && $user_id) {\n\t\t\t\n\t\t\t$record = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $unfavorite));\n\t\t//\tdie(print_r($record));\n\t\t\tif($record)\n\t\t\t\t$record->delete();\n\t\t//\t$this->redirect('/cabinet/favorites');\n\t\t//\t Yii::app()->end();\n\n\t\t}\t\n\n\n\t\t\n\t\tif($user_id) {\n\t\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\t\n\t\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t\t if ($fruit_name == 1) {\n\t\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t\t }\n\t\t\t next($cookie_favorite);\n\t\t\t}\n\t\t\t\n\t\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\t\tif(!$favorite) {\n\t\t\t\t\t$record = new Favorited;\n\t\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t\t$record->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$this->checkUser();\n\t\t$favarray = array();\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\t//echo print_r($cookie_favorite, true);\n\t\t\n\t\tforeach($cookie_favorite as $cookie_key => $cookie_value) {\n\t\t\t\n\t\t if ($cookie_value && $unfavorite != $cookie_key) {\n\t\t $cookie_fav_wrap[] = $cookie_key;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\tif ($unfavorite != $fav_item) \n\t\t\t\t$favarray[] = $fav_item;\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\n\t\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t\tif($fav->object_id == $unfavorite)\n\t\t\t\t$fav->delete();\n\t\t}\t\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\tif($unfavorite != $favorite->object_id) {\n\t\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\tunset($_COOKIE['favorite']);\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t$cookie->path = '/';\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t} else {\n\t\t\tif(!$user_id && $unfavorite) {\n\t\t\t\tforeach($favarray as $favorite) {\n\t\t\t\t\t$cookie_fav_wrap[$favorite] = true;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\t\tunset($_COOKIE['favorite']);\n\t\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t\t$cookie->path = '/';\n\t\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t}\n\n\t\t\n\t\t$this->render('favorites',array('objects'=>$objects,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "public function index()\n {\n return Favourite::all();\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getFavorites()\n {\n return $this->hasMany(Recipe::className(), ['id' => 'recipe_id'])\n ->viaTable('favorites', ['user_id' => 'id'])\n ->orderBy(['created_at' => SORT_DESC]);\n }", "public function getUserFavorites($limit = null)\r\n {\r\n $args = array();\r\n if (!empty($limit)) {\r\n $args['limit'] = (int)$limit;\r\n }\r\n return self::makeCall('getUserFavoriteSongs', $args, 'songs', false, $this->sessionID);\r\n }", "public function user_favorites() {\n\t\t\tif ($this->request->is('get')) {\n\t\t\t\t$user_id = $_GET['user_id'];\n\n\t\t\t$tweet_favorites = ClassRegistry::init('tweets')->find('all', array('fields' => array('tweets.tweet,tweets.photo, tweets.created ,users_profiles.firstname, users_profiles.lastname,users_profiles.photo,users_profiles.user_id,users_profiles.handler,favorites.favorite,favorites.content_id,favorites.id ,favorites.user_id'),'order'=>'favorites.id DESC',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites', 'table' => 'favorites', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('favorites.content_id = tweets.id ')),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('favorites.user_id ='.$user_id.' AND favorites.content_type=\"tweets\"')));\n\t\t\n\t\t$this->set('tweet_favorites',$tweet_favorites);\n\t\t\n\t\t/*user friends start*/\t\n\t$reqUser = ClassRegistry::init('connections')->find('all',array('fields'=>array('connections.friend_id,connections.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('(connections.user_id='.$user_id.' OR connections.friend_id='.$user_id.') AND connections.request=1')));\n\t\t\t\n\t\tforeach ($reqUser as $rfid) {\n\t\t\t\tif ($rfid['connections']['friend_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['friend_id'];\n\t\t\t\t}\n\t\t\t\tif ($rfid['connections']['user_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['user_id'];\n\t\t\t\t} \n\t\t}\n\t\t/*user friends end*/\n\t\t\n\t\tif($comResult){\n\t\t\tif (sizeof($comResult)>1) {\n\t\t\t \t$result =@implode(',',$comResult);\n\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\tforeach ($comResult as $key=>$value) {\n\t\t\t\t\t\t\t\t\t$result = $value;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$user_tweet_comments = ClassRegistry::init('Tweet_comment')->find('all', array('fields' => array('\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.tweet_comment,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.created,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.firstname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.lastname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.photo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.user_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.tags,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.favorite,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.user_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'Tweet_comment.id DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.id = favorites.content_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.user_id = users_profiles.user_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('Tweet_comment.user_id IN ('.$result.','.$user_id.')'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Tweet_comment.comment_type = \"tweets\"'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'group' => 'Tweet_comment.id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\n\t\t$this->set('user_tweet_comments',$user_tweet_comments);\n\t\t}\n\t\t\n\t\t\t/*********************************** Retweeted tweets by user **********/\n\t$retweeted_tweets = ClassRegistry::init('tweets')->find('all',array('fields'=>array('tweets.parent_id,tweets.id,tweets.user_id,users_profiles.firstname, users_profiles.lastname, users_profiles.handler, users_profiles.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'joins'=>array(array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('tweets.parent_id !=0 AND tweets.status=2')));\n\t\t$this->set('retweeted_tweets',$retweeted_tweets);\n\t\t\n\t\t\n\t\t if ($user_id) {\n\t\t$favorites_on_Tweet = ClassRegistry::init('favorites')->find('all', array('fields'=>array('favorites.user_id,favorites.favorite,favorites.content_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'favorites.id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorites.content_type=\"tweets\" AND favorites.user_id='.$user_id)));\n\n\t\t$this->set('favorites_on_Tweet',$favorites_on_Tweet);\n\t\t\n\t\t/*Tweet count for current user*/\n\t$tweets_count_added_user= ClassRegistry::init('tweets')->find('all',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('conditions'=>array('tweets.user_id='.$user_id.' AND tweets.status=2')));\n\t\t\n\t$this->set('tweets_count_added_user',sizeof($tweets_count_added_user));\n\n\t\t\t\t\t/************************************** To show user following and followers ***********************/\n\t\t\t\t$userFollowings = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status, count(users_followings.following_id) as total_following'),'conditions'=>array('users_followings.user_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t$userFollows = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status ,count(users_followings.user_id) as total_follow'),'conditions'=>array('users_followings.following_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t\n\t\t$userFollowingsbyYou = $userFollowings[0][0];\n\t\t$userFollowingsbyYou = $userFollowingsbyYou['total_following'];\n\t\t$this->set('following',$userFollowingsbyYou);\n\t\t\n\t\t$userFollowYou = $userFollows[0][0];\n\t\t$userFollowYou = $userFollowYou['total_follow'];\n\t\t$this->set('followers',$userFollowYou);\t\t\n\t\t$this->set('userName',$this->userInfo['users_profiles']);\n\n\t\t }\n\t\t\n\t\t\n\t\t$this->autorender = false;\n\t $this->layout = false;\n\t $this->render('user_favorites');\n\t\t}\n\t}", "public function getFavoriteSongs($userId){\n return $this->DB->queryFetchAllAssoc(\"SELECT s.* FROM user u, song s, favorite_songs fs WHERE fs.user_id = u.id AND fs.song_id = s.id AND u.id = $userId\");\n }", "function get_product_favourite( $conds = array(), $limit = false, $offset = false )\n\t{\n\t\t$this->db->select('rt_products.*'); \n\t\t$this->db->from('rt_products');\n\t\t$this->db->join('rt_favourites', 'rt_favourites.product_id = rt_products.id');\n\n\t\tif(isset($conds['user_id'])) {\n\n\t\t\tif ($conds['user_id'] != \"\" || $conds['user_id'] != 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\t\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t$this->db->offset($offset);\n\t\t}\n\t\t\n\t\treturn $this->db->get();\n \t}", "public function getPhotos();", "public static function remove_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if (!empty($_GET['id'])) {\n $favorites = get_user_meta(get_current_user_id(), 'favorites', true);\n\n if (!empty($favorites) && is_array($favorites)) {\n foreach ($favorites as $key => $property_id) {\n if ($property_id == $_GET['id']) {\n unset($favorites[$key]);\n }\n }\n\n update_user_meta(get_current_user_id(), 'favorites', $favorites);\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __('No favorite properties found.', 'realia-favorites'),\n );\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __('Property ID is missing.', 'realia-favorites'),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "public function favorites(){\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function getAllPhotos();", "public function index()\n {\n $client_id = Auth::guard('client')->user()->id;\n $favs = Favorite::where('client_id', $client_id)->get();\n return view('home.fav',compact('favs'));\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function index()\n {\n $user = \\Auth::user();\n $festivals = $user->festivals;\n\n return view('festivals.favorites', [\n 'username' => $user->name, \n 'festivals' => $festivals\n ]);\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public static function add_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if ( ! empty( $_GET['id'] ) ) {\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n $favorites = ! is_array( $favorites ) ? array() : $favorites;\n\n if ( empty( $favorites ) ) {\n $favorites = array();\n }\n\n $post = get_post( $_GET['id'] );\n $post_type = get_post_type( $post->ID );\n\n if ( 'property' != $post_type ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'This is not property ID.', 'realia-favorites' ),\n );\n } else {\n $found = false;\n\n foreach ( $favorites as $property_id ) {\n if ( $property_id == $_GET['id']) {\n $found = true;\n break;\n }\n }\n\n if ( ! $found ) {\n $favorites[] = $post->ID;\n update_user_meta( get_current_user_id(), 'favorites', $favorites );\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property is already in list', 'realia-favorites' ),\n );\n }\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property ID is missing.', 'realia-favorites' ),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "public function showFavorites()\n {\n\n $favorites = Auth::user()->favorites()->orderBy('company_name')->get();\n\n $allFavoritesTags = Favorite::getTagsForFavorites();\n\n return view('pages.favorites')->with([\n 'favoritesList' => $favorites,\n 'favorites' => $favorites,\n 'allFavoritesTags' => $allFavoritesTags,\n ]);\n\n }", "public function userFavorites() {\n return $this->belongsToMany('App\\User');\n }", "public function favourites($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif(!$user = User::findUser(array('user_id' => $id)))\n\t\t{\n\t\t\t// something has gone wrong with db request\n\t\t\theader(\"Location: /myrecipe/users/\".$id);\n\t\t\texit;\n\t\t}\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t// find all the favourites\n\t\t$data = array('favourites.user_id'=>$id, 'recipe_images.is_cover'=>'yes');\n\t\t$favourites = Favourites::findFavourites($data);\n\t\t$this->template->favourites = $favourites;\n/*\t\techo \"<pre>\";\n\t\tprint_r($favourites);\n\t\techo \"</pre>\";\n*/\n\t\t$this->template->display('favourites.html.php');\n\t}", "public function myFavoriteAction()\n {\n $em = $this->getDoctrine()->getManager();\n $favoriteRepo = $em->getRepository('BORAdvertBundle:Favorite');\n $favorites = $favoriteRepo->findByUser($this->getUser());\n $adverts = array();\n\n foreach ($favorites as $favorite) {\n $adverts[] = $favorite->getAdvert();\n }\n\n return array(\n 'entities' => $adverts,\n 'favorites' => $favorites,\n );\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getFavoriteCount() {\n\t\treturn count($this->favorite_users);\n\t}", "public function favourites()\n {\n return $this->hasMany(Favourite::class);\n }", "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function favourites()\n {\n return $this->hasManyThrough('App\\Favourite', 'favorite_tbl');\n }", "function bp_activity_action_favorites_feed() {\n\tif ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {\n\t\treturn false;\n\t}\n\n\t// get displayed user's favorite activity IDs\n\t$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );\n\t$fav_ids = implode( ',', (array) $favs );\n\n\t// setup the feed\n\tbuddypress()->activity->feed = new BP_Activity_Feed( array(\n\t\t'id' => 'favorites',\n\n\t\t/* translators: User activity favorites RSS title - \"[Site Name] | [User Display Name] | Favorites\" */\n\t\t'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),\n\n\t\t'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',\n\t\t'description' => sprintf( __( \"Activity feed of %s's favorites.\", 'buddypress' ), bp_get_displayed_user_fullname() ),\n\t\t'activity_args' => 'include=' . $fav_ids\n\t) );\n}", "public function index()\n {\n return new FavoriteCollection(Favorite::all());\n }", "public function getAvatarList(){\n return $this->_get(5);\n }", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "public function favourites(){\n return $this->hasMany('App\\Favourite', 'user_id');\n }", "public function index()\n {\n $favourites = Favourite::with('product.products_gallary')->where('user_id',auth()->id())->get();\n return view('front.favourite.index',compact('favourites'));\n }", "public function getUserUploads() {\n\t\tif (!self::COOKIES_ENABLED) {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t/* load form database */\n\t\t$uploads = array();\n\t\t$delete_code = $this->getDeleteCode();\n\t\t$result = $this->db->query('\n\t\t\tSELECT *\n\t\t\tFROM image\n\t\t\tWHERE delete_code = \"'.SQLite3::escapeString($delete_code).'\"\n\t\t\t\tAND gallery_id = \"\"\n\t\t\tORDER BY ROWID DESC');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$uploads[$entry['id']] = $entry;\n\t\t\t}\n\t\t}\n\t\treturn $uploads;\n\t}", "function favorites($pid, $query = array(), $rawJson = false) {\n \t\tif ( $json = $this->_get('/merchants/'.$pid.'/favorites.json', $query) )\n \t\t\treturn $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n }", "public function favorites() {\n return $this->hasMany(Favorite::class);\n }", "protected function favorited($username)\n {\n $user = User::whereUsername($username)->first();\n\n $presentIds = $user ? $user->favorites()->pluck('id')->toArray() : [];\n\n return $this->builder->whereIn('id', $presentIds);\n }", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function index()\n {\n $idUser = Auth::id();\n $sellFlats = null;\n $favorite = Favorite::query()\n ->where('user_id', $idUser)\n ->get();\n\n if (isset($favorite)){\n foreach ($favorite as $item) {\n $sellFlats[] = sellApartment::query()\n ->where('id', $item->favoriteable_id)\n ->where('is_banned',false)\n ->paginate(8);\n }\n }\n\n return view('main.user.favorite.allFlats', compact('sellFlats'));\n }", "public function index()\n {\n // Favorite users photos area\n $PopularPhotos = $this->homeService->getPopularPhotos();\n\n $Top = $PopularPhotos[0];\n $Others = array_slice($PopularPhotos->toArray(), 1);\n\n // Top User Information\n $TopUserPhotos = $this->photoService->getPhotosById($PopularPhotos[0]->user_id, false)->items();\n\n // Random photos area\n $RandomPhotos = $this->homeService->getRandomPhotos();\n\n // New Members photos area\n $NewMembers = $this->homeService->getNewMembersPhotos();\n\n //RankedUsers PopularPhotos\n return compact('TopUserPhotos','RandomPhotos','NewMembers','Top','Others');\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t\t\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t if ($fruit_name == 1) {\n\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t }\n\t\t next($cookie_favorite);\n\t\t}\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\tif(!$favorite) {\n\t\t\t\t$record = new Favorited;\n\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t$record->save();\n\t\t\t}\n\t\t}\n\t\tunset(Yii::app()->request->cookies['favorite']);\n\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\t\n\t\t$favarray = array();\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t}\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t}\n\t\t\n\t\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t}\t\n\n\t\t\t\n\t\t$flats = Estate::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id),array('order'=>$order_field.' '.$order_dir));\n\t\t\n\t\t$this->render('index',array('flats'=>$flats, 'favarray'=>$favarray,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function getFavoritos(){\n\t\t$user_id = $_SESSION['activeUser']->getId();\n\t\tUtilidades::_log(\"getFavoritos($user_id)\");\n\t\t\n\t\t$query = \"SELECT book.*, book_lang.*\n\t\t\t\t\tFROM favourites,book, book_lang\n\t\t\t\t\tWHERE favourites.user_id = $user_id\n\t\t\t\t\t AND favourites.book_id = book.id\n\t\t\t\t\t AND favourites.book_id = book_lang.book_id\n\t\t\t\t\t and favourites.book_lang = book_lang.lang \";\n\t\t$query.= \" ORDER BY sold DESC, rating DESC\";\n\t\t\n\t\tUtilidades::_log(\"query: \".$query);\n\t\t$res = array();\n\t\t\n\t\tforeach(DB::ejecutarConsulta($query) as $row) {\n\t\t\t// Añadimos un objeto por cada elemento obtenido\n\t\t\t$res[] = new BookVO($row);\n\t\t}\n\t\treturn $res;\n\t}", "public function list(Request $request)\n {\n \t$favorites = $request->auth->favorites()->with(['music', 'music.categorie', 'music.artist'])->get();\n\n \treturn response()->json(['status' => true, 'favorites' => $favorites]);\n }", "public function getFavorites(Request $request)\n {\n\n $id = Auth::user()->id;\n $favorites = Favorite::select('favorite_user.id', 'favorite_user.user_id as userid', 'favorite_user.merchant_id', 'user_merchant.*')\n ->where('favorite_user.user_id', $id)\n //->leftJoin('users', 'users.id', '=', 'favorite_user.merchant_id')\n ->leftJoin('user_merchant', 'user_merchant.user_id', '=', 'favorite_user.merchant_id')\n ->get();\n if ($favorites->isEmpty()) {\n return response()->json(array(\n 'status' => 201,\n 'favorites' => 'No favorites merchant yet.',\n ));\n } else {\n return response()->json(array(\n 'status' => 200,\n 'favorites' => $favorites,\n ));\n }\n\n }", "public function viewFavourite(){\n $user = Auth::user();\n $puestos = DB::table('puesto')\n ->join('favorito', 'puesto.idPuesto', '=', 'favorito.idpuesto')\n ->where('favorito.idUsu',$user->idUsu)->paginate(8);\n return view('home', ['puestos' => $puestos,'cesta' => $user->shoppingBasket()]) ;\n }", "public function index()\n {\n //list favourites for each user\n $favourites = DB::table('books')\n ->join('favourites','favourites.book_id','=', 'books.id' )\n ->where('favourites.user_id','=',Auth::id())\n ->get();\n $fav= \\App\\User::find(Auth::id())->favorites()->pluck('book_id')->all();\n\n \n return view('FavouritesPage',['favourites'=>$favourites,\"favs\"=>$fav]);\n }", "public function index()\n {\n\n $properties = Property::whereIn('properties.id', function($query)\n {\n $query->select('users_favourites.prop_id')\n ->from('users_favourites')\n ->whereRaw('users_favourites.user_id = ' . Sentry::getUser()->id);\n })->get();\n\n return View::make('property.favourites.index', compact('properties'));\n \n }", "function theme_profile_favourites($profile_pid, $post_page, $post_tab, $post_type) {\n\n\t// note: Favourites are viewable by everyone!\n\t\n\t$profile_author = get_user_by('slug', $profile_pid);\n\n\tglobal $wpdb, $post, $current_user, $current_site, $gp;\n\t$geo_currentlocation = $gp->location;\n\t$ns_loc = $gp->location['country_iso2'] . '\\\\Edition';\n\t$edition_posttypes = $ns_loc::getPostTypes();\n\t\n\t$post_type_filter = \"\";\n\t$post_type_key = getPostTypeID_by_Slug($post_type);\n\t\n\tif ( $post_type_key ) {\n\t\t$post_type_filter = \"\" . $wpdb->prefix . \"posts.post_type = '{$post_type_key}'\";\n\t} else {\n\t foreach ($edition_posttypes as $value) {\n\t\t if ( $value['enabled'] === true ) {\n\t\t\t $post_type_filter .= $wpdb->prefix . \"posts.post_type = '{$value['id']}' or \";\n\t\t }\n\t\t}\n\t\t$post_type_filter = substr($post_type_filter, 0, -4);\n\t}\n\n\t$total = \"SELECT COUNT(*) as count\n\t\t\t\tFROM \" . $wpdb->prefix . \"posts \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"usermeta as m0 on REPLACE(m0.meta_key, 'likepost_', '')=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"postmeta as m1 on m1.post_id=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tWHERE post_status='publish' \n\t\t\t\t\tAND (\" . $post_type_filter . \")\n\t\t\t\t\tAND m0.meta_value > 0 \n\t\t\t\t\tAND m0.user_id = $profile_author->ID \n\t\t\t\t\tAND m0.meta_key LIKE 'likepost%' \n\t\t\t\t\tAND m1.meta_value >= 1;\";\n\t\t\t\t\n\t$totalposts = $wpdb->get_results($total, OBJECT);\n\t\n\t#$ppp = intval(get_query_var('posts_per_page'));\n\t$ppp = 20;\n\t$wp_query->found_posts = $totalposts[0]->count;\n\t$wp_query->max_num_pages = ceil($wp_query->found_posts / $ppp);\t\t\n\t#$on_page = intval(get_query_var('paged'));\t\n\t$on_page = $post_page;\n\n\tif($on_page == 0){ $on_page = 1; }\t\t\n\t$offset = ($on_page-1) * $ppp;\n\n\t$querystr = \"SELECT DISTINCT \" . $wpdb->prefix . \"posts.*\n\t\t\t\t\t, m1.meta_value as _thumbnail_id \n\t\t\t\tFROM \" . $wpdb->prefix . \"posts \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"usermeta as m0 on REPLACE(m0.meta_key, 'likepost_', '')=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"postmeta as m1 on m1.post_id=\" . $wpdb->prefix . \"posts.ID\n\t\t\t\tWHERE post_status='publish'\n\t\t\t\t\tAND (\" . $post_type_filter . \") \n\t\t\t\t\tAND m0.meta_value > 0 \n\t\t\t\t\tAND m0.user_id = $profile_author->ID \n\t\t\t\t\tAND m0.meta_key LIKE 'likepost%' \n\t\t\t\t\tAND m1.meta_value >= 1 \n\t\t\t\tORDER BY m0.meta_value DESC\n\t\t\t\tLIMIT \" . $ppp . \" \n\t\t\t\tOFFSET \" . $offset;\n\t\t\t\t\t\n\t $pageposts = $wpdb->get_results($querystr, OBJECT);\n\n if ( $post_type_key ) {\n foreach ($edition_posttypes as $newposttype) {\n if ( $newposttype['enabled'] === true ) {\n if ($newposttype['id'] == $post_type_key) {\n if ($newposttype['plural'] === true) {\n $post_type_name = \" \" . $newposttype['name'] . \"s\";\n } else {\n $post_type_name = \" \" . $newposttype['name'];\n }\n }\n }\n }\n }\n \n if ($post_type_name) {\n echo \"<div class=\\\"total-posts\\\">Favourite{$post_type_name}</div>\";\n } else {\n echo \"<div class=\\\"total-posts\\\">Favourites</div>\";\n }\t \n\t \n\t\t$previous_post_title = '';\n\t\tforeach ($pageposts as $post) {\n\t\t\n\t\t\tsetup_postdata($post);\n\t\t\tif ($post->post_title != $previous_post_title) {\n\t\t\t theme_index_feed_item();\n\t\t\t $previous_post_title = $post->post_title;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $wp_query->max_num_pages > 1 ) {\n\t\t\ttheme_tagnumpagination( $on_page, $wp_query->max_num_pages, $post_tab, $post_type );\n\t\t}\n}", "public function getUserFiles()\n {\n $user_files = Helper::getUserFiles();\n return $user_files;\n }", "public function index()\n {\n if(Auth::guest()){\n $result['stores'] = [];\n $result['recommended'] = [];\n $result['popular'] = [];\n }else{\n $result['stores'] = $this->_submitHTTPGet(config('config.api_url') . 'users/favouriteStores/'.$this->dataPage['user']['id'].'/', [\n 'c_limit' => 18,\n 'c_offset' => 0\n ]);\n Session::forget('favorite-stores-more-'.$this->dataPage['user']['id']);\n $result['recommended'] = $this->_submitHTTPGet(config('config.api_url') . 'users/suggestStore/'.$this->dataPage['user']['id'].'/',[\n 'c_limit' => 18,\n 'c_location' => config('config.location')]);\n }\n return view('profile.v2-favourite')->with(array_merge($this->dataPage,$result, $this->data));\n }", "public function findPraiseTopTen(){\n $sql = \"SELECT p.`id`, u.`nickname`, p.`favorite`, p.`pic` FROM `photo` AS p, `user` AS u WHERE p.`uid` = u.`uid` ORDER BY p.`favorite` DESC, p.`created` LIMIT 0, 10\";\n $res = $this->connect()->query($sql);\n $list = $res->fetch_all($resulttype = MYSQLI_ASSOC);\n if($list) {\n return $list;\n }\n return FALSE;\n }", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function index()\n {\n // $favorite= Fav_property::whereUser_id(Auth::user()->id)->whereProperty_id(1)->get();\n // $user = User::find(Auth::user()->id);\n $properties = Property::selectRaw('properties.*')->orderBy('properties.updated_at', 'desc')\n ->join('fav_properties', 'fav_properties.property_id', 'properties.id')\n ->where('fav_properties.user_id', Auth::user()->id)->get();\n foreach ($properties as $property) {\n if (Image::selectRaw('url')->whereProperty_id($property->id)->wherePrincipal(1)->first() != null) {\n $property->image = Image::selectRaw('url')->whereProperty_id($property->id)->wherePrincipal(1)->first()->url;\n }else{\n $property->image = null;\n }\n }\n // $favs = Fav_property::whereUser_id(Auth::user()->id)->get();\n // $properties = Fav_property::whereUser_id(Auth::user()->id)->get();\n \n return view('properties-fav', [\"properties\" => $properties,'rol' => Auth::user()->role_id]);\n }", "public function favorites()\n {\n return $this->belongsToMany(Question::class, 'favorites', 'user_id', 'question_id')->withTimestamps();\n }", "public function index()\n {\n //\n $favorites = Favorite::all();\n return view('favorites.index', compact('favorites'));\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "function getFavoriteIDs(){\n\t$id = getUserID();\n\t$query = \"SELECT unique_network_id FROM favorites WHERE user_id = $id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favIDs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favIDs[] = $row[0];// this is unique_network_id\n\t}\n\treturn $favIDs;\n}", "public function getFavoriteVideos() {\r\n $category_id = Input::get('category_id');\r\n $user_id = Input::get('user_id');\r\n\r\n $sql = \"SELECT v.*\"\r\n . \" FROM videos AS v\"\r\n . \" LEFT JOIN video_categories AS c ON c.id = v.category_id\"\r\n . \" WHERE v.visibility=1 AND v.category_id = ? AND v.id IN (SELECT video_id FROM video_favorites WHERE user_id = ?)\";\r\n $rows = DB::select($sql, [$category_id, $user_id]);\r\n\r\n return response()->json($rows);\r\n }", "public function index()\n {\n $products = Product::all();\n if (Auth::check() == true && User::findOrFail(Auth::id())->favorites()->count() > 0) {\n $favorites = User::findOrFail(Auth::id())->favorites()->get();\n } else {\n $favorites = null;\n }\n\n return view('home', compact('products', 'favorites'));\n }", "public function favorites()\n {\n return $this->belongsToMany(Product::class, 'favorites');\n }", "private function getByFavorite($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->andWhere('p.isFavorite = 1')\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function index()\n {\n // get all the nerds\n $favorites = \\App\\Favorite::where('user_id', Auth::user()->id)->get();\n // load the view and pass the nerds\n return View::make('favorites.index')\n ->with('recettes', $favorites);\n }", "public function getAllUserpreferences()\n {\n $dbHandler = Lib\\DbHandler::getDbHandler();\n $restaurantID = array();\n $userlist = $dbHandler->getUsers();\n $numberOfUsers = count($userlist);\n foreach ($userlist as $user) {\n $restaurants = $user->getPreferedRestaurantIds();\n\n foreach ($restaurants as $restaurant) {\n $restaurantID[] .= $restaurant[ID];\n\n }\n\n }\n $this->getMostlikedRestaurants($restaurantID);\n }" ]
[ "0.6951597", "0.6951065", "0.6901152", "0.6783222", "0.65645576", "0.65645134", "0.65489775", "0.653162", "0.6520821", "0.64882904", "0.6487816", "0.6480715", "0.6469994", "0.6468104", "0.6425402", "0.63879156", "0.6344827", "0.63429934", "0.6338001", "0.6309637", "0.63036555", "0.6302865", "0.62839204", "0.6283017", "0.622189", "0.62167287", "0.61614597", "0.61533195", "0.6139465", "0.61003155", "0.6089601", "0.6087153", "0.60607505", "0.6060472", "0.60290843", "0.6019849", "0.60159564", "0.5990655", "0.59665334", "0.5957379", "0.59442604", "0.5930715", "0.5925213", "0.5923986", "0.59009093", "0.5894613", "0.5858585", "0.58539885", "0.5847421", "0.5809913", "0.5809198", "0.5795153", "0.5775595", "0.5758804", "0.5755206", "0.5751439", "0.57349354", "0.5726393", "0.57133543", "0.57122433", "0.56921935", "0.5675444", "0.5668147", "0.56460744", "0.563722", "0.5635846", "0.5633834", "0.561806", "0.56140006", "0.5611885", "0.5611052", "0.5610302", "0.560856", "0.559882", "0.5595164", "0.5594642", "0.5578704", "0.557153", "0.55687606", "0.55496234", "0.55474776", "0.55423194", "0.55380887", "0.55347097", "0.55056864", "0.5490469", "0.5484581", "0.54743654", "0.5470916", "0.5462758", "0.54605526", "0.5445284", "0.54285693", "0.54278976", "0.54228127", "0.54200447", "0.54164726", "0.53869313", "0.53846794", "0.53830713" ]
0.74113095
0
Returns a list of favorite public photos for the given user.
function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) { $user_id = ($user_id) ? $user_id : $this->getUserId(); $params = array(); $params['method'] = 'flickr.favorites.getPublicList'; $params['user_id'] = $user_id; $params['per_page'] = $per_page; $params['page'] = $page; if ($extras) $params['extras'] = $extras; $response = $this->execute($params, 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function get_user_favorite_publics(){\r\n global $USER;\r\n\r\n if(isset($USER) && $USER->id > 0) {\r\n $publics = new PublicsByFunctionUser($USER->id, $this->tab);\r\n if($this->tab == 'formation'){\r\n return $publics->get_favorite_formation_publics();\r\n } else {\r\n return $publics->get_favorite_course_publics();\r\n }\r\n }\r\n return false;\r\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAllFavorites($user_id);", "public function favorites($user, $options = []);", "function favorites() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n if ($id > 0) {\n $query = \"select * from favorites where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n } \n }", "private function getByFavorite($user)\n {\n $q = $this\n ->getUserPublicationQueryBuilder($user)\n ->andWhere('p.isFavorite = 1')\n ->orderBy('p.publishedAt', 'desc')\n ->getQuery()\n ;\n\n return $q->getResult();\n }", "public function getFavoriteSongs($userId){\n return $this->DB->queryFetchAllAssoc(\"SELECT s.* FROM user u, song s, favorite_songs fs WHERE fs.user_id = u.id AND fs.song_id = s.id AND u.id = $userId\");\n }", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getRandomFavoritePhoto($userEmail) {\n $api = new Phlickr_Api(FLICKR_API_KEY, FLICKR_API_SECRET);\n // load a saved cache file if it exists, set the expiration limit to a week.\n $api->setCache(Phlickr_Cache::createFrom(CACHE_FILE, 60*60*24*7));\n\n // select a random favorite photo\n $user = Phlickr_User::findByEmail($api, $userEmail);\n $favlist = $user->getFavoritePhotoList();\n $photo = $favlist->getRandomPhoto();\n\n assert(!is_null($photo));\n\n // serialize and save the cache file\n $api->getCache()->saveAs(CACHE_FILE);\n\n return $photo;\n}", "public static function get_photos_by_user($user_id) {\n\t\t$photos_array = array();\n\n\t\t$sql = \"SELECT * \n\t\t FROM photo_directory \n\t\t WHERE user_id = {$user_id}\n\t\t ORDER BY time_uploaded DESC;\";\n\t\t$photos_dbo = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($photos_dbo)) {\n\t\t\tarray_push($photos_array, $row);\n\t\t} \n\n\t\tglobal $firephp;\n\t\t$firephp->log('get_photos_by_user:');\n\t\t$firephp->log($photos_array);\n\t\treturn $photos_array;\n\t}", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "function get_favorites($user_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_favorites' => true, //a flag to execute the right code in App-Logic! \n 'user_id' => $user_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "public function myfavorites_get()\n {\n $user = $this->getCurrentUser();\n $criteria = new \\Doctrine\\Common\\Collections\\Criteria();\n //AQUI TODAS LAS EXPRESIONES POR LAS QUE SE PUEDE BUSCAR CON TEXTO\n $expresion = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"favorite\", \\Doctrine\\Common\\Collections\\Expr\\Comparison::EQ, 1);\n $criteria->where($expresion);\n $criteria->orderBy(array(\"visited_at\"=>\"DESC\"));\n $relacion = $user->getUserservices()->matching($criteria)->toArray();\n $result[\"desc\"] = \"Listado de los servicios marcados como favoritos por el usuario\";\n $result[\"data\"] = array();\n foreach ($relacion as $servicerel) {\n $service_obj = $servicerel->getService();\n $service_obj->loadRelatedData($user, null, site_url());\n $result[\"test\"] = $service_obj->loadRelatedUserData($user);\n $result[\"data\"][] = $service_obj;\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n\n }", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "private function getUserFavoritePublications($user, $returnQuery = false, $maxResults = null, $firstResult = null)\n {\n $bookmark_post = $this->getRepository('bookmark_post')\n ->createQueryBuilder('bmp');\n $bookmark_post\n ->select('p.id')\n ->leftJoin('bmp.post', 'p')\n ->andWhere($bookmark_post->expr()->eq('bmp.user', ':user'));\n\n $publications = $this->getRepository('post')\n ->createQueryBuilder('post');\n $publications\n ->andWhere($publications->expr()->eq('post.resource', true))\n ->andWhere($publications->expr()->in('post.status', ':status'))\n ->andWhere($publications->expr()->in('post.id', $bookmark_post->getDql()))\n ->setParameters(array(\n 'user' => $user,\n 'status' => array(Post::STATUS_PUBLISHED, Post::STATUS_DRAFTING, Post::STATUS_ARCHIVED)\n ));\n\n if (null !== $maxResults) {\n $publications->setMaxResults($maxResults);\n }\n\n if (null !== $firstResult) {\n $publications->setFirstResult($firstResult);\n }\n\n if ($returnQuery) {\n return $publications->getQuery();\n }\n\n return $publications->getQuery()->getResult();\n }", "public function getFavorites();", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "function photos_getFavorites ($photo_id, $page = 1, $per_page = 20) {\n $response = $this->execute(array('method' => 'flickr.photos.getFavorites', 'photo_id' => $photo_id, 'page' => $page, 'per_page' => $per_page));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo']['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function my_favs(){\n $current_user=Auth::user();\n if(!$current_user){ return false; }\n\n $favorites=Favorites::where('user_id',$current_user->id)->orderBy('id', 'desc')->get();\n\n $return=[];\n foreach ($favorites as $key => $value) {\n $data = json_decode(app('App\\Http\\Controllers\\GiphyController')->single($value->gif_uid));\n $return[]=($data->data);\n }\n\n return $return;\n\n }", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "public static function create_by_user_public($a_user_id){\n\n\t\t$request = self::_get_connection()->select(\"SELECT ID from `apine_images` where user_id=$a_user_id OR privacy=2\");\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "public static function getFavorites($user_id, $page = 1)\n {\n $count = self::getFavoritesCount($user_id);\n $result = array(\n 'audios' => array(),\n 'load_more' => false,\n 'page' => $page,\n 'total' => $count\n );\n\n if (0 == $count) {\n return $result;\n }\n\n $total_pages = ceil($count / 10);\n\n if ($page > $total_pages) {\n return $result;\n }\n\n $columns = self::$columns;\n $columns = array_map(\n function ($value) {\n return 'A.' . $value;\n },\n $columns\n );\n $columns = implode(',', $columns);\n $query = db()->prepare(\n \"SELECT DISTINCT\n {$columns}\n FROM audios AS A\n INNER JOIN favorites AS F\n ON A.id = F.audio_id\n AND F.user_id = :user_id\n AND A.status = '1'\n ORDER BY F.date_added DESC\n LIMIT :skip, :max\"\n );\n $query->bindValue('user_id', $user_id);\n $query->bindValue(\n 'skip',\n ($page - 1) * self::$per_page,\n PDO::PARAM_INT\n );\n $query->bindValue('max', self::$per_page, PDO::PARAM_INT);\n $query->execute();\n\n while ($audio = $query->fetch(PDO::FETCH_ASSOC)) {\n $result['audios'][] = self::complete($audio);\n }\n \n $result['load_more'] = $page < $total_pages;\n $result['page'] = $page + 1;\n $result['total'] = $count;\n return $result;\n }", "public function getPhotos($userid)\n {\n $stmt = $this->con->prepare(\"SELECT id_foto, caminho, disciplina, dataCreate FROM tbl_foto WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $userid);\n $stmt->execute();\n $stmt->bind_result($id, $caminho, $disciplina, $data);\n $photos = array();\n\n while ($stmt->fetch()) {\n $photo = array();\n $photo['id'] = $id;\n $photo['caminho'] = $caminho;\n $photo['disciplina'] = $disciplina;\n $photo['userid'] = $userid;\n $photo['data'] = $data;\n array_push($photos, $photo);\n }\n\n $stmt->close();\n return $photos;\n }", "public function index()\n {\n //\n return UserFavorite::get();\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public function favorites() {\n\t\t$favoriteSounds = Sound::whereHas('favorite', function($query) {\n\t\t\t$user = Auth::user();\n\n\t\t\t$query->where('userId', '=', $user->id);\n\t\t});\n\n\t\treturn Responder::success([\n\t\t\t'favoriteSounds' => $favoriteSounds->get()\n\t\t]);\n\t}", "public function favorite()\n {\n $mentor = User::leftJoin('review_mentor', 'user_id_mentor', '=', 'users.id')\n ->where('mentor', 'Y')\n ->groupBy('users.id')\n ->select('users.id', 'users.first_name', 'users.last_name', 'users.photo',\n DB::raw(\"SUM(CASE WHEN is_like = 'Y' THEN 1 ELSE 0 END) as islike \"),\n DB::raw(\"SUM(CASE WHEN is_like = 'N' THEN 1 ELSE 0 END) as unlike \")\n )\n ->get();\n return MentorFavorite::collection($mentor);\n }", "function get_user_images($user_id) {\n $images = DAO_user::DAO_fetch_user_images($user_id);\n if (is_array($images)) {\n $i = 0;\n $result = array();\n foreach ($images as $image) {\n $result[$i++] = $image;\n }\n return $result;\n }\n else return -1;\n }", "protected function favorited($username)\n {\n $user = User::whereUsername($username)->first();\n\n $presentIds = $user ? $user->favorites()->pluck('id')->toArray() : [];\n\n return $this->builder->whereIn('id', $presentIds);\n }", "public function favourite()\n {\n return $this->belongsToMany('App\\User', 'favourite', 'media_id', 'user_id');\n }", "public function index(User $user)\n {\n $files = File::all();\n return $this->showAll($files);\n }", "public static function print_photos_by_user($user_id) {\n\t\t$photos_array = self::get_photos_by_user($user_id);\n\t\tforeach ($photos_array as $photo) {\n\t\t\techo '\n\t\t\t\t<div class=\"photo\">\n\t\t\t\t\t<a href=\"photobooth.php?photo_id=' . $photo['photo_id'] . '\" class=\"fancybox.ajax fancybox\" rel=\"profile-gallery\">\n\t\t\t\t\t\t<div class=\"imgContainer\">\n\t\t\t\t\t\t\t<img class=\"imgImg\" src=\"../../photos-thumbnails/' . Photo::get_photo_path($photo['photo_id']) . '\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t</div>';\n\t\t}\n\t}", "function getFavouriteTags(){\n //first we get all the info on tags that belong to tasks that the current user has clicked on\n $clickInfo = $this->qh->getClickTagInfo($_SESSION['userID']);\n return $this->getFavourites($clickInfo, 'TagID');\n }", "public function getFavorites()\n {\n $tricks = $this->tricks->findAllFavorites($this->user);\n\n $this->view('user.favorites', compact('tricks'));\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function find_favorites() {\n\t\tstatic $favorites;\n\n\t\tif (!is_array($favorites)) {\n\t\t\t$favorites = array();\n\t\t\tif ($this->loaded()) {\n\t\t\t\t$users = db::build()->select('user_id')->from('favorites')->where('event_id', '=', $this->id)->execute()->as_array();\n\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t$favorites[(int)$user['user_id']] = (int)$user['user_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $favorites;\n\t}", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function getFilesCurrentUser(User $user)\n {\n }", "public function index(User $user): JsonResponse\n {\n $articles = $user->favorites()->with(['resources', 'keywords', 'childrenArticles'])\n ->where('visibility', '=', 1)\n ->latest();\n return $this->collectionResponse(ArticleResource::collection($this->getModel(new Article, ['resources', 'keywords', 'childrenArticles'], $articles)));\n }", "public function user_profile_pictures( $profileuser ) {\n\t\t$user = new User_Pictures( $profileuser->data->ID );\n\t\t$pictures = $user->get_pictures();\n\t\t$primary_picture_id = $user->get_primary();\n\t\t?>\n\n\t\t<h2><?php _e( 'Profile Pictures', 'bwcpp' ); ?></h2>\n\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<th><?php _e( 'Uploaded Profile Pictures', 'bwcpp' ); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php foreach ( $pictures as $picture ) : ?>\n\t\t\t\t\t\t\t<img src=\"<?php echo $picture['url']; ?>\" width=\"96\" style=\"margin-right: 5px;<?php echo ( $picture['id'] === $primary_picture_id ) ? ' border: 3px solid red;' : ''; ?>\">\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<?php\n\t}", "function getFavoritesWithIDs(){\n\n\t$id = getUserID();\n\t$query = \"SELECT unique_networks.unique_network_id, networks.area, networks.state, activities.activity_name FROM favorites, networks, activities, unique_networks WHERE user_id = \".$id.\"\"\n\t.\" AND favorites.unique_network_id = unique_networks.unique_network_id\"\n\t.\" AND unique_networks.activity_id = activities.activity_id\"\n\t.\" AND unique_networks.network_id = networks.network_id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favs[] = $row;\n\t}\n\treturn $favs;\n}", "public function show(UserFavorite $userFavorite)\n {\n //\n return $userFavorite;\n }", "function getItems($user_id)\n {\n $this->db->select(\"*\");\n $this->db->from('favourite_goods');\n $this->db->where('user_id', $user_id);\n $query = $this->db->get();\n return $query->result();\n }", "public static function loop_my_favorites() {\n $paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n if( ! is_array( $favorites ) || count( $favorites ) == 0 ) {\n $favorites = array( '', );\n }\n\n query_posts( array(\n 'post_type' => 'property',\n 'paged' => $paged,\n 'post__in'\t\t=> $favorites,\n 'post_status' => 'publish',\n ) );\n }", "public static function get_image($user_id);", "function getUserRatings($user_id, $offset = 0, $limit = 25) {\n\n /* getting all published ratings from user */\n if (!$ratings = Ratings::getUserRatings($user_id, $offset, $limit))\n return false;\n /* foreach rating if it have photo, we must get photo thumbnails */\n foreach ($ratings as $key => $rating) {\n if (!empty($rating['photo_name'])) {\n $ratings[$key]['photo_thumbnails'] = ImagesManager::getMealPhotoThumbnails($rating['meal_id'], $rating['photo_name']);\n }\n unset($ratings[$key]['cur_meal_id']);\n }\n\n return $ratings;\n }", "public function user_favorites() {\n\t\t\tif ($this->request->is('get')) {\n\t\t\t\t$user_id = $_GET['user_id'];\n\n\t\t\t$tweet_favorites = ClassRegistry::init('tweets')->find('all', array('fields' => array('tweets.tweet,tweets.photo, tweets.created ,users_profiles.firstname, users_profiles.lastname,users_profiles.photo,users_profiles.user_id,users_profiles.handler,favorites.favorite,favorites.content_id,favorites.id ,favorites.user_id'),'order'=>'favorites.id DESC',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites', 'table' => 'favorites', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('favorites.content_id = tweets.id ')),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('favorites.user_id ='.$user_id.' AND favorites.content_type=\"tweets\"')));\n\t\t\n\t\t$this->set('tweet_favorites',$tweet_favorites);\n\t\t\n\t\t/*user friends start*/\t\n\t$reqUser = ClassRegistry::init('connections')->find('all',array('fields'=>array('connections.friend_id,connections.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('(connections.user_id='.$user_id.' OR connections.friend_id='.$user_id.') AND connections.request=1')));\n\t\t\t\n\t\tforeach ($reqUser as $rfid) {\n\t\t\t\tif ($rfid['connections']['friend_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['friend_id'];\n\t\t\t\t}\n\t\t\t\tif ($rfid['connections']['user_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['user_id'];\n\t\t\t\t} \n\t\t}\n\t\t/*user friends end*/\n\t\t\n\t\tif($comResult){\n\t\t\tif (sizeof($comResult)>1) {\n\t\t\t \t$result =@implode(',',$comResult);\n\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\tforeach ($comResult as $key=>$value) {\n\t\t\t\t\t\t\t\t\t$result = $value;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$user_tweet_comments = ClassRegistry::init('Tweet_comment')->find('all', array('fields' => array('\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.tweet_comment,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.created,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.firstname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.lastname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.photo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.user_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.tags,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.favorite,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.user_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'Tweet_comment.id DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.id = favorites.content_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.user_id = users_profiles.user_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('Tweet_comment.user_id IN ('.$result.','.$user_id.')'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Tweet_comment.comment_type = \"tweets\"'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'group' => 'Tweet_comment.id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\n\t\t$this->set('user_tweet_comments',$user_tweet_comments);\n\t\t}\n\t\t\n\t\t\t/*********************************** Retweeted tweets by user **********/\n\t$retweeted_tweets = ClassRegistry::init('tweets')->find('all',array('fields'=>array('tweets.parent_id,tweets.id,tweets.user_id,users_profiles.firstname, users_profiles.lastname, users_profiles.handler, users_profiles.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'joins'=>array(array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('tweets.parent_id !=0 AND tweets.status=2')));\n\t\t$this->set('retweeted_tweets',$retweeted_tweets);\n\t\t\n\t\t\n\t\t if ($user_id) {\n\t\t$favorites_on_Tweet = ClassRegistry::init('favorites')->find('all', array('fields'=>array('favorites.user_id,favorites.favorite,favorites.content_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'favorites.id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorites.content_type=\"tweets\" AND favorites.user_id='.$user_id)));\n\n\t\t$this->set('favorites_on_Tweet',$favorites_on_Tweet);\n\t\t\n\t\t/*Tweet count for current user*/\n\t$tweets_count_added_user= ClassRegistry::init('tweets')->find('all',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('conditions'=>array('tweets.user_id='.$user_id.' AND tweets.status=2')));\n\t\t\n\t$this->set('tweets_count_added_user',sizeof($tweets_count_added_user));\n\n\t\t\t\t\t/************************************** To show user following and followers ***********************/\n\t\t\t\t$userFollowings = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status, count(users_followings.following_id) as total_following'),'conditions'=>array('users_followings.user_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t$userFollows = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status ,count(users_followings.user_id) as total_follow'),'conditions'=>array('users_followings.following_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t\n\t\t$userFollowingsbyYou = $userFollowings[0][0];\n\t\t$userFollowingsbyYou = $userFollowingsbyYou['total_following'];\n\t\t$this->set('following',$userFollowingsbyYou);\n\t\t\n\t\t$userFollowYou = $userFollows[0][0];\n\t\t$userFollowYou = $userFollowYou['total_follow'];\n\t\t$this->set('followers',$userFollowYou);\t\t\n\t\t$this->set('userName',$this->userInfo['users_profiles']);\n\n\t\t }\n\t\t\n\t\t\n\t\t$this->autorender = false;\n\t $this->layout = false;\n\t $this->render('user_favorites');\n\t\t}\n\t}", "public function favorites()\n {\n $favoriteClass = config('favorable.favorite_model');\n\n return $this->morphMany($favoriteClass, 'favoriteable');\n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function getPhotos();", "public function index()\n {\n // Favorite users photos area\n $PopularPhotos = $this->homeService->getPopularPhotos();\n\n $Top = $PopularPhotos[0];\n $Others = array_slice($PopularPhotos->toArray(), 1);\n\n // Top User Information\n $TopUserPhotos = $this->photoService->getPhotosById($PopularPhotos[0]->user_id, false)->items();\n\n // Random photos area\n $RandomPhotos = $this->homeService->getRandomPhotos();\n\n // New Members photos area\n $NewMembers = $this->homeService->getNewMembersPhotos();\n\n //RankedUsers PopularPhotos\n return compact('TopUserPhotos','RandomPhotos','NewMembers','Top','Others');\n }", "public function getFavoritos(){\n\t\t$user_id = $_SESSION['activeUser']->getId();\n\t\tUtilidades::_log(\"getFavoritos($user_id)\");\n\t\t\n\t\t$query = \"SELECT book.*, book_lang.*\n\t\t\t\t\tFROM favourites,book, book_lang\n\t\t\t\t\tWHERE favourites.user_id = $user_id\n\t\t\t\t\t AND favourites.book_id = book.id\n\t\t\t\t\t AND favourites.book_id = book_lang.book_id\n\t\t\t\t\t and favourites.book_lang = book_lang.lang \";\n\t\t$query.= \" ORDER BY sold DESC, rating DESC\";\n\t\t\n\t\tUtilidades::_log(\"query: \".$query);\n\t\t$res = array();\n\t\t\n\t\tforeach(DB::ejecutarConsulta($query) as $row) {\n\t\t\t// Añadimos un objeto por cada elemento obtenido\n\t\t\t$res[] = new BookVO($row);\n\t\t}\n\t\treturn $res;\n\t}", "static public function getFavorites() {\r\n self::initFav();\r\n return self::$FAV;\r\n }", "public function fetchImageForUser($user, $where = null);", "public function favorite()\n {\n $attributes = ['user_id' => auth()->id()];\n\n if (! $this->favorites()->where($attributes)->exists()) {\n return $this->favorites()->create($attributes);\n }\n }", "public function index(User $user) {\n $files = $user->account->files()\n ->orderBy('type', 'desc')\n ->orderBy('name')\n ->get();\n\n return response()->json([\n 'success' => true,\n 'files' => $files,\n ]);\n }", "function getFavorites(){\n\n\t$id = getUserID();\n\t$query = \"SELECT networks.area, networks.state, activities.activity_name FROM favorites, networks, activities, unique_networks WHERE user_id = \".$id.\"\"\n\t.\" AND favorites.unique_network_id = unique_networks.unique_network_id\"\n\t.\" AND unique_networks.activity_id = activities.activity_id\"\n\t.\" AND unique_networks.network_id = networks.network_id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favs[] = $row['area']. \", \". $row['state']. \" - \" .$row['activity_name'];\n\t}\n\treturn $favs;\n}", "public function myFavoriteAction()\n {\n $em = $this->getDoctrine()->getManager();\n $favoriteRepo = $em->getRepository('BORAdvertBundle:Favorite');\n $favorites = $favoriteRepo->findByUser($this->getUser());\n $adverts = array();\n\n foreach ($favorites as $favorite) {\n $adverts[] = $favorite->getAdvert();\n }\n\n return array(\n 'entities' => $adverts,\n 'favorites' => $favorites,\n );\n }", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function favorite(){\n $attributes = ['user_id' => auth()->id()];\n\n if(! $this->favorites()->where($attributes)->exists()){\n return $this->favorites()->create($attributes);\n }\n }", "public function index() {\n return response()->json([\n 'posts' => auth()->user()->favorites()->orderBy('created_at', 'DESC')->get(),\n ]);\n }", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getAllFoodpornsByFavorite()\n {\n $stmt = self::$_db->prepare(\"SELECT fp.* FROM favorit AS fav LEFT JOIN foodporn AS fp On fav.fs_foodporn = fp.id_foodporn AND fav.fs_user=:uid WHERE id_foodporn IS NOT NULL\");\n $uid = self::getUserID();\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "public function getUserProfilePhotos(int $user_id, int $offset = 0, int $limit = 100)\n {\n return current($this->sendRequest('GET', 'getUserProfilePhotos', [\n 'user_id' => $user_id\n ]));\n }", "public function new_files_from_user($user_name, $marketplace_name = 'themeforest', $limit = null)\n {\n $url = preg_replace('/set/i', 'new-files-from-user:' . $user_name . ',' . $marketplace_name, $this->public_url);\n $new_files = $this->curl($url)->{'new-files-from-user'};\n\n // If a limit is passed, create new array from results with a count equal \n // to the limit. \n return $this->apply_limit($new_files, $limit);\n }", "function getvotados($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'integrante')) {\n\t\t$votos = $wpdb->get_var( \"SELECT count(1) FROM \".$wpdb->prefix . \"poptest_votos where votante = \".$user.\" group by votante\");\n\t\treturn $votos;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function favorited($userId=null)\n {\n if (is_null($userId)) {\n $userId = Auth()->id();\n }\n \n return (bool) $this->favorites()\n ->where('user_id', '=', $userId)\n ->count();\n }", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "public function isFavOfUser($user)\n {\n if(!$user)\n return false;\n $favs = $this->favourites;\n $usersHavingFaved = array();\n\n foreach ($favs as $fav) {\n $usersHavingFaved[] = $fav->user_id;\n }\n return (in_array($user->id, $usersHavingFaved));\n }", "public function userFavorites() {\n return $this->belongsToMany('App\\User');\n }", "public function getAllPhotos();", "public function index()\n {\n return Favourite::all();\n }", "public function index($user_id)\n {\n //\n $user = new User;\n $bookmarks = $user->find($user_id)->gifts()->with(['category', 'relationship', 'situation'])->get();\n\n return response()->json($bookmarks);\n }", "public function favorited($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\treturn (bool) $this->favorites()\n\t\t\t->where('user_id', '=', $userId)\n\t\t\t->count();\n\t}", "public function get_users_items($user,$from_marketplaces=array()){\n $files = array();\n if(!is_array($from_marketplaces))$from_marketplaces=array($from_marketplaces);\n foreach($from_marketplaces as $marketplace){\n //http://marketplace.envato.com/api/v2/new-files-from-user:collis,themeforest.json\n $url = \"http://marketplace.envato.com/api/v2/new-files-from-user:$user,$marketplace.json\";\n if(_ENVATO_DEBUG_MODE){\n echo \" Grabbing API url: $url <bR>\\n\";\n }\n $data = $this->get_url($url,array(),false);\n if(!empty($data)) {\n $json_data = json_decode($data, true);\n if(_ENVATO_DEBUG_MODE){\n echo \"data: \";print_r($json_data);\n }\n $files = array_merge($files,$json_data['new-files-from-user']);\n }\n }\n return $files;\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getPins($user, $storeLocally = false) {\n\n $pagenum = 1;\n $content = \"\";\n $pinterestDir = \"\";\n\n if ($storeLocally) {\n // remove all existing pins\n $pinterestDir = __DIR__ . '/pins/';\n $this->rrmdir($pinterestDir); \n }\n \n // the last page of content contains the string noResults \n while (strpos($content, \"noResults\") == FALSE) {\n $content .= file_get_contents(\"http://pinterest.com/$user/pins/?lazy=1&page=$pagenum\");\n $pagenum++;\n }\n preg_match_all('#\\bhttps?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', $content, $matches);\n $matches = $matches[0];\n\n $pins = array();\n foreach ($matches as $pin) {\n\n $tmp = strpos($pin, \"550x\");\n if ($tmp !== FALSE) {\n\n if ($storeLocally) {\n // download and store pin\n // $pinterestDir = __DIR__;\n $imageName = basename($pin);\n $imageFullPath = $pinterestDir . $imageName;\n if (!file_exists($imageFullPath)) {\n file_put_contents($imageFullPath, file_get_contents($pin));\n }\n \n $pin = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];\n $pin = substr($pin,0, strrpos($pin, '/')+1);\n $pin .= 'pins/';\n $pin .= $imageName;\n }\n\n $pins[] = $pin;\n }\n }\n\n sort($pins);\n $pins = array_unique($pins); \n \n return $pins;\n }", "public static function create_by_user_folder_public($a_user_id, $a_folder){\n\n\t\t$request_id = self::_get_connection()->prepare(\"SELECT ID from `apine_images` where ( user_id=? AND folder=? ) OR ( privacy=2 AND folder=? )\");\n\t\t$request = self::_get_connection()->execute(array(\n\t\t\t\t\t\t$a_user_id,\n\t\t\t\t\t\t$a_folder,\n\t\t\t\t\t\t$a_folder\n\t\t), $request_id);\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "public function getUserFiles()\n {\n $user_files = Helper::getUserFiles();\n return $user_files;\n }", "public function favorites()\n\t{\n\t\treturn $this->morphMany(Favorite::class, 'favoriteable');\n\t}", "public function getUserFavorites($limit = null)\r\n {\r\n $args = array();\r\n if (!empty($limit)) {\r\n $args['limit'] = (int)$limit;\r\n }\r\n return self::makeCall('getUserFavoriteSongs', $args, 'songs', false, $this->sessionID);\r\n }", "public function favourites($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif(!$user = User::findUser(array('user_id' => $id)))\n\t\t{\n\t\t\t// something has gone wrong with db request\n\t\t\theader(\"Location: /myrecipe/users/\".$id);\n\t\t\texit;\n\t\t}\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t// find all the favourites\n\t\t$data = array('favourites.user_id'=>$id, 'recipe_images.is_cover'=>'yes');\n\t\t$favourites = Favourites::findFavourites($data);\n\t\t$this->template->favourites = $favourites;\n/*\t\techo \"<pre>\";\n\t\tprint_r($favourites);\n\t\techo \"</pre>\";\n*/\n\t\t$this->template->display('favourites.html.php');\n\t}", "function getFilesByUserId($user_id) {\r\n $sql = '\r\n SELECT\r\n *\r\n FROM\r\n files\r\n WHERE\r\n user_id = ?\r\n ORDER BY\r\n uuid DESC\r\n ';\r\n\r\n return $this->query_result($sql, array($user_id));\r\n }", "public function show($id)\n {\n return Favorite::where('user_id', $id)->with('entity')->get();\n }", "public function favorite($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\tif($userId) {\n\t\t\t$favorite = $this->favorites()\n\t\t\t\t->where('user_id', '=', $userId)\n\t\t\t\t->first();\n\n\t\t\tif($favorite) return;\n\n\t\t\t$favorite = new Favorite();\n\t\t\t$favorite->user_id = $userId;\n\t\t\t$this->favorites()->save($favorite);\n\t\t}\n\n\t\t$this->incrementFavoriteCount();\n\t}", "public function favourites()\n {\n return $this->morphMany(Favourite::class, 'favourite');\n }", "public function index()\n {\n $client_id = Auth::guard('client')->user()->id;\n $favs = Favorite::where('client_id', $client_id)->get();\n return view('home.fav',compact('favs'));\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function get_favorites()\n {\n return view('content.favorites')\n ->with('page_title', 'Your Favorite Pages')\n ->with('titles', Favorite::all());\n }", "function favorites_page_handler ($page) {\n\tgatekeeper();\n\n\tif (empty($page[0])) {\n\t\t$user = elgg_get_logged_in_user_entity();\n\t} else {\n\t\t$user = get_user_by_username($page[0]);\n\n\t\tif (!$user) {\n\t\t\tregister_error(elgg_echo('favorites:notfound'));\n\t\t\tforward(REFERER);\n\t\t}\n\t}\n\n\tif ($user->guid == elgg_get_logged_in_user_guid()) {\n\t\t$title = elgg_echo('favorites:own');\n\t} else {\n\t\t$title = elgg_echo('favorites:user', array($user->name));\n\t}\n\n\t$content = elgg_list_entities_from_relationship(array(\n\t\t'relationship_guid' => $user->getGUID(),\n\t\t'relationship' => 'favorite',\n\t\t'inverse_relationship' => true,\n\t\t'full_view' => false,\n\t\t'order_by' => 'r.time_created DESC',\n\t));\n\n\tif (!$content) {\n\t\t$content = elgg_echo('favorites:none');\n\t}\n\n\t$params = array(\n\t\t'title' => \t$title,\n\t\t'content' => $content,\n\t\t'filter' => '',\n\t);\n\n\t$body = elgg_view_layout('content', $params);\n\techo elgg_view_page($title, $body);\n}", "public function getList($user);", "public function favourites(){\n return $this->hasMany('App\\Favourite', 'user_id');\n }", "function getAllUserLikes($model=null){\n\t\t$user_id = $this->Auth->user('id');\n\t\treturn $this->Vote->getAllUserLikes($model,$user_id);\n\t}", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }" ]
[ "0.77330893", "0.7666382", "0.75277483", "0.722145", "0.7196927", "0.7091533", "0.69208944", "0.6708945", "0.6678264", "0.65504897", "0.6491154", "0.6482784", "0.64572716", "0.6451725", "0.6430946", "0.63825727", "0.62879896", "0.6244853", "0.61897665", "0.61817765", "0.6181298", "0.61439854", "0.606273", "0.605977", "0.6046758", "0.6026596", "0.6018812", "0.6017503", "0.60098666", "0.60075057", "0.59781885", "0.5974265", "0.59383285", "0.5882572", "0.58709544", "0.584573", "0.5839842", "0.5837636", "0.58291477", "0.5788023", "0.5784679", "0.57466054", "0.5742422", "0.57389873", "0.572595", "0.57257384", "0.5711026", "0.5708847", "0.57032526", "0.56985873", "0.5686384", "0.56332636", "0.56241256", "0.5622208", "0.5620385", "0.56156546", "0.56134117", "0.5608186", "0.5606689", "0.5602398", "0.55988777", "0.5577039", "0.55742776", "0.55673635", "0.5561428", "0.5552057", "0.55515224", "0.5551289", "0.55448717", "0.55395997", "0.55346185", "0.5531855", "0.55173904", "0.55108476", "0.5495605", "0.54519665", "0.54477537", "0.5447209", "0.54424644", "0.54370403", "0.5435853", "0.5430705", "0.5427864", "0.54260373", "0.5423358", "0.5423128", "0.5415645", "0.53960985", "0.53828704", "0.5365438", "0.53584874", "0.5352431", "0.5352305", "0.53507787", "0.5350378", "0.5348693", "0.53431886", "0.53425175", "0.5342381", "0.53396624" ]
0.79236317
0
Removes a photo from a user's favorites list.
function favorites_remove ($photo_id) { $response = $this->execute(array('method' => 'flickr.favorites.remove', 'photo_id' => $photo_id), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeFavorites()\n {\n $this->favorites()->delete();\n $this->favoriteCounter()->delete();\n }", "public static function remove_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if (!empty($_GET['id'])) {\n $favorites = get_user_meta(get_current_user_id(), 'favorites', true);\n\n if (!empty($favorites) && is_array($favorites)) {\n foreach ($favorites as $key => $property_id) {\n if ($property_id == $_GET['id']) {\n unset($favorites[$key]);\n }\n }\n\n update_user_meta(get_current_user_id(), 'favorites', $favorites);\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __('No favorite properties found.', 'realia-favorites'),\n );\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __('Property ID is missing.', 'realia-favorites'),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "public function removeFavorites()\n\t{\n\t\tFavorite::where('favoriteable_type', $this->morphClass)->where('favoriteable_id', $this->id)->delete();\n\n\t\tFavoriteCounter::where('favoriteable_type', $this->morphClass)->where('favoriteable_id', $this->id)->delete();\n\t}", "private function deleteFavorite()\n {\n try\n {\n $request = $_REQUEST;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"Video Id not provided.\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"Video Id is not numeric.\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n $video_id = mysql_clean($request['videoid']);\n global $cbvid;\n $cbvid->action->remove_favorite($video_id);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'removed from favorites succesfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function deleteFromFavorites($user_id, $item_id);", "function remove_favorite($fav_id,$uid=NULL)\r\n\t{\r\n\t\tglobal $db;\r\n\t\tif(!$uid)\r\n\t\t\t$uid=userid();\r\n\t\tif($this->fav_check($fav_id,$uid))\r\n\t\t{\r\n\t\t\t$db->delete(tbl($this->fav_tbl),array('userid','type','id'),array($uid,$this->type,$fav_id));\r\n\t\t\te(sprintf(lang('fav_remove_msg'), lang($this->name)),'m');\r\n\t\t}else\r\n\t\t\te(sprintf(lang('unknown_favorite'), lang($this->name)));\r\n\t}", "function bp_activity_action_remove_favorite() {\n\n\tif ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'unmark_favorite' );\n\n\tif ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )\n\t\tbp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' );\n\n\tbp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );\n}", "public function remove( $args, $assoc_args ) {\n\t\t$user = $this->get_user_id_from_identifier( $assoc_args['user-id'] );\n\n\t\t// Check if topic exists.\n\t\t$topic_id = $assoc_args['topic-id'];\n\t\tif ( ! bbp_is_topic( $topic_id ) ) {\n\t\t\t\\WP_CLI::error( 'No topic found by that ID.' );\n\t\t}\n\n\t\t\\WP_CLI::confirm( 'Are you sure you want to remove this topic from the user\\'s favorite list?', $assoc_args );\n\n\t\t// True if removed.\n\t\tif ( bbp_remove_user_favorite( $user->ID, $topic_id ) ) {\n\t\t\t\\WP_CLI::success( 'Favorite successfully removed.' );\n\t\t} else {\n\t\t\t\\WP_CLI::error( 'Could not remove favorite.' );\n\t\t}\n\t}", "public function unfavorite($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\tif($userId) {\n\t\t\t$favorite = $this->favorites()\n\t\t\t\t->where('user_id', '=', $userId)\n\t\t\t\t->first();\n\n\t\t\tif(!$favorite) { return; }\n\n\t\t\t$favorite->delete();\n\t\t}\n\n\t\t$this->decrementFavoriteCount();\n\t}", "function removeFavorite($id, $name){\n\t\t\t$str_query=\"DELETE FROM cuisine_favorite WHERE fav_id='$id' and username='$name'\";\n\t\t\treturn $this->query($str_query);\n\t\t}", "function deleteFromFavorites() {\n if($this->getRequestMethod() != \"POST\") {\n $this->response('',406);\n }\n $userId = (int)$this->_request['user_id'];\n $videoId = (int)$this->_request['video_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($userId, $auth)) {\n $this->response('',204);\n }\n if($videoId > 0) { \n $query = \"delete from favorites where user_id=$userId and video_id=$videoId;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Successfully deleted one record.\");\n $this->response(json_encode($success),200);\n } else {\n $this->response('',204);\n } \n }", "function photo_remove() {\n if ( ! $this->input->is_ajax_request() || ! $this->auth->is_login()) {\n return redirect(config_item('site_url'));\n }\n \n $item = filter($this->uri->segment(3), 'str', 40);\n $photo = $this->media->get_by_id($item);\n \n if ( ! $photo || empty($photo)) {\n log_write(LOG_WARNING, 'Photo not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n \n if ($photo->item_author != $this->auth->get_user_id()) {\n log_write(LOG_ERR, 'User is not the author of the photo, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $image = explode('.', $photo->item_filename);\n\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '_thumb.' . $image[1]);\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '.' . $image[1]);\n\n $this->media->remove($item);\n \n return $this->output->set_output(json_encode(array(\n 'code' => 'luck'\n )));\n }", "public function unset_fav($username = '', $id = '') {\n\t\t\n\t\tif ($username == '') return 0;\n\t\tif ($id == '') return 0;\n\t\t\n\t\t$key = $this->_get_user_fav_key($username);\n\t\t\t\t\n\t\t//use current time as score\n\t\t$ret = Redis::zrem($key, $id); \t\t\n\t\tif ($ret == 1)\n\t\t\treturn 1;\n\t\t\n\t\treturn 0;\n\t }", "public function clearUserFavorites()\n\t{\n\t\t$this->collUserFavorites = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function removeCompany()\n {\n\n $company = Auth::user()->favorites()->find($this->request->remove);\n $company->tags()->detach();\n $company->delete();\n\n Session::flash('message', $company->company_name . ' was removed from your favorites.');\n\n return redirect('/favorites');\n\n }", "public function remove($id){\n $user = \\Auth::user();\n $user->festivals()->detach($id);\n\n return redirect('/favorites');\n }", "public function action_remove(){\n\t\t$monumentId = $this->request->param('id');\n\t\t$user = Auth::instance()->get_user();\n\t\t\n\t\t// Remove the monument from the user list\n\t\t$favoriteList = new Model_List_Favorite();\n\t\t$favoriteList->remove($monumentId, $user->UserID);\n\t\t\n\t\t// Redirect the user back to the monument page\n\t\t$this->request->redirect('monument/view/' . $monumentId);\n\t}", "public function defavorite($userId=null)\n {\n if (is_null($userId)) {\n $userId = Auth()->id();\n }\n \n if ($userId) {\n $favorite = $this->favorites()\n ->where('user_id', '=', $userId)\n ->first();\n \n if (!$favorite) {\n return;\n }\n \n $favorite->delete();\n }\n\n $this->decrementFavoriteCount();\n }", "public function unfavourite(Request $request)\n {\n $data = $request->all();\n $favourite = Favourite::where([\n \"place_id\" => $data[\"place_id\"],\n \"user_id\" => $data[\"user_id\"]\n ]);\n $favourite->delete();\n return response()->json(['message' => 'deleted']);\n }", "function delete() {\n\t\tif ( $this->getUserID() ) {\n\t\t\t$query = 'DELETE FROM '.system::getConfig()->getDatabase('mofilm_content').'.userEventFavourites WHERE userID = :UserID';\n\t\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t\t$oStmt->bindValue(':UserID', $this->getUserID());\n\t\t\t$oStmt->execute();\n\t\t\t$oStmt->closeCursor();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function removeFromFavorites($objid);", "public function delete(){\r\n\t\t$image = $this->admin_users_model->get_one(array('id'=>$this->uri->segment(2)),'UserAvatar');\r\n\t\t@unlink('../upload/avatar/'.$image);\r\n\t\t$this->admin_users_model->Delete($this->uri->segment(2));\r\n\t\tredirect('admin-users-list');\t\r\n\r\n\r\n\t\t}", "public function deleteProfilePhoto(): void\n {\n if (! Features::managesProfilePhotos()) {\n return;\n }\n\n if (is_null($this->profile_photo_path)) {\n return;\n }\n\n Storage::disk($this->profilePhotoDisk())->delete($this->profile_photo_path);\n\n $this->forceFill([\n 'profile_photo_path' => null,\n ])->save();\n }", "public function removePhotoAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id');\n\n //GET LISTING ITEM\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n //GET FILE ID\n $file_id = Engine_Api::_()->getDbtable('photos', 'sitereview')->getPhotoId($listing_id, $sitereview->photo_id);\n\n //DELETE PHOTO\n if (!empty($file_id)) {\n $photo = Engine_Api::_()->getItem('sitereview_photo', $file_id);\n $photo->delete();\n }\n\n //SET PHOTO ID TO ZERO\n $sitereview->photo_id = 0;\n $sitereview->save();\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'change-photo', 'listing_id' => $listing_id), \"sitereview_dashboard_listtype_$listingtype_id\", true);\n }", "public function destroy(UserFavorite $userFavorite)\n {\n //\n $userFavorite->delete();\n }", "function ciniki_poma_favItemDelete(&$ciniki, $tnid, $args) {\n \n //\n // Check args\n //\n if( !isset($args['object']) || $args['object'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.29', 'msg'=>'No item specified.'));\n }\n if( !isset($args['object_id']) || $args['object_id'] < 1 || $args['object_id'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.30', 'msg'=>'No item specified.'));\n }\n if( !isset($args['customer_id']) || $args['customer_id'] < 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.31', 'msg'=>'No customer specified.'));\n }\n\n //\n // Check if item already exists as a fav\n //\n $strsql = \"SELECT id, uuid, status \"\n . \"FROM ciniki_poma_customer_items \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND itype = 20 \"\n . \"AND object = '\" . ciniki_core_dbQuote($ciniki, $args['object']) . \"' \"\n . \"AND object_id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.32', 'msg'=>'Unable to add favourite.', 'err'=>$rc['err']));\n }\n //\n // Remove the favourite, and if multiple rows due to bug, remove all rows\n //\n if( isset($rc['rows']) && count($rc['rows']) > 0 ) {\n foreach($rc['rows'] as $row) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.poma.customeritem', $row['id'], $row['uuid'], 0x07);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n\n return array('stat'=>'ok');\n}", "public function removePhoto($value)\n {\n $key = array_search($value, $this->photos);\n if($key !== false) {\n unset($this->photos[$key]);\n }\n }", "public function removeFavourite($book_id, $book_lang){\n\t\t$user_id = $_SESSION['activeUser']->getId();\n\t\tUtilidades::_log(\"removeFavourite($user_id, $book_id, $book_lang)\");\n\t\t\n\t\t$query = 'DELETE FROM favourites \n\t\t\t\t\tWHERE user_id = :user_id\n\t\t\t\t\t AND book_id = :book_id\n\t\t\t\t\t AND book_lang = :book_lang';\n\t\t$db=DB::conectar();//Devuelve conexión\n\t\t$delete=$db->prepare($query);\n\t\t//Bind values\n\t\t$delete->bindValue('user_id',$user_id);\n\t\t$delete->bindValue('book_id',$book_id);\n\t\t$delete->bindValue('book_lang',$book_lang);\n\t\t\n\t\t$delete->execute();\n\t\t\n\t\tUtilidades::_log(\"Eliminado.\");\n\t}", "public function unFavoritePost(Post $post){\n\t Auth::user()->favorites()->detach($post->id);\n\t return back();\n\t}", "public function destroy($id)\n {\n $model = FavoritesModel::where('users_id','=',$request->input('users_id'))->where('news_id','=',$request->input('news_id'))->first();\n if($model->delete()){\n return Common::returnErrorResult(200,'取消收藏成功','');\n }\n else{\n return Common::returnErrorResult(400,'传参错误','');\n }\n // \\Auth::user()->favorites()->detach($id);\n // return redirect()->back();\n }", "public function deleteProfilePhoto()\n {\n Storage::disk($this->profilePhotoDisk())->delete($this->profile_photo_path);\n\n $this->forceFill([\n 'profile_photo_path' => null,\n ])->save();\n }", "public function destroy(UserList $userlist)\n { \n $this->authorize('modify', $userlist);\n if($userlist->image) {\n File::delete(public_path().$userlist->image);\n }\n $userlist->delete();\n return redirect('/userlists');\n }", "private function deleteLatestAvatar()\n {\n $userId = Auth::user()->id;\n $userLatestAvatar = Avatar::where('user_id', $userId)->oldest()->first();\n if ($userLatestAvatar) {\n $imageUrl = $userLatestAvatar->image_url;\n if (!strpos($imageUrl, 'default')) {\n $locationImage = public_path('uploads/avatars/' . $imageUrl);\n unlink($locationImage);\n }\n $userLatestAvatar->delete();\n }\n }", "public function destroy(Favorite $favorite)\n {\n //\n }", "public function destroy(User $user, $id)\n {\n $article = Article::query()->findOrFail($id);\n\n if ($user->favorites->contains($article))\n {\n $user->favorites()->detach($article);\n return $this->api_success([\n 'data' => $article,\n 'message' => 'articulo eliminado de favoritos!',\n 'code' => 200\n ]);\n } else\n {\n return $this->errorResponse(\n 'Este articulo no se encuentra en los favoritos!'\n );\n }\n }", "public function favorites($user, $options = []);", "public function destroy($unique_id)\n {\n // Get user\n $user = Auth::user();\n\n if (is_demo($user->id)) {\n return Demo::favourites($user);\n }\n\n // Remove folder from user favourites\n $user->favourites()->detach($unique_id);\n\n // Return updated favourites\n return $user->favourites->makeHidden(['pivot']);\n }", "public function unfavorite($id)\n {\n $product = Product::findOrFail($id);\n $favorite = Favorite::where('user_id', Auth::id())->where('product_id', $product->id)->firstorFail();\n $favorite->delete();\n\n return back();\n }", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "function removeProfileimg($userId)\n {\n $this->db->select(PROFILE_IMAGE);\n $this->db->from(TBL_USERS);\n $this->db->where(USERID, $userId);\n $query = $this->db->get();\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n unlink(FCPATH . \"assets/uploads/profilephoto/\" . $result[0][PROFILE_IMAGE]);\n $data = array(\n PROFILE_IMAGE => 0\n );\n $this->db->where(USERID, $userId);\n $this->db->update(TBL_USERS, $data);\n return true;\n } else {\n return false;\n }\n }", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function destroy(Request $request)\n {\n $fid = $request->fid;\n $fv = Favorite::find($fid);\n if ($fv != null) {\n $fv->delete();\n return $this->send_response(true, [], 200, 'Favorite removed');\n }\n return $this->send_response(false, [], 401, 'Favorite not found');\n }", "public function destroy( $id)\n {\n $matchThese = ['book_id' => $id, 'user_id' => Auth::id(),'deleted_at'=>NULL];\n\n DB::table('favourites')->where($matchThese)->delete();\n \n return redirect ()->route('home');\n }", "function local_avatars_delete_image($user_id){\n\tlocal_avatars_get_plugin()->file_handler->delete_image($user_id);\n}", "protected function deleteOldImage(){\n if(auth()->user()->profileImage){\n Storage::delete('/public/images/'.auth()->user()->profileImage);\n }\n }", "private function decrementFavoriteCount()\n {\n $counter = $this->favoriteCounter()->first();\n\n if ($counter) {\n $counter->count--;\n if ($counter->count) {\n $counter->save();\n } else {\n $counter->delete();\n }\n }\n }", "public function destroy($prop_id)\n {\n \n UserFavourite::where('prop_id', $prop_id)\n ->where('user_id', Sentry::getUser()->id)->delete();\n \n return Redirect::back();\n\n }", "public function deleteUserProfilePicture(Request $request)\n {\n $data= Validator::make($request->all(), [\n 'id' => 'required'\n ]);\n\n if ($data->fails()) {\n return response()->json([\n 'status' => 400,\n 'message' => 'All fields are required',\n 'data'=> []\n ], 400);\n }\n\n if($request->id != $request->userID){\n return response()->json([\n 'status' => 400,\n 'message' => 'Not authorized to carry out this action',\n 'data'=> []\n ], 400);\n }\n\n User::find($request->id)->update([\n 'pictureUrl' => null\n ]);\n $user = User::find($request->id);\n $user->followers = Follow::where('userId', $user->id)->count();\n $user->following = Follow::where('followedBy', $user->id)->count();\n $user->recipes = Recipe::where('userId', $user->id)->count();\n\n return response()->json([\n 'status' => 200,\n 'message' => 'User account has been updated',\n 'data' => [\n $user\n ]\n ], 200);\n }", "public function destroy(Request $request, $image_id)\n {\n $image_id = Like::where([['image_id', $image_id], ['user_id', $request->user()->id]])->delete();\n return redirect('home');\n }", "public function destroy($id)\n {\n Favourite::find($id)->delete();\n return redirect()->back();\n }", "public function actionDropImg() {\n $userId = Yii::$app->request->post('userId');\n\n if (empty($userId)) {\n return false;\n }\n\n $model = User::find()\n ->where(['id' => $userId])\n ->one();\n\n unlink(Yii::getAlias('@app') . $model->img_user_profile);\n\n $model->img_user_profile = null;\n $model->save();\n\n return true;\n }", "private function decrementFavoriteCount()\n\t{\n\t\t$counter = $this->favoriteCounter()->first();\n\n\t\tif($counter) {\n\t\t\t$counter->count--;\n\t\t\tif($counter->count) {\n\t\t\t\t$counter->save();\n\t\t\t} else {\n\t\t\t\t$counter->delete();\n\t\t\t}\n\t\t}\n\t}", "public function destroy(Request $request, Favorite $favorite = null)\n {\n //\n $resource = request('resource_type')::find(request('resource_id'));\n \n $resource->unfavorite();\n }", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "function removeFavorite(){\n $id = $_REQUEST['id'];\n $name=$_REQUEST['name'];\n include(\"../model/favorite.php\");\n $obj=new favorite();\n\n if($obj->removeFavorite($id, $name)) {\n echo '{\"result\":1}';\n }\n else {\n echo '{\"result\":0}';\n }\n }", "public function removeImage($image)\n {\n if (file_exists('upload_image/' . $image)) {\n unlink('upload_image/' . $image);\n }\n }", "public function destroy($id)\n {\n Gallery::RemoveUserPhoto( $id );\n }", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "public function deletePicture()\n {\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $tenant->profile_picture = NULL;\n $tenant->save();\n\n }", "public function destroyPhoto($id) {\n\n // Find the ID of the photo and delete it.\n ProfilePhoto::findOrFail($id)->delete();\n\n return redirect()->back();\n\n }", "protected function removeFavourites($args) {\n\n if ($args['ent_date_time'] == '' || $args['ent_mas_email'] == '')\n return $this->_getStatusMessage(1, 15);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $location = $this->mongo->selectCollection('location');\n\n $masDet = $location->findOne(array('email' => $args['ent_mas_email']));\n\n $favorite = $this->mongo->selectCollection('favourite');\n $favorite->remove(array('driver' => (int) $masDet['user']));\n\n return $this->_getStatusMessage(96, 52);\n }", "public function deleteSupervisionFromFavoriteList(Request $request)\n {\n return DB::table('favorite_supervision_list')->where('userId', '=', \\Auth::user()->id)->where('supervision_id', '=', $request->supervisionId)->delete();\n }", "function removeSurferFromFavorites($surferId = NULL) {\n $condition = NULL;\n if ($surferId != NULL) {\n $condition = array('favorite_surferid' => $surferId);\n }\n $this->databaseDeleteRecord($this->tableFavorites, $condition);\n }", "public function remove()\n\t{\n\t\t$photosTable = PTA_DB_Table::get('Catalog_Product_Photo');\n\t\t$photos = (array)$photosTable->getPhotos($this->_id);\n\n\t\tif (parent::remove()) {\n\t\t\t$photoFileField = $photosTable->getFieldByAlias('photo');\n\t\t\tforeach ($photos as $photo) {\n\t\t\t\tPTA_Util::unlink(PTA_CONTENT_PATH . '/' . $photo[$photoFileField]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function deleteSongFromFavorites($userId, $songId){\n return $this->DB->exec(\"DELETE FROM favorite_songs WHERE user_id = $userId AND song_id = $songId\");\n }", "public function deleteImage($foto) {\n \t\n \tforeach($this->barcoFotos as $barcof) {\n \t\tif ($barcof->id === $foto) {\n \t\t\t$image = $barcof->foto_url;\n \t\t\tif (unlink($image)) {\n \t\t\t\t$barcof->delete();\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t}\n \treturn false;\n }", "public function destroy(Request $request)\n {\n $currentUser = User::find(Auth::user()->id);\n\n $request->validate([\n 'photo-like-id' => 'integer|required'\n ]);\n\n $photoLikeID = intval($request->input('photo-like-id'));\n\n if ($photoLike = PhotoLike::find($photoLikeID)) {\n if ($photoLike->user_id === $currentUser->id) {\n if ($photoLike->delete()) {\n return redirect()->back();\n } else {\n return redirect()->back()->with('not-unliked', 'An Error Occured when Unliking the Photo. Please try Again');\n }\n } else {\n return redirect()->back();\n }\n } else {\n return redirect()->back();\n }\n }", "public function removeProfile();", "public function delete()\n {\n $this->images()->delete();\n // as suggested by Dirk in comment,\n // it's an uglier alternative, but faster\n // Photo::where(\"user_id\", $this->id)->delete()\n\n // delete the user\n return parent::delete();\n }", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "public function destroy($id)\n {\n $user = User::find($id);\n if(auth()->user()->role == \"admin\" || auth()->user()->id == $id){\n $user->delete();\n return back();\n }\n if ($post->cover_image != 'profile.png') Storage::delete('public/_profileimg/'.$user->image);\n\n return redirect(\"/home\");\n\n \n }", "public function do_delete_old_image(){\n\t\t$data = $this->get_profile();\n\n\t\t// Delete file\n\t\t$this->load->helper(\"file\");\n\t\t$old_image_path = $data['image'];\n\t\t// Change path when you upload to a live server\n\t\tif ($old_image_path != 'default.gif') {\n\t\t\tunlink($_SERVER['DOCUMENT_ROOT']. 'ci/public/upload/img/profile/thumbnail_' .$old_image_path);\n\t\t\tunlink($_SERVER['DOCUMENT_ROOT']. 'ci/public/upload/img/profile/' .$old_image_path) ;\n\t\t}\n\n\t\t// Remove a file table in upload table\n $this->db->where('id', $this->session->userdata('id'));\n $fetch_image = $this->db->get('user_profiles')->row()->image;\n $this->db->where('file', $fetch_image);\n $this->db->delete('upload');\n\n\t\t// Remove filename in profiles table\n\t\t$temp_data = array(\n\t\t\t'image' => 'default.gif'\n\t\t\t);\n\t\t$this->db->where('id', $this->session->userdata('id'));\n\t\t$this->db->update('user_profiles', $temp_data);\n\t}", "public function destroy($id)\n {\n $user = User::findorFail($id)->posts;\n foreach ($user as $us){\n $us->delete();\n }\n\n // $userimg = unlink(public_path() . \"/\" .$user->photos->name );\n return back()->with([\"message\"=>\"Successfully deleted\"]);\n }", "public function delete_photo(){\n $sql=\"DELETE FROM photos WHERE id=\".$this->id;\n self::$connect->query($sql);\n\n }", "function deleteImage() \n\t{\n\t\t$filename = $this->fieldValue(\"theme_backimage\",\"\",\" and user_id=\".$this->user_id);\n\t\tif (trim($filename)!=\"\" && file_exists(THEME_BACK_IMAGE.$filename))\n\t\t\tunlink(THEME_BACK_IMAGE.$filename);\n\t\t\n\t\t$strquery=\"UPDATE \".DB_PREFIX.\"theme SET theme_backimage='', updated_date='\".$this->updated_date.\"', updated_by='\".$this->updated_by.\"' WHERE user_id=\".$this->user_id;\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}", "public function destroy($user)\n {\n $post = Post::findOrFail($user);\n\n if($post->photo->file)\n {\n unlink(public_path(). $post->photo->file);\n }\n\n $post->delete();\n\n return redirect('/admin/posts');\n }", "public function actionFavorites()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\t\n\t\t$unfavorite = Yii::app()->request->getParam('unfavorite');\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\n\t\tif($unfavorite && $user_id) {\n\t\t\t\n\t\t\t$record = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $unfavorite));\n\t\t//\tdie(print_r($record));\n\t\t\tif($record)\n\t\t\t\t$record->delete();\n\t\t//\t$this->redirect('/cabinet/favorites');\n\t\t//\t Yii::app()->end();\n\n\t\t}\t\n\n\n\t\t\n\t\tif($user_id) {\n\t\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\t\n\t\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t\t if ($fruit_name == 1) {\n\t\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t\t }\n\t\t\t next($cookie_favorite);\n\t\t\t}\n\t\t\t\n\t\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\t\tif(!$favorite) {\n\t\t\t\t\t$record = new Favorited;\n\t\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t\t$record->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$this->checkUser();\n\t\t$favarray = array();\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\t//echo print_r($cookie_favorite, true);\n\t\t\n\t\tforeach($cookie_favorite as $cookie_key => $cookie_value) {\n\t\t\t\n\t\t if ($cookie_value && $unfavorite != $cookie_key) {\n\t\t $cookie_fav_wrap[] = $cookie_key;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\tif ($unfavorite != $fav_item) \n\t\t\t\t$favarray[] = $fav_item;\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\n\t\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t\tif($fav->object_id == $unfavorite)\n\t\t\t\t$fav->delete();\n\t\t}\t\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\tif($unfavorite != $favorite->object_id) {\n\t\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\tunset($_COOKIE['favorite']);\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t$cookie->path = '/';\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t} else {\n\t\t\tif(!$user_id && $unfavorite) {\n\t\t\t\tforeach($favarray as $favorite) {\n\t\t\t\t\t$cookie_fav_wrap[$favorite] = true;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\t\tunset($_COOKIE['favorite']);\n\t\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t\t$cookie->path = '/';\n\t\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t}\n\n\t\t\n\t\t$this->render('favorites',array('objects'=>$objects,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "function deleteUserImage($id)\n {\n $connect = new Config();\n $sql = \"SELECT user_info FROM user_db WHERE id = :id\";\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n $delImage = $query->fetch();\n\n $decoded = json_decode($delImage['user_info'], true);\n $image = $decoded['user_image'];\n\n if ($delImage != DEFAULT_IMAGE) {\n unlink($_SERVER['DOCUMENT_ROOT'] . $image);\n }\n }", "public function destroy($id)\n {\n // delete\n $fav = Favorite::find($id);\n $fav->delete();\n\n // redirect\n Session::flash('message', 'Favori supprimé avec succès');\n return Redirect::to('favorite');\n }", "public function removeUpload()\n {\n $this->picture = null;\n }", "function removeUserProfilePicture(){\n\n $con = connectToDatabase();\n\n $sql = \"UPDATE users set profilePhoto = NULL WHERE User_id = \" . $_SESSION['User_id'];\n\n if($result = mysqli_query($con,$sql)){\n\n // Close the connection to the database\n\n mysqli_close($con);\n\n\n return true;\n } else {\n return false;\n }\n\n\n}", "public static function removeFavoritesOnDelete()\n {\n return isset(static::$removeFavoritesOnDelete)\n ? static::$removeFavoritesOnDelete\n : true;\n }", "function favoriteDelete($pid, $post = array(), $query = array(), $rawJson = false) {\n \t\tif ( $currentUser = $this->currentUserLogin() ) {\n \t if ( $json = $this->_post('/users/'.$currentUser.'/favorites/'.$pid.'.json', $post, 'delete', $query, true) )\n \t\t return $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t\t} else {\n \t\t return false;\n \t\t}\n \t}", "public function destroy_photo($id)\n {\n //\n if(File::exists(public_path('files/products_img/'.Photo::find($id)->name)))\n {\n File::delete(public_path('files/products_img/'.Photo::find($id)->name));\n Photo::find($id)->delete();\n return redirect()->back();\n }\n }", "public function destroy($id)\n {\n // User::findOrFail($id)->delete();\n $user = User::findOrFail($id);\n unlink(public_path($user->photo->file));\n $user->delete();\n Session::flash('message', 'The user has been deleted :-(');\n return redirect('admin/users');\n }", "public function avoir_realisateur_favoris_delete(){\r\n\t\tglobal $conn;\r\n\t\t$query = $conn->prepare(\"DELETE QUICK FROM avoir_realisateur_favoris WHERE :id_films = id_films AND :id_realisateur = id_realisateur;\");\r\n\t\t$query->execute(array(\"id_films\" => $this->id_films,\"id_realisateur\" => $this->id_realisateur ));\r\n\t}", "public function removePhotoProfile(Request $request){\n\n return response( $this->profileRepository->RemovePhotoProfile($request,$this->user), 200);\n\n }", "public function actionRemoveFromBasket()\n\t{\n\t\t$removeThis = array($_GET['imageid']);\n\t\t$basket = Yii::app()->user->getState('basketContents');\n\t\t$newBasket = array_diff($basket,$removeThis);\n\t\t// reduces useless keys, blank keys, from the array\n\t\t$newBasket = array_values($newBasket);\n\t\tYii::app()->user->setState('basketContents',$newBasket);\n\t}", "public static function removeFavoritesOnDelete()\n\t{\n\t\treturn isset(static::$removeFavoritesOnDelete)\n\t\t\t? static::$removeFavoritesOnDelete\n\t\t\t: true;\n\t}", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }", "function cinerama_edge_user_del_image() {\n\t\tif ( ! isset( $_GET['user_id'] ) ) {\n\t\t\tesc_html_e( 'Not Set or Empty', 'cinerama' );\n\t\t\texit;\n\t\t}\n\n\t\t$field_name = $_GET['field_name'];\n\t\t$user_id = $_GET['user_id'];\n\t\t$imageID = get_user_meta( $user_id, $field_name, true );; // Get our attachment ID\n\n\t\tif ( is_numeric( $imageID ) ) { // Verify that the attachment ID is indeed a number\n\t\t\tdelete_user_meta( $user_id, $field_name );// Delete our image meta\n\t\t\texit;\n\t\t}\n\n\t\tesc_html_e( 'Contact Administrator', 'cinerama' ); // If we've reached this point, something went wrong - enable debugging\n\t\texit;\n\t}", "public function destroy($username)\n {\n Auth::logout();\n $user = User::where('username',$username)->firstOrFail();\n if ($user->avatar && file_exists(storage_path('app/public/'.$user->avatar))) {\n Storage::delete('public/'.$user->avatar);\n }\n $user->delete();\n return redirect()->route('home');\n }", "public function destroy($id)\n {\n\n $user = User::find($id);\n // dd($user);\n File::delete($user->avatar);\n $user->delete();\n\n return Redirect::back();\n }", "public function destroy($id)\n {\n\n $getdata=user::where('id', $id)->FirstorFail();\n user::destroy($id);\n\n // profile Photo\n if($getdata->img){\n if (file_exists(public_path().'/contents/uploads/customer/'.$getdata->img)) {\n unlink(public_path().'/contents/uploads/customer/'.$getdata->img);\n }\n }\n\n // NID\n if($getdata->nid){\n if (file_exists(public_path().'/contents/uploads/customer/'.$getdata->nid)) {\n unlink(public_path().'/contents/uploads/customer/'.$getdata->nid);\n }\n }\n\n\n\n if($getdata->singature){\n if (file_exists(public_path().'/contents/uploads/customer/'.$getdata->singature)) {\n unlink(public_path().'/contents/uploads/customer/'.$getdata->singature);\n }\n }\n\n\n\n\n }", "public function clearForumFavorites()\n {\n $this->favoriteForums->clear();\n }", "public function destroy($id)\n\t{\n\t\t//\n\n\t\t$user = User::find($id);\n\n\n\n\n\t\t\t\tif($user->photourl!=\"\"){\n\t\t\t\t\tif (file_exists(public_path() .$user->photourl)) {\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tunlink(public_path() . $user->photourl);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tUser::destroy($id);\n\n\n\t\t\t\treturn redirect()->route(\"userspannel.index\");\n\t\t\t\t\n\n\t}", "protected function _hapusPrevFoto()\r\n {\r\n $this->db->prepare('SELECT avatar_user FROM akun_siswa WHERE nis = :nis');\r\n $this->db->bind('nis',$_SESSION['login']);\r\n $foto = $this->db->queryOne();\r\n if (file_exists('user/profile/img/'.$foto['avatar_user'] || $foto['avatar_user'] !== 'user-def.svg')) {\r\n unlink('user/profile/img/'.$foto['avatar_user']);\r\n return true;\r\n }else{\r\n return true;\r\n }\r\n }", "public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }" ]
[ "0.6962366", "0.6777098", "0.66394377", "0.66252553", "0.6521929", "0.6515568", "0.65061086", "0.64308417", "0.64284986", "0.64239705", "0.64213306", "0.6409266", "0.6301437", "0.62294173", "0.62175995", "0.6208038", "0.61591506", "0.6157689", "0.6106015", "0.6069731", "0.6045002", "0.60203916", "0.5964848", "0.5943878", "0.5931961", "0.5924608", "0.59121346", "0.5891361", "0.5860025", "0.5852867", "0.5842429", "0.5822046", "0.57757145", "0.5772868", "0.5760197", "0.57405096", "0.57365525", "0.5735074", "0.57261676", "0.57137376", "0.57108694", "0.56757534", "0.56750447", "0.5653242", "0.5626828", "0.5599927", "0.55897075", "0.5564259", "0.55568296", "0.55558634", "0.55517966", "0.55502063", "0.5546674", "0.5539682", "0.5523571", "0.55231386", "0.5516522", "0.55140084", "0.5512698", "0.55062497", "0.5486482", "0.5485016", "0.5472485", "0.5469998", "0.54694587", "0.54654795", "0.5464632", "0.5458332", "0.5454818", "0.5442423", "0.5439093", "0.54300606", "0.5407605", "0.5406681", "0.54015964", "0.539972", "0.5394827", "0.5392481", "0.53576523", "0.5354825", "0.5345128", "0.5329966", "0.53287166", "0.5319112", "0.5317755", "0.5315875", "0.53158087", "0.5311177", "0.53076434", "0.5306821", "0.5305469", "0.53022146", "0.52984", "0.5293035", "0.52921313", "0.52889246", "0.52881664", "0.52864873", "0.5284363", "0.527404" ]
0.71413577
0
/ People methods Return a user's NSID, given their email address
function people_findByEmail($find_email) { $response = $this->execute(array('method' => 'flickr.people.findByEmail', 'find_email' => $find_email)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['user']['nsid']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_user_id_from_string($email_or_login)\n {\n }", "public function getIdentifier()\n {\n return $this->user->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->getEmail();\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->email;\n }", "function fetch_user_Idn($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email\t=\tsanitize($email);\n\n\t\t$query = \"SELECT `student_Idn` FROM `student` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\t\t$rows = mysqli_fetch_assoc($run_query);\n\t\t$student_Idn = $rows['student_Idn'];\n\t\treturn $student_Idn;\n\n\t}", "function get_user_id($db, $email)\n{\n\t$sql = \"SELECT id FROM users where email = :email\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn $us[0]['id'];\n\n}", "protected function userIDEmail ($email)\n {\n \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('email'=>$email),\n )\n ));\n if(!empty($user))\n {\n $id=0;\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n }\n return $id; \n } \n }", "function getEmailId($eid)\n{\n\t$password=\"k4heNatH\";\n\t$ds=ldap_connect(\"ldap://prodldap.honeywell.com\");\n\tif ($ds) {\n\t\t$dn=\"cn=atlassian-prod,ou=ApplicationUsers,o=honeywell\";\n\t\t$r=ldap_bind($ds,$dn,$password);\n\t\t$sr=ldap_search($ds, \"o=honeywell\",\"uid=E$eid\");\n\t\t$info = ldap_get_entries($ds, $sr);\n\t\tfor ($i=0; $i<$info[\"count\"]; $i++) {\n\t\t\t$dn=$info[$i][\"dn\"];\n\t\t\t$name=$info[$i][\"cn\"][0] ;\n\t\t\t$email= $info[$i][\"mail\"][0];\n\t\t}\n\t\tldap_close($ds);\n\t}\n\telse {\n\t\techo \"<h4>Unable to connect to LDAP server</h4>\";\n\t}\n\treturn $email;\n}", "public function getUidFromEmail($email);", "public function get_user_by_email_address($email_address, $organization_id);", "function getIdFromEmailUser($db, $user_email) {\n\n $SELECT_ID_USER = \"SELECT user_id FROM user WHERE user_email = ?\";\n\n $resultats = $db->prepare($SELECT_ID_USER);\n $resultats->execute(array($user_email));\n $row = $resultats->fetch(PDO::FETCH_OBJ);\n $user_id = $row->user_id;\n $resultats->closeCursor();\n\n return $user_id;\n}", "public function get_user_id();", "function get_user_by_email($email)\n {\n }", "function get_user_id_from_email($email)\n\t{\n\t\t//$this->firephp->log(\"email=\".$email);\n\t\t\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'email'),$email);\t\n\t\t$qres=$this->db->get('user_accounts');\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_id'].\"for email=\".$email);\n\t\t\treturn $row['uacc_id'];\n\t\t} else {\n\t\t\t$this->firephp->log(\"Could not determine user id from user email\");\n\t\t\treturn NULL;\n\t\t}\n\t}", "function admin_fetch_user_Idn($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email\t=\tsanitize($email);\n\n\t\t$query = \"SELECT `admin_Idn` FROM `administrator` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\t\t$rows = mysqli_fetch_assoc($run_query);\n\t\t$admin_Idn = $rows['admin_Idn'];\n\t\treturn $admin_Idn;\n\n\t}", "public function getUserId() {\n $response = $this->execute(array('method' => 'flickr.auth.checkToken'), 60);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['auth']['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n }", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "static function email2id($email) {\n // converts a user email to the id of the user\n // both id and email are indivitual to every user\n \n global $con;\n\n $sql = \"SELECT `id` FROM `user` WHERE `email` LIKE '\".$email.\"';\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n return intval($row['id']);\n }\n return NULL;\n }", "function salesperson_select_id($email)\n{\n $conn = db_connect();\n\n // Prepared statement for selecting a salesperson's information from the database\n $salesperson_select_id_stmt = pg_prepare($conn, \"salesperson_select_id_stmt\", \"SELECT * FROM salespeople WHERE email_address = $1\");\n $id = pg_fetch_result(pg_execute($conn, \"salesperson_select_id_stmt\", array($email)), 0, \"id\");\n\n return $id;\n}", "protected function _getNSID($name) {\r\n return $this->_createRequest([\r\n 'method' => 'flickr.urls.lookupUser',\r\n 'url' => 'https://www.flickr.com/photos/'.$name\r\n ])->then(function($data) {\r\n return $data['user']['id'];\r\n });\r\n }", "public function GetUserID($emailId) \n\t{\n $sql = \"SELECT userid\"\n . \" FROM user \"\n . \" WHERE email = '\" . $emailId . \"' \"\n . \" LIMIT 1\";\n \n\t\t $result=parent::query($sql);\n\t\t\t\n\t\t//print_r($result);\n\t\tif (empty($result))\n\t\t{return '0';}\n\t\telse\n\t\t{return $result[0]['userid'];}\n }", "public function get_user_id($em){\r\n $this->db->select('id');\r\n $this->db->where('email', $em);\r\n $query = $this->db->get('users');\r\n foreach ($query->result() as $row)\r\n {\r\n return $row->id;\r\n }\r\n }", "public function getUserId()\n {\n $conn = Db::getConnection();\n $statement = $conn->prepare('select userID from user where email = :email');\n $email = $this->getEmail();\n $statement->bindParam(':email', $email);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n\n return $result;\n }", "function getUserIdByEmail($email) {\n\t$email = escape($email);\n\t$result = mysql_query(\"SELECT id FROM users WHERE email = '$email'\");\n\t\n\tif($row = mysql_fetch_array($result)) {\n\t\treturn $row[0];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getUserId() {\n\t\treturn (string) $this->photo->owner['nsid'];\n\t}", "Public Function getIdUsingEmail($Email)\n\t{\n\t\t$Result = $this->_db->fetchRow('SELECT * FROM bevomedia_user WHERE email = ?', $Email);\n\t\tif(!$Result || !sizeOf($Result))\n\t\t\treturn false;\n\t\treturn $Result->id;\n\t}", "public function getUser($email);", "function get_profile_email($email){\r\n\t\r\n}", "public function getPersonGuid();", "public function getUserAccountPublicId();", "public function getAuthIdentifierName()\n\t{\n\t return $this->email;\n\t}", "public function getPersonID() {\n\t\t$session_id = $this->getCurrentID();\n\t\t$this->load($session_id);\n\t\treturn $this->contactid;\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function id()\n {\n return $this->user()->getEmail();\n }", "function get_id() : string {\n\t$current_user = wp_get_current_user();\n\treturn sha1( $current_user->user_email );\n}", "private function _getUserID($pbe)\n\t{\n\t\treturn (!empty($pbe['user_info']['id']) && !empty($this->_modSettings['maillist_enabled']))\n\t\t\t? (int) $pbe['user_info']['id'] : User::$info->id;\n\t}", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "function getUserID($user) {\r\n $sql = $this->db->prepare(\"SELECT UserID FROM USER WHERE email='$user'\");\r\n if ($sql->execute()) {\r\n $result = $sql->fetch(PDO::FETCH_ASSOC);\r\n return $result['UserID'];\r\n }\r\n return false;\r\n }", "private function convertIdn($email)\n {\n list($local, $domain) = explode('@', $email);\n $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);\n\n return sprintf('%s@%s', $local, $domain);\n }", "public function getIdentity(): string\n {\n return $this->email;\n }", "public function getUserId($email)\n\t{\n\t\t$email= $this->_db -> quote($email);\n\t\t$queryStr = \"select id from users where email= $email;\";\n try\n \t{\n\t $result = $this->_db -> query($queryStr);\n\t \n\t // test for error conditions\n $err = $this->_db->error();\n\t if (!empty($err)) \n\t \tthrow new Exception(\"select failed: \".$err);\n\t \n\t \n\t //pull from result\n\t $userId = false;\n\t foreach($result as $arr){\n $userId = isset($arr[\"id\"])?$arr[\"id\"]:false ;\n } \n\t return $userId;\t\n }\n catch (Exception $e) \n\t\t{\n \terror_log( 'UserManager.getUserId: '. $e->getMessage() . \". Query: \".$queryStr );\n\t\t} \n\t\t\n\t\treturn false; \n\t\t\n\t}", "public function findPerson($email) {\n return $this->findRecordId('person', array(\n 'contactInfo.email' => $email\n ));\n }", "public function getUserByEmail($email);", "function get_user_email_from_id($uid)\n\t{\n\t\t//$this->firephp->log(\"In get_user_email_from_id\");\n\t\t//$this->firephp->log(\"uid=\".$uid);\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'email'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'id'),$uid);\t\n\t\t$qres=$this->db->get('user_accounts');\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_email'].\"for uid= \".$uid);\n\t\t\treturn $row['uacc_email'];\n\t\t} else {\n\t\t\t$this->firephp->log(\"Could not determine user email from user id\");\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getUserID($email){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$stmt = $conn->prepare(\"select id from login where Email=?\");\n\t\t$stmt->bind_param(\"s\", $email);\t\t\t\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($v_id);\n\t\t\n\t\tif($stmt->execute()){\n\t\t\twhile($stmt->fetch()){\n\t\t\t\t$id=$v_id;\n\t\t\t}\n\t\t}\n\n\t\t$stmt->free_result();\n\t\t$stmt->close();\n\t\t\n\t\treturn $id;\n\t\n\t}", "public function getAuthyUserId( $email, $phone_number, $country_code ) {\n\n //sanity checks\n if( empty( $email ) ) {\n throw new Exception( t('Invalid email address') );\n }\n\n if( empty( $phone_number ) ) {\n throw new Exception( t('Invalid phone number') );\n }\n\n if( empty( $country_code ) ) {\n throw new Exception( t('Invalid country code') );\n }\n\n //build the payload\n $payload = http_build_query( array(\n 'user[email]' => $email,\n 'user[cellphone]' => $phone_number,\n 'user[country_code]' => $country_code\n ));\n\n //and ask authy\n $got = $this->req( '/users/new', $payload , true );\n\n //are we ok?\n if( $got->success == false ) {\n throw new Exception( t('Authy error when creating/updating a user: ') . $got->message );\n }\n\n //if ok, safe navigate to user id\n if( $got->success == true ) {\n if( is_object( $got->user ) ) {\n return $got->user->id;\n }\n }\n\n //one should not find itself here\n throw new Exception( t('Unexpected Authy reponse') );\n }", "public function getCustomUserId();", "public function getUniqueUsernameFromEmail($email);", "public function getUserIdentifier(): string\n {\n return (string) $this->login;\n }", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "public function getUserIdentifier(): string\n\t{\n\t\treturn (string)$this->siret;\n\t}", "public function search_id_user($email)\n {\n \treturn $this->db->select('id_client, name, last_name, email, country')->where('email', $email)->get('ec_client')->result_array();\n }", "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "function getId($email) {\n\t\t$selectPrepa = self::$bdd -> prepare(\"SELECT id FROM utilisateur WHERE email = '$email'\");\n\t\t$selectPrepa -> execute();\n\t\t$result = $selectPrepa -> fetch();\n\t\treturn $result[0];\n\t}", "function rlip_get_email_recipient($email) {\n global $DB;\n\n if ($result = $DB->get_record('user', array('email' => $email))) {\n //user exists, so use their user record\n return $result;\n }\n\n //fake user record for non-moodle recipient\n $result = new stdClass;\n $result->email = $email;\n\n return $result;\n}", "function GetAffId($db, $email) {\n\t$query = \"SELECT m.member_link_id\n\t\t\t\tFROM members m\n\t\t\t\tWHERE m.email_username='$email'\"; \n\t$result = mysqli_query($db, $query) or die(mysqli_error($db));\n\t$table_rows = false;\n\tif($row = mysqli_fetch_assoc($result)) {\n\t\t$res = $row['member_link_id'];\n\t} else {\n\t\t$res = \"INVALID_AFF_ID\";\n\t}\n\t\n\treturn $res;\n}", "public static function idByEmail($email=NULL)\n {\n if($email!=NULL)\n {\n try \n {\n $count = User::where('email', $email)->count();\n if($count > 0)\n {\n $user = User::where('email', $email)->orderBy('name', 'asc')->first();\n return $user->id;\n }\n else\n {\n return null;\n }\n } \n catch (ModelNotFoundException $e) \n {\n Log::error(\"The user with email ` $email ` does not exist: \". $e->getMessage());\n //TODO: send email?\n return null;\n }\n }\n else\n {\n return null;\n }\n }", "public function getIdEmailByEmail($email){\n $row = $this->db->run(\"SELECT id, username, email FROM users WHERE email=? LIMIT 1\", [$email])->fetch();\n return $row;\n }", "function ibm_uid ( $dn ) { return dn2uid($dn); }", "public function getUserIdFromEmail($useremail)\n { \n try\n {\n $db_request = DB::table('user')\n ->select('id')\n ->where('Email', $useremail)\n ->first(); \n\n $id = $db_request->id;\n if($id!=NULL){\n return $id;\n }\n }\n catch(\\Exception $Exception)\n {\n return -1; \n }\n \n }", "private function getUserId()\n {\n $company = $this->getCompany();\n\n if (!isset($company['user']['id'])) {\n throw new BiglionException('User \"id\" not defined', 1);\n }\n\n return $company['user']['id'];\n }", "function userIdGet(PDO $db,$email)\n{\n $sql = \"SELECT id FROM users WHERE email = :email\";\n\n $stmt = $db->prepare($sql); \n $stmt->bindParam(':email', $email, PDO::PARAM_STR); \n $stmt->execute();\n $id=$stmt->fetch(PDO::FETCH_NUM);\n\n return $id;\n}", "public function getUserIdentifier(): string\n {\n return (string) $this->username;\n }", "function getuid_nick($nick)\n{\n $uid = mysql_fetch_array(mysql_query(\"SELECT id FROM ibwf_users WHERE name='\".$nick.\"'\"));\n return $uid[0];\n}", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId($email) {\n $this->db->select('userid');\n $this->db->from($this->userTable);\n $this->db->where('email', $email);\n $query = $this->db->get();\n $user_id = $query->result_array();\n return !empty($user_id)?$user_id:false;\n }", "public function getUserIdByEmail($email){\n try{\n $result = User::model()->checkIfUserExist($email,'Email');\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getUserIdByEmail::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n return $result;\n }", "public function getUser_ident()\n {\n return $this->user_ident;\n }", "public static function getIdByEmail($email)\n\t{\n\t\treturn (int) FrontendModel::getDB()->getVar('SELECT p.id FROM profiles AS p WHERE p.email = ?', (string) $email);\n\t}", "abstract protected function getUserId() ;", "public static function GetUserID()\n\t{\n\t\treturn self::GetFB()->getUser();\n\t}", "function resolveEmail($email) {\n\t\tif (null != $email) {\n\t\t\tforeach ($this->_config['user_class_ids'] as $clsid) {\n\t\t\t\tif (null != ($user = call_user_func(array(SyndNodeLib::loadClass($clsid), 'resolveEmail'), $email)))\n\t\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "function getUserId($act_code){\n\t\n\t$us = mysql_fetch_object(listAll(\"user\", \"WHERE act_code = '$act_code'\"));\n\t\n\treturn $us->id;\n\t\n}", "public function getUserByEmail($email) {\n //create user query by email\n $user_query_by_email = Doctrine_Query::create()\n ->select('sgu.id')\n ->from('sfGuardUser sgu')\n ->where('sgu.email_address =?', $email);\n return $user_query_by_email->fetchOne();\n }", "public static function findUserForIdentity($identity) {\n\t\t$query=OCP\\DB::prepare('SELECT `userid` FROM `*PREFIX*preferences` WHERE `appid`=? AND `configkey`=? AND `configvalue`=?');\n\t\t$result=$query->execute(array('user_openid','identity',$identity))->fetchAll();\n\t\tif(count($result)>0) {\n\t\t\treturn $result[0]['userid'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function get_user_id($username)\n{\n\t$query = \"SELECT user_id FROM user WHERE email=?\";\n\treturn get_prepared_single_value($query,array($username),'s'); \n}", "function wpcom_vip_get_user_profile( $email_or_id ) {\n\n\tif ( is_numeric( $email_or_id ) ) {\n\t\t$user = get_user_by( 'id', $email_or_id );\n\t\tif ( ! $user )\n\t\t\treturn false;\n\n\t\t$email = $user->user_email;\n\t} elseif ( is_email( $email_or_id ) ) {\n\t\t$email = $email_or_id;\n\t} else {\n\t\t$user_login = sanitize_user( $email_or_id, true );\n\t\t$user = get_user_by( 'login', $user_login );\n\t\tif ( ! $user )\n\t\t\treturn;\n\n\t\t$email = $user->user_email;\n\t}\n\n\t$hashed_email = md5( strtolower( trim( $email ) ) );\n\t$profile_url = esc_url_raw( sprintf( '%s.gravatar.com/%s.php', ( is_ssl() ? 'https://secure' : 'http://www' ), $hashed_email ), array( 'http', 'https' ) );\n\n\t$profile = wpcom_vip_file_get_contents( $profile_url, 1, 900 );\n\tif ( $profile ) {\n\t\t$profile = unserialize( $profile );\n\n\t\tif ( is_array( $profile ) && ! empty( $profile['entry'] ) && is_array( $profile['entry'] ) ) {\n\t\t\t$profile = $profile['entry'][0];\n\t\t} else {\n\t\t\t$profile = false;\n\t\t}\n\t}\n\treturn $profile;\n}", "public function get_id()\n {\n\n $user_type = $this->isStaff ? \"staff\" : \"user\";\n\n return $this->database->get($user_type,'id',['user_url' => $this->username]);\n\n }", "function ldap_get_user($username_or_email, $db) {\n if( is_mail($username_or_email) && $db->mailExists($username_or_email) ) {\n return $db->getUserWithMail($username_or_email);\n }\n if($db->userExists($username_or_email)) {\n return $db->getUser($username_or_email);\n }\n return false;\n}" ]
[ "0.7204528", "0.7062429", "0.69925815", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6983918", "0.6721962", "0.660183", "0.6551202", "0.654427", "0.6544029", "0.64955866", "0.649543", "0.6440766", "0.6430117", "0.64235926", "0.6420687", "0.6400215", "0.63867235", "0.6386022", "0.6383245", "0.6354878", "0.63498914", "0.6344", "0.6327091", "0.6314764", "0.6309326", "0.62716967", "0.62524927", "0.62450504", "0.61896884", "0.6186397", "0.61634225", "0.6163191", "0.61606383", "0.61606383", "0.61606383", "0.61263573", "0.6114645", "0.60981536", "0.6097613", "0.6096542", "0.6095523", "0.6093744", "0.6090084", "0.6066805", "0.60612345", "0.60232764", "0.6021179", "0.60164416", "0.60088664", "0.60050404", "0.59987515", "0.59913814", "0.5981059", "0.5976374", "0.59712857", "0.59609884", "0.59444433", "0.59243774", "0.5910844", "0.590967", "0.59023637", "0.5901748", "0.5894635", "0.58791775", "0.58784455", "0.5867848", "0.58610535", "0.58610535", "0.58610535", "0.58610535", "0.58610535", "0.58610535", "0.58610535", "0.58610535", "0.58610535", "0.5857424", "0.58555174", "0.5848221", "0.5839512", "0.5838325", "0.58373135", "0.5833206", "0.5827675", "0.58192354", "0.5811012", "0.58099645", "0.5807948", "0.5806389", "0.58044183" ]
0.7120048
1
Return a user's NSID, given their username.
function people_findByUsername ($username) { $response = $this->execute(array('method' => 'flickr.people.findByUsername', 'username' => $username)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['user']['nsid']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetUserID($username) {\r\n $user_ids = array();\r\n $usernames = array($username);\r\n user_get_id_name($user_ids, $usernames);\r\n return $user_ids[0];\r\n }", "public function getID($username) \n {\n return $this->idGet($username);\n }", "function getIdUser($username)\r\n {\r\n $results = $this->querySimpleExecute(\"select * from t_user where useUsername='\". $username . \"'\");\r\n return $results = $this->formatData($results)[0]['idUser'];\r\n }", "function getUserID($username)\n {\n $users = $this->data->getUserByName($username);\n while ($user = $users->fetch_assoc())\n {\n $id = $user['UserID'];\n }\n return $id;\n }", "protected function get_dbmail_user_idnr($username = '') {\n\n $sql = \"SELECT user_idnr \"\n . \"FROM dbmail_users \"\n . \"WHERE userid = '{$this->dbmail->escape($username)}' \";\n\n $result = $this->dbmail->query($sql);\n\n if ($this->dbmail->num_rows($result) != 1) {\n // not found\n return FALSE;\n }\n\n $user = $this->dbmail->fetch_assoc($result);\n\n return $user['user_idnr'];\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->username;\n }", "public function getUserID($username)\r\n\t{\r\n\t\t$select=$this->select();\r\n\t\t\t$select->from($this,'user_id')\r\n\t\t\t->where('username=?',$username);\r\n\t\t$row=$this->fetchRow($select);\r\n\t\tif(!$row) return NULL;\r\n\t\treturn $row['user_id'];\r\n\t}", "function getUserid($username) {\n\t$username = dbEscape($username);\n\treturn(dbFirstResult(\"SELECT id FROM users WHERE username='$username'\"));\n}", "function user_getid($username = null)\n\t{\n\t\t$user = ($username == null) ? session_get('username') : $username;\n\t\t$get = $this->DB->database_select('users', 'uid', array('username' => $user), 1);\n\t\treturn ($get === false) ? false : $get['uid'];\n\t}", "function getUserID($sUsername) {\n global $default;\n\n $id = lookupID($default->users_table, \"username\", $sUsername);\n\n $this->iId = $id;\n }", "public function getUserID($username) {\n $stmt = $this->connection->prepare(\"SELECT \".COL_USER_ID.\" FROM \".DB_USER_TABLE.\" WHERE \".COL_USER_USERNAME.\" = ?\");\n $stmt->bind_param(\"s\", $username);\n $stmt->execute();\n return $stmt->get_result()->fetch_array(MYSQLI_NUM)[0];\n }", "function get_user_id_by_username($username = '') {\r\n\r\n\t\t$field = 'id';\r\n\r\n\t\t$users = $this->users_model->get_users_by_username($username, $field);\r\n\r\n\t\t$result = $users['id'];\r\n\r\n\t\treturn $result;\r\n\r\n\t}", "function user_id_from_username($username) {\n $username = sanitize($username);\n $query = mysql_query(\"SELECT `user_id` FROM `users` WHERE `username` = '$username'\");\n return mysql_result($query, 0, 'user_id');\n}", "public function id($username)\n {\n $id = $this->_client->processChannelId($username);\n\n if ($id) {\n $this->info(__('ID: {0}', $id));\n } else {\n $this->info(__('The ID or Username is not correct.'));\n }\n\n return $id;\n }", "public static function getUserID($username)\n {\n \t\n // Check if username has data\n if ($username !== NULL && !empty($username))\n {\n\t\t\t$post = Model_User::find('first', [\n \t\t'where' => [\n 'username' => $username,\n \t\t]\n \t]);\n \t$userid = $post->id;\n\t\t\treturn $userid;\n }\n else\n {\n //no user id found\n return NULL;\n }\n }", "function GetSMFUserIDFromUsername($username)\n{\n\tglobal $smcFunc; //, $db_show_debug, $db_cache;\n\n\t//$db_show_debug = true;\n\n\t$request = $smcFunc['db_query']('', '\n\t\tSELECT id_member\n\t\tFROM {db_prefix}members\n\t\tWHERE member_name = {string:username}',\n\t\tarray(\n\t\t\t'username' => $username,\n\t\t)\n\t);\n\n\t//print_r($db_cache);\n\n\t$row = $smcFunc['db_fetch_assoc']($request);\n\t$smcFunc['db_free_result']($request);\n\n\treturn $row['id_member'];\n}", "static function getIdByUsername(string $username) {\n $db = new Database();\n return $db->getColumnValueWhere('users', 'id', 'username', '\"' . $username . '\"');\n }", "public function getUserId($username) {\r\n\t\treturn ($this->appUserDao->getUserId ( mysql_escape_string($username) ));\r\n\t}", "function getUserID($conn, $username) {\n $query = \"SELECT user_id FROM user WHERE user_username = '${username}'\";\n $result = mysqli_query($conn, $query);\n if ($result) {\n $row = mysqli_fetch_assoc($result);\n return $row['user_id'];\n } else {\n return 0;\n }\n }", "public function get_id_session($username){\r\n\r\n $info = $this->db->get_where('user', array('khojeko_username' => $username));\r\n $row = $info->row();\r\n $id = 'user_id';\r\n $id = $row->$id;\r\n return $id;\r\n }", "public static function getUserIDbyName($username) {\n\t\t$conn = new mysqli ( $GLOBALS ['dbservername'], $GLOBALS ['dbusername'], $GLOBALS ['dbpassword'], $GLOBALS ['dbname'] );\n\t\t$sql = \"SELECT id FROM user WHERE username='$username'\";\n\t\t$result = $conn->query ( $sql );\n\t\tif (mysqli_num_rows ( $result ) > 0) {\n\t\t\twhile ( $row = mysqli_fetch_assoc ( $result ) ) {\n\t\t\t\treturn $row ['id'];\n\t\t\t}\n\t\t} else\n\t\t\techo \"No such user exist \";\n\t}", "function get_user_id($username)\n{\n\t$query = \"SELECT user_id FROM user WHERE email=?\";\n\treturn get_prepared_single_value($query,array($username),'s'); \n}", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "protected function _getNSID($name) {\r\n return $this->_createRequest([\r\n 'method' => 'flickr.urls.lookupUser',\r\n 'url' => 'https://www.flickr.com/photos/'.$name\r\n ])->then(function($data) {\r\n return $data['user']['id'];\r\n });\r\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->login;\n }", "public function getUserId() {\n $response = $this->execute(array('method' => 'flickr.auth.checkToken'), 60);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['auth']['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n }", "public function get_userID($username)\n {\n $this->db->select('userID');\n $this->db->from('user');\n $this->db->where('adminNumber', $username);\n $query = $this->db->get(); \n $row = $query->row();\n return $row->userID;\n }", "public function getIdByUsername(string $username) : int\n\t{\n\t\t$user = new User;\n\t\t$user->loadByUsername($username);\n\n\t\treturn $user->id;\n\t}", "static public function GetUserIDFromUsername ($username){\n try {\n $resGetUserIDFromUsername = DB::table('users')\n ->select('id_user')\n ->where('username','=',$username)\n ->get();\n return $resGetUserIDFromUsername[0]->id_user;\n } catch (\\Exception $e) {\n return 'error';\n }\n }", "function User_ID($Username)\n\t{\n\t\t$R=j::SQL(\"SELECT XU.ID FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE Username=?\",$Username);\n\t\tif ($R) return $R[0]['ID'];\n\t\telse return null;\n\t\t\n\t}", "function GetUserIdByName ($username) {\n $username = filter_var($username, FILTER_SANITIZE_STRING);\n \n $path = REST_PATH . 'users/' . $username . '.xml';\n\n // Call Rest API\n $result = CallRestApi($path);\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n return $xml->User->Id;\n}", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "function mysql_auth_user_id($username)\n{\n return dbFetchCell(\"SELECT `user_id` FROM `users` WHERE `username` = ?\", array($username));\n}", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "function get_userID($username)\n {\n return $this->db->get_where('users', array('username'=>$username))->row_array();\n }", "public function getId($username) {\n\t\t// At least I hope so.\n\t\tif (!array_key_exists($username, $this->idCache)) {\n\t\t\t$this->idCache[$username] = \\JUserHelper::getUserId($username);\n\t\t}\n\t\treturn $this->idCache[$username];\n\t}", "private function GetUserID($UserIDorUsername)\n\t{\n\t\tif (!is_numeric($UserIDorUsername))\n\t\t\t$UserID=$this->User_ID($UserIDorUsername);\n\t\telse \n\t\t\t$UserID=$UserIDorUsername;\n\t\treturn $UserID;\n\t}", "public function get_user_id($username){\n $this->db->select('userID')->from('users')->where('username', $username);\n $query = $this->db->get();\n \n if($query->num_rows() > 0)\n {\n $row = $query->row(0);\n return $row->userID;\n }\n }", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function get_user_id();", "public function username_id ($username) {\n\n # The query will get the id from the username address\n $this->db->select ('idUser')\n ->where ('username', $username);\n\n # Put the results in a variable\n $result = $this->db->get ('tblUsers');\n\n # If there is not just ONE row, the login can't happen\n if ($result->num_rows () != 1)\n return FALSE;\n\n # Get the record as an array, and return the user id\n return $result->row_array ()['idUser'];\n\n }", "function retrieveUserId($username, $connection)\n {\n $userQuery = \"SELECT id from user where user.username = '$username'\";\n $userResult = mysqli_query($connection, $userQuery);\n $userId = -1;\n while($row = mysqli_fetch_row($userResult)) {\n $userId = $row[0];\n break;\n }\n\n return $userId;\n }", "public function getUserIdentifier(): string\n\t{\n\t\treturn (string)$this->siret;\n\t}", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function getUserId() {\n\t\treturn (string) $this->photo->owner['nsid'];\n\t}", "public static function idByUsername($username=NULL)\n {\n if($username!=NULL)\n {\n try \n {\n $count = User::where('username', $username)->count();\n if($count > 0)\n {\n $user = User::where('username', $username)->orderBy('name', 'asc')->first();\n return $user->id;\n }\n else\n {\n return null;\n }\n } \n catch (ModelNotFoundException $e) \n {\n Log::error(\"The user with username ` $username ` does not exist: \". $e->getMessage());\n //TODO: send username?\n return null;\n }\n }\n else\n {\n return null;\n }\n }", "public function get_user_id_by_username($username)\n {\n $query = $this->db\n ->where('username', $username)\n ->get('users');\n $result = $query->row_array();\n return intval($result['user_id']);\n }", "public function getUserNameIdentifier()\n {\n return $this->user_name;\n }", "public static function get_id ($user_name) {\n\t\t$db = db::get_instance();\n\t\t\n\t\t$query = sprintf(\"SELECT * \n\t\t FROM users\n\t\t WHERE `user_name` = '%s'\",\n\t\t $db->db_escape($user_name));\n\n\t\t$result = $db->db_fetch($query);\n\t\t\n\t\treturn $result ? $result['user_id'] : null;\n\t}", "private function getUserIdByUsername($username) {\n $username=trim($username);\n // Query the database for the user ID\n $stmt = $this->_pdo->prepare(\"SELECT * FROM \".$this->_dbTable.\" WHERE \".$this->_dbFields[\"username\"].\" = :username\");\n $stmt->execute([\":username\" => $username]);\n $user = $stmt->fetch(\\PDO::FETCH_ASSOC);\n // If the user was found, return the user ID\n if ($user) {\n return $user[$this->_dbFields[\"id\"]];\n }\n // If the user was not found, return null\n return null;\n }", "public function getUserIdWithUsername($id);", "function pico_main_get_uid($text)\n{\n\t$user_handler = xoops_gethandler('user');\n\n\t$text = trim($text);\n\tif (is_numeric($text)) {\n\t\t$uid = (int)$text;\n\t\t$user = &$user_handler->get($uid);\n\t\tif (is_object($user)) return $uid;\n\t\telse return 0;\n\t} else {\n\t\t$users = &$user_handler->getObjects(new Criteria('uname', addslashes($text))); // ???\n\t\tif (is_object(@$users[0])) return $users[0]->getVar('uid');\n\t\telse return 0;\n\t}\n}", "public function getUsername()\n {\n return $this->getUserIdentifier();\n }", "private function idGet($username) \n {\n $this->db->select('GUID');\n //where $username = username \n $this->db->where('username', $username);\n //from the users table\n $query = $this->db->get('users');\n\n foreach ($query->result() as $row) \n {\n $id = $row->GUID;\n }\n return $id;\n }", "public function getId() {\n\t\treturn SYS_USERNAME;\n\t}", "public function getUserId ($sid = null) {\n $u = $this->userSession($sid);\n return $u->userid;\n }", "function user_id($username) {\n require(ROOT_PATH . 'inc/database.php');\n \n try {\n $ids = $db->prepare('SELECT id FROM user_pass WHERE username = ?');\n $ids->bindValue(1,$username);\n $ids->execute();\n foreach ($ids as $id) {\n $user_id = $id['id'];\n return $user_id;\n }\n } catch (Exception $e) {\n echo \"Data was not retrieved from the database successfully.\";\n exit;\n }\n }", "public function getUserId($username) {\n $sql = \"SELECT * FROM usertable WHERE username = '$username'\";\n $data;\n foreach (parent::$this->db_connect->query($sql) as $row) {\n $data = $row;\n }\n return $data[\"userid\"];\n }", "function user_find_id($username) {\n $db = connectDB();\n \n // Look up user\n $stmt = $db->prepare('\n SELECT\n user_id\n FROM\n users\n WHERE\n username = :username\n LIMIT\n 1\n ;\n ');\n $stmt->execute([':username' => $username]);\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n if (empty($rows)) {\n return NULL;\n } else {\n return $rows[0]['user_id'];\n }\n}", "public static function getUsernameFromId($idUser)\n {\n $connection = Yii::app()->db; \n $command = $connection->createCommand(\"SELECT username FROM user WHERE idUser = $idUser\");\n return $command->queryScalar();\n }", "function user_id_si($username_SI) {\n\t require(ROOT_PATH . 'inc/database.php');\n\t \n\t try {\n\t $ids = $db->prepare('SELECT id FROM user_pass WHERE username = ?');\n\t $ids->bindValue(1,$username_SI);\n\t $ids->execute();\n\t foreach ($ids as $id) {\n\t $userID = $id['id'];\n\t return $userID;\n\t }\n\t } catch (Exception $e) {\n\t echo \"Data was not retrieved from the database successfully.\";\n\t exit;\n\t }\n\t }", "protected static function getUserID()\r\n {\r\n $userID = \\CAT\\Helper\\Validate::sanitizePost('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = \\CAT\\Helper\\Validate::sanitizeGet('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = self::router()->getParam(-1);\r\n\r\n if(!$userID || !is_numeric($userID) || !\\CAT\\Helper\\Users::exists($userID))\r\n Base::printFatalError('Invalid data')\r\n . (self::$debug ? '(\\CAT\\Backend\\Users::getUserID())' : '');;\r\n\r\n return $userID;\r\n }", "public function getUserId($userName)\n {\n $sql = \"SELECT id FROM fos_user WHERE username = :username\";\n $stmt = $this->connection->prepare($sql);\n $stmt->bindValue(\"username\", $userName);\n $stmt->execute();\n $res = $stmt->fetch();\n return intval($res['id']);\n }", "function getuid_nick($nick)\n{\n $uid = mysql_fetch_array(mysql_query(\"SELECT id FROM ibwf_users WHERE name='\".$nick.\"'\"));\n return $uid[0];\n}", "public static function username() {\n return 'user_id';\n }", "public function get_user_id_by_username($username) {\n $username = $this->real_escape_string($username);\n $query = $this->query(\"SELECT user_id FROM users WHERE username = '\"\n . $username . \"'\");\n\n if ($query->num_rows > 0) {\n $row = $query->fetch_row();\n return $row[0];\n } else\n return null;\n }", "public function getUser_ident()\n {\n return $this->user_ident;\n }", "public function getByUsername($username){\n $this->db->query(\"SELECT FROM tb_user WHERE username = :username\");\n\n $this->db->bind(\":username\", $username);\n\n $results = $this->db->single();\n\n return $results->user_id;\n }", "private function getCurrentUser($username) {\n\n $samaccountnameArray = explode(\"@\",$username);\n\n $samaccountname = $samaccountnameArray[0];\n \n return $samaccountname;\n }", "public function getUserId($username)\n {\n $select = $this->getTable()->select();\n $select->from('job_user', array('user_id'))\n ->where('username = ?', $username);\n \n $row = $this->getTable()->fetchRow($select);\n \n return $row->user_id;\n }", "public function getId()\n {\n return $this->username;\n }", "function get_user_id_from_string($email_or_login)\n {\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserID()\n {\n return $this->userID;\n }", "function getnick_sid($sid)\n{\n $uid = mysql_fetch_array(mysql_query(\"SELECT uid FROM ibwf_ses WHERE id='\".$sid.\"'\"));\n $uid = $uid[0];\n return getnick_uid($uid);\n}", "function User_lookup_id_by_login($login) {\n\t// Create call\n\t$call = new xmlrpcmsg('User.lookup_id_by_login', array(new xmlrpcval($login, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "static public function get_user_id()\n\t{\n\t\tif (isset($_SESSION[self::$cookie_name_prefix .self::USER_ID]))\n\t\t\treturn $_SESSION[self::$cookie_name_prefix .self::USER_ID];\n\t\telse\n\t\t\treturn null;\n\t}", "public function getUserID(){\n return($this->userID);\n }", "public function getUsername() {\n\t\treturn $this->netxUsername;\n\t}", "public function getUserID() {\n\t\t\treturn $this->iUser; \t\n\t\t}", "function identifier()\n\t{\n\t\t$identifier = $this->CI->session->userdata(AUTH_USER_IDENTIFIER);\n\t\tif ($identifier)\n\t\t{\n\t\t\treturn $identifier;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception (\"User identifier referenced, but not initialised. Perhaps the user is not logged in?\");\n\t\t}\n\t}", "public function fcpoGetIdByUserName($sUserName) \n {\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $sQuery = \"SELECT oxid FROM oxuser WHERE oxusername = \" . oxDb::getDb()->quote($sUserName);\n\n if (!$oConfig->getConfigParam('blMallUsers')) {\n $sQuery .= \" AND oxshopid = '{$oConfig->getShopId()}'\";\n }\n\n $sReturn = $this->_oFcpoDb->GetOne($sQuery);\n\n return $sReturn;\n }", "function textus_db_get_id($name)\n{\n global $wpdb;\n if (!$name) {\n return wp_send_json(array(\"status\"=>500, \"error\"=>\"No username was given\"));\n }\n $notes = $wpdb->get_var( \n \"SELECT ID\n FROM \" . $wpdb->prefix . \"users\n WHERE user_nicename='$name'\"\n );\n\n if ($notes) \n {\n return $notes;\n }\n}", "public static function getUserName($user_id);", "public function _getID()\n {\n $this->selftest();\n return $this->objectUser->ID;\n }", "public function getUserIdForUserName($username)\n\t{\n\t\t$database = new Database();\n\t\t$db = $database->getConnection();\n\t\t\n\t\t$user = new User($db);\n\t\t$allUsers = $user->get();\n\n\t\tforeach($allUsers[\"records\"] as $user)\n\t\t{\n\t\t\tif($user[\"username\"] == $username)\n\t\t\t{\n\t\t\t\t// User found\n\t\t\t\treturn $user['id'];\n\t\t\t}\n\t\t}\n\t\t// User does not exist\n\t\treturn false;\n\t}", "public function getNicknameByID($userID){\n $userDAO = new UserDAO();\n return $userDAO->getNicknameByIDFromDB($userID);\n }", "function GetId ()\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $data = $this->mongo->dataFindOne( array( \"username\" => $this->username ) );\n return isset( $data[ \"_id\" ] ) ? $data[ \"_id\" ] : 0;\n }", "public function getUserId($username){\n\n\t\t$sqlQuery = \"SELECT user_id \";\n\n\t\t$sqlQuery .= \"FROM user_table \";\n\t\t$sqlQuery .= \"WHERE user_name='$username' \";\t\n\t\t$result = $this->getDbManager()->executeSelectQuery($sqlQuery);\n\t\t\t\n\n\t\tif (!empty($result[0][\"user_id\"])) return ($result[0][\"user_id\"]);\n\n\t\telse return (false);\n\n\t}", "public function diviroids_user_id($atts)\n {\n return DiviRoids_Security::get_current_user('ID');\n }", "function ibm_uid ( $dn ) { return dn2uid($dn); }", "public function getUsername($userID)\n {\n return $this->database->retrieve(\"SELECT username FROM Users Where userID = \\\"$userID\\\"\")[0];\n }", "public function getUsername() {\n\t\treturn parent::getId();\n\t}", "function wv_get_username_by_userid($uid) {\n\n $user = get_user_by('id', $uid);\n $username = $user->user_login;\n return $username;\n }", "function OS_GetUsernameByUserID( $uid) {\n //$sth = $db->prepare(\"SET NAMES 'utf8'\");\n //$result = $sth->execute();\n\t global $db;\n\t $sth = $db->prepare(\"SELECT * FROM \".OSDB_USERS.\" WHERE user_id = ? LIMIT 1 \");\n\t \n\t $sth->bindValue(1, (int)$uid, PDO::PARAM_INT);\n\t $result = $sth->execute();\n\t $row = $sth->fetch(PDO::FETCH_ASSOC);\n\t $username = $row[\"user_name\"];\n\t return $username;\n }", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "public function getUserID() {\n\t\treturn $this->_user_id;\n\t}" ]
[ "0.7589604", "0.72057945", "0.71841484", "0.7163695", "0.70501566", "0.70336443", "0.69733226", "0.69690347", "0.69331706", "0.6927661", "0.69158643", "0.6883752", "0.68680257", "0.6854988", "0.68269527", "0.67857724", "0.6763815", "0.67453474", "0.673239", "0.67245805", "0.6694383", "0.6665098", "0.6639137", "0.66302824", "0.6624789", "0.66164356", "0.6607602", "0.66004163", "0.6594319", "0.6584092", "0.6566519", "0.6528808", "0.6528808", "0.6528808", "0.6528468", "0.650984", "0.6493669", "0.64898324", "0.6472651", "0.64559335", "0.64472526", "0.6446073", "0.6445742", "0.6442153", "0.64203954", "0.64120424", "0.6410368", "0.6403489", "0.6401976", "0.63899887", "0.63820684", "0.63543344", "0.63430893", "0.6339219", "0.63280964", "0.6314433", "0.6277501", "0.62647474", "0.6261467", "0.6254275", "0.6242924", "0.6237417", "0.62370956", "0.6230421", "0.6214095", "0.6203545", "0.6201834", "0.6189859", "0.6185376", "0.6183329", "0.61656755", "0.61526996", "0.61524737", "0.6144155", "0.61262226", "0.61262226", "0.61221135", "0.6084766", "0.6084026", "0.6079831", "0.6073395", "0.60664624", "0.6065931", "0.6060622", "0.6057705", "0.6057429", "0.6045569", "0.6043951", "0.6034003", "0.6028556", "0.6021115", "0.6020433", "0.6009344", "0.6009029", "0.6004901", "0.600049", "0.59990776", "0.59986424", "0.59796464", "0.5973203" ]
0.6790407
15
Get information about a user.
function people_getInfo ($user_id) { $response = $this->execute(array('method' => 'flickr.people.getInfo', 'user_id' => $user_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['person']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }", "public function get_user_info()\n\t{\n\t\tif ( function_exists('wp_remote_get') ) {\n\t\t\t$json = wp_remote_get($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json['body'], true);\n\t\t} else {\n\t\t\t$json = @file_get_contents($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json, true);\n\t\t}\n\t\t\n\t\treturn $user_info['resp'];\n\t}", "public function getUserInfo() {}", "public function user_information($user_name)\n {\n $url = preg_replace('/set/i', 'user:' . $user_name, $this->public_url);\n return $this->curl($url)->user;\n }", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "abstract public function getUserInfo();", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function get_user_info()\n {\n try {\n $user_info = self::api(\"me\");\n } catch (Exception $e) {\n // TODO: Handle the error\n // Set the return value to be an empty array\n $user_info = array();\n }\n\n return $this->convert_array_to_object($user_info);\n }", "public static function getUser();", "public function getUserInformation()\n {\n return $this->userInformation;\n }", "public function getInfo()\n {\n $user = User::with(['optician'])->find(auth()->id());\n\n return api_resource('mobile\\User')->make($user);\n }", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "public function getUserInfo ()\n\t{\n\t\t$info[\"id\"]\t\t\t\t\t\t= $this->id;\t\t\t\t\t//The unique id of the user in the database\n\t\t$info[\"user_id\"] \t\t\t\t= $this->userId;\t\t\t\t//The id of the user includes API id's\n\t\t$info[\"email\"]\t\t\t\t\t= $this->email;\t\t\t\t\t//The email of the user\n\t\t$info[\"description\"]\t\t\t= $this->description;\t\t\t//The description of the user\n\t\t$info[\"location\"]\t\t\t\t= $this->location;\t\t\t\t//The location of the user\n\t\t$info[\"first_name\"]\t\t\t\t= $this->firstName;\t\t\t\t//The first name of the user\n\t\t$info[\"last_name\"]\t\t\t\t= $this->lastName;\t\t\t\t//The last name of the user\n\t\t$info[\"name\"]\t\t\t\t\t= $this->fullName;\t\t\t\t//The full name of the user\n\t\t$info[\"username\"]\t\t\t\t= $this->username;\t\t\t\t//The username of the user\n\t\t$info[\"type\"]\t\t\t\t\t= $this->type;\t\t\t\t\t//The type of user registration\n\t\t$info[\"thumbnail\"]\t\t\t\t= $this->thumbnail;\t\t\t\t//The user's image thumbnail\n\t\t$info[\"gender\"]\t\t\t\t\t= $this->gender;\t\t\t\t//The gender of the user\n\t\t$info[\"num_calendars\"]\t\t\t= $this->numCalendarsCreated;\t//The number of calendars the user has created\n\t\t$info[\"num_followed_calendars\"]\t= $this->numCalendarsFollowed;\t//The number of calendars the user is following\n\t\t$info[\"primary_calendar\"]\t\t= $this->primaryCalendar;\t\t//The primary calendar that a user is using\n\t\t\n\t\treturn $info;\n\t}", "public function getUserInfo()\n {\n }", "public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }", "public function getUserInfo() {\n $endpoint = '/users';\n $client = $this->_constructClient($endpoint . '/self');\n try {\n $response = $client->request();\n } catch (Zend_Http_Client_Exception $e) { // timeout or host not accessible\n return;\n }\n\n // error in response\n if ($response->isError()) return;\n\n $result = Zend_Json::decode($response->getBody());\n\n // foursquare returned an error\n if ($result['meta']['code'] != 200) return;\n\n $entry = $result['response']['user'];\n $user = array(\n 'name' => $entry['firstName'] . ' ' . $entry['lastName'],\n 'id' => $entry['id'],\n 'avatar' => $entry['photo']\n );\n return $user;\n }", "public function get_userInfo()\n {\n return $this->call_method(\"get/userInfo\",\n array()\n );\n }", "public function getUser() {\n\t\t$urlUser = \"{$this->apiHost}/me.json\";\n\t\treturn $this->runCurl ( $urlUser );\n\t}", "private function get_user_info() {\n $user_info = $this->_api_call('https://api.twitter.com/1.1/account/settings.json');\n return $user_info;\n }", "public function getUser()\n {\n\t\t//TODO User 1. How can we check the id of the JWT user?\n\t\t$user = '';\n\t\tif ($user) {\n\t\t\treturn $this->sendResponse(UserModel::find($user->id));\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to view this user');\n }", "public function getUserInfo()\r\n {\r\n return self::makeCall('getUserInfo', array(), null, false, $this->sessionID);\r\n }", "public function user_info() {\n if ($this->rails_cookie_value() == NULL) {\n return null;\n }\n if (!self::$user_info && !self::$user_info_called) {\n $json_data = $this->api_request(\"user/\" . $this->rails_cookie_value());\n self::$user_info = $json_data->{'user'};\n self::$user_info_called = true;\n }\n return self::$user_info;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function getUserInfo($user_id) {\n $params = array_merge([\n 'token' => $this->bot_token,\n 'user' => $user_id,\n 'pretty' => true,\n ]);\n\n $response = $this->get($params, 'users.info');\n\n return $response['user'];\n }", "public function getUser()\n {\n $this->getParam('user');\n }", "public static function retrieveUserInformation($user) {\n return R::find('user', 'username = ? ', [ $user ]);\n }", "public function getUserInfo($user)\r\n {\r\n return $this->exec('user_info ' . $this->escapePeer($user));\r\n }", "public function getUserInfo() {\n\t\t$userInfo = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => USERINFO,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'user_id' => $this->photo['owner'],\n\t\t\t));\n\t\treturn unserialize($userInfo->body);\n\t}", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "function getUserInfo()\n {\n return $this->userinfo;\n }", "public function getUser() {\n\t\treturn $this->api->getUserById($this->getUserId());\n\t}", "public function get_user_info($info)\n {\n Session::_start();\n return Session::_get(\"user\", $info);\n }", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function user()\n {\n return $this->request('get', '/api/user');\n }", "public function getInfo()\n {\n if(Sentry::check())\n {\n $user = Sentry::getUser();\n $data = $this->app->json([\n \"username\" => $user->first_name,\n \"password\" => \" \",\n \"email\" => $user->email\n ]);\n return $data;\n } else {\n return false;\n }\n }", "public function getMyAccountInfo()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n $user = array_pop($user);\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'Successfully retrieved user info';\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "private function getUser()\n {\n return $this->user->getUser();\n }", "public function user()\n\t{\n\n\t\t$user = $this->current_user ? $this->current_user : $this->ion_auth->get_user();\n\n\t\techo json_encode($user);die;\n\t}", "public function actionInfo()\n {\n $uid = getParam('id', null);\n if (!$uid) {\n $uid = getMyId();\n }\n if (!empty($uid)) {\n\n $useModel = User::find()->active()->where(['id' => $uid])->one();\n if ($useModel) {\n $this->msg = 'User Info';\n $this->data = User::getDetail($uid);\n } else {\n $this->code = 404;\n $this->msg = 'User Not found';\n }\n } else {\n $this->code = 422;\n $this->msg = 'Id is require';\n }\n\n }", "function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}", "public function getUserInfo()\n {\n\n if (empty($this->_user))\n return '';\n\n $userInfo = $this->_user;\n\n if (!empty($this->_password))\n $userInfo .= \":{$this->_password}\";\n\n return $userInfo;\n }", "public function userInfo()\n {\n $this->startBrokerSession();\n $user = null;\n\n $userId = $this->getSessionData('sso_user');\n\n if ($userId) {\n $user = $this->getUserInfo($userId);\n if (!$user) return $this->fail(\"User not found\", 500); // Shouldn't happen\n }\n\n header('Content-type: application/json; charset=UTF-8');\n echo json_encode($user);\n }", "function get_user_info( $user, $key )\n {\n //Unimplemented\n }", "public function getUserDetails()\n {\n try\n {\n $user = \\App\\User::find(getLoggedInUser('id'));\n\n return createResponse(200, \"User Details.\", ['user' => $user]);\n\n }catch(\\Exception $e)\n {\n \\Log::error(\"Get user details API failed: \".$e->getMessage());\n return createResponse(config('httpResponse.SERVER_ERROR'),\n \"Cound not fetch detail!\",\n ['error' => 'Cound not fetch detail!']);\n }\n }", "public function getUserInfo($user_name) {\n $query = \"SELECT * FROM users WHERE user_name = '%s'\";\n $vals = Array();\n $vals[] = $user_name;\n $user_info = $this->read_one($query, $vals);\n return $user_info;\n }", "public function getUserInfo()\n {\n $request = new Resource('GET', 'https://api.dropbox.com/1/account/info', array(\n 'oauth_consumer_key' => $this->consumer->client_id,\n 'oauth_token' => $this->token->access_token,\n ));\n\n // Sign the request using the consumer and token\n $request->sign($this->signature, $this->consumer, $this->token);\n\n $user = json_decode($request->execute());\n\n // Create a response from the request\n return array(\n 'uid' => $this->token->uid,\n 'name' => $user->display_name,\n 'email' => $user->email,\n 'location' => $user->country,\n );\n }", "public function get_user()\n\t{\n\t\t$username = 'root';\n\t\t$password = md5('123');\n\n\t\t//将数据存储到数据中\n\t\t$arr = array(\n\t\t\t'username'\t=>\t$username,\n\t\t\t'psd' \t\t=>\t$password\n\t\t);\n\n\t\t$this->load->model('user_model','user');\n\t\t$data = $this->user->get_user($arr);\n\t\techo $this->_gen_userinfo_json($data);\n\t}", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public static function get_user($user_id);", "public function getuserAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User;\r\n return $data;\r\n }", "public function getUserInfo($id)\n {\n return $this->_dbTable->getUserInfo($id);\n }", "public function getUser() {}", "function getUserInfo($user_id) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $query = 'SELECT id, username, name, email FROM #__users ' .\n 'WHERE id = ' . (int) $user_id;\n $dbo =& JFactory::getDBO();\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0]; \n $infos['user_id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n return $infos;\n }\n return $infos;\n }", "private function getUserInfo()\n\t{\n\t\t$user = Sentry::user();\n\t\t$result = array(\n\t\t\t'username' => $user->get('username'),\n\t\t\t'isAdmin' => $user->in_group('admin'),\n\t\t);\n\t\treturn $result;\n\t}", "public static function user() {\n // $userInfo = $oauth2->userinfo->get();\n $userInfo = json_decode(json_encode(['email' => '@', 'gender' => null, 'name' => 'test', 'picture' => 'f']));\n return User::fromGoogleUser($userInfo);\n \n }", "public function getUserInformation() {\n /** @var User $user */\n $user = auth()->user() ;\n\n return $user->toArray() ;\n }", "public function profile()\n {\n try {\n $user = auth('api')->user();\n return $this->sendResponse($user, trans('actions.get.success'));\n } catch (Exception $ex) {\n return $this->sendError([], trans('actions.get.failed'));\n }\n }", "public function UserDetails()\n {\n if (!Auth::user()) {\n return response()->json(\"Not Authenticated\");\n } else {\n $user = Auth::user();\n return response()->json([$user], 200);\n }\n }", "public function fetchUser() {\n return $this->QueryAPI(\"current_user\");\n }", "public function profileInfo()\n {\n\n return response()->json(User::where('id', '=', Auth::user()->id)->get());\n }", "public function getUser() {\n\t\treturn User::find($this->user_id);\n\t}", "public function info()\n {\n return $this->query($this->userEndpoint);\n }", "public function getUserInfo(\\Core\\Auth\\OAuth2\\Token\\Access $token)\n\t{\n\t\t// define the get user information token\n\t\t$url = 'https://apis.live.net/v5.0/me?' . http_build_query(array(\n\t\t\t'access_token' => $token->accessToken,\n\t\t), null, '&');\n\n\t\t// perform network request\n\t\t$user = json_decode(file_get_contents($url));\n\n\t\t// create a response from the request and return it\n\t\treturn array(\n\t\t\t'uid' \t\t\t=> $user->id,\n\t\t\t'name' \t\t\t=> $user->name,\n\t\t\t'emial'\t\t\t=> isset($user->emails->preferred) ? $user->emails->preferred : null,\n\t\t\t'nickname' \t\t=> \\Core\\Inflector::friendlyTitle($user->name, '-', true),\n\t\t\t// 'location' \t=> $user->location,\n\t\t\t// \trequires scope wl.postal_addresses and docs here: http://msdn.microsoft.com/en-us/library/hh243648.aspx#user\n\t\t\t'locale' \t\t=> $user->locale,\n\t\t\t'urls' \t\t\t=> array(\n\t\t\t\t'Windows Live' => $user->link\n\t\t\t),\n\t\t);\n\t}", "public function getUserInformation($uid, User &$userObject = null);", "public function getUser() {\n\t\treturn $this->getTable('User')->find($this->user_id);\n\t}", "function getUserInfo($user='',$field='')\r\n\t{\r\n\t\tif($user != '')\r\n\t\t{\r\n\t\t\t$sql = $GLOBALS['db']->Query(\"SELECT $field FROM \" . PREFIX . \"_users WHERE Status = '1' AND Id = '$user'\");\r\n\t\t\t$row = $sql->fetchrow();\r\n\t\t\t$sql->close();\r\n\t\t\treturn $row->$field;\r\n\t\t}\r\n\t}", "public function get_userInfo_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userInfo($user_id,$profile_type);\n\t\treturn $this->response($result);\t\t\t\n\t}", "public function getUser()\r\n {\r\n return $this->user;\r\n }", "private function getUser()\n {\n $userObj = new Core_Model_Users;\n return $userObj->profile();\n }", "static public function GetGETUser() {\n if (isset(self::$getUser))\n return self::$getUser;\n else\n return self::UNKNOWN;\n }", "public function getUserInfo() {\n\n if (empty($this->uriParts['user'])) {\n return '';\n }\n $val = $this->uriParts['user'];\n\n if (!empty($this->uriParts['pass'])) {\n $val .= ':' . $this->uriParts['pass'];\n }\n return $val;\n }", "public function getUser() {\r\n return $this->user;\r\n }", "public function userinfo($username=null) {\r\n\t\tif (!is_null($username)) {\r\n\t\t\t$field = ($this->validEmail($idin)) ? 'email' : 'username';\r\n\t\t\t$user = $this->db\r\n\t\t\t\t->where($field, $username)\r\n\t\t\t\t->get($this->user_table)\r\n\t\t\t\t->row();\r\n\t\t\treturn $user;\r\n\t\t}\r\n\t}", "public function user() {\n $connection = new HTTPConnector($this);\n $url = $this->credential->getRequestUrl(BitcasaConstants::METHOD_USER . BitcasaConstants::METHOD_PROFILE);\n if (!BitcasaUtils::isSuccess($connection->get($url))) {\n return null;\n }\n\n $response = $connection->getResponse(true);\n\n $user = User::getInstance($response);\n return $user;\n }", "public function getUser(){\r\n $urlUser = \"{$this->apiHost}/api/v1/me\";\r\n // return $urlUser;\r\n return self::runCurl($urlUser);\r\n }", "public function getAuthUserDetail()\n {\n return $this->user;\n }", "public function user()\n {\n return $this->response_json($this->guard()->user());\n }", "public function userDetails()\n {\n $user = Auth::user();\n return response()->json(['success' => $user]);\n }", "public static function getUser()\n {\n return self::getInstance()->_getUser();\n }", "public function details( $userId )\n {\n $this->setApiRequestUrl( $userId );\n\n $response = $this->simpleGetRequest();\n\n return new UserDetailsInfo( $response );\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }" ]
[ "0.8160531", "0.79876846", "0.7815327", "0.7776348", "0.77492225", "0.76899296", "0.7640455", "0.76099616", "0.757275", "0.7563238", "0.7563238", "0.7563238", "0.7563238", "0.7563238", "0.7563238", "0.7563238", "0.7559353", "0.7553211", "0.7508531", "0.7505855", "0.75006986", "0.74996084", "0.74877024", "0.7461549", "0.74604535", "0.7430536", "0.74152327", "0.7414738", "0.7407418", "0.7399201", "0.73869616", "0.73736405", "0.7359484", "0.7359484", "0.7359484", "0.7338509", "0.7337433", "0.7325198", "0.7320539", "0.73058957", "0.73026973", "0.7302579", "0.72702414", "0.72603154", "0.7239123", "0.7238738", "0.72336423", "0.7222343", "0.7213507", "0.7193256", "0.7190745", "0.7174469", "0.7173806", "0.7171296", "0.716757", "0.7157271", "0.7147611", "0.71440345", "0.7142527", "0.713968", "0.7134491", "0.7134491", "0.7134491", "0.7134491", "0.7131099", "0.71283835", "0.7125482", "0.7121236", "0.71137357", "0.708953", "0.7072641", "0.703941", "0.7029589", "0.70267123", "0.7015334", "0.7013074", "0.70129", "0.70077074", "0.7006768", "0.70066994", "0.6995851", "0.699436", "0.6991025", "0.6986644", "0.6977681", "0.69723105", "0.6962911", "0.6961029", "0.69591707", "0.69573945", "0.69503987", "0.69433504", "0.69397956", "0.69361943", "0.6929607", "0.69252485", "0.6924827", "0.6924827", "0.6924827", "0.6924827", "0.6924827" ]
0.0
-1
Returns the list of public groups a user is a member of.
function people_getPublicGroups ($user_id) { $response = $this->execute(array('method' => 'flickr.people.getPublicGroups', 'user_id' => $user_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['groups']['group']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserGroups()\n\t{\n\t\t\n\t\t$groups = array();\n\t\t$db \t= $this->getUserDbTable();\n\t\t$id \t= $this->getUserId();\n\t\t\n\t\tif ($id)\n\t\t{\t\n\t\t\t$groups \t= $db->getAdapter()->select()->from(array('gmt'=>'groups_members_table'))\n\t\t\t\t\t\t\t\t\t\t ->joinInner(array('gt'=>'groups_table'), 'gmt.group_id = gt.group_id')\n\t\t\t\t\t\t\t\t\t\t ->where('gmt.user_id = ? ', $id)\n\t\t\t\t\t\t\t\t\t\t ->query()->fetchAll();\n\t\t}\t\n\t\t/* Automatically append group 0===Public group */\n\t\t$public \t\t= $db->getAdapter()->select()->from(array('gmt'=>'groups_table'))->where('group_privacy_level = ? ', 0)\n\t\t\t\t\t\t\t\t\t ->query()->fetch();\n\t\t$groups[] = $public;\n\t\t\n\t\treturn $groups;\n\t}", "public function groups()\n {\n $return = ['everyone'];\n\n $groups = GroupMember::where('user_id', $this->id())\n ->sort('`group` ASC')\n ->all();\n\n foreach ($groups as $group) {\n $return[] = $group->group;\n }\n\n return $return;\n }", "function getGroups()\n {\n//\t\t$this->_groups = array();\n if ( empty( $this->_groups ) ) {\n $member_handler = &zarilia_gethandler( 'member' );\n if ( $this->getVar( 'uid' ) ) {\n $this->_groups = $member_handler->getGroupsByUser( $this->getVar( 'uid' ) );\t\t\t\t\n } else {\n $this->_groups = array( 0 => ZAR_GROUP_ANONYMOUS );\n }\n }\t\t\n return $this->_groups;\n }", "public function getUserGroups()\n {\n $query = \"SELECT groupName FROM UserGroupAccess\";\n if(($result = $this->getQuery($query,true)) != NULL)\n {\n return $result;\n }\n else\n return false;\n }", "public function listGroups($user) {\n return $user->groups;\n }", "public function get_groups()\n\t{\n\t\tif (empty($this->user))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn array(array('UniGroup', $this->user[static::_column('group')]));\n\t}", "public function getUserGroups()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$uid = UserUtil::getIdFromName($uname);\n\t\tif($uid == false) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\t$groups = UserUtil::getGroupsForUser($uid);\n\t\t$return = array();\n\t\tforeach($groups as $item) {\n\t\t\t$group = UserUtil::getGroup($item);\n\t\t\t$return[] = $group['name'];\n\t\t}\n\t\tif(SecurityUtil::checkPermission('Owncloud::Admin', '::', ACCESS_MODERATE, $uid)) {\n\t\t\t$return[] = 'admin';\n\t\t}\n\t\treturn self::ret($return);\n\t}", "public function GetMembers()\n {\n if($this->getGroupId())\n {\n $user = new User($this->sqlDataBase);\n $groupMembers = $user->GetGroupUsers($this->groupId);\n return $groupMembers;\n }\n return array();\n }", "public function get_groups(){\n $group_users = private_party_group_user::search()->where('uid', $this->uid)->exec();\n $merged_groups = array();\n foreach($group_users as $group_user){\n /* @var $group_user private_party_group_user */\n $groups = $group_user->get_groups();\n $merged_groups = array_merge($merged_groups, $groups);\n }\n return $merged_groups;\n }", "private function getGroups()\n {\n $where = '';\n if ($this->userGroups)\n {\n $groups = explode(',', $this->userGroups);\n $where .= \" uid IN ('\" . implode(\"','\", $groups) . \"') \";\n }\n $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_groups', $where);\n $res = array();\n while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)))\n {\n $res[$row['uid']] = $row;\n }\n\n $this->loadGroupIcons($res);\n\n return $res;\n }", "protected function _get_usergroup_list()\n {\n $results = $this->connection->query('SELECT gid,title FROM ' . $this->connection->get_table_prefix() . 'usergroups');\n $mod_results = array();\n foreach ($results as $key => $value) {\n $mod_results[] = array('group_id' => $value['gid'], 'group_name' => $value['title']);\n }\n $results2 = collapse_2d_complexity('group_id', 'group_name', $mod_results);\n return $results2;\n }", "public function getUserGroupMemberShip($userId)\n {\n return $this->_userDao->getGroupList($userId);\n }", "private function getUserGroups($userId){\n\t\t\t$publicGroups = $this->getGroupsByUserId($userId, 1);\n\t\t\t$privateGroups = $this->getGroupsByUserId($userId, 0);\n\t\t\t\n\t\t\t$userGroups = array();\n\t\t\t\n\t\t\tforeach($publicGroups as $group){\n\t\t\t\tif($group[\"joined\"] == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\t$userGroups[] = $group;\n\t\t\t}\n\t\t\t\n\t\t\tforeach($privateGroups as $group){\n\t\t\t\t$userGroups[] = $group;\n\t\t\t}\n\t\t\t\n\t\t\treturn $userGroups;\n\t\t}", "public static function getCurrentUserGroups()\n {\n return self::getUserGroups();\n }", "public function getGroups()\n {\n if ($this->_oGroups == null && $sOxid = $this->getId()) {\n // usergroups\n $this->_oGroups = oxNew('oxlist', 'oxgroups');\n $sViewName = getViewName(\"oxgroups\", $this->getLanguage());\n $sSelect = \"select {$sViewName}.* from {$sViewName}, oxobject2group \";\n $sSelect .= \"where oxobject2group.oxobjectid='$sOxid' \";\n $sSelect .= \"and oxobject2group.oxgroupsid={$sViewName}.oxid \";\n $this->_oGroups->selectString($sSelect);\n }\n\n return $this->_oGroups;\n }", "public function getGroupsWithMember($user_id) {\n return $this->get('get_groups_with_member', ['user_id' => $user_id]);\n }", "function getGroups($uid, $asString = FALSE)\n {\n static $grouplist = NULL;\n\n $menber =& xoops_gethandler('member');\n\n if (is_null($grouplist)) {\n $grouplist = $menber->getGroupList();\n }\n foreach($menber->getGroupsByUser($uid) as $gid) {\n $ret[$gid] = $grouplist[$gid];\n }\n if ($asString) {\n $ret = join($asString, $ret);\n }\n\n return $ret;\n }", "public function getGroups() {\r\n // Array to hold the group objects\r\n $groups = [];\r\n // Loop through each of the groups the user belongs to\r\n foreach ($this->groups as $group) {\r\n // Get the group from the database\r\n $grp = UserGroup::getByName($group);\r\n // If the group has a valid ID (not 0 or less)\r\n if ($grp->id != 0) {\r\n // Add the group to the array\r\n $groups[] = $grp;\r\n }\r\n }\r\n // Return the groups array\r\n return $groups;\r\n }", "public function getGroups()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getGroups() : array();\r\n }", "static function getUserGroups(){\n \n }", "function getGroupMemberships($user, $parentGroups = false)\n {\n return array();\n }", "public function getUsersInGroup()\n\t{\n\t\tself::authenticate();\n\n\t\t$group = FormUtil::getPassedValue('group', null, 'GETPOST');\n\n\t\tif($group == null) {\n\t\t\treturn self::retError('ERROR: No group passed!');\n\t\t}\n\n\t\t$group = UserUtil::getGroups('name = \\'' . mysql_escape_string($group) . '\\'');\n\t\t$return = array();\n\t\tif(count($group) == 1) {\n\t\t\tforeach($group as $item) {\n\t\t\t\t$users = UserUtil::getUsersForGroup($item['gid']);\n\t\t\t\tforeach($users as $uid) {\n\t\t\t\t\t$return[] = UserUtil::getVar('uname', $uid);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = array();\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "public function getGroups() {\n return $this->getGuardUser() ? $this->getGuardUser()->getGroups() : array();\n }", "function getUsersGroups($mysqli,$userID){\r\n $result = $mysqli->query(\"SELECT groups.*, group_members.isAdmin FROM `group_members` RIGHT JOIN groups ON group_members.group_ID = groups.ID WHERE Member_ID = \".$userID.\"\");\r\n $groups = array();\r\n\r\n $i=0;\r\n while($row = $result->fetch_row()){\r\n $g = new group();\r\n $g->groupID = $row[0];\r\n $g->name = $row[1];\r\n $g->description = $row[2];\r\n $g->website = $row[3];\r\n $g->private = $row[4];\r\n $g->type = $row[5];\r\n $g->sport = $row[6];\r\n $g->logoURL = $row[7];\r\n $g->city = $row[8];\r\n $g->userIsAdmin = $row[9];\r\n $groups[$i] = $g;\r\n $i++;\r\n }\r\n return $groups;\r\n }", "public function getMembers() {\n /* get members */\n $c = $this->modx->newQuery('modUser');\n $c->innerJoin('modUserGroupMember','UserGroupMembers');\n $c->innerJoin('modUserGroupRole','Role','UserGroupMembers.role = Role.id');\n $c->where(array(\n 'UserGroupMembers.user_group' => $this->userGroup->get('id'),\n ));\n $c->select($this->modx->getSelectColumns('modUser','modUser'));\n $c->select(array(\n 'role' => 'Role.id',\n 'role_name' => 'Role.name',\n ));\n $members = $this->modx->getCollection('modUser',$c);\n $list = array();\n /** @var $member modUserGroupMember */\n foreach ($members as $member) {\n $list[] = array(\n $member->get('id'),\n $member->get('username'),\n $member->get('role'),\n $member->get('role_name'),\n );\n }\n $this->userGroupArray['members'] = '(' . $this->modx->toJSON($list) . ')';\n return $list;\n }", "public function getUserGroupIDs()\n {\n $membergroupids = explode(',', $this->userInfo->membergroupids);\n\n if (in_array($this->userInfo->usergroupid, $membergroupids)) {\n return $membergroupids;\n }\n\n return [$this->userInfo->usergroupid] + $membergroupids;\n }", "public function getGroups();", "public function getGroups();", "function get_groups() {\n\t\tif (!isset($_SESSION['groups']))\n\t\t\tlgi_mysql_fetch_session(\"SELECT GROUP_CONCAT(`name`) AS `groups` FROM %t(usergroups) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%'\", $this->userid);\n\t\treturn explode(',', $_SESSION['groups']);\n\t}", "function _get_usergroups($args = array()) {\n\t\treturn WP_Scoped_User_Anon::get_groups_for_user( -1 );\n\t}", "public function listGroups()\n {\n\t\t$data = $this->call(array(), \"GET\", \"groups.json\");\n\t\t$data = $data->{'groups'};\n\t\t$groupArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$groupArray->append(new Group($data[$i], $this));\n\t\t}\n\t\treturn $groupArray;\n }", "function getGroups($username){\r\n\t\t//SELEZIONO DAL DATABASE L'ELENCO DEI GRUPPI AI QUALI L'UTENTE APPARTIENE\r\n\t\t$sql = \"SELECT groupname FROM \".$this->schema.\".user_group WHERE username='$username'\";\r\n\t\tprint_debug($sql,null,'tabella');\r\n\t\tif($this->db->sql_query($sql)){\t\t//STRUTTURA GRUPPI GISCLIENT\r\n\t\t\t$ris=$this->db->sql_fetchlist('groupname');\r\n\t\t\tif(!$ris) {\r\n\t\t\t\t$this->error->getError(\"C001\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tforeach($ris as $g){\r\n\t\t\t\t$this->groups[]=$g;\r\n\t\t\t}\r\n\t\t\treturn $this->groups;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->error->setNote($sql);\r\n\t\t\t$this->error->getError(\"1\");\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static function GetList()\n {\n $groups_directory = System::GetDataPath() . 'groups';\n \n $dir_handle = opendir($groups_directory);\n $groups = array();\n\n while (($group_directory = readdir($dir_handle)) !== false)\n {\n if(!is_dir($groups_directory . '/' . $group_directory))\n continue;\n\n //just check directories inside and skip the guest user group\n if (strcmp($group_directory, '.') != 0 && strcmp($group_directory, '..') != 0 && strcmp($group_directory, 'guest') != 0)\n {\n $group_data = self::GetData($group_directory);\n\n $groups[] = $group_data;\n }\n }\n\n return $groups;\n }", "public static function getGroups(): array\n {\n return ['user'];\n }", "public function getGroups()\n\t{\n\t\tself::authenticate();\n\n\t\t$search = FormUtil::getPassedValue('search', null, 'GETPOST');\n\t\tif($search == 'admin') {\n\t\t\t$return = array('admin');\n\t\t} else {\n\t\t\t$return = array();\n\t\t}\n\n\t\tif($search != '') {\n\t\t\t$where = 'name LIKE \\'' . mysql_escape_string($search) . '%\\'';\n\t\t} else {\n\t\t\t$where = '';\n\t\t}\n\t\t$offset = (integer)FormUtil::getPassedValue('offset', -1);\n\t\tif($offset == null) {\n\t\t\t$offset = -1;\n\t\t}\n\t\t$limit = (integer)FormUtil::getPassedValue('limit', -1);\n\t\tif($limit == null) {\n\t\t\t$limit = -1;\n\t\t}\n\n\t\t$groups = UserUtil::getGroups($where, 'name', $offset, $limit);\n\n\t\t$return = array();\n\t\tforeach($groups as $item) {\n\t\t\t$return[] = $item['name'];\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "public function getGroupsList(){\n return $this->_get(1);\n }", "private function getUserGroups($user){\n\t\t// check if the user exists\n\t\tif (posix_getpwnam($user) === false) {\n\t\t\treturn false;\n\t\t}\n\t\t// use the command \"groups <user>\" to find the groups\n\t\t// the format of output is as follows:\n\t\t// <user> : <group1> <group2> <group3> ...\n\t\t$output = shell_exec(\"groups \" . escapeshellarg($user));\n\t\t$output = trim($output); //get rid of newline\n\t\t\n\t\t// userstring = <user>, groupstring = <group1> <group2> <group3> ...\n\t\tlist($userstring,$groupstring) = explode( \":\", $output);\n\t\t\n\t\t//groups[0] = <group1>, groups[1] = <group2>, groups[2] = <group3>...\n\t\t$groups = explode(\" \",trim($groupstring)); //remove leading space from $groupstring, then split\n\t\t\n\t\treturn $groups;\n\t}", "function getMembersGroups($memberID) {\r\n $sql = $this->db->prepare(\"SELECT GROUPS.groupID, GROUPS.name FROM GROUPMEMBERS LEFT JOIN GROUPS ON GROUPMEMBERS.groupID=GROUPS.groupID WHERE GROUPMEMBERS.UserID='$memberID'\");\r\n if($sql->execute()) {\r\n return $sql->fetchall( PDO::FETCH_ASSOC );\r\n }\r\n return false;\r\n }", "public function getGroupsList(){\n return $this->_get(3);\n }", "public function getGroupsList(){\n return $this->_get(4);\n }", "public function getGroupsList(){\n return $this->_get(4);\n }", "public static function getAllGroupsByUserId($userId)\n {\n $arrMemberGroups = array();\n $arrOwnGroups = array();\n $arrAllGroups = array();\n \n // get user memeber groups\n $arrMemberGroups = self::select('network_groups.id', 'network_groups.name', 'network_groups.user_id')->join('group_users', 'group_users.network_group_id', '=', 'network_groups.id')\n ->where('group_users.user_id', '=', $userId)\n ->get()\n ->toArray();\n \n // get users own groups\n $arrOwnGroups = self::select('network_groups.id', 'network_groups.name', 'network_groups.user_id')->join('group_users', 'group_users.network_group_id', '=', 'network_groups.id')\n ->where('network_groups.user_id', '=', $userId)\n ->groupBy('network_groups.id')\n ->get()\n ->toArray();\n \n // merge all\n $arrAllGroups = array_merge($arrMemberGroups, $arrOwnGroups);\n \n return $arrAllGroups;\n }", "function _get_user_groups(){\r\n $groups = array();\r\n for($i=0; $i<get_sso_option('rules_number'); $i++){\r\n $rule = _get_rule($i);\r\n if($rule != FALSE){\r\n\t $is_group = _run_rule($rule['var'], $rule['regexp'], $rule['group']);\r\n\t if($is_group === TRUE) $groups[] = $rule['group'];\r\n }\r\n }\r\n return $groups;\r\n}", "public function getAllGroups(){\n // Get list\n $lists = array(); \n $data = Group::where('account_id', $this->getAccountId()) \n ->where('user_id', $this->user_id)\n ->get() \n ->toArray();\n $lists = $data;\n return $lists;\n }", "public function PublisherMembers() {\n\t\tif($this->owner->CanPublishType == 'OnlyTheseUsers'){\n\t\t\t$groups = $this->owner->PublisherGroups();\n\t\t\t$members = new DataObjectSet();\n\t\t\tif($groups) foreach($groups as $group) {\n\t\t\t\t$members->merge($group->Members());\n\t\t\t}\n\t\t\t\n\t\t\t// Default to ADMINs, if something goes wrong\n\t\t\tif(!$members->Count()) {\n\t\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\t\t$members = $group->Members();\n\t\t\t}\n\t\t\t\n\t\t\treturn $members;\n\t\t} elseif($this->owner->CanPublishType == 'LoggedInUsers') {\n\t\t\treturn Permission::get_members_by_permission('CMS_ACCESS_CMSMain');\n\t\t} else {\n\t\t\t$group = Permission::get_groups_by_permission('ADMIN')->first();\n\t\t\treturn $group->Members();\n\t\t}\n\t}", "public function getGroups()\n {\n return $this->groups;\n }", "function getGroups( $userId )\n\t{\n\t\t$query = \"SELECT DISTINCT CONCAT(units.alias,'-',holders.position,'-current')\n\t\t\t FROM holders, terms, units\n\t\t\t WHERE holders.term = terms.current_term\n\t\t\t AND holders.unitId = units.id\n\t\t\t AND holders.userid = ?;\";\n\n\t\t$groups = $this->_db->fetchAll($query, $userId);\n\t\treturn $groups;\n\t}", "public function getAllGroups();", "public function getGroups()\n\t{\n\t\treturn $this->groups;\n\t}", "function allGroupsIn($username, $permission){\n \t$con = new mysqli('localhost','heng','@powell135','200ok');\n \tif ($con -> connect_errno){\n \t\treturn CONNECTION_FAIL;\n \t}\n//\t$permission = MANAGER;\n\t$status = CONFIRMED;\n \t$query = \"select jnjn_group.groupid,name from jnjn_group inner join jnjn_user_group on jnjn_group.groupid=jnjn_user_group.groupid where username='$username' and status='$status' and permission='$permission'\";\n \t$result = $con -> query($query);\n \t$groupids = array();\n \twhile($row = mysqli_fetch_array($result)){\n \t\t$groupids[$row['name']] = $row['groupid'];\n \t}\n \t$result -> close();\n \treturn $groupids;\n }", "public function getGroups() {}", "public function getGroups() {\n return $this->groups;\n }", "public function groups()\n {\n $response = $this->request->post($this->requestUrl('get_groups'), $this->params);\n\n return $response->groups;\n }", "protected function _get_members_groups($member)\n {\n if ($member == $this->get_guest_id()) {\n return array(-1);\n }\n\n $groups = array();\n $additional_groups = explode(',', $this->get_member_row_field($member, 'additionalgroups'));\n foreach ($additional_groups as $key => $value) {\n if (!empty($value)) {\n $groups[] = $value;\n }\n }\n $groups[] = $this->get_member_row_field($member, 'usergroup');\n\n return $groups;\n }", "public function getUserGroups($userId){\n $query = \"SELECT * FROM groups g JOIN user_groups ug \n ON g.id = ug.groupId\n WHERE ug.userId='$userId' ORDER BY g.groupName;\";\n return $this->getData($query);\n }", "static function MemberMembergroups(Member $member)\n {\n if (!$member->Exists())\n {\n return array();\n }\n $sql = Access::SqlBuilder();\n $tblMmg = MemberMembergroup::Schema()->Table();\n $tblMg = Membergroup::Schema()->Table();\n $join = $sql->Join($tblMmg);\n $joinCondition = $sql->Equals($tblMmg->Field('MemberGroup'), $tblMg->Field('ID'));\n $where = $sql->Equals($tblMmg->Field('Member'), $sql->Value($member->GetID()));\n $orderBy = $sql->OrderList($sql->OrderAsc($tblMg->Field('Name')));\n \n return Membergroup::Schema()->Fetch(false, $where, $orderBy, null, 0, null, $join, JoinType::Inner(), $joinCondition);\n }", "function joined_groups() // pulls all the groups the user is joined but excludes school group\n {\n $user = $this->ion_auth->get_user();\n $query_string = \"SELECT group_relationships.group_id, groups.name FROM group_relationships LEFT JOIN groups ON group_relationships.group_id = groups.id \" .\n \"WHERE group_relationships.user_joined_id = ? AND groups.school_group=0\";\n $query = $this->db->query($query_string, array($user->id));\n\n $return_array = array();\n foreach ($query->result() as $row)\n {\n $return_array[] = array('id' => $row->group_id,\n 'name' => $row->name);\n }\n\n return $return_array;\n }", "protected function _get_moderator_groups()\n {\n $moderator_group = $this->connection->query('SELECT gid FROM ' . $this->connection->get_table_prefix() . 'usergroups WHERE title LIKE \\'' . db_encode_like('%Moderator%') . '\\'');\n\n if (is_null($moderator_group)) {\n return array();\n }\n\n $return_moderator_group = array();\n foreach ($moderator_group as $key => $value) {\n if (!empty($value['gid'])) {\n $return_moderator_group[] = $value['gid'];\n }\n }\n\n return $return_moderator_group;\n }", "public function getUserGroups()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('userGroups');\n }", "function mysteam_filter_groups($user)\n{\n\tglobal $mybb;\n\tstatic $gids;\n\n\t// Return true if no usergroups to filter from.\n\tif (!$mybb->settings['mysteam_limitbygroup'])\n\t{\n\t\treturn true;\n\t}\n\t\n\t// Check if the user is in an authorized usergroup.\n\tif (empty($gids))\n\t{\n\t\t$gids = explode(',', $mybb->settings['mysteam_limitbygroup']);\n\t\t\t\n\t\tif (is_array($gids))\n\t\t{\n\t\t\t$gids = array_map('intval', $gids);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$gids = (int) $mybb->settings['mysteam_limitbygroup'];\n\t\t}\n\t}\n\t\t\n\t$usergroups = explode(',', $user['additionalgroups']);\n\t$usergroups[] = $user['usergroup'];\n\t\n\tif (!is_array($usergroups))\n\t{\n\t\t$usergroups = array($usergroups);\n\t}\n\t\n\tif (array_intersect($usergroups, $gids))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "private function _show_list_of_groups() {\n // show groups of current user\n // create group button\n $this->load->model('membership_model');\n \n $user_id = $this->session->userdata('user')['id'];\n\n $where = array(\n 'm.user_id' => $user_id,\n 'm.status' => 1,\n 'g.status' => 1\n );\n \n $groups = $this->membership_model->fetch($where);\n\n // 1 is owner\n $where['m.type'] = 1;\n // allow status 2 for my groups for hidden\n // 0 is deleted\n unset($where['g.status']);\n $where['g.status !='] = 0;\n $my_groups = $this->membership_model->fetch($where);\n \n // membership type 2 is normal member\n $where['m.type'] = 2;\n $where['g.status'] = 1;\n $other_groups = $this->membership_model->fetch($where);\n\n // can be any type for invited\n unset($where['m.type']);\n $where['m.status'] = 2;\n $invited_groups = $this->membership_model->fetch($where);\n \n $data = array(\n 'title' => 'Groups',\n 'msg' => $this->session->flashdata('msg'),\n 'groups' => $groups,\n 'my_groups' => $my_groups,\n 'other_groups' => $other_groups,\n 'invited_groups' => $invited_groups\n );\n $this->_view(\n array('templates/nav', 'pages/dashboard/groups', 'alerts/msg'),\n array_merge($this->_nav_items, $data)\n );\n }", "public function getMembers()\n {\n if (!is_null($this->members_relation)) {\n return array_keys($this->members_relation);\n }\n\n if ($this->members_objs == null) {\n // load members\n $response = Helper::get('group/'.$this->unique_id);\n if (isset($response->body['result']['members'])) {\n $this->__construct($response->body['result']);\n }\n }\n\n if ($this->members_objs != null) {\n $list = array();\n foreach ($this->members_objs as $user) {\n $list[] = $user instanceof User ? $user->username : $user;\n }\n\n return $list;\n }\n }", "private function getUserGroups($userID)//this function should be moved to the UserVo\n\t{\n\t\t$db = Zend_Registry::get('db');\n\t\t\n\t\t$select = $db->select()\n\t\t\t\t\t->from(PrecurioTableConstants::USER_GROUPS,'group_id')\n\t\t\t\t\t->join(PrecurioTableConstants::GROUPS,'user_groups.group_id = groups.id','')\n\t\t\t\t\t->where('user_id= ?',$userID)\n\t\t\t\t\t->where ('active= ?',true);\n\t\t\t\t\t\n\t\t$stmt = $select->query();\n\t\t\n\t\t$stmt->setFetchMode(Zend_Db::FETCH_NUM);\n\t\t\n\t\t$userGroups = $stmt->fetchAll();\n\t\t$userGroups = Precurio_Utils::getSecondLevelArray($userGroups,0);\n\t\treturn $userGroups;\n\t}", "public static function getUserGroups($user)\n {\n return self::getAccount($user, array('CN'));\n }", "function membersOf($db,$groupID)\n{\n\t$q = \"select * from acad_object_groups where id = %d\";\n\t$grp = dbOneTuple($db, mkSQL($q, $groupID));\n\n\t$q = \"select member(%d)\";\n\t$res = dbQuery($db, mkSQL($q, $groupID));\n\t$arr = array();\n\twhile ($tuple = dbNext($res)) {\n\t\tarray_push($arr, $tuple[0]); \n\n\t}\n\t$arr = array_unique($arr);\n\t$arr = array_values($arr);\n\tsort($arr);\n\n\treturn array($grp[\"gtype\"], $arr); // stub\n}", "public function getGroups()\n {\n if (is_null($this->groups)) {\n /** @psalm-var ?list<mixed> $data */\n $data = $this->raw(self::FIELD_GROUPS);\n if (is_null($data)) {\n return null;\n }\n $this->groups = $data;\n }\n\n return $this->groups;\n }", "public function getUsers()\n {\n\t\treturn $this->api->listUsersOfGroup($this->getID());\n }", "function user_groups($username,$recursive=NULL){\n if ($username==NULL){ return (false); }\n if ($recursive==NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it\n if (!$this->_bind){ return (false); }\n \n //search the directory for their information\n $info=@$this->user_info($username,array($this->_group_attribute,\"member\",\"primarygroupid\"));\n \n $groups=$this->nice_names($info[0][$this->_group_attribute]); //presuming the entry returned is our guy (unique usernames)\n\n if ($recursive){\n foreach ($groups as $id => $group_name){\n $extra_groups=$this->recursive_groups($group_name);\n $groups=array_merge($groups,$extra_groups);\n }\n }\n return ($groups);\n }", "public function getAllGroups() {\n\t\t$groups = $this->group->getAll();\n\t\treturn $groups;\n\t}", "public function getUserGroups($username)\n {\n $apiEndpoint = '/1/user/group/direct?username='.$username;\n $apiReturn = $this->runCrowdAPI($apiEndpoint, \"GET\", array());\n if ($apiReturn['status'] == '200') {\n $groups = array();\n for ($i = 0; $i < count($apiReturn['data']['groups']); $i++) {\n $groups[] = $apiReturn['data']['groups'][$i]['name'];\n }\n return $groups;\n }\n return null;\n }", "public function getGroupNames()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getGroupNames() : array();\r\n }", "function getMembersOfGroup($group_id) {\n\n\t\t$db = JFactory::getDbo();\n\n\t\t$query = $db -> getQuery(true);\n\t\t$query -> select(array('memberid'));\n\t\t$query -> from('#__community_groups_members');\n\t\t$query -> where('groupid = ' . $db -> quote($group_id));\n\t\t$query -> where(\"approved = '1'\");\n\n\t\t$db -> setQuery($query);\n\n\t\t// Load the results as a list of stdClass objects.\n\t\t$members = $db -> loadResultArray();\n\n\t\treturn $members;\n\t}", "public function getGroups(){\n $groups = Group::get()->toArray();\n $groups_array = array();\n foreach($groups as $group){\n $groups_array[$group['id']]['group_name'] = $group['group_name'];\n $groups_array[$group['id']]['user_ids'] = explode(\",\",$group['user_ids']);\n }\n return $groups_array;\n }", "function groups($user_id)\n\t{\n\t\tif(!is_numeric($user_id) || $user_id < 1)\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Invalid user id.');\n\t\t}\n\n\t\treturn $this->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t$this->name . '.user_id' => $user_id,\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'Group',\n\t\t\t\t'Group.Project',\n\t\t\t\t'Group.User',\n\t\t\t\t'Role',\n\t\t\t),\n\t\t\t'order' => 'Group.name',\n\t\t));\n\t}", "public function getUserGroupIds()\n\t{\n\t\treturn $this->user_group_ids;\n\t}", "function db_get_groups()\n{\n\t$dbh = db_connect();\n\n\t$query = \"SELECT * FROM `groups`\";\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t$retval = array();\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t$retval[$row['id']] = $row;\n\t}\n\n\t// Get the members as well.\n\t// In each group's entry, 'members' is an array listing the\n\t// IDs of members of that group. Positive IDs corresond to\n\t// feeds, and negative IDs correspond to groups.\n\t$result = $dbh->query(\"SELECT * FROM group_members\");\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t// $row == (member, parent)\n\t\t// We take $row[parent] to get the parent, and append to\n\t\t// its 'members' array.\n\t\t$retval[$row['parent']]['members'][] = $row['member'];\n\t}\n\n\treturn $retval;\n}", "public function getGroupNames() {\n return $this->getGuardUser() ? $this->getGuardUser()->getGroupNames() : array();\n }", "public function getMembers($group_id);", "public static function getAllGroups()\n {\n return ValveGroup::all();\n }", "public function groups() : array\n {\n return $this->groups;\n }", "public function groups() : array\n {\n return $this->groups;\n }", "function get_all_user_group()\n {\n $user_group = $this->db->query(\"\n SELECT\n *\n\n FROM\n `groups`\n\n WHERE\n 1 = 1\n AND gro_id != 1\n\n ORDER BY `gro_id` DESC\n \")->result_array();\n\n return $user_group;\n }", "public function getGroupsWithAdmin($user_id) {\n return $this->get('get_groups_with_admin', ['user_id' => $user_id]);\n }", "public function user_groups($username,$recursive=NULL,$isGUID=false){\n if ($username===NULL){ return (false); }\n if ($recursive===NULL){ $recursive=$this->_recursive_groups; } // Use the default option if they haven't set it\n if (!$this->_bind){ return (false); }\n \n // Search the directory for their information\n $info=@$this->user_info($username,array(\"memberof\",\"primarygroupid\"),$isGUID);\n $groups=$this->nice_names($info[0][\"memberof\"]); // Presuming the entry returned is our guy (unique usernames)\n\n if ($recursive === true){\n foreach ($groups as $id => $group_name){\n $extra_groups=$this->recursive_groups($group_name);\n $groups=array_merge($groups,$extra_groups);\n }\n }\n\n // remove duplicate entries and close gaps\n $groups = array_values(array_unique($groups));\n \n return ($groups);\n }", "function getMemberGroupInfo() {\n global $inputs;\n\n if (empty($inputs)) {\n $mid = getLogin()['mid'];\n } else {\n $mid = $inputs['id'];\n }\n\n $res = getAll(\"SELECT b.*,a.id AS union_id \n FROM member_group a \n INNER JOIN `group` b \n ON a.group_id = b.id \n WHERE a.member_id = ?\", [$mid]);\n\n if (empty($inputs)) {\n return $res;\n } else {\n formatOutput(true, 'success', $res);\n }\n}", "public function getUsergroupIds()\n\t{\n\t\treturn $this->usergroup_ids;\n\t}", "public function getGroupList()\n\t{\n\t\t$db = FabrikWorker::getDbo(true);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('DISTINCT(group_id)')->from('#__{package}_formgroup');\n\t\t$db->setQuery($query);\n\t\t$usedgroups = $db->loadResultArray();\n\t\tJArrayHelper::toInteger($usedgroups);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id AS value, name AS text')->from('#__{package}_groups');\n\t\tif (!empty($usedgroups)) {\n\t\t\t$query->where('id NOT IN('.implode(\",\", $usedgroups) .')');\n\t\t}\n\t\t$query->where('published <> -2');\n\t\t$query->order(FabrikString::safeColName('text'));\n\t\t$db->setQuery($query);\n\t\t$groups = $db->loadObjectList();\n\t\t$list = JHTML::_('select.genericlist', $groups, 'jform[groups]', \"class=\\\"inputbox\\\" size=\\\"10\\\" style=\\\"width:100%;\\\" \", 'value', 'text', null, $this->id . '-from');\n\t\treturn array($groups, $list);\n\t}", "function group_users($group_name=NUL){\n $result = array();\n if ($group_name==NULL){ return (false); }\n if (!$this->_bind){ return (false); }\n $filter=\"(&(|(objectClass=posixGroup)(objectClass=groupofNames))(\".$this->_group_cn_identifier.\"=\".$this->ldap_search_encode($group_name).\"))\";\n\n $fields=array(\"member\",\"memberuid\");\n $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);\n if (FALSE === $sr) {\n $this->_warning_message = \"group_users: ldap_search error \".ldap_errno($this->_conn).\": \".ldap_error($this->_conn);\n echo \"DEBUG: \".$this->_warning_message.\"\\n\";\n }\n $entries = $this->ldap_get_entries_raw($sr);\n\n // DEBUG\n if (0 == count($entries)) {\n $this->_warning_message = \"group_users: No entry for the specified filter $filter\";\n echo \"DEBUG: \".$this->_warning_message;\n }\n\n if (isset($entries[0][\"member\"][0]))\n {\n $result = $this->nice_names($entries[0][\"member\"]);\n /*\n for ($i=0; $i++; $i < $entries[0][\"member\"][count])\n {\n $result[] == ($entries[0][\"member\"][$i]);\n }\n */\n }\n elseif (isset($entries[0][\"memberuid\"][0]))\n {\n $result = $this->nice_names($entries[0][\"memberuid\"]);\n }\n else\n {\n $result = array();\n }\n return ($result);\n }", "public function getGroups(): array;", "public function listGroupByUser($name){\n \n $this->connect->connector();\n $ad = $this->connect->getConnector();\n \n \n $racine = \"cn=Users,dc=admc, dc=com\";\n $rechercheGroupe = ldap_search($ad, $racine, \"(&(objectclass=user)(name=\".$name.\"))\");\n $entries = ldap_get_entries($ad, $rechercheGroupe);\n $listGroup = False;\n \n for ($x=0; $x<$entries['count']; $x++){\n \n if(!empty($entries[$x]['memberof'][0])){\n //var_dump($entries[$x]['memberof']);\n for($y=0; $y< $entries[$x]['memberof']['count']; $y++){\n\n\n $listGroup[$y] = $this->getBetween($entries[$x]['memberof'][$y], \"=\", \",\");\n }\n\n }\n }\n return $listGroup;\n \n \n }", "function GetAllGroups($UserID){\n $Memberships=array();\n $DirectMemberships = Query(\"SELECT DISTINCT(GroupID) FROM `UserGroupMembership` WHERE UserID = \".intval($UserID));\n \n foreach($DirectMemberships as $DirectMembership){\n \n $Memberships[$DirectMembership['GroupID']]=$DirectMembership['GroupID'];\n \n $IndirectMemberships = GetGroupAncestors($DirectMembership['GroupID']);\n foreach($IndirectMemberships as $IndirectMembership){\n $Memberships[$IndirectMembership]=$IndirectMembership;\n }\n \n }\n ksort($Memberships);\n \n //The groups are in order but they are strings and some might be blank. Let's clean them up\n $CleanMemberships=array();\n foreach($Memberships as $Membership){\n $temp=trim(intval($Membership));\n if(!($temp=='')){\n $CleanMemberships[]=$temp;\n }\n }\n \n return $CleanMemberships;\n}", "function getGroupList() {\n return getAll(\"SELECT * FROM `group` WHERE admin_id = ?\", [getLogin()['uid']]);\n}", "public function adminHasRetrievedGroupListUsingTheGraphApi(): array {\n\t\t$response = GraphHelper::getGroups(\n\t\t\t$this->featureContext->getBaseUrl(),\n\t\t\t$this->featureContext->getStepLineRef(),\n\t\t\t$this->featureContext->getAdminUsername(),\n\t\t\t$this->featureContext->getAdminPassword()\n\t\t);\n\t\tif ($response->getStatusCode() === 200) {\n\t\t\t$jsonResponseBody = $this->featureContext->getJsonDecodedResponse($response);\n\t\t\treturn $jsonResponseBody[\"value\"];\n\t\t} else {\n\t\t\t$this->throwHttpException($response, \"Could not retrieve groups list.\");\n\t\t}\n\t}", "public function groups()\n {\n return $this->hasMany(Group::class, 'memberuid', 'uid');\n }", "function get_members($gid, $limit = NULL, $approved = NULL) {\n global $db;\n\n $app_query = \"\";\n if ($approved)\n $app_query = \" AND \" . tbl($this->gp_mem_tbl) . \".active='$approved'\";\n\n //List of fields we need from a user table\n $user_fields = get_user_fields();\n\n $user_fields = apply_filters($user_fields, 'get_group_members');\n\n $fields_query = '';\n\n foreach ($user_fields as $field)\n $fields_query .= ',' . tbl('users') . '.' . $field;\n\n $result = $db->select(tbl($this->gp_mem_tbl)\n . \" LEFT JOIN \" . tbl('users')\n . \" ON \" . tbl($this->gp_mem_tbl)\n . \".userid=\" . tbl('users') . \".userid\"\n , tbl($this->gp_mem_tbl) . \".*\" . $fields_query\n , \" group_id='$gid' $app_query\", $limit);\n\n\n\n if ($db->num_rows > 0)\n return $result;\n else\n return false;\n }", "public function getGroups() {\n\t\treturn array(\n\t\t\t'user_meta' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => 'Usage of users/usermeta tables is highly discouraged in VIP context, For storing user additional user metadata, you should look at User Attributes.',\n\t\t\t\t'object_vars' => array(\n\t\t\t\t\t'$wpdb->users',\n\t\t\t\t\t'$wpdb->usermeta',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'cache_constraints' => array(\n\t\t\t\t'type' => 'warning',\n\t\t\t\t'message' => 'Due to using Batcache, server side based client related logic will not work, use JS instead.',\n\t\t\t\t'variables' => array(\n\t\t\t\t\t'$_COOKIE',\n\t\t\t\t\t),\n\t\t\t\t'array_members' => array(\n\t\t\t\t\t'$_SERVER[\\'HTTP_USER_AGENT\\']',\n\t\t\t\t\t'$_SERVER[\\'REMOTE_ADDR\\']',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "public function userInGroup()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$group = FormUtil::getPassedValue('group', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($group == null) {\n\t\t\treturn self::retError('ERROR: No group passed!');\n\t\t}\n\n\t\t$uid = UserUtil::getIdFromName($uname);\n\t\tif($uid == false) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\tif($group == 'admin') {\n\t\t\tif(SecurityUtil::checkPermission('Owncloud::Admin', '::', ACCESS_MODERATE, $uid)) {\n\t\t\t\t$return = true;\n\t\t\t} else {\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$groups = UserUtil::getGroupsForUser($uid);\n\t\t\t$return = false;\n\t\t\tforeach($groups as $item) {\n\t\t\t\t$itemgroup = UserUtil::getGroup($item);\n\t\t\t\tif($itemgroup['name'] == $group) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "public function member_group_query($groups, $max = null, $start = 0)\n {\n $_groups = '';\n foreach ($groups as $group) {\n if ($_groups != '') {\n $_groups .= ' OR ';\n }\n $_groups .= 'u.usergroup=' . strval($group);\n }\n if ($_groups == '') {\n return array();\n }\n\n return $this->connection->query('SELECT * FROM ' . $this->connection->get_table_prefix() . 'users u LEFT JOIN ' . $this->connection->get_table_prefix() . 'usergroups g ON u.usergroup=g.gid WHERE ' . $_groups . ' ORDER BY u.usergroup ASC', $max, $start, false, true);\n }", "protected function readGroups() {\n\t\tif ($this->items) {\n\t\t\t$sql = \"SELECT\t\tuser_group.*, (SELECT COUNT(*) FROM wcf\".WCF_N.\"_user_to_groups WHERE groupID = user_group.groupID) AS members\n\t\t\t\tFROM\t\twcf\".WCF_N.\"_group user_group\n\t\t\t\tORDER BY\t\".($this->sortField != 'members' ? 'user_group.' : '').$this->sortField.\" \".$this->sortOrder;\n\t\t\t$result = WCF::getDB()->sendQuery($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$row['deletable'] = (!WCF::getUser()->getPermission('admin.user.canDeleteGroup') || Group::isMember($row['groupID']) || !Group::isAccessibleGroup($row['groupID']) || $row['groupType'] == Group::EVERYONE || $row['groupType'] == Group::GUESTS || $row['groupType'] == Group::USERS) ? 0 : 1;\n\t\t\t\t$row['editable'] = (WCF::getUser()->getPermission('admin.user.canEditGroup') && Group::isAccessibleGroup($row['groupID'])) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t$this->groups[] = $row;\n\t\t\t}\n\t\t}\n\t}", "function getGroups() {\n $groups = $this->groups;\n if (is_string($groups)) {\n $groups = explode(',', $groups);\n }\n return $groups;\n }" ]
[ "0.7976204", "0.7471614", "0.72242177", "0.71383363", "0.71382433", "0.7122522", "0.70754933", "0.69764465", "0.694652", "0.6891328", "0.6859492", "0.68249506", "0.6807395", "0.6805979", "0.6734159", "0.6714943", "0.6714702", "0.67120385", "0.6634768", "0.65869355", "0.65760905", "0.65459317", "0.6515814", "0.65145814", "0.6496813", "0.6484295", "0.64626265", "0.64626265", "0.64464945", "0.64295566", "0.6349778", "0.63244027", "0.63214594", "0.63201463", "0.63118476", "0.63082933", "0.6305774", "0.6287139", "0.62764335", "0.62644887", "0.62644887", "0.626187", "0.6252487", "0.6245186", "0.6234881", "0.623363", "0.62329876", "0.62297606", "0.62215096", "0.62198466", "0.61834526", "0.6163714", "0.61616313", "0.6161391", "0.61490875", "0.6148057", "0.61465096", "0.6137594", "0.61322373", "0.6124712", "0.6120986", "0.6118048", "0.6103581", "0.6100022", "0.6089646", "0.60771525", "0.60495996", "0.604436", "0.6038635", "0.60372084", "0.6022968", "0.6020621", "0.6012392", "0.5997057", "0.59774554", "0.5975729", "0.5972515", "0.5972377", "0.5957886", "0.59555674", "0.59555674", "0.5951978", "0.5941775", "0.5937694", "0.59331334", "0.5924064", "0.59201676", "0.5916044", "0.5910556", "0.59083927", "0.5904912", "0.59033215", "0.59031075", "0.58984977", "0.58983845", "0.5897411", "0.5897286", "0.58967566", "0.5893661", "0.5889125" ]
0.7236823
2
Get a list of public photos for the given user.
function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) { $params = array(); $params['method'] = 'flickr.people.getPublicPhotos'; $params['user_id'] = $user_id; $params['per_page'] = $per_page; $params['page'] = $page; $params['safe_search'] = $safe_search; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public static function get_photos_by_user($user_id) {\n\t\t$photos_array = array();\n\n\t\t$sql = \"SELECT * \n\t\t FROM photo_directory \n\t\t WHERE user_id = {$user_id}\n\t\t ORDER BY time_uploaded DESC;\";\n\t\t$photos_dbo = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($photos_dbo)) {\n\t\t\tarray_push($photos_array, $row);\n\t\t} \n\n\t\tglobal $firephp;\n\t\t$firephp->log('get_photos_by_user:');\n\t\t$firephp->log($photos_array);\n\t\treturn $photos_array;\n\t}", "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "public static function create_by_user_public($a_user_id){\n\n\t\t$request = self::_get_connection()->select(\"SELECT ID from `apine_images` where user_id=$a_user_id OR privacy=2\");\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "function get_user_images($user_id) {\n $images = DAO_user::DAO_fetch_user_images($user_id);\n if (is_array($images)) {\n $i = 0;\n $result = array();\n foreach ($images as $image) {\n $result[$i++] = $image;\n }\n return $result;\n }\n else return -1;\n }", "public function getPhotos();", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "public function getPhotos($userid)\n {\n $stmt = $this->con->prepare(\"SELECT id_foto, caminho, disciplina, dataCreate FROM tbl_foto WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $userid);\n $stmt->execute();\n $stmt->bind_result($id, $caminho, $disciplina, $data);\n $photos = array();\n\n while ($stmt->fetch()) {\n $photo = array();\n $photo['id'] = $id;\n $photo['caminho'] = $caminho;\n $photo['disciplina'] = $disciplina;\n $photo['userid'] = $userid;\n $photo['data'] = $data;\n array_push($photos, $photo);\n }\n\n $stmt->close();\n return $photos;\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function index(User $user)\n {\n $publications = $user->publications->fresh('images', 'conditions', 'categories');\n\n $aux = $publications->sortByDesc('created_at');\n\n return $this->showAll($aux);\n }", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "function getPhotosOfUser($idUser){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$tab = new Data();\r\n\t\t$r = mysql_query(\"select login from Utilisateur where id_user = \" . $idUser);\r\n\r\n\t\tif(mysql_num_rows($r) == 0){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\t\t$name = mysql_result($r,0,0);\r\n\t\t$connectService->close();\r\n\t\tif(!is_dir(\"../v2.0/espace/\" . $name . \"/photos/sd\")){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\r\n\t\t$tab->addInfo(\"root\",\"../v2.0/espace/\" . $name . \"/photos\");\r\n\t\t$tab->addInfo(\"photos\",$this->getPhotosOfDir($tab->getInfo(\"root\")));\r\n\t\t$tab->addInfo(\"type\",\"scan\");\r\n\r\n\t\treturn $tab;\r\n\t}", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }", "public function getAllPhotos();", "public static function print_photos_by_user($user_id) {\n\t\t$photos_array = self::get_photos_by_user($user_id);\n\t\tforeach ($photos_array as $photo) {\n\t\t\techo '\n\t\t\t\t<div class=\"photo\">\n\t\t\t\t\t<a href=\"photobooth.php?photo_id=' . $photo['photo_id'] . '\" class=\"fancybox.ajax fancybox\" rel=\"profile-gallery\">\n\t\t\t\t\t\t<div class=\"imgContainer\">\n\t\t\t\t\t\t\t<img class=\"imgImg\" src=\"../../photos-thumbnails/' . Photo::get_photo_path($photo['photo_id']) . '\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t</div>';\n\t\t}\n\t}", "public static function get_image($user_id);", "public function getUserProfilePhotos(int $user_id, int $offset = 0, int $limit = 100)\n {\n return current($this->sendRequest('GET', 'getUserProfilePhotos', [\n 'user_id' => $user_id\n ]));\n }", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "public function getPhoto($userId, $size);", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function get_images( $id_element = \"\", $user_login = \"\", $public_only = true, $format = JSON ) \n\t{\n\t\t// TODO: add temporal boundaries\n\t\t$elements = $this->dvdb->get_elements( $id_element, $user_login, $public_only );\n\t\t$this->last_images = array();\n\n\t\t$index = 0;\n\t\tforeach ($elements as $element) {\n\t\t\tif ( !empty($element->filename) ) {\n\t\t\t\t$img_src = ABSDOMAIN.UPLOAD_FOLDER.\"/\".$element->filename.\".\".$element->ext;\n\t\t\t\t$img_thumb_src = ABSDOMAIN.UPLOAD_FOLDER.\"/\".$element->filename.\"-\".THUMB_SUFFIX.\".\".$element->ext;\n\t\t\t\t\n\t\t\t\t$this->last_images[$index]['id_element'] = $element->id_element;\n\t\t\t\t$this->last_images[$index]['is_public'] = $element->is_public;\n\t\t\t\t$this->last_images[$index]['name'] = $img_src;\n\t\t\t\t$this->last_images[$index]['thumb'] = $img_thumb_src;\n\t\t\t\t$index++;\n\t\t\t}\n\t\t}\n\t\tif( $format == JSON ) {\n\t\t\treturn json_encode( $this->last_images );\n\t\t} else {\n\t\t\treturn $this->last_images;\n\t\t}\n\t}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getFilesCurrentUser(User $user)\n {\n }", "public function getPins($user, $storeLocally = false) {\n\n $pagenum = 1;\n $content = \"\";\n $pinterestDir = \"\";\n\n if ($storeLocally) {\n // remove all existing pins\n $pinterestDir = __DIR__ . '/pins/';\n $this->rrmdir($pinterestDir); \n }\n \n // the last page of content contains the string noResults \n while (strpos($content, \"noResults\") == FALSE) {\n $content .= file_get_contents(\"http://pinterest.com/$user/pins/?lazy=1&page=$pagenum\");\n $pagenum++;\n }\n preg_match_all('#\\bhttps?://[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/))#', $content, $matches);\n $matches = $matches[0];\n\n $pins = array();\n foreach ($matches as $pin) {\n\n $tmp = strpos($pin, \"550x\");\n if ($tmp !== FALSE) {\n\n if ($storeLocally) {\n // download and store pin\n // $pinterestDir = __DIR__;\n $imageName = basename($pin);\n $imageFullPath = $pinterestDir . $imageName;\n if (!file_exists($imageFullPath)) {\n file_put_contents($imageFullPath, file_get_contents($pin));\n }\n \n $pin = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];\n $pin = substr($pin,0, strrpos($pin, '/')+1);\n $pin .= 'pins/';\n $pin .= $imageName;\n }\n\n $pins[] = $pin;\n }\n }\n\n sort($pins);\n $pins = array_unique($pins); \n \n return $pins;\n }", "function getImages() {\n $bdd = getBdd();\n $users = $bdd->query('select IMG_PATH as path,'\n . ' USER_ID as user_id, REV_ID as rev_id'\n . ' from T_IMAGES')->fetchAll(PDO::FETCH_ASSOC);\n return $users;\n}", "public function getUserProfilePhotos($datas = [])\r\n {\r\n return $this->telegram(\"getUserProfilePhotos\", $datas);\r\n }", "public function getList($user);", "public function userIndex()\n {\n return SongResource::collection(Song::where('user_id', auth()->id())->where('uploaded_by', 'user')->orderBy('created_at', 'desc')->get());\n }", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "public function getUserPhoto($iduser){\n //convert the $id to integer\n $iduser = intval($iduser);\n\n $userinfo = DB::connection('mongodb')->collection('userinformations')\n ->project(['_id' => 0])\n ->select('profilephoto')\n ->where('iduser', '=', $iduser)\n ->get();\n if($userinfo) {\n foreach($userinfo as $new){\n return $new;\n }\n \n } else {\n return 'no photo';\n }\n \n }", "public function getPhotos($page, $itemsPerPage);", "public function getPhotos()\n {\n return $this->photos;\n }", "public function index(User $user)\n {\n $files = File::all();\n return $this->showAll($files);\n }", "public function global_get_photos($id, $type = 'user',$user_id=null, $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->global_get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n // echo'<pre>'; print_r($user_id);die;\n if(!empty($user_id)){\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s And posts.user_id= %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($user_id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }else{\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }\n \n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "public function index($start, $limits)\n {\n return response()->json( Gallery::UserPhotos($start, $limits), 200);\n }", "public function index()\n {\n //\n $id = Auth()->user()->id;\n $photos = Picture::where('user_id', '=', $id )->latest()->get();\n\n $result = $photos->map(function($photo){\n return [\n \"user_id\" => $photo->user_id,\n \"title\" => $photo->title,\n \"photos\" => $photo->photos\n ];\n });\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Records fetched successfully\",\n \"data\" => $result\n ],StatusCodes::SUCCESS);\n }", "public function index(User $user) {\n $files = $user->account->files()\n ->orderBy('type', 'desc')\n ->orderBy('name')\n ->get();\n\n return response()->json([\n 'success' => true,\n 'files' => $files,\n ]);\n }", "function getUserImages($user_id) {\n\n \n $sql = \"select name from images where user_id = :user_id\";\n try {\n $stmnt = $this->conn->prepare($sql);\n $params = [\n 'user_id' => $user_id\n ];\n $stmnt->execute($params);\n\n while ($row = $stmnt->fetch()) {\n echo <<<HTM\n \n <div class=\"gallery_product col-lg-4 col-md-4 col-sm-4 col-xs-6 filter hdpe\">\n <img src=\"img/{$row['name']}\" class=\"img-responsive\">\n </div>\n \nHTM;\n \n }\n \n }\n \n Catch (PDOException $e) {\n $e = new ErrorView([\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ]);\n }\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function getAllPublicPhotosJson(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0';\n $photos = $this->executeQuery($sql);\n while ($photo = $photos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $photo;\n }\n $photosJson = json_encode($data);\n echo $photosJson;\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function getUserimages()\n {\n return $this->hasMany(Userimage::className(), ['user_id' => 'id']);\n }", "public static function create_by_user_folder_public($a_user_id, $a_folder){\n\n\t\t$request_id = self::_get_connection()->prepare(\"SELECT ID from `apine_images` where ( user_id=? AND folder=? ) OR ( privacy=2 AND folder=? )\");\n\t\t$request = self::_get_connection()->execute(array(\n\t\t\t\t\t\t$a_user_id,\n\t\t\t\t\t\t$a_folder,\n\t\t\t\t\t\t$a_folder\n\t\t), $request_id);\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "public function index()\n {\n return Photo::get();\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function fetchImageForUser($user, $where = null);", "public function getFullObjects(UserGroup $userGroup)\n {\n $images = $userGroup->getAssignedObjects(self::OBJECT_TYPE);\n $galleries = $userGroup->getAssignedObjects(Gallery::OBJECT_TYPE);\n $albums = $userGroup->getAssignedObjects('nggAlbum');\n\n foreach ($albums as $albumId => $albumType) {\n $albumPictures = $this->nextGenGallery->find_images_in_album($albumId);\n }\n\n foreach ($galleries as $galleryId => $galleryType) {\n $galleryImages = $this->nextGenGallery->getImagesByGallery($galleryId);\n }\n\n return $images;\n }", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function index()\n {\n // Favorite users photos area\n $PopularPhotos = $this->homeService->getPopularPhotos();\n\n $Top = $PopularPhotos[0];\n $Others = array_slice($PopularPhotos->toArray(), 1);\n\n // Top User Information\n $TopUserPhotos = $this->photoService->getPhotosById($PopularPhotos[0]->user_id, false)->items();\n\n // Random photos area\n $RandomPhotos = $this->homeService->getRandomPhotos();\n\n // New Members photos area\n $NewMembers = $this->homeService->getNewMembersPhotos();\n\n //RankedUsers PopularPhotos\n return compact('TopUserPhotos','RandomPhotos','NewMembers','Top','Others');\n }", "public function getUserFiles()\n {\n $user_files = Helper::getUserFiles();\n return $user_files;\n }", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function get_photos($id, $type = 'user', $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n $query = sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false));\n $get_photos = $db->query($query) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "function get_data_for_user( $user_id = null, $type = null ) {\n\t$allowed_types = [ 'beers', 'photos' ];\n\n\tif ( is_null( $user_id ) || ! in_array( $type, $allowed_types, true ) ) {\n\t\treturn [];\n\t}\n\n\t/**\n\t * Get user beers\n\t */\n\tif ( $type !== 'photos' ) {\n\t\t$cpt = substr( $type, 0, -1 );\n\n\t\t$items = get_posts( [\n\t\t\t'post_type' => $cpt,\n\t\t\t'author' => (int) $user_id,\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => 9999,\n\t\t] );\n\n\t\tif ( ! is_wp_error( $items ) && ! empty( $items ) ) {\n\t\t\treturn $items;\n\t\t}\n\t}\n\n\t/**\n\t * Get photos (WP medias)\n\t */\n\telse {\n\t\t$items = get_posts( [\n\t\t\t'post_type' => 'attachment',\n\t\t\t'author' => (int) $user_id,\n\t\t\t'posts_per_page' => 9999,\n\t\t] );\n\n\t\tif ( ! is_wp_error( $items ) && ! empty( $items ) ) {\n\t\t\treturn $items;\n\t\t}\n\t}\n\n\treturn [];\n}", "public static function getUserProfilePhotos(array $data)\n {\n if (empty($data)) {\n throw new TelegramException('Data is empty!');\n }\n\n if (!isset($data['user_id'])) {\n throw new TelegramException('User id is empty!');\n }\n\n return self::send('getUserProfilePhotos', $data);\n }", "public function gallery()\n {\n $photos = User::find(Auth::id())->photos()->latest()->paginate(10);\n// dd($photos);\n return view('user.gallery', compact('photos'));\n }", "public function getImages(Request $request)\n\t{\n\t\t$response = Image::all($request);\n\t\t\n\t\tforeach($response['records'] as &$row) {\n\t\t\t$row['rel'] = [\n\t\t\t\t'pages' => sprintf('#visibility', $row['url_hash']),\n\t\t\t];\n\t\t}\n\n\t\treturn $this->response($response, 'images', $request);\n\t}", "public function list_owned_files() {\n $stmt = $this->pdo->prepare('select filename from file where user_id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, $f['filename']);\n }\n return $result;\n }", "function getDemandesPhotosHD(){\r\n $users = $this->dao->getDemandesPhotosHD();\r\n $jsonBuilder = new JSONBuilder();\r\n echo $jsonBuilder->set(\"users\",$users)->build();\r\n }", "public function getImageByTag(string $userTags = '*', int $userQuantity = 5, int $userPage = 1) : array\n {\n // ---------------------------------------------------------------------------------------\n\n # To beginning, we clean all arguments send by the user\n $cleaner = new ArgumentCleaner;\n $tagArg = 'q='.$cleaner->cleanUserTags($userTags);\n $quantityArg = 'perpage='.$cleaner->cleanUserQuantity($userQuantity);\n $pageArg = 'page='.$cleaner->cleanUserPage($userPage);\n\n # after, we send a request to the website to get a json file with each time all data of an image\n $completeUrl = self::protocol.'://'.self::domainName.'/'.self::searchAction.'/?'.$tagArg.'&'.$quantityArg.'&'.$pageArg;\n $siteResponse = file_get_contents($completeUrl);\n $responseDecoded = json_decode($siteResponse, 1);\n\n # Finaly, we go through the array to get all image link and we return the result\n $mediaList = [];\n foreach ($responseDecoded['search'] as $search) {\n $media = new Media();\n $media->setUrl($search['image']);\n $media->setType(strpos($media->getUrl(), '.webm') ? 'movie' : 'image');\n $mediaList[] = $media;\n }\n return $mediaList;\n }", "public function getImages()\n {\n $url = str_replace(\"[:action]\", \"images\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_images = '';\n foreach ($result['data'] as $item) {\n $_img = new ImgUrImage();\n $_img->setAttributes($item);\n $_images[] = $_img;\n }\n\n return $_images;\n }", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "function getFilesByUserId($user_id) {\r\n $sql = '\r\n SELECT\r\n *\r\n FROM\r\n files\r\n WHERE\r\n user_id = ?\r\n ORDER BY\r\n uuid DESC\r\n ';\r\n\r\n return $this->query_result($sql, array($user_id));\r\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "function getUserRatings($user_id, $offset = 0, $limit = 25) {\n\n /* getting all published ratings from user */\n if (!$ratings = Ratings::getUserRatings($user_id, $offset, $limit))\n return false;\n /* foreach rating if it have photo, we must get photo thumbnails */\n foreach ($ratings as $key => $rating) {\n if (!empty($rating['photo_name'])) {\n $ratings[$key]['photo_thumbnails'] = ImagesManager::getMealPhotoThumbnails($rating['meal_id'], $rating['photo_name']);\n }\n unset($ratings[$key]['cur_meal_id']);\n }\n\n return $ratings;\n }", "public function index()\n {\n $userP = ProductsPhoto::where('public',1)->get();\n return view('home',array('userP' =>$userP));\n }", "public function index()\n {\n $this->authorize('viewAny', User::class);\n //response genrated by query builder\n $users = QueryBuilder::for(User::class)\n ->allowedIncludes('images')\n ->allowedFilters('email')\n ->get();\n return response()->json(['scuess' => true, 'users' => $users, \"code\" => $this->successStatus], $this->successStatus);\n }", "protected function getPhoto($id){\n try{\n $query = \"Select users.photo From users Where users.id = ?\";\n $stmt = $this->getConnection($query);\n $stmt -> bind_param('i', $id);\n $stmt -> execute();\n $stmt -> bind_result($photo);\n $stmt->fetch();\n $userPhoto[] = array(\n 'photo' => $photo\n );\n $stmt -> close();\n\n return $userPhoto;\n }catch (Exception $e){\n die('Error - cannot get user photo: ' . $e -> getMessage());\n }\n }", "public function getPhoto($userId, $size)\n {\n $response = $this->client->get(\n sprintf('/v2/user/%s/photo/%s', $userId, $size)\n );\n\n return $response;\n }", "public static function create_by_user($a_user_id){\n\n\t\t$request = self::_get_connection()->select(\"SELECT ID from `apine_images` where user_id=$a_user_id\");\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "private function get_user_favorite_publics(){\r\n global $USER;\r\n\r\n if(isset($USER) && $USER->id > 0) {\r\n $publics = new PublicsByFunctionUser($USER->id, $this->tab);\r\n if($this->tab == 'formation'){\r\n return $publics->get_favorite_formation_publics();\r\n } else {\r\n return $publics->get_favorite_course_publics();\r\n }\r\n }\r\n return false;\r\n }", "public function index()\n\t{\n\t\tif(Auth::user()){\n\t\t\t\n\t\t\t$photos = Photo::all();\n\n\t\t\treturn View::make('photos.index')->with(array('photos' => $photos));\n\n\t\t}\n\t\n\t\t\n\t}", "public function index()\n {\n //\n return response()->json(Auth::user()->files);\n }", "function getUserPhotoAlbums($user_id=null,$profile_picture_album=false){\r\n\t\tif($user_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('user_id'=>$user_id));\r\n\t\tif($profile_picture_album==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('title'=>PROFILE_PICTURES));\t\t\r\n\t\t}\r\n\t\t$recordSet = $this->db->get(TBL_PHOTO_ALBUMS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function user_profile_pictures( $profileuser ) {\n\t\t$user = new User_Pictures( $profileuser->data->ID );\n\t\t$pictures = $user->get_pictures();\n\t\t$primary_picture_id = $user->get_primary();\n\t\t?>\n\n\t\t<h2><?php _e( 'Profile Pictures', 'bwcpp' ); ?></h2>\n\n\t\t<table class=\"form-table\" role=\"presentation\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<th><?php _e( 'Uploaded Profile Pictures', 'bwcpp' ); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php foreach ( $pictures as $picture ) : ?>\n\t\t\t\t\t\t\t<img src=\"<?php echo $picture['url']; ?>\" width=\"96\" style=\"margin-right: 5px;<?php echo ( $picture['id'] === $primary_picture_id ) ? ' border: 3px solid red;' : ''; ?>\">\n\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t<?php\n\t}", "public function getUserProfilePhotos(int $user_id, int $limit = null, int $offset = null): Request\n {\n return $this->request('getUserProfilePhotos', [\n 'user_id' => $user_id,\n 'limit' => $limit,\n 'offset' => $offset,\n ]);\n }", "function getPictures($fb, $ids) {\n $fql = \"SELECT uid, pic_square FROM user WHERE uid IN (\" . implode(\",\", $ids) . \")\";\n \n $response = $fb->api(array(\n 'method' => 'fql.query',\n 'query' => $fql,\n ));\n \n $picture_by_id = array();\n foreach ($response as $r) {\n $picture_by_id[$r['uid']] = $r['pic_square'];\n }\n \n return $picture_by_id;\n}", "public function list_shared_files_with() {\n $stmt = $this->pdo->prepare('select filename, name from share s, user u, file f where s.user_id = :id and s.owner_id = u.id and s.file_id = f.id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, array('filename' => $f['filename'],\n 'username' => $f['name']));\n }\n return $result;\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function index()\n {\n $photos = Photo::where('is_private',1)->paginate(9);\n return view('home',compact('photos'));\n \n }", "public function getProfileGallery($uid){\n\t\t/* Needs to return the profile album media for the given user */\n\t}", "public function getUserImages() {\n $user = UserMaster::findOne(Yii::$app->user->id);\n if ($user->proImg != '' || $user->proImg != NULL) {\n $userImg = Yii::$app->request->baseUrl . \"/themes/assets/images/userImages/img/default-user-img.jpg\";\n } else {\n $userImg = Yii::$app->request->baseUrl . \"/themes/assets/images/userImages/img/default-user-img.jpg\";\n }\n return $userImg;\n }", "public function getAuthenticatedEmotes($user) { \r\n return $this->makeRequest('get', \"/users/{$user}/emotes\");\r\n }", "public function getUserAlbums($user_id, $start, $page_size) {\n $query_params = array(\n 'columns' => 'id, name, description',\n 'where' => 'user_id = ?',\n 'orderby' => 'create_date DESC',\n 'limit' => '?, ?'\n );\n \n $bind_params = array($user_id, $start, $page_size);\n $albums = $this->find($query_params, $bind_params);\n \n return $albums;\n }", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function getPhotos($id)\n {\n $gallery = Gallery::with('photos')->find($id);\n\n $photos = $gallery->photos;\n\n $photoarr = [];\n\n foreach($photos as $photo) {\n $photoarr[] = [\n 'server' => $photo->filename,\n 'size' => app('files')->size(public_path('uploads/photos/' . $photo->filename)),\n 'imageurl' => asset('uploads/photos/thumbs/' . $photo->filename)\n ];\n }\n return response()->json([\n 'photos' => $photoarr\n ]);\n }" ]
[ "0.81467324", "0.7285678", "0.7243038", "0.71633863", "0.7110668", "0.6900005", "0.6805384", "0.66844726", "0.66733015", "0.66701645", "0.665343", "0.66399693", "0.6600413", "0.65600675", "0.6483653", "0.6461635", "0.64439166", "0.6395105", "0.6332279", "0.6315035", "0.6309733", "0.6302908", "0.62626445", "0.62108433", "0.61762685", "0.6172985", "0.61502725", "0.61139274", "0.61105996", "0.61009675", "0.60858715", "0.60839206", "0.6065851", "0.60550624", "0.60444635", "0.6040881", "0.6034019", "0.6021363", "0.60140043", "0.6003241", "0.6000697", "0.5948501", "0.5941646", "0.59263873", "0.5910488", "0.5909002", "0.59077066", "0.5896419", "0.5863429", "0.5837219", "0.5817955", "0.58160394", "0.57933646", "0.5791796", "0.5791088", "0.57788885", "0.57757384", "0.57724845", "0.576495", "0.5762332", "0.5761367", "0.57549953", "0.57512456", "0.5746165", "0.57452226", "0.57441384", "0.57427245", "0.5740353", "0.57352835", "0.5675089", "0.5671179", "0.56661105", "0.56637883", "0.5662886", "0.5641218", "0.5633957", "0.5621202", "0.5609762", "0.55998373", "0.55975705", "0.55928487", "0.55848414", "0.5579647", "0.55787814", "0.55782557", "0.55770147", "0.55759084", "0.5575398", "0.55740833", "0.5567215", "0.5559991", "0.5554297", "0.55471885", "0.554375", "0.55422187", "0.5540749", "0.55390435", "0.55362535", "0.55356723", "0.5522555" ]
0.80440164
1
Returns information for the calling user related to photo uploads.
function people_getUploadStatus () { $response = $this->execute(array('method' => 'flickr.people.getUploadStatus')); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['user']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserInfo() {\n\t\t$userInfo = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => USERINFO,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'user_id' => $this->photo['owner'],\n\t\t\t));\n\t\treturn unserialize($userInfo->body);\n\t}", "public function getUserPhoto() {\n $response = $this->_connectAndGrabUserData();\n\n if($response && isset($response['picture']) && $response['picture']) {\n return $response['picture'];\n }\n\n return false;\n }", "public function getUserId()\n {\n return $this->fileStructure->uid;\n }", "public function getUserId() {\n\t\treturn (string) $this->photo->owner['nsid'];\n\t}", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "public function getProfilePicture()\n\t{\n\t\treturn $this->info['profile_picture'];\n\t}", "public function getPhotoSender(){\n return $this->photoSender;\n }", "public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }", "public function getProfilePicture();", "public function GetUserPhoto($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function getUserInformation()\n {\n return $this->userInformation;\n }", "function getUserInformation(){\n\t\tinclude ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/getUserInformation.fb.inc.php');\n return $this->resObject;\n\t}", "public function picture_url() {\n return $this->_adaptee->user_photo(\"\", true);\n }", "public static function getInfo($selected_uid) {\n\t$sql=<<<EOM\n\t select username, profile_fields as image\n\t from users\n\t where id = '$selected_uid'\n\t limit 1;\nEOM;\n $query = DB::query($sql);\n $result = $query->execute();\n return $result[0];\n }", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function getProfilePictureFile()\n {\n return $this->profile_picture_file;\n }", "public function getProfilePicture()\n {\n return $this->profilePicture;\n }", "function getUserInfo()\n {\n return $this->userinfo;\n }", "public function getAvatarUploadMeta()\n {\n return $this->avatarUploadMeta;\n }", "private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }", "public function getUserInfo ()\n\t{\n\t\t$info[\"id\"]\t\t\t\t\t\t= $this->id;\t\t\t\t\t//The unique id of the user in the database\n\t\t$info[\"user_id\"] \t\t\t\t= $this->userId;\t\t\t\t//The id of the user includes API id's\n\t\t$info[\"email\"]\t\t\t\t\t= $this->email;\t\t\t\t\t//The email of the user\n\t\t$info[\"description\"]\t\t\t= $this->description;\t\t\t//The description of the user\n\t\t$info[\"location\"]\t\t\t\t= $this->location;\t\t\t\t//The location of the user\n\t\t$info[\"first_name\"]\t\t\t\t= $this->firstName;\t\t\t\t//The first name of the user\n\t\t$info[\"last_name\"]\t\t\t\t= $this->lastName;\t\t\t\t//The last name of the user\n\t\t$info[\"name\"]\t\t\t\t\t= $this->fullName;\t\t\t\t//The full name of the user\n\t\t$info[\"username\"]\t\t\t\t= $this->username;\t\t\t\t//The username of the user\n\t\t$info[\"type\"]\t\t\t\t\t= $this->type;\t\t\t\t\t//The type of user registration\n\t\t$info[\"thumbnail\"]\t\t\t\t= $this->thumbnail;\t\t\t\t//The user's image thumbnail\n\t\t$info[\"gender\"]\t\t\t\t\t= $this->gender;\t\t\t\t//The gender of the user\n\t\t$info[\"num_calendars\"]\t\t\t= $this->numCalendarsCreated;\t//The number of calendars the user has created\n\t\t$info[\"num_followed_calendars\"]\t= $this->numCalendarsFollowed;\t//The number of calendars the user is following\n\t\t$info[\"primary_calendar\"]\t\t= $this->primaryCalendar;\t\t//The primary calendar that a user is using\n\t\t\n\t\treturn $info;\n\t}", "public function onUserProfilePhotoUpload($event)\n {\n\t\tif(Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album'))\n\t\t\treturn;\n $payload = $event->getPayload();\n if( empty($payload['user']) || !($payload['user'] instanceof Core_Model_Item_Abstract) ) {\n return;\n }\n if( empty($payload['file']) || !($payload['file'] instanceof Storage_Model_File) ) {\n return;\n }\n $viewer = $payload['user'];\n $file = $payload['file'];\n // Get album\n $table = Engine_Api::_()->getDbtable('albums', 'sesalbum');\n $album = $table->getSpecialAlbum($viewer, 'profile');\n $photoTable = Engine_Api::_()->getDbtable('photos', 'sesalbum');\n $photo = $photoTable->createRow();\n $photo->setFromArray(array(\n 'owner_type' => 'user',\n 'owner_id' => Engine_Api::_()->user()->getViewer()->getIdentity()\n ));\n $photo->save();\n $photo->setPhoto($file);\n $photo->album_id = $album->album_id;\n $photo->save();\n if( !$album->photo_id ) {\n $album->photo_id = $photo->getIdentity();\n $album->save();\n }\n $auth = Engine_Api::_()->authorization()->context;\n $auth->setAllowed($photo, 'everyone', 'view', true);\n $auth->setAllowed($photo, 'everyone', 'comment', true);\n $auth->setAllowed($album, 'everyone', 'view', true);\n $auth->setAllowed($album, 'everyone', 'comment', true);\n $event->addResponse($photo);\n }", "function getPhotoInfo($photoId);", "public function getUserInfo($uid) {\n // get user avatar information of song adder\n $_user_nickname = '';\n $_user_avatar_url = '';\n if (!empty(Yii::app()->params['user_default_setting']) && is_array(Yii::app()->params['user_default_setting'])) {\n $_user_nickname = Yii::app()->params['user_default_setting']['nickname'];\n $_user_avatar_url = Yii::app()->createAbsoluteUrl('//') . '/avatar/' . Yii::app()->params['user_default_setting']['avatarurl'];\n }\n $_user = PlatformUser::model()->findByPk($uid);\n if (!is_null($_user)) {\n $_auth_type = strtoupper($_user['auth_type']);\n if (in_array($_auth_type, $this->_other_auth_types)) {\n $_user_nickname = '';\n $_user_avatar_url = '';\n } else if ($_auth_type == ApiController::DEFAULT_AUTH_TYPE) {\n $_user_nickname = empty($_user->display_name) ? $_user_nickname : $_user->display_name;\n $_user_avatar_url = '';\n } else {\n $_user_nickname = empty($_user->display_name) ? $_user_nickname : $_user->display_name;\n $_user_avatar_url = empty($_user->avatar_url) ? $_user_avatar_url : $_user->avatar_url;\n }\n } else {\n $_user_nickname = '';\n $_user_avatar_url = '';\n }\n\n return array('uid' => intval($uid), 'nickname' => $_user_nickname, 'avatarurl' => $_user_avatar_url);\n }", "public function getPhotoFile()\n {\n return $this->photoFile;\n }", "public function profile(){\n // using the auth() helper we are returning the authenticated user info\n return auth('api')->user();\n }", "public function getUserProfile();", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo() {}", "abstract public function getUserInfo();", "public function getUser(){\r\n\t\treturn $this->facebook_obj->getUser();\r\n\t}", "public function getAvatar()\n {\n // so that updated images happen when users change their avatar. Also fixes #9822\n if (!isset($this->data['avatar'])) {\n $ui = app(UserInfoRepository::class)->getByID($this->data['id']);\n if ($ui) {\n $this->data['avatar'] = $ui->getUserAvatar()->getPath();\n }\n }\n return $this->data['avatar'];\n }", "public function getUserId()\r\r\n {\r\r\n return $this->signedRequest ? $this->signedRequest->getUserId() : null;\r\r\n }", "public function getUploader()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\treturn $sfUsers::fetchUser($this->uploader);\n\t}", "public function getAvatar()\n {\n return $this->user['avatar'];\n }", "public function getAuthUserDetail()\n {\n return $this->user;\n }", "public function get_user_info()\n\t{\n\t\tif ( function_exists('wp_remote_get') ) {\n\t\t\t$json = wp_remote_get($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json['body'], true);\n\t\t} else {\n\t\t\t$json = @file_get_contents($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json, true);\n\t\t}\n\t\t\n\t\treturn $user_info['resp'];\n\t}", "public function getPhotoFile()\n\t{\n\t\treturn $this->photo_file;\n\t}", "public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}", "public function getCurrentUser(){\n\t\t$cm = \\OC::$server->getContactsManager();\n\t\t// The API is not active -> nothing to do\n\n\t\t$result = $cm->search(\\OCP\\User::getUser(), array('FN'));\n\t\t$r = $result[0];\n\t\t$data = array();\n\t\t$data['id'] = $r['id'];\n\t\t$data['displayname'] = $r['FN'];\n\t\tif(!isset($r['EMAIL'])){\n\t\t\t$r['EMAIL'] = array();\n\t\t}\n\n\t\tif(!isset($r['IMPP'])){\n\t\t\t$r['IMPP'] = array();\n\t\t}\n\t\t$data['backends'] = $this->contactBackendToBackend($r['EMAIL'], $r['IMPP']);\n\t\tlist($addressBookBackend, $addressBookId) = explode(':', $r['addressbook-key']);\n\t\t$data['address_book_id'] = $addressBookId;\n\t\t$data['address_book_backend'] = $addressBookBackend;\n\t\treturn $data;\n\t}", "final public function getUserPhoto() {\r\n\t\treturn new FeaturedImage($this->wrappedTopic, 'photo|featured');\r\n\t}", "public function get_avatar()\n\t{\n\t\treturn $this->user_loader->get_avatar($this->get_data('from_user_id'));\n\t}", "public function getUserAvatar(){\n return($this->userAvatar);\n }", "public function user_info() {\n if ($this->rails_cookie_value() == NULL) {\n return null;\n }\n if (!self::$user_info && !self::$user_info_called) {\n $json_data = $this->api_request(\"user/\" . $this->rails_cookie_value());\n self::$user_info = $json_data->{'user'};\n self::$user_info_called = true;\n }\n return self::$user_info;\n }", "public function get_user_info()\n {\n try {\n $user_info = self::api(\"me\");\n } catch (Exception $e) {\n // TODO: Handle the error\n // Set the return value to be an empty array\n $user_info = array();\n }\n\n return $this->convert_array_to_object($user_info);\n }", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function getAvatar()\n {\n return $this->getProfilePicture();\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }", "function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }", "public function getUserPhoto($photoType = 'square')\r\n \t{\r\n \t\t// check for photoType\r\n \t\tif (!in_array($photoType, array('square', 'small', 'normal', 'large')))\r\n \t\t{\r\n \t\t\t$photoType = 'square';\r\n \t\t}\r\n\r\n \t\tif (null === $userid)\r\n \t\t{\r\n \t\t\t$picture = $this->_client->api('/me', 'GET', array('fields' => 'picture', 'type' => $photoType));\r\n \t\t\treturn ($picture) ? $picture['picture']['data']['url'] : null;\r\n \t\t}\r\n \t\treturn null;\r\n\t}", "public function getProfile()\n {\n return $this->request('me');\n }", "public function getPhoto() {\n if(isset($this->photo) && !empty($this->photo)) {\n return Yii::getAlias('@web'). '/' . $this->photo;\n }\n return Yii::$app->params['defaultProfileImage'];\n }", "public function owner()\n\t{\n\t\treturn array('url' => Route::url('user.profile', array('id' => $this->owner['id'])), 'username' => $this->owner['username']);\n\t}", "public function getSpotifyProfilePicture()\n {\n return $this->spotifyProfilePicture;\n }", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "function getUserProfile()\n\t{\n\t\t// ask kakao api for user infos\n\t\t$data = $this->api->api( \"user/me\" ); \n \n\t\tif ( ! isset( $data->id ) || isset( $data->error ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an invalid response.\", 6 );\n\t\t}\n\n\t\t$this->user->profile->identifier = @ $data->id; \n\t\t$this->user->profile->displayName = @ $data->properties->nickname;\n\t\t$this->user->profile->photoURL = @ $data->properties->thumbnail_image;\n\n\t\treturn $this->user->profile;\n\t}", "public function getUserInfo()\n {\n $request = new Resource('GET', 'https://api.dropbox.com/1/account/info', array(\n 'oauth_consumer_key' => $this->consumer->client_id,\n 'oauth_token' => $this->token->access_token,\n ));\n\n // Sign the request using the consumer and token\n $request->sign($this->signature, $this->consumer, $this->token);\n\n $user = json_decode($request->execute());\n\n // Create a response from the request\n return array(\n 'uid' => $this->token->uid,\n 'name' => $user->display_name,\n 'email' => $user->email,\n 'location' => $user->country,\n );\n }", "public function getUserInfo()\r\n {\r\n return self::makeCall('getUserInfo', array(), null, false, $this->sessionID);\r\n }", "protected function getUser()\n {\n $user = $this->formatUser();\n\n // If no user is to be returned, Vanilla expects name and photourl\n // with empty values\n if (empty($user)) {\n return [\n 'name' => '',\n 'photourl' => '',\n ];\n }\n\n // When no signature and timestamp is sent, only return public information\n if (! $this->request->has('timestamp') && ! $this->request->has('signature')) {\n return [\n 'name' => $user['name'],\n 'photourl' => @$user['photourl'],\n ];\n }\n\n // If security is disabled (when running the SSO in test mode for instance)\n // the user is returned with all information, but without signing the\n // data set.\n if ($this->secure === null) {\n return $user;\n }\n\n // Return the complete user with signed data set\n return $this->sign($user, $this->secure, true);\n }", "public function viewPhoto(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $user_id = $user['id'];\n $items = [];\n\n if(null !== $this->request->getQuery('id')){\n $q_r = $this->{$this->main_model}->find()->where(['id' => $this->request->getQuery('id')])->first();\n\n if($q_r){\n $items['photo_file_name'] = $q_r->photo_file_name;\n }\n }\n\n $this->set([\n 'data' => $items, //For the form to load we use data instead of the standard items as for grids\n 'success' => true,\n '_serialize' => ['success','data']\n ]);\n }", "function fc_get_jomSocial_avatar(){\r\n\t$user =& CFactory::getUser($userid);\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getThumbAvatar());\r\n}", "function profile_info() {\n $parameters = array(\n 'method' => __FUNCTION__\n );\n return $this->get_data($parameters);\n }", "function get_currentuserinfo()\n {\n }", "public function getInfo_Raw()\n {\n $raw = $this->provider->makeQuery('SELECT '.implode(',', self::_getUserFacebookFieldsMap()).' FROM user WHERE uid = me()');\n lmb_assert_true(count($raw));\n return $raw[0];\n }", "public static function GetUserInfo()\n\t{\n\t\t$userID = self::GetUserID();\n\t\t// TODO: Use cURL for this, requires server config\n\t\treturn json_decode(file_get_contents(\"http://graph.facebook.com/${userID}\"));\n\t}", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "function form_upload_picture() {\n $user = $this->ion_auth->user()->row();\n $this->load->view('portofolio/form_update_foto', $user);\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function photographer()\n {\n if (! isset($this->photographer)) {\n $this->photographer = User::find($this->user['username']);\n }\n\n return $this->photographer;\n }", "public function getOwner()\n {\n return $this->data['owner'];\n }", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function getUserInfo()\n {\n }", "public function getUserData()\r\n \t{\r\n \t\tif ($this->_client->getUser())\r\n \t\t{\r\n \t\t\treturn $this->_client->api('/me');\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "public function getAvatar() {\n return (new Query())->select('profile_photo')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }", "function LoggedIn() {\n\t\treturn $this->Get('UserDetails');\n\t}", "protected function getUserInfo()\n {\n return [\n \"channel\" => self::getSdkChannel(),\n \"uid\" => $this->request_param[\"user_id\"],\n \"server_id\" => $this->request_param[\"server_id\"],\n \"role_id\" => is_null($this->role_id)?\"?\":$this->role_id,\n ];\n }", "public function getAuthenticatedUser()\n {\n return $this->getUnsplashClient()->sendRequest('GET', 'me');\n }", "public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}", "abstract protected function getUserProfile();", "public function getUser(){\r\n $urlUser = \"{$this->apiHost}/api/v1/me\";\r\n // return $urlUser;\r\n return self::runCurl($urlUser);\r\n }", "public function iN_GetUploadedFileDetails($imageID) {\n\t\tif ($imageID) {\n\t\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_user_uploads WHERE upload_id='$imageID'\") or die(mysqli_error($this->db));\n\t\t\t$result = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getUserObject()\n\t{\n\t\treturn $this->user_object;\n\t}", "function User_Info($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT * FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return $R[0];\n\t\telse return null;\n\t}", "public function getUserObject()\n {\n return $this->userobject;\n }", "public function getUserProfile(){\n\n\t\treturn $this->cnuser->getUserProfile($this->request->header('Authorization'));\n\t}", "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "public function getUserInformation() {\n /** @var User $user */\n $user = auth()->user() ;\n\n return $user->toArray() ;\n }", "public function getApiUserInfo()\n {\n return $this->userTransformer->getUserInfo($this->getAuthenticatedUser());\n }", "public function getAvatar()\n {\n return $this->profile->getAvatar();\n }", "public function getUser()\n {\n return $this->hasOne(User::className(), ['image_id' => 'id']);\n }", "public function getUserDetails()\n {\n $this->db->select('*');\n $this->db->from('User');\n $this->db->where('email', $this->session->userdata('email'));\n $query = $this->db->get();\n\n $user = new User();\n\n $user->setUserId($query->row_array()['userId']);\n $user->setFirstName($query->row_array()['firstName']);\n $user->setLastName($query->row_array()['lastName']);\n $user->setProfilePicture($query->row_array()['profilePicture']);\n\n return $this->getUserFollowerCount($user);\n }", "public function get_userInfo()\n {\n return $this->call_method(\"get/userInfo\",\n array()\n );\n }" ]
[ "0.6821546", "0.6543956", "0.6477818", "0.64656454", "0.6436483", "0.6286003", "0.6205379", "0.6169175", "0.6161311", "0.6095036", "0.6078698", "0.6062227", "0.60294485", "0.60181636", "0.59832966", "0.59788364", "0.5968892", "0.596765", "0.5961962", "0.5954738", "0.5941397", "0.5926611", "0.58613", "0.58593696", "0.58506274", "0.584448", "0.584294", "0.58402395", "0.58402395", "0.58402395", "0.5806867", "0.5806559", "0.5787615", "0.57789665", "0.57738656", "0.57697797", "0.5763972", "0.57596636", "0.575558", "0.57554454", "0.57488465", "0.57449603", "0.57430506", "0.5739593", "0.5727034", "0.5721017", "0.57087284", "0.57011336", "0.5700279", "0.5691322", "0.5686311", "0.5686311", "0.5686311", "0.5686311", "0.5686311", "0.5686028", "0.5675215", "0.5661323", "0.5657401", "0.5655077", "0.5651353", "0.56404054", "0.56273013", "0.56245613", "0.562275", "0.5621423", "0.5614811", "0.56134", "0.5611563", "0.5610814", "0.5602226", "0.55986136", "0.5598145", "0.5586084", "0.55848", "0.5581208", "0.55764693", "0.5565633", "0.55556", "0.5551053", "0.55483", "0.5535161", "0.55203277", "0.55155855", "0.55125827", "0.5505253", "0.5496119", "0.54947203", "0.5489316", "0.54893035", "0.54889363", "0.54882205", "0.5486229", "0.5484364", "0.54828066", "0.54792607", "0.54711795", "0.545695", "0.5456174", "0.5454872" ]
0.601037
14
/ Photos methods Add tags to a photo.
function photos_addTags ($photo_id, $tags) { $response = $this->execute(array('method' => 'flickr.photos.addTags', 'photo_id' => $photo_id, 'tags' => $tags)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function photos_setTags ($photo_id, $tags) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setTags', 'photo_id' => $photo_id, 'tags' => $tags));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "function add_tags($tags) {\n array_merge($this->tags, $tags);\n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "public function addPhoto($value)\n {\n $this->photos[] = $value;\n }", "public function addTags($tags) {\n foreach ($tags as $tag) {\n Database::insert(\"post_tags\", [\n \"post_id\" => $this->getId(),\n \"tag_id\" => $tag\n ]);\n }\n }", "public function addTags($tags = array())\n {\n if (!is_array($tags)) {\n $tags = func_get_args();\n }\n foreach ($tags as $tagAttributes) {\n $this->addTag($tagAttributes);\n }\n }", "public function addTagToImage($imageID, $tagName) {\n $sql = \"INSERT INTO t_tags_included VALUES(?,?)\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"ss\", $tagName, $imageID);\n $select->execute();\n $select->close();\n }", "public function &addTag($pid, $tag_uid, $tag_text, $x, $y, array $tags, $uid = 0)\n {\n // Requires either a owner_uid or a session_key\n if (empty($uid) && !$this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires either a uid or a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n\n $params = array(\n 'pid' => $pid,\n 'tag_uid' => $tag_uid,\n 'tag_text' => $tag_text,\n 'x' => $x,\n 'y' => $y,\n 'tags' => (is_array($tags)) ? json_encode($tags) : null);\n\n if (!empty($owner_uid)) {\n $params['owner_uid'] = $uid;\n }\n $results = $this->_facebook->callMethod('facebook.photos.addTag', $params);\n\n return $results;\n\n }", "function setTags($photo_id = false){\n\n\t\t/* Lets get some tags */\n\t\tif($photo_id){\n\n\t\t\t/* This is used on Photo Page */\n\t\t\t$tags = $this->getTags($photo_id);\n\n\t\t\t/* Start Output */\n\t\t\t$output = '';\n\t\t\tforeach($tags->photo->tags->tag as $tag){\n\t\t\t\t$output .= $tag->raw.', ';\n\t\t\t}\n\t\t} else {\n\t\t\t/* This is used on photo page */\n\t\t\t$tags = $this->getUserTags();\n\n\t\t\t/* Start Output */\n\t\t\t$output = '';\n\t\t\tforeach($tags->who->tags->tag as $tag){\n\t\t\t\t$output .= $tag->_content.', ';\n\t\t\t}\n\t\t}\n\n\t\t/* Sets global var */\n\t\t$this->tags = $output;\n\t\treturn $output;\n\t}", "static function addTag($tags){\n\t\t//fetch corresponding tagids\n\t\t$length = count($tags);\n\t\t$db = (new Database)->connectToDatabase();\n\t\tfor($i=0;$i<$length;$i++){\n\t\t\t$db->query(\"SELECT * FROM tag_table WHERE tag_name='$tags[i]'\");\n\t\t\tif($db->returned_rows==0){\n\t\t\t\t//no tag found in tag table... so add it\n\t\t\t\t$db->query(\"INSERT INTO tag_table (tag_name) VALUES ('$tag[i]')\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//check if tag already there with post?\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t\n\t}", "public function addTag( $data = array() ) { \t\n\n $url = $this->_base_url . 'tags';\n $options['data']['tag'] = $data;\n $options['post'] = true;\n $this->_callAPI($url, $options);\n }", "public function addTag($imageId, $tag) {\n $dataToInsert = [\n 'image_id' => $imageId,\n 'tag' => filter_var($tag, FILTER_SANITIZE_STRING)\n ];\n $result = Db::insert('tags', $dataToInsert);\n\n return $result;\n }", "public function addTagsFor($objectid, $tags) {\n $query = 'INSERT INTO '\n . $this->tagMapTable\n . ' (objectid, tagid)'\n . ' SELECT '.$objectid.', tags.id '\n . ' FROM ' . $this->tagTable .' tags '\n . ' WHERE tags.name IN ' . $this->_createSetOfStrings($tags);\n\n $this->query($query);\n }", "function add_tag($tag) {\n array_push($this->tags, $tag);\n }", "public function setTags(Collection $tags)\n {\n throw new \\RuntimeException('Settings tags on an ImageVariant is not supported.', 1371237597);\n }", "public function tags();", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "public function addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "private function addProductPhotos(array $request){\n\n if(array_key_exists('photos', $request)){\n \n foreach($request['photos'] as $photos){\n\n $photo = new Photo();\n\n $photoProduct = Product::where('name', $request['name'])->get();\n $path = $photos->store('/storage/products');\n $filename = basename($path);\n $extension = $photos->getClientOriginalExtension();\n \n $photo->product_id = $photoProduct[0]->id; \n $photo->path = $filename;\n $photo->extension = $extension;\n\n $photo->save();\n }\n }\n }", "function photosets_addPhoto ($photoset_id, $photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.addPhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "abstract public function addItems(\\Media\\Entity\\Photo\\PhotoBase $item);", "public function addTags(array $tags) {\n foreach ($tags as $tag)\n $this->addTag($tag);\n }", "public function addTag(Tag $tag)\n {\n throw new \\RuntimeException('Adding a tag on an ImageVariant is not supported.', 1371237593);\n }", "public function store(Request $request)\n {\n $photo =\"\";\n if ($request->hasFile('photo')) \n {\n $photo = $request->photo->store('images');\n }\n \n $requestData = array_merge($request->all(), ['user_id' => Auth::user()->id,'photo'=>$photo]);\n\n if ( $post=Post::create($requestData)) {\n foreach ($request->post('tags') as $mytag) {\n \n $tag =new postesTags();\n $tag->post_id = $post->id;\n $tag->tag_id = $mytag;\n $tag->save();\n }\n \n }\n\n\n return redirect(url(Config::get('constants.ADMIN_PATH').'posts'))->with('flash_message', 'Post added!');\n }", "public function add_agiletags($email, $tags) {\r\n $fields = array(\r\n 'email' => urlencode($email),\r\n 'tags' => urlencode($tags)\r\n );\r\n $fields_string = '';\r\n foreach ($fields as $key => $value) {\r\n $fields_string .= $key . '=' . $value . '&';\r\n }\r\n\r\n $result = $this->curl_wrap(\"contacts/email/tags/add\", rtrim($fields_string, '&'), \"POST\", \"application/x-www-form-urlencoded\");\r\n return $result;\r\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "protected function createNewTag($tags, $relation)\n {\n if($tags) {\n foreach( $tags as $val) {\n $tag = $this->tag->create([ 'nama' => $val ]);\n $relation->tag()->attach($tag);\n }\n }\n }", "public function addPhoto($paramsPhoto)\n {\n return DB::table('photos')->insert(\n [\n 'photos_link' => trim(strip_tags($paramsPhoto['link'])),\n 'album_id' => trim(strip_tags($paramsPhoto['albumId'])),\n ]\n ); }", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "public function setTagsFor($objectid, $tags) {\n $prevTags = $this->getTagsFor($objectid);\n if( !$prevTags ) {\n $prevTags = array();\n }\n $delTags = array_diff($prevTags, $tags);\n $insTags = array_diff($tags, $prevTags);\n\n $this->deleteTagsFor($objectid, $delTags);\n $this->addTagsFor($objectid, $insTags);\n }", "public function addImage($uploadFileArray,$description,$tags){\n // If this request falls under any of them, treat it invalid.\n if (\n !isset($uploadFileArray['error']) ||\n is_array($uploadFileArray['error'])\n ) {\n throw new RuntimeException('invalid_parameters');\n }\n\n // Check $_FILES['upfile']['error'] value.\n switch ($uploadFileArray['error']) {\n case UPLOAD_ERR_OK:\n break;\n case UPLOAD_ERR_NO_FILE:\n throw new RuntimeException('no_file_sent');\n case UPLOAD_ERR_INI_SIZE:\n case UPLOAD_ERR_FORM_SIZE:\n throw new RuntimeException('oversized_file');\n default:\n throw new RuntimeException('unknown_error');\n }\n\n // You should also check filesize here. \n if ($uploadFileArray['size'] > 1000000) {\n throw new RuntimeException('oversized_file');\n }\n\n // DO NOT TRUST $_FILES['upfile']['mime'] VALUE !!\n // Check MIME Type by yourself.\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n if (false === $ext = array_search(\n $finfo->file($uploadFileArray['tmp_name']),\n array(\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'gif' => 'image/gif',\n ),\n true\n )) {\n throw new RuntimeException('invalid_file_format');\n }\n\n // You should name it uniquely.\n // DO NOT USE $_FILES['upfile']['name'] WITHOUT ANY VALIDATION !!\n // On this example, obtain safe unique name from its binary data.\n\n\n $dbEntry = $this->createDbRow(md5(sha1_file($uploadFileArray['tmp_name']).mt_rand().time()),\n $uploadFileArray['name'],\n resources::get('session')->user->id,\n 0,\n $description);\n \n if (!move_uploaded_file(\n $uploadFileArray['tmp_name'],\n resources::get('config')->get('uploadDir',APPLICATION_PATH . '/upload') . '/' . $dbEntry->file_id\n )) {\n $dbEntry->delete();\n throw new RuntimeException('failed_to_move_file');\n }\n if(!empty($tags)){\n $this->tagPhoto($dbEntry->id,$tags);\n }\n \n return $dbEntry;\n\n }", "protected function addTags ($tagsToAdd, $objectType, $partnerId)\r\n\t{\r\n\t \r\n\t foreach ($tagsToAdd as $tagToAdd)\r\n\t {\r\n\t if (strlen($tagToAdd) >= TagSearchPlugin::MIN_TAG_SEARCH_LENGTH)\r\n\t {\r\n \t $tag = new Tag();\r\n \t $tag->setTag(trim($tagToAdd));\r\n \t $tag->setObjectType($objectType);\r\n \t $tag->setPartnerId($partnerId);\r\n \t $tag->save();\r\n\t }\r\n\t }\r\n\t}", "public function &getTags($pids)\n {\n // Requires a session_key\n if (!$skey = $this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n $results = $this->_facebook->callMethod(\n 'facebook.photos.getTags',\n array('pids' => $pids));\n\n return $results;\n }", "private function addTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n\t\t// return Builder\n $tag = Tag::where('tag', '=', $tagName)->first();\n\t\t\n\t\tif (is_object($tag))\n\t\t{\n\t\t\t// To increment count number to exists tag\n\t\t\tTagUtil::incrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count() === 0)\n\t {\n\t\t\t\t// To attach a related item to taggable\n\t \t$this->tags()->attach($tag->id);\n\t }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tag = new Tag(['tag' => $tagName]);\n\t\t\t\n\t\t\t$this->tags()->save($tag);\t\n\t\t}\n\t}", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "protected function saveTags()\n {\n $this->checkConstants();\n $articleId = $this->id;\n $tags = $this->tags;\n if ( $this->isNewRecord )\n {\n if ( !empty( $tags ) )\n {\n $this->addTags( $articleId, $tags );\n }\n }\n else\n {\n if ( is_array( $tags ) &&( !empty( $tags ) ) )\n {\n /*\n we received array with the same or different values of tags -\n in any case that will be an array with numbers\n */\n if ( is_numeric( $tags[0] ) )\n {\n $this->changeTags( $articleId, $tags );\n }\n /*\n if $tags was filled with models and user has removed from form all tags\n we will receive empty array and $tags will be the same as after initialization\n */\n elseif( is_object( $tags[0] ) )\n {\n $this->deleteAllTags( $articleId );\n }\n }\n }\n }", "public function addTag($id){\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildTagUrl($id) );\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"PUT\"); \n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t}", "public function extend($photo)\n {\n if (!is_object($photo) && !is_array($photo)) {\n if ($this->debugEnabled) {\n wp_die ('Invalid $photo parameter specified');\n }\n }\n\n $photo = (object) $photo;\n\n $usedTimes = $this->getUsedTimes($photo);\n\n $photo->attachment = wp_prepare_attachment_for_js($photo->attachment_id);\n $photo->is_used = (($usedTimes > 0) ? true : false);\n $photo->used_times = $usedTimes;\n\n if (class_exists('GridGalleryPro_Galleries_Model_Tags')) {\n $tags = new GridGalleryPro_Galleries_Model_Tags();\n $result = $tags->getByPhotoId($photo->id);\n $photo->tags = array();\n\n if (is_object($result) && property_exists($result, 'tags')) {\n $photo->tags = explode(',', $result->tags);\n }\n }\n\n return $photo;\n }", "function set_tags($tags) {\n $this->tags = $tags;\n }", "private function addTag()\n {\n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n \n $data = array();\n $tagTitle = stripslashes(trim($_REQUEST['tag']));\n $tag = Utils::sanitize($tagTitle);\n \n $Tickets = new Tickets($params);\n $Tickets->addTag($tag, $tagTitle);\n \n echo '[{\"isError\":0, \"message\":\"Successfully added tag\"}]';\n exit;\n }", "public function setShowTags(SetAlbumTagsRequest $request): void\n\t{\n\t\t$request->album()->show_tags = $request->tags();\n\t\t$request->album()->save();\n\t}", "private function _insertTags($objectId,$tags){\n\t\t$tagObj = Doctrine_Core::getTable('Tag');\n\t\t\n\t\tforeach($tags as $tag){\n\t\t\t$result = $tagObj->findOneByNume($tag);\n\t\t\tif ($result->id) {\n\t\t\t\t$this->_insertTagObiect($objectId,$result->id);\n\t\t\t}else {\n\t\t\t\t$newTagObj = new Tag;\n\t\t\t\t$newTagObj->nume = $tag;\n\t\t\t\t$newTagObj->save();\n\t\t\t\t\n\t\t\t\t$this->_insertTagObiect($objectId,$newTagObj->id);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function addTags($artist, $album, $tags, $api_sig, $sk)\n {\n return $this->getClient()->call('album.addtags', array(\n 'artist' => $artist,\n 'album' => $album,\n 'tags' => $tags,\n 'api_sig' => $api_sig,\n 'sk' => $sk,\n ));\n }", "public function addTags($value)\n {\n if ($this->tags === null) {\n $this->tags = new \\Protobuf\\ScalarCollection();\n }\n\n $this->tags->add($value);\n }", "public function addTags($value)\n {\n if ($this->tags === null) {\n $this->tags = new \\Protobuf\\ScalarCollection();\n }\n\n $this->tags->add($value);\n }", "public function setTags($tags)\n {\n $this->_tags = $tags;\n }", "function set_book_tags( $id, $tags, $append = false ) {\r\n\treturn wp_set_post_tags($id, $tags, $append);\r\n}", "public function setTags($tags)\n {\n $this->tags = $tags;\n }", "public function setTags($tags)\n {\n $this->tags = $tags;\n }", "protected function setTags()\n {\n $this->authBasedTag();\n $this->nameBasedTag($this->relatedEntities);\n }", "public function addTag($tag)\r\n {\r\n if (!empty($this->data['props']['taglist'])) {\r\n $this->data['props']['taglist'] .= ',' . $tag;\r\n } else {\r\n $this->data['props']['taglist'] = $tag;\r\n }\r\n }", "public function attachTags(\n $bookmarkid, $tags, $fromApi = false,\n $extension = null, $replace = true, $fromImport = false\n ) {\n if (!is_array($tags)) {\n $tags = trim($tags);\n if ($tags != '') {\n if (substr($tags, -1) == ',') {\n $tags = substr($tags, 0, -1);\n }\n if ($fromApi) {\n $tags = explode(' ', $tags);\n } else {\n $tags = explode(',', $tags);\n }\n } else {\n $tags = null;\n }\n }\n\n $tagservice = SemanticScuttle_Service_Factory::get('Tag');\n $tags = $tagservice->normalize($tags);\n\n $tags_count = is_array($tags)?count($tags):0;\n if (is_array($tags)) {\n foreach ($tags as $i => $tag) {\n $tags[$i] = trim(utf8_strtolower($tags[$i]));\n if ($fromApi) {\n $tags[$i] = convertTag($tags[$i], 'in');\n }\n }\n }\n\n if ($tags_count > 0) {\n // Remove system tags\n $tags = array_filter($tags, array($this, \"isNotSystemTag\"));\n\n // Eliminate any duplicate categories\n $temp = array_unique($tags);\n $tags = array_values($temp);\n } else {\n // Unfiled\n $tags[] = 'system:unfiled';\n }\n\n // Media and file types\n if (!is_null($extension)) {\n include_once 'SemanticScuttle/functions.php';\n\n if ($keys = multi_array_search($extension, $GLOBALS['filetypes'])) {\n $tags[] = 'system:filetype:'. $extension;\n $tags[] = 'system:media:'. array_shift($keys);\n }\n }\n\n // Imported\n if ($fromImport) {\n $tags[] = 'system:imported';\n }\n\n $this->db->sql_transaction('begin');\n\n if ($replace) {\n if (!$this->deleteTagsForBookmark($bookmarkid)){\n $this->db->sql_transaction('rollback');\n message_die(GENERAL_ERROR, 'Could not attach tags (deleting old ones failed)', '', __LINE__, __FILE__, $sql, $this->db);\n return false;\n }\n }\n\n $bs = SemanticScuttle_Service_Factory::get('Bookmark');\n $tts = SemanticScuttle_Service_Factory::get('Tag2Tag');\n\n // Create links between tags\n foreach ($tags as $key => $tag) {\n if (strpos($tag, '=')) {\n // case \"=\"\n $pieces = explode('=', $tag);\n $nbPieces = count($pieces);\n if ($nbPieces <= 1) {\n continue;\n }\n for ($i = 0; $i < $nbPieces-1; $i++) {\n $bookmark = $bs->getBookmark($bookmarkid);\n $uId = $bookmark['uId'];\n $tts->addLinkedTags($pieces[$i], $pieces[$i+1], '=', $uId);\n }\n // Attach just the last tag to the bookmark\n $tags[$key] = $pieces[0];\n } else {\n // case \">\"\n $pieces = explode('>', $tag);\n $nbPieces = count($pieces);\n if ($nbPieces <= 1) {\n continue;\n }\n for ($i = 0; $i < $nbPieces-1; $i++) {\n $bookmark = $bs->getBookmark($bookmarkid);\n $uId = $bookmark['uId'];\n $tts->addLinkedTags($pieces[$i], $pieces[$i+1], '>', $uId);\n }\n // Attach just the last tag to the bookmark\n $tags[$key] = $pieces[$nbPieces-1];\n }\n }\n\n //after exploding, there may be duplicate keys\n //since we are in a transaction, hasTag() may\n // not return true for newly added duplicate tags\n $tags = array_unique($tags);\n\n // Add the tags to the DB.\n foreach ($tags as $tag) {\n if ($tag == '') {\n continue;\n }\n if ($this->hasTag($bookmarkid, $tag)) {\n continue;\n }\n\n $values = array(\n 'bId' => intval($bookmarkid),\n 'tag' => $tag\n );\n\n $sql = 'INSERT INTO '. $this->getTableName()\n . ' ' . $this->db->sql_build_array('INSERT', $values);\n if (!($dbresult = $this->db->sql_query($sql))) {\n $this->db->sql_transaction('rollback');\n message_die(\n GENERAL_ERROR, 'Could not attach tags',\n '', __LINE__, __FILE__, $sql, $this->db\n );\n return false;\n }\n }\n $this->db->sql_transaction('commit');\n return true;\n }", "public function create($idArticulo,$idTag){\n\n $articulo = Article::find($idArticulo);\n $tag = Tag::find($idTag);\n $articulo->tags()->attach($tag);\n }", "public function tagged( $tag );", "public function addTags(SessionInterface $session, string $artist, string $track, array $tags): void\n {\n $count = count($tags);\n\n if (0 === $count) {\n return;\n } elseif ($count > 10) {\n throw new \\InvalidArgumentException('A maximum of 10 tags is allowed');\n }\n\n $this->signedCall('track.addTags', [\n 'artist' => $artist,\n 'track' => $track,\n 'tags' => implode(',', $tags),\n ], $session, 'POST');\n }", "public function addNewTag($tagName) {\n $sql = \"INSERT INTO t_tags VALUES(?)\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $tagName);\n $select->execute();\n $select->close();\n }", "public function addTag($id, $tag)\n {\n $this->db->update(array('id'=>$id), array('$addToSet'=>array('tags'=>$tag)));\n }", "public function addTag($tag)\n {\n $this->tags[] = $tag;\n $this->processTags();\n }", "protected function _addTags(Kronolith_Event $event)\n {\n $tagger = Kronolith::getTagger();\n $tagger->tag($event->uid, $event->tags, $event->creator, Kronolith_Tagger::TYPE_EVENT);\n\n // Resources don't currently have owners, so can't tag as owner.\n if ($event->calendarType == 'resource') {\n return;\n }\n\n // Add tags again, but as the share owner.\n try {\n $cal = $GLOBALS['injector']->getInstance('Kronolith_Shares')->getShare($event->calendar);\n } catch (Horde_Share_Exception $e) {\n Horde::log($e->getMessage(), 'ERR');\n throw new Kronolith_Exception($e);\n }\n\n if ($cal->get('owner') != $event->creator) {\n $tagger->tag($event->uid, $event->tags, $cal->get('owner'), 'event');\n }\n }", "protected function _actionAdd($context)\n\t{\t\n\t\t$data = $context->data;\t\t\n\t\t$file = KRequest::get('files.file', 'raw');\n\t\t$content = @file_get_contents($file['tmp_name']);\n\t\t$filesize = strlen($content);\n\t\t$uploadlimit = $this->_max_upload_limit * 1024 * 1024; \n\t\t\n\t\t$exif = (function_exists('exif_read_data')) ? @exif_read_data($file['tmp_name']) : array();\n\n\t\tif($filesize == 0)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('File is missing');\t\n\t\t\t\n\t\t return;\n\t\t}\n\t\t\n\t\tif($filesize > $uploadlimit)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('Exceed maximum size');\t\n\n\t\t return;\n\t\t}\n\n\t\t$orientation = 0;\n\t\t\n\t\tif(!empty($exif) && isset($exif['Orientation']) )\n {\n $orientation = $exif['Orientation']; \n }\t\t\n\t\t\n\t\t$data['portrait'] = array('data'=>$content,'rotation'=>$orientation,'mimetype'=>isset($file['type']) ? $file['type'] : null);\t\t\t\t\n \n\t\t$photo = $this->actor->photos->addNew($data);\t\n\t\t\n\t\t$photo->setExifData($exif);\n\t\t\n\t\t$photo->save();\n\t\t\n\t\t$this->setItem($photo);\n\t\t\n\t\t$this->getResponse()->status = KHttpResponse::CREATED;\n\t\t\n if($photo->body && preg_match('/\\S/',$photo->body))\n {\n $context->append(array( \n 'story' => array('body'=>$photo->body)\n )); \n }\n\n\t\treturn $photo;\n\t}", "public function actionAdd()\n\t{\n\t\t$tag = array(\n\t\t\t'tag_id' => 0\n\t\t);\n\n\t\treturn $this->_getTagAddEditResponse($tag);\n\t}", "function tagAdd($pid, $post = array('tag_list' => ''), $query = array(), $rawJson = false) {\n \t\t/**\n \t\t * We currently have to do the following to bypass a php to\n \t\t * rails conflict with the meaning of [] in form field names.\n \t\t * With the following, we only need to name our field \"taggable\",\n \t\t * or tag_list, but \"taggable[tag_list]\" is also supported\n \t\t */\n \t if ( isset($post['tagging']) ) {\n \t $tmp = $post['tagging'];\n \t\t unset($post['tagging']);\n \t\t if ( is_array($post['tagging']) ) {\n \t\t foreach ($tmp as $key => $value)\n \t\t $post[\"tagging[$key]\"] = $value;\n \t\t} else {\n \t\t $post['tagging[tag_list]'] = $tmp;\n \t\t}\n \t\t} elseif ( isset($post['tag_list']) ) {\n \t\t $tmp = $post['tag_list'];\n \t\t unset($post['tag_list']);\n \t\t $post['tagging[tag_list]'] = $tmp;\n \t\t}\n \t\t\n \t\t$post['tagging[tag_list]'] = stripslashes($post['tagging[tag_list]']);\n \t\t\n \t\tif ( $json = $this->_post('/merchants/'.$pid.'/taggings.json', $post, 'post', $query, true) )\n \t\t return $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t}", "function testRemoveTag_UsingMessyTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('some thing!', 'a-nother.', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "public function tag(Request $request, $id)\n {\n\t\t//$request->tag_id\n\t\t\n \t$ctag = Roompicturetag::find($request->tag_id);\n \t$product = Product::find($id);\n \t$products = [];\n \t$products2 = [];\n\t\t\n \tif ($product->relative)\n \t\t$products = $product->relative->products;\n\t\t \n \tif ($product->relative)\n \t\t$products2 = $product->relative->products;\n\t\t \n\t\t\n \treturn response()->json([\n\t\t\t'html' => view('partials.product-tag-new', compact('product', 'ctag', 'products', 'products2'))->render(), \n\t\t\t'html2' => view('partials.product-tag-new2', compact('product', 'ctag', 'products', 'products2'))->render(), \n\t\t\t'p_id' => $id]);\n\n\t\tdie();\n\t}", "public function tags()\r\n {\r\n }", "public function addPhoto($username, AddProfilePhotoRequest $request) {\n\n // Set $photo to the fromFile() function,\n // and get the $requested file which is set to 'photo',\n // and upload it using the upload function().\n // -- 'photo' comes from the <script> tags in profile/index.blade.php.\n\n // Create a new photo instance from a file upload.\n $photo = ProfilePhoto::fromFile($request->file('photo'))->upload();\n\n // Set User::loacatedAt() in (User Model)\n // = to the username, and add the photo.\n // -- Find the user and add the Profile Photo.\n User::locatedAt($username)->addProfilePhoto($photo);\n\n }", "public function setTags($value)\n {\n if (!array_key_exists('tags', $this->fieldsModified)) {\n $this->fieldsModified['tags'] = $this->data['fields']['tags'];\n } elseif ($value === $this->fieldsModified['tags']) {\n unset($this->fieldsModified['tags']);\n }\n\n $this->data['fields']['tags'] = $value;\n }", "public function setPhoto(Photo $photoObject);", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "public function addTagsToPost(Request $request, $id) {\n $tags_id = $request->get('tags_id');\n foreach($tags_id as $tag_id) {\n // check tag is exist\n if(PostTag::where('post_id', $id)->where('tag_id', $tag_id)->count() == 0) {\n $postTag = new PostTag();\n $postTag->post_id = $id;\n $postTag->tag_id = $tag_id;\n $postTag->save();\n }\n }\n $post = Post::findOrFail($id)->load('tags');\n\n return $this->responseJson('success', $post);\n }", "public function addPhoto()\n\t{\n\t\t// check if any key in request is of error type\n\t\tif ($this->request->hasKey(ErrorEnum::ERROR))\n\t\t{\n\t\t\t// setting general error message and view style for a template\n\t\t\t$this->view->add_new_photo_message_class = ErrorEnum::ERROR;\n\t\t\t$this->view->add_new_photo_message = MessageBundle::getMessage('form.validation.field.addphoto.noimage.exists');\n\t\t\t\n\t\t\tif ($this->request->hasKey(ErrorEnum::FILENOIMAGE))\n\t\t\t{\n\t\t\t\t$this->view->add_new_photo_message = MessageBundle::getMessage('form.validation.field.addphoto.filenoimage');\n\t\t\t}\n\t\t}\n\t\t$this->view->add_to_existing_album = $this->helper->getExistingAlbumsToForm();\n\t\t$this->view->show('profile_gallery_add');\n\t}", "private function uploadProductTag(int $productId, array $tags)\n {\n $productTag = PersistenceFactory::createMapper(ProductTag::class);\n foreach ($tags as $item) {\n $productTag->save($productId, $item);\n }\n }", "function admin_add() {\n\t\tif (!empty($this->data)) {\n\t\t\tif (isset($this->data['Post']['new_tags'])) {\n\t\t\t\t$new_tags = explode(',', $this->data['Post']['new_tags']);\n\n\t\t\t\tforeach($new_tags as $new_tag) {\n\t\t\t\t\t$tag['Tag']['name'] = ucfirst(strtolower(trim($new_tag)));\n\t\t\t\t\t$this->Post->Tag->create();\n\t\t\t\t\tif ($this->Post->Tag->save($tag)) {\n\t\t\t\t\t\t$this->data['Tag']['Tag'][] = $this->Post->Tag->id;\n\t\t\t\t\t\t// unset( $this->Post->Tag->id );\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($tag);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->Post->create();\n\t\t\tif ($this->Post->saveAll($this->data)) {\n\t\t\t\t$this->Session->setFlash('Your post has been saved.');\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t}\n\t\t}\n\n\t\t$tags = $this->Post->Tag->find('list');\n\t\t$this->set(compact('tags'));\n\t}", "public function setTags($tags)\n {\n $this->tags = is_array($tags) ? new ArrayCollection($tags) : $tags;\n }", "public function getImageTag();", "public function putAction() {\n\t\t$rawData = json_decode($this->_request->getRawBody(), true);\n\t\tif (!empty($rawData)) {\n\t\t\t$rawData['name'] = ucfirst($rawData['name']);\n\t\t\t$result = Models_Mapper_Tag::getInstance()->save($rawData);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t}\n\t\tif ($result === null) {\n\t\t\t$this->_error('This tag already exists', self::REST_STATUS_BAD_REQUEST);\n\t\t} else {\n\t\t\treturn $result->toArray();\n\t\t}\n\t}", "public function addTags($tags, $post_id)\n {\n $tags_arr = array_map(function($t) {return trim($t);}, explode(',', $tags));\n //Get all the tags in the tags table\n $tags_list = $this->getTags();\n //Get all the tags associated with the entry\n $postTags = array_map(function($t) { return $t['name'];}, $this->getTagsByPostID($post_id));\n\n foreach ($tags_arr as $tag) {\n //Check if $tag is already in the tags table\n if (!in_array($tag, $tags_list)) {\n //if not, add the tag to the tags table\n $tag_id = $this->addSingleTag($tag);\n } else {\n //otherwise get the id of the tag\n $tag_id = $this->getTagId($tag)['id']; \n }\n\n //Check if $tag is already associated to the entry\n if (!in_array($tag, $postTags)) {\n //if not, add the entry id and the tag id to the enries_tags table\n try {\n $result = $this->database->prepare(\n 'INSERT INTO posts_tags (posts_id, tags_id) VALUES (:posts_id, :tags_id)');\n $result->bindParam(\"posts_id\", $post_id);\n $result->bindParam(\"tags_id\", $tag_id);\n $result->execute();\n } catch (Exception $e) {\n $e->getMessage();\n }\n }\n }\n\n foreach ($postTags as $tag1) {\n //Check if the user removes a tag for the selected entry\n if (!in_array($tag1, $tags_arr)) {\n //if so get the tag id\n $tag_id = $this->getTagId($tag1)['id'];\n //and remove all rows with the current $entry_id and $tag_id\n $result1 = $this->deletePostTag($post_id, $tag_id);\n }\n }\n \n return true;\n }", "public function appendTags($tags) {\n\t\tTemplate::appendSiteMetaTags($tags);\n\t}", "function InfAddTag($inf_contact_id, $inf_tag_id) {\n\treturn Infusionsoft_ContactService::addToGroup($inf_contact_id, $inf_tag_id);\t\t\n}", "public function uploadPhoto($currentAlbumId, $currentUserID, $photoName, $shortDescription, $placeTaken, $selectedCategories, $writtenTags, $photoFile, $titlePhoto,$users){\n\n $insertedPhotoId = 'nothing to upload';\n\n // upload photo to server\n if (!empty($photoFile)){\n\n foreach($photoFile as $file) {\n $destinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n if($fileSize <= 1024*1024*10){\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n //upload photo in database\n $insertedPhotoId = DB::table('photos')->insertGetId(\n array('photo_name' => $photoName,\n 'photo_short_description' => $shortDescription,\n 'photo_taken_at' => $placeTaken,\n 'album_id' => $currentAlbumId,\n 'user_id' => $currentUserID,\n 'photo_size' => $fileSize\n )\n );\n\n UserAction::add('Photo \"' . $photoName . '\" was uploaded');\n\n $explodedTags = preg_replace(\"/[^\\w\\ _]+/\", '', $writtenTags); // strip all punctuation characters, news lines, etc.\n $explodedTags = preg_split(\"/\\s+/\", $explodedTags); // split by left over spaces\n $tagLine = \"\";\n for($i=0; $i<sizeOf($explodedTags); $i++)\n $tagLine = $tagLine.$explodedTags[$i].\", \";\n $tagLine = substr($tagLine, 0, -2);\n\n DB::insert('insert into photo_tags (photo_id, tags) values (?,?)', array($insertedPhotoId, $tagLine));\n\n\n\n $upload_success = $file->move($destinationPath, $insertedPhotoId.\".\".$extension);\n if($upload_success){\n //makes photo thumb\n $fileForThumb = $destinationPath.\"/\".$insertedPhotoId.\".\".$extension;\n App::make('phpthumb')\n ->create('resize', array($fileForThumb, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", $insertedPhotoId.\"_thumb.\".$extension);\n\n DB::update('update photos set\n photo_destination_url = ?,\n photo_thumbnail_destination_url = ?\n where photo_id = ?',\n array(\n $destinationPath.\"/\".$insertedPhotoId.\".\".$extension,\n $destinationPath.\"/\".$insertedPhotoId.\"_thumb.\".$extension,\n $insertedPhotoId));\n }\n\n //add categories\n for($i = 0; $i < sizeOf($selectedCategories); $i++){\n $catId = DB::select('select * from categories where category_name = ?', array($selectedCategories[$i]));\n if($catId)\n DB::table('photo_categories')->insert(\n array(\n 'photo_id' => $insertedPhotoId,\n 'category_id' => $catId[0]->category_id,\n )\n );\n }\n //add users\n $ob = new User();\n foreach($users as $user){\n if($user != \"\"){\n $usId = $ob->getUserNameById($user);\n $photoP = DB::insert('insert into photo_people (photo_id, user_id) values (?,?)',array($insertedPhotoId,$usId));\n }\n }\n\n //-----------------Editing album title photo data---------------------//\n //if 'make uploaded photo to title album photo' property is selected\n if($titlePhoto){\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //gets current photo url\n $newTitlePhoto = DB::table('photos')->where('photo_id', $insertedPhotoId)->get();\n if($newTitlePhoto){\n\n //photo\n $photo = null;\n $photo = $newTitlePhoto[0]->photo_destination_url;\n if($photo != null ){\n if(is_file($photo)){\n $photoExtension = File::extension($photo);\n $newPhoto = $destinationPath.\"/title_\".$currentAlbumId.\".\".$photoExtension;\n File::copy($photo, $newPhoto);\n $photo = $newPhoto;\n }\n }\n\n //thumb\n $photoThumb = null;\n $photoThumb = $newTitlePhoto[0]->photo_thumbnail_destination_url;\n if($photoThumb != null){\n if(is_file($photoThumb)){\n $thumbExtension = File::extension($photoThumb);\n $newPhotoThumbUrl = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$thumbExtension;\n File::copy($photoThumb, $newPhotoThumbUrl);\n $photoThumb = $newPhotoThumbUrl;\n }\n }\n else if($photoThumb == null && is_file($photo) != null){\n App::make('phpthumb')\n ->create('resize', array($photo, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$photoExtension);\n $photoThumb = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$photoExtension;\n }\n\n //insert uploaded/unuploaded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $photo,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n }\n }\n return $insertedPhotoId;\n }", "public function photosAdd($id, PhotosRequest $photosrequest){\n\n $directory = '/uploads/photos/'.$id;\n\n if (!File::exists(public_path().$directory)){\n File::makeDirectory(public_path().$directory, 0775,true);\n }\n\n $files = $photosrequest->file('file');\n\n\n\n foreach ($files as $file) {\n\n $name = Auth::id().'_'.$id.'_'.str_slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME),'-').rand(1000,9999);\n $name_thumb = 'thumb_'.$name;\n $name_thumb2 = 'thumb2_'.$name;\n $file_path = $name.'.'.$file->getClientOriginalExtension();\n\n $img = Image::make($file);\n $img->interlace();\n $img->save('uploads/photos/'.$id.'/' . $name .'.'. $file->getClientOriginalExtension());\n\n $img->fit(200, 200);\n $img->save('uploads/photos/'.$id.'/' . $name_thumb .'.'. $file->getClientOriginalExtension());\n\n $img = Image::make($file);\n $img->resize(180, null, function($constraint){\n $constraint->aspectRatio();\n });\n $img->save('uploads/photos/'.$id.'/' . $name_thumb2 .'.'. $file->getClientOriginalExtension());\n\n $picture = new Pictures();\n\n $picture->name = $file_path;\n $picture->directory = $directory;\n $picture->albums_id = $id;\n\n $picture->save();\n }\n\n\n Session::flash('success', \"Vos photos on été ajoutées à l'album\");\n\n return redirect('/albums/'.$id);\n\n }", "public function store(Request $request)\n {\n\n\n if (Input::file('picture')) {\n\n $data = $request->all();\n $lala = Input::file('picture');\n $extension = Input::file('picture')->getClientOriginalExtension();\n $destinationPath='img/';\n $fileName = rand(11111,99999).'.'.$extension; // renaming image\n Input::file('picture')->move($destinationPath, $fileName);\n\n $post = Post::create([\n 'user_id' => auth()->id(),\n 'name'=> request('name'),\n 'description'=>request('description'),\n 'status'=>'free',\n 'picture'=>$fileName,\n\n //image\n\n ]);\n $tags = $data['myInputs'];\n\n // dd($tags);\n foreach ($tags as $eachInput) {\n\n\n $tag = Tag::where('name','=',$eachInput)->first();\n\n\n if (is_null($tag)){\n $tag = new Tag();\n $tag->name=$eachInput;\n $tag->save();\n // dd($tag);\n\n }\n $post->tags()->attach([$tag->id]);\n }\n $post->save();\n\n\n // dd($lala);\n }\n\n // dd(auth()->id()) ;\n return back();\n\n\n }", "public function associateToBook(Tag $tag, Book $book);", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"uploads\";\n $destination_path = \"products\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function addTags($tags, $delimiter = ',')\n {\n //parse tags\n if(!is_array($tags)) {\n $tags = Tag::strToArray($tags, $delimiter);\n }\n\n //create un-available tags\n $availableTagObjs = Tag::find()->where(['name' => $tags])->all();\n\t $availableTags = ArrayHelper::getColumn($availableTagObjs, 'name');\n\t $unavailabelTags = array_diff($tags, $availableTags);\n\t\tforeach($unavailabelTags as $tag){\n\t\t\t$objTag = new Tag();\n\t\t\t$objTag->name = $tag;\n\t\t\t$objTag->save();\n\n\t\t\t$availableTagObjs[] = $objTag;\n\t\t}\n\n\t\t//unlink all old tags\n\t //TODO :: instead of un-linking all old tags, just remove missing only\n\t $this->unlinkAll('tags', true);\n\n\t\t//link new tags to post\n\t\tforeach ($availableTagObjs as $objTag){\n\t\t\t$this->link('tags', $objTag);\n\t\t}\n\n\t\treturn true;\n }", "public function addRelatedImage(Request $request, $id)\n {\n Validator::make($request->all(), [\n 'photos.*' => \"file|image|mimes:jpeg,png,jpg,gif,svg|max:5000\"\n ])->validate();\n $product = Product::find($id);\n $lastID = DB::table('products_photos')->latest('id')->first()->id;\n\n // Store related images into Storage/app\n $arr_img = [];\n if ($photos = $request->file('photos')) {\n $i = $lastID + 1;\n foreach ($photos as $photo) {\n $photoExt = $photo->getClientOriginalExtension();\n $photoName = $product['name'] . \"_\" . $i . \".\" . $photoExt;\n $photo->move(base_path('storage/app/public/product_images'), $photoName);\n $arr_img[] = $photoName;\n $i++;\n }\n }\n // Insert database\n foreach ($arr_img as $key => $value) {\n $insertPhoto = DB::table('products_photos')->insert(\n ['product_id' => $id, 'photos' => $value]\n );\n }\n\n return redirect()->route(\"adminAddRelatedImageForm\",$id)->withSuccess('Related Images has already inserted');\n }", "public function addTagToPostInTheMiddle() {}", "public function inserirTag(Tag $tag){\n $this->tag[] = $tag;\n }", "public function addPhoto($id, Request $request)\n {\n $this->validate($request, [\n 'photo' => 'required|mimes:jpg,jpeg,png,bmp'\n ]);\n\n $photo = $this->makePhoto($request->file('photo'));\n\n //Save and associate photo with PhotoSession\n PhotoSession::findOrFail($id)->addPhoto($photo);\n }", "function getTagInfos($idPhotoTag){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$photoTag = new Data();\r\n\r\n\t\t$query = \"select DAYOFMONTH(DATE_MEDIA) as day, MONTH(DATE_MEDIA) as month, YEAR (DATE_MEDIA) as year,TYPE_PHOTO,COMMENTAIRE \"\r\n\t\t\t\t. \" from PhotoTag left join media on FK_ID_PHOTOS = ID_MEDIA where ID_PHOTO_TAG = \" . $idPhotoTag;\r\n\t\t$result = mysql_query($query);\r\n\r\n\t\tif(mysql_num_rows($result)!=1){return null;}\r\n\t\tif(mysql_result($result,0,\"day\")!=null){\r\n\t\t\t$photoTag->addInfo(\"date\",mysql_result($result,0,\"day\") . \" \" . getMonth(mysql_result($result,0,\"month\")) . \" \" . mysql_result($result,0,\"year\"));\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$photoTag->addInfo(\"date\",\"\");\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"type\",mysql_result($result,0,\"TYPE_PHOTO\"));\r\n\t\t$photoTag->addInfo(\"commentaire\",mysql_result($result,0,\"COMMENTAIRE\"));\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Personne, Utilisateur where FK_ID_PHOTO_TAG = \" . $idPhotoTag . \" and FK_ID_UTILISATEUR = id_user\");\r\n\t\t$personnes = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$personnes .= mysql_result($result,$i,\"nom\") . \" \" . mysql_result($result,$i,\"prenom\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"personnes\",$personnes);\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Moto, Motos, Marques where IdMarque = marque and FK_ID_PHOTO_TAG = \" . $idPhotoTag . \" and FK_ID_MOTO = IdMoto\");\r\n\t\t$motos = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$motos = utf8_encode(mysql_result($result,$i,\"nommarque\") . \" \" . mysql_result($result,$i,\"motocmcube\") . \" \" . mysql_result($result,$i,\"nommoto\")) . \", \";\r\n\t\t\t}\r\n\t\t$photoTag->addInfo(\"motos\",$motos);\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_MotCle, MotCle where FK_ID_MOT_CLE = ID_MOT_CLE and FK_ID_PHOTO_TAG = \" . $idPhotoTag);\r\n\t\t$motsCles = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$motsCles .= mysql_result($result,$i,\"LIB_MOT_CLE\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"motsCles\",$motsCles);\r\n\r\n\t\t$lieux = \"\";\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Lieu, Lieu where FK_ID_LIEU = ID_LIEU and FK_ID_PHOTO_TAG = \" . $idPhotoTag);\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$lieux .= mysql_result($result,$i,\"LIB_LIEU\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"lieux\",$lieux);\r\n\r\n\t\tmysql_close();\r\n\t\treturn $photoTag;\r\n\t}", "public function update($id)\n\t{\n\n // aqui validacion\n $post = Post::findOrFail($id);\n// $post->fill(Input::all());\n\n\n $usuario = Auth::user()->username;\n\n $tags = Input::get('tags');\n\n $etiquetas = explode(',', $tags);\n\n\n foreach($etiquetas as $etiqueta):\n $tag = new Tag();\n $tag->nombre = $etiqueta;\n $tag->save();\n// $tag->posts()->save($post);\n $post->tags()->attach($id);\n endforeach;\n\n\n\n /*$post->tags()->attach($id);*/\n\n\n\n\n $post->titulo = Input::get('titulo');\n $post->resumen = Input::get('resumen');\n $post->cuerpo = Input::get('cuerpo');\n $post->usuario_id = Auth::user()->id;\n $post->username = $usuario;\n $post->categoria_id = Input::get('categoria_id');\n\n // Foto\n if(Input::hasFile('foto'))\n {\n $imagen = Input::file('foto');\n $real_path = $imagen->getRealPath();\n $tipo = Input::file('foto')->getMimeType();\n\n switch($tipo)\n {\n case 'image/jpg': case 'image/jpeg': $ext = '.jpg'; break;\n case 'image/png': case 'image/pneg': $ext = '.png'; break;\n case 'image/gif': $ext = '.gif'; break;\n }\n\n $ruta = 'images/posts/';\n File::delete($post->foto); // Borrar la anterior\n\n $foto_name = uniqid().$ext;\n\n $ancho_in = Image::make($imagen)->width();\n $alto_in = Image::make($imagen)->height();\n\n if ($ancho_in > 800)\n {\n $ancho_out = 800;\n $prop = $ancho_in / $ancho_out;\n $alto_out = $alto_in / $prop;\n $alto_out = (int)$alto_out;\n\n Image::make($real_path)->resize($ancho_out, $alto_out)->save($ruta.$foto_name);\n //Image::make($real_path)->crop($ancho_out, 200)->save($ruta.$foto_name);\n }\n\n $post->foto = $ruta.$foto_name;\n }\n\n $post->save();\n return Redirect::to('posts')->with('mensaje', 'Post actualizado');\n\n\t}", "public function setTags( ArrayCollection $tags )\n {\n $this->tags = $tags;\n }", "public function add_pic() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['add_pic']) && !empty($_POST['add_pic'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if ($this->_model->addPicture($_POST['picture'])) {\n $this->_model->setFlash(\"add_success\", \"Photo ajoutée avec succès!\");\n $this->redirect(\"/montage\");\n }\n }\n }\n $this->_model->setFlash(\"add_error\", \"Erreur lors de l'ajout de votre photo!\");\n $this->redirect(\"/montage\");\n }", "public function add_new_tags( $activity_id, $activity_tags ) {\n\n\t\tif ( !is_array( $activity_tags ) ) {\n\t\t\t$tags_arr = explode( \",\", $activity_tags );\n\t\t\t$tags_arr = array_map( \"trim\", $tags_arr );\n\t\t} else {\n\t\t\t$tags_arr = $activity_tags;\n\t\t}\n\n\t\t$tags_arr = array_unique( $tags_arr );\n\t\t$tags_arr = array_filter( $tags_arr );\n\n\t\t$existing_tags \t= array();\n\t\t$new_tags\t\t= array();\n\n\t\tforeach ( $tags_arr as $t ) {\n\t\t\t$tag = $this->get_tag_by_tagname( $t );\n\n\t\t\tif ( !$tag ) {\n\t\t\t\tarray_push( $new_tags, $t );\n\t\t\t} else {\n\t\t\t\tarray_push( $existing_tags, $tag[ \"id\" ] );\n\t\t\t}\n\t\t}\n\n\t\tarray_map( array( $this, \"input_validation\"), $new_tags );\n\n\t\tforeach( $new_tags as $new_tag ) {\n\t\t\t$tag_id = $this->add_tag( $new_tag );\n\t\t\tarray_push( $existing_tags, $tag_id );\n\t\t}\n\n\t\tforeach( $existing_tags as $tag_id ) {\n\t\t\t$this->add_users_tags( $activity_id, $tag_id );\n\t\t}\n\t}", "public function add_tag($tag, $message = null) {\n\t\t\tif ($message === null) {\n\t\t\t\t$message = $tag;\n\t\t\t}\n\t\t\treturn $this->run(\"tag -a $tag -m \" . escapeshellarg($message));\n\t\t}", "public function addTag($tagName, array $tagReference)\n\t{\n\t\t$tagName = (string)$tagName;\n\n\t\tif ( $tagName != '' and count($tagReference) > 0 )\n\t\t\t$this->tags[ $tagName ] = $tagReference;\n\t}", "public function addTag(Tag $tag)\n {\n $tag->addArticle($this);\n $this->tags[] = $tag;\n }", "public function addImage($url, $attributes = []);" ]
[ "0.6724628", "0.64815724", "0.6448946", "0.644029", "0.61712533", "0.6033899", "0.5994737", "0.59491086", "0.591882", "0.58828974", "0.58600646", "0.5808063", "0.5772397", "0.57443684", "0.57409966", "0.57406014", "0.5707457", "0.57072794", "0.56968343", "0.5681233", "0.5637215", "0.5618421", "0.5593804", "0.5551292", "0.55217636", "0.5505209", "0.55000836", "0.5491844", "0.5491801", "0.54901016", "0.54898816", "0.54840654", "0.54839545", "0.5473438", "0.54719645", "0.54568714", "0.54464257", "0.5429125", "0.5425796", "0.5411611", "0.53957385", "0.5395314", "0.53808177", "0.5372053", "0.5361379", "0.5361379", "0.53496945", "0.53464305", "0.5327508", "0.5327508", "0.528868", "0.5286403", "0.5275845", "0.5274885", "0.52717936", "0.52657443", "0.5258584", "0.52497905", "0.5248162", "0.5241034", "0.52211416", "0.51878685", "0.5187712", "0.5182043", "0.5181966", "0.5175885", "0.5170473", "0.51532906", "0.5151923", "0.5149032", "0.5144869", "0.5138661", "0.5133884", "0.5132029", "0.5119411", "0.51161873", "0.5112442", "0.509573", "0.5087365", "0.5082439", "0.50781757", "0.5076917", "0.50727236", "0.50725806", "0.5068277", "0.5053683", "0.50515354", "0.50456214", "0.50451297", "0.50423783", "0.5032425", "0.50304496", "0.5026376", "0.50250596", "0.5017268", "0.50104594", "0.5007809", "0.50050634", "0.4997239", "0.49874443" ]
0.7340523
0
Delete a photo from flickr.
function photos_delete ($photo_id) { $response = $this->execute(array('method' => 'flickr.photos.delete', 'photo_id' => $photo_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_photo(){\n $sql=\"DELETE FROM photos WHERE id=\".$this->id;\n self::$connect->query($sql);\n\n }", "public function delete_photo ($photo_id){\n\t\t$q_extension = \"SELECT extension FROM photos WHERE photo_id =\".$photo_id;\t\n\t\t$q_photo = 'WHERE photo_id = '.$photo_id;\n\t\t#delete photo record from database\n\t\t\t\n\t\t$ext = DB::instance(DB_NAME)->select_field($q_extension);\n\t\tDB::instance(DB_NAME)->delete('photos', $q_photo);\t\t\n\t\t//delete photo from uploads images folder\n\t\tunlink(\"uploads/images/\".$photo_id.\".\".$ext);\n\t\t#send user back to message index\n\t\tRouter::redirect(\"/photos/gallery\");\n\t\n\t}", "private function deletePhoto()\n {\n try \n {\n global $cbphoto;\n \n $request = $_REQUEST;\n \n if(!isset($request['photo_id']) || $request['photo_id']==\"\" )\n throw_error_msg(\"photo id not provided\");\n\n if( !is_numeric($request['photo_id']) )\n throw_error_msg(\"invalid photo id\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n\n $id = (int)$request['photo_id'];\n $photo = $cbphoto->get_photo($id);\n\n if(!$photo)\n {\n throw_error_msg(lang(\"photo_not_exists\"));\n }\n else\n {\n if($photo['userid']!=userid())\n throw_error_msg(\"You don't have enough permission to delete this photo\");\n } \n \n $cbphoto->delete_photo($id); \n \n if( error() )\n {\n if(error('single')!=\"Photo does not exist in this collection\")\n {\n throw_error_msg(error('single')); \n } \n else\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"photo deleted successfully\", \"data\" => array());\n $this->response($this->json($data)); \n } \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"photo deleted successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public static function delete_photo($id){\n global $db;\n $row = static::find_photo($id);\n $k78sql = \"DELETE FROM photos WHERE photo_id = '\".$id.\"'\";\n try {\n //check if photo is present in database\n if($db->query($sql)){\n //$row = static::find_photo($id);\n //deletes file in image path\n unlink(IMG_PATH.DS.$row['file_name']);\n //deleting photo from database table\n $db->exec($sql);\n return 'Photo with ID '.$id.' deleted from DB';\n }else{\n throw new Exception(\"File could not be deleteed\");\n }\n } catch (Exception $e) {\n return $e;\n }\n }", "function photo_remove() {\n if ( ! $this->input->is_ajax_request() || ! $this->auth->is_login()) {\n return redirect(config_item('site_url'));\n }\n \n $item = filter($this->uri->segment(3), 'str', 40);\n $photo = $this->media->get_by_id($item);\n \n if ( ! $photo || empty($photo)) {\n log_write(LOG_WARNING, 'Photo not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n \n if ($photo->item_author != $this->auth->get_user_id()) {\n log_write(LOG_ERR, 'User is not the author of the photo, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $image = explode('.', $photo->item_filename);\n\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '_thumb.' . $image[1]);\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '.' . $image[1]);\n\n $this->media->remove($item);\n \n return $this->output->set_output(json_encode(array(\n 'code' => 'luck'\n )));\n }", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function deletePhoto($id)\n {\n return DB::table('photos')->where(['photos_id' => $id])->delete();\n }", "public function destroy_photo($id)\n {\n //\n if(File::exists(public_path('files/products_img/'.Photo::find($id)->name)))\n {\n File::delete(public_path('files/products_img/'.Photo::find($id)->name));\n Photo::find($id)->delete();\n return redirect()->back();\n }\n }", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public static function deleteImage(){}", "public function removePhotoAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id');\n\n //GET LISTING ITEM\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n //GET FILE ID\n $file_id = Engine_Api::_()->getDbtable('photos', 'sitereview')->getPhotoId($listing_id, $sitereview->photo_id);\n\n //DELETE PHOTO\n if (!empty($file_id)) {\n $photo = Engine_Api::_()->getItem('sitereview_photo', $file_id);\n $photo->delete();\n }\n\n //SET PHOTO ID TO ZERO\n $sitereview->photo_id = 0;\n $sitereview->save();\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'change-photo', 'listing_id' => $listing_id), \"sitereview_dashboard_listtype_$listingtype_id\", true);\n }", "public function delete($id) \n\t{\n \t$tot = $this->Model_photo->photo_check($id);\n \tif(!$tot) {\n \t\tredirect(base_url().'admin/photo');\n \texit;\n \t}\n\n $data['photo'] = $this->Model_photo->getData($id);\n if($data['photo']) {\n unlink('./public/uploads/'.$data['photo']['photo_name']);\n }\n\n $this->Model_photo->delete($id);\n redirect(base_url().'admin/photo');\n }", "public function DeletePhotos()\n\t{\tforeach ($this->imagesizes as $sizename=>$size)\n\t\t{\t@unlink($this->GetImageFile($sizename));\n\t\t}\n\t}", "function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }", "public function deleteImage($foto) {\n \t\n \tforeach($this->barcoFotos as $barcof) {\n \t\tif ($barcof->id === $foto) {\n \t\t\t$image = $barcof->foto_url;\n \t\t\tif (unlink($image)) {\n \t\t\t\t$barcof->delete();\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t}\n \treturn false;\n }", "public function destroy($id)\n {\n $photo = $this->photo->find($id);\n $path = public_path() . '/' . Config::get('photogallery::upload_folder');\n if (File::exists($path . $photo->url))\n File::delete($path . $photo->url);\n $photo->delete();\n\n /*\n * if exist in the configuration file, delete all other versions\n */\n if (count(Config::get('photogallery::versions')) > 0) {\n foreach (Config::get('photogallery::versions') as $version) {\n $path = public_path() . '/' . $version['upload_folder'];\n if (File::exists($path . $photo->url))\n File::delete($path . $photo->url);\n $photo->delete();\n }\n }\n\n return Redirect::back();\n }", "public function destroy(Photo $photo)\n {\n $photo->delete();\n return redirect('recitals/photos');\n }", "public function destroy(Photo $photo)\n {\n //\n }", "public function destroy(Photo $photo)\n {\n //\n }", "public function deletePicture($id){\n $picName = null;\n $images = new Images();\n $dataPic = $images->get_image($id);\n foreach ($dataPic as $key => $value) {\n $picName = $value->img_url;\n }\n $checkFile = file_exists(public_path() . '/' . $picName);\n if ($checkFile){\n unlink(public_path() . '/' . $picName);\n }\n }", "function deletePhoto($imageNom, $link)\n{\n /* SUPPRIME DU SERVEUR */\n unlink($imageNom);\n\n /* SUPPRIME DE LA BASE DE DONNEES */\n $query = \"DELETE FROM Photo WHERE nomFich = '\" . $imageNom . \"'\";\n executeUpdate($link, $query);\n\n $imageNom = str_replace(array( '..', '/', '\\\\', ':' ), '', $imageNom);\n}", "public function deleteAction()\n {\n \t$this->_helper->getHelper('ViewRenderer')->setNoRender(true);\n \t\n \t// Récuperation de l'ID photo\n\t\t$id = (is_numeric($this->_getParam('id'))) ? $this->_getParam('id') : 0;\n\t\t\n\t\t// Récuperation de la photo\n\t\t$photoMapper = new Application_Model_PhotoMapper();\n\t\t$photo = $photoMapper->getPhoto($id);\n\t\t\n\t\tif(!is_null($photo))\n\t\t{\n\t\t\t// Suppression de la photo\n\t\t\t$rowsDeleted = $photoMapper->deletePhoto($id);\n\t\t\n\t\t\t// Message\n\t\t\t$message = $rowsDeleted.' photo supprimée';\n\t\t\t$this->_helper->getHelper('FlashMessenger')->addMessage($message);\n\t\t\t\n\t\t\t// Redirection\n\t\t\t$this->_helper->getHelper('Redirector')->gotoSimple('edit', 'project', 'admin', array('id' => $photo->getIdProjet()));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_helper->getHelper('Redirector')->gotoSimple('list', 'project', 'admin');\n\t\t}\n }", "public function actionDelete()\n {\n if (Yii::app()->getRequest()->getIsPostRequest()) {\n $id = $_POST['id'];\n /** @var $photo GalleryPhoto */\n $photo = GalleryPhoto::model()->findByPk($id);\n if ($photo !== null && $photo->delete()) echo 'OK';\n else echo 'FAIL';\n } else echo 'FAIL';\n }", "public function destroy(Fotos $fotos)\n {\n //\n }", "public function deletePhoto (Request $request) {\n\n \ttry {\n\n \t\t$this->profileRepo->deletePhoto(Auth::user()->id, $request->photo_name);\n \t\treturn response()->json(['status' => 'success']);\n\n\n \t} catch (\\Exception $e) {\n\n \t\treturn response()->json(['status' => 'error', 'errors' => [trans_choice('app.unable_to_delete',1)] ]);\n \t}\n }", "public function deletePhoto(Request $request) {\n\n // Log::info(\"request image delete \" . $request['image']);\n\n if(is_null($request->image) || is_null($request->id)) {\n return response()-json([\"error\" => \"No Image Specified\"], 200);\n }\n\n $photo = Photo::where([ \n [\"property_id\", $request->id],\n [\"url\", $request->image]\n ]);\n\n if(!is_null($photo)) {\n $photo->delete();\n }\n\n Storage::disk('public')->delete($request->image);\n\n return response()->json([\"success\" => \"success\"], 200);\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy($id)\n {\n $photo = Photo::findOrFail($id);\n\n unlink(public_path() . $photo->file);\n\n $photo->delete();\n\n Session::flash('message', 'Photo deleted!');\n Session::flash('status', 'success');\n\n return redirect('admin/photos');\n }", "public function destroyPhoto($id) {\n\n // Find the ID of the photo and delete it.\n ProfilePhoto::findOrFail($id)->delete();\n\n return redirect()->back();\n\n }", "public function deleting( Picture $picture)\n\t{\n\t\tif (!empty($picture->filename)) {\n\t\t\t$filename = public_path($picture->getPathImage());\n\t\t\t\\File::Delete($filename);\n\t\t\t$filename = public_path($picture->getPathThumbImage());\n\t\t\t\\File::Delete($filename);\n\t\t}\n\t}", "public function destroy($id)\n {\n $item = PhotoGallary::find($id);\n $item->delete();\n\n //delete image\n $image_path = \"uploads/photogallary/\".$item->image; // Value is not URL but directory file path\n if(File::exists($image_path)) {\n // dd($image_path);\n File::delete($image_path);\n }\n\n $item = PhotoGallary::get();\n return redirect()->route('photoGallary.index')->with('message','Photo Successfully Deleted');\n }", "public function actionDeleteimage($id){\n\n $image = Images::findOne($id);\n\n $service_id = $image->service_id;\n\n $url = Url::to('@frontend/web/img/clinic/services/') . $image->file;\n $urlThumb = Url::to('@frontend/web/img/clinic/services/thumbs/') . $image->file;\n\n // Delete image from the database and the folder\n if (unlink($url) && unlink($urlThumb) && $image->delete())\n return true;\n else\n return false;\n }", "public function delete($picture)\n\t{\n\t\t$picture = $this->findByName($picture);\n\t\t// exclui as fotos (pequena, media e grande)\n\t\tImageService::destroy($picture->name);\n\t\t// exclui no banco de dados\n\t\t$picture->delete();\n\n\t\treturn $picture->item;\n\t}", "public function deletePhoto($photo)\n {\n if(!isset($photo['id']))\n return false;\n\n $res = $this->db->delete_attributes($this->domainPhoto, $photo['id']);\n $this->logErrors($res);\n return $res->isOK();\n }", "public function destroy(Photo $photo)\n {\n $photo->delete();\n return redirect()->route('photos.index');\n }", "public function delete(){\n $record = $this->getImageWithId($this->id);\n if(!$record){\n return false;\n }\n $conn = static::connect();\n $stmt = $conn->prepare(\"DELETE FROM images WHERE id = :id\");\n $stmt->bindValue(\"id\", $record['id'], PDO::PARAM_INT);\n\n /* removes file from server */\n unlink($record['path']);\n return $stmt->execute();\n }", "public function destroy($id)\n {\n $photo=Gallery::all()->where('id',$id)->pluck('photos')->first();\n Storage::disk('public')->delete($photo);\n $deletedPhoto=Gallery::all()->where('id',$id)->first();\n $deletedPhoto->delete();\n return redirect('admin/realestate/' . $realestate.'/photos');\n }", "public function deleteAction(Request $request, Photos $photo)\n {\n $form = $this->createDeleteForm($photo);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($photo);\n $em->flush();\n }\n\n return $this->redirectToRoute('photos_index');\n }", "function favorites_remove ($photo_id) {\n $response = $this->execute(array('method' => 'flickr.favorites.remove', 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function destroy($id)\n {\n $photo = Photo::where('user_id', '=', Auth()->user()->id)->findOrFail($id);\n\n File::delete(public_path(UPLOADS_PIC_FOLDER . $photo->file));\n File::delete(public_path(ORIGINAL_PICS_FOLDER . $photo->file));\n File::delete(public_path(UPLOADS_THUMB_FOLDER . $photo->file));\n\n $photo->delete();\n Session::flash('message', 'Photo supprimée avec succès.');\n\n return redirect()->route('user.event.show', $photo->event_id);\n }", "public function del_pic($i_id)\r\n\t{\r\n\t\ttry\r\n {\r\n\t\t\treturn $this->db->update($this->tbl, array('s_photo'=>''), array('i_id'=>$i_id));\r\n\t\t}\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n\t}", "public function destroy($id)\n {\n $photo = Photo::findOrFail($id);\n $photo->delete();\n unlink(public_path('/uploads/'.$photo->file)); // remove photo from public folder\n unlink(public_path('/uploads/1280x1024/'.$photo->file)); // remove photo from public folder\n unlink(public_path('/uploads/316x255/'.$photo->file)); // remove photo from public folder\n unlink(public_path('/uploads/118x95/'.$photo->file)); // remove photo from public folder\n return redirect()->back()->with('success', 'Photo deleted.');\n }", "public function delete(){\r\n\t\t$image = $this->admin_users_model->get_one(array('id'=>$this->uri->segment(2)),'UserAvatar');\r\n\t\t@unlink('../upload/avatar/'.$image);\r\n\t\t$this->admin_users_model->Delete($this->uri->segment(2));\r\n\t\tredirect('admin-users-list');\t\r\n\r\n\r\n\t\t}", "public function destroyImage(File $photo)\n {\n Storage::delete($photo->hashed);\n $photo->delete();\n\n return redirect()->back()\n ->with([\n 'notification' => 'Imagen eliminado',\n 'alert-class' => 'alert-success'\n ]);\n }", "protected function _delete()\n {\n $photoTable = Engine_Api::_()->getItemTable('socialstore_product_photo');\n $photoSelect = $photoTable->select()->where('album_id = ?', $this->getIdentity());\n foreach( $photoTable->fetchAll($photoSelect) as $productPhoto ) {\n $productPhoto->delete();\n }\n\n parent::_delete();\n }", "function deleteImage($image = \"\")\n {\n if (!$image)\n $image = $this->image;\n unlink ($image);\n }", "public function actionDelete()\n\t{\n\t\t// setting the delete tag as false\n\t\t$deleteObject = Image::model()->findByPk($_GET['imageid']);\n\t\t$deleteObject->deleted = true;\n\t\t$deleteObject->save();\n\t\t\n\t\t// link to the physical image file\n\t\t$deleteMe = $deleteObject->getImageFile('full', false, Image::FULLIMAGEPATH);\n\t\t\t\n\t\t// first the existance of the file has to be evaluated in order to avoid an php error\n\t\tif( file_exists( $deleteMe ) )\n\t\t\trename( \n\t\t\t\t// source\n\t\t\t\t$deleteMe,\n\t\t\t\t// target \n\t\t\t\tImage::DELETEDIMAGEPATH . $deleteObject->imageid . '.' . $deleteObject->tiedostotyyppi\t\t\n\t\t);\n\t\t\n\t\t$deleteObject->deleteImage(array('small', 'light', 'medium', 'large'));\n\t\t\n\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\n\t}", "public function presentation_image_delete($image_id)\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$image_id = rawurldecode($image_id);\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$this->pim->delete($image_id);\n\t\t\tredirect('/admin/presentation_images','refresh');\n\t\t}", "public function deletePhoto($photo_uid, $conf) {\r\n\t\t$photo = tx_cwtcommunity_lib_common::dbQuery('SELECT album_uid, filename FROM tx_cwtcommunity_photos WHERE uid = \"'.intval($photo_uid).'\";');\r\n\t\t$album = tx_cwtcommunity_lib_common::dbQuery('SELECT preview_photo_uid FROM tx_cwtcommunity_albums WHERE uid = \"'.intval($photo[0]['album_uid']).'\";');\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_photos WHERE uid = \"'.intval($photo_uid).'\";');\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_photo_comments WHERE photo_uid = \"'.intval($photo_uid).'\";');\r\n\t\tif ($album[0]['preview_photo_uid'] == $photo_uid) {\r\n\t\t\t// Update preview photo\r\n\t\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('UPDATE tx_cwtcommunity_albums SET preview_photo_uid = \"\" WHERE uid = \"'.intval($photo[0]['album_uid']).'\";');\r\n\t\t}\r\n\t\t\r\n\t\t// Delete photo from filesystem\r\n\t\t$storageFolder = $conf['album.']['photo.']['storageFolder'];\r\n\t\t$file = $storageFolder.$photo[0]['filename'];\r\n\t\tif (@file_exists($file)) {\r\n\t\t\tunlink($file);\r\n\t\t}\r\n\t}", "public function delete($image_id){\n $image = Image::find($image_id);\n if(empty($image)){\n return $this->jsonResponse(\"error\", \"Cannot find image\", Input::get('callback'));\n }\n if($image->user_id != Auth::user()->id){\n return $this->jsonResponse(\"error\", \"Image owned by another user. Cannot delete image.\", Input::get('callback'));\n }\n \n // Delete Image File\n File::delete(public_path() . \"/images/\" . basename($image->file));\n \n // Delete SQL record\n if(!$image->delete()){\n return $this->jsonResponse(\"error\", \"Cannot delete image\", Input::get('callback'), $image->errors());\n }\n \n return $this->jsonResponse(\"ok\", \"Image deleted\", Input::get('callback'));\n }", "public function delete($force = false)\n {\n if (!$this->uploaded)\n @unlink($this->photoUrl);\n\n if ($this->uploaded && !$force)\n {\n $this->deleted = 1;\n $this->save();\n }\n else\n parent::delete();\n }", "public function deleteImage(string $type, $id);", "public function destroy($id)\n {\n $input = HeaderPhoto::find($id);\n\n if (file_exists($filename = public_path() . '/images/' .$input->path)) {\n unlink($filename);\n }\n $input->delete();\n\n return redirect()->back();\n }", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function destroy($id)\n {\n $photo = Photo::find($id);\n $photo->delete();\n\n return redirect()->back();\n }", "public function destroy($id)\n {\n Gallery::RemoveUserPhoto( $id );\n }", "public function destroy($id)\n\t{\n\t\tPhoto::destroy($id);\n\t\treturn Redirect::route('admin.photo.index')->with('success', 'Photo deleted.');\n\t}", "public function destroy($id)\n {\n $post = Post::findOrFail($id);\n\n\n if ($post->photo_id){\n\n $image_path = $post->photo->file;\n\n $parse = explode(\"/\", $image_path);\n\n unlink('images/' . end($parse));\n\n $photo = Photo::findOrFail($post->photo_id);\n\n $photo->delete();\n }\n\n Session::flash('deleted_blog', 'El blog fue borrado');\n\n\n $post->delete();\n\n return redirect('/admin/posts');\n\n }", "public static function delete($name)\r\n {\r\n foreach (self::getPhotos() as $photo) {\r\n if (self::getName($photo) == $name) {\r\n self::getSlider()->removeChild($photo);\r\n }\r\n }\r\n \r\n return self::save();\r\n }", "public function deletePhoto($photoId){\n $photos = DB::select('select * from photos where photo_id = ?', array($photoId));\n if($photos){\n File::delete($photos[0]->photo_destination_url);\n\n UserAction::add('Photo \"' . ($photos[0]->photo_name) . '\" was deleted');\n\n DB::table('photos')->where('photo_id', $photoId)->delete();\n }\n return \"Deleted\";\n }", "public static function deleteImage($id)\n {\n // get db\n $db = BackendModel::getContainer()->get('database');\n\n // delete the record\n $db->delete('slideshow_images', 'id = ?', array((int) $id));\n }", "public function deletePhoto(Image $image)\n {\n $image->moveToTrash();\n\n return $this->successResponse();\n }", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "public function destroy($id)\n {\n //\n\t\t// delete\n $photo = Note::find($id);\n $photo->delete();\n\n // redirect\n Session::flash('message', 'Successfully deleted the nerd!');\n return Redirect::to('photos');\n }", "public function destroy(Photo $photo)\n { \n\t //$this->processFile($photo);\n\t\t $res = $photo->delete();\n\t\t if($res)\n\t\t {\n\t\t\t $this->deleteFile($photo);\n\t\t }\n return redirect()->back();\n }", "public static function deletePhotoGallery($params) {\n\t\n\t\t$q = Doctrine_Query::create()->update('Gallery g')\n\t\t->set('g.deleted', 1)\n\t\t->where('g.id=?', $params['id'])\n\t\t->execute();\n\t\t\n\t}", "public function delete($photoId, User $user, \\PDO $db){\n $stmt = $db->prepare(\"DELETE FROM `photos` WHERE `user_id` = ? AND id = ?\"); \n $stmt->bindParam(1, $user->id);\n $stmt->bindParam(2, $photoId);\n return $stmt->execute(); \n }", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function actionDeleteImage()\n {\n $this->goHomeIfNotPost();\n $this->goHomeIfNotCinema();\n\n $validationResult = $this->isValid(\"actionDeleteGalleryImage\", $_POST);\n if ($validationResult != 1)\n {\n header(\"Location: /Theatre\");\n exit();\n }\n\n $imageName = $_POST[\"deleteImageName\"];\n \n try\n {\n (new GalleryModel())->where(\"email\", $this->userMail)->where(\"name\", $imageName)->delete();\n }\n catch (Exception $e)\n {\n $msg = \"Deleting an image from the gallery failed!<br/>\".$e->getMessage();\n return view(\"Exception.php\",[\"msg\" => $msg,\"destination\" => \"/Theatre\"]);\n }\n\n header(\"Location: /Theatre\");\n exit();\n }", "function delete_logoimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"r_logoimage\"];\n \n unlink($fullpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "public function deleteImage($id){\n $id = strip_tags($id);\n\n $sql = \"DELETE FROM image WHERE id = :id\";\n $query = $this->db->prepare($sql);\n $query->execute(array(':id' => $id));\n\n }", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "function deleteAutore()\n{\n global $connection;\n $_SESSION['authorDeleteSuccess'] = false;\n $_SESSION['authorDeleteError'] = false;\n if (isset($_POST['delete'])) {\n $idAutore = $_POST['delete'];\n $photoAutore = $_POST['photoAutore'];\n\n $delete_Autore = \"DELETE FROM autore_video WHERE id_autore='$idAutore'\";\n $result_delete = mysqli_query($connection, $delete_Autore);\n if ($result_delete) {\n if (file_exists($photoAutore)) {\n unlink($photoAutore);\n }\n $_SESSION['authorDeleteSuccess'] = true;\n } else {\n $_SESSION['authorDeleteError'] = true;\n }\n }\n}", "public function destroy($id)\n {\n $image = Poi::where('id',$id)->first();\n $image_path = 'user/img/pois/'.$image->image;\n if(file_exists($image_path))\n {\n unlink($image_path);\n }\n Poi::where('id',$id)->delete();\n return redirect()->back();\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function remove()\n\t{\n\t\t$photosTable = PTA_DB_Table::get('Catalog_Product_Photo');\n\t\t$photos = (array)$photosTable->getPhotos($this->_id);\n\n\t\tif (parent::remove()) {\n\t\t\t$photoFileField = $photosTable->getFieldByAlias('photo');\n\t\t\tforeach ($photos as $photo) {\n\t\t\t\tPTA_Util::unlink(PTA_CONTENT_PATH . '/' . $photo[$photoFileField]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function delete_imagen($img_id){\n\t\t$img = $this->get_img($img_id);\n\n\t\tif(!$this->db->where(\"sli_id\",$img_id)->delete(\"slide\") ){\n\t\t\treturn FALSE;\n\t\t}\n\t\tunlink(\"./imagenes/\".$img->sli_img_nombre);\n\t\treturn TRUE;\n\t}", "public function destroy( $id)\n {\n $user = User::find($id);\n $model = Photos::where('user_id', $id)\n ->get();\n $response = \\Gate::inspect('del-use', $user);\n //dd($model);\n\n if ($response->allowed()) {\n //$content = $model->getAttributes();\n foreach ($model as $value) {\n $attr = $value->getAttributes();\n //dd($attr);\n unlink($attr['photo']);\n $value->delete();\n }\n //$model->delete();\n $user->delete();\n\n return redirect()\n ->route('conUse.index'); \n\n } else {\n echo $response->message();\n } \n }", "public function deleteImage()\n {\n $this->checkImage($this->logo, $this);\n }", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\n\t\t$result = Browser_Service_Recsite::deleteRecsite($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function deleteImage($image_id)\n {\t\t\t\n\t\t/**\n\t\t * Validate that we have \n\t\t * a logged-in user\n\t\t */\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\n\n\t\t\t/**\n\t\t\t * Only this user should be \n\t\t\t * updating this image\n\t\t\t */\n\t\t\t$image = ImageModel::usersImages($user->id)->find($image_id);\n\t\t\tif ($image) {\n\t\t\t\t//TODO Image 5. How can we delete this image?\n\t\t\t\t//return $this->sendResponse('Your image has been successfully deleted');\n\t\t\t}\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this image');\n }", "public function destroy($id)\n {\n try {\n $image = Image::findOrFail($id);\n $url = $image->url;\n if(isset($url) && $url != null){\n $image->delete();\n unlink($url);\n }\n return response()->json([\n 'message' => 'Imagen eliminada con éxito',\n 'data' => $image\n ], 200);\n } catch (Exception $e) {\n return response()->json([\n 'message' => 'ImageController.destroy.failed',\n 'error' => $e->getMessage()\n ], 505);\n }\n }", "public function deleteAction(Request $request, Photo $photo)\n {\n $form = $this->createDeleteForm($photo);\n $form->handleRequest($request);\n\n $photoSrc = $this->getParameter('root_directory').$photo->getSrc();\n $photoFile = new Filesystem();\n\n if ($form->isSubmitted() && $form->isValid()) {\n $photoFile->remove($photoSrc);\n $em = $this->getDoctrine()->getManager();\n $em->remove($photo);\n $em->flush();\n }\n\n return $this->redirectToRoute('_dashboard');\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function destroy($id)\n {\n $photo = Photo::find($id);\n $data = Pesanan::find($photo->id_pesanan);\n if ($photo->gambar != 'imagedefault.png') {\n $old_image = public_path() . \"/assets/images/\" . $photo->gambar;\n @unlink($old_image);\n }\n\n $photo->delete();\n if (!$photo) {\n session()->flash('error', 'Data gagal dihapus');\n return redirect(route('photo.show', $data->slug));\n } else {\n session()->flash('success', 'Data berhasil dihapus');\n return redirect(route('photo.show', $data->slug));\n }\n }", "function deletePicture() {\n\t\tglobal $DB_LINK, $db_table_recipes, $g_rb_database_type, $LangUI;\n\t\t$sql = \"UPDATE $db_table_recipes SET recipe_picture='', recipe_picture_type='' WHERE recipe_id=\" . $DB_LINK->addq($this->id, get_magic_quotes_gpc());\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error removing the picture'), $sql);\n\n\t\t// Do the postgres cleanup\n\t\tif ($this->picture_oid && $g_rb_database_type==\"postgres\") {\n\t\t\t$rc = $DB_LINK->BlobDelete($this->picture_oid);\n\t\t\t$this->picture_oid=NULL;\n\t\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error removing the picture'), $sql);\n\t\t}\n\t\treturn TRUE;\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function destroy($id) {\n $foto = $this->foto->whereId($id)->first();\n $foto->delete();\n\n $redirectme = Input::get('redirectme');\n if ($redirectme && $redirectme != \"\") {\n return Redirect::to($redirectme)->with('message', 'Foto eliminada.');\n } else {\n return Redirect::route('adminFotos.index')->with('message', 'Foto eliminada.');\n }\n }", "function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_Link WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_Link set ImageID='0' WHERE ID='$this->ID'\" );\n }", "public function destroy($id)\n {\n try{\n $slider= Slider::find($id);\n\n $link = $slider->img_url;\n\n $slider->delete();\n\n if($slider->img_url!=null){\n if(\\File::exists(public_path($link))){\n unlink(public_path($link));\n\n }\n\n }\n\n\n\n Session::flash('danger', 'Image is deleted');\n return Redirect::back();\n }catch (Exception $exception){\n Session::flash('alert', 'Image is not deleted');\n return Redirect::back();\n }\n\n\n }", "public function deleteImage(Request $request){\n if(Auth::user()->signature_url!=\"\"){\n unlink(public_path().\"/storage/\".Auth::user()->signature_url);\n }\n\n DB::table('users')\n ->where('id', Auth::user()->id)\n ->update(['signature_url' => \"\"]);\n\n return response()->json(['response'=>\"success\"]);\n }", "public function deleteSlider($id)\n {\n $image = Slider::find($id);\n $old_image = $image->image;\n unlink($old_image);\n\n Slider::find($id)->delete();\n\n return redirect()->back()->with('success','slider Delete successfully');\n }", "public function actionDeleteimage()\n {\n $this->enableCsrfValidation = false;\n $filename = Yii::$app->request->post('filename');\n $path_name = \"../web/web_mat/temp/\" . $filename;\n if (unlink($path_name)) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n }", "public function destroy($id)\n {\n $image = Slider::find($id);\n if ($image->delete()) {\n return redirect('res_admin/slider');\n };\n }", "function delete()\n\t{\n\tglobal $db, $config_vars;\n\n// \t\t$result = new phreak_error();\n// \t$result->set_object_id($this->id);\n// \t$result->set_operation('delete');\n\n\n\t\t//check if the object is in the database\n\t\tif (isset($this->id))\n\t\t{\n\n\t\t\tif ($this->check_perm('delete')) //Authorisation is okay\n\t\t\t{\n\n\t\t\t\t//remove views for this picture\n\t\t\t\t$sql = 'DELETE FROM ' . $config_vars['table_prefix'] . \"views WHERE content_id = \" . $this->id;\n\t\t\t\tif (!$result = $db->sql_query($sql))\n\t\t\t\t{\n\t\t\t\t\t$error = new phreak_error(E_WARNING,SQL_ERROR,__LINE__,__FILE__,'delete',$this->id,0,0,$sql);\n\t\t\t\t\t$error->commit();\n//\t\t\t\t\terror_report(SQL_ERROR, 'delete' , __LINE__, __FILE__,$sql);\n\t\t\t\t}\n\n\n\n\n\t\t\t\t// remove from content table\n\t\t\t\t$sql = \"DELETE FROM \" . $config_vars['table_prefix'] . \"content WHERE id = \" . $this->id;\n\t\t\t\tif (!$result = $db->sql_query($sql))\n\t\t\t\t{\n\t\t\t\t\t$error = new phreak_error(E_WARNING,SQL_ERROR,__LINE__,__FILE__,'delete',$this->id,0,0,$sql);\n\t\t\t\t\t$error->commit();\n//\t\t\t\t\terror_report(SQL_ERROR, 'delete' , __LINE__, __FILE__,$sql);\n\t\t\t\t}\n\n\t\t\t\t$this->clear_content_in_cat();\n\n\t\t\t\tif (is_file($this->file))\n\t\t\t\t{\n\t\t\t\t\tif (!unlink($this->file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = new phreak_error(E_WARNING,FILE_ERROR,__LINE__,__FILE__,'delete');\n\t\t\t\t\t\t$error->commit();\n//\t\t\t\t\t\terror_report(FILE_ERROR, 'delete' , __LINE__, __FILE__);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (is_file($this->get_thumbfile()))\n\t\t\t\t{\n\t\t\t\t\tif (!unlink($this->get_thumbfile()))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = new phreak_error(E_WARNING,FILE_ERROR,__LINE__,__FILE__,'delete');\n\t\t\t\t\t\t$error->commit();\n//\t\t\t\t\t\terror_report(FILE_ERROR, 'delete' , __LINE__, __FILE__);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunset($this->id);\n\n\t\t\t\t// decrase content amount\n\t\t\t\tforeach ($this->cat_ids as $id)\n\t\t\t\t{\n\t\t\t\t\t$this->remove_from_cat = new categorie;\n\t\t\t\t\t$this->remove_from_cat->generate_from_id($id);\n\t\t\t\t\t$this->remove_from_cat->set_content_amount($this->remove_from_cat->get_content_amount()-1);\n\t\t\t\t\t$this->remove_from_cat->commit();\n\t\t\t\t}\n\n\n\t\t\t\t// remove from content_in_cat table\n\n\n\t\t\t\tunset($this->file);\n\t\t\t\tunset($this->cat_ids);\n\t\t\t\tunset($this->place_in_cat);\n\n\n\n\n\t\t\t\treturn OP_SUCCESSFUL;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn OP_NP_MISSING_DELETE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn OP_NOT_IN_DB;\n\t\t}\n\n\t}", "public function destroy(Hotel $hotel, $photo_id)\n {\n $photo = HotelPhoto::find($photo_id);\n //$file_path = public_path(\"img\\photo\") . '\\\\' . $photo->img;\n $file_path = 'public/img/photo' . '/' . $photo->img;\n //dd($file_path);\n\n if (unlink($file_path))\n {\n $photo->destroy($photo_id);\n\n return redirect()->route('hotels.show', $hotel->id);\n }\n }", "public function deleteAction(Image $image)\n {\n $em = $this->getDoctrine()->getManager();\n $em->remove($image);\n $em->flush();\n\n return $this->redirectToRoute('gallery_index');\n }", "public function deleteImage()\n {\n return Storage::delete($this->image);\n }", "public function destroy($id)\n\t{\n $this->repository->find($id)->delete();\n return redirect()->route('images.index')->withSuccess('La imagen se elimino correctamente.');\n\t}" ]
[ "0.75842", "0.7137276", "0.6974389", "0.695486", "0.6946395", "0.69385713", "0.6874482", "0.6823608", "0.6817173", "0.67936695", "0.6791227", "0.67703795", "0.6729899", "0.66948974", "0.6677093", "0.6649489", "0.66435516", "0.6637135", "0.6637135", "0.66153735", "0.6613823", "0.6602847", "0.66016155", "0.6592587", "0.6592215", "0.65895665", "0.6550014", "0.65430456", "0.65080506", "0.6505327", "0.6501431", "0.6500076", "0.64863104", "0.64825606", "0.6480997", "0.64683956", "0.64632714", "0.64556557", "0.6452284", "0.6451625", "0.6446663", "0.6374465", "0.63726306", "0.63553804", "0.6353753", "0.635118", "0.63281775", "0.63272035", "0.6319062", "0.6297971", "0.6295134", "0.62951016", "0.6288928", "0.6284284", "0.62835234", "0.6277787", "0.62737286", "0.62670726", "0.6262498", "0.624916", "0.624767", "0.6243655", "0.62428975", "0.6239516", "0.6232502", "0.6229903", "0.62262595", "0.62239945", "0.62188506", "0.62179774", "0.6217219", "0.6216601", "0.62135166", "0.6210548", "0.6200018", "0.6192157", "0.61910903", "0.61706525", "0.6163149", "0.61624265", "0.61539656", "0.6153574", "0.61462206", "0.6143329", "0.61350286", "0.6132746", "0.6128019", "0.61224246", "0.61209077", "0.61195", "0.6114169", "0.61139506", "0.61128885", "0.6104811", "0.6100541", "0.60804266", "0.6074752", "0.60733044", "0.6071948", "0.6068859" ]
0.759642
0
Returns all visible sets and pools the photo belongs to.
function photos_getAllContexts ($photo_id) { $response = $this->execute(array('method' => 'flickr.photos.getAllContexts', 'photo_id' => $photo_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { unset($object['stat']); return $object; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}", "public function getResourceSets();", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "static public function get_sets() {\n\t\t$switched = false;\n\t\t// Return the sets if already registered.\n\t\tif ( self::$sets ) {\n\t\t\treturn self::$sets;\n\t\t}\n\t\tglobal $blog_id;\n\t\t// Check to see if we should pull sets from the main site.\n\t\tif ( is_multisite() ) {\n\n\t\t\t$id\t\t= defined( 'BLOG_ID_CURRENT_SITE' ) ? BLOG_ID_CURRENT_SITE : 1;\n\t\t\t$enabled_icons\t= get_option( '_fl_builder_enabled_icons' );\n\n\t\t\tif ( ( $id != $blog_id ) && empty( $enabled_icons ) ) {\n\t\t\t\tswitch_to_blog( $id );\n\t\t\t\t$switched = true;\n\t\t\t}\n\t\t}\n\n\t\t// Register the icon sets.\n\t\tself::register_custom_sets();\n\t\tself::register_core_sets();\n\n\t\t// Revert to the current site if we pulled from the main site.\n\t\tif ( is_multisite() && $switched ) {\n\t\t\trestore_current_blog();\n\t\t}\n\n\t\t// Filter the sets\n\t\tself::$sets = apply_filters( 'fl_builder_icon_sets', self::$sets );\n\n\t\t// Return the sets.\n\t\treturn self::$sets;\n\t}", "public function getSets() {\r\n\t\treturn $this -> sets;\r\n\t}", "public function findSets() {\n $select = $this->getDatabase()\n ->select()\n ->from($this->getTableName());\n\n $data = $select->fetchAll();\n\n $result = array();\n foreach ($data as $item) {\n $item['id'] = (int)$item['id'];\n\n $result[] = new Entity\\Set($item);\n }\n\n return $result;\n }", "public function getVisibleBlocksPerRegion(array &$cacheable_metadata = []);", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAllSets() {\n $entityTypeId = Mage::getModel('eav/entity')->setType(Alpenite_Blog_Model_Post::ENTITY)->getTypeId();\n\n $sets = Mage::getModel('eav/entity_attribute_set')\n ->getResourceCollection()\n ->setEntityTypeFilter($entityTypeId)\n ->load();\n\n $resultArray = array();\n foreach ($sets as $set) {\n $resultArray[] = array(\n 'value' => $set->getId(),\n 'label' => $set->getAttributeSetName()\n );\n }\n return $resultArray;\n }", "public function setImagesets()\n {\n $this->_imagesets = [];\n try {\n $pnmain = $this->_qobject->getPNMainTable();\n $type = $this->_image->getImageParams('type');\n if ($type == 'rgb') {\n $model = $this->_image->getImageParams('R_model');\n } else {\n $model = $this->_image->getImageParams('in_model');\n }\n\n if (!$model || $model == null) {\n return $this->mylogger->logMessage(\"Model for the parameter 'run_id' is not defined.\", $this, 'warning',\n false);\n }\n $runs = $pnmain->{$model}()\n ->where('found', 'y')\n ->distinct('run_id')\n ->pluck('run_id')\n ->toArray();\n\n if (!$runs || $runs == null || empty($runs)) {\n return $this->mylogger->logMessage(\"No results.\", $this, 'warning', false);\n }\n\n// $old_base_file_names = array_column($this->_oldresults, 'OutImage');\n\n foreach ($runs as $run_id) {\n $run_id = ($run_id == null || !$run_id) ? \"-1\" : $run_id;\n\n $base_file_name = $this->pngName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'), $run_id);\n\n $full_file_name = MyFunctions::pathslash($this->_getOutDir()) . $base_file_name;\n\n $outimages = $this->_setOutimages($full_file_name);\n if (empty($outimages)) {\n continue;\n }\n\n $metadata = [\n 'type' => $type,\n 'run_id' => $run_id,\n 'OutImage' => $base_file_name,\n \"rgb_cube\" => ($type == 'rgb') ? $this->getRGBcubeName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'),\n $run_id) : null,\n \"out_images\" => $outimages,\n ];\n\n\n// if (in_array($base_file_name, $old_base_file_names)) {\n// continue;\n// }\n\n $rgb_components = $this->_getRGBComponents($pnmain, $run_id);\n\n if ($rgb_components) {\n $this->_imagesets[$run_id] = array_merge($metadata, $rgb_components);\n } else {\n $this->mylogger->logMessage(\"Missing fits image(s).\", $this, 'warning', false);\n }\n }\n } catch (\\Exception $e) {\n $this->_imagesets = [];\n return $this->mylogger->logMessage(\"Problem with setting imagesets: \" . $e . \".\", $this, 'warning', false);\n }\n if (empty($this->_imagesets)) {\n return false;\n }\n return true;\n\n }", "public function getShowGroups(): array;", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getVisibleInSiteVisibilities()\n {\n return Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();\n }", "public function getCollection() {\n return $this->gateway->find(\n $this->getFilter(),\n $this->order,\n $this->relations,\n $this->pager,\n !$this->excludeRepo\n );\n }", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function getSets($id, Request $request)\n {\n // the number of items we want to display per page\n $items_per_page = 50;\n // check if request overwrote this value\n $input = $request->all();\n if (array_key_exists('items_per_page', $input)) {\n if (!is_numeric($input['items_per_page'])) {\n return response([\"error\" => \"Items per page must be a numerical value.\"], 400);\n }\n $items_per_page = intval($input['items_per_page']);\n }\n\n // check to make sure girl id is valid\n $girl = Girl::find($id);\n if ($girl == null) {\n return response([\"error\" => \"Invalid ID was given.\"], 400);\n }\n\n // eloquent does not yet support belongsToManyThrough.\n $results = DB::table('girls')\n ->join('girls_cards', 'girls.girl_id', '=', 'girls_cards.girl_id')\n ->join('cards', 'girls_cards.card_id', '=', 'cards.card_id')\n ->join('sets', 'cards.set_id', '=', 'sets.set_id')\n ->where('girls.girl_id', '=', $id)\n ->groupBy('sets.set_id')\n ->select('sets.set_id', 'sets.set_type', 'sets.set_name_initial', 'sets.set_name_initial_eng', 'sets.set_image_name_initial', 'sets.set_image_name_final', 'sets.set_size')\n ->distinct()->get();\n\n // this was the original plan - it works, but it grew too ugly, and will become even uglier during set searching.\n // so, the image name columns were added to the sets. it's more redundant, but it will save work in the long run.\n // see the comments at the end of this file for more details.\n\n// $results = DB::select(\"SELECT DISTINCT(sets.set_id), q.card_image_name AS 'set_image_name_initial', z.card_image_name AS 'set_image_name_final' FROM girls\n// INNER JOIN girls_cards ON girls.girl_id = girls_cards.girl_id\n// INNER JOIN cards ON girls_cards.card_id = cards.card_id INNER JOIN sets ON cards.set_id = sets.set_id\n// INNER JOIN\n// (SELECT cards.card_image_name, t.set_id FROM\n// (SELECT sets.set_id, MAX(card_id) AS 'max', MIN(card_id) as 'min' FROM `sets`\n// INNER JOIN cards ON cards.set_id = sets.set_id\n// GROUP BY sets.set_id) t\n// INNER JOIN cards ON t.min = cards.card_id WHERE cards.set_id = t.set_id) q\n// ON sets.set_id = q.set_id\n// INNER JOIN\n// (SELECT cards.card_image_name, x.set_id FROM\n// (SELECT sets.set_id, MAX(card_id) AS 'max', MIN(card_id) as 'min' FROM `sets`\n// INNER JOIN cards ON cards.set_id = sets.set_id\n// GROUP BY sets.set_id) x\n// INNER JOIN cards ON x.max = cards.card_id WHERE cards.set_id = x.set_id) z\n// ON sets.set_id = z.set_id\");\n\n // manual pagination with the LengthAwarePaginator class since laravel fails to paginate when distinct is used\n// $collection = Collection::make($results);\n $currentPage = LengthAwarePaginator::resolveCurrentPage();\n $currentPageSearchResults = $results->slice(($currentPage - 1) * $items_per_page, $items_per_page)->all();\n $paginatedResults = new LengthAwarePaginator($currentPageSearchResults, count($results), $items_per_page);\n $paginatedResults->setPath($request->url());\n $paginatedResults->appends($request->except(['page']));\n\n return response($paginatedResults, 200);\n }", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "public function getDatasetsList() {\n return $this->_get(1);\n }", "public function getDatasetsList() {\n return $this->_get(3);\n }", "public function getSets()\n\t\t{\n\t\t\treturn $this->sets;\n\t\t}", "static public function get_sets_for_current_site() {\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn self::get_sets();\n\t\t}\n\n\t\t// Store the original sets.\n\t\t$original_sets = self::$sets;\n\n\t\t// Register the icon sets.\n\t\tself::register_custom_sets();\n\t\tself::register_core_sets();\n\n\t\t// Get the new sets.\n\t\t$sets = apply_filters( 'fl_builder_current_site_icon_sets', self::$sets );\n\n\t\t// Revert to the original sets.\n\t\tself::$sets = $original_sets;\n\n\t\t// Return the sets.\n\t\treturn $sets;\n\t}", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "public function getReferenceSetsList(){\n return $this->_get(1);\n }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function images()\n {\n return $this->hasMany(Image::class, 'owner_id')->whereHas('type', function ($q) {\n return $q->where('type', static::class);\n });\n }", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function getPhotos();", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "public function dataSets()\n\t{\n\t\treturn $this->data_sets;\n\t}", "public function getAlbums()\n {\n return GalleryAlbum::get()->filter('ParentID', $this->ID);\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function all()\n {\n return DogsGallery::where(\"found_by\", null)\n ->get()\n ->map->format();\n }", "public function getAll(){\n\t\t$FocusList = new Image();\n\t\t$FocusLists = $FocusList->select('path')->where('category_id','=',1)->orderBy(\"id\", \"desc\")->limit(5)->get();\n return $FocusLists;\n\t}", "function getGroups(){\r\n\t\t$this->connectService->connect();\r\n\t\t$result = mysql_query(\"select id_group_photo,description_group_photo from group_photos order by 2\");\r\n\r\n\t\t$groups = array();\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$groups[mysql_result($result,$i,0)] = mysql_result($result,$i,1);\r\n\t\t}\r\n\r\n\t\t$this->connectService->close();\r\n\t\treturn $groups;\r\n\t}", "public function getDisplayStockPhotos()\n {\n return $this->displayStockPhotos;\n }", "public function getDatasetsList() {\n return $this->_get(4);\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function photographCollections()\n {\n return $this->hasMany(PhotographCollection::class)->orderBy('title', 'asc');\n }", "protected function getItemSets()\n {\n $db = $this->db;\n $query = $db->getQuery(true);\n $query->select($db->quoteName(array('params')));\n $query->from($db->quoteName('#__extensions'));\n $query->where($db->quoteName('element') . ' = '. $db->quote('rimage'), 'AND');\n $query->where($db->quoteName('folder') . ' = '. $db->quote('k2'));\n $db->setQuery($query);\n return json_decode($db->loadResult(), true);\n }", "function getDataSets()\n {\n if ($this->getResource('wdrs:describedby')){\n $dataset = $this->getResource('wdrs:describedby')->all('void:inDataset');\n }else {\n $schemaUrls = $this->allResources('schema:url');\n $describedBy = array_filter($schemaUrls, function($schemaUrl)\n {\n return(strpos($schemaUrl->getURI(), 'worldcat.org/title'));\n });\n $describedBy = array_shift($describedBy);\n $dataset = $describedBy->all('void:inDataset');\n }\n \n return $dataset;\n }", "public function getPictures()\n {\n\n return $this->pictures;\n }", "protected function getAllVisible()\n {\n $col = 'visible';\n $result = $this->db->newQuery('select', $this->table)\n ->addWhere()\n ->Equals($col)\n ->makeStatement()\n ->Bind($col, [$col => 1])\n ->FetchAll();\n\n return ($result) ?: null;\n }", "public function getGrid()\n {\n return $this->all();\n }", "public function getGrid()\n {\n return $this->all();\n }", "public function getPicturesInSlider(): PictureCollection;", "public function sets()\n {\n return $this->hasMany(Set::class);\n }", "public function sets()\n {\n return $this->hasMany(Set::class);\n }", "public function getPools()\r\n\t{\r\n\t\treturn $this->pools;\r\n\t}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "public function all()\n\t{\n\t\treturn $this->boxes;\n\t}", "public function boxsets()\n {\n return $this->hasMany('App\\Boxset');\n }", "public function getBlocks(): Collection;", "public function images()\n {\n return $this->hasMany('Lwv\\BlockSliderExtension\\Image\\ImageModel','block')->orderBy('weight');\n }", "function get_setlist() {\n $query = $this->db->get('settings');\n return $query->result_array();\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function findForList()\n {\n return $this->findByShowInOverview(true);\n }", "public function getPools()\n\t{\n\t\t$pools = array();\n\t\t$result = '';\n\t\t\n\t\tswitch( $this->db_link->getDriver() )\n\t\t{\n\t\t\tcase 'sqlite':\n\t\t\tcase 'mysql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM Pool\";\n\t\t\tbreak;\n\t\t\tcase 'pgsql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM pool\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->db_link->runQuery($query);\n\t\tforeach( $result->fetchAll() as $pool )\n\t\t\t$pools[] = $pool;\n\n\t\treturn $pools;\n\t}", "public function getShownpcsList(){\n return $this->_get(29);\n }", "function printSets($packery = true, $size = 'q'){ // This one has different formatting\n\n\t\t/* Gets Sets for User */\n\t\t$sets = $this->getSets($this->user);\n\n\t\t/* Generate output */\n\t\t$packery ? $packery = 'packery' : $packery = '';\n\t\t$output = '<section class=\"sets\"><ul class=\"photosets '.$packery.'\">';\n\t\tforeach($sets->photosets->photoset as $set){\n\t\t\tif($set->title->_content[0] !== ' '){ // I use a Space in front of sets to make them private\n\t\t\t\t$output .= '<li class=\"set item\"><figure>';\n\n\t\t\t\t/* Add Link */\n\t\t\t\t$link = '<a href=\"#!/set='.strtolower(urlencode($set->title->_content)).'&amp;id='.$set->id.'\">';\n\t\t\t\t$output .= $link;\n\t\t\t\t$output .= '<img src=\"http://static.flickr.com/'.$set->server.'/'.$set->primary.'_'.$set->secret.'_'.$size.'.jpg\" alt=\"'.$set->title->_content.'\" /></a>';\n\t\t\t\t$output .= '<figcaption>'.$link.$set->title->_content.'</a></figcaption>';\n\t\t\t\t$output .= '</figure></li>';\n\t\t\t}\n\t\t}\n\t\t$output .= '</ul></section>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "public function getObjects()\n {\n return $this->objects;\n }", "protected function findAll()\n {\n return ContainerPage::find()->contentContainer($this->contentContainer)->all();\n }", "public function get_images(){\n\t\treturn $this->images;\n\t}", "public function filterVisible(): self;", "private function getList()\n\t{\n\t\t// Get the correct billboards collection to display from the parameters\n\t\t$collection = (int) $this->params->get('collection', 1);\n\n\t\t// Grab all the buildboards associated with the selected collection\n\t\t// Make sure we only grab published billboards\n\t\t$rows = Billboard::whereEquals('published', 1)\n\t\t ->whereEquals('collection_id', $collection)\n\t\t ->order('ordering', 'asc')\n\t\t ->rows();\n\n\t\treturn $rows;\n\t}", "public function getImages() {\n\t\tif($this->images === null) {\n\t\t\t$this->images = $this->getObjectManager()->get('Qinx\\Qxgallery\\Domain\\Repository\\ImageRepository')->findAll(array(\n\t\t\t\t'category' => $this\n\t\t\t));\n\t\t}\n\n\t\treturn $this->images;\n\t}", "public function getImages(){\n return $this->images;\n }", "function get_listing_data( $params )\n\t{\n\t\tif( $params['allow_albums'] == -1 && $params['allow_cats'] == -1 )\n\t\t{\n\t\t\t$this->total_images = 0;\n\t\t\treturn;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Are we listing images from a category?\n\t\t// ------------------------------------------------------\n\t\tif( $params['category'] == 'no' )\n\t\t{\n\t\t\t$where = \"category_id=0 \";\n\t\t}\n\t\telse if( $params['category'] )\n\t\t{\n\t\t\t$where = \"category_id={$params['category']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Is this an album?\n\t\t// ------------------------------------------------------\n\t\tif( $params['album'] == 'no' )\n\t\t{\n\t\t\t$where = \"album_id=0 \";\n\t\t}\n\t\telse if( $params['album'] > 0 )\n\t\t{\n\t\t\t$where = \"album_id={$params['album']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Is this a favorte?\n\t\t// ------------------------------------------------------\n\t\tif( $params['favorite'] )\n\t\t{\n\t\t\t$fav_tbl = ', ibf_gallery_favorites f';\n\t\t\t$where = \" f.member_id={$params['favorite']} AND i.id=f.img_id \";\n\t\t\t$this->favorite = true;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Pin Images?\n\t\t// ------------------------------------------------------\n\t\tif( $params['pinned'] )\n\t\t{\n\t\t\t$pin = \"pinned DESC,\";\n\t\t\t$this->pin = 1;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Restrict which categories images are pulled from?\n\t\t// ------------------------------------------------------\n\t\tif( is_array( $params['allow_cats'] ) && $params['category'] != 'no' )\n\t\t{\n\t\t\t$cats = implode( \",\", $params['allow_cats'] );\n\t\t\t$cat_restrict = \" i.category_id IN ( {$cats} ) \";\n\t\t}\n\t\telse if( $params['allow_cats'] == -1 )\n\t\t{\n\t\t\t$cat_restrict = \"category_id=0\";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Restrict which albums images are pulled from?\n\t\t// ------------------------------------------------------\n\t\tif( is_array( $params['allow_albums'] ) && $params['album'] != 'no' )\n\t\t{\n\t\t\t$album = implode( \",\", $params['allow_albums'] );\n\t\t\t$album_restrict = \" i.album_id IN ( {$album} ) \";\n\t\t}\n\t\telse if( $params['allow_albums'] == -1 )\n\t\t{\n\t\t\t$album_restrict = \"album_id=0 \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Format the restrict sql\n\t\t// ------------------------------------------------------\n\t\tif( $album_restrict && $cat_restrict )\n\t\t{\n\t\t\t$restrict = \" ( {$cat_restrict} OR {$album_restrict} ) \";\n\t\t}\n\t\telse if( $album_restrict || $cat_restrict )\n\t\t{\n\t\t\t$restrict = \" {$album_restrict} {$cat_restrict} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Only show a certain members images?\n\t\t// ------------------------------------------------------\n\t\tif( $params['member'] )\n\t\t{\n\t\t\t$where = \"i.member_id={$params['member']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// How many rows are we getting?\n\t\t// ------------------------------------------------------\n\t\tif( isset( $params['st'] ) && isset( $params['show'] ) )\n\t\t{\n\t\t\t$limit = \"LIMIT {$params['st']}, {$params['show']}\";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Show unapproved images?\n\t\t// ------------------------------------------------------\n\t\t$params['approve'] = ( $params['approve'] ) ? ' i.approved=1' : \"\";\n\t\t//$this->mod = ( $params['approve'] ) ? 0 : 1 ;\n\n\t\t/*\n\t\t* Recheck mod status */\n\t\t//$this->mod = $this->ipsclass->member['is_mod'];\n\t\t/*\n\t\t* If input['unapproved'] is set, show only unapproved images */\n\t\t$params['approve'] = ( isset( $this->ipsclass->input['unapproved'] ) ) ? 'i.approved=0' : $params['approve'];\n\t\t\n\t\t// ------------------------------------------------------\n\t\t// Image Sorting\n\t\t// ------------------------------------------------------\n\t\t$sort_key = ( $params['sort_key'] ) ? $params['sort_key'] : 'date';\n\t\t$order_key = ( $params['order_key'] ) ? $params['order_key'] : 'DESC';\n\t\t$prune_key = ( $params['prune_key'] ) ? $params['prune_key'] : '30';\n\t\t\n\t\tif( $sort_key == 'rating' )\n\t\t{\n\t\t\t$sort_key = '(ratings_total/ratings_count)';\t\n\t\t}\n\n\t\tif( $sort_key == 'date' )\n\t\t{\n\t\t\t$sort_extra = \", i.id {$order_key} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Final SQL Formatting\n\t\t// ------------------------------------------------------\n\t\tif( $where )\n\t\t{\n\t\t\t$str = \"{$where} \";\n\t\t}\n\n\t\tif( !empty( $params['approve'] ) )\n\t\t{\n\t\t\t$str = ( $str ) ? \" {$str} AND {$params['approve']} \" : $params['approve'];\n\t\t}\n\n\t\tif( $restrict )\n\t\t{\n\t\t\t$str = ( $str ) ? \" {$str} AND {$restrict} \" : $restrict;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Query the images\n\t\t// ------------------------------------------------------\n\t\t$this->ipsclass->DB->cache_add_query( 'get_images', array( 'fav_tbl' => $fav_tbl,\n\t\t'member_id' => $this->ipsclass->member['id'],\n\t\t'where' => $str,\n\t\t'pin' => $pin,\n\t\t'sort_key' => $sort_key,\n\t\t'order_key' => $order_key,\n\t\t'sort_xtra' => $sort_extra,\n\t\t'limit' => $limit ), 'gallery_sql_queries' );\n\n\t\t// ------------------------------------------------------\n\t\t// Store the results?\n\t\t// ------------------------------------------------------\n\t\t$this->res = $this->ipsclass->DB->simple_exec();\n\n\t\t// ------------------------------------------------------\n\t\t// Store the total images found\n\t\t// ------------------------------------------------------\n\t\t$this->total_images = $this->ipsclass->DB->get_num_rows( $this->res );\n\t}", "public function getOwnedObjects()\n {\n if (array_key_exists(\"ownedObjects\", $this->_propDict)) {\n return $this->_propDict[\"ownedObjects\"];\n } else {\n return null;\n }\n }", "public function materiasHabilitadas(){\n\t\t$connection = Connection::getInstance();\n\t\t$result \t= $connection->query(\"SELECT distinct materias.id \n\t\t\t\t\t\t\t\t\t\t FROM materias, grupos \n\t\t\t\t\t\t\t\t\t\t WHERE grupos.materia_id = materias.id AND \n\t\t\t\t\t\t\t\t\t\t materias.id NOT IN \n\t\t\t\t\t\t\t\t\t\t (SELECT grupos.materia_id \n\t\t\t\t\t\t\t\t\t\t FROM usuarios, inscripciones, grupos \n\t\t\t\t\t\t\t\t\t\t WHERE tipo_usuario = \".Usuario::ESTUDIANTE.\" AND \n\t\t\t\t\t\t\t\t\t\t usuarios.id = $this->id AND \n\t\t\t\t\t\t\t\t\t\t usuarios.id = inscripciones.usuario_id AND \n\t\t\t\t\t\t\t\t\t\t grupos.id = inscripciones.grupo_id)\");\n\t\t$res \t\t= array();\n\t\t\n\t\twhile ($id = pg_fetch_array($result)[0]){\n\t\t\t$res[] = new Materia($id);\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "public function getAllPossibleArticulations()\n {\n // Get the SEs filtered by Permissible Articulations for that appropriate Bone type\n $sb = $this->skeletalbone()->first();\n $sb_articluations = $sb->articulations;\n $articluations_list = null;\n if ($sb_articluations->count()) {\n $query = SkeletalElement::whereIn(\"sb_id\", $sb_articluations->pluck('id'))\n ->where(\"side\", \"!=\", $this->getOppositeSide()) // not opposite side\n ->where(\"id\", \"!=\", $this->id); // not the same se (for bones that can articulate to themselves such as unseriated cervical vertebra)\n $articluations_list = $query->latest()->get();\n }\n return $articluations_list;\n }", "public function getGrids() {\n $gridList = array();\n\n // Query to get all grids from the database\n $query = \"SELECT * FROM grid\";\n $stmt = $this->conn->prepare($query);\n if ($stmt->execute()) {\n // Getting the grids\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n\n // Filling the array with the grid object\n foreach ($result as $grid) {\n $gridModel = new Grid($grid->id, $grid->name, $grid->length, $grid->height);\n array_push($gridList, $gridModel);\n }\n }\n // Returning the array\n return $gridList;\n }", "function getSharings()\n {\n $sharing = new Sharing();\n\n //$sharing->whereAdd(sprintf('profile_id != %d', common_current_user()->getProfile()->id));\n\n $sharing->orderBy('created DESC');\n\n if(!empty($this->pc)) {\n $sharing->whereAdd(sprintf('(lower(displayName) LIKE \"%%%s%%\" OR lower(summary) LIKE \"%%%s%%\")', strtolower($this->pc), strtolower($this->pc)));\n }\n\n if($this->sharing_category_id != 0) {\n $sharing->whereAdd(sprintf('sharing_category_id = %d', $this->sharing_category_id));\n }\n\n if($this->sharing_city_id != 0) {\n $sharing->whereAdd(sprintf('sharing_city_id = %d', $this->sharing_city_id));\n }\n\n if($this->sharing_type_id != 0) {\n $sharing->whereAdd(sprintf('sharing_type_id = %d', $this->sharing_type_id));\n }\n\n if($this->gratuito == true) {\n $sharing->whereAdd('price = 0');\n }\n\n $offset = ($this->page - 1) * PROFILES_PER_PAGE;\n $limit = PROFILES_PER_PAGE + 1;\n \n $sharing->find();\n\n return $sharing;\n }", "public function getImages() {\n\t\treturn($this->images);\n\t}", "function getAllBands() {\n return $this->Band->getAllBands();\n }", "function album_gallery_get_page_content_all($GUID_USER)\n{\n //Take entities from user\n $entita = elgg_get_entities(array(\n 'types' => 'object',\n 'subtypes' => 'album-gallery',\n 'owner_guid' => $GUID_USER,\n 'limit' => 0,\n 'order_by' => 'e.time_created asc'\n ));\n\n if(count($entita) > 0)\n foreach ($entita as $key)\n $immagine .= elgg_view('elgg-album-gallery/all',array(\n 'title' => $key->title,\n 'descr' => $key->description,\n 'album_guid' => $key->guid,\n 'guid_user' => $GUID_USER\n ));\n else\n $immagine = elgg_view('elgg-album-gallery/error', array('error' => elgg_echo('gallery:no:imagegallery')));\n\n $return = array(\n 'title' => elgg_echo('gallery:title:showall'),\n 'content' => $immagine);\n\n return $return;\n}", "protected function getImageCandidates()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->imgElements as $imgElement)\n\t\t{\n\t\t\t$imageDimensions = $this->getImageDimensions($imgElement);\n\t\t\tif($imageDimensions['width'] >= self::MIN_IMAGE_WIDTH && $imageDimensions['height'] >= self::MIN_IMAGE_HEIGHT)\n\t\t\t{\n\t\t\t\t$result[] = $imgElement['src'];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getImages()\r\n {\r\n return $this->images;\r\n }", "function getPools() {\n\n include_once 'pool.php';\n\n $result = new pool();\n $authenticate = $result->getPools();\n\n // checking if bookings have been gotten from database\n if (!$authenticate) {\n echo \"Error getting pool data\";\n return;\n }\n\n $row = $result->fetch();\n if (!$row) {\n echo \"unable to get pool data\";\n return;\n } else {\n\t\t\techo '{\"result\":1,\"pool\":[';\n\t\t\twhile ($row) {\n\t\t\t\techo json_encode($row);\n\t\t\t\t$row = $result->fetch();\n\t\t\t\t\tif ($row) {\n\t\t\t\t\t\techo ',';\n\t\t\t\t\t}\n\t\t\t}\n\t\t\techo ']}';\n\t\t\t\t// echo $row['user_username'];\n\t\t\t\t// $row = $result->fetch();\n\t\t\t}\n }", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "abstract public function showFieldSets();", "public function getImageSet()\n {\n if (!$this->imageSet instanceof ImageSetStorage) {\n $this->imageSet = new ImageSetStorage($this->repository);\n }\n return $this->imageSet;\n }", "public function visible()\n {\n $visible = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && $page->visible()) {\n $visible[$path] = $slug;\n }\n }\n $this->items = $visible;\n\n return $this;\n }", "public abstract function getObjects();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getBilder()\n {\n if (null == $this->bilder_collection) {\n $this->bilder_collection = new BilderSamling($this->getId());\n }\n\n return $this->bilder_collection;\n }", "function getObjects() {\n return $this->objects;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }" ]
[ "0.5854568", "0.58227324", "0.5711955", "0.5711848", "0.5690772", "0.5677374", "0.56007284", "0.55996597", "0.55898464", "0.5575779", "0.5563532", "0.5532307", "0.5483637", "0.5476335", "0.5473596", "0.54683465", "0.5457099", "0.54549575", "0.5446564", "0.54412687", "0.5429133", "0.54202443", "0.5403623", "0.5392062", "0.5388092", "0.53748935", "0.53744113", "0.53716266", "0.53694695", "0.5368506", "0.53450406", "0.53429943", "0.53384864", "0.5327588", "0.5319948", "0.53188044", "0.5311592", "0.5299965", "0.5293297", "0.52930164", "0.5245901", "0.52428126", "0.52197725", "0.52174824", "0.5217416", "0.5207046", "0.5182034", "0.5181815", "0.5181815", "0.5179892", "0.51652235", "0.51652235", "0.51636016", "0.5157776", "0.5137409", "0.5135034", "0.51311016", "0.5128712", "0.51187074", "0.51067394", "0.5098288", "0.50972956", "0.5096664", "0.5091295", "0.5089441", "0.5089203", "0.5061221", "0.5060313", "0.50543904", "0.5051426", "0.50514203", "0.5049197", "0.5047804", "0.5043358", "0.5038707", "0.50352496", "0.5026203", "0.5025198", "0.50240904", "0.5016263", "0.50062054", "0.50032544", "0.5003179", "0.500303", "0.5000086", "0.49967843", "0.4996372", "0.49943382", "0.49906835", "0.498732", "0.4984254", "0.4984254", "0.4984254", "0.4984254", "0.49835807", "0.49814472", "0.49783066", "0.49783066", "0.49783066", "0.49783066", "0.49783066" ]
0.0
-1
Fetch a list of recent photos from the calling users' contacts.
function photos_getContactsPhotos ($count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) { $params = array(); $params['method'] = 'flickr.photos.getContactsPhotos'; $params['count'] = $count; if ($just_friends) $params['just_friends'] = $just_friends; if ($single_photo) $params['single_photo'] = $single_photo; if ($include_self) $params['include_self'] = $include_self; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photos_getRecent ($per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getRecent';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getTenLatestPhotos();", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "function getRecentPhoto()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentPhoto($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getPhotos();", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getAllPhotos();", "public function getUserProfilePhotos($datas = [])\r\n {\r\n return $this->telegram(\"getUserProfilePhotos\", $datas);\r\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "function photos_recentlyUpdated ($per_page = 25, $page = 1, $min_date = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.recentlyUpdated';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif (!$min_date) {\n\t\t\t$params['min_date'] = time()-604800;;\n\t\t}\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getUserContacts()\n\t{\n\t\t$parameters = array( 'page' => 1 );\n\t\t$response = $this->api->get( 'user/list_friends.json', $parameters );\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User contacts request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif( ! $response || ! count( $response->friends ) ){\n\t\t\treturn ARRAY();\n\t\t}\n\n\t\t$max_page = (property_exists($response,'max_page'))?$response->max_page:1;\n\t\tfor ($i = 0; $i<$max_page; $i++) {\n\t\t\tif( $i > 0 ) {\n\t\t\t\t$parameters = array( 'page' => $i );\n\t\t\t\t$response = $this->api->get( 'user/list_friends.json', $parameters );\n\t\t\t\t// check the last HTTP status code returned\n\t\t\t\tif ( $this->api->http_code != 200 ){\n\t\t\t\t\tthrow new Exception( \"User contacts request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $response && count( $response->friends ) ){\n\t\t\t\tforeach( $response->friends as $item ){\n\t\t\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t\t\t$uc->identifier = (property_exists($item,'id_user'))?$item->id_user:\"\";\n\t\t\t\t\t$uc->displayName = (property_exists($item,'username'))?$item->username:\"\";\n\t\t\t\t\t$uc->profileURL = (property_exists($item,'user_url'))?$item->user_url:\"\";\n\t\t\t\t\t$uc->photoURL = (property_exists($item,'avatar_url'))?$item->avatar_url:\"\";\n\t\t\t\t\t//$uc->description = (property_exists($item,'description'))?$item->description:\"\";\n\n\t\t\t\t\t$contacts[] = $uc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $contacts;\n\t}", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function index()\n {\n //\n $id = Auth()->user()->id;\n $photos = Picture::where('user_id', '=', $id )->latest()->get();\n\n $result = $photos->map(function($photo){\n return [\n \"user_id\" => $photo->user_id,\n \"title\" => $photo->title,\n \"photos\" => $photo->photos\n ];\n });\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Records fetched successfully\",\n \"data\" => $result\n ],StatusCodes::SUCCESS);\n }", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "function getUserContacts()\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count'] = 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/contacts', $parameters);\n\n\t\tif ( $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User contacts request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif ( !$response->contacts->contact && ( $response->errcode != 0 ) )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$contacts = array();\n\n\t\tforeach( $response->contacts->contact as $item ) {\n\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t$uc->identifier = $this->selectGUID( $item );\n\t\t\t$uc->email = $this->selectEmail( $item->fields );\n\t\t\t$uc->displayName = $this->selectName( $item->fields );\n\t\t\t$uc->photoURL = $this->selectPhoto( $item->fields );\n\n\t\t\t$contacts[] = $uc;\n\t\t}\n\t\t\n\t\treturn $contacts;\n\t}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function rest_get_avatar_urls($id_or_email)\n {\n }", "public function allPhotosAction() {\r\n $this->view->photo_id = $photo_id = $this->getRequest()->getParam('photo_id', '0');\r\n $this->view->chanel_id = $album_id = $this->getRequest()->getParam('chanel_id', '0');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $params = array();\r\n // send extra params to view for extra URL parameters\r\n $this->view->params = $params;\r\n $page = isset($_POST['page']) ? $_POST['page'] : 1;\r\n $is_ajax = isset($_POST['is_ajax']) ? $_POST['is_ajax'] : 0;\r\n $params['paginator'] = true;\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n //FETCH photos\r\n $paginator = $this->view->allPhotos = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getPhotoCustom($photo, $params, '', true);\r\n $paginator->setItemCountPerPage(30);\r\n $this->view->limit = ($page - 1) * 30;\r\n $this->view->page = $page;\r\n $this->view->is_ajax = $is_ajax;\r\n $paginator->setCurrentPageNumber($page);\r\n }", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "function local_ltiprovider_membership_service_update_userphotos( $userphotos ) {\n\n // Sync of user photos.\n mtrace( \"Sync user profile images\" );\n $counter = 0;\n if ( $userphotos ) {\n foreach ( $userphotos as $userid => $url ) {\n if ( $url ) {\n $result = local_ltiprovider_update_user_profile_image( $userid, $url );\n if ( $result === true ) {\n $counter ++;\n mtrace( \"Profile image succesfully downloaded and created from $url\" );\n } else {\n mtrace( $result );\n }\n }\n }\n }\n mtrace( \"$counter profile images updated\" );\n}", "public function getPhotoUrls () {\n\t\t\n\t}", "public function getAvatarList(){\n return $this->_get(5);\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "function company_photos()\n\t\t{\n\t\t\t$type = $this->uri->segment(5);\n\t\t\t$data = $this->photo->company_photos();\n\t\t\t$this->directPageDetails(\"gallery_company/list_photo_company\",\"\",$data);\n\t\t}", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "public function getProfilePics(array $facebook_uids){\r\n\t\t$profile_pics = array();\r\n\t\t$fb_result = $this->usersGetInfo($facebook_uids, array('pic'));\r\n\t\tif(Helper_Request::assureVariable($fb_result, 'ARR')){\r\n\t\t\tforeach($fb_result as $index => $facebook_info){\r\n\t\t\t\tif(is_array($facebook_info) && array_key_exists('uid', $facebook_info) && array_key_exists('pic', $facebook_info)){\r\n\t\t\t\t\t$profile_pics[$facebook_info['uid']] = $facebook_info['pic'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $profile_pics;\r\n\t}", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "public function getPhotos($page, $itemsPerPage);", "function contacts_getList ($per_page = 25, $page = 1, $filter = NULL) {\n $response = $this->execute(array('method' => 'flickr.contacts.getList', 'per_page' => $per_page, 'page' => $page, 'filter' => $filter));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['contacts'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "function getUserContacts( $userID, $recent ){\r\n\r\n\t\t$query = \"SELECT `ID` FROM contacts \r\n where `Creator` LIKE '%$userID%' || `Modifier` LIKE '%$userID%'\r\n ORDER BY DateCreated DESC\";\r\n\r\n if($recent){\r\n //$now = date('Y-m-d H:i:s');\r\n $past = date('Y-m-d H:i:s', time() - (30*24*60*60)); // a month ago\r\n\t\t $query = \"SELECT `ID` FROM contacts \r\n where `DateCreated` >= '$past'\r\n and (`Creator` LIKE '%$userID%' || `Modifier` LIKE '%$userID%') \r\n ORDER BY DateCreated DESC\";\r\n }\r\n\r\n\t\t$result = mysql_query($query);\r\n\t\tfor($i=0; $results = mysql_fetch_array($result); $i++){\r\n\t\t\t$IDs[$i]=$results['ID'];\r\n\t\t}\r\n\t\treturn $IDs;\r\n\t}", "public static function getUserProfilePhotos(array $data)\n {\n if (empty($data)) {\n throw new TelegramException('Data is empty!');\n }\n\n if (!isset($data['user_id'])) {\n throw new TelegramException('User id is empty!');\n }\n\n return self::send('getUserProfilePhotos', $data);\n }", "protected function getPhotos(Item $album, $number)\n {\n return $album->photos()\n ->uploaded()\n ->orderBy('likes', 'desc')\n ->inRandomOrder()\n ->take($number)\n ->get()\n ->sortBy('number');\n }", "public function view() {\r\n $id = $this->api->getParam('id');\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n $object = $this->model->find_by_id($id);\r\n $images_array = $object->getFlickrImages($this->api->apikey);\r\n $this->api->loadView('contact-view', array(\r\n 'row' => $object,\r\n 'images' => $images_array\r\n ));\r\n }", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "function get_recent_files($num = 10)\n{\n return get_records('File', array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "public function getPhotos($userid)\n {\n $stmt = $this->con->prepare(\"SELECT id_foto, caminho, disciplina, dataCreate FROM tbl_foto WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $userid);\n $stmt->execute();\n $stmt->bind_result($id, $caminho, $disciplina, $data);\n $photos = array();\n\n while ($stmt->fetch()) {\n $photo = array();\n $photo['id'] = $id;\n $photo['caminho'] = $caminho;\n $photo['disciplina'] = $disciplina;\n $photo['userid'] = $userid;\n $photo['data'] = $data;\n array_push($photos, $photo);\n }\n\n $stmt->close();\n return $photos;\n }", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "function photos_getFavorites ($photo_id, $page = 1, $per_page = 20) {\n $response = $this->execute(array('method' => 'flickr.photos.getFavorites', 'photo_id' => $photo_id, 'page' => $page, 'per_page' => $per_page));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo']['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getUserContacts() \r\n\t{\r\n\t\t# to access this area, the user have to be loggedin with an IDp an has a HybridAuth session\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\tHybrid_Auth::addWarning( Hybrid_Auth::text( \"GET_USER_CONTACTS_UNSUPPORTED_WARNING\" ) ); \r\n\r\n\t\treturn NULL;\r\n\t}", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function get_recentfile_list($u_id){\n\t\t$this->db->select('images.img_id,images.img_name,images.imag_org_name,images.img_create_at,favourite.yes')->from('images');\t\t\n\t\t$this->db->join('favourite', 'favourite.file_id = images.img_id', 'left');\n\n\t\t$curr_date = date('Y-m-d h:i:s A', strtotime('-7 days'));\n\t\t$this->db->where('images.u_id', $u_id);\n\t\t$this->db->where('images.img_create_at >', $curr_date);\n\t\t$this->db->order_by(\"images.img_create_at\", \"DESC\");\n\t\treturn $this->db->get()->result_array();\n\t}", "public static function get_photos_by_user($user_id) {\n\t\t$photos_array = array();\n\n\t\t$sql = \"SELECT * \n\t\t FROM photo_directory \n\t\t WHERE user_id = {$user_id}\n\t\t ORDER BY time_uploaded DESC;\";\n\t\t$photos_dbo = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($photos_dbo)) {\n\t\t\tarray_push($photos_array, $row);\n\t\t} \n\n\t\tglobal $firephp;\n\t\t$firephp->log('get_photos_by_user:');\n\t\t$firephp->log($photos_array);\n\t\treturn $photos_array;\n\t}", "function getPictures($fb, $ids) {\n $fql = \"SELECT uid, pic_square FROM user WHERE uid IN (\" . implode(\",\", $ids) . \")\";\n \n $response = $fb->api(array(\n 'method' => 'fql.query',\n 'query' => $fql,\n ));\n \n $picture_by_id = array();\n foreach ($response as $r) {\n $picture_by_id[$r['uid']] = $r['pic_square'];\n }\n \n return $picture_by_id;\n}", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "function getRecents() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY id DESC LIMIT 30;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public function fetchContacts()\n {\n return $this->contacts;\n }", "public function gallery()\n {\n $photos = User::find(Auth::id())->photos()->latest()->paginate(10);\n// dd($photos);\n return view('user.gallery', compact('photos'));\n }", "public function getRecentCreatedUsers()\n {\n $result = $this\n ->_model\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $result;\n }", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "public function getContacts(){\n\t\t// ***\n\t\t// the following code should be ported\n\t\t// so multiple backends are allowed\n\t\t$userOnlineMapper = $this->app['UserOnlineMapper'];\n\t\t$usersOnline = $userOnlineMapper->getOnlineUsers();\n\t\t$syncOnline = $this->app['SyncOnlineCommand'];\n\t\t$syncOnline->execute();\n\t\t// ***\n\n\t\tif(count(self::$contacts) == 0){\n\t\t\t$cm = \\OC::$server->getContactsManager();\n\n\t\t\t$result = $cm->search('',array('FN'));\n\t\t\t$receivers = array();\n\t\t\t$contactList = array();\n\t\t\t$contactsObj = array();\n\t\t\tforeach ($result as $r) {\n\t\t\t\t$data = array();\n\n\t\t\t\t$contactList[] = $r['FN'];\n\n\t\t\t\t$data['id'] = $r['id'];\n\t\t\t\t$data['online'] = in_array($r['id'], $usersOnline);\n\t\t\t\t$data['displayname'] = $r['FN'];\n\n\t\t\t\tif(!isset($r['EMAIL'])){\n\t\t\t\t\t$r['EMAIL'] = array();\n\t\t\t\t}\n\n\t\t\t\tif(!isset($r['IMPP'])){\n\t\t\t\t\t$r['IMPP'] = array();\n\t\t\t\t}\n\t\t\t\t$data['backends'] = $this->contactBackendToBackend($r['EMAIL'], $r['IMPP']);\n\t\t\t\tlist($addressBookBackend, $addressBookId) = explode(':', $r['addressbook-key']);\n\t\t\t\t$data['address_book_id'] = $addressBookId;\n\t\t\t\t$data['address_book_backend'] = $addressBookBackend;\n\t\t\t\t$receivers[] = $data;\n\t\t\t\t$contactsObj[$r['id']] = $data;\n\t\t\t}\n\t\t\tself::$contacts = array('contacts' => $receivers, 'contactsList' => $contactList, 'contactsObj' => $contactsObj);\n\t\t}\n\t\treturn self::$contacts;\n\t}", "public function getContacts();", "public function index()\n {\n return Gallery::latest()->with('images','user','comments.user')->paginate(6);\n }", "function tp_mostrecentimages($max = 8, $pagination = true) {\n\treturn list_entities(\"object\", \"image\", 0, $max, false, false, $pagination);\n}", "public function getPictures($num, $count)\n {\n\n $select;\n\n if(!isset($count) && !isset($num)){\n $select = $this->sql\n ->select()\n ->columns(['pictures_id',\n 'pictures_title',\n 'pictures_description', \n 'pictures_title',\n 'pictures_filename',\n //'authors_firstName',\n //'authors_lastName'\n ])\n ->from('pictures')\n //->join('authors', 'pictures.authors_id = authors.authors_id')\n ->limit(8)\n ;\n }\n else{\n $select = $this->sql\n ->select()\n ->columns(['pictures_id',\n 'pictures_title',\n 'pictures_description', \n 'pictures_title',\n 'pictures_filename',\n //'authors_firstName',\n //'authors_lastName'\n ])\n ->from('pictures')\n //->join('authors', 'pictures.authors_id = authors.authors_id')\n ->offset($num)\n ->limit($count)\n ;\n }\n\n $query = $this->sql->buildSqlString($select);\n\n return $this->adapter->query($query)->execute();\n }", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "public function index()\n {\n return Photo::get();\n }", "public function getAllViewerFriends() {\r\n $this->debug(\"getting all viewer friends...\");\r\n\r\n $count = 1;\r\n $index = 0;\r\n $countPerFetch = 50;\r\n\r\n $allFriends = $this->getViewerFriends($countPerFetch, $index);\r\n $lastCount = count($allFriends);\r\n $this->debug(\"Last count: $lastCount ...\");\r\n $currentIteration = 0;\r\n $maxIterations = 3;\r\n while ($lastCount >= $countPerFetch) {\r\n if ($currentIteration >= $maxIterations) {\r\n $this->debug(\"Reached max of $maxIterations iterations! Stopping loop...\");\r\n break;\r\n }\r\n\r\n $index += $countPerFetch;\r\n $currentBatch = $this->getViewerFriends($countPerFetch, $index);\r\n\r\n $allFriends = array_merge($allFriends, $currentBatch);\r\n $currentIteration++; //could connect this to index and vice versa\r\n\r\n $lastCount = count($currentBatch);\r\n $this->debug(\"Last count: $lastCount ...\");\r\n }\r\n\r\n return $allFriends;\r\n }", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }", "public function getMyContacts()\n\t\t{\n\t\tif (!$this->login_ok)\n\t\t\t{\n\t\t\t$this->debugRequest();\n\t\t\t$this->stopPlugin();\n\t\t\treturn false;\n\t\t\t}\n\t\telse $url=$this->login_ok;\n\t\t$res=$this->get($url,true);\n\t\tif ($this->checkResponse(\"get_friends\",$res))\n\t\t\t$this->updateDebugBuffer('get_friends',\"{$url}\",'GET');\n\t\telse\n\t\t\t{\n\t\t\t$this->updateDebugBuffer('get_friends',\"{$url}\",'GET',false);\n\t\t\t$this->debugRequest();\n\t\t\t$this->stopPlugin();\n\t\t\treturn false;\n\t\t\t}\n\n\t\t$res=str_replace(PHP_EOL,\"\",$res);\n\t\tpreg_match_all(\"#mailto\\:(.+)\\\"#U\",$res,$emails);\n\t\tpreg_match_all(\"#252Fcontacts\\\"\\>(.+)\\<\\/#U\",$res,$names);\t\t\n\t\t$contacts=array();\n\t\tif (!empty($emails[1])) foreach($emails[1] as $key=>$email) if (!empty($names[1][$key])) $contacts[$email]=$names[1][$key];\t\t\t\t\n\t\tforeach ($contacts as $email=>$name) if (!$this->isEmail($email)) unset($contacts[$email]);\n\t\treturn $contacts;\n\t\t}", "public function uultra_get_latest_photos($user_id, $howmany)\r\n\t{\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\trequire_once(ABSPATH . 'wp-includes/link-template.php');\r\n\t\t\r\n\t\t$site_url = site_url().\"/\";\t\t\r\n\t\t\r\n\t\t$upload_folder = $xoouserultra->get_option('media_uploading_folder'); \r\n\t\t\t\r\n\t\t\r\n\t\t$dr = $xoouserultra->photogallery->get_latest_photos_public($user_id, $howmany);\r\n\t\t\r\n\t\t\r\n\t\t$header_css = $this->get_widget_header_inline_css(3);\r\n\t\t$widget_bg_css = $this->get_widget_bg_inline_css(3);\r\n\t\t$widget_font_color_css = $this->get_widget_box_color_css(3);\r\n\t\t$widget_text = $this->get_widget_header_text(3);\r\n\t\t\r\n\t\t$html = \"\";\r\n\t\t\r\n\t\t $html .= '<li><!--- widget 2 column 1---> \r\n <div class=\"widget-ultra\">\r\n <h3 class=\"uultra-gnral\" '.$header_css.'>'.$widget_text.'</h3>\r\n <section class=\"default-bg uultra-profile-widget-arrow-3\"> \r\n <div class=\"uultra-latest-photo\" '.$widget_bg_css.'>\t\t\t\t\t \r\n <ul>';\r\n\t\t\t\t\t \r\n\t\t //get my latest photos\r\n\t foreach ( $dr as $photo )\r\n\t\t\t {\r\n\t\t\t\t \r\n\t\t\t\t $file=$photo->photo_thumb;\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t $thumb = $site_url.$upload_folder.\"/\".$user_id.\"/\".$file;\r\n\t\t\t\t\r\n\t\t\t\t $html .= '<li><a href=\"'.$xoouserultra->userpanel->public_profile_get_photo_link($photo->photo_id, $user_id).'\"><img src=\"'.$thumb.'\" class=\"rounded\"/> </a></li>' ; \r\n\t\t\t \r\n\t\t\t }\r\n \r\n\t\t $html .= ' </ul>\r\n </div> \r\n </section>\r\n </div> \r\n </li><!--- End widget 2 --->';\r\n\t\t\t\t \r\n\t\t\t\t \r\n\treturn $html;\t\t\t \r\n\t\t\r\n\t}", "function get_photos($groupid, $photo_number=1) {\n\n //parameters to use\n $params = array(\n 'api_key' => $this->flickr_api_key,\n 'method' => 'flickr.groups.pools.getPhotos',\n 'group_id' => $groupid,\n 'per_page' => $this->photos_per_page,\n 'page' => (string) $photo_number,\n 'extras' => 'url_m,path_alias,url_t,url_s,url_o',\n 'format' => 'php_serial',\n );\n //make the parameters nice for api call\n $url_params = array();\n foreach ($params as $k => $v) {\n $url_params[] = urlencode($k) . '=' . urlencode($v);\n }\n \n //make the api call\n $url = 'http://api.flickr.com/services/rest/?' . implode('&', $url_params);\n $response = file_get_contents($url);\n \n $resp_array = unserialize($response);\n\n if ($resp_array['stat'] == 'ok') {\n //Everything ok! Return the photo object\n return $resp_array['photos']['photo'];\n } else {\n //Something went wrong with the flickr call\n //We say this by returning NULL\n \n //Temporary error message\n echo \"Nu blev det nåt fel med flickr! Ojojoj!\";\n \n return NULL;\n \n }\n}", "function retrieve_recent_profile_views(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_recent_profile_views($this->promoter->pt_id);\n\t\t\n\t}", "public function global_get_photos($id, $type = 'user',$user_id=null, $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->global_get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n // echo'<pre>'; print_r($user_id);die;\n if(!empty($user_id)){\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s And posts.user_id= %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($user_id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }else{\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }\n \n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "public function index()\n {\n // Favorite users photos area\n $PopularPhotos = $this->homeService->getPopularPhotos();\n\n $Top = $PopularPhotos[0];\n $Others = array_slice($PopularPhotos->toArray(), 1);\n\n // Top User Information\n $TopUserPhotos = $this->photoService->getPhotosById($PopularPhotos[0]->user_id, false)->items();\n\n // Random photos area\n $RandomPhotos = $this->homeService->getRandomPhotos();\n\n // New Members photos area\n $NewMembers = $this->homeService->getNewMembersPhotos();\n\n //RankedUsers PopularPhotos\n return compact('TopUserPhotos','RandomPhotos','NewMembers','Top','Others');\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "function getRandomFavoritePhoto($userEmail) {\n $api = new Phlickr_Api(FLICKR_API_KEY, FLICKR_API_SECRET);\n // load a saved cache file if it exists, set the expiration limit to a week.\n $api->setCache(Phlickr_Cache::createFrom(CACHE_FILE, 60*60*24*7));\n\n // select a random favorite photo\n $user = Phlickr_User::findByEmail($api, $userEmail);\n $favlist = $user->getFavoritePhotoList();\n $photo = $favlist->getRandomPhoto();\n\n assert(!is_null($photo));\n\n // serialize and save the cache file\n $api->getCache()->saveAs(CACHE_FILE);\n\n return $photo;\n}", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "function get_pics($db,$tag,$current,$num=5) {\n\t\n\t// holder for pictures selected\n\t$pics = array();\n\t\n\t// condition to search on to avoid picking dupes\n\t$cond = (count($current)) ? 'id !=' . implode(\" AND id !=\", $current) : '1';\n\t\n\t\n\t$card_deck = CARD_DECK; // database table for photos\n\t\n\t// query for random selection from database\n\t$query = \"SELECT * FROM $card_deck WHERE $cond and tag='$tag' and active=1 ORDER BY RAND() limit 0,$num\";\n\t\n\t$result = mysqli_query($db, $query);\t\n\tif (mysqli_error($db) ) echo 'Ouch! Database problem:' . mysqli_error($db);\n\t\n\t while ($row = mysqli_fetch_array($result)) {\n\t \t$pics[] = array(\n\t \t\t'id' => $row['id'], \n\t \t\t'url' => \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_m.jpg\",\n\t \t\t'link' => \"http://www.flickr.com/photos/\" . $row['nsid'] . \"/\" . $row['fid'] . \"/\",\n\t \t\t'credit' => stripslashes($row['username']),\n\t \t\t);\n }\n\n\treturn $pics;\n}", "public function getPhoto($userId, $size);", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "protected function fetchAllImages(){\n $this->fetchImagesInContent();\n $this->fetchFullTextImage();\n $this->fetchIntroImage();\n $this->fetchFirstImageInContent();\n }", "public function getContacts($keyword = \"\", $limit = 10, $page = 1)\r\n {\r\n $authenticatedUser = $this->authenticatedUser;\r\n $offset = $this->getOffset($limit, $page);\r\n $userContacts = $this->contactService->getContacts($authenticatedUser, $keyword, $limit, $offset);\r\n\r\n $contacts = array();\r\n foreach ($userContacts as $contact) {\r\n $userProfileImage = $contact->getPrimaryImage();\r\n\r\n extract($this->getPrimaryImages($userProfileImage, $contact));\r\n\r\n $recievedUnreadMessages = $contact->getUnreadRecievedMessagesFromUser($authenticatedUser);\r\n\r\n $store = null;\r\n if($contact->getUserType() == User::USER_TYPE_SELLER){\r\n $store = $contact->getStore();\r\n }\r\n\r\n array_push($contacts, array(\r\n \"userId\" => $contact->getUserId(),\r\n \"slug\" => $contact->getUserType() == User::USER_TYPE_SELLER? $store->getStoreSlug() : $contact->getSlug(),\r\n \"fullName\" => !is_null($store)? $store->getStoreName() : $contact->getFullName(),\r\n \"profileImageUrl\" => $profileImageUrl,\r\n \"profileThumbnailImageUrl\" => $profileThumbnailImageUrl,\r\n \"profileSmallImageUrl\" => $profileSmallImageUrl,\r\n \"profileMediumImageUrl\" => $profileMediumImageUrl,\r\n \"profileLargeImageUrl\" => $profileLargeImageUrl,\r\n \"isOnline\" => $contact->getActiveNonIdleDevices()->count()? \"1\" : \"0\",\r\n \"hasUnreadMessage\" => (string)$recievedUnreadMessages->count()\r\n ));\r\n }\r\n\r\n return $contacts;\r\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "function getPhoto()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$response = $this->mapi->getPhoto($id);\n\n\t\techo json_encode($response);\n\t}", "public function viewMultiple(){\n // Default configuration\n $orderBy = Input::get('orderBy') ? Input::get('orderBy') : 'created_at';\n $limit = Input::get('limit') ? Input::get('limit') : 30;\n \n if(!Cache::has('maxStartAt')){\n Cache::add('maxStartAt', DB::table('images')->count() - $limit, 10);\n }\n \n if(Input::has('startAt')){\n $startAt = Input::get('startAt');\n }else{\n if(Cache::get('maxStartAt') > 0){\n $startAt = rand(1, Cache::get('maxStartAt'));\n }else{\n $startAt = 0;\n }\n }\n \n // Take rates relation\n $images = Image::with('ratees')->take($limit)->skip($startAt)->orderBy($orderBy)->get();\n \n\tif($images->count() == 0){\n\t\treturn $this->jsonResponse(\"error\", \"No images found with given parameters\", Input::get('callback'));\n\t}\n\t\t\n\treturn $this->jsonResponse(\"ok\", \"Images found\", Input::get('callback'), $images);\n }", "public function getMyContacts()\r\n {\r\n $contacts=$this->plugin->getMyContacts();\r\n //if ($contacts!==false) $this->statsRecordImport(count($contacts));\r\n return $contacts;\r\n }" ]
[ "0.68440557", "0.6666258", "0.6618044", "0.65922886", "0.65017796", "0.64848036", "0.6447779", "0.6435721", "0.64054793", "0.62770945", "0.6248473", "0.6184491", "0.6127249", "0.6055801", "0.60177565", "0.5982734", "0.59674066", "0.59271115", "0.5924531", "0.58834046", "0.58529484", "0.58066577", "0.578659", "0.57732743", "0.56949335", "0.56767607", "0.5671538", "0.5670543", "0.5638772", "0.56150264", "0.56104374", "0.56085217", "0.56011444", "0.5588815", "0.5587722", "0.55825317", "0.55691177", "0.5567643", "0.555731", "0.552272", "0.5520471", "0.54845464", "0.54843295", "0.54831916", "0.5477589", "0.5471107", "0.54706234", "0.5439844", "0.5438328", "0.54225516", "0.54160464", "0.5404828", "0.54026324", "0.5399471", "0.53667665", "0.53556967", "0.533807", "0.5337342", "0.5325154", "0.53174406", "0.5312038", "0.5310487", "0.530466", "0.5299023", "0.52945924", "0.5287364", "0.528483", "0.52705485", "0.5267779", "0.5262293", "0.5256697", "0.5224759", "0.5224418", "0.52069193", "0.5203257", "0.51966214", "0.51964587", "0.5192463", "0.51878524", "0.5171159", "0.5163823", "0.51571745", "0.5153119", "0.5150219", "0.5147124", "0.51419353", "0.514056", "0.5139811", "0.5129767", "0.5126798", "0.5122231", "0.5118872", "0.51136184", "0.5107497", "0.51067525", "0.51049626", "0.51047575", "0.5094195", "0.5089277", "0.508919" ]
0.72992504
0
Fetch a list of recent public photos from a users' contacts.
function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) { $params = array(); $params['method'] = 'flickr.photos.getContactsPublicPhotos'; $params['user_id'] = $user_id; $params['count'] = $count; if ($just_friends) $params['just_friends'] = $just_friends; if ($single_photo) $params['single_photo'] = $single_photo; if ($include_self) $params['include_self'] = $include_self; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function photos_getContactsPhotos ($count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPhotos';\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos();", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getAllPhotos();", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getTenLatestPhotos();", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "function photos_getRecent ($per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getRecent';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function getUserProfilePhotos($datas = [])\r\n {\r\n return $this->telegram(\"getUserProfilePhotos\", $datas);\r\n }", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "function getRecentPhoto()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentPhoto($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function index()\n {\n //\n $id = Auth()->user()->id;\n $photos = Picture::where('user_id', '=', $id )->latest()->get();\n\n $result = $photos->map(function($photo){\n return [\n \"user_id\" => $photo->user_id,\n \"title\" => $photo->title,\n \"photos\" => $photo->photos\n ];\n });\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Records fetched successfully\",\n \"data\" => $result\n ],StatusCodes::SUCCESS);\n }", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "public function allPhotosAction() {\r\n $this->view->photo_id = $photo_id = $this->getRequest()->getParam('photo_id', '0');\r\n $this->view->chanel_id = $album_id = $this->getRequest()->getParam('chanel_id', '0');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $params = array();\r\n // send extra params to view for extra URL parameters\r\n $this->view->params = $params;\r\n $page = isset($_POST['page']) ? $_POST['page'] : 1;\r\n $is_ajax = isset($_POST['is_ajax']) ? $_POST['is_ajax'] : 0;\r\n $params['paginator'] = true;\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n //FETCH photos\r\n $paginator = $this->view->allPhotos = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getPhotoCustom($photo, $params, '', true);\r\n $paginator->setItemCountPerPage(30);\r\n $this->view->limit = ($page - 1) * 30;\r\n $this->view->page = $page;\r\n $this->view->is_ajax = $is_ajax;\r\n $paginator->setCurrentPageNumber($page);\r\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "function company_photos()\n\t\t{\n\t\t\t$type = $this->uri->segment(5);\n\t\t\t$data = $this->photo->company_photos();\n\t\t\t$this->directPageDetails(\"gallery_company/list_photo_company\",\"\",$data);\n\t\t}", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "function photos_recentlyUpdated ($per_page = 25, $page = 1, $min_date = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.recentlyUpdated';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif (!$min_date) {\n\t\t\t$params['min_date'] = time()-604800;;\n\t\t}\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "function rest_get_avatar_urls($id_or_email)\n {\n }", "function getUserContacts()\n\t{\n\t\t$parameters = array( 'page' => 1 );\n\t\t$response = $this->api->get( 'user/list_friends.json', $parameters );\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User contacts request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif( ! $response || ! count( $response->friends ) ){\n\t\t\treturn ARRAY();\n\t\t}\n\n\t\t$max_page = (property_exists($response,'max_page'))?$response->max_page:1;\n\t\tfor ($i = 0; $i<$max_page; $i++) {\n\t\t\tif( $i > 0 ) {\n\t\t\t\t$parameters = array( 'page' => $i );\n\t\t\t\t$response = $this->api->get( 'user/list_friends.json', $parameters );\n\t\t\t\t// check the last HTTP status code returned\n\t\t\t\tif ( $this->api->http_code != 200 ){\n\t\t\t\t\tthrow new Exception( \"User contacts request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif( $response && count( $response->friends ) ){\n\t\t\t\tforeach( $response->friends as $item ){\n\t\t\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t\t\t$uc->identifier = (property_exists($item,'id_user'))?$item->id_user:\"\";\n\t\t\t\t\t$uc->displayName = (property_exists($item,'username'))?$item->username:\"\";\n\t\t\t\t\t$uc->profileURL = (property_exists($item,'user_url'))?$item->user_url:\"\";\n\t\t\t\t\t$uc->photoURL = (property_exists($item,'avatar_url'))?$item->avatar_url:\"\";\n\t\t\t\t\t//$uc->description = (property_exists($item,'description'))?$item->description:\"\";\n\n\t\t\t\t\t$contacts[] = $uc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $contacts;\n\t}", "public function getAllPublicPhotosJson(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0';\n $photos = $this->executeQuery($sql);\n while ($photo = $photos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $photo;\n }\n $photosJson = json_encode($data);\n echo $photosJson;\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function getPhotos($page, $itemsPerPage);", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "function contacts_getList ($per_page = 25, $page = 1, $filter = NULL) {\n $response = $this->execute(array('method' => 'flickr.contacts.getList', 'per_page' => $per_page, 'page' => $page, 'filter' => $filter));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['contacts'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "public function view() {\r\n $id = $this->api->getParam('id');\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n $object = $this->model->find_by_id($id);\r\n $images_array = $object->getFlickrImages($this->api->apikey);\r\n $this->api->loadView('contact-view', array(\r\n 'row' => $object,\r\n 'images' => $images_array\r\n ));\r\n }", "public function getProfilePics(array $facebook_uids){\r\n\t\t$profile_pics = array();\r\n\t\t$fb_result = $this->usersGetInfo($facebook_uids, array('pic'));\r\n\t\tif(Helper_Request::assureVariable($fb_result, 'ARR')){\r\n\t\t\tforeach($fb_result as $index => $facebook_info){\r\n\t\t\t\tif(is_array($facebook_info) && array_key_exists('uid', $facebook_info) && array_key_exists('pic', $facebook_info)){\r\n\t\t\t\t\t$profile_pics[$facebook_info['uid']] = $facebook_info['pic'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $profile_pics;\r\n\t}", "public function getPhotos($userid)\n {\n $stmt = $this->con->prepare(\"SELECT id_foto, caminho, disciplina, dataCreate FROM tbl_foto WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $userid);\n $stmt->execute();\n $stmt->bind_result($id, $caminho, $disciplina, $data);\n $photos = array();\n\n while ($stmt->fetch()) {\n $photo = array();\n $photo['id'] = $id;\n $photo['caminho'] = $caminho;\n $photo['disciplina'] = $disciplina;\n $photo['userid'] = $userid;\n $photo['data'] = $data;\n array_push($photos, $photo);\n }\n\n $stmt->close();\n return $photos;\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "function local_ltiprovider_membership_service_update_userphotos( $userphotos ) {\n\n // Sync of user photos.\n mtrace( \"Sync user profile images\" );\n $counter = 0;\n if ( $userphotos ) {\n foreach ( $userphotos as $userid => $url ) {\n if ( $url ) {\n $result = local_ltiprovider_update_user_profile_image( $userid, $url );\n if ( $result === true ) {\n $counter ++;\n mtrace( \"Profile image succesfully downloaded and created from $url\" );\n } else {\n mtrace( $result );\n }\n }\n }\n }\n mtrace( \"$counter profile images updated\" );\n}", "public function global_get_photos($id, $type = 'user',$user_id=null, $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->global_get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n // echo'<pre>'; print_r($user_id);die;\n if(!empty($user_id)){\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s And posts.user_id= %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($user_id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }else{\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }\n \n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "public static function get_photos_by_user($user_id) {\n\t\t$photos_array = array();\n\n\t\t$sql = \"SELECT * \n\t\t FROM photo_directory \n\t\t WHERE user_id = {$user_id}\n\t\t ORDER BY time_uploaded DESC;\";\n\t\t$photos_dbo = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($photos_dbo)) {\n\t\t\tarray_push($photos_array, $row);\n\t\t} \n\n\t\tglobal $firephp;\n\t\t$firephp->log('get_photos_by_user:');\n\t\t$firephp->log($photos_array);\n\t\treturn $photos_array;\n\t}", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "function get_photos($groupid, $photo_number=1) {\n\n //parameters to use\n $params = array(\n 'api_key' => $this->flickr_api_key,\n 'method' => 'flickr.groups.pools.getPhotos',\n 'group_id' => $groupid,\n 'per_page' => $this->photos_per_page,\n 'page' => (string) $photo_number,\n 'extras' => 'url_m,path_alias,url_t,url_s,url_o',\n 'format' => 'php_serial',\n );\n //make the parameters nice for api call\n $url_params = array();\n foreach ($params as $k => $v) {\n $url_params[] = urlencode($k) . '=' . urlencode($v);\n }\n \n //make the api call\n $url = 'http://api.flickr.com/services/rest/?' . implode('&', $url_params);\n $response = file_get_contents($url);\n \n $resp_array = unserialize($response);\n\n if ($resp_array['stat'] == 'ok') {\n //Everything ok! Return the photo object\n return $resp_array['photos']['photo'];\n } else {\n //Something went wrong with the flickr call\n //We say this by returning NULL\n \n //Temporary error message\n echo \"Nu blev det nåt fel med flickr! Ojojoj!\";\n \n return NULL;\n \n }\n}", "public function index()\n {\n return Photo::get();\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "public function getAvatarList(){\n return $this->_get(5);\n }", "protected function getPhotos(Item $album, $number)\n {\n return $album->photos()\n ->uploaded()\n ->orderBy('likes', 'desc')\n ->inRandomOrder()\n ->take($number)\n ->get()\n ->sortBy('number');\n }", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function index()\n {\n return Gallery::latest()->with('images','user','comments.user')->paginate(6);\n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function get_objects($offset, $count, $order_property = null)\r\n {\r\n $order_property = $this->get_order_property($order_property);\r\n return $this->get_browser()->retrieve_photo_gallery_publications($this->get_condition(), $order_property, $offset, $count);\r\n }", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "function getUserContacts()\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count'] = 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/contacts', $parameters);\n\n\t\tif ( $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User contacts request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif ( !$response->contacts->contact && ( $response->errcode != 0 ) )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$contacts = array();\n\n\t\tforeach( $response->contacts->contact as $item ) {\n\t\t\t$uc = new Hybrid_User_Contact();\n\n\t\t\t$uc->identifier = $this->selectGUID( $item );\n\t\t\t$uc->email = $this->selectEmail( $item->fields );\n\t\t\t$uc->displayName = $this->selectName( $item->fields );\n\t\t\t$uc->photoURL = $this->selectPhoto( $item->fields );\n\n\t\t\t$contacts[] = $uc;\n\t\t}\n\t\t\n\t\treturn $contacts;\n\t}", "public function index()\n {\n // Favorite users photos area\n $PopularPhotos = $this->homeService->getPopularPhotos();\n\n $Top = $PopularPhotos[0];\n $Others = array_slice($PopularPhotos->toArray(), 1);\n\n // Top User Information\n $TopUserPhotos = $this->photoService->getPhotosById($PopularPhotos[0]->user_id, false)->items();\n\n // Random photos area\n $RandomPhotos = $this->homeService->getRandomPhotos();\n\n // New Members photos area\n $NewMembers = $this->homeService->getNewMembersPhotos();\n\n //RankedUsers PopularPhotos\n return compact('TopUserPhotos','RandomPhotos','NewMembers','Top','Others');\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }", "public function get_photos($id, $type = 'user', $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n $query = sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false));\n $get_photos = $db->query($query) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "public function all_userPost_picture_for_footer(){\r\n $query = \"SELECT car_image FROM tbl_user_post WHERE publication_status = 1 ORDER BY user_post_id DESC LIMIT 12\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "function asu_isearch_fetch_profile_photo($data) {\n $photo_url = $data['photo_url'];\n $destination = $data['destination'];\n\n $entity = current(entity_load('node', array($data['entity'])));\n\n if (!$entity) {\n return;\n }\n\n // ensure the file is truly accessible\n $response = drupal_http_request($photo_url);\n if ($response->code == 200) {\n\n $file = FALSE;\n $photo_exists = file_exists($destination);\n\n // does the file already exist on the server?\n // if yes, associate it\n if ($photo_exists) {\n $file = current(entity_load('file', array(), array('uri' => $destination.'')));\n }\n\n if (!$photo_exists || filesize($destination) != $response->headers['content-length']) {\n $file = system_retrieve_file($photo_url, $destination, TRUE, $replace = FILE_EXISTS_REPLACE);\n }\n \n if ($file) {\n // Load the node so we can set\n $entity->field_isearch_photo_url[LANGUAGE_NONE][0]['fid'] = $file->fid;\n node_save($entity);\n }\n }\n}", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function getPictures($num, $count)\n {\n\n $select;\n\n if(!isset($count) && !isset($num)){\n $select = $this->sql\n ->select()\n ->columns(['pictures_id',\n 'pictures_title',\n 'pictures_description', \n 'pictures_title',\n 'pictures_filename',\n //'authors_firstName',\n //'authors_lastName'\n ])\n ->from('pictures')\n //->join('authors', 'pictures.authors_id = authors.authors_id')\n ->limit(8)\n ;\n }\n else{\n $select = $this->sql\n ->select()\n ->columns(['pictures_id',\n 'pictures_title',\n 'pictures_description', \n 'pictures_title',\n 'pictures_filename',\n //'authors_firstName',\n //'authors_lastName'\n ])\n ->from('pictures')\n //->join('authors', 'pictures.authors_id = authors.authors_id')\n ->offset($num)\n ->limit($count)\n ;\n }\n\n $query = $this->sql->buildSqlString($select);\n\n return $this->adapter->query($query)->execute();\n }", "function photos_search ($per_page = 25, $page = 1, $tags = NULL, $text = NULL, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.search';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($tags) {\n\t\t\t$tags = explode(',', $tags);\n\t\t\tarray_map('trim', $tags);\n\t\t\t$tags = implode(',', $tags);\n\t\t\t$params['tags'] = $tags;\n\t\t}\n\t\tif ($text) $params['text'] = trim($text);\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getUserContacts( $userID, $recent ){\r\n\r\n\t\t$query = \"SELECT `ID` FROM contacts \r\n where `Creator` LIKE '%$userID%' || `Modifier` LIKE '%$userID%'\r\n ORDER BY DateCreated DESC\";\r\n\r\n if($recent){\r\n //$now = date('Y-m-d H:i:s');\r\n $past = date('Y-m-d H:i:s', time() - (30*24*60*60)); // a month ago\r\n\t\t $query = \"SELECT `ID` FROM contacts \r\n where `DateCreated` >= '$past'\r\n and (`Creator` LIKE '%$userID%' || `Modifier` LIKE '%$userID%') \r\n ORDER BY DateCreated DESC\";\r\n }\r\n\r\n\t\t$result = mysql_query($query);\r\n\t\tfor($i=0; $results = mysql_fetch_array($result); $i++){\r\n\t\t\t$IDs[$i]=$results['ID'];\r\n\t\t}\r\n\t\treturn $IDs;\r\n\t}", "public function getAllPhotosAndLikes($idMember, $idConnectMember){\n $sql = 'SELECT photos.*, IF(likes.id_photo IS NULL, FALSE, TRUE) as liked \n FROM photos \n LEFT JOIN likes \n ON (likes.id_member = ? AND likes.id_photo = photos.id)\n WHERE photos.memberId = ?\n ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idConnectMember, $idMember));\n return $photos;\n }", "public static function getUserProfilePhotos(array $data)\n {\n if (empty($data)) {\n throw new TelegramException('Data is empty!');\n }\n\n if (!isset($data['user_id'])) {\n throw new TelegramException('User id is empty!');\n }\n\n return self::send('getUserProfilePhotos', $data);\n }", "public function gallery()\n {\n $photos = User::find(Auth::id())->photos()->latest()->paginate(10);\n// dd($photos);\n return view('user.gallery', compact('photos'));\n }", "function photos_getFavorites ($photo_id, $page = 1, $per_page = 20) {\n $response = $this->execute(array('method' => 'flickr.photos.getFavorites', 'photo_id' => $photo_id, 'page' => $page, 'per_page' => $per_page));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo']['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "function getPictures($fb, $ids) {\n $fql = \"SELECT uid, pic_square FROM user WHERE uid IN (\" . implode(\",\", $ids) . \")\";\n \n $response = $fb->api(array(\n 'method' => 'fql.query',\n 'query' => $fql,\n ));\n \n $picture_by_id = array();\n foreach ($response as $r) {\n $picture_by_id[$r['uid']] = $r['pic_square'];\n }\n \n return $picture_by_id;\n}", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function getPeople()\n {\n //Get query\n $db = JFactory::getDBO();\n $query = $this->_buildQuery();\n\n $view = $this->app->input->get('view');\n $layout = $this->app->input->get('layout');\n\n /** ------------------------------------------\n * Set query limits/ordering and load results\n */\n $limit = $this->getState($this->_view.'_limit');\n $limitStart = $this->getState($this->_view.'_limitstart');\n if (!$this->_id && $limit != 0) {\n $query->order($this->getState('People.filter_order') . ' ' . $this->getState('People.filter_order_Dir'));\n if ( $limitStart >= $this->getTotal() ) {\n $limitStart = 0;\n $limit = 10;\n $limitStart = ($limit != 0) ? (floor($limitStart / $limit) * $limit) : 0;\n $this->state->set($this->_view.'_limit', $limit);\n $this->state->set($this->_view.'_limitstart', $limitStart);\n }\n $query .= \" LIMIT \".($limit).\" OFFSET \".($limitStart);\n }\n $db->setQuery($query);\n $people = $db->loadAssocList();\n\n //generate query to join deals\n if ( count($people) > 0 ) {\n\n $export = $this->app->input->get('export');\n\n if (!$export) {\n\n //generate query to join notes\n foreach ($people as $key => $person) {\n\n /* Deals */\n $dealModel = new Deal;\n $dealModel->set('person_id',$person['id']);\n $people[$key]['deals'] = $dealModel->getDeals();;\n\n /* Notes */\n $notesModel = new Note;\n $people[$key]['notes'] = $notesModel->getNotes($person['id'],'people');\n\n /* Docs */\n $docsModel = new Document;\n $docsModel->set('person_id',$person['id']);\n $people[$key]['documents'] = $docsModel->getDocuments();\n\n /* Tweets */\n if ($person['twitter_user']!=\"\" && $person['twitter_user']!=\" \") {\n $people[$key]['tweets'] = TweetsHelper::getTweets($person['twitter_user']);\n }\n\n }\n\n }\n }\n\n $this->app->triggerEvent('onPersonLoad', array(&$people));\n\n //return results\n return $people;\n\n }", "public function getContacts();", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "function get_all_contacts() {\n //get all the users\n $task = Doctrine_Query::create()\n ->from('Zim_Model_User');\n $exec = $task->execute();\n $contacts = $exec->toArray();\n //return the array of contacts\n return $contacts;\n\n }", "public function getMyImagefeedsAction()\n {\n\t echo Zend_Json::encode( \\Extended\\wall_post::getUserWall_lite( Auth_UserAdapter::getIdentity()->getId() , $this->getRequest()->getParam(\"offset\"), 10, Extended\\wall_post::WALL_TYPE_SOCIALISE ) );\n\t die;\n }", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "public function getPhoto($userId, $size);", "public function index()\n {\n return SocialMediaResource::collection(SocialMedia::all()->sortBy('sequence'));\n }", "function roverPhotos() {\n $apiKey = 'MJNM4W8Ot1jbNzCPVOVLBd5v381zqy7m57Rl9p6d';\n $cam = $_POST['rover'];\n $sol = rand(0, 1000);\n $url = \"https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?sol=\". $sol .\"&camera=\". $cam .\"&api_key=\". $apiKey;\n $json = file_get_contents($url);\n $array = json_decode($json, true);\n echo '<div class=\"img\">';\n echo '<img class=img src='. \"'\" . $array['photos'][0][\"img_src\"]. \"'\" .'>';\n echo \"</div>\";\n}", "function getImages() {\n $bdd = getBdd();\n $users = $bdd->query('select IMG_PATH as path,'\n . ' USER_ID as user_id, REV_ID as rev_id'\n . ' from T_IMAGES')->fetchAll(PDO::FETCH_ASSOC);\n return $users;\n}", "public static function getList($currentPage=0, $order=\"uploadDate DESC\") {\n\t\t\n\t\t$x = $currentPage * NUM_PER_PAGE;\n\t\t$y = $x+NUM_PER_PAGE;\n\n\t\t$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n\t\t$sql = \"SELECT * FROM images WHERE published = 1 ORDER BY uploadDate DESC LIMIT :x, :y\";\n\n\t\t$st = $conn->prepare($sql);\n\t\t$st->bindValue(\":x\", $x, PDO::PARAM_INT);\n\t\t$st->bindValue(\":y\", $y, PDO::PARAM_INT);\n\t\t$st->execute();\n\t\t$list = array();\n\t\t\n\t\twhile ($row = $st->fetch()) {\n\t\t\t$image = new Image($row);\n\t\t\t$list[] = $image;\n\t\t}\n\t\t\n\t\t$sql = \"SELECT FOUND_ROWS() AS totalRows\";\n\t\t$totalRows = $conn->query($sql)->fetch();\n\t\t$conn = null;\n\t\t//$row = $st->fetch();\n\t\t//return json_encode($row);\n\t\treturn(array(\"results\"=>$list, \"totalRows\"=>$totalRows[0]));\n\t}", "public function getIndividualsPersonalPhotos($individuals)\n {\n $personalPhotos = array();\n $uniquePersonalPhotoIds = array();\n foreach ($individuals as $individual) {\n if (isset($individual['personal_photo'])) {\n $uniquePersonalPhotoIds[$individual['personal_photo']['id']] = true;\n }\n }\n\n if (!empty($uniquePersonalPhotoIds)) {\n $personalPhotoIds = array_keys($uniquePersonalPhotoIds);\n $personalPhotos = $this->getFamilyGraph()->api($personalPhotoIds);\n }\n\n return $personalPhotos;\n }", "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "function getRandomFavoritePhoto($userEmail) {\n $api = new Phlickr_Api(FLICKR_API_KEY, FLICKR_API_SECRET);\n // load a saved cache file if it exists, set the expiration limit to a week.\n $api->setCache(Phlickr_Cache::createFrom(CACHE_FILE, 60*60*24*7));\n\n // select a random favorite photo\n $user = Phlickr_User::findByEmail($api, $userEmail);\n $favlist = $user->getFavoritePhotoList();\n $photo = $favlist->getRandomPhoto();\n\n assert(!is_null($photo));\n\n // serialize and save the cache file\n $api->getCache()->saveAs(CACHE_FILE);\n\n return $photo;\n}", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "public function topContributors()\r\n {\r\n $this->paginatedResult->setLimit(35);\r\n $this->paginatedResult->setOffset(0);\r\n $query = \"SELECT count(b.id) as total , b.user_login, b.profile_image FROM links a inner join users b on a.ID_User = b.ID where a.id_status = 4 group by b.user_login order by total DESC\";\r\n $this->paginatedResult->setQuery( $query );\r\n\t$this->paginatedResult->setMethod( 'cache' );\r\n\t$this->paginatedResult->generatePagination();\r\n\treturn $this->paginatedResult;\r\n }" ]
[ "0.7301247", "0.7199164", "0.688835", "0.6676204", "0.6649503", "0.65172833", "0.6448596", "0.64393145", "0.63865054", "0.6377215", "0.6306663", "0.6274159", "0.62488616", "0.61948913", "0.6165222", "0.61591196", "0.6140508", "0.61305773", "0.6092145", "0.6075333", "0.6031383", "0.6015164", "0.5976479", "0.59210277", "0.58918345", "0.58721024", "0.5868995", "0.5862498", "0.5846988", "0.58134186", "0.5791487", "0.57900876", "0.57810575", "0.5766032", "0.5760499", "0.5758996", "0.57583857", "0.5742792", "0.57374924", "0.57124144", "0.56884885", "0.56862414", "0.5678836", "0.567758", "0.56753325", "0.5671631", "0.5627644", "0.56067055", "0.5606565", "0.56028575", "0.559525", "0.5587074", "0.5585674", "0.5579871", "0.557722", "0.55697525", "0.55425376", "0.55243117", "0.55200183", "0.55144435", "0.55016917", "0.5501212", "0.5489455", "0.5481355", "0.54682", "0.5463736", "0.5454589", "0.5452223", "0.54132485", "0.54120976", "0.54070085", "0.5403996", "0.5398205", "0.5396795", "0.53929245", "0.53905046", "0.53710926", "0.5354142", "0.53537786", "0.53536296", "0.5350097", "0.53455126", "0.53405917", "0.53367627", "0.5333278", "0.5332429", "0.5332216", "0.53291655", "0.53253984", "0.5316965", "0.53159904", "0.5310924", "0.5290465", "0.5289575", "0.52864003", "0.5274828", "0.52729785", "0.52729756", "0.5253496", "0.52492255" ]
0.76549244
0
Returns next and previous photos for a photo in a photostream.
function photos_getContext ($photo_id) { $response = $this->execute(array('method' => 'flickr.photos.getContext', 'photo_id' => $photo_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { unset($object['stat']); return $object; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function photos(Builder $photos_sql)\n\t{\n\n\t\t$previousPhotoID = '';\n\t\t$return_photos = array();\n\t\t$photo_counter = 0;\n\t\t$photos = $photos_sql->get();\n\t\tforeach ($photos as $photo_model) {\n\n\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t$photo = $photo_model->prepareData();\n\n\t\t\t// Set previous and next photoID for navigation purposes\n\t\t\t$photo['previousPhoto'] = $previousPhotoID;\n\t\t\t$photo['nextPhoto'] = '';\n\n\t\t\t// Set current photoID as nextPhoto of previous photo\n\t\t\tif ($previousPhotoID !== '') {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $photo['id'];\n\t\t\t}\n\t\t\t$previousPhotoID = $photo['id'];\n\n\t\t\t// Add to return\n\t\t\t$return_photos[$photo_counter] = $photo;\n\n\t\t\t$photo_counter++;\n\t\t}\n\n\t\tif (count($return_photos) > 0) {\n\t\t\t// Enable next and previous for the first and last photo\n\t\t\t$lastElement = end($return_photos);\n\t\t\t$lastElementId = $lastElement['id'];\n\t\t\t$firstElement = reset($return_photos);\n\t\t\t$firstElementId = $firstElement['id'];\n\n\t\t\tif ($lastElementId !== $firstElementId) {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $firstElementId;\n\t\t\t\t$return_photos[0]['previousPhoto'] = $lastElementId;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_photos;\n\t}", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "private function getNextPrevIds() {\n $arrReturn = array();\n\n //Load all images on the current level\n $objCur = class_objectfactory::getInstance()->getObject($this->getSystemid());\n $arrImagesLevel = class_module_mediamanager_file::loadFilesDB($objCur->getPrevId(), class_module_mediamanager_file::$INT_TYPE_FILE, true);\n //Sort out the unallowed ones\n foreach($arrImagesLevel as $intKey => $objOneImage) {\n if(!$objOneImage->rightView())\n unset($arrImagesLevel[$intKey]);\n }\n\n //make array-keys numeric\n /** @var $arrImagesLevel class_module_mediamanager_file[] */\n $arrImagesLevel = array_values($arrImagesLevel);\n //Search the current image\n $intKeyHit = 0;\n foreach ($arrImagesLevel as $intKeyHit => $objOneImage) {\n if($objOneImage->getSystemid() == $this->getSystemid()) {\n break;\n }\n }\n\n $arrReturn[\"forward_1\"] = (isset($arrImagesLevel[$intKeyHit+1]) ? $arrImagesLevel[$intKeyHit+1]->getSystemid() : \"\");\n $arrReturn[\"forward_2\"] = (isset($arrImagesLevel[$intKeyHit+2]) ? $arrImagesLevel[$intKeyHit+2]->getSystemid() : \"\");\n $arrReturn[\"forward_3\"] = (isset($arrImagesLevel[$intKeyHit+3]) ? $arrImagesLevel[$intKeyHit+3]->getSystemid() : \"\");;\n\n $arrReturn[\"backward_1\"] = (isset($arrImagesLevel[$intKeyHit-1]) ? $arrImagesLevel[$intKeyHit-1]->getSystemid() : \"\");;\n $arrReturn[\"backward_2\"] = (isset($arrImagesLevel[$intKeyHit-2]) ? $arrImagesLevel[$intKeyHit-2]->getSystemid() : \"\");;\n $arrReturn[\"backward_3\"] = (isset($arrImagesLevel[$intKeyHit-3]) ? $arrImagesLevel[$intKeyHit-3]->getSystemid() : \"\");;\n\n return $arrReturn;\n }", "public function getPhotoNextPrevious($id, $filterOpts = null)\n {\n $buildQuery = $this->buildQuery($filterOpts, null, null);\n $photo = $this->getPhoto($id);\n if(!$photo)\n return false;\n\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} AND dateTaken>'{$photo['dateTaken']}' ORDER BY dateTaken ASC LIMIT 1\");\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} AND dateTaken<'{$photo['dateTaken']}' ORDER BY dateTaken DESC LIMIT 1\");\n $responses = $this->db->batch($queue)->send();\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $ret = array();\n if(isset($responses[0]->body->SelectResult->Item))\n $ret['previous'] = self::normalizePhoto($responses[0]->body->SelectResult->Item);\n if(isset($responses[1]->body->SelectResult->Item))\n $ret['next'] = self::normalizePhoto($responses[1]->body->SelectResult->Item);\n\n return $ret;\n }", "public function getPhotos();", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "function getFirstPhoto()\n\t{\n\t\treturn array_shift( $this->getPhotos() ); \n\t}", "public function getPhotos($page, $itemsPerPage);", "public function getPhotos()\n {\n return $this->photos;\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function prevNext(): array\n {\n $file = $this->model;\n $siblings = $file->templateSiblings()->sortBy(\n 'sort',\n 'asc',\n 'filename',\n 'asc'\n );\n\n return [\n 'next' => function () use ($file, $siblings): ?array {\n $next = $siblings->nth($siblings->indexOf($file) + 1);\n return $next ? $next->panel()->toLink('filename') : null;\n },\n 'prev' => function () use ($file, $siblings): ?array {\n $prev = $siblings->nth($siblings->indexOf($file) - 1);\n return $prev ? $prev->panel()->toLink('filename') : null;\n }\n ];\n }", "function ve_get_360_photos() {\n\t$field_name_repeater = '';\n\t$photo_url_field = '';\n\tif ( is_singular( 'companies' ) ) {\n\t\t$field_name_repeater = 'company_threesixty_photos_repeater';\n\t\t$photo_url_field = 'company_threesixty_photo_url';\n\t}\n\tif ( is_singular( 'group_of_companies' ) ) {\n\t\t$field_name_repeater = 'group_of_companies_threesixty_photos_repeater';\n\t\t$photo_url_field = 'group_of_companies_threesixty_photo_url';\n\t}\n\tif (have_rows($field_name_repeater) ) {\n\t\t/**\n\t\t * Go through all the data in company_youtube_repeater field:\n\t\t */\n\t\t?>\n\t\t<div id=\"owl-threesixty-photos\" class=\"owl-carousel owl-theme\">\n\t\t\t<?php\n\t\t\twhile (have_rows($field_name_repeater) ) {\n\t\t\t\tthe_row();\n\t\t\t\t?>\n\t\t\t\t<div class=\"item\">\n\t\t\t\t\t<blockquote data-mode=\"click2play\" data-width=\"100%\" data-height=\"500px\" class=\"ricoh-theta-spherical-image\" ><?php echo get_sub_field($photo_url_field); ?><a href=\"<?php echo get_sub_field($photo_url_field); ?>\" target=\"_blank\"></a></blockquote>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<script async src=\"https://theta360.com/widgets.js\" charset=\"utf-8\"></script>\n\t\t<?php\n\t}\n\t/**\n\t * If there are NO 360 photos:\n\t */\n\telse {\n\t\t// Do nothing\n\t}\n}", "function be_make_prev_next( $output, $id, $size, $permalink, $icon, $text ) {\n\tif( '&laquo; Previous Photo' == $text )\n\t\t$output = '<span class=\"prev\">' . $output . '</span>';\n\t\n\tif( 'Next Photo &raquo;' == $text )\n\t\t$output = '<span class=\"next\">' . $output . '</span>';\n\t\t\n\treturn $output;\n}", "public function getPrevious();", "public function getTenLatestPhotos();", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "public function getSiblings()\n\t{\n\t\t$folderFiles = $this->Parent->Files;\n\t\tforeach ($folderFiles as $key => $item) {\n\t\t\tif ($this->name == $item->name) {\n\t\t\t\t$prev = $key - 1;\n\t\t\t\t$current = $key + 1;\n\t\t\t\t$next = $key + 1;\n\t\t\t}\n\t\t}\n\t\tif ($next >= count($folderFiles)) {\n\t\t\t$next = 0;\n\t\t}\n\t\tif ($prev < 0) {\n\t\t\t$prev = count($folderFiles) - 1;\n\t\t}\n\n\t\t$result = new stdClass();\n\t\t$result->next = $folderFiles[$next];\n\t\t$result->previous = $folderFiles[$prev];\n\t\t$result->current = $current;\n\t\t$result->count = count($folderFiles);\n\n\t\treturn $result;\n\t}", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "private function getPhotoList($html)\n {\n $matches = array();\n $photoList = array();\n $profileSharedData = array();\n\n if (preg_match(\"#_sharedData = (\\{.*});<\\/script>#\", $html, $matches)) {\n if ((isset($matches[1])) && (!empty($matches[1]))) {\n $profileSharedData = json_decode($matches[1], true);\n }\n }\n\n if (isset($profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'])) {\n $timeLineMedia = $profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'];\n\n if (!isset($timeLineMedia['count']) || ($timeLineMedia['count'] == 0)) {\n throw new Exception(\"This profile doesn't have any photo.\", self::ERROR_PROFILE_NO_PHOTO);\n } elseif (isset($timeLineMedia['edges']) && (count($timeLineMedia['edges']) === 0)) {\n throw new Exception(\"This is a private account.\", self::ERROR_PROFILE_NO_PHOTO);\n }\n\n foreach ($timeLineMedia['edges'] as $photo) {\n if (true == $photo['node']['is_video']) {\n continue;\n }\n\n $photoList[] = array(\n 'shortcode' => $photo['node']['shortcode'],\n 'display_url' => $photo['node']['display_url'],\n 'thumbnail_src' => $photo['node']['thumbnail_src'],\n 'thumbnail_resources' => $photo['node']['thumbnail_resources'],\n 'dimensions' => $photo['node']['dimensions'],\n 'liked_by' => $photo['node']['edge_liked_by']['count'],\n 'comment_by' => $photo['node']['edge_media_to_comment']['count'],\n );\n }\n }\n\n return $photoList;\n }", "public function getAllPhotos();", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getPrevious() {}", "public static function getPhotoContext($photos, $imageObject) {\r\n \r\n /**\r\n * Loop through the array once until we find the provided image. Add photos to a temporary array, and then we slice it to return the last 4 entries to the array\r\n */\r\n \r\n $return = array(); \r\n $split = 0;\r\n $tmp = array(); \r\n \r\n foreach ($photos as $key => $data) {\r\n \r\n if ($data['image_id'] == $imageObject->id) {\r\n $split = $key;\r\n break;\r\n }\r\n \r\n $tmp[] = $data; \r\n }\r\n \r\n $return = array_slice($tmp, -2);\r\n \r\n /**\r\n * Add the current photo to the array\r\n */\r\n \r\n $return[] = array_merge($photos[$split], array(\"current\" => true));\r\n \r\n /**\r\n * Loop through the array starting at $split\r\n */\r\n \r\n $tmp = array(); \r\n \r\n foreach ($photos as $key => $data) {\r\n if ($key >= $split + 1) {\r\n $tmp[] = $data;\r\n }\r\n }\r\n \r\n $return = array_merge($return, array_slice($tmp, 0, 2));\r\n \r\n return array_reverse($return);\r\n \r\n }", "function getPhotosOfMedia($idMedia){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\r\n\t\t$result = mysql_query(\"select * from media_photos, media where FK_ID_MEDIA = ID_MEDIA and ID_MEDIA = \" . $idMedia);\r\n\t\t$tab = new Data();\r\n\t\tif(mysql_num_rows($result)==0){\r\n\t\t\t// on liste le repertoire\r\n\t\t\t$result = mysql_query(\"select * from media where ID_MEDIA = \" . $idMedia);\r\n\t\t\t$nb = mysql_num_rows($result);\r\n\t\t\tif($nb==0){\r\n\t\t\t\t$connectService->close();\r\n\t\t\t\treturn $tab;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$tab->addInfo(\"root\",$this->directory . mysql_result($result,0,\"DIR_MEDIA\"));\r\n\t\t\t\t$tab->addInfo(\"titre\",mysql_result($result,0,\"DESCRIPTION\"));\r\n\t\t\t\t$tab->addInfo(\"group\",mysql_result($result,0,\"FK_ID_GROUP\"));\r\n\t\t\t\t$connectService->close();\r\n\t\t\t\t$tab->addInfo(\"photos\",$this->getPhotosOfDir($tab->getInfo(\"root\")));\r\n if($idMedia == 617){\r\n $tab->addInfo(\"root\",\"http://chaines.cardans.s3-website-eu-west-1.amazonaws.com/PHOTOS/2012_11_24-FONTAINEBLEAU\");\r\n }\r\n\t\t\t\t$tab->addInfo(\"type\",\"scan\");\r\n\t\t\t\treturn $tab;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "function get_object_images($obj_type, $obj_id, $image_sizes = array(), $order = 'ASC')\n{\n $rows = db_get_list_by_query('SELECT * FROM object_images WHERE obj_type = \"' . \n strtok($obj_type, \" \") . '\" AND obj_id = ' . (int)$obj_id . \n ' ORDER by `order` ' . strtok($order, \" \"));\n if (!$rows)\n return;\n\n\n $images = array();\n foreach ($rows as $id => $row) {\n $images[$id] = get_images($row['img_id'], $image_sizes);\n $images[$id]['id'] = $row['id'];\n }\n\n $images = add_prev_next($images);\n return $images;\n}", "function navigate_images($total) {\r\n\tglobal $section, $Image, $prev, $next, $end, $pg, $html_files\r\n\t , $CatBody, $css_files, $sec_url_php, $modal, $url_home\r\n\t\t , $pub_header_title, $pub_welcome_message, $pub_welcome_message2;\r\n\t$query = !empty($Image) ? '?file='.rawurlencode($Image).'&pg=' : '?pg=';\r\n\t$pages = $total <= $section ? 1 : ceil($total / $section);\r\n\t$p = '<li><a href=\"'.SELF.$query.$prev.'\">Prev</a></li>';\r\n\t$n = '<li><a href=\"'.SELF.$query.$next.'\">Next</a></li>';\r\n\t$c = '<li><p>Page '.$pg.' of '.$pages.'</p></li>';\r\n\t\r\n\t//echo('<div class=\"navigate_images\">'.\"\\r\\n\");\r\n\t//echo('<div class=\"left\">'.\"\\r\\n\".'<ul>'.\"\\r\\n\");\r\n\tif(($pg == 1 && $end >= $total)){\r\n\t\techo($c.\"\\r\\n\");\r\n\t}elseif($pg == 1){\r\n\t\t//echo($n.' '.$c);\r\n\t\techo ($n.\"\\r\\n\");\r\n\t\techo ($c.\"\\r\\n\");\r\n\t}elseif($end < $total){\r\n\t\techo($p.\"\\r\\n\");\r\n\t\techo($n.\"\\r\\n\");\r\n\t\techo($c.\"\\r\\n\");\r\n\t\t// echo($p.' '.$n.' '.$c);\r\n\t}else{\r\n\t\t//echo($p.' '.$c);\r\n\t\techo($p.\"\\r\\n\");\r\n\t\techo($c.\"\\r\\n\");\r\n\t}\r\n\t// print($c);\r\n\t// echo('</div>');\r\n\t// compensate for 1px style image borders, i feel dirty\r\n\t// $mainwidth = COLS * THMBWIDTH;\r\n\t//print('<div id=\"main\" style=\"width: '.$mainwidth.'px;\">'.\"\\r\\n\");\r\n\tinclude $html_files.'pageBody.html';\r\n\t//print('<div class=\"content\">'.\"\\r\\n\");\r\n\t//echo('<h2>Browse '.$CatBody.'</h2>'.\"\\r\\n\");\r\n}", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_adjacent_image_link($prev = true, $text = \"test\") {\n\t\tglobal $post;\n\t\t$post = get_post($post);\n\t\t$attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));\n\t\tforeach ( $attachments as $k => $attachment )\n\t\t\tif ( $attachment->ID == $post->ID )\n\t\t\t\tbreak;\n\t\t$k = $prev ? $k - 1 : $k + 1;\n\t\tif ( isset($attachments[$k]) )\n\t\t\treturn wp_get_attachment_link($attachments[$k]->ID, '' , true, false, $text);\n\t}", "function cs_media_pagination(){\n\tforeach ( $_REQUEST as $keys=>$values) {\n\t\t$$keys = $values;\n\t}\n\t$records_per_page = 10;\n\tif ( empty($page_id) ) $page_id = 1;\n\t$offset = $records_per_page * ($page_id-1);\n?>\n\t<ul class=\"gal-list\">\n <?php\n $query_images_args = array('post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,);\n $query_images = new WP_Query( $query_images_args );\n if ( empty($total_pages) ) $total_pages = count( $query_images->posts );\n\t\t$query_images_args = array('post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => $records_per_page, 'offset' => $offset,);\n $query_images = new WP_Query( $query_images_args );\n $images = array();\n foreach ( $query_images->posts as $image) {\n \t$image_path = wp_get_attachment_image_src( $image->ID, array( get_option(\"thumbnail_size_w\"),get_option(\"thumbnail_size_h\") ) );\n ?>\n \t<li style=\"cursor:pointer\"><img src=\"<?php echo $image_path[0]?>\" onclick=\"javascript:clone('<?php echo $image->ID?>')\" alt=\"\" /></li>\n <?php\n }\n ?>\n </ul>\n <br />\n <div class=\"pagination-cus\">\n \t<ul>\n\t\t\t\t<?php\n if ( $page_id > 1 ) echo \"<li><a href='javascript:show_next(\".($page_id-1).\",$total_pages)'>Prev</a></li>\";\n for ( $i = 1; $i <= ceil($total_pages/$records_per_page); $i++ ) {\n if ( $i <> $page_id ) echo \"<li><a href='javascript:show_next($i,$total_pages)'>\" . $i . \"</a></li> \";\n else echo \"<li class='active'><a>\" . $i . \"</a></li>\";\n }\n if ( $page_id < $total_pages/$records_per_page ) echo \"<li><a href='javascript:show_next(\".($page_id+1).\",$total_pages)'>Next</a></li>\";\n ?>\n\t\t\t</ul>\n </div>\n<?php\n\tif ( isset($_POST['action']) ) die();\n}", "function get_adjacent_image_link($prev = \\true, $size = 'thumbnail', $text = \\false)\n {\n }", "public function getPictures()\n {\n\n return $this->pictures;\n }", "private function get_prev_next($array, $current) {\n $pn = new stdClass();\n\n $hascurrent = $pn->next = $pn->prev = false;\n\n foreach ($array as $a) {\n if ($hascurrent) {\n $pn->next = $a;\n break;\n }\n if ($a == $current) {\n $hascurrent = true;\n } else {\n if (!$hascurrent) {\n $pn->prev = $a;\n }\n }\n }\n return $pn;\n }", "protected function getPhotos(Item $album, $number)\n {\n return $album->photos()\n ->uploaded()\n ->orderBy('likes', 'desc')\n ->inRandomOrder()\n ->take($number)\n ->get()\n ->sortBy('number');\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getPrevSibling();", "public function morePics()\n {\n $aPicGallery = $this->getPictureGallery();\n\n return $aPicGallery['MorePics'];\n }", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function getPhotos($iPhotoAlbumId = null, $iPage) {\n \t$oLibSearch = Phpfox::getLib('search');\n \t$oUrlSearch = Phpfox::getLib('url');\n Phpfox::getLib('request')->set('page', $iPage);\n \t$bIsUserProfile = false;\n \t\n \tif (defined('PHPFOX_IS_USER_PROFILE')) {\n \t\t$bIsUserProfile = true;\n \t\t$aUser = Phpfox::getService('user')->get($this->_aParams['user_id']); \t\t\t\n \t}\n \t\n \t$sCategory = $aParentModule = null;\t\n\t\t$aSearch = $this->request()->getArray('search');\n\t\t$bIsTagSearch = false;\n\t\t$sView = $this->request()->get('view', false);\n\n $aPageSizes = (empty($iPhotoAlbumId) ? array(20) : array(1000));\n\t\t\n\t\t$aSort = array(\n\t\t\t'latest' => array('photo.photo_id', Phpfox::getPhrase('photo.latest')),\n\t\t);\n\t\t\n \t$oLibSearch->set(array(\n\t\t\t\t'type' => 'photo',\n\t\t\t\t'field' => 'photo.photo_id',\t\t\t\t\n\t\t\t\t'search_tool' => array(\n\t\t\t\t\t'table_alias' => 'photo',\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('photo.search_photos'),\n\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t'field' => 'photo.title'\n\t\t\t\t\t),\n\t\t\t\t\t'sort' => $aSort,\n\t\t\t\t\t'show' => $aPageSizes\n\t\t\t\t),\n\t\t\t\t'display' => 1\n\t\t\t)\n\t\t);\t\t\n\n\t\t$aBrowseParams = array(\n\t\t\t'module_id' => 'photo',\n\t\t\t'alias' => 'photo',\n\t\t\t'field' => 'photo_id',\n\t\t\t'table' => Phpfox::getT('photo'),\n\t\t\t'hide_view' => array('pending', 'my')\n\t\t);\t\n\t\t\n\t\tif ($bIsUserProfile) {\n\t\t\t$oLibSearch->setCondition('AND photo.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND photo.user_id = ' . (int) $aUser['user_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (defined('PHPFOX_IS_CUSTOM_MODULE')) {\n\t\t\t\t$this->search()->setCondition('AND photo.view_id = 0 AND photo.module_id = \\'' . Phpfox::getLib('database')->escape($this->_aParams['module_id']) . '\\' AND photo.group_id = ' . (int) $this->_aParams['item_id'] . ' AND photo.privacy IN(%PRIVACY%)');\n\t\t\t} else {\n\t\t\t\t$oLibSearch->setCondition('AND photo.view_id = 0 AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(%PRIVACY%)');\n\t\t\t}\n\t\t}\n \t\n \tif (!empty($iPhotoAlbumId)) {\n \t\t$oLibSearch->setCondition('AND photo.album_id = '. $iPhotoAlbumId);\n \t}\n \t\n \t$oLibSearch->browse()->params($aBrowseParams)->execute();\n\t\t\n\t\t$aPhotos = $oLibSearch->browse()->getRows();\n\t\t$iCnt = $oLibSearch->browse()->getCount();\n\n\n\t\tPhpfox::getLib('pager')->set(array('page' => $oLibSearch->getPage(), 'size' => $oLibSearch->getDisplay(), 'count' => $oLibSearch->browse()->getCount()));\n\t\t\n\t\tforeach ($aPhotos as $iKey => $aPhoto) {\n\t\t\tif (Phpfox::isModule('like')) {\n\t\t\t\t$aPhoto['is_liked'] = $this->database()->select('lik.like_id AS is_liked')->from(Phpfox::getT('like'), 'lik')->where('lik.type_id = \\'photo\\' AND lik.item_id = '. $aPhoto['photo_id']. ' AND lik.user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t}\t\n\t\n\t\t\t$aPhoto['is_friend'] = $this->database()->select('f.friend_id AS is_friend')->from(Phpfox::getT('friend'), 'f')->where('f.user_id = '. $aPhoto['user_id']. ' AND f.friend_user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t\n\t\t\t$aPhoto = $this->processPhoto($aPhoto);\n\t\t\t$aPhoto['type_id'] = 'photo';\n\t\t\t$aPhoto = Phpfox::getService('accountapi.feed')->processFeed($aPhoto, null, $aPhoto['user_id'], true);\n\t\t\t$aPhotos[$iKey] = $aPhoto;\n\t\t}\n\t\t\n\t\treturn array($iCnt, $aPhotos);\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function getPicturesInSlider(): PictureCollection;", "public function getAroundPhotos($latMin, $latMax, $lngMin, $lngMax, $photosArray){\n $sql = 'SELECT * FROM photos WHERE lat > ? && lat < ? && lng > ? && lng < ? && status=0';\n $aroundPhotos = $this->executeQuery($sql, array($latMin, $latMax, $lngMin, $lngMax));\n $array = json_decode($photosArray);\n $data = [];\n //retain the prefix to retrieve the id of the photo\n foreach($array as $key => $element){\n $array[$key]= str_replace('photo_', '', $element);\n }\n while ($aPhoto = $aroundPhotos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $aPhoto;\n }\n /*for each photo of the secondary gallery if is id already present in the\n main gallery we remove the photo of the secondary gallery*/\n foreach ($data as $photo){\n if (in_array($photo['id'], $array)){\n unset($data[array_search($photo, $data)]);\n }\n }\n return $data;\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "function prev() {\n\n $next = $this->find('first', array('conditions'=>array('position <'=>$this->data['Ringsite']['position']),\n 'order'=>'position DESC'));\n\n if (empty($next)) {\n $next = $this->find('first', array('conditions'=>array('position >='=>0),\n 'order'=>'position DESC'));\n }\n\n return $next;\n }", "public function count_homepage_photos(){\n $sql=\"SELECT COUNT(*) FROM photos WHERE img_navigacija_id=2\";\n $result=self::$connect->query($sql);\n while($row=$result->fetch(PDO::FETCH_NUM)){\n return $row[0];\n }\n }", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "function buildHtmlPhotos($data) {\r\n $photos = null;\r\n foreach ($data as $photo) {\r\n $image = '<img src=\"' . $photo['square_image_url'] .'\" title=\"' . $photo['title'] . '\" alt=\"' . $photo['title'] .'\" />';\r\n $photos .= '<div class=\"image-container\"><div class=\"image\">' . '<a href=\"/view-photo/' . $photo['id'] . '\" target=\"_blank\">' . $image . '</a></div></div>';\r\n }\r\n return $photos;\r\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function photos_getRecent ($per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getRecent';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public static function getList($currentPage=0, $order=\"uploadDate DESC\") {\n\t\t\n\t\t$x = $currentPage * NUM_PER_PAGE;\n\t\t$y = $x+NUM_PER_PAGE;\n\n\t\t$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n\t\t$sql = \"SELECT * FROM images WHERE published = 1 ORDER BY uploadDate DESC LIMIT :x, :y\";\n\n\t\t$st = $conn->prepare($sql);\n\t\t$st->bindValue(\":x\", $x, PDO::PARAM_INT);\n\t\t$st->bindValue(\":y\", $y, PDO::PARAM_INT);\n\t\t$st->execute();\n\t\t$list = array();\n\t\t\n\t\twhile ($row = $st->fetch()) {\n\t\t\t$image = new Image($row);\n\t\t\t$list[] = $image;\n\t\t}\n\t\t\n\t\t$sql = \"SELECT FOUND_ROWS() AS totalRows\";\n\t\t$totalRows = $conn->query($sql)->fetch();\n\t\t$conn = null;\n\t\t//$row = $st->fetch();\n\t\t//return json_encode($row);\n\t\treturn(array(\"results\"=>$list, \"totalRows\"=>$totalRows[0]));\n\t}", "public function getPreviousPage();", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "public function getPrev() {\n\t\treturn $this->pagefiles->getPrev($this); \n\t}", "public function getAllThePhotosAccordingTolAlbum($offset,$photo_per_page,$albumId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myQuery=\"SELECT photo FROM photo WHERE album_id='\".$albumId.\"' LIMIT $offset,$photo_per_page\";\n\t\t\t $result=$conn->query($myQuery);\n\t\t\t foreach($result as $image){\n\t\t\t\t array_push($this->photos,$image['photo']);\n\t\t\t }\n\t\t\t $conn=null;\n\t\t\t return $this->photos;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function prevPage(): array\n {\n return $this->prev()->getPage();\n }", "public function prevNext(): array\n {\n $user = $this->model;\n\n return [\n 'next' => function () use ($user) {\n $next = $user->next();\n return $next ? $next->panel()->toLink('username') : null;\n },\n 'prev' => function () use ($user) {\n $prev = $user->prev();\n return $prev ? $prev->panel()->toLink('username') : null;\n }\n ];\n }", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "private function _getLastImage()\n\t{\n\t\treturn Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'azgallery` ORDER BY `id_image` DESC LIMIT 0,1');\n\t}", "public function additional_images() {\n\t\t$image_list = array();\n\t\t\n\t\tif (is_single () || is_page ()) {\n\t\t\t$fb_image1 = get_post_meta ( get_the_ID(), 'essb_post_og_image1', true );\n\t\t\t$fb_image2 = get_post_meta ( get_the_ID(), 'essb_post_og_image2', true );\n\t\t\t$fb_image3 = get_post_meta ( get_the_ID(), 'essb_post_og_image3', true );\n\t\t\t$fb_image4 = get_post_meta ( get_the_ID(), 'essb_post_og_image4', true );\n\t\t\t\n\t\t\tif (!empty($fb_image1) && is_string($fb_image1)) {\n\t\t\t\t$image_list[] = $fb_image1;\n\t\t\t}\n\n\t\t\tif (!empty($fb_image2) && is_string($fb_image2)) {\n\t\t\t\t$image_list[] = $fb_image2;\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($fb_image3) && is_string($fb_image3)) {\n\t\t\t\t$image_list[] = $fb_image3;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($fb_image4) && is_string($fb_image4)) {\n\t\t\t\t$image_list[] = $fb_image4;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $image_list;\n\t}", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function getNext() {\n\t\treturn $this->pagefiles->getNext($this); \n\t}", "public function firstImageInContent(){\n if(isset($this->imageFirstInContent)){\n return $this->imageFirstInContent;\n }\n $this->fetchFirstImageInContent();\n return $this->imageFirstInContent;\n }", "function get_images_at_begining($image_array){\n $images = array();\n if(count($image_array) > 7 ){\n for($i=0;$i<7;$i++){\n $images[$i] = $image_array[$i];\n }\n return $images;\n }\n else{\n return $image_array;\n }\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_query_pagination_arrow($block, $is_next)\n {\n }", "public function get_nb_pictures(){\n $return = array();\n $sql = sprintf(\"SELECT count(*) FROM miki_album_picture WHERE id_album = %d\",\n mysql_real_escape_string($this->id));\n $result = mysql_query($sql);\n $row = mysql_fetch_array($result);\n return $row[0];\n }", "function register_block_core_comments_pagination_previous()\n {\n }", "function getImages($operator_id, $page_no = 1) {\n\t\treturn $this->getResponse ( $this->getXmlApi (), 'getImages', array ('operator_id' => $operator_id, 'page_no' => $page_no ) );\n\t}", "function render_block_core_comments_pagination_previous($attributes, $content, $block)\n {\n }", "function photos_search ($per_page = 25, $page = 1, $tags = NULL, $text = NULL, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.search';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($tags) {\n\t\t\t$tags = explode(',', $tags);\n\t\t\tarray_map('trim', $tags);\n\t\t\t$tags = implode(',', $tags);\n\t\t\t$params['tags'] = $tags;\n\t\t}\n\t\tif ($text) $params['text'] = trim($text);\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_pics($db,$tag,$current,$num=5) {\n\t\n\t// holder for pictures selected\n\t$pics = array();\n\t\n\t// condition to search on to avoid picking dupes\n\t$cond = (count($current)) ? 'id !=' . implode(\" AND id !=\", $current) : '1';\n\t\n\t\n\t$card_deck = CARD_DECK; // database table for photos\n\t\n\t// query for random selection from database\n\t$query = \"SELECT * FROM $card_deck WHERE $cond and tag='$tag' and active=1 ORDER BY RAND() limit 0,$num\";\n\t\n\t$result = mysqli_query($db, $query);\t\n\tif (mysqli_error($db) ) echo 'Ouch! Database problem:' . mysqli_error($db);\n\t\n\t while ($row = mysqli_fetch_array($result)) {\n\t \t$pics[] = array(\n\t \t\t'id' => $row['id'], \n\t \t\t'url' => \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_m.jpg\",\n\t \t\t'link' => \"http://www.flickr.com/photos/\" . $row['nsid'] . \"/\" . $row['fid'] . \"/\",\n\t \t\t'credit' => stripslashes($row['username']),\n\t \t\t);\n }\n\n\treturn $pics;\n}", "public function sel_next_image_id()\n\t{\n\t\t$image_id = null;\n\t\ttry{\n\t\t\t$m_image = new Model_M_Image($this->db, $this->client_id);\n\t\t\t$image_id = $m_image->sel_next_id();\n\t\t} catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$image_id = null;\n\t\t}\n\t\treturn $image_id;\n\t}", "function prev_next($id, $type){\n\tglobal $db;\n\t$total_count_query = \"SELECT count(*) FROM shit WHERE type = '\".$type.\"' ORDER BY id ASC\";\n\t$r_total = $db->get_results($total_count_query, ARRAY_A);\n\t\n\t$q_prev = \"SELECT * FROM shit WHERE id > \".$id.\" AND type = '\".$type.\"' ORDER BY id ASC LIMIT 0,1\";\n\t$r_prev = $db->get_results($q_prev, ARRAY_A);\n\n\t$q_next = \"SELECT * FROM shit WHERE id < \".$id.\" AND type = '\".$type.\"' ORDER BY id DESC LIMIT 0,1\"; \n\t$r_next = $db->get_results($q_next, ARRAY_A);\n\n\t#print_r($r_total);\n\t\n\t$return = '';\n\tif($r_total[0]['count(*)'] > 0){\n\t\t$return.= '<li>';\n\t\tif(count($r_prev) > 0) {\n\t\t\t$return.= ' <a href=\"index.php?select='.$r_prev[0]['type'].'&id='.$r_prev[0]['id'].'\" title=\"'.ucwords(stripslashes($r_prev[0]['title'])).'\">Previous</a> / ';\n\t\t} else { \n\t\t\t$return.= ' <span style=\"color:#ccc;\">Previous</span> / ';\n\t\t}\n\t\t\n\t\t$return.= '</li> <li>';\n\t\tif(count($r_next) > 0) {\n\t\t\t$return.= ' <a href=\"index.php?select='.$r_next[0]['type'].'&id='.$r_next[0]['id'].'\" title=\"'.ucwords(stripslashes($r_next[0]['title'])).'\">Next</a> / ';\n\t\t} else {\n\t\t\t$return.= ' <span style=\"color:#ccc;\">Next</span> / ';\n\t\t} \n\n\t\t\n\t\t$return.= '</li>';\n\t} else { $return = null;}\n\t\n\treturn($return);\n}", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "public function getNext ()\n {\n return prev ( $this->_list ) ;\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function previousElement();", "function getSlider_images()\n\t\t{\n\t\t\t$slider_images = $this->manage_content->getValue('slider_info','*');\n\t\t\tforeach($slider_images as $slider_image)\n\t\t\t{\n\t\t\t\tif($slider_image['slider_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$slider_image[\"slider_link\"].'\"><img src=\"images/'.$slider_image[\"slider_image\"].'\" style=\"width:692px;height:210px;\"/></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function tp_mostrecentimages($max = 8, $pagination = true) {\n\treturn list_entities(\"object\", \"image\", 0, $max, false, false, $pagination);\n}", "public function getUserProfilePhotos($datas = [])\r\n {\r\n return $this->telegram(\"getUserProfilePhotos\", $datas);\r\n }", "public static function main() {\n\t\t$page = file_get_html('http://photography.nationalgeographic.com/photography/photo-of-the-day/nature-weather/');\n\t\t$link = $page->find('#search_results', 0)->find('a', 0)->href;\n\n\t\t$page = file_get_html('http://photography.nationalgeographic.com'.$link);\n\t\t$img = $page->find('meta[property=og:image]', 0)->content;\n\t\treturn $img;\n\t}", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function getPrev($criteria = null)\n\t{\n\t\treturn $this->_getRelativeElement($criteria, -1);\n\t}", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function next($search=null){\n\t\treturn $this->look_on_same_row(\"next\",$search);\n\t}", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "function render_block_core_query_pagination_previous($attributes, $content, $block)\n {\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "private function get_list_pageinfo($event) {\n global $config, $database;\n \n // get the amount of images per page\n $images_per_page = $config->get_int('index_images');\n \n // this occurs when viewing post/list without page number\n if ($event->get_arg(0) == null) {// no page listed\n $prefix = \"\"; \n $page_number = 1;\n $total_pages = ceil($database->get_one(\n \"SELECT COUNT(*) FROM images\") / $images_per_page);\n }\n \n // if there are no tags, use default\n else if ($event->get_arg(1) == null){\n $prefix = \"\"; \n $page_number = (int)$event->get_arg(0);\n $total_pages = ceil($database->get_one(\n \"SELECT COUNT(*) FROM images\") / $images_per_page);\n }\n \n else { // if there are tags, use pages with tags\n $prefix = $event->get_arg(0).\"/\";\n $page_number = (int)$event->get_arg(1);\n $total_pages = ceil($database->get_one(\n \"SELECT count FROM tags WHERE tag=:tag\", \n array(\"tag\"=>$event->get_arg(0))) / $images_per_page);\n }\n \n // creates previous & next values \n // When previous first page, go to last page\n if ($page_number <= 1) $prev = $total_pages;\n else $prev = $page_number-1;\n if ($page_number >= $total_pages) $next = 1;\n else $next = $page_number+1;\n \n // Create return array\n $pageinfo = array(\n \"prev\" => $prefix.$prev.$after,\n \"next\" => $prefix.$next.$after,\n );\n \n return $pageinfo;\n }", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "public function getImages()\n {\n $res=array();\n $this->objTable = new Model($this->getLangAndID['lang'].'_slide_image');\n $select = array('id','title','description','slide_id','src_link','order_by','avatar');\n $this->objTable->where('slide_id',$this->id);\n $this->objTable->where('idw',$this->idw);\n $data = $this->objTable->get(null,null,$select);\n \n return $data; \n }" ]
[ "0.6429229", "0.6134129", "0.6060616", "0.6032105", "0.5932901", "0.57583904", "0.5598782", "0.5580938", "0.55164933", "0.5497971", "0.5485377", "0.54754186", "0.5471924", "0.5455965", "0.5414507", "0.5403318", "0.5376486", "0.5367267", "0.53360087", "0.53204364", "0.53182185", "0.530545", "0.52983516", "0.529449", "0.5274012", "0.5248543", "0.5200361", "0.5199312", "0.51982903", "0.51834404", "0.5180029", "0.51749945", "0.51563823", "0.51176095", "0.5098222", "0.50856686", "0.5085094", "0.50750697", "0.50661093", "0.50428396", "0.50218916", "0.5020704", "0.5019291", "0.5006352", "0.5004422", "0.49999177", "0.49989596", "0.49887568", "0.4980493", "0.49750665", "0.497017", "0.49699926", "0.49663526", "0.49643815", "0.4948172", "0.4940418", "0.49341252", "0.49337608", "0.4929907", "0.49275213", "0.49243295", "0.4895564", "0.48905534", "0.48859", "0.48739198", "0.48607424", "0.48503354", "0.4847707", "0.48476887", "0.48415604", "0.4839919", "0.48364475", "0.48292878", "0.481957", "0.48112062", "0.48095354", "0.48075068", "0.47982088", "0.4796412", "0.4793877", "0.4791488", "0.477975", "0.4779747", "0.47791463", "0.47623026", "0.47585902", "0.4749068", "0.4746163", "0.4742217", "0.4740597", "0.47379544", "0.47361708", "0.47322983", "0.47299904", "0.47272918", "0.4726261", "0.472625", "0.47251964", "0.47233865", "0.47168204", "0.47137165" ]
0.0
-1
Gets a list of photo counts for the given date ranges for the calling user.
function photos_getCounts ($dates = NULL, $taken_dates = NULL) { $params = array(); $params['method'] = 'flickr.photos.getCounts'; if (!$dates) { $dates = time()-31536000 .','. time(); $params['dates'] = $dates; } if ($taken_dates) $params['taken_dates'] = $taken_dates; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photocounts']['photocount']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getListUserCountByRangeDate($types, $startDate = '', $endDate = '')\r\n\t{\r\n\t\tif ( empty($types) ) {\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$now = new \\DateTime(\"now\");\r\n\t\t// $now->format('Y-m-d') . ' 23:59:59';\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\t$rsm = new \\Doctrine\\ORM\\Query\\ResultSetMapping;\r\n\r\n\t\t$select = array();\r\n\t\t$i = 0;\r\n\r\n\t\tforeach($types as $type) {\r\n\t\t\tswitch ($type) {\r\n\t\t\t\tcase 'validatedMembers':\r\n\t\t\t\t\t$filter = \"u.state IS NOT NULL\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'activeMembers':\r\n\t\t\t\t\t$filter = \"u.state=1\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'optin':\r\n\t\t\t\t\t$filter = \"u.optin=1\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'optinPartners':\r\n\t\t\t\t\t$filter = \"u.optin_partner=1\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'unregistered':\r\n\t\t\t\t\t$filter = \"u.state IS NULL\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'suspended':\r\n\t\t\t\t\t$filter = \"u.state=2\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\tcase 'members':\r\n\t\t\t\t\t$filter = \"u.user_id\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$rsm->addScalarResult('c'.$i, 'c'.$i);\r\n\t\t\t$select[] = 'SUM(CASE WHEN '.$filter.' THEN 1 ELSE 0 END) AS c'.$i;\r\n\t\t\t$rsm->addScalarResult('c'.$i.'_male', 'c'.$i.'_male');\r\n\t\t\t$select[] = 'SUM(CASE WHEN '.$filter.' AND (u.title=\\'M\\' OR u.title IS NULL) THEN 1 ELSE 0 END) AS c'.$i.'_male';\r\n\t\t\t$rsm->addScalarResult('c'.$i.'_female', 'c'.$i.'_female');\r\n\t\t\t$select[] = 'SUM(CASE WHEN '.$filter.' AND u.title=\\'Me\\' THEN 1 ELSE 0 END) AS c'.$i++.'_female';\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(u.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND u.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"u.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"u.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"u.created_at IS NOT NULL\";\r\n\t\t}\r\n\t\t$query = $em->createNativeQuery('\r\n\t\t\tSELECT '.implode(',',$select).' FROM user AS u\r\n\t\t\tWHERE ' . $dateRange, $rsm);\r\n\t\treturn array_values($query->getSingleResult());\r\n\t}", "public function getGamesByRangeDate($startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(g.publicationDate >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND g.publicationDate <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"g.publicationDate <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"g.publicationDate >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"g.publicationDate IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(g.id) FROM PlaygroundGame\\Entity\\Game g\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\tAND g.active=1\r\n\t\t');\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "public function getParticipationsByRangeDate($startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(e.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND e.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"e.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"e.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"e.created_at IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(e.id) FROM PlaygroundGame\\Entity\\Entry e\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\tAND e.active=0\r\n\t\t');\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "public function getListBadgeCountByRangeDate($badges, $startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\t \r\n\t\t$rsm = new \\Doctrine\\ORM\\Query\\ResultSetMapping;\r\n\t \r\n\t\t$select = array();\r\n\t\t$i = 0;\r\n\r\n\t\tforeach($badges as $badge => $levels) {\r\n\t\t\tforeach($levels as $level) {\r\n\t\t\t\t$filter = array('a.id');\r\n\t\t\t\tif($badge != 'total') {\r\n\t\t\t\t\t$filter[] = 'a.category = \\''.$badge.'\\'';\r\n\t\t\t\t}\r\n\t\t\t\tif($level > 0){\r\n\t\t\t\t\t$filter[] = 'a.level = '.( (int) $level );\r\n\t\t\t\t}\r\n\t\t\t\t$rsm->addScalarResult('c'.$i, 'c'.$i);\r\n\t\t\t\t$select[] = 'SUM(CASE WHEN '.implode(' AND ',$filter).' THEN 1 ELSE 0 END) AS c'.$i++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(a.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND a.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"a.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"a.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"a.created_at IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createNativeQuery('\r\n\t\t\tSELECT '.implode(',',$select).' FROM reward_achievement a\r\n\t\t\tWHERE ' . $dateRange, $rsm);\r\n\t\treturn array_values( $query->getSingleResult() );\r\n\t}", "public static function getNewUserCountWithDateRange($startDate, $endDate)\n\t{\n $link = TDOUtil::getDBLink();\n if(!$link)\n {\n\t\t\treturn false;\n }\n\t\t\n\t\t$sql = \"SELECT COUNT(*) FROM tdo_user_accounts WHERE creation_timestamp >= $startDate AND creation_timestamp <= $endDate\";\n//\t\terror_log(\"SQL: $sql\");\n\t\t\n\t\t$result = mysql_query($sql, $link);\n\t\t\n\t\tif($result)\n\t\t{\n\t\t\tif($row = mysql_fetch_array($result))\n\t\t\t{\n if(isset($row['0']))\n {\n \t\t\tTDOUtil::closeDBLink($link);\n return $row['0'];\n }\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\terror_log(\"TDOUser::getNewUserCountWithDateRange($startDate, $endDate): Unable to get user count\");\n\t\t}\n\t\t\n TDOUtil::closeDBLink($link);\n return false;\n\t}", "public function getListShareCountByRangeDate($types, $startDate = '', $endDate = '')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\t$rsm = new \\Doctrine\\ORM\\Query\\ResultSetMapping;\r\n\r\n\t\t$select = array();\r\n\t\t$i = 0;\r\n\r\n\t\tforeach( $types as $type ) {\r\n\t\t\tswitch ($type) {\r\n\t\t\t\tcase 'sponsoredMembers':\r\n\t\t\t\t\t$filter = \"e.action_id =20\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'shares':\r\n\t\t\t\t\t$filter = \"e.action_id IN (13,14,15,16,17)\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'profilShares':\r\n\t\t\t\t\t$filter = \"e.action_id IN (13,14,15,16,17) AND e.label like '%espace client%'\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'fbInvit':\r\n\t\t\t\t\t$filter = \"e.action_id IN (14,15) AND e.label NOT like '%espace client%'\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'twInvit':\r\n\t\t\t\t\t$filter = \"e.action_id=16 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'glInvit':\r\n\t\t\t\t\t$filter = \"e.action_id=17 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'mailInvit':\r\n\t\t\t\t\t$filter = \"e.action_id=13 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$rsm->addScalarResult('c'.$i, 'c'.$i);\r\n\t\t\t$select[] = 'SUM(CASE WHEN '.$filter.' THEN 1 ELSE 0 END) AS c'.$i++;\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(e.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND e.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"e.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"e.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"e.created_at IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createNativeQuery('\r\n\t\t\tSELECT '.implode(',',$select).' FROM reward_event e\r\n\t\t\tWHERE ' . $dateRange, $rsm);\r\n\t\treturn array_values($query->getSingleResult());\r\n\t}", "function countTotalLoggedUsersInBetween($startDate, $endDate, $limit = 0, $offsetStart = 0, $offsetEnd = 0)\n {\n\n // define all the global variables\n global $database, $message, $settings, $user;\n\n // check if current user has the required permission\n if (!$user->hasPermission(\"analytics_countLoggedUsersInBetween\")) {\n $message->setError(\"You don't have the permission to perform this action\", Message::Error);\n return false;\n }\n\n // check if any limits are set\n if ($limit != 0) {\n $limitArgs = \" LIMIT \" . $limit;\n } else {\n $limitArgs = \"\";\n }\n\n // check if any offsets has been used\n if ($offsetEnd != 0 && $offsetEnd >= $offsetStart) {\n $limitArgs = \" LIMIT \" . $offsetStart . \",\" . $offsetEnd;\n }\n\n // call the database and get the results back\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE\n \" . TBL_USERS_LAST_LOGIN . \" >= '$startDate' AND \n \" . TBL_USERS_LAST_LOGIN . \" <= '$endDate'\" . $limitArgs;\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n return $database->getQueryNumRows($result, true);\n }", "public function getArticlesByRangeDate($startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(p.publicationDate >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND p.publicationDate <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"p.publicationDate <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"p.publicationDate >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"p.publicationDate IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(p.id) FROM PlaygroundCms\\Entity\\Page p\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\tAND p.active=1\r\n\t\t');\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "function countTotalRegisteredUsersInBetween($startDate, $endDate, $limit = 0, $offsetStart = 0, $offsetEnd = 0)\n {\n\n // define all the global variables\n global $database, $message, $settings, $user;\n\n // check if current user has the required permission\n if (!$user->hasPermission(\"analytics_countRegisteredUsersInBetween\")) {\n $message->setError(\"You don't have the permission to perform this action\", Message::Error);\n return false;\n }\n\n // check if any limits are set\n if ($limit != 0) {\n $limitArgs = \" LIMIT \" . $limit;\n } else {\n $limitArgs = \"\";\n }\n\n // check if any offsets has been used\n if ($offsetEnd != 0 && $offsetEnd >= $offsetStart) {\n $limitArgs = \" LIMIT \" . $offsetStart . \",\" . $offsetEnd;\n }\n\n // call the database and get the results back\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE\n \" . TBL_USERS_DATE_JOINED . \" >= '$startDate' AND \n \" . TBL_USERS_DATE_JOINED . \" <= '$endDate'\" . $limitArgs;\n\n // get the sql results\n $result = $database->getQueryResults($sql);\n if ($database->anyError()) {\n return false;\n }\n\n $row = $database->getQueryNumRows($result, true);\n\n\n return $row;\n }", "public function get_count_within_range( $data, $start_date, $chart_interval ) {\n\t\t$results = array();\n\t\tforeach( $data as $d ) {\n\t\t\t$date_time = $d->post_date;\n\n\t \t\t//Add one more, so it includes the current day\n\t\t\tif( ($date_time <= ($start_date + ($chart_interval * 86400) + 86400) && \n\t\t\t\t$date_time >= $start_date) || \n\t\t\t\t$chart_interval == 0)\n\t\t\t\t$results[] = $d;\n\t\t}\n\t\treturn $results;\n\t}", "public function count_inbound_outbound_calls($start_date, $end_date){\n $result['inbound'] = 0;\n $result['outbound'] = 0;\n\n $sql = \"SELECT count(`call_direction`) as inbound\n from \".db_prefix().\"call_logs where call_direction = 1 AND DATE_FORMAT(`call_start_time`,'%Y-%m-%d') between '\".$start_date.\"' AND '\".$end_date.\"' \" ;\n $query = $this->db->query($sql);\n $row = $query->row();\n if (isset($row)){\n $result['inbound'] = $row->inbound;\n }\n\n $sql = \"SELECT count(`call_direction`) as outbound\n from `tblcall_logs` where call_direction = 2 AND DATE_FORMAT(`call_start_time`,'%Y-%m-%d') between '\".$start_date.\"' AND '\".$end_date.\"' \" ;\n $query = $this->db->query($sql);\n $row = $query->row();\n if (isset($row)){\n $result['outbound'] = $row->outbound;\n }\n\n return $result;\n }", "function getTotalLoggedUsersInBetween($startDate, $endDate, $limit = 0, $offsetStart = 0, $offsetEnd = 0)\n {\n\n // define all the global variables\n global $database, $message, $settings, $user;\n\n // check if current user has the required permission\n if (!$user->hasPermission(\"analytics_loggedUsersInBetween\")) {\n $message->setError(\"You don't have the permission to perform this action\", Message::Error);\n return false;\n }\n\n // Set the required parameters\n $users = \"\";\n\n // check if any limits are set\n if ($limit != 0) {\n $limitArgs = \" LIMIT \" . $limit;\n } else {\n $limitArgs = \"\";\n }\n\n // check if any offsets has been used\n if ($offsetEnd != 0 && $offsetEnd >= $offsetStart) {\n $limitArgs = \" LIMIT \" . $offsetStart . \",\" . $offsetEnd;\n }\n\n // call the database and get the results back\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE\n \" . TBL_USERS_LAST_LOGIN . \" >= '$startDate' AND \n \" . TBL_USERS_LAST_LOGIN . \" <= '$endDate'\" . $limitArgs;\n\n // get the sql results\n if (!$results = $database->getQueryResults($sql)) {\n return false;\n }\n\n foreach ($database->getQueryEffectedRows($results, true) as $row) {\n $currentUser = new User();\n $currentUser->initInstance($row);\n\n $users[] = $currentUser;\n }\n\n return $users;\n }", "public function findTotalChargesPerPersonByUserIdForChargeDates($start_date = null, $end_date = null) {\n if ($start_date === null) {\n $start_date = self::MIN_CHARGE_DATE;\n }\n if ($end_date === null) {\n $end_date = self::MAX_CHARGE_DATE;\n }\n $params = [\n \":start_date\" => $start_date,\n \":end_date\" => $end_date,\n ];\n $charges = $this->doManagedQuery(\"findTotalChargesByUserIdForChargeDates\", $params);\n $total_charges_by_user_id = [];\n foreach ($charges as $user_info) {\n $user_id = $user_info[\"user_id\"];\n if ($user_id == 107) {\n $total_charges = $user_info[\"total_charges\"] / 2; // Jamie and Elara\n } else {\n $total_charges = $user_info[\"total_charges\"];\n }\n $total_charges_by_user_id[$user_id] = $total_charges;\n }\n return $total_charges_by_user_id;\n }", "function getAllUsersCount() {\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t $params = null;\n $userObj = new App42Response();\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/count/all\";\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userObj->setStrResponse($response->getResponse());\n $userObj->setResponseSuccess(true);\n $userResponseObj = new UserResponseBuilder();\n $userObj->setTotalRecords($userResponseObj->getTotalRecords($response->getResponse()));\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n }", "private static function get_user_counts() {\n\t\t$user_count = array();\n\t\t$user_count_data = count_users();\n\t\t$user_count['total'] = $user_count_data['total_users'];\n\n\t\t// Get user count based on user role\n\t\tforeach ( $user_count_data['avail_roles'] as $role => $count ) {\n\t\t\t$user_count[ $role ] = $count;\n\t\t}\n\n\t\treturn $user_count;\n\t}", "function getTotalRegisteredUsersInBetween($startDate, $endDate, $limit = 0, $offsetStart = 0, $offsetEnd = 0)\n {\n\n // define all the global variables\n global $database, $message, $settings, $user;\n\n // check if current user has the required permission\n if (!$user->hasPermission(\"analytics_registeredUsersInBetween\")) {\n $message->setError(\"You don't have the permission to perform this action\", Message::Error);\n return false;\n }\n\n // Set the required parameters\n $users = \"\";\n\n // check if any limits are set\n if ($limit != 0) {\n $limitArgs = \" LIMIT \" . $limit;\n } else {\n $limitArgs = \"\";\n }\n\n // check if any offsets has been used\n if ($offsetEnd != 0 && $offsetEnd >= $offsetStart) {\n $limitArgs = \" LIMIT \" . $offsetStart . \",\" . $offsetEnd;\n }\n\n // call the database and get the results back\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE\n \" . TBL_USERS_DATE_JOINED . \" >= '$startDate' AND \n \" . TBL_USERS_DATE_JOINED . \" <= '$endDate'\" . $limitArgs;\n\n // get the sql results\n if (!$results = $database->getQueryResults($sql)) {\n return false;\n }\n\n foreach ($database->getQueryEffectedRows($results, true) as $row) {\n $currentUser = new User();\n $currentUser->initInstance($row);\n\n $users[] = $currentUser;\n }\n\n return $users;\n }", "public function countReports(){\n\t\t$date = date('Y-m-d');\n\t\t$from = Input::get('start');\n\t\tif(!$from) $from = date('Y-m-01');\n\t\t$to = Input::get('end');\n\t\tif(!$to) $to = $date;\n\t\t$toPlusOne = date_add(new DateTime($to), date_interval_create_from_date_string('1 day'));\n\t\t$counts = Input::get('counts');\n\t\t$accredited = array();\n\t\t//\tBegin grouped test counts\n\t\tif($counts==trans('messages.grouped-test-counts'))\n\t\t{\n\t\t\t$testCategories = TestCategory::all();\n\t\t\t$testTypes = TestType::all();\n\t\t\t$ageRanges = array('0-5', '5-15', '15-120');\t//\tAge ranges - will definitely change in configurations\n\t\t\t$gender = array(Patient::MALE, Patient::FEMALE); \t//\tArray for gender - male/female\n\n\t\t\t$perAgeRange = array();\t// array for counts data for each test type and age range\n\t\t\t$perTestType = array();\t//\tarray for counts data per testype\n\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\tSession::flash('message', trans('messages.check-date-range'));\n\t\t\t}\n\t\t\tforeach ($testTypes as $testType) {\n\t\t\t\t$countAll = $testType->groupedTestCount(null, null, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$countMale = $testType->groupedTestCount([Patient::MALE], null, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$countFemale = $testType->groupedTestCount([Patient::FEMALE], null, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$perTestType[$testType->id] = ['countAll'=>$countAll, 'countMale'=>$countMale, 'countFemale'=>$countFemale];\n\t\t\t\tforeach ($ageRanges as $ageRange) {\n\t\t\t\t\t$maleCount = $testType->groupedTestCount([Patient::MALE], $ageRange, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t\t$femaleCount = $testType->groupedTestCount([Patient::FEMALE], $ageRange, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t\t$perAgeRange[$testType->id][$ageRange] = ['male'=>$maleCount, 'female'=>$femaleCount];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn View::make('reports.counts.groupedTestCount')\n\t\t\t\t\t\t->with('testCategories', $testCategories)\n\t\t\t\t\t\t->with('ageRanges', $ageRanges)\n\t\t\t\t\t\t->with('gender', $gender)\n\t\t\t\t\t\t->with('perTestType', $perTestType)\n\t\t\t\t\t\t->with('perAgeRange', $perAgeRange)\n\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t->withInput(Input::all());\n\t\t}\n\t\telse if($counts==trans('messages.ungrouped-specimen-counts')){\n\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\tSession::flash('message', trans('messages.check-date-range'));\n\t\t\t}\n\n\t\t\t$ungroupedSpecimen = array();\n\t\t\tforeach (SpecimenType::all() as $specimenType) {\n\t\t\t\t$rejected = $specimenType->countPerStatus([Specimen::REJECTED], $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$accepted = $specimenType->countPerStatus([Specimen::ACCEPTED], $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$total = $rejected+$accepted;\n\t\t\t\t$ungroupedSpecimen[$specimenType->id] = [\"total\"=>$total, \"rejected\"=>$rejected, \"accepted\"=>$accepted];\n\t\t\t}\n\n\t\t\t// $data = $data->groupBy('test_type_id')->paginate(Config::get('kblis.page-items'));\n\t\t\treturn View::make('reports.counts.ungroupedSpecimenCount')\n\t\t\t\t\t\t\t->with('ungroupedSpecimen', $ungroupedSpecimen)\n\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t->withInput(Input::all());\n\n\t\t}\n\t\telse if($counts==trans('messages.grouped-specimen-counts')){\n\t\t\t$ageRanges = array('0-5', '5-15', '15-120');\t//\tAge ranges - will definitely change in configurations\n\t\t\t$gender = array(Patient::MALE, Patient::FEMALE); \t//\tArray for gender - male/female\n\n\t\t\t$perAgeRange = array();\t// array for counts data for each test type and age range\n\t\t\t$perSpecimenType = array();\t//\tarray for counts data per testype\n\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\tSession::flash('message', trans('messages.check-date-range'));\n\t\t\t}\n\t\t\t$specimenTypes = SpecimenType::all();\n\t\t\tforeach ($specimenTypes as $specimenType) {\n\t\t\t\t$countAll = $specimenType->groupedSpecimenCount([Patient::MALE, Patient::FEMALE], null, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$countMale = $specimenType->groupedSpecimenCount([Patient::MALE], null, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$countFemale = $specimenType->groupedSpecimenCount([Patient::FEMALE], null, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$perSpecimenType[$specimenType->id] = ['countAll'=>$countAll, 'countMale'=>$countMale, 'countFemale'=>$countFemale];\n\t\t\t\tforeach ($ageRanges as $ageRange) {\n\t\t\t\t\t$maleCount = $specimenType->groupedSpecimenCount([Patient::MALE], $ageRange, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t\t$femaleCount = $specimenType->groupedSpecimenCount([Patient::FEMALE], $ageRange, $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t\t$perAgeRange[$specimenType->id][$ageRange] = ['male'=>$maleCount, 'female'=>$femaleCount];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn View::make('reports.counts.groupedSpecimenCount')\n\t\t\t\t\t\t->with('specimenTypes', $specimenTypes)\n\t\t\t\t\t\t->with('ageRanges', $ageRanges)\n\t\t\t\t\t\t->with('gender', $gender)\n\t\t\t\t\t\t->with('perSpecimenType', $perSpecimenType)\n\t\t\t\t\t\t->with('perAgeRange', $perAgeRange)\n\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t->withInput(Input::all());\n\t\t}\n\t\telse{\n\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\tSession::flash('message', trans('messages.check-date-range'));\n\t\t\t}\n\n\t\t\t$ungroupedTests = array();\n\t\t\tforeach (TestType::all() as $testType) {\n\t\t\t\t$pending = $testType->countPerStatus([Test::PENDING, Test::STARTED], $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$complete = $testType->countPerStatus([Test::COMPLETED, Test::VERIFIED], $from, $toPlusOne->format('Y-m-d H:i:s'));\n\t\t\t\t$ungroupedTests[$testType->id] = [\"complete\"=>$complete, \"pending\"=>$pending];\n\t\t\t}\n\n\t\t\t// $data = $data->groupBy('test_type_id')->paginate(Config::get('kblis.page-items'));\n\t\t\treturn View::make('reports.counts.ungroupedTestCount')\n\t\t\t\t\t\t\t->with('ungroupedTests', $ungroupedTests)\n\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t}\n\t}", "public static function getNumbersCalled($dates)\n {\n return self::select(DB::raw('dst, count(dst) as totalcalls, sum(billsec) as totaltime'))\n ->where('calldate', '>=', $dates['start'] . \"00:00:00\")\n ->where('calldate', '<=', $dates['end'] . \"23:59:00\") \n ->where('outbound_cnum', '!=', '')\n ->where('disposition', '=', 'ANSWERED')\n ->groupBy('dst')\n ->orderByRaw('count(dst) desc')\n ->get();\n }", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }", "public function sumCountOfReports($dateStart, $dateEnd);", "function CountDates($arrayDate)\n\t\t{\n\t\t\t\n\t\t\t\t\tforeach ($arrayDate as $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($this->graphArray,array('comment'=>0,'favorite'=>0,'upload'=>0));\n\t\t\t\t\t}\n\t\t\n\t\t\n\n\t\t\t\t\tforeach ($this->commentDates as $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$i=0;\n\t\t\t\t\t\tforeach ($arrayDate as $date)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->IsDateBetween($date['startdate'], $data,$date['enddate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->graphArray[$i]['comment']++;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\tforeach ($this->favoriteDates as $data)\n\t\t\t\t\t{\n\t\t\t\n\t\t\t\t\t\t$i=0;\n\t\t\t\t\t\tforeach ($arrayDate as $date)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->IsDateBetween($date['startdate'], $data,$date['enddate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->graphArray[$i]['favorite']++;\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this->userName==$this->channelName)\n\t\t\t\t\tif(isset($uploadDates))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($uploadDates as $data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$i=0;\n\t\t\t\t\t\t\tforeach ($arrayDate as $date)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($this->IsDateBetween($date['startdate'], $data,$date['enddate']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->graphArray[$i]['upload']++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t}", "public function getUsageCount()\n {\n $today = Carbon::now('Asia/Singapore')->toDateTimeString();\n $timezone = new Carbon('Asia/Singapore');\n $last_thirty_days = $timezone->subDays(30);\n\n return count($this->appUserBlurb->where('interaction_type', 'use')->whereBetween('created_at', array($last_thirty_days->toDateTimeString(), $today))->groupBy('app_user_id')->get());\n }", "function get_user_percentage_age($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n \r\n $list = array(\r\n array(0),\r\n array(1, 10),\r\n range(11, 15),\r\n range(16, 19),\r\n range(20, 22),\r\n range(23, 25),\r\n range(26, 28),\r\n range(29, 30),\r\n range(31, 40),\r\n range(41, 200)\r\n );\r\n\r\n $output = array(array('연령' , '비율'));\r\n $data = array();\r\n\r\n $i = 1;\r\n //query\r\n $sql = \"SELECT DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age,\r\n count(gender) as age_count, \r\n count(user_id) as user_count, all_count \r\n from users \r\n left join user_profiles on users.id = user_profiles.user_id \r\n join (select count(id) as all_count from users where activated=? and created between ? and ?) all_user \r\n WHERE created between ? and ?\r\n group by age\"; \r\n $query = $this->db->query($sql, array(1, $from, $to, $from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n if(is_null($row->age)) continue;\r\n foreach($list as $k=>$v){\r\n if(in_array($row->age, $v)){\r\n $data[$k] += round($row->age_count*100/$row->all_count, 2);\r\n }\r\n }\r\n }\r\n\r\n foreach($list as $k=>$v){\r\n $i = $k+1;\r\n $output[$i][0] = (string)((count($v)>1)?$v[0].\"~\".$v[count($v)-1]:\"{$v[0]}\");\r\n $output[$i][1] = round($data[$k], 2);\r\n }\r\n\r\n return $output; \r\n /* \r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('연령' , '비율'));\r\n if($dateNum>0){\r\n $AxisX = array(\"0\", \"1~10\", \"11~15\", \"16~19\", \"20~22\", \"23~25\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $i = 1;\r\n foreach($AxisX as $text){\r\n $normal = array(\"11~15\", \"16~19\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $large = array(\"20~22\", \"23~25\", \"26~28\");\r\n if(in_array($text, $normal)){\r\n $num = rand(70, 100);\r\n } else if(in_array($text, $large)){\r\n $num = rand(0, 30);\r\n } else{\r\n $num = 0;\r\n }\r\n $output[$i] = array($text, $num);\r\n $i++;\r\n }\r\n }\r\n return $output;*/\r\n }", "public function countVotesCreatedBetweenDatesGroupByDates(\\DateTime $dateTimeInit, \\DateTime $dateTimeEnd)\n\t{\n\t\t$queryBuilder = $this->em->createQueryBuilder();\n\t\t$queryBuilder->select('DATE(v.publicatedAt) AS DateCreatedAt, COUNT(v.publicatedAt) AS Votes, COUNT(DISTINCT v.participant) AS Users')\n\t\t->from($this->class,'v')\n\t\t->where($queryBuilder->expr()->between('v.publicatedAt', ':dateTimeInit', ':dateTimeEnd'))\n\t\t->addGroupBy('DateCreatedAt')\n\t\t->addOrderBy('DateCreatedAt');\n\t\n\t\n\t\t$queryBuilder->setParameter('dateTimeInit',$dateTimeInit->format(self::DATE_FORMAT));\n\t\t$queryBuilder->setParameter('dateTimeEnd',$dateTimeEnd->format(self::DATE_FORMAT));\n\t\n\t\t$result = $queryBuilder->getQuery()->getScalarResult();\n\t\n\t\treturn $result;\n\t}", "function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }", "public function getTicketCountByRecipientAndDates(CUSTOMER $customer, $beginDate, $endDate) {\n\n $count = $this->database->count(\"ticket\", \"*\",\n [\n \"recipient_id\" => $customer->getId(), \"date[<>]\"=>[$beginDate, $endDate]\n ]);\n\n return $count;\n }", "public function getUsageCountPaginate()\n {\n $today = Carbon::now('Asia/Singapore')->toDateTimeString();\n $timezone = new Carbon('Asia/Singapore');\n $last_thirty_days = $timezone->subDays(30);\n\n $appUserBlurb = $this->appUserBlurb->where('interaction_type', 'use')->whereBetween('created_at', array($last_thirty_days->toDateTimeString(), $today))->groupBy('app_user_id')->get()->toArray();\n\n $app_user_ids = array_map(function ($structure) {\n return $structure['app_user_id'];\n\n }, $appUserBlurb);\n\n return $this->appUser->whereIn('id', $app_user_ids)->orderByRaw(\"FIELD(status , 'Approved', 'Disabled', 'Blocked') ASC\")->paginate(10);\n }", "function getLockedUsersCount() {\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n\t\t $params = null;\n $userObj = new App42Response();\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/count/locked\";\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userObj->setStrResponse($response->getResponse());\n $userObj->setResponseSuccess(true);\n $userResponseObj = new UserResponseBuilder();\n $userObj->setTotalRecords($userResponseObj->getTotalRecords($response->getResponse()));\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n }", "public function searchCountDate ($theme, $from, $to){\n $json = new JsonFile ($this->host . '/api/' . $theme . '/count/date?from='. $from . \"&to=\" . $to);\n $json->parse();\n \n return $json;\n }", "public function getHistories($user_id = null ,$fromDate = null ,$toDate = null,$params = array())\n {\n \n $condition = array();\n $condition =\" 1=1 \";\n if ($user_id != null)\n {\n $condition .= \" AND his.user_id = \".$user_id;\n }\n if ($fromDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$fromDate.\"')>=0\";\n }\n if ($toDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$toDate.\"')<=0\";\n }\n foreach($params as $key=>$value)\n {\n if ( $key != 'limit' && $key!='group_by')\n $condition .= $value;\n }\n if(!isset($params['limit']))\n $params['limit'] = 50;\n $count = 0;\n if(!isset($params['group_by']))\n {\n $count = 0;\n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d')\")\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') DESC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n else\n {\n $count = 0; \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group($params['group_by'])\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') ASC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n \n }", "function get_user_percentage_gender_age($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n \r\n $list = array(\r\n array(0),\r\n array(1, 10),\r\n range(11, 15),\r\n range(16, 19),\r\n range(20, 22),\r\n range(23, 25),\r\n range(26, 28),\r\n range(29, 30),\r\n range(31, 40),\r\n range(41, 200)\r\n );\r\n\r\n //select DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age, SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, count(user_id) as user_count, all_count from users left join user_profiles on users.id = user_profiles.user_id join (select count(id) as all_count from users where activated=1) all_user group by age\r\n $output = array(array('연령' , '남비율', '여비율'));\r\n $data = array();\r\n\r\n $i = 1;\r\n //query\r\n $sql = \"SELECT DATE_FORMAT(CURRENT_DATE, '%Y')-DATE_FORMAT(birth, '%Y')+1 as age,\r\n SUM(case when gender = 'm' then 1 else 0 end) as gender_m_count, \r\n SUM(case when gender = 'f' then 1 else 0 end) as gender_f_count, \r\n count(user_id) as user_count, all_count \r\n from users \r\n left join user_profiles on users.id = user_profiles.user_id \r\n join (select count(id) as all_count from users where activated=? and created >= ? and created <= ?) all_user \r\n WHERE created between ? and ?\r\n group by age\"; \r\n $query = $this->db->query($sql, array(1, $from, $to, $from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n if(is_null($row->age)) continue;\r\n foreach($list as $k=>$v){\r\n if(in_array($row->age, $v)){\r\n $data[$k]['m'] += round($row->gender_m_count*100/$row->all_count, 2);\r\n $data[$k]['f'] += round($row->gender_f_count*100/$row->all_count, 2);\r\n }\r\n }\r\n }\r\n\r\n foreach($list as $k=>$v){\r\n $i = $k+1;\r\n $output[$i][0] = (string)((count($v)>1)?$v[0].\"~\".$v[count($v)-1]:\"{$v[0]}\");\r\n $output[$i][1] = round($data[$k]['m'], 2);\r\n $output[$i][2] = round($data[$k]['f'], 2);\r\n }\r\n\r\n return $output; \r\n /*\r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('연령' , '남비율', '여비율'));\r\n if($dateNum>0){\r\n $AxisX = array(\"0\", \"1~10\", \"11~15\", \"16~19\", \"20~22\", \"23~25\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $i = 1;\r\n foreach($AxisX as $text){\r\n $normal = array(\"11~15\", \"16~19\", \"26~28\", \"29~30\", \"31~40\", \"41~\");\r\n $large = array(\"20~22\", \"23~25\", \"26~28\");\r\n if(in_array($text, $normal)){\r\n $num1 = rand(30, 70);\r\n $num2 = 100-$num1;\r\n } else if(in_array($text, $large)){\r\n $num1 = rand(30, 70);\r\n $num2 = 100-$num1;\r\n } else{\r\n $num1 = 0;\r\n $num2 = 0;\r\n }\r\n $output[$i] = array($text, $num1, $num2);\r\n $i++;\r\n }\r\n }\r\n return $output;*/\r\n }", "public function index($start, $limits)\n {\n return response()->json( Gallery::UserPhotos($start, $limits), 200);\n }", "public function TotalUserUploadsPhotos($uid) {\n\t// This query to select the total upload image from the user profile\n\t$query=mysqli_query($this->db,\"SELECT users.uid,\n\tusers.username,\n\tusers.updates_count,\n\tuser_uploads.uid_fk,\n\tuser_uploads.id,\n\tuser_uploads.image_path,\n\tmessages.msg_id,\n\tmessages.uid_fk,\n\tmessages.uploads,\n\tmessages.share_count,\n\tmessages.comment_count,\n\tmessages.like_count \n\tFROM users \n\tINNER JOIN messages\n\tON users.uid = messages.uid_fk\n\tINNER JOIN user_uploads \n\tON messages.uploads = user_uploads.id\n\tWHERE uid='$uid' order by msg_id DESC LIMIT 3\") or die(mysqli_error($this->db));\n\twhile($row=mysqli_fetch_array($query,MYSQLI_ASSOC)) {\n\t\t// Store the result into array\n\t\t $data[]=$row;\n\t\t}\n\t\tif(!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n}", "public function getDailyUsersBySO($idApp, $initialDate, $finalDate, $os){\n @list($d1, $m1, $y1) = explode( $this->separador,$initialDate,3);\n @list($d2, $m2, $y2) = explode( $this->separador,$finalDate,3);\n $c=$this->getConector($y1, $y2);\n $this->otherdb->select('year, month, day, platformname, count(id_download) as Users');\n $this->otherdb->from('dailyuserdata');\n $this->otherdb->where(\"id_app\", $idApp);\n $this->otherdb->where(\"platformname\", $os);\n $this->otherdb->where(\"((year = $y1 and ( $m1 < month or ($m1=month and day >= $d1 and day <= 31 ) )) $c \n (year = $y2 and ( $m2 > month or ($m2=month and day >= 01 and $d2 >= day ))))\" );\n $this->otherdb->group_by(\" year, month, day, platformname\");\n /*$query = \" select year, month, day, platformname, count(id_download) as Users from dailyuserdata \n where id_app='$idApp' and platformname = '$os' and\n ((year = $y1 and ( $m1 < month or ($m1=month and day >= $d1 and day <= 31 ) )) $c\n (year = $y2 and ( $m2 > month or ($m2=month and day >= 01 and $d2 >= day ))))\n group by year, month, day, platformname\";*/\n $this->addSegmentQuery($this->otherdb);\n $result = $this->otherdb->get();\n //$result = $this->otherdb->query($query);\n $titlearray = array(\"Users\");\n \n return $this->prepareResultSet($titlearray, $initialDate, $finalDate,$result->result_array());\n }", "public function imageCount(): array\n {\n $options = $this->generateGetRequestParams('image_count', uniqid('', true), time());\n\n // Call API\n $res = $this->client->request(\"GET\", \"image_count/\", [\n 'query' => $options,\n ]);\n\n // Decode Response\n $parsed_json = json_decode($res->getBody(), true);\n if (null === $parsed_json) {\n throw new TinEyeJsonParseException($res->getBody());\n }\n\n return $parsed_json;\n }", "public static function get_days_with_routes($date_range, $office)\n\t{\n\t\t$range = explode(' - ', $date_range);\n\n\t\t$data = Document::groupBy('documents.date_created')\n\t\t\t->selectRaw('documents.date_created')\n\t\t\t->join('document_route_list', 'documents.id', '=', 'document_route_list.document_id')\n\t\t\t->join('route_lists', 'document_route_list.route_list_id', '=', 'route_lists.id')\n\t\t\t->join('drivers as fd', 'route_lists.first_driver_id', '=', 'fd.id')\n\t\t\t->where('documents.date_created', '>=', $range[0])\n\t\t\t->where('documents.date_created', '<=', $range[1])\t\t\t\n\t\t\t->where('route_lists.is_international', '=', 0)\t\n\t\t\t->where('fd.office_id', $office)\n\t\t\t->orderBy('documents.date_created', 'ASC')\n\t\t\t->get()\n\t\t\t->toArray();\n\t\t\treturn array_pluck($data, 'date_created');\n\t}", "public function getDailyLogCounts() {\n\n\t\t$previewLogDate = Request::input('dailylog_date');\n\n\t\tif (empty($previewLogDate)) $previewLogDate = date(\"Y-m-d\");\n\t\telse $previewLogDate = date(\"Y-m-d\", strtotime($previewLogDate));\n\n\t\ttry {\n\n\t\t\t$previewTags = PreviewTag::where('station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t->where('preview_date', '=', $previewLogDate)\n\t\t\t\t->get();\n\n\t\t\t$adID = ContentType::GetAdContentTypeID();\n\t\t\t$promoID = ContentType::GetPromoContentTypeID();\n\t\t\t$talkID = ContentType::GetTalkContentTypeID();\n\t\t\t$newsID = ContentType::GetNewsContentTypeID();\n\t\t\t$musicID = ContentType::GetMusicContentTypeID();\n\t\t\t$otherID = 100;\n\t\t\t$overallID = 0;\n\n\n\t\t\t$byCategory = array(\n\t\t\t\t$adID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t\t$promoID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t\t$talkID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t\t$newsID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t\t$musicID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t\t$otherID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t\t$overallID => array('complete' => 0, 'incomplete' => 0),\n\t\t\t);\n\n\t\t\tforeach ($previewTags as $previewTag) {\n\t\t\t\t\n\t\t\t\t$contentTypeID = $previewTag->content_type_id;\n\n\t\t\t\tif ($contentTypeID == $adID || $contentTypeID == $promoID || $contentTypeID == $talkID || $contentTypeID == $newsID || $contentTypeID == $musicID) {\n\n\t\t\t\t} else {\n\t\t\t\t\t$contentTypeID = $otherID;\n\t\t\t\t}\n\n\t\t\t\tif ($previewTag->hasEnoughConnectData()) {\n\t\t\t\t\t$byCategory[$contentTypeID]['complete']++;\n\t\t\t\t\t$byCategory[0]['complete']++;\n\n\t\t\t\t} else { //Missing some content data\n\t\t\t\t\t$byCategory[$contentTypeID]['incomplete']++;\n\t\t\t\t\t$byCategory[0]['incomplete']++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('statistics' => $byCategory)));\n\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "public function getCountEventsGroup(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$result = [];\n\t\tforeach ($request->getArray('dates', 'DateTimeInUserFormat') as $datePair) {\n\t\t\t$record->set('start', $datePair[0]);\n\t\t\t$record->set('end', $datePair[1]);\n\t\t\t$result[] = $record->getEntityRecordsCount();\n\t\t}\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}", "function __getCountByDate($data)\n\t{\n\t\t/*function countSort($a, $b)\n\t\t{\n\t\t\t//debug($a);\n\t\t\t//debug($b);\n\t\t\t$aKey = 'DATE(CommentsStream.modified)';\n\t\t\t$bKey = 'DATE(CommentsStream.modified)';\n\t\t\tif (array_key_exists('DATE(PagesStream.modified)', $a[0]) && array_key_exists('DATE(CommentsStream.modified)', $b[0]))\n\t\t\t{\n\t\t\t\t$aKey = 'DATE(PagesStream.modified)';\n\t\t\t\t$bKey = 'DATE(CommentsStream.modified)';\n\t\t\t}\n\t\t\telse if (array_key_exists('DATE(CommentsStream.modified)', $a[0]) && array_key_exists('DATE(PagesStream.modified)', $b[0]))\n\t\t\t{\n\t\t\t\t$aKey = 'DATE(CommentsStream.modified)';\n\t\t\t\t$bKey = 'DATE(PagesStream.modified)';\n\t\t\t}\n\t\t\telse if (array_key_exists('DATE(PagesStream.modified)', $a[0]) && array_key_exists('DATE(PagesStream.modified)', $b[0]))\n\t\t\t{\n\t\t\t\t$aKey = 'DATE(PagesStream.modified)';\n\t\t\t\t$bKey = 'DATE(PagesStream.modified)';\n\t\t\t}\n\t\t if (($a[0][$aKey] == $b[0][$bKey]))\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t }\n\t\t return ($a[0][$aKey] < $b[0][$bKey]) ? -1 : 1;\t\n\t\t}*/\n\t\t\n\t\t/*$commentsCountArray = $this->Stream->CommentsStream->getCommentsforStreamCountByDate($data);\n\t\t//debug($commentsCountArray);\n\t\t$pagesCountArray = $this->Stream->PagesStream->getPagesforStreamCountByDate($data);\n\t\t//debug($pagesCountArray);\n\t\t\n\t\t$countArray = array();\n\t\tif ($commentsCountArray && $pagesCountArray)\n\t\t{\n\t\t\t$countArray = array_merge((array)$pagesCountArray, (array)$commentsCountArray);\n\t\t\tuasort($countArray, 'countSort');\n\t\t}\n\t\telse if ($commentsCountArray)\n\t\t\t$countArray = (array)$commentsCountArray;\n\t\telse if ($pagesCountArray)\n\t\t\t$countArray = (array)$pagesCountArray;*/\n\t\t\n\t\t$countArray = $this->Stream->CommentsStream->__getDatePaginationData($data);\n\t\t//debug($countArray);\n\t\t\t\t\t\n\t\t$datePagination = array();\n\t\t$j = 0;\n\t\treset($countArray);\n\t\tfor ($i = 0; $i < count($countArray); ++$i)\n\t\t{\n\t\t\t$currentArray = reset(current($countArray));\n\t\t\t//debug($currentArray);\n\t\t\t$date = reset($currentArray); //gets the date like '2009-07-28'\n\t\t\t$year = next($currentArray);\n\t\t\t$month = next($currentArray);\n\t\t\t$day = next($currentArray);\n\t\t\t$count = next($currentArray);\n\t\t\tif (!array_key_exists($year, $datePagination))\n\t\t\t{\n\t\t\t\t$datePagination[$year] = array\n\t\t\t\t(\n\t\t\t\t\t'count' => $count,\n\t\t\t\t\t'months' => array\n\t\t\t\t\t(\n\t\t\t\t\t\t$month => array\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t'count' => $count,\n\t\t\t\t\t\t\t'days' => array\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t$day => array (\n\t\t\t\t\t\t\t\t\t'count' => $count,\n\t\t\t\t\t\t\t\t\t'stream_id' => $data['stream_id'],\n\t\t\t\t\t\t\t\t\t'filter_id' => $data['filter_id'],\n\t\t\t\t\t\t\t\t\t'filter_type' => $data['filter_type'],\n\t\t\t\t\t\t\t\t\t'date'\t=> $date\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t );\n\t\t\t}\n\t\t\telse if (!array_key_exists($month, $datePagination[$year]['months']))\n\t\t\t{\n\t\t\t\t//$count = (int)end(current($countArray));\n\t\t\t\t$datePagination[$year]['count'] += $count;\n\t\t\t\t$datePagination[$year]['months'][$month] = array(\n\t\t\t\t\t'count' => $count,\n\t\t\t\t\t'days' => array (\n\t\t\t\t\t\t$day => array(\n\t\t\t\t\t\t\t'count' => $count,\n\t\t\t\t\t\t\t'stream_id' => $data['stream_id'],\n\t\t\t\t\t\t\t'filter_id' => $data['filter_id'],\n\t\t\t\t\t\t\t'filter_type' => $data['filter_type'],\n\t\t\t\t\t\t\t'date'\t=> $date\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse if (!array_key_exists($day, $datePagination[$year]['months'][$month]['days']))\n\t\t\t{\n\t\t\t\t//$count = (int)end(current($countArray));\n\t\t\t\t$datePagination[$year]['count'] += $count;\n\t\t\t\t$datePagination[$year]['months'][$month]['count'] += $count;\n\t\t\t\t$datePagination[$year]['months'][$month]['days'][$day] = array(\n\t\t\t\t\t'count' => $count,\n\t\t\t\t\t'stream_id' => $data['stream_id'],\n\t\t\t\t\t'filter_id' => $data['filter_id'],\n\t\t\t\t\t'filter_type' => $data['filter_type'],\n\t\t\t\t\t'date'\t=> $date\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$datePagination[$year]['count'] += $count;\n\t\t\t\t$datePagination[$year]['months'][$month]['count'] += $count;\n\t\t\t\t$datePagination[$year]['months'][$month]['days'][$day]['count'] += $count;\n\t\t\t}\n\t\t\t//debug($datePagination);\n\t\t\tnext($countArray);\n\t\t}\n\t\t//debug($dates);\t\n\t\treturn $datePagination;\n\t}", "public function getBadgesByRangeDate($type, $level, $startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(a.createdAt >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND a.createdAt <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"a.createdAt <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"a.createdAt >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"a.createdAt IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\tif($type == 'total') {\r\n\t\t\t$badgeType = '';\r\n\t\t} else {\r\n\t\t\t$badgeType = 'AND a.category = :type';\r\n\t\t}\r\n\r\n\t\tif($level == 0){\r\n\t\t\t$levelType = '';\r\n\t\t} else {\r\n\t\t\t$levelType = 'AND a.level = ' . $level;\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(a.id) FROM PlaygroundReward\\Entity\\Achievement a\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\t' . $badgeType . '\r\n\t\t\t' . $levelType . '\r\n\t\t');\r\n\t\tif($type != 'total') {\r\n\t\t\t$query->setParameter('type', $type);\r\n\t\t}\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "function GetIncidentCountsByDate($date)\n\t\t{\n\t\t\t$db = new DatabaseManager();\n\t\t\t$db->Connect();\n\t\t\n\t\t\t// sanitize inputs\n\t\t\t$date = $db->SanitizeInput($date);\n\t\t\n\t\t\t// get the counts for all incidents seen today\n\t\t\t$query = 'select count(distinct itemid) as count, event from incidents where pubdate=\"' . $date . '\" group by event';\n\t\t\t\n\t\t\t// execute the query\n\t\t\t$results = $db->Query($query);\n\t\t\n\t\t\t// create a dictionary to hold our results in\n\t\t\t$dict = array();\n\t\t\n\t\t\t// generate dictionary of results\n\t\t\twhile($r = mysql_fetch_assoc($results)) {\n\t\t\t\n\t\t\t\t// decode the row data\n\t\t\t\t$event = strtolower($r['event']);\n\t\t\t\t$count = $r['count'];\n\t\t\t\t\n\t\t\t\t// add the key and value to the dictionary\n\t\t\t\t$dict[$event] = $count;\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t// create an instance of our event manager\n\t\t\t$eventManager = new EventManager();\n\t\t\t\n\t\t\t// get all of the known event types\n\t\t\t$eventtypes = $eventManager->GetEventTypes();\n\t\t\t\n\t\t\t// create an array to return that has our counts in it\n\t\t\t$counts = array();\n\t\t\t\n\t\t\t// create our count list based on our dictionary entries\n\t\t\tforeach($eventtypes as $eventtype)\n\t\t\t{\n\t\t\t\t$id = strtolower($eventtype->eventtype);\n\t\t\t\n\t\t\t\t// add the count for the event type to the counts array. If it doesn't exist, it will be zero\n\t\t\t\t$counts[] = $dict[$id];\n\t\t\t}\n\t\t\t\n\t\t\t// return our array of counts for the event types\n\t\t\treturn $counts;\n\t\t\t\n\t\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "function get_total_work_logs($data)\n {\n\t\tif($data['dateFrom'] && $data['dateTo'])\n\t\t{\n\t\t\tif(isset($data['userName'])){\n\t\t\t\t$user_array = explode(\"~\", $data['userName']);\n\t\t\t\t$un = \" and username IN (\";\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($user_array as $user)\n\t\t\t\t{\n\t\t\t\t\tif($i == 0){\n\t\t\t\t\t\t$un = $un.\"'\".$user.\"'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$un = $un.\", '\".$user.\"'\";\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$un = $un.\")\";\n\t\t\t} else {\n\t\t\t\t$un = \"\";\n\t\t\t}\n\t\t\tif( isset($data['projectkey']) )\n\t\t\t{\n\t\t\t\t$pk = \" and project_key = '\".$data['projectkey'].\"'\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pk = \"\";\n\t\t\t}\n\t\t\t$sql =\n\t\t\t\t\"select count(*) from WORKLOGS where work_date \"\n\t\t\t\t.\">= cast( '\".$data['dateFrom'].\"' as datetime) and work_date \"\n\t\t\t\t.\"<= cast( '\".$data['dateTo'].\"' as datetime)\".$un.$pk;\n\t\t\t$query = $this->db->query($sql);\n\t\t\t$return_array = json_decode(json_encode($query->result()),true);\n\t\t\treturn $return_array[0]['count(*)'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Both start and end dates are required.\");\n\t\t}\n }", "function count_participations ( $CourseID, $enrolled, $start_date, $end_date ){\n\tglobal $access_token, $canvas_base_url;\n\t\n\t//echo \"Total Enrollments for course: \".count($enrolled);\n\t\n\t$counter=0;\n\tforeach ($enrolled as $student) {\n\t\t\n\t\t$url = $canvas_base_url.\"/api/v1/courses/\".$CourseID.\"/analytics/users/sis_user_id:\".$student['id'].\"/activity\";\n\t\t\n\t\t// Get cURL resource\n\t\t$curl = curl_init();\n\t\t// Set some options - we are passing in a useragent too here\n\t\tcurl_setopt_array($curl, array(\n\t\t CURLOPT_RETURNTRANSFER => 1,\n\t\t CURLOPT_CUSTOMREQUEST => 'GET',\n\t\t CURLOPT_HTTPHEADER => array('Authorization: Bearer ' . $access_token), \n\t\t CURLOPT_URL => $url,\n\t\t CURLOPT_USERAGENT => 'Matt Loves cURLing Things'\n\t\t));\n\t\t// Send the request & save response to $resp\n\t\t$resp = json_decode(curl_exec($curl));\n\t\t// Close request to clear up some resources\n\t\tcurl_close($curl);\n\t\t\n\t\tforeach ($resp->participations as $singleparicipation) {\n\t\t\t$participation_time=strtotime($singleparicipation->created_at);\n\t\t\t\n\t\t\t//only count participations in the specified date range\n\t\t\tif ($participation_time >= strtotime($start_date) && $participation_time <= strtotime($end_date)) {\n\t\t\t\t$enrolled[$student['id']]['participations']=$enrolled[$student['id']]['participations']+1;\n\t\t\t\t$counter++;\n\t\t\t}\t\n\t\t}\n\t}\n\treturn $enrolled;\n\n}", "public function countDate($beginDate=null,$endDate){\n\t\t$begin = new DateTime( $beginDate );\n\t\t$end = new DateTime( $endDate );\n\t\t$end = $end->modify( '+1 day' ); \n\t\t$long = -1;\n\n\t\t$interval = new DateInterval('P1D');\n\t\t$daterange = new DatePeriod($begin, $interval ,$end);\n\n\t\tforeach($daterange as $date){\n\t\t\t$long++;\n\t\t}\n\t\treturn $long;\n\t}", "public function countByDate($start, $end, $status) {\n $subscriptions = Subscriptions::query()\n ->whereHas('status', function($query) use ($status) {\n $query->where('status', '=', $status);\n })\n ->where('status_change', '>=', $start)\n ->where('status_change', '<=', $end)->count();\n \n return $subscriptions;\n }", "function statistics_extended_users_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,'create' as event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}entities \";\r\n\t$query.=\"WHERE type = 'user' \";\r\n\t$query.=\"AND enabled='yes' \";\r\n\t$query.=\"GROUP BY zoom\";\r\n\treturn get_data($query);\r\n}", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function getSharesByRangeDate($type, $startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\tswitch ($type){\r\n\t\t\tcase 'sponsoredMembers' :\r\n\t\t\t\t$filter = \"e.action=20\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'shares' :\r\n\t\t\t\t$filter = \"e.action IN (13,14,15,16,17)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'profilShares' :\r\n\t\t\t\t$filter = \"e.action IN (13,14,15,16,17) AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'fbInvit' :\r\n\t\t\t\t$filter = \"e.action IN (14,15) AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'twInvit' :\r\n\t\t\t\t$filter = \"e.action=16 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'glInvit' :\r\n\t\t\t\t$filter = \"e.action=17 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mailInvit' :\r\n\t\t\t\t$filter = \"e.action=13 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(e.createdAt >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND e.createdAt <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"e.createdAt <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"e.createdAt >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"e.createdAt IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(e.id) FROM PlaygroundReward\\Entity\\Event e\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\tAND ' . $filter . '\r\n\t\t');\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "public function dateRanges(): DateRangeCollection;", "public function countByDate(){\n $query = $this->createQueryBuilder('o')\n ->select('SUBSTRING(o.creatAt, 1, 10) as dateOffres, COUNT(o) as count')\n ->groupBy('dateOffres')\n ;\n return $query->getQuery()->getResult();\n\n }", "public function getActives($date) {\n $start = $date . ' 23:59:59';\n $subscriptionsAll = DB::table('subscriptions')\n ->select(DB::raw('MAX(id) as id'))\n ->where('status_change', '<=', $start)\n ->groupBy('user_id');\n \n $subscriptionsActives = DB::table('subscriptions')\n ->join('status', function ($join) {\n $join->on('status.id', '=', 'subscriptions.status_id');\n })\n ->joinSub($subscriptionsAll, 'sa', function ($join) {\n $join->on('subscriptions.id', '=', 'sa.id');\n })\n ->where('subscriptions.status_change', '<=', $start)\n ->count();\n return $subscriptionsActives;\n }", "function get_counts( $results, $start, $end ) {\n $count = 0;\n\n foreach ( $results as $result ) {\n if ( $result['facet_value'] >= $start ) {\n if ( is_null( $end ) || $result['facet_value'] <= $end ) {\n $count += 1;\n }\n }\n }\n\n return $count;\n }", "private function _getVisitorCounts( $Days = 1 ) {\n $txnTable = $this->settings['txnTable'];\n $Days = nullInt( $Days, 1 );\n $rVal = 0;\n\n $sqlStr = \"SELECT DATE_FORMAT(`DateStamp`, '%Y-%m-%d') as `DTS`, sum(`Hits`) as `PageViews`\" .\n \" FROM `$txnTable`\" .\n \" WHERE `isResource` = 'N' and `isDeleted` = 'N'\" .\n \" and `DateStamp` >= DATE_FORMAT(DATE_SUB(Now(), INTERVAL $Days DAY), '%Y-%m-%d %H:00:00')\" .\n \" and `SiteID` = \" . nullInt($this->settings['SiteID']) .\n \" GROUP BY `DTS`;\";\n $rslt = doSQLQuery( $sqlStr );\n if ( is_array($rslt) ) {\n $rVal = nullInt( $rslt[0]['PageViews'] );\n }\n \n writeNote( \"PageViews: $rVal\" );\n\n // Return the Array\n return $rVal;\n }", "public function count_portfolio_possible_view_users($condition);", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getTotalDistinctURIs($start = null, $end = null)\n {\n $query = \"SELECT count(DISTINCT request_uri) AS count FROM \" . $this->tableName;\n\n if ((!is_null($start)) && (!is_null($end))) {\n $query .= \" WHERE stat_date BETWEEN '$start' AND '$end' \";\n }\n\n $data = $this->SelectData($query, PDO::FETCH_ASSOC);\n if (false === $data) {\n return false;\n } else {\n return $data[0]['count'];\n }\n }", "public function getCountEventsGroup(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$result = [];\n\t\tforeach ($request->getArray('dates', 'DateTimeInUserFormat') as $datePair) {\n\t\t\t$record->set('start', $datePair[0]);\n\t\t\t$record->set('end', $datePair[1]);\n\t\t\t$result[] = $record->getEntityRecordsCount();\n\t\t}\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}", "public function filterAccessDailyWithSubscribersNotification($between = array('*'))\n {\n $between = (object) $between;\n\n return\n DB::select(\"\n SELECT \n data_acesso, COUNT(*) AS total_acesso, \n (SELECT \n COUNT(DATE(created_at)) AS total_inscrito\n FROM\n notificacao_inscricao\n WHERE\n DATE(notificacao_inscricao.created_at) = DATE(log_acesso.data_acesso)\n GROUP BY DATE(created_at)) AS total_inscrito\n FROM\n (SELECT \n COUNT(DISTINCT DATE(created_at)) AS acesso,\n DATE(created_at) AS data_acesso,\n hospede_reserva_id,\n agente_usuario\n FROM\n log_acesso\n WHERE\n DATE(created_at) BETWEEN '{$between->dateInitial}' AND '{$between->dateFinal} '\n AND tipo_acesso_id = 1\n GROUP BY data_acesso , hospede_reserva_id , agente_usuario) AS log_acesso\n GROUP BY data_acesso\n \");\n }", "function loginHistoryCount($userId, $searchText, $fromDate, $toDate)\n {\n $this->db->select('BaseTbl.userId, BaseTbl.sessionData, BaseTbl.machineIp, BaseTbl.userAgent, BaseTbl.agentString, BaseTbl.platform, BaseTbl.createdDtm');\n if(!empty($searchText)) {\n $likeCriteria = \"(BaseTbl.email LIKE '%\".$searchText.\"%')\";\n $this->db->where($likeCriteria);\n }\n if(!empty($fromDate)) {\n $likeCriteria = \"DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) >= '\".date('Y-m-d', strtotime($fromDate)).\"'\";\n $this->db->where($likeCriteria);\n }\n if(!empty($toDate)) {\n $likeCriteria = \"DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) <= '\".date('Y-m-d', strtotime($toDate)).\"'\";\n $this->db->where($likeCriteria);\n }\n $this->db->where('BaseTbl.userId', $userId);\n $this->db->from('tbl_last_login as BaseTbl');\n $query = $this->db->get();\n \n return $query->num_rows();\n }", "public function getUserStats(User $user, \\DateTimeInterface $from, \\DateTimeInterface $to)\n {\n try {\n $qb = App::getEntityManager()->createQueryBuilder();\n $qb->select('s')\n ->from('Tollwerk\\Toggl\\Domain\\Model\\Stats', 's')\n ->where('s.user = :user')\n ->andWhere('s.date >= :from')\n ->andWhere('s.date <= :to')\n ->setParameter('user', $user)\n ->setParameter('from', $from->format('Y-m-d'))\n ->setParameter('to', $to->format('Y-m-d'))\n ->setParameter('user', $user)\n ->orderBy('s.date', 'ASC');\n// echo $qb->getQuery()->getSQL();\n return $qb->getQuery()->execute();\n } catch (QueryException $e) {\n echo $e->getMessage();\n }\n return [];\n }", "public static function countDays($range) {\n return round(self::countSeconds($range) / self::DAY);\n}", "public function getCountUsersList($filterParameters)\r\n {\r\n\r\n\t\t$mail = (string) $filterParameters['mail'];\r\n $firstName = (string) $filterParameters['firstName'];\r\n $lastName = (string) $filterParameters['lastName'];\r\n $cp = (string) $filterParameters['cp'];\r\n $idUser = (String) $filterParameters['idUser'];\r\n $phoneNumber = (int) $filterParameters['phone'];\r\n $country = (int) $filterParameters['country'];\r\n $qb = $this->em->createQueryBuilder()\r\n ->from('NearteamUserBundle:User', 'c')\r\n ->leftJoin('c.country', 'cnt') \r\n ->select('c.idUser,c.firstName, c.lastName, c.email, c.createDt,c.updateDt,c.birthDate, c.phone, c.cp,cnt.name')\r\n ->where('c.isDeleted = false');\r\n if (!(empty($mail))) {\r\n $qb->andwhere('c.email LIKE :email')\r\n ->setParameter('email', '%' . $mail . '%');\r\n }\r\n\t\t\r\n\t\t if((!(empty($phoneNumber))))\r\n\t\t { \r\n\t\t\t$qb->andwhere('c.phone LIKE :phone')\r\n ->setParameter('phone', '%'.$phoneNumber.'%');\r\n\t\t\t\r\n\t\t }\r\n\r\n if (!(empty($firstName))) {\r\n\r\n $qb->andwhere('c.firstName = :firstName');\r\n\r\n $qb->setParameter('firstName', $firstName);\r\n }\r\n\r\n if (!(empty($lastName))) {\r\n\r\n $qb->andwhere('c.lastName LIKE :lastName');\r\n $qb->setParameter('lastName', '%' . $lastName . '%');\r\n }\r\n\r\n\r\n // if (!(empty($city))) {\r\n\r\n // $qb->andwhere('ct.idCity = :city');\r\n // $qb->setParameter('city', $city);\r\n // }\r\n\r\n if (!(empty($idUser))) {\r\n\r\n $qb->andwhere('c.idUser LIKE :idUser');\r\n\r\n $qb->setParameter('idUser', '%' . $idUser . '%');\r\n }\r\n\r\n \r\n \r\n\r\n\r\n if (!(empty($country))) {\r\n\r\n\r\n $qb->andwhere('cnt.idCountry = :country');\r\n\r\n $qb->setParameter('country', $country);\r\n }\r\n\r\n $qb->groupBy('c.idUser');\r\n \r\n return $qb;\r\n\t\t\r\n }", "function get_override_count(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj= new available_override();\n $columns = \" sum(override) as qty\";\n $where = null;\n $rst = $obj ->get($where,$columns);\n \n if(!$rst){\n $var_result['success']=false;\n return $var_result; \n };\n \n $var_result['override_count'] = $rst[0]['qty'];\n $var_result['success']=true;\n $var_result['data']=$var_result;\n return $var_result; \n \n}", "function mfcs_request_statistics_load_counts($start, $stop) {\n if (!is_null($start) && !cf_is_integer($start) || is_null($start) && !is_null($stop)) {\n cf_error::invalid_integer('start');\n return FALSE;\n }\n\n if (!is_null($stop) && !cf_is_integer($stop) || !is_null($start) && is_null($stop)) {\n cf_error::invalid_integer('stop');\n return FALSE;\n }\n\n $counts = array();\n\n // main\n $counts['main'] = array(\n 'total' => NULL,\n );\n\n try {\n $query = db_select('mfcs_requests', 'mer');\n\n $query->addExpression('count(mer.id)');\n\n $query->condition('mer.status', MFCS_REQUEST_STATUS_DELETED, '<>');\n\n // total\n $the_query = clone($query);\n\n if (!is_null($start)) {\n $the_query->condition('mer.created', $start, '>=');\n $the_query->condition('mer.created', $stop, '<');\n }\n\n $counts['main']['total'] = $the_query->execute()->fetchField();\n\n\n // status\n $counts['status'] = array(\n 'locked' => NULL,\n 'unlocked' => NULL,\n 'accepted' => NULL,\n 'denied' => NULL,\n 'unavailable' => NULL,\n 'due_to_lock' => NULL,\n 'cancelled' => NULL,\n 'accepted_cancelled' => NULL,\n );\n\n $query = db_select('mfcs_requests', 'mer');\n\n $query->addExpression('count(mer.id)');\n\n $query->condition('mer.status', MFCS_REQUEST_STATUS_DELETED, '<>');\n\n if (!is_null($start)) {\n $query->condition('mer.created', $start, '>=');\n $query->condition('mer.created', $stop, '<');\n }\n\n // status (locked)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_LOCKED);\n $counts['status']['locked'] = $the_query->execute()->fetchField();\n\n // status (unlocked)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_UNLOCKED);\n $counts['status']['unlocked'] = $the_query->execute()->fetchField();\n\n // status (closed, accepted)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_CLOSED_ACCEPTED);\n $counts['status']['accepted'] = $the_query->execute()->fetchField();\n\n // status (closed, denied)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_CLOSED_DENIED);\n $counts['status']['denied'] = $the_query->execute()->fetchField();\n\n // status (closed, unavailable)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_CLOSED_UNAVAILABLE);\n $counts['status']['unavailable'] = $the_query->execute()->fetchField();\n\n // status (closed, due to lock)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_CLOSED_DUE_TO_LOCK);\n $counts['status']['due_to_lock'] = $the_query->execute()->fetchField();\n\n // status (cancelled)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_CANCELLED);\n $counts['status']['cancelled'] = $the_query->execute()->fetchField();\n\n // status (accepted, but cancelled)\n $the_query = clone($query);\n $the_query->condition('mer.status', MFCS_REQUEST_STATUS_CLOSED_ACCEPTED_CANCELLED);\n $counts['status']['accepted_cancelled'] = $the_query->execute()->fetchField();\n\n\n // step\n $counts['step'] = array(\n 'changes_required' => NULL,\n 'completed' => NULL,\n 'final_decision' => NULL,\n 'release_hold' => NULL,\n 'review' => NULL,\n 'requirements' => NULL,\n 'venue_available' => NULL,\n );\n\n $query = db_select('mfcs_requests', 'mer');\n\n $query->addExpression('count(mer.id)');\n\n $query->condition('mer.status', MFCS_REQUEST_STATUS_DELETED, '<>');\n\n if (!is_null($start)) {\n $query->condition('mer.created', $start, '>=');\n $query->condition('mer.created', $stop, '<');\n }\n\n // step (changes required)\n #$the_query = clone($query);\n #$the_query->condition('mer.step', MFCS_REVIEW_STEP_CHANGES_REQUIRED);\n #$counts['step']['changes_required'] = $the_query->execute()->fetchField();\n\n // step (completed)\n $the_query = clone($query);\n $the_query->condition('mer.step', MFCS_REVIEW_STEP_COMPLETED);\n $counts['step']['completed'] = $the_query->execute()->fetchField();\n\n // step (final approval)\n $the_query = clone($query);\n $the_query->condition('mer.step', MFCS_REVIEW_STEP_FINAL_DECISION);\n $counts['step']['final_decision'] = $the_query->execute()->fetchField();\n\n // step (release hold)\n #$the_query = clone($query);\n #$the_query->condition('mer.step', MFCS_REVIEW_STEP_RELEASE_HOLD);\n #$counts['step']['release_hold'] = $the_query->execute()->fetchField();\n\n // step (review)\n $the_query = clone($query);\n $the_query->condition('mer.step', MFCS_REVIEW_STEP_REVIEW);\n $counts['step']['review'] = $the_query->execute()->fetchField();\n\n // step (venue available)\n $the_query = clone($query);\n $the_query->condition('mer.step', MFCS_REVIEW_STEP_VENUE_AVAILABLE);\n $counts['step']['venue_available'] = $the_query->execute()->fetchField();\n\n\n // request classification\n $counts['classification'] = array(\n 'student' => NULL,\n 'camps' => NULL,\n 'facility' => NULL,\n 'external' => NULL,\n );\n\n $query = db_select('mfcs_requests', 'mer');\n\n $query->addExpression('count(mer.id)');\n\n $query->condition('mer.status', MFCS_REQUEST_STATUS_DELETED, '<>');\n\n if (!is_null($start)) {\n $query->condition('mer.created', $start, '>=');\n $query->condition('mer.created', $stop, '<');\n }\n\n // classification (student)\n $the_query = clone($query);\n $the_query->condition('mer.classification', MFCS_REQUEST_CLASSIFICATION_STUDENT);\n $counts['classification']['student'] = $the_query->execute()->fetchField();\n\n // classification (camps)\n $the_query = clone($query);\n $the_query->condition('mer.classification', MFCS_REQUEST_CLASSIFICATION_CAMPS);\n $counts['classification']['camps'] = $the_query->execute()->fetchField();\n\n // classification (faculty)\n $the_query = clone($query);\n $the_query->condition('mer.classification', MFCS_REQUEST_CLASSIFICATION_FACULTY);\n $counts['classification']['faculty'] = $the_query->execute()->fetchField();\n\n // classification (external)\n $the_query = clone($query);\n $the_query->condition('mer.classification', MFCS_REQUEST_CLASSIFICATION_EXTERNAL);\n $counts['classification']['external'] = $the_query->execute()->fetchField();\n\n\n // request type\n $counts['type'] = array(\n 'athletic' => NULL,\n 'banquery' => NULL,\n 'ceremony' => NULL,\n 'fair' => NULL,\n 'lecture' => NULL,\n 'meeting' => NULL,\n 'other' => NULL,\n 'performance' => NULL,\n 'quick_meeting' => NULL,\n 'talent' => NULL,\n 'workshop' => NULL,\n );\n\n $query = db_select('mfcs_requests', 'mer');\n\n $query->addExpression('count(mer.id)');\n\n $query->condition('mer.status', MFCS_REQUEST_STATUS_DELETED, '<>');\n\n if (!is_null($start)) {\n $query->condition('mer.created', $start, '>=');\n $query->condition('mer.created', $stop, '<');\n }\n\n // type (athletic)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_ATHLETIC);\n $counts['type']['athletic'] = $the_query->execute()->fetchField();\n\n // type (banquet)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_BANQUET);\n $counts['type']['banquet'] = $the_query->execute()->fetchField();\n\n // type (ceremony)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_CEREMONY);\n $counts['type']['ceremony'] = $the_query->execute()->fetchField();\n\n // type (fair)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_FAIR);\n $counts['type']['fair'] = $the_query->execute()->fetchField();\n\n // type (lecture)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_LECTURE);\n $counts['type']['lecture'] = $the_query->execute()->fetchField();\n\n // type (meeting)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_MEETING);\n $counts['type']['meeting'] = $the_query->execute()->fetchField();\n\n // type (other)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_OTHER);\n $counts['type']['other'] = $the_query->execute()->fetchField();\n\n // type (performance)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_PERFORMANCE);\n $counts['type']['performance'] = $the_query->execute()->fetchField();\n\n // type (quick_meeting)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_QUICK_MEETING);\n $counts['type']['quick_meeting'] = $the_query->execute()->fetchField();\n\n // type (reception)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_RECEPTION);\n $counts['type']['reception'] = $the_query->execute()->fetchField();\n\n // type (talent)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_TALENT);\n $counts['type']['talent'] = $the_query->execute()->fetchField();\n\n // type (workshop)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_WORKSHOP);\n $counts['type']['workshop'] = $the_query->execute()->fetchField();\n\n // type (club_meeting)\n $the_query = clone($query);\n $the_query->condition('mer.type', MFCS_REQUEST_TYPE_CLUB_MEETING);\n $counts['type']['club_meeting'] = $the_query->execute()->fetchField();\n }\n catch (Error $e) {\n cf_error::on_exception($e);\n\n return FALSE;\n }\n catch (Exception $e) {\n cf_error::on_exception($e);\n\n return FALSE;\n }\n\n return $counts;\n}", "function getCount($user_name)\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering getCount(\".$user_name.\") method ...\");\n\t\t$query = \"select count(*) from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where user_name=? and vtiger_crmentity.deleted=0\";\n\t\t$result = $this->db->pquery($query,array($user_name),true,\"Error retrieving contacts count\");\n\t\t$rows_found = $this->db->getRowCount($result);\n\t\t$row = $this->db->fetchByAssoc($result, 0);\n\n\n\t\t$log->debug(\"Exiting getCount method ...\");\n\t\treturn $row[\"count(*)\"];\n\t}", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function emailCounts($email);", "function get_statistics_data_collect($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(c.regdate, '%Y-%m-%d') as date,\r\n count(c.id) as log_count,\r\n count(distinct c.work_id) as work_count\r\n from\r\n user_work_collect as c\r\n left join works on works.work_id = c.work_id\r\n where\r\n works.user_id = ?\r\n and c.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "function getUserReport( $datetypeselect, $startdate, $enddate ) {\r\n\t\t\r\n\t\t$userid = $_SESSION['userid'];\r\n\t\t\r\n\t\t\r\n\t\tif( $datetypeselect == 0 ) $left = \" left\";\r\n\t\t\r\n\t\tif( $startdate ) $datestuff .= \" and c.datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\tif( $enddate ) $datestuff .= \" and c.datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\r\n\t\t$query = \"\r\n\t\t\tselect u.ID,\r\n\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as FullName,\r\n\t\t\t u.Extension,\r\n\t\t\t u.Email\r\n\t\t\tfrom users u$left join (`contacts-users` cu join contacts c on cu.contactid = c.id$datestuff) on cu.userid = u.id\r\n\t\t\";\r\n\t\t\r\n\t\tif( $datetypeselect == 0 || $datetypeselect == 1 ) {\r\n\t\t\tif( $startdate ) $query .= \" and datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\t\tif( $enddate ) $query .= \" and datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t}\r\n\t\telse if( $datetypeselect == 2 && ($startdate || $enddate) ) {\r\n\t\t\t$query .= \" and (0\";\r\n\t\t\tif( $startdate ) $query .= \" or datecreated < '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\t\tif( $enddate ) $query .= \" or datecreated > '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\t$query .= \")\";\r\n\t\t}\r\n\t\t\r\n\t\t$query .= \" group by u.id order by u.lastname\";\r\n\t\t\t\t\r\n\t\t$return = array();\r\n\t\t$result = mysql_query( $query );\r\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $return as $rowNumber => $row ) {\r\n\t\t\t// include the number of contacts\r\n\t\t\t$query = \"select count(*) as NumContacts from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct contactid from `contacts-users` cu\r\n\t\t\t\t\twhere cu.userid = '\".$row['ID'].\"'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContacts'] = $numContactsArray['NumContacts'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContacts'] = false;\r\n\t\t\t\t\t\r\n\t\t\t// include the number of contacts in the date range\r\n\t\t\t$query = \"select count(*) as NumContactsInRange from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct c.id from contacts c\r\n\t\t\t\t\tjoin `contacts-users` cu\r\n\t\t\t\t\ton cu.contactid = c.id\r\n\t\t\t\t\tand cu.userid = '\".$row['ID'].\"'$datestuff\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContactsInRange'] = $numContactsArray['NumContactsInRange'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContactsInRange'] = false;\r\n\t\t\t\r\n\t\t\t// include all the students associated with the contacts\r\n\t\t\t$query = \"select distinct s.ID,\r\n\t\t\t\t\t concat( s.LAST_NAME, ', ', s.FIRST_NAME, ' ', s.MIDDLE_NAME ) as FullName,\r\n\t\t\t\t\t s.WOOSTER_EMAIL\r\n\t\t\t\t from X_PNSY_STUDENT s, `contacts-users` cu, `contacts-students` cs, contacts c\r\n\t\t\t\t where s.ID = cs.studentid\r\n\t\t\t\t and cu.contactid = cs.contactid\r\n\t\t\t\t and cu.userid = '\".$row['ID'].\"'\r\n\t\t\t\t and cs.contactid = c.id$datestuff\r\n\t\t\t\t \";\r\n\t\t\t$studentsArray = array();\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\twhile( $studentrow = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\tarray_push( $studentsArray, $studentrow );\r\n\t\t\t}\r\n\t\t\t$return[$rowNumber]['Students'] = $studentsArray;\r\n\t\t\t\r\n\t\t\t$return[$rowNumber]['StartDate'] = $startdate;\r\n\t\t\t$return[$rowNumber]['EndDate'] = $startdate;\r\n\t\t}\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "public function getUsersByRangeDate($type, $startDate='', $endDate='', $sexe='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$now = new \\DateTime(\"now\");\r\n\t\t//$now->format('Y-m-d') . ' 23:59:59';\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\tswitch ($type){\r\n\t\t\tcase 'members' :\r\n\t\t\t\t$filter = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'validatedMembers' :\r\n\t\t\t\t$filter = \"AND (u.state IS NOT NULL)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'activeMembers' :\r\n\t\t\t\t$filter = \"AND u.state=1\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'optin' :\r\n\t\t\t\t$filter = \"AND u.optin=1\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'optinPartners' :\r\n\t\t\t\t$filter = \"AND u.optinPartner=1\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'unregistered' :\r\n\t\t\t\t$filter = \"AND u.state IS NULL\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'suspended' :\r\n\t\t\t\t$filter = \"AND u.state=2\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tswitch ($sexe){\r\n\t\t\tcase 'M' :\r\n\t\t\t\t$filterSexe = \" AND (u.title='M' OR u.title IS NULL)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'Me':\r\n\t\t\t\t$filterSexe = \" AND u.title='Me'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '' :\r\n\t\t\t\t$filterSexe = \"\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(u.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND u.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"u.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"u.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"u.created_at IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(u.id) FROM PlaygroundUser\\Entity\\User u\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\t' . $filter . ' ' . $filterSexe . '\r\n\t\t');\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getProjectsByUserIdCount(int $userId) : int;", "public function getProfilePics(array $facebook_uids){\r\n\t\t$profile_pics = array();\r\n\t\t$fb_result = $this->usersGetInfo($facebook_uids, array('pic'));\r\n\t\tif(Helper_Request::assureVariable($fb_result, 'ARR')){\r\n\t\t\tforeach($fb_result as $index => $facebook_info){\r\n\t\t\t\tif(is_array($facebook_info) && array_key_exists('uid', $facebook_info) && array_key_exists('pic', $facebook_info)){\r\n\t\t\t\t\t$profile_pics[$facebook_info['uid']] = $facebook_info['pic'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $profile_pics;\r\n\t}", "public function getCountEvents(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = $record->getEntityRecordsCount();\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}", "function getCountBetweenDates($from, $till) {\n\t\t$retVal = 0;\n\t\t\n\t\t$sql =\"SELECT count(*) as total from \" . $this->mTable . \" where date >=:date_from and date<=:date_till\";\n\t\n\t\t$this->mDb->query($sql);\n\t\t$this->mDb->bind(\":date_from\", $from);\n\t\t$this->mDb->bind(\":date_till\", $till);\n\n\t\t$rows = $this->mDb->single();\n\t\t\n\t\tif (is_array($rows)) {\n\t\t\t$retVal = $rows[\"total\"];\n\t\t}\n\t\t\n\t\t$this->mError = $this->mDb->getLastError();\n\t\treturn $retVal;\n\n\t}", "function get_statistics_data_view($params)\r\n {\r\n $params = (object)$params;\r\n $default_params = (object)array(\r\n 'user_id' => USER_ID,\r\n 'sdate' => date('Y-m-d'),\r\n 'edate' => date('Y-m-d', strtotime(\"-1 week\"))\r\n );\r\n foreach($default_params as $key => $value){\r\n if(!isset($params->{$key}))\r\n $params->{$key} = $value;\r\n }\r\n \r\n $period = new DatePeriod(\r\n new DateTime($params->sdate),\r\n new DateInterval('P1D'),\r\n new DateTime($params->edate)\r\n );\r\n\r\n $data = array();\r\n \r\n $sql = \"SELECT \r\n date_format(v.regdate, '%Y-%m-%d') as date,\r\n count(v.id) as log_count,\r\n count(distinct v.work_id) as work_count\r\n from\r\n log_work_view as v\r\n left join works on works.work_id = v.work_id\r\n where\r\n works.user_id = ?\r\n and v.regdate between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($params->user_id, $params->sdate, $params->edate));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = $row->log_count;\r\n }\r\n\r\n $output = array();\r\n foreach ($period as $date) {\r\n $dateString = $date->format('Y-m-d');\r\n $output[$dateString] = (empty($data[$dateString]))?0:$data[$dateString];\r\n }\r\n\r\n return $output;\r\n }", "public function countAllEntries($competition_date_start, $competition_date_end = null)\n {\n $competition_date_end = ($competition_date_end === null) ? $competition_date_start : $competition_date_end;\n $competition_date_start = $this->rpsdb->getMysqldate($competition_date_start);\n $competition_date_end = $this->rpsdb->getMysqldate($competition_date_end);\n\n $return = $this->getAllEntries($competition_date_start, $competition_date_end);\n\n return count($return);\n }", "function loginHistoryCount($userId, $searchText, $fromDate, $toDate)\n {\n $this->db->select('BaseTbl.id,BaseTbl.userId, BaseTbl.sessionData, BaseTbl.machineIp, BaseTbl.userAgent, BaseTbl.agentString, BaseTbl.platform, BaseTbl.createdDtm');\n if(!empty($searchText)) {\n $likeCriteria = \"(BaseTbl.sessionData LIKE '%\".$searchText.\"%')\";\n $this->db->where($likeCriteria);\n }\n if(!empty($fromDate)) {\n $likeCriteria = \"DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) >= '\".date('Y-m-d', strtotime($fromDate)).\"'\";\n $this->db->where($likeCriteria);\n }\n if(!empty($toDate)) {\n $likeCriteria = \"DATE_FORMAT(BaseTbl.createdDtm, '%Y-%m-%d' ) <= '\".date('Y-m-d', strtotime($toDate)).\"'\";\n $this->db->where($likeCriteria);\n }\n if($userId >= 1){\n $this->db->where('BaseTbl.userId', $userId);\n }\n $this->db->from('user_last_login as BaseTbl');\n $query = $this->db->get();\n \n return $query->num_rows();\n }", "public function statistics(Request $request)\n {\n $statistics = [];\n foreach ($this->getQueryType($request, true) as $alias => $notificationClassname) {\n $badge = $request->user()->unreadNotifications()->whereType($notificationClassname)->count();\n if ($notificationClassname === SystemNotification::class) {\n $first = $request->user()->notifications(SystemNotification::class)->first();\n $statistics[$alias] = [\n 'badge' => $badge,\n ];\n $statistics[$alias] = array_merge($statistics[$alias], (! $first) ? [] : [\n 'first' => new NotificationResource($first),\n ]);\n continue;\n }\n\n $lastCreatedAt = $this->dateTimeToIso8601ZuluString(\n $request->user()->notifications()->whereType($notificationClassname)->first()->created_at ?? null\n );\n $previewUserNames = $request->user()\n ->notifications()\n ->whereType($notificationClassname)\n ->limit(5)\n ->get()\n ->map(function ($notification) {\n return $notification->data['sender']['name'];\n })\n ->filter()\n ->unique()\n ->values()\n ->all();\n $statistics[$alias] = [\n 'badge' => $badge,\n 'last_created_at' => $lastCreatedAt,\n 'preview_users_names' => $previewUserNames,\n ];\n }\n\n $statistics['follow'] = [\n 'badge' => $request->user()->unreadNotifications()->whereType(FollowNotification::class)->count(),\n ];\n\n return new JsonResponse($statistics);\n }", "public function getScoresUser($user_id, $competition_date_start, $competition_date_end = null)\n {\n $competition_date_end = ($competition_date_end === null) ? $competition_date_start : $competition_date_end;\n\n $sql = $this->rpsdb->prepare(\"SELECT\n c.ID AS Competition_ID,\n c.Competition_Date,\n c.Classification,\n if(c.Classification = 'Beginner', 1,\n if(c.Classification = 'Advanced', 2,\n if(c.Classification = 'Salon', 3, 0))) AS \\\"Class_Code\\\",\n c.Medium,\n c.Theme,\n e.ID AS Entry_ID,\n e.Title,\n e.Server_File_Name,\n e.Score,\n e.Award\nFROM competitions AS c, entries AS e\nWHERE c.ID = e.Competition_ID AND\n c.Competition_Date >= %s AND\n c.Competition_Date <= %s AND\n e.Member_ID = %s\nORDER BY c.Competition_Date, c.Medium\",\n $competition_date_start,\n $competition_date_end,\n $user_id);\n $return = $this->rpsdb->get_results($sql, ARRAY_A);\n\n return $return;\n }", "function getCompanyViews($params, $arr_test_user_account_ids = null)\n\t{\n\t\t$company_id = !empty($params['companyId']) ? $params['companyId'] : (!empty($params['companyid']) ? $params['companyid'] : '');\n\t\t$campaign_ids = !empty($params['campaignId']) ? $params['campaignId'] : (!empty($params['campaignid']) ? $params['campaignid'] : '');\n\t\t//$start_date = $params['startDate'];\n\t\t$start_date = !empty($params['startDate']) ? $params['startDate'] : (!empty($params['startdate']) ? $params['startdate'] :'');\n\t\t//$end_date = $params['endDate'];\n\t\t$end_date = !empty($params['endDate']) ? $params['endDate'] : (!empty($params['enddate']) ? $params['enddate'] :'');\n\t\t$rejected_permissions = !empty($params['rejectedPermissions']) ? $params['rejectedPermissions'] : (!empty($params['rejectedpermissions']) ? $params['rejectedpermissions'] :'');\n\t\t\n\t\t$time_zone = !empty($params['timezone']) ? $params['timezone'] : '-0500';\n\t\t$str_date_sub_start = \"\";\n\t\t$str_date_sub_end = \"\";\n\t\t$str_time_zone = 'UTC';\n\t\t\n\t\tswitch($time_zone)\n\t\t{\n\t\t\tcase '-0500':\n\t\t\t\t$str_date_sub_start = \"date_sub(\";\n\t\t\t\t$str_date_sub_end = \", interval 5 hour)\";\n\t\t\t\t$str_time_zone = 'EST';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif(!empty($params['useDate']))\n\t\t{\n\t\t\t$str_date_sub_start = \"date(\" . $str_date_sub_start;\n\t\t\t$str_date_sub_end .= \")\";\n\t\t}\n\t\t\n\t\tif(empty($arr_test_user_account_ids))\n\t\t\t$arr_test_user_account_ids = User::getTestUserAccountsIds();\n\t\t\n\t\t// Total Views\n\t\t$arr_where_clause_views = array();\n\t\t$sql_views = \"select count(iv.id) as num_views from items_views iv\";\n\t\tif(empty($campaign_ids))\n\t\t\t$arr_where_clause_views[] = \" iv.company_id = '$company_id'\";\n\t\telse\n\t\t\t$arr_where_clause_views[] = \" iv.items_id in ($campaign_ids)\";\n\t\t\n\t\tif(!empty($start_date) && !empty($end_date))\n\t\t{\n\t\t\tif($start_date != $end_date)\n\t\t\t\t$arr_where_clause_views[] = \" \" . $str_date_sub_start . \"iv.created\" . $str_date_sub_end . \" between '$start_date' and '$end_date'\";\n\t\t\telse\n\t\t\t\t$arr_where_clause_views[] = \" \" . $str_date_sub_start . \"iv.created\" . $str_date_sub_end . \" = '$start_date'\";\n\t\t\t\t\n\t\t}\n\t\telse if(!empty($start_date))\n\t\t{\n\t\t\t$arr_where_clause_views[] = \" \" . $str_date_sub_start . \"iv.created\" . $str_date_sub_end . \" >= '$start_date'\";\n\n\t\t}\n\t\telse if(!empty($end_date))\n\t\t{\n\t\t\t$arr_where_clause_views[] = \" \" . $str_date_sub_start . \"iv.created\" . $str_date_sub_end . \" <= '$end_date'\";\n\t\t}\n\t\t\n\t\tif(!empty($rejected_permissions))\n\t\t\t$arr_where_clause_views[] = \" (iv.permissions_rejected = 1 or iv.share_permissions_rejected = 1)\";\n\t\t\n\t\tif(!empty($arr_test_user_account_ids))\n\t\t\t$arr_where_clause_views[] = \"iv.user_id not in (\" . implode(',', $arr_test_user_account_ids). \")\";\n\t\t\n\t\tif(!empty($arr_where_clause_views))\n\t\t\t$sql_views .= \" where \" . implode(' and ', $arr_where_clause_views);\n\t\t// error_log(\"Views SQL for getCompanyViews() : \" . $sql_views);\n\t\t$rs = Database::mysqli_query($sql_views);\n\t\t$row = Database::mysqli_fetch_assoc($rs);\n\t\t$num_views = $row['num_views'] + 0;\n\t\tDatabase::mysqli_free_result($rs);\n\t\treturn $num_views;\n\t}", "function CalculateStatsSet($oDB, $riderID, $startDate, $endDate)\n{\n $sql = \"SELECT IFNULL(SUM(Distance),0) AS Miles,\n IFNULL(SUM(IF(RideLogTypeID=1 OR RideLogTypeID=3, Distance, 0)),0) AS CEMiles,\n COUNT(DISTINCT Date) AS Days,\n COUNT(DISTINCT IF(RideLogTypeID=1 OR RideLogTypeID=3, Date, NULL)) AS CEDays,\n COUNT(DISTINCT IF(RideLogTypeID=1 OR RideLogTypeID=3, RideLogID, NULL)) AS CERides\n FROM ride_log\n WHERE RiderID=$riderID AND Date BETWEEN '\" . $startDate->format('Y-m-d') . \"' AND '\" . $endDate->format('Y-m-d') . \"'\n GROUP BY RiderID\";\n $rs = $oDB->query($sql);\n if($rs->num_rows)\n {\n $record = $rs->fetch_array(MYSQLI_ASSOC);\n }\n else\n {\n $record = array('Miles'=>0, 'CEMiles'=>0, 'Days'=>0, 'CEDays'=>0, 'CERides'=>0);\n }\n $rs->close();\n return($record);\n}", "public static function getArticulosUsuarios($date1 = null, $date2 = null) \n {\n if(($date1 == null) || ($date2 == null)){\n $q = Doctrine_Query::create()\n\t ->select('u.username, count(i.id) as cant')\n\t ->from('sfGuardUser u, Item i')\n\t ->where('u.id = i.sf_guard_user_id')\n\t ->groupBy('u.id');\n\n return ($q->fetchArray());\n\n }else{\n $array1 = split('/',$date1);\n $array2 = split('/',$date2);\n $date1 = $array1[2].'/'.$array1[1].'/'.$array1[0];\n $date2 = $array2[2].'/'.$array2[1].'/'.$array2[0];\n \n $q = Doctrine_Query::create()\n\t ->select('u.username, count(i.id) as cant')\n\t ->from('sfGuardUser u, Item i')\n\t ->where('u.id = i.sf_guard_user_id')\n ->andWhere('i.created_at BETWEEN ? AND ?', array($date1, $date2))\n\t ->groupBy('u.id');\n\n return ($q->fetchArray());\n }\n }", "function how_many_photos($data)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT spotlight_post_id FROM gv_spotlight_post_image WHERE (spotlight_image_block = 0) AND spotlight_post_id = ' . $data;\r\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\r\n\t\t\r\n\t\tif(mysql_num_rows($result) > 0)\r\n\t\t{\r\n\t\t\t$number_of_images = mysql_num_rows($result);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\t$number_of_images = 0;\r\n\t\t}\r\n\t\treturn $number_of_images;\r\n\t}", "public function getExistingRoomRentOnDate($userId, $date) {\n if (!is_array($userId)) $userId = array($userId);\n $sql = \"select user_id, amount_total as totalRent, service_cost as serviceCost, UNIX_TIMESTAMP(effective_date) as rentDate from property_transactions where user_id IN (\" . implode(',', $userId) . \") order by user_id, effective_date desc\";\n $rez = DB::select($sql);\n/*\nEXAMPLE SQL AND OUTPUT\nselect user_id, totalRent, serviceCost, UNIX_TIMESTAMP(effectiveDate) as rentDate from rent where user_id IN (236, 240 ) order by user_id, effectiveDate desc;\nuser_id totalRent serviceCost rentDate\n236 564.11 282.95 1498867200\n236 554.11 272.95 1467331200\n236 538.18 267.70 1441065600\n236 538.18 174.70 1441065600\n240 588.68 276.39 1498867200\n240 578.68 266.39 1467331200\n240 562.11 261.14 1443657600\n240 562.11 168.13 1443657600\n*/\n $rentValuesByUser = array(); // We are/could be processing multiple tenants, with multiple rent amounts.\n for ($j=0; $j<sizeof($rez); $j++) // For each user\n {\n if (!array_key_exists($rez[$j]->user_id, $rentValuesByUser)) \n $rentValuesByUser[$rez[$j]->user_id] = array(); \n $rentValuesByUser[$rez[$j]->user_id][] = $rez[$j]; \n\n }\n $result = array();\n foreach ($userId as $u) {\n $result[$u] = array( // Initialize array of array containing rents, service and totals, using user_id as index\n 'rent' => 0,\n 'service' => 0,\n 'total' => 0\n );\n }\n foreach ($rentValuesByUser as $uId => $rents) {\n // $rents are already in descending date order\n foreach ($rents as $rent) {\n if ($rent->rentDate <= $date) {\n $result[$uId]['total'] = number_format($rent->totalRent, 2);\n $result[$uId]['service'] = number_format($rent->serviceCost, 2);\n $result[$uId]['rent'] = number_format((float)$result[$uId]['total'] - (float)$result[$uId]['service'], 2);\n break;\n }\n }\n }\n// return count($userId) > 1 ? $result : $result[$userId[0]];\n return $result;\n }", "function statistics_extended_objects_view_count($object_types,$container_guid=null,$owner_guid=null){\r\n\tif(!is_array($object_types)){\r\n\t\t$object_types = array($object_types);\r\n\t}\r\n\t$resp = array();\r\n\tforeach($object_types as $object_type){\r\n\t\t$resp[$object_type] = statistics_extended_object_view_count($object_type,$owner_guid,$container_guid);\r\n\t}\r\n\treturn $resp;\r\n}", "public function getUniqueAccount($startDate, $endDate)\n {\n /*\n $cursor = $this\n ->mongo\n //->where('status', static::STATUS_NOT_POSTED)\n ->whereGte('import_date', $startDate)\n ->whereLte('import_date', $endDate)\n ->orderBy(array('account_number' => 'asc'))\n ->get($this->collection)\n ;\n */\n\n $collectionName = $this->collection;\n\n $cursor = $this->mongoDB->{$collectionName}->find(\n array(\n 'import_date' => array('$gte' => $startDate, '$lte' => $endDate),\n 'status' => static::STATUS_NOT_POSTED\n )\n );\n\n $accounts = array();\n foreach ($cursor as $doc) {\n if (isset($doc['account_number'])) {\n $accounts[] = $doc['account_number'];\n }\n }\n\n return array_unique($accounts);\n }", "public function countVotesCreatedBetweenDatesGroupByWeeks(\\DateTime $dateTimeInit, \\DateTime $dateTimeEnd)\n\t{\n\t\t$queryBuilder = $this->em->createQueryBuilder();\n\t\t$queryBuilder->select('YEAR(v.publicatedAt) AS YEAR, WEEK(v.publicatedAt) AS WEEK, COUNT(v.publicatedAt) AS Votes , COUNT(DISTINCT v.participant) AS Users')\n\t\t->from($this->class,'v')\n\t\t->where($queryBuilder->expr()->between('v.publicatedAt', ':dateTimeInit', ':dateTimeEnd'))\n\t\t->groupBy('YEAR')\n\t\t->addGroupBy('WEEK')\n\t\t->OrderBy('YEAR','DESC')\n\t\t->addOrderBy('WEEK');\n\t\n\t\n\t\t$queryBuilder->setParameter('dateTimeInit',$dateTimeInit->format(self::DATE_FORMAT));\n\t\t$queryBuilder->setParameter('dateTimeEnd',$dateTimeEnd->format(self::DATE_FORMAT));\n\t\n\t\t$result = $queryBuilder->getQuery()->getScalarResult();\n\t\n\t\treturn $result;\n\t}", "public function getByUserAndDate($user_id, $start_date, $end_date)\n {\n return $this->db->table(static::TABLE)\n ->eq('user_id', $user_id)\n ->gte('date', $start_date)\n ->lte('date', $end_date)\n ->desc('date')\n ->asc('start')\n ->findAll();\n }", "function imagesList($album=array(), $images=array(), $startnum=-1, $modvars=array(), $imagesCount=null)\n\t{\n\t\t// Create output object\n\t\t$pnRender = pnRender :: getInstance('crpCasa');\n\n\t\t$pnRender->assign('startnum',$startnum);\n\t\t$pnRender->assign($modvars);\n\t\t$pnRender->assign('album',$album);\n\t\t$pnRender->assign('images',$images);\n\t\t// Assign the information required to create the pager\n\t\t$pnRender->assign('pager', array (\n\t\t\t'numitems' => $imagesCount,\n\t\t\t'itemsperpage' => $modvars['albumsperpage']\n\t\t));\n\n\t\t// Return the output that has been generated by this function\n\t\treturn $pnRender->fetch('crpcasa_user_album_view.htm');\n\t}", "public static function getListofDatesBetweenTwoDates($date_from, $date_to) {\n // Convert date to a UNIX timestamp\n $date_from = strtotime($date_from);\n $date_to = strtotime($date_to);\n $list = array();\n for ($i = $date_from; $i <= $date_to; $i+=86400) {\n $list[] = date('m/d/Y', $i);\n }\n $date_range = implode(\",\", $list);\n return $date_range;\n }", "private function count_chrono_records(){\n\t\t$searchmonthnext = $this->searchmonth + 1;\n\t\t$start = mktime(0, 0, 0, $this->searchmonth, 1, $this->searchyear);\n\t\t$end = mktime(23, 59, 59, $searchmonthnext, 0, $this->searchyear);\n\t\t\n\t\ttry {\n \t\t \t\t$stmt = $this->db->prepare(\" SELECT COUNT(*) FROM $this->tablename WHERE $this->record_date >= :start AND $this->record_date <= :end \");\n\t\t\t\t$stmt->bindValue(':start', $start, PDO::PARAM_INT);\n\t\t\t\t$stmt->bindValue(':end', $end, PDO::PARAM_INT);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$this->volume_of_records_in_timerange = $stmt->fetchColumn();\n\t\t} catch(PDOException $ex) {\n\t\t \t\t$this->display_svg_graph = \"<p>Unable to count records.</p>\";\n\t\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "function get_user_images($user_id) {\n $images = DAO_user::DAO_fetch_user_images($user_id);\n if (is_array($images)) {\n $i = 0;\n $result = array();\n foreach ($images as $image) {\n $result[$i++] = $image;\n }\n return $result;\n }\n else return -1;\n }", "public function getUserFilesCount($user)\n {\n $queryBuilder = $this->createQueryBuilder('f');\n $queryBuilder->innerJoin('f.userFiles', 'uf', Expr\\Join::WITH, $queryBuilder->expr()->eq('uf.email', '?1'));\n $queryBuilder->select($queryBuilder->expr()->count('f'));\n $queryBuilder->setParameter(1, $user->getEmail()); \n\n $query = $queryBuilder->getQuery();\n $singleScalar = $query->getSingleScalarResult();\n return $singleScalar;\n }", "public function getFilteredContactsCount(Request $request)\n {\n $user = $request->user();\n $tag = $request->input('tag');\n $conditions = $request->input('conditions');\n\n $contacts = $this->contactRepo->getContactCountsByCondition($user, $tag, $conditions);\n\n return response()->json($contacts);\n }", "public function getRemainDateCount($startDate,$endDate)\r\n {\r\n // mysql date convert to timeStamp\r\n $startDateUnix = mysql_to_unix($startDate);\r\n $endDateUnix = mysql_to_unix($endDate);\r\n\r\n\r\n // check reservation expired\r\n if(($endDateUnix-$startDateUnix) > 0)\r\n {\r\n // get remain seconds\r\n $remainSeconds = $endDateUnix-$startDateUnix;\r\n // get remain dates\r\n return ((($remainSeconds /24) /60) /60);\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n \r\n }", "public function getTotalDistinctUserAgents($start = null, $end = null)\n {\n $query = \"SELECT count(DISTINCT http_user_agent) AS count FROM \" . $this->tableName;\n\n if ((!is_null($start)) && (!is_null($end))) {\n $query .= \" WHERE stat_date BETWEEN '$start' AND '$end' \";\n }\n\n $data = $this->SelectData($query, PDO::FETCH_ASSOC);\n if (false === $data) {\n return false;\n } else {\n return $data[0]['count'];\n }\n }", "public function getTotalDistinctUsers($start = null, $end = null)\n {\n $query = \"SELECT count(DISTINCT user_id) AS count FROM \" . $this->tableName;\n\n if ((!is_null($start)) && (!is_null($end))) {\n $query .= \" WHERE stat_date BETWEEN '$start' AND '$end' \";\n }\n\n $data = $this->SelectData($query, PDO::FETCH_ASSOC);\n if (false === $data) {\n return false;\n } else {\n return $data[0]['count'];\n }\n }", "public function getUsersCount($status = null, $type = null, $academy = null, $startDate = null, $endDate = null)\n {\n $parameters = array();\n\n if (null !== $status) {\n $parameters['status'] = $status;\n }\n\n if (null !== $type) {\n $parameters['type'] = $type;\n }\n\n if (null !== $academy) {\n $parameters['academy'] = $academy;\n }\n\n if (null !== $startDate) {\n $parameters['startDate'] = $startDate;\n }\n\n if (null !== $endDate) {\n $parameters['endDate'] = $endDate;\n }\n\n $users = $this\n ->createQueryBuilder('u')\n ->select('COUNT(u.id)')\n ->setParameters($parameters)\n ;\n\n if (null !== $status) {\n $users->andWhere('u.status = :status');\n }\n\n if (null !== $type) {\n $users->andWhere('u.type = :type');\n }\n\n if (null !== $academy) {\n $users->andWhere('u.academy = :academy');\n }\n\n if (null !== $startDate && null !== $endDate) {\n $users->andWhere('u.date >= :startDate');\n $users->andWhere('u.date <= :endDate');\n } elseif (null !== $startDate) {\n $users->andWhere('u.date >= :startDate');\n } elseif (null !== $endDate) {\n $users->andWhere('u.date <= :endDate');\n }\n\n return $users\n ->getQuery()\n ->getSingleScalarResult()\n ;\n }" ]
[ "0.6373758", "0.611192", "0.60245615", "0.60193956", "0.588854", "0.58060545", "0.5699149", "0.56943905", "0.56653905", "0.5563889", "0.55329126", "0.5487288", "0.5446137", "0.542717", "0.53767556", "0.5367526", "0.5349641", "0.53403664", "0.53330004", "0.5274494", "0.5236827", "0.52228653", "0.52145845", "0.52120006", "0.52089155", "0.51571935", "0.51441604", "0.5126235", "0.51106876", "0.5100337", "0.50957984", "0.5078542", "0.50588405", "0.5040879", "0.5033762", "0.5002964", "0.4994821", "0.4991108", "0.49885812", "0.49783945", "0.49760437", "0.49665713", "0.4964755", "0.4944832", "0.49279508", "0.49273285", "0.49257305", "0.49153334", "0.49052566", "0.49031717", "0.48954883", "0.48904964", "0.48892573", "0.48558462", "0.48547792", "0.48516145", "0.48480645", "0.48477957", "0.4836548", "0.4832844", "0.48316607", "0.48283747", "0.4825926", "0.48078382", "0.48071685", "0.4804719", "0.48043495", "0.47969157", "0.47968134", "0.479588", "0.47844908", "0.47843593", "0.47819266", "0.4774662", "0.477046", "0.47675717", "0.4759783", "0.4753136", "0.4746744", "0.47439504", "0.4743539", "0.4741653", "0.4738551", "0.47346038", "0.47343788", "0.4733032", "0.47286093", "0.4727521", "0.4726569", "0.47258103", "0.4721842", "0.4721567", "0.47210133", "0.47181398", "0.47155008", "0.47132918", "0.4711626", "0.4707619", "0.47042543", "0.47031295" ]
0.68856645
0
Retrieves a list of EXIF/TIFF/GPS tags for a given photo. The calling user must have permission to view the photo.
function photos_getExif ($photo_id, $secret = NULL) { $params = array(); $params['method'] = 'flickr.photos.getExif'; $params['photo_id'] = $photo_id; if ($secret) $params['secret'] = $secret; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photo']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "public function getPhotos();", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function getAllPhotos();", "function getTagInfos($idPhotoTag){\r\n\t\t$infos = $this->dao->getTagInfos($idPhotoTag);\r\n\t\tif($infos == null){\r\n\t\t\techo \"{error:\\\"Pas d'info\\\"}\";\r\n\t\t}\r\n\t\t$json=sprintf(\"{\\\"date\\\":\\\"%s\\\",\\\"type\\\":\\\"%s\\\",\\\"commentaire\\\":\\\"%s\\\",\\\"personnes\\\":\\\"%s\\\",\\\"motos\\\":\\\"%s\\\",\\\"motsCles\\\":\\\"%s\\\",\\\"lieux\\\":\\\"%s\\\"\",\r\n\t\t\t$infos->getInfo(\"date\"),$infos->getInfo(\"type\"),$infos->getInfo(\"commentaire\"),\r\n\t\t\t$infos->getInfo(\"personnes\"),$infos->getInfo(\"motos\"),$infos->getInfo(\"motsCles\"),\r\n\t\t\t$infos->getInfo(\"lieux\"));\r\n\t\t$json.=\"}\";\r\n\t\techo $json;\r\n\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getUserTags($imageID) {\n $sql = \"SELECT fk_pk_tags FROM t_tags_included WHERE fk_pk_bild_id=?\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $imageID);\n $select->execute();\n $result = $select->get_result();\n $tags = array();\n while ($row = $result->fetch_assoc()) {\n array_push($tags, $row[\"fk_pk_tags\"]);\n }\n $select->close();\n return $tags;\n }", "function getPhotoInfo($photoId);", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "function getTagInfos($idPhotoTag){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$photoTag = new Data();\r\n\r\n\t\t$query = \"select DAYOFMONTH(DATE_MEDIA) as day, MONTH(DATE_MEDIA) as month, YEAR (DATE_MEDIA) as year,TYPE_PHOTO,COMMENTAIRE \"\r\n\t\t\t\t. \" from PhotoTag left join media on FK_ID_PHOTOS = ID_MEDIA where ID_PHOTO_TAG = \" . $idPhotoTag;\r\n\t\t$result = mysql_query($query);\r\n\r\n\t\tif(mysql_num_rows($result)!=1){return null;}\r\n\t\tif(mysql_result($result,0,\"day\")!=null){\r\n\t\t\t$photoTag->addInfo(\"date\",mysql_result($result,0,\"day\") . \" \" . getMonth(mysql_result($result,0,\"month\")) . \" \" . mysql_result($result,0,\"year\"));\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$photoTag->addInfo(\"date\",\"\");\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"type\",mysql_result($result,0,\"TYPE_PHOTO\"));\r\n\t\t$photoTag->addInfo(\"commentaire\",mysql_result($result,0,\"COMMENTAIRE\"));\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Personne, Utilisateur where FK_ID_PHOTO_TAG = \" . $idPhotoTag . \" and FK_ID_UTILISATEUR = id_user\");\r\n\t\t$personnes = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$personnes .= mysql_result($result,$i,\"nom\") . \" \" . mysql_result($result,$i,\"prenom\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"personnes\",$personnes);\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Moto, Motos, Marques where IdMarque = marque and FK_ID_PHOTO_TAG = \" . $idPhotoTag . \" and FK_ID_MOTO = IdMoto\");\r\n\t\t$motos = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$motos = utf8_encode(mysql_result($result,$i,\"nommarque\") . \" \" . mysql_result($result,$i,\"motocmcube\") . \" \" . mysql_result($result,$i,\"nommoto\")) . \", \";\r\n\t\t\t}\r\n\t\t$photoTag->addInfo(\"motos\",$motos);\r\n\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_MotCle, MotCle where FK_ID_MOT_CLE = ID_MOT_CLE and FK_ID_PHOTO_TAG = \" . $idPhotoTag);\r\n\t\t$motsCles = \"\";\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$motsCles .= mysql_result($result,$i,\"LIB_MOT_CLE\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"motsCles\",$motsCles);\r\n\r\n\t\t$lieux = \"\";\r\n\t\t$result = mysql_query(\"select * from PhotoTag_a_Lieu, Lieu where FK_ID_LIEU = ID_LIEU and FK_ID_PHOTO_TAG = \" . $idPhotoTag);\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($result) ; $i++){\r\n\t\t\t$lieux .= mysql_result($result,$i,\"LIB_LIEU\") . \", \";\r\n\t\t}\r\n\t\t$photoTag->addInfo(\"lieux\",$lieux);\r\n\r\n\t\tmysql_close();\r\n\t\treturn $photoTag;\r\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function &getTags($pids)\n {\n // Requires a session_key\n if (!$skey = $this->_facebook->auth->getSessionKey()) {\n throw new Horde_Service_Facebook_Exception(\n 'photos.addTag requires a session_key',\n Horde_Service_Facebook_ErrorCodes::API_EC_SESSION_REQUIRED);\n }\n $results = $this->_facebook->callMethod(\n 'facebook.photos.getTags',\n array('pids' => $pids));\n\n return $results;\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function get_tags()\r\n\t{\r\n\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=tag\");\r\n\t\treturn $xml;\r\n\t}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "function getUserTags(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListUserPopular','user_id='.$this->user);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function listTags() {\n\t\t$request = $this->send(\"GET\", \"contacts/\" . $this->contactId . '/tags', [\n\t\t\t'headers' => [\n\t\t\t\t'Accept' => 'application/json, */*',\n\t\t\t],\n\t\t]);\n\t\treturn $request;\n\t}", "public function listMediaTags() {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->tags;\n\t\t$query\t\t= array('tag_status' => '1');\n\t\t$sort\t\t= array('tag_name' => 1);\n\t\t$cursor\t\t= $collection->find($query)->sort($sort);\n\t\t$resultArray= array();\n\t\t\n\t\twhile($cursor->hasNext())\n\t\t{\n\t\t\t$resultArray[]\t= $cursor->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function getImageTag();", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function photos( $tag, $count = null, $order = null )\n {\n $tag = Tag::with( $this->eagerLoad )->where( 'slug', '=', $tag )->firstOrFail();\n\n if ( $order === null ) {\n list( $orderCol, $orderBy ) = $this->defaultOrder;\n } else {\n list( $orderCol, $orderBy ) = $order;\n }\n\n return $tag->photos()\n ->orderBy( $orderCol, $orderBy )\n ->paginate( $this->perPage( $count ) );\n }", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function listImages()\n {\n $images = $this->docker(\"images --format '\\\"{{.Repository}}:{{.Tag}}\\\"' --filter=reference='*' | jq -r\");\n\n $image = explode(\"\\n\", substr($images, 0, -1));\n\n return $image;\n }", "public function Photo(){\n\t\t$photoId = \"491634914183411\";\n\t\t$imgInfo \t\t\t= 'https://graph.facebook.com/'.$photoId.'?access_token='.$this->session->userdata('oauth_token');\n\t\techo $imgInfo;\n\t}", "function getTags($tag) {\n \n \t$tags_request_url = sprintf($this->api_urls['tags'], $tag, $this->access_token);\n \t\n \treturn $this->__apiCall($tags_request_url);\n \n }", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "public function index(PhotosSearchRequest $request): array\n {\n if ($request->has('tags')) {\n // Search photo by tags.\n $photos = Photo::whereHas('tags', function (Builder $query) use ($request) {\n $query->search(explode(',', $request->tags));\n });\n } else {\n // Create fresh builder.\n $photos = Photo::query();\n }\n\n // Apply filter by title and/or description.\n if ($request->has('search')) {\n $photos = $photos->search($request->input('search'));\n }\n\n // Include advanced entity.\n $this->includeEntity($request, $photos);\n\n $photos = $photos->sort((string) $request->input('sort'));\n $photos = $photos->simplePaginate($request->input('per_page') ?? 20);\n\n return [\n 'current_page' => (int) $photos->currentPage(),\n 'per_page' => (int) $photos->perPage(),\n 'from' => (int) $photos->firstItem(),\n 'to' => (int) $photos->lastItem(),\n\n 'data' => $this->transformPhotos($photos->items(), [\n 'include_comments' => (bool) $request->include_comments,\n 'include_likes' => (bool) $request->include_likes,\n 'include_location' => (bool) $request->include_location,\n 'include_owner' => (bool) $request->include_owner,\n 'include_tags' => (bool) $request->include_tags,\n ]),\n ];\n }", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public function getPhotos($iPhotoAlbumId = null, $iPage) {\n \t$oLibSearch = Phpfox::getLib('search');\n \t$oUrlSearch = Phpfox::getLib('url');\n Phpfox::getLib('request')->set('page', $iPage);\n \t$bIsUserProfile = false;\n \t\n \tif (defined('PHPFOX_IS_USER_PROFILE')) {\n \t\t$bIsUserProfile = true;\n \t\t$aUser = Phpfox::getService('user')->get($this->_aParams['user_id']); \t\t\t\n \t}\n \t\n \t$sCategory = $aParentModule = null;\t\n\t\t$aSearch = $this->request()->getArray('search');\n\t\t$bIsTagSearch = false;\n\t\t$sView = $this->request()->get('view', false);\n\n $aPageSizes = (empty($iPhotoAlbumId) ? array(20) : array(1000));\n\t\t\n\t\t$aSort = array(\n\t\t\t'latest' => array('photo.photo_id', Phpfox::getPhrase('photo.latest')),\n\t\t);\n\t\t\n \t$oLibSearch->set(array(\n\t\t\t\t'type' => 'photo',\n\t\t\t\t'field' => 'photo.photo_id',\t\t\t\t\n\t\t\t\t'search_tool' => array(\n\t\t\t\t\t'table_alias' => 'photo',\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('photo.search_photos'),\n\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t'field' => 'photo.title'\n\t\t\t\t\t),\n\t\t\t\t\t'sort' => $aSort,\n\t\t\t\t\t'show' => $aPageSizes\n\t\t\t\t),\n\t\t\t\t'display' => 1\n\t\t\t)\n\t\t);\t\t\n\n\t\t$aBrowseParams = array(\n\t\t\t'module_id' => 'photo',\n\t\t\t'alias' => 'photo',\n\t\t\t'field' => 'photo_id',\n\t\t\t'table' => Phpfox::getT('photo'),\n\t\t\t'hide_view' => array('pending', 'my')\n\t\t);\t\n\t\t\n\t\tif ($bIsUserProfile) {\n\t\t\t$oLibSearch->setCondition('AND photo.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND photo.user_id = ' . (int) $aUser['user_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (defined('PHPFOX_IS_CUSTOM_MODULE')) {\n\t\t\t\t$this->search()->setCondition('AND photo.view_id = 0 AND photo.module_id = \\'' . Phpfox::getLib('database')->escape($this->_aParams['module_id']) . '\\' AND photo.group_id = ' . (int) $this->_aParams['item_id'] . ' AND photo.privacy IN(%PRIVACY%)');\n\t\t\t} else {\n\t\t\t\t$oLibSearch->setCondition('AND photo.view_id = 0 AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(%PRIVACY%)');\n\t\t\t}\n\t\t}\n \t\n \tif (!empty($iPhotoAlbumId)) {\n \t\t$oLibSearch->setCondition('AND photo.album_id = '. $iPhotoAlbumId);\n \t}\n \t\n \t$oLibSearch->browse()->params($aBrowseParams)->execute();\n\t\t\n\t\t$aPhotos = $oLibSearch->browse()->getRows();\n\t\t$iCnt = $oLibSearch->browse()->getCount();\n\n\n\t\tPhpfox::getLib('pager')->set(array('page' => $oLibSearch->getPage(), 'size' => $oLibSearch->getDisplay(), 'count' => $oLibSearch->browse()->getCount()));\n\t\t\n\t\tforeach ($aPhotos as $iKey => $aPhoto) {\n\t\t\tif (Phpfox::isModule('like')) {\n\t\t\t\t$aPhoto['is_liked'] = $this->database()->select('lik.like_id AS is_liked')->from(Phpfox::getT('like'), 'lik')->where('lik.type_id = \\'photo\\' AND lik.item_id = '. $aPhoto['photo_id']. ' AND lik.user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t}\t\n\t\n\t\t\t$aPhoto['is_friend'] = $this->database()->select('f.friend_id AS is_friend')->from(Phpfox::getT('friend'), 'f')->where('f.user_id = '. $aPhoto['user_id']. ' AND f.friend_user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t\n\t\t\t$aPhoto = $this->processPhoto($aPhoto);\n\t\t\t$aPhoto['type_id'] = 'photo';\n\t\t\t$aPhoto = Phpfox::getService('accountapi.feed')->processFeed($aPhoto, null, $aPhoto['user_id'], true);\n\t\t\t$aPhotos[$iKey] = $aPhoto;\n\t\t}\n\t\t\n\t\treturn array($iCnt, $aPhotos);\n }", "public function extractOGTags($tags = array())\n {\n $ogs = array();\n foreach ($tags as $tag) {\n if( $tag->hasAttribute('property') && strpos($tag->getAttribute('property'), 'og:') === 0)\n {\n $property = $tag->getAttribute('property');\n preg_match('/og:(.*)/', $property, $key);\n $ogs[$key[1]] = $tag->getAttribute('content');\n }\n }\n\n return $ogs;\n }", "public function findImagesByTags($request)\n {\n $returnType = '\\Aspose\\Imaging\\Model\\SearchResultsSet';\n $isBinary = false;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "function setTags($photo_id = false){\n\n\t\t/* Lets get some tags */\n\t\tif($photo_id){\n\n\t\t\t/* This is used on Photo Page */\n\t\t\t$tags = $this->getTags($photo_id);\n\n\t\t\t/* Start Output */\n\t\t\t$output = '';\n\t\t\tforeach($tags->photo->tags->tag as $tag){\n\t\t\t\t$output .= $tag->raw.', ';\n\t\t\t}\n\t\t} else {\n\t\t\t/* This is used on photo page */\n\t\t\t$tags = $this->getUserTags();\n\n\t\t\t/* Start Output */\n\t\t\t$output = '';\n\t\t\tforeach($tags->who->tags->tag as $tag){\n\t\t\t\t$output .= $tag->_content.', ';\n\t\t\t}\n\t\t}\n\n\t\t/* Sets global var */\n\t\t$this->tags = $output;\n\t\treturn $output;\n\t}", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getTags() {\n try {\n $getTagsOperation = new GetTags();\n\n $getTagsResponse = $this->apiCall($getTagsOperation);\n $tagsList = $getTagsResponse->getData();\n\n if ($getTagsResponse->isSuccess()) {\n\n $response = [];\n\n if(is_array($tagsList) && count($tagsList) > 0) {\n foreach ($tagsList as $item) {\n $response[] = [\n 'id' => $item['tagId'],\n 'name' => $item['name']\n ];\n }\n }\n return $response;\n }\n }catch (\\Exception $e){\n throw new \\Exception($e->getMessage());\n }\n }", "public function getTags() {\n\t\t$tags = array();\n\n\t\ttry {\n\t\t\t/** @var Thrive_Dash_Api_KlickTipp $api */\n\t\t\t$api = $this->get_api();\n\t\t\t$tags = $api->getTags();\n\t\t} catch ( Exception $e ) {\n\n\t\t}\n\n\t\treturn $tags;\n\t}", "function searchPhotos($request,$from,$size){\r\n\t $gestionTagDao = new GestionTagDao();\r\n $tab = $gestionTagDao->search($request,$from,$size);\r\n\r\n $photos = $tab[1];\r\n $nb = $tab[0];\r\n \r\n if(sizeof($photos) == 0){\r\n echo \"{\\\"message\\\":\\\"Pas de données\\\"}\";\r\n\t\t\treturn;\r\n }\r\n $tab = new Data();\r\n $tab->addInfo(\"photos\",$photos);\r\n $tab->addInfo(\"nb\",$nb);\r\n $json = $this->writePhotosJSON($tab);\r\n echo $json;\r\n }", "public function getTagsbyImageId($imageId) {\n $result = Db::queryAll(\n 'SELECT tag FROM `tags`\n LEFT JOIN `images` ON images.id = tags.image_id WHERE `image_id` = ?',\n [$imageId]\n );\n\n return $result;\n }", "public function getPhoto($photo_uid) {\r\n\t\t$photo = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE uid = \"'.intval($photo_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $photo[0];\r\n\t}", "public static function getPhotoContext($photos, $imageObject) {\r\n \r\n /**\r\n * Loop through the array once until we find the provided image. Add photos to a temporary array, and then we slice it to return the last 4 entries to the array\r\n */\r\n \r\n $return = array(); \r\n $split = 0;\r\n $tmp = array(); \r\n \r\n foreach ($photos as $key => $data) {\r\n \r\n if ($data['image_id'] == $imageObject->id) {\r\n $split = $key;\r\n break;\r\n }\r\n \r\n $tmp[] = $data; \r\n }\r\n \r\n $return = array_slice($tmp, -2);\r\n \r\n /**\r\n * Add the current photo to the array\r\n */\r\n \r\n $return[] = array_merge($photos[$split], array(\"current\" => true));\r\n \r\n /**\r\n * Loop through the array starting at $split\r\n */\r\n \r\n $tmp = array(); \r\n \r\n foreach ($photos as $key => $data) {\r\n if ($key >= $split + 1) {\r\n $tmp[] = $data;\r\n }\r\n }\r\n \r\n $return = array_merge($return, array_slice($tmp, 0, 2));\r\n \r\n return array_reverse($return);\r\n \r\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function getImages($tagID)\n\t{\t\t\n\t\treturn Tag::find($tagID)->images;\n\t}", "public function index()\n {\n return Photo::get();\n }", "public function getTags() {}", "function photos_getInfo ($photo_id, $secret = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getInfo';\n\t\t$params['photo_id'] = $photo_id;\n\t\tif ($secret) $params['secret'] = $secret;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getImageDetails($id)\n {\n \tif(!$this->token)\n \t{\n \t\treturn parent::getImageDetails($id);\n \t}\n \t\n static $method = 'flickr.photos.getSizes';\n\n if (empty($id)) {\n /**\n * @see Zend_Service_Exception\n */\n require_once 'Zend/Service/Exception.php';\n throw new Zend_Service_Exception('You must supply a photo ID');\n }\n $options = array(\n \t'api_key' => $this->apiKey,\n \t'auth_token' => $this->token, \n \t'method' => $method, \n \t'photo_id' => $id\n );\n $options = $this->signOptions($this->secret, $options);\n\n $restClient = $this->getRestClient();\n $restClient->getHttpClient()->resetParameters();\n $response = $restClient->restGet('/services/rest/', $options);\n\n $dom = new DOMDocument();\n $dom->loadXML($response->getBody());\n $xpath = new DOMXPath($dom);\n self::_checkErrors($dom);\n $retval = array();\n /**\n * @see Zend_Service_Flickr_Image\n */\n require_once 'Zend/Service/Flickr/Image.php';\n foreach ($xpath->query('//size') as $size) {\n $label = (string) $size->getAttribute('label');\n $retval[$label] = new Zend_Service_Flickr_Image($size);\n }\n\n return $retval;\n }", "function photos_search ($per_page = 25, $page = 1, $tags = NULL, $text = NULL, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.search';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($tags) {\n\t\t\t$tags = explode(',', $tags);\n\t\t\tarray_map('trim', $tags);\n\t\t\t$tags = implode(',', $tags);\n\t\t\t$params['tags'] = $tags;\n\t\t}\n\t\tif ($text) $params['text'] = trim($text);\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "private function getPhotoList($html)\n {\n $matches = array();\n $photoList = array();\n $profileSharedData = array();\n\n if (preg_match(\"#_sharedData = (\\{.*});<\\/script>#\", $html, $matches)) {\n if ((isset($matches[1])) && (!empty($matches[1]))) {\n $profileSharedData = json_decode($matches[1], true);\n }\n }\n\n if (isset($profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'])) {\n $timeLineMedia = $profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'];\n\n if (!isset($timeLineMedia['count']) || ($timeLineMedia['count'] == 0)) {\n throw new Exception(\"This profile doesn't have any photo.\", self::ERROR_PROFILE_NO_PHOTO);\n } elseif (isset($timeLineMedia['edges']) && (count($timeLineMedia['edges']) === 0)) {\n throw new Exception(\"This is a private account.\", self::ERROR_PROFILE_NO_PHOTO);\n }\n\n foreach ($timeLineMedia['edges'] as $photo) {\n if (true == $photo['node']['is_video']) {\n continue;\n }\n\n $photoList[] = array(\n 'shortcode' => $photo['node']['shortcode'],\n 'display_url' => $photo['node']['display_url'],\n 'thumbnail_src' => $photo['node']['thumbnail_src'],\n 'thumbnail_resources' => $photo['node']['thumbnail_resources'],\n 'dimensions' => $photo['node']['dimensions'],\n 'liked_by' => $photo['node']['edge_liked_by']['count'],\n 'comment_by' => $photo['node']['edge_media_to_comment']['count'],\n );\n }\n }\n\n return $photoList;\n }", "public function infoTag(TagName $tagName): array\r\n\t{\r\n\t\t$endpoint = (new Tag)\r\n\t\t\t->withTags()\r\n\t\t\t->withTagName((string)$tagName)\r\n\t\t\t->withMedia()\r\n\t\t\t->withRecent();\r\n\t\t$token = \\Ch0c01dxyz\\InstaToken\\buildURLQuery(['access_token' => $this->getAccessToken()]);\r\n\t\t$uri = (new Uri((string)$endpoint))\r\n\t\t\t->withQuery($token);\r\n\t\t$request = $this->requestFactory->createRequest(\"GET\", $uri);\r\n\t\t$response = $this->httpClient->sendRequest($request);\r\n\r\n\t\tif ($response->getStatusCode() === 400) {\r\n\t\t\t$body = $this->restoreFromJson(\r\n\t\t\t\t(string)$response->getBody()\r\n\t\t\t);\r\n\r\n\t\t\tthrow new TagException(\r\n\t\t\t\tsprintf(\"%s\", $body->meta->error_message)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn $this->restoreFromJson(\r\n\t\t\t(string)$response->getBody(),\r\n\t\t\ttrue\r\n\t\t);\r\n\t}", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "function getPhoto()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$response = $this->mapi->getPhoto($id);\n\n\t\techo json_encode($response);\n\t}", "public function tagSearch($search){\n\n $images = [];\n\n /* @var IConnector $connector */\n foreach($this->connectors as $key => $connector) {\n $images = array_merge($images, $connector->tagSearch($search));\n }\n\n return $images;\n }", "private function _getAllTags() {\n\n\t\t$param = [\n\t\t\t'table' => 'tags',\n\t\t\t'select' => '*'\n\t\t];\n\n\t\tif($this->CI->input->get()) {\n\t\t\tif(isset($this->CI->input->get['fields'])) { $param['select'] = $this->CI->input->get['fields']; }\n\t\t\tif(isset($this->CI->input->get['type'])) { $param['where'] = ['type' => $this->CI->input->get['type']]; }\n\t\t}\n\n\t\t$data = $this->CI->model->get($param);\n\t\tif(count($data)) { $this->CI->exitCode = 200; }\n\t\treturn ['data' => $data];\n\t}", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "function get_exif_data($filename, $map)\n{\n\t$result = array();\n \t\n\tif (!function_exists('read_exif_data')) {\n\t\tdie('Exif extension not available, admin should disable exif use');\n\t}\n\n\t// Read EXIF data\n\tif ($exif = @read_exif_data($filename)) {\n\t\tforeach ($map as $key => $field) {\n\t\t\tif (strpos($field, ';') === false) {\n\t\t\t\tif (isset($exif[$field])) {\n\t\t\t\t\tif ($field == 'UserComment') {\n\t\t\t\t\t\t$result[$key] = substr($exif[$field], 8);\n\t\t\t\t\t\t// Récupère l'encodage du champ et supprime les caractères NULL de complétion\n\t\t\t\t\t\t$result[$key.'_encodage'] = substr($exif[$field], 0, strpos($exif[$field] , chr(0)));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result[$key] = $exif[$field];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$tokens = explode(';', $field);\n\t\t\t\tif (isset($exif[$tokens[0]][$tokens[1]])) {\n\t\t\t\t\t$result[$key] = $exif[$tokens[0]][$tokens[1]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $result;\n}", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "function images_for_tag($tag=\"global\")\n{\n global $header_images;\n $ret=array();\n foreach($header_images as $img => $tags){\n if(in_array($tag, $tags))\n $ret[] = $img;\n }\n return $ret;\n}", "function getTags() {\n\t\t$db = Database::getInstance();\n\t\t$mysqli = $db->getConnection();\n\t\t\n\t\t$tagsArray = array();\n\t\t\t$sql_query = \"select tagnaam,tagid from tag where status=6\";\n\t\t\t$result = $mysqli->query($sql_query);\n\t\t\t\n\t\t\twhile ( $row = $result->fetch_object () ) {\n\t\t\t\t$Tag = new Tag();\n\t\t\t\t$Tag->tagId = $row->tagid;\n\t\t\t\t$Tag->tagName = $row->tagnaam;\n\t\t\t\tarray_push($tagsArray, $Tag);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$result->close();\n\t\t\treturn $tagsArray;\n\t}", "public function actionIndex()\n {\n $searchModel = new PhotoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getTags($string='',$tag='img'){\r\n $string=strtolower($string);\r\n if($string!=''){\r\n $oriString = $string;\r\n //find next tag in string code\r\n $string = stristr($string,'<'.$tag);\r\n $safetyLimit = 10000;\r\n $i=0;\r\n $tags=array();\r\n while($string && $i<$safetyLimit){\r\n //find end of tag\r\n $tagEndPos = strpos($string,'>')+1;\r\n //get tag string\r\n $tagString = substr($string,0,$tagEndPos);\r\n //get tag start.\r\n $tagStartPos = strpos($oriString,$tagString);\r\n //Put tag information into array.\r\n $tags[] = array('string'=>$tagString,'start'=>$tagStartPos,'end'=>$tagStartPos+strlen($tagString));\r\n //gets the next tag from string\r\n $string = stristr(substr($string,1),'<'.$tag);\r\n $i++;\r\n }\r\n }else{\r\n $tags = array();\r\n }\r\n return $tags;\r\n }", "public function headshots()\n {\n $compositeKey = [\n 'ezt_user_id' => $this->ezt_user_id,\n 'image_type' => 2\n ];\n\n return Image::where($compositeKey)->get();\n }", "function miu_get_images($post_id=null)\r\n{\r\n global $post;\r\n if ($post_id == null)\r\n {\r\n $post_id = $post->ID;\r\n }\r\n\r\n $value = get_post_meta($post_id, 'miu_images', true);\r\n $images = unserialize($value);\r\n $result = array();\r\n if (!empty($images))\r\n {\r\n foreach ($images as $image)\r\n {\r\n $result[] = $image;\r\n }\r\n }\r\n return $result;\r\n}", "function get_tags(){\n global $DB;\n\n $collection = $DB->get_record('tag_coll',['name' => PLUGINNAME]);\n if (!$collection->id) {\n throw new moodle_exception('pluginname', 'local_tematica');\n }\n $tags = $DB->get_records('tag', ['tagcollid' => $collection->id]);\n return $tags;\n}", "function getRecentPhoto()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentPhoto($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "public function getTags() {\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tAn array containing all of the spin tags\n\t\t$artist = $this->getArtist();\n\t\tif($artist) { return $artist->spin_tags; }\n\t}", "function imagenes_disponibles_tipo_por_tag($tag,$id_tipo) {\n\t\t$query = \"SELECT \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*, palabras.*\n\t\tFROM imagenes, palabra_imagen, palabras\n\t\tWHERE imagenes.tags_imagen LIKE '%{\".$tag.\"}%'\n\t\tAND imagenes.id_tipo_imagen='$id_tipo'\n\t\tAND palabra_imagen.id_palabra = palabras.id_palabra\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "public static function getImageData($filename){\n $exif = exif_read_data(wfArray::get($GLOBALS, 'sys/app_dir').$filename, 0, true);\n return $exif;\n }", "function getPhotosOfDir($dirName){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$r = mysql_query(\"select PATH_PHOTO,ID_PHOTO_TAG from PhotoTag where PATH_PHOTO like '\" . str_replace($this->directory,\"\",$dirName) . \"%'\");\r\n\t\t$tags = array();\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($r) ; $i++){\r\n\t\t\t$path = mysql_result($r,$i,\"PATH_PHOTO\");\r\n\t\t\t$tags[substr($path,strrpos($path,\"/\")+1)] = mysql_result($r,$i,\"ID_PHOTO_TAG\");\r\n\t\t}\r\n\r\n\t\t$tab = array();\r\n\t\t$dir = opendir($dirName . \"/sd\");\r\n\t\t$i = 0;\r\n\t\t/* Parcourt les photos */\r\n\t\twhile( ($photo = readdir($dir))!=false){\r\n\t\t\tif($photo != \".\" && $photo!=\"..\" && strstr($photo,\".jpg\") == \".jpg\"){\r\n\t\t\t\t$data = new Data();\r\n\t\t\t\t$data->addInfo(\"name\",str_replace(\".jpg\",\"\",$photo));\r\n\t\t\t\t$size = getimagesize($dirName . \"/sd/\" . $photo);\r\n\t\t\t\t$data->addInfo(\"width\",$size[0]);\r\n $data->addInfo(\"height\",$size[1]);\r\n\t\t\t\tif(isset($tags[str_replace(\".jpg\",\"\",$photo)]) == true){\r\n\t\t\t\t\t$data->addInfo(\"tag\",$tags[str_replace(\".jpg\",\"\",$photo)]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$data->addInfo(\"tag\",-1);\r\n\t\t\t\t}\r\n\t\t\t\t$tab[++$i] = $data;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Trie les photos par nom */\r\n\t\tfunction abc($a,$b){return strnatcasecmp($a->getInfo(\"name\"),$b->getInfo(\"name\"));}\r\n\t\tusort($tab,\"abc\");\r\n\r\n\t\t$connectService->close();\r\n\t\treturn $tab;\r\n\t}", "public function getTagList();", "public static function get_tags() {\n global $wpdb;\n $query = \"SELECT * FROM XTB_TAGS\";\n return $wpdb->get_results($query);\n }", "public function tag_list()\n {\n $this->pushpin_id = $_GET['pushpinId'];\n\n $query = \"SELECT tags\nFROM PushpinTags\nWHERE pushpin_ID= '$this->pushpin_id'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function getTags():array;", "function getPhotoDetail($photo_id=null){\r\n\t\tif($photo_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('id'=>$photo_id));\r\n\t\t$recordSet = $this->db->get(TBL_ALBUM_HAS_PHOTOS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function lists_photo(Request $request) {\n $widget = Widget::find($request['id']);\n $total = substr_count($widget->image, ',');\n $json = array();\n if ($widget->image != \"\") {\n for ($i = 1; $i <= substr_count($widget->image, ','); $i++) {\n $imagen = explode(',', $widget->image);\n $json[] = array('nombre' => $imagen[$i]);\n }\n }\n return response()->json($json);\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function getPhoto($id);" ]
[ "0.6933012", "0.66794616", "0.6597597", "0.62525266", "0.6190118", "0.61632466", "0.6133025", "0.604752", "0.60417026", "0.6027369", "0.60064244", "0.5946522", "0.58707833", "0.5869264", "0.5856333", "0.58200854", "0.58093375", "0.5790388", "0.5774532", "0.5761118", "0.57294065", "0.5690797", "0.56491786", "0.5623944", "0.56100714", "0.5592451", "0.5576421", "0.55744183", "0.55699086", "0.5543951", "0.5509214", "0.5431066", "0.54249203", "0.54249203", "0.54249203", "0.54249203", "0.54249203", "0.5419225", "0.5407251", "0.5405304", "0.54051286", "0.5402725", "0.5389113", "0.5372418", "0.5371105", "0.5331029", "0.53288174", "0.53124106", "0.53061146", "0.52997345", "0.52954566", "0.52881306", "0.52846277", "0.52766204", "0.52492595", "0.5249092", "0.52481186", "0.52044624", "0.5190215", "0.51769114", "0.51739234", "0.51721346", "0.51637906", "0.5159541", "0.515711", "0.5148124", "0.5146804", "0.51432693", "0.51348686", "0.5118888", "0.5116266", "0.5116252", "0.51131654", "0.51097935", "0.51086557", "0.5103223", "0.5102486", "0.5099798", "0.5098291", "0.5085656", "0.50799227", "0.50676847", "0.5058374", "0.50507313", "0.5048741", "0.5041216", "0.5032493", "0.50288", "0.50118035", "0.500972", "0.5008743", "0.50021064", "0.4994535", "0.49904335", "0.49893844", "0.4985118", "0.49847198", "0.49810442", "0.49806976", "0.4976977" ]
0.5743006
20
Returns the list of people who have favorited a given photo.
function photos_getFavorites ($photo_id, $page = 1, $per_page = 20) { $response = $this->execute(array('method' => 'flickr.photos.getFavorites', 'photo_id' => $photo_id, 'page' => $page, 'per_page' => $per_page)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photo']['person']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFavorites();", "public function find_favorites() {\n\t\tstatic $favorites;\n\n\t\tif (!is_array($favorites)) {\n\t\t\t$favorites = array();\n\t\t\tif ($this->loaded()) {\n\t\t\t\t$users = db::build()->select('user_id')->from('favorites')->where('event_id', '=', $this->id)->execute()->as_array();\n\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t$favorites[(int)$user['user_id']] = (int)$user['user_id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $favorites;\n\t}", "function getAllFoodpornsByFavorite()\n {\n $stmt = self::$_db->prepare(\"SELECT fp.* FROM favorit AS fav LEFT JOIN foodporn AS fp On fav.fs_foodporn = fp.id_foodporn AND fav.fs_user=:uid WHERE id_foodporn IS NOT NULL\");\n $uid = self::getUserID();\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "protected function favorited($username)\n {\n $user = User::whereUsername($username)->first();\n\n $presentIds = $user ? $user->favorites()->pluck('id')->toArray() : [];\n\n return $this->builder->whereIn('id', $presentIds);\n }", "function favorites() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n if ($id > 0) {\n $query = \"select * from favorites where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n } \n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function favorites()\n {\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function favorited($userId=null)\n {\n if (is_null($userId)) {\n $userId = Auth()->id();\n }\n \n return (bool) $this->favorites()\n ->where('user_id', '=', $userId)\n ->count();\n }", "public function favorited($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\treturn (bool) $this->favorites()\n\t\t\t->where('user_id', '=', $userId)\n\t\t\t->count();\n\t}", "static public function getFavorites() {\r\n self::initFav();\r\n return self::$FAV;\r\n }", "public function favorites() {\n\t\t$favoriteSounds = Sound::whereHas('favorite', function($query) {\n\t\t\t$user = Auth::user();\n\n\t\t\t$query->where('userId', '=', $user->id);\n\t\t});\n\n\t\treturn Responder::success([\n\t\t\t'favoriteSounds' => $favoriteSounds->get()\n\t\t]);\n\t}", "function getFavouriteTags(){\n //first we get all the info on tags that belong to tasks that the current user has clicked on\n $clickInfo = $this->qh->getClickTagInfo($_SESSION['userID']);\n return $this->getFavourites($clickInfo, 'TagID');\n }", "public function favorites()\n {\n $favoriteClass = config('favorable.favorite_model');\n\n return $this->morphMany($favoriteClass, 'favoriteable');\n }", "public function getFavoriteSongs($userId){\n return $this->DB->queryFetchAllAssoc(\"SELECT s.* FROM user u, song s, favorite_songs fs WHERE fs.user_id = u.id AND fs.song_id = s.id AND u.id = $userId\");\n }", "function getFavorites(){\n\n\t$id = getUserID();\n\t$query = \"SELECT networks.area, networks.state, activities.activity_name FROM favorites, networks, activities, unique_networks WHERE user_id = \".$id.\"\"\n\t.\" AND favorites.unique_network_id = unique_networks.unique_network_id\"\n\t.\" AND unique_networks.activity_id = activities.activity_id\"\n\t.\" AND unique_networks.network_id = networks.network_id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favs[] = $row['area']. \", \". $row['state']. \" - \" .$row['activity_name'];\n\t}\n\treturn $favs;\n}", "function favorites($pid, $query = array(), $rawJson = false) {\n \t\tif ( $json = $this->_get('/merchants/'.$pid.'/favorites.json', $query) )\n \t\t\treturn $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n }", "public function favorites($user, $options = []);", "public function getFavorites()\n {\n return $this->hasMany(Recipe::className(), ['id' => 'recipe_id'])\n ->viaTable('favorites', ['user_id' => 'id'])\n ->orderBy(['created_at' => SORT_DESC]);\n }", "public function favorite()\n {\n $mentor = User::leftJoin('review_mentor', 'user_id_mentor', '=', 'users.id')\n ->where('mentor', 'Y')\n ->groupBy('users.id')\n ->select('users.id', 'users.first_name', 'users.last_name', 'users.photo',\n DB::raw(\"SUM(CASE WHEN is_like = 'Y' THEN 1 ELSE 0 END) as islike \"),\n DB::raw(\"SUM(CASE WHEN is_like = 'N' THEN 1 ELSE 0 END) as unlike \")\n )\n ->get();\n return MentorFavorite::collection($mentor);\n }", "function getFavoritesWithIDs(){\n\n\t$id = getUserID();\n\t$query = \"SELECT unique_networks.unique_network_id, networks.area, networks.state, activities.activity_name FROM favorites, networks, activities, unique_networks WHERE user_id = \".$id.\"\"\n\t.\" AND favorites.unique_network_id = unique_networks.unique_network_id\"\n\t.\" AND unique_networks.activity_id = activities.activity_id\"\n\t.\" AND unique_networks.network_id = networks.network_id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favs[] = $row;\n\t}\n\treturn $favs;\n}", "public function favorites()\n\t{\n\t\treturn $this->morphMany(Favorite::class, 'favoriteable');\n\t}", "private function get_user_favorite_publics(){\r\n global $USER;\r\n\r\n if(isset($USER) && $USER->id > 0) {\r\n $publics = new PublicsByFunctionUser($USER->id, $this->tab);\r\n if($this->tab == 'formation'){\r\n return $publics->get_favorite_formation_publics();\r\n } else {\r\n return $publics->get_favorite_course_publics();\r\n }\r\n }\r\n return false;\r\n }", "public function favorite()\n {\n $attributes = ['user_id' => auth()->id()];\n\n if (! $this->favorites()->where($attributes)->exists()) {\n return $this->favorites()->create($attributes);\n }\n }", "public function getAllFavorites($user_id);", "public function myfavorites_get()\n {\n $user = $this->getCurrentUser();\n $criteria = new \\Doctrine\\Common\\Collections\\Criteria();\n //AQUI TODAS LAS EXPRESIONES POR LAS QUE SE PUEDE BUSCAR CON TEXTO\n $expresion = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"favorite\", \\Doctrine\\Common\\Collections\\Expr\\Comparison::EQ, 1);\n $criteria->where($expresion);\n $criteria->orderBy(array(\"visited_at\"=>\"DESC\"));\n $relacion = $user->getUserservices()->matching($criteria)->toArray();\n $result[\"desc\"] = \"Listado de los servicios marcados como favoritos por el usuario\";\n $result[\"data\"] = array();\n foreach ($relacion as $servicerel) {\n $service_obj = $servicerel->getService();\n $service_obj->loadRelatedData($user, null, site_url());\n $result[\"test\"] = $service_obj->loadRelatedUserData($user);\n $result[\"data\"][] = $service_obj;\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n\n }", "public function favorite(){\n $attributes = ['user_id' => auth()->id()];\n\n if(! $this->favorites()->where($attributes)->exists()){\n return $this->favorites()->create($attributes);\n }\n }", "public function favourites()\n {\n return $this->morphMany(Favourite::class, 'favourite');\n }", "public function getFavorites()\n {\n $tricks = $this->tricks->findAllFavorites($this->user);\n\n $this->view('user.favorites', compact('tricks'));\n }", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function favorites() {\n return $this->hasMany(Favorite::class);\n }", "function get_product_favourite( $conds = array(), $limit = false, $offset = false )\n\t{\n\t\t$this->db->select('rt_products.*'); \n\t\t$this->db->from('rt_products');\n\t\t$this->db->join('rt_favourites', 'rt_favourites.product_id = rt_products.id');\n\n\t\tif(isset($conds['user_id'])) {\n\n\t\t\tif ($conds['user_id'] != \"\" || $conds['user_id'] != 0) {\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\t\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t$this->db->offset($offset);\n\t\t}\n\t\t\n\t\treturn $this->db->get();\n \t}", "public function getUserFavorites($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collUserFavorites === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collUserFavorites = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(UserFavoritePeer::USER_ID, $this->id);\n\n\t\t\t\tUserFavoritePeer::addSelectColumns($criteria);\n\t\t\t\t$this->collUserFavorites = UserFavoritePeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(UserFavoritePeer::USER_ID, $this->id);\n\n\t\t\t\tUserFavoritePeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastUserFavoriteCriteria) || !$this->lastUserFavoriteCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collUserFavorites = UserFavoritePeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastUserFavoriteCriteria = $criteria;\n\t\treturn $this->collUserFavorites;\n\t}", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function isFavorited()\n {\n\n // NB FARE ATTENZIONE CHE SE VALORIZZIAMO CON IL QUERY BUILDER IL METODO WHERE VUOLE UN ARRAY KEY=>VALUE\n // MENTRE IL METODO WHERE DELLA COLLECTION VUOLE 2 PARAMETRI\n\n // Metodo via SQL - N+1 problem () ad ogni commento lancio la query per sapere se ho messo il like\n //return $this->favorites()->where(['user_id' => Auth::id()])->exists();\n\n // Metodo via Collection - NON HO IL N+1 problem () ad ogni commento NON lancio la query in quanto ho già i favorites precaricati tramite eagerLoad, quindi lavoro sulla collection per sapere se ho messo il like\n return !! $this->favorites->where('user_id', auth()->id())->count(); // !! inverto la negazione facendo il cast a boolean\n }", "public function favorites(){\n return $this->morphMany(Favorite::class, 'favorited');\n }", "public function favourites()\n {\n return $this->hasMany(Favourite::class);\n }", "function followingFav($userID, $postID){\n\n\t$result = getAllFollowingList($user_id);\n\t$i=0;\n\twhile($row = mysql_fetch_assoc($result))\n\t{\n\t\t$following[$i] = $row['profile_ID'];\n\t\t$i++;\n\t}\n\n\tif($i < 20 )\n\t{\n\t\tif($following)$following = \"('\".implode(\"', '\", $following).\"')\";\n\t\t$list = isFav($following, $postID);\n\t\treturn $list;\n\t}\n\n\tif($following && $i > 19)\n\t{\n\t\t$following = array_chunk($following, 20);\n\t\tfor($i=0;$i<count($following, 0);$i++)\n\t\t\t$following[$i] = \"('\".implode(\"', '\", $following[$i]).\"')\";\n\t\t$cnt = $i;\n\t}\n\t$arr =array();\n\t$list =array();\n\tfor($i=0;$i<$cnt;$i++){\n\t\tif(isFav($following[$i]))\n\t\t{\n\t\t\t$arr = isFav($following[$i], $postID);\n\t\t\t$list = array_merge( $list, $arr);\n\t\t}\n\t}\n\n\treturn $list;\n}", "public function actionFavorites()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\t\n\t\t$unfavorite = Yii::app()->request->getParam('unfavorite');\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\n\t\tif($unfavorite && $user_id) {\n\t\t\t\n\t\t\t$record = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $unfavorite));\n\t\t//\tdie(print_r($record));\n\t\t\tif($record)\n\t\t\t\t$record->delete();\n\t\t//\t$this->redirect('/cabinet/favorites');\n\t\t//\t Yii::app()->end();\n\n\t\t}\t\n\n\n\t\t\n\t\tif($user_id) {\n\t\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\t\n\t\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t\t if ($fruit_name == 1) {\n\t\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t\t }\n\t\t\t next($cookie_favorite);\n\t\t\t}\n\t\t\t\n\t\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\t\tif(!$favorite) {\n\t\t\t\t\t$record = new Favorited;\n\t\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t\t$record->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$this->checkUser();\n\t\t$favarray = array();\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\t//echo print_r($cookie_favorite, true);\n\t\t\n\t\tforeach($cookie_favorite as $cookie_key => $cookie_value) {\n\t\t\t\n\t\t if ($cookie_value && $unfavorite != $cookie_key) {\n\t\t $cookie_fav_wrap[] = $cookie_key;\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\tif ($unfavorite != $fav_item) \n\t\t\t\t$favarray[] = $fav_item;\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\n\t\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t\tif($fav->object_id == $unfavorite)\n\t\t\t\t$fav->delete();\n\t\t}\t\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\tif($unfavorite != $favorite->object_id) {\n\t\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t\t} else {\t\t\t\t\n\t\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\tunset($_COOKIE['favorite']);\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t$cookie->path = '/';\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t} else {\n\t\t\tif(!$user_id && $unfavorite) {\n\t\t\t\tforeach($favarray as $favorite) {\n\t\t\t\t\t$cookie_fav_wrap[$favorite] = true;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset(Yii::app()->request->cookies['favorite']);\t\n\t\t\t\tunset($_COOKIE['favorite']);\n\t\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\t$cookie->expire = time() + 2592000;\n\t\t\t\t$cookie->path = '/';\n\t\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$objects = Estate::model()->findAllByAttributes(array('id'=>$favarray),array('order'=>$order_field.' '.$order_dir));\n\t\t\t\n\t\t}\n\n\t\t\n\t\t$this->render('favorites',array('objects'=>$objects,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "public function getFavoritos(){\n\t\t$user_id = $_SESSION['activeUser']->getId();\n\t\tUtilidades::_log(\"getFavoritos($user_id)\");\n\t\t\n\t\t$query = \"SELECT book.*, book_lang.*\n\t\t\t\t\tFROM favourites,book, book_lang\n\t\t\t\t\tWHERE favourites.user_id = $user_id\n\t\t\t\t\t AND favourites.book_id = book.id\n\t\t\t\t\t AND favourites.book_id = book_lang.book_id\n\t\t\t\t\t and favourites.book_lang = book_lang.lang \";\n\t\t$query.= \" ORDER BY sold DESC, rating DESC\";\n\t\t\n\t\tUtilidades::_log(\"query: \".$query);\n\t\t$res = array();\n\t\t\n\t\tforeach(DB::ejecutarConsulta($query) as $row) {\n\t\t\t// Añadimos un objeto por cada elemento obtenido\n\t\t\t$res[] = new BookVO($row);\n\t\t}\n\t\treturn $res;\n\t}", "public function my_favs(){\n $current_user=Auth::user();\n if(!$current_user){ return false; }\n\n $favorites=Favorites::where('user_id',$current_user->id)->orderBy('id', 'desc')->get();\n\n $return=[];\n foreach ($favorites as $key => $value) {\n $data = json_decode(app('App\\Http\\Controllers\\GiphyController')->single($value->gif_uid));\n $return[]=($data->data);\n }\n\n return $return;\n\n }", "public function findFavorite($pid) {\n $sql = \"SELECT `favorite` FROM `photo` WHERE `id` = ?\";\n $res = $this->connect()->prepare($sql);\n $res->bind_param(\"s\", $pid);\n $res->execute();\n $res->bind_result($favorite);\n if($res->fetch()) {\n return $favorite;\n }\n return FALSE;\n }", "public static function loop_my_favorites() {\n $paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n if( ! is_array( $favorites ) || count( $favorites ) == 0 ) {\n $favorites = array( '', );\n }\n\n query_posts( array(\n 'post_type' => 'property',\n 'paged' => $paged,\n 'post__in'\t\t=> $favorites,\n 'post_status' => 'publish',\n ) );\n }", "public function favourite()\n {\n return $this->belongsToMany('App\\User', 'favourite', 'media_id', 'user_id');\n }", "public function favorites()\n {\n return $this->belongsToMany(Question::class, 'favorites', 'user_id', 'question_id')->withTimestamps();\n }", "public function get_favorites()\n {\n return view('content.favorites')\n ->with('page_title', 'Your Favorite Pages')\n ->with('titles', Favorite::all());\n }", "function theme_profile_favourites($profile_pid, $post_page, $post_tab, $post_type) {\n\n\t// note: Favourites are viewable by everyone!\n\t\n\t$profile_author = get_user_by('slug', $profile_pid);\n\n\tglobal $wpdb, $post, $current_user, $current_site, $gp;\n\t$geo_currentlocation = $gp->location;\n\t$ns_loc = $gp->location['country_iso2'] . '\\\\Edition';\n\t$edition_posttypes = $ns_loc::getPostTypes();\n\t\n\t$post_type_filter = \"\";\n\t$post_type_key = getPostTypeID_by_Slug($post_type);\n\t\n\tif ( $post_type_key ) {\n\t\t$post_type_filter = \"\" . $wpdb->prefix . \"posts.post_type = '{$post_type_key}'\";\n\t} else {\n\t foreach ($edition_posttypes as $value) {\n\t\t if ( $value['enabled'] === true ) {\n\t\t\t $post_type_filter .= $wpdb->prefix . \"posts.post_type = '{$value['id']}' or \";\n\t\t }\n\t\t}\n\t\t$post_type_filter = substr($post_type_filter, 0, -4);\n\t}\n\n\t$total = \"SELECT COUNT(*) as count\n\t\t\t\tFROM \" . $wpdb->prefix . \"posts \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"usermeta as m0 on REPLACE(m0.meta_key, 'likepost_', '')=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"postmeta as m1 on m1.post_id=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tWHERE post_status='publish' \n\t\t\t\t\tAND (\" . $post_type_filter . \")\n\t\t\t\t\tAND m0.meta_value > 0 \n\t\t\t\t\tAND m0.user_id = $profile_author->ID \n\t\t\t\t\tAND m0.meta_key LIKE 'likepost%' \n\t\t\t\t\tAND m1.meta_value >= 1;\";\n\t\t\t\t\n\t$totalposts = $wpdb->get_results($total, OBJECT);\n\t\n\t#$ppp = intval(get_query_var('posts_per_page'));\n\t$ppp = 20;\n\t$wp_query->found_posts = $totalposts[0]->count;\n\t$wp_query->max_num_pages = ceil($wp_query->found_posts / $ppp);\t\t\n\t#$on_page = intval(get_query_var('paged'));\t\n\t$on_page = $post_page;\n\n\tif($on_page == 0){ $on_page = 1; }\t\t\n\t$offset = ($on_page-1) * $ppp;\n\n\t$querystr = \"SELECT DISTINCT \" . $wpdb->prefix . \"posts.*\n\t\t\t\t\t, m1.meta_value as _thumbnail_id \n\t\t\t\tFROM \" . $wpdb->prefix . \"posts \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"usermeta as m0 on REPLACE(m0.meta_key, 'likepost_', '')=\" . $wpdb->prefix . \"posts.ID \n\t\t\t\tLEFT JOIN \" . $wpdb->prefix . \"postmeta as m1 on m1.post_id=\" . $wpdb->prefix . \"posts.ID\n\t\t\t\tWHERE post_status='publish'\n\t\t\t\t\tAND (\" . $post_type_filter . \") \n\t\t\t\t\tAND m0.meta_value > 0 \n\t\t\t\t\tAND m0.user_id = $profile_author->ID \n\t\t\t\t\tAND m0.meta_key LIKE 'likepost%' \n\t\t\t\t\tAND m1.meta_value >= 1 \n\t\t\t\tORDER BY m0.meta_value DESC\n\t\t\t\tLIMIT \" . $ppp . \" \n\t\t\t\tOFFSET \" . $offset;\n\t\t\t\t\t\n\t $pageposts = $wpdb->get_results($querystr, OBJECT);\n\n if ( $post_type_key ) {\n foreach ($edition_posttypes as $newposttype) {\n if ( $newposttype['enabled'] === true ) {\n if ($newposttype['id'] == $post_type_key) {\n if ($newposttype['plural'] === true) {\n $post_type_name = \" \" . $newposttype['name'] . \"s\";\n } else {\n $post_type_name = \" \" . $newposttype['name'];\n }\n }\n }\n }\n }\n \n if ($post_type_name) {\n echo \"<div class=\\\"total-posts\\\">Favourite{$post_type_name}</div>\";\n } else {\n echo \"<div class=\\\"total-posts\\\">Favourites</div>\";\n }\t \n\t \n\t\t$previous_post_title = '';\n\t\tforeach ($pageposts as $post) {\n\t\t\n\t\t\tsetup_postdata($post);\n\t\t\tif ($post->post_title != $previous_post_title) {\n\t\t\t theme_index_feed_item();\n\t\t\t $previous_post_title = $post->post_title;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $wp_query->max_num_pages > 1 ) {\n\t\t\ttheme_tagnumpagination( $on_page, $wp_query->max_num_pages, $post_tab, $post_type );\n\t\t}\n}", "public function favourites()\n {\n return $this->hasManyThrough('App\\Favourite', 'favorite_tbl');\n }", "public function getFavoriteCount() {\n\t\treturn count($this->favorite_users);\n\t}", "public function favorites()\n {\n return $this->belongsToMany(Product::class, 'favorites');\n }", "public function favorite(Post $post)\n {\n if (Groupe::findOrFail($post->groupe_id)->is_member())\n return $post->favorited_users()->toggle(Auth::user());\n \n return response()->json(['message' => 'Not a member'], 200);\n /*if (empty($post->favorited_users()->find(Auth::id()))) {\n $post->favorited_users()->attach(Auth::id());\n return response()->json(['message' => 'Le post a été aimé avec succès'], 200);\n } else {\n DB::table('favorises')->where('compte_id', Auth::id())->where('post_id', $post->id)->delete();\n return response()->json(['message' => 'Le post a été - avec succès'], 200);\n }*/\n }", "public function favorite($id)\n {\n\n $uid = Auth::user()->id;\n $user = \\App\\User::where('id', $uid)->first();\n $recipe = \\App\\Recipe::where('id', $id)->first();\n $hasfavorited = \\App\\User::whereHas('favorites', function($q) use($uid, $id) {\n $q->where ('favorited', '1');\n $q->where ('recipe_id', $id);\n })->exists();\n\n $user->favorites()->attach($recipe->id, ['favorited' => '1']);\n return redirect()->route('recipes.show',$recipe->id)->with('message', 'You succesfully favorited the recipe.');\n}", "public static function getFavoriteUsers(string $moduleName): array\n\t{\n\t\t$userId = \\App\\User::getCurrentUserId();\n\t\tif (\\App\\Cache::has('FavoriteUsers', $userId)) {\n\t\t\t$users = \\App\\Cache::get('FavoriteUsers', $userId);\n\t\t} else {\n\t\t\t$users = (new \\App\\Db\\Query())->select(['fav_id', 'id'])\n\t\t\t\t->from('u_#__users_pinned')\n\t\t\t\t->where(['user_id' => $userId, 'tabid' => \\App\\Module::getModuleId($moduleName)])\n\t\t\t\t->createCommand()\n\t\t\t\t->queryAllByGroup();\n\t\t\t\\App\\Cache::save('FavoriteUsers', $userId, $users, \\App\\Cache::LONG);\n\t\t}\n\t\treturn $users;\n\t}", "public function showFavorites()\n {\n\n $favorites = Auth::user()->favorites()->orderBy('company_name')->get();\n\n $allFavoritesTags = Favorite::getTagsForFavorites();\n\n return view('pages.favorites')->with([\n 'favoritesList' => $favorites,\n 'favorites' => $favorites,\n 'allFavoritesTags' => $allFavoritesTags,\n ]);\n\n }", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function favourites()\n {\n return $this->belongsToMany(Confession::class, 'favourites', 'fb_user_id', 'confession_id');\n }", "public function getUserFavorites($limit = null)\r\n {\r\n $args = array();\r\n if (!empty($limit)) {\r\n $args['limit'] = (int)$limit;\r\n }\r\n return self::makeCall('getUserFavoriteSongs', $args, 'songs', false, $this->sessionID);\r\n }", "public function user_favorites() {\n\t\t\tif ($this->request->is('get')) {\n\t\t\t\t$user_id = $_GET['user_id'];\n\n\t\t\t$tweet_favorites = ClassRegistry::init('tweets')->find('all', array('fields' => array('tweets.tweet,tweets.photo, tweets.created ,users_profiles.firstname, users_profiles.lastname,users_profiles.photo,users_profiles.user_id,users_profiles.handler,favorites.favorite,favorites.content_id,favorites.id ,favorites.user_id'),'order'=>'favorites.id DESC',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites', 'table' => 'favorites', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('favorites.content_id = tweets.id ')),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('favorites.user_id ='.$user_id.' AND favorites.content_type=\"tweets\"')));\n\t\t\n\t\t$this->set('tweet_favorites',$tweet_favorites);\n\t\t\n\t\t/*user friends start*/\t\n\t$reqUser = ClassRegistry::init('connections')->find('all',array('fields'=>array('connections.friend_id,connections.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('(connections.user_id='.$user_id.' OR connections.friend_id='.$user_id.') AND connections.request=1')));\n\t\t\t\n\t\tforeach ($reqUser as $rfid) {\n\t\t\t\tif ($rfid['connections']['friend_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['friend_id'];\n\t\t\t\t}\n\t\t\t\tif ($rfid['connections']['user_id'] != $user_id) {\n\t\t\t\t\t$comResult[] .= $rfid['connections']['user_id'];\n\t\t\t\t} \n\t\t}\n\t\t/*user friends end*/\n\t\t\n\t\tif($comResult){\n\t\t\tif (sizeof($comResult)>1) {\n\t\t\t \t$result =@implode(',',$comResult);\n\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\tforeach ($comResult as $key=>$value) {\n\t\t\t\t\t\t\t\t\t$result = $value;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$user_tweet_comments = ClassRegistry::init('Tweet_comment')->find('all', array('fields' => array('\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.tweet_comment,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Tweet_comment.created,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.firstname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.lastname,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.photo,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.handler,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.user_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t users_profiles.tags,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.favorite,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.content_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t favorites.user_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'Tweet_comment.id DESC',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'joins'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'favorites',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.id = favorites.content_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('alias' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'table' => 'users_profiles',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array('Tweet_comment.user_id = users_profiles.user_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t array('Tweet_comment.user_id IN ('.$result.','.$user_id.')'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Tweet_comment.comment_type = \"tweets\"'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'group' => 'Tweet_comment.id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\n\t\t$this->set('user_tweet_comments',$user_tweet_comments);\n\t\t}\n\t\t\n\t\t\t/*********************************** Retweeted tweets by user **********/\n\t$retweeted_tweets = ClassRegistry::init('tweets')->find('all',array('fields'=>array('tweets.parent_id,tweets.id,tweets.user_id,users_profiles.firstname, users_profiles.lastname, users_profiles.handler, users_profiles.user_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'joins'=>array(array('alias' => 'users_profiles', 'table' => 'users_profiles', 'type' => 'left', 'foreignKey' => false, 'conditions' => array('tweets.user_id = users_profiles.user_id'))),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('tweets.parent_id !=0 AND tweets.status=2')));\n\t\t$this->set('retweeted_tweets',$retweeted_tweets);\n\t\t\n\t\t\n\t\t if ($user_id) {\n\t\t$favorites_on_Tweet = ClassRegistry::init('favorites')->find('all', array('fields'=>array('favorites.user_id,favorites.favorite,favorites.content_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order'=>'favorites.id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'favorites.content_type=\"tweets\" AND favorites.user_id='.$user_id)));\n\n\t\t$this->set('favorites_on_Tweet',$favorites_on_Tweet);\n\t\t\n\t\t/*Tweet count for current user*/\n\t$tweets_count_added_user= ClassRegistry::init('tweets')->find('all',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('conditions'=>array('tweets.user_id='.$user_id.' AND tweets.status=2')));\n\t\t\n\t$this->set('tweets_count_added_user',sizeof($tweets_count_added_user));\n\n\t\t\t\t\t/************************************** To show user following and followers ***********************/\n\t\t\t\t$userFollowings = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status, count(users_followings.following_id) as total_following'),'conditions'=>array('users_followings.user_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t$userFollows = ClassRegistry::init('users_followings')->find('all' ,array('fields'=>array('users_followings.id,users_followings.status ,count(users_followings.user_id) as total_follow'),'conditions'=>array('users_followings.following_id='.$user_id.' AND users_followings.following_type=\"users\" AND users_followings.status=2')));\n\t\t\n\t\t\n\t\t$userFollowingsbyYou = $userFollowings[0][0];\n\t\t$userFollowingsbyYou = $userFollowingsbyYou['total_following'];\n\t\t$this->set('following',$userFollowingsbyYou);\n\t\t\n\t\t$userFollowYou = $userFollows[0][0];\n\t\t$userFollowYou = $userFollowYou['total_follow'];\n\t\t$this->set('followers',$userFollowYou);\t\t\n\t\t$this->set('userName',$this->userInfo['users_profiles']);\n\n\t\t }\n\t\t\n\t\t\n\t\t$this->autorender = false;\n\t $this->layout = false;\n\t $this->render('user_favorites');\n\t\t}\n\t}", "function getRandomFavoritePhoto($userEmail) {\n $api = new Phlickr_Api(FLICKR_API_KEY, FLICKR_API_SECRET);\n // load a saved cache file if it exists, set the expiration limit to a week.\n $api->setCache(Phlickr_Cache::createFrom(CACHE_FILE, 60*60*24*7));\n\n // select a random favorite photo\n $user = Phlickr_User::findByEmail($api, $userEmail);\n $favlist = $user->getFavoritePhotoList();\n $photo = $favlist->getRandomPhoto();\n\n assert(!is_null($photo));\n\n // serialize and save the cache file\n $api->getCache()->saveAs(CACHE_FILE);\n\n return $photo;\n}", "public static function add_favorite() {\n header( 'HTTP/1.0 200 OK' );\n header( 'Content-Type: application/json' );\n\n $data = array();\n\n if( ! is_user_logged_in() ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'You need to log in at first.', 'realia-favorites' ),\n );\n } else if ( ! empty( $_GET['id'] ) ) {\n $favorites = get_user_meta( get_current_user_id(), 'favorites', true );\n $favorites = ! is_array( $favorites ) ? array() : $favorites;\n\n if ( empty( $favorites ) ) {\n $favorites = array();\n }\n\n $post = get_post( $_GET['id'] );\n $post_type = get_post_type( $post->ID );\n\n if ( 'property' != $post_type ) {\n $data = array(\n 'success' => false,\n 'message' => __( 'This is not property ID.', 'realia-favorites' ),\n );\n } else {\n $found = false;\n\n foreach ( $favorites as $property_id ) {\n if ( $property_id == $_GET['id']) {\n $found = true;\n break;\n }\n }\n\n if ( ! $found ) {\n $favorites[] = $post->ID;\n update_user_meta( get_current_user_id(), 'favorites', $favorites );\n\n $data = array(\n 'success' => true,\n );\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property is already in list', 'realia-favorites' ),\n );\n }\n }\n } else {\n $data = array(\n 'success' => false,\n 'message' => __( 'Property ID is missing.', 'realia-favorites' ),\n );\n }\n\n echo json_encode( $data );\n exit();\n }", "public function getIsFavouriteAttribute()\n {\n $user = auth()->guard('client')->user() ?? auth()->guard('api')->user();\n if (!$user)\n {\n return false;\n }\n $favourite = $this->whereHas('favourites',function ($query) use($user){\n $query->where('client_post.client_id',$user->id);\n $query->where('client_post.post_id',$this->id);\n })->first();\n // client\n // null\n if ($favourite)\n {\n return true;\n }\n return false;\n }", "public function favorite()\n\t{\n\t\t$service = $this->lib->input_post('service');\n\t\t$service = $this->services[$service];\n\n\n\t\t$video_page = $this->lib->input_post('video_page');\n\n\t\t$video_id = $service->get_video_id($video_page);\n\n\n\t\t// check if already a fav\n\n\t\t$already_fav = $service->is_favorite($video_id);\n\n\n\t\tif($already_fav)\n\t\t{\n\t\t\t// remove favorite if it is\n\t\t\t\n\t\t\t$service->remove_favorite($video_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// add favorite if it's not\n\n\t\t\t$service->add_favorite($video_id);\n\t\t}\n\t}", "public function isFavorited(){\n // return ! $this->favorites->where('user_id', auth()->id())->isEmpty();\n\n //so we do: \n //we are casting to boolean \"!!\"\n //if there is a reply, the user favorites the reply\n return !! $this->favorites->where('user_id', auth()->id())->count();\n }", "private function recipeIsFavourite($recipe) {\n // Meanwhile, we assume none of the recipes is favourite.\n return false;\n }", "public function isFavorite()\n {\n $favorite = Favorite::where('news_id' , $this->id)\n ->where('user_id', Auth::user()->id)\n ->first();\n if (!$favorite) {\n return false;\n }\n return true;\n }", "function getFavoriteIDs(){\n\t$id = getUserID();\n\t$query = \"SELECT unique_network_id FROM favorites WHERE user_id = $id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favIDs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favIDs[] = $row[0];// this is unique_network_id\n\t}\n\treturn $favIDs;\n}", "public function isFavorited()\n {\n return $this->getData('isFavorited', false) === true;\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function ListarProductosFavoritos()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.favorito = 'SI' and productos.existencia > '0'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "public function getTrackFavoriters($param = null, $filters = null) {\r\n \t$this->_response = SoundCloud::sendRequest(\"{$this->getUrl()}/favoriters/?client_id={$this->_soundcloud->getClientId()}{$filters}\");\r\n }", "public function favourites(){\n return $this->hasMany('App\\Favourite', 'user_id');\n }", "public function favorite()\n {\n return $this->hasMany('Favorite');\n }", "public function favorite($imageHash)\n {\n $this->setEndpoint(Endpoint::IMAGE_FAVORITE);\n\n $this->setQueryImageHash($imageHash);\n\n return $this->post();\n }", "public function favoured(Model $favourable)\n {\n return $this->favourites()->where(['favourable_id' => $favourable->getKey(), 'favourable_type' => get_class($favourable)])->exists();\n }", "public function getFriends(){\r\n\t\t$fql = 'SELECT uid, name, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = '.$this->getFacebookUid().')';\r\n\t\t$fql_result = $this->runFQL($fql, 'fql_get_friends');\r\n\t\treturn $fql_result;\r\n\t}", "public function getFavorites(Request $request)\n {\n\n $id = Auth::user()->id;\n $favorites = Favorite::select('favorite_user.id', 'favorite_user.user_id as userid', 'favorite_user.merchant_id', 'user_merchant.*')\n ->where('favorite_user.user_id', $id)\n //->leftJoin('users', 'users.id', '=', 'favorite_user.merchant_id')\n ->leftJoin('user_merchant', 'user_merchant.user_id', '=', 'favorite_user.merchant_id')\n ->get();\n if ($favorites->isEmpty()) {\n return response()->json(array(\n 'status' => 201,\n 'favorites' => 'No favorites merchant yet.',\n ));\n } else {\n return response()->json(array(\n 'status' => 200,\n 'favorites' => $favorites,\n ));\n }\n\n }", "function bp_activity_action_favorites_feed() {\n\tif ( ! bp_is_user_activity() || ! bp_is_current_action( 'favorites' ) || ! bp_is_action_variable( 'feed', 0 ) ) {\n\t\treturn false;\n\t}\n\n\t// get displayed user's favorite activity IDs\n\t$favs = bp_activity_get_user_favorites( bp_displayed_user_id() );\n\t$fav_ids = implode( ',', (array) $favs );\n\n\t// setup the feed\n\tbuddypress()->activity->feed = new BP_Activity_Feed( array(\n\t\t'id' => 'favorites',\n\n\t\t/* translators: User activity favorites RSS title - \"[Site Name] | [User Display Name] | Favorites\" */\n\t\t'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),\n\n\t\t'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',\n\t\t'description' => sprintf( __( \"Activity feed of %s's favorites.\", 'buddypress' ), bp_get_displayed_user_fullname() ),\n\t\t'activity_args' => 'include=' . $fav_ids\n\t) );\n}", "function get_favorites($user_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_favorites' => true, //a flag to execute the right code in App-Logic! \n 'user_id' => $user_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($response,true);\n\n }", "public function hasFavourited(Task $task)\n {\n $taskId = $task->id;\n return $this->favouriteTasks->contains(function ($key, $task) use ($taskId) {\n return $task->id == $taskId;\n });\n }", "public function getTrackFavoriter($param = null, $filters = null) {\r\n \t$this->_response = SoundCloud::sendRequest(\"{$this->getUrl()}/favoriters/{$param}?client_id={$this->_soundcloud->getClientId()}{$filters}\");\r\n }", "public function favouritedBy()\n {\n return $this->belongsToMany('App\\User', 'users_favourites_stores')->withTimestamps();\n }", "public function myFavoriteAction()\n {\n $em = $this->getDoctrine()->getManager();\n $favoriteRepo = $em->getRepository('BORAdvertBundle:Favorite');\n $favorites = $favoriteRepo->findByUser($this->getUser());\n $adverts = array();\n\n foreach ($favorites as $favorite) {\n $adverts[] = $favorite->getAdvert();\n }\n\n return array(\n 'entities' => $adverts,\n 'favorites' => $favorites,\n );\n }", "public function userFavorites() {\n return $this->belongsToMany('App\\User');\n }", "function recuperarFavoritos(){\n\t\t$codpincho = new CodigoPincho();\n\t\t$res = $codpincho->recuperarFavoritos();\n\t\treturn $res;\n\t}", "public function favourites($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif(!$user = User::findUser(array('user_id' => $id)))\n\t\t{\n\t\t\t// something has gone wrong with db request\n\t\t\theader(\"Location: /myrecipe/users/\".$id);\n\t\t\texit;\n\t\t}\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t// find all the favourites\n\t\t$data = array('favourites.user_id'=>$id, 'recipe_images.is_cover'=>'yes');\n\t\t$favourites = Favourites::findFavourites($data);\n\t\t$this->template->favourites = $favourites;\n/*\t\techo \"<pre>\";\n\t\tprint_r($favourites);\n\t\techo \"</pre>\";\n*/\n\t\t$this->template->display('favourites.html.php');\n\t}", "protected function _findFavorites($state, $query = array(), $results = array()) {\n if ($state == 'before') {\n if (empty($query['conditions']['username'])) {\n $query['conditions']['username'] = 'default';\n $this->request['auth'] = true;\n }\n $this->request['uri']['path'] = 'feeds/api/users/' . $query['conditions']['username'] . '/favorites';\n $query = $this->_paginationParams($query);\n return $query;\n } else {\n return $results;\n }\n }", "function viewFavorite($name){\n\t\t\t$str_query=\"SELECT * FROM cuisine_favorite WHERE username='$name'\";\n\t\t\treturn $this->query($str_query);\n\t\t}", "public function index()\n {\n return Favourite::all();\n }", "public function getUserFavoritesJoinQuestion($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collUserFavorites === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t\t$this->collUserFavorites = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(UserFavoritePeer::USER_ID, $this->id);\n\n\t\t\t\t$this->collUserFavorites = UserFavoritePeer::doSelectJoinQuestion($criteria, $con, $join_behavior);\n\t\t\t}\n\t\t} else {\n\t\t\t// the following code is to determine if a new query is\n\t\t\t// called for. If the criteria is the same as the last\n\t\t\t// one, just return the collection.\n\n\t\t\t$criteria->add(UserFavoritePeer::USER_ID, $this->id);\n\n\t\t\tif (!isset($this->lastUserFavoriteCriteria) || !$this->lastUserFavoriteCriteria->equals($criteria)) {\n\t\t\t\t$this->collUserFavorites = UserFavoritePeer::doSelectJoinQuestion($criteria, $con, $join_behavior);\n\t\t\t}\n\t\t}\n\t\t$this->lastUserFavoriteCriteria = $criteria;\n\n\t\treturn $this->collUserFavorites;\n\t}", "public function viewFavourite(){\n $user = Auth::user();\n $puestos = DB::table('puesto')\n ->join('favorito', 'puesto.idPuesto', '=', 'favorito.idpuesto')\n ->where('favorito.idUsu',$user->idUsu)->paginate(8);\n return view('home', ['puestos' => $puestos,'cesta' => $user->shoppingBasket()]) ;\n }", "public function findPraiseTopTen(){\n $sql = \"SELECT p.`id`, u.`nickname`, p.`favorite`, p.`pic` FROM `photo` AS p, `user` AS u WHERE p.`uid` = u.`uid` ORDER BY p.`favorite` DESC, p.`created` LIMIT 0, 10\";\n $res = $this->connect()->query($sql);\n $list = $res->fetch_all($resulttype = MYSQLI_ASSOC);\n if($list) {\n return $list;\n }\n return FALSE;\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function favorite()\n {\n return $this->hasMany(Favorite::class, 'product_id', 'id');\n }", "public function index()\n {\n //\n return UserFavorite::get();\n }", "public static function getFriends()\n {\n $friends = Auth::user()->friends;\n foreach ($friends as $friend)\n {\n if($friend->pivot->is_friend == 1)\n {\n $fr[] = $friend;\n }\n }\n if(isset($fr))\n {\n return new \\Illuminate\\Database\\Eloquent\\Collection($fr);\n }\n else\n {\n return new \\Illuminate\\Database\\Eloquent\\Collection();\n }\n }", "function favorites_add ($photo_id) {\n $response = $this->execute(array('method' => 'flickr.favorites.add', 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getIsFavorite()\n {\n if (!$this->isPropertyAvailable(\"IsFavorite\")) {\n return null;\n }\n return $this->getProperty(\"IsFavorite\");\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t\t\n\t\t$user_id = Yii::app()->user->id;\n\t\t\n\t\t\n\t\t$cookie_favorite = Yii::app()->request->cookies['favorite']->value;\n\t\t$cookie_favorite = json_decode($cookie_favorite);\n\t\t\n\t\t$cookie_fav_wrap = array();\n\t\t\n\t\twhile ($fruit_name = current($cookie_favorite)) {\n\t\t if ($fruit_name == 1) {\n\t\t $cookie_fav_wrap[] = key($cookie_favorite);\n\t\t }\n\t\t next($cookie_favorite);\n\t\t}\n\t\t\n\t\tforeach($cookie_fav_wrap as $fav_item) {\n\t\t\t$favorite = Favorited::model()->findByAttributes(array('user_id' => $user_id, 'object_id' => $fav_item));\n\t\t\tif(!$favorite) {\n\t\t\t\t$record = new Favorited;\n\t\t\t\t$record->user_id = $user_id;\n\t\t\t\t$record->object_id = $fav_item;\n\t\t\t\t$record->save();\n\t\t\t}\n\t\t}\n\t\tunset(Yii::app()->request->cookies['favorite']);\n\t\t\t\n\t\t$order_dir = Yii::app()->request->getParam('dir', 'asc');\n\t\tif(!in_array($order_dir, array('desc','asc'))) {\n\t\t\t$order_dir = 'asc';\n\t\t}\n\t\t$order_field = Yii::app()->request->getParam('order', 'rooms');\n\t\tif(!in_array($order_field, array('rooms','square','cost'))) {\n\t\t\t$order_field = 'rooms';\n\t\t}\n\t\t\t\n\t\t$favorites = Favorited::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id));\n\t\t\n\t\t$favarray = array();\n\t\t\n\t\tif($favorites) {\n\t\t\t\n\t\t\t$cookie_fav_wrap = array();\n\t\t\tforeach($favorites as $favorite) {\n\t\t\t\t$favarray[] = $favorite->object_id;\n\t\t\t\t$cookie_fav_wrap[$favorite->object_id] = true;\n\t\t\t}\n\t\t\t$cookie_favorite = json_encode($cookie_fav_wrap);\n\t\t\t\n\t\t\t$cookie = new CHttpCookie('favorite',$cookie_favorite);\n\t\t\t\n\t\t\t$cookie->expire = time() + 2592000;\n\t\t\tYii::app()->request->cookies['favorite'] = $cookie;\n\t\t}\n\t\t\n\t\t\n\t\tforeach($favorites as $fav) {\n\t\t\t$faved = Estate::model()->findByAttributes(array('id'=>$fav->object_id));\n\t\t\tif(!$faved)\t\n\t\t\t\t$fav->delete();\n\t\t}\t\n\n\t\t\t\n\t\t$flats = Estate::model()->findAllByAttributes(array('user_id'=>Yii::app()->user->id),array('order'=>$order_field.' '.$order_dir));\n\t\t\n\t\t$this->render('index',array('flats'=>$flats, 'favarray'=>$favarray,'order_field'=>$order_field,'order_dir'=>$order_dir));\n\t}", "public function favorite($userId=null)\n\t{\n\t\tif(is_null($userId)) {\n\t\t\t$userId = $this->loggedInUserId();\n\t\t}\n\n\t\tif($userId) {\n\t\t\t$favorite = $this->favorites()\n\t\t\t\t->where('user_id', '=', $userId)\n\t\t\t\t->first();\n\n\t\t\tif($favorite) return;\n\n\t\t\t$favorite = new Favorite();\n\t\t\t$favorite->user_id = $userId;\n\t\t\t$this->favorites()->save($favorite);\n\t\t}\n\n\t\t$this->incrementFavoriteCount();\n\t}", "public function favourites()\n {\n return $this->belongsToMany('App\\Recipe')\n ->withTimestamps();\n }", "public function friends()\n\t{\n\t\treturn $this->friendsOfMine()->wherePivot('accepted',true)->get()->merge($this->friendsOf()->wherePivot('accepted',true)->get());\n\t}" ]
[ "0.6755054", "0.66816044", "0.66116256", "0.6575815", "0.6478729", "0.6462401", "0.64249754", "0.6414417", "0.63521975", "0.62955076", "0.62857187", "0.6243544", "0.62431455", "0.6209417", "0.6202553", "0.6200787", "0.6184905", "0.6150616", "0.614637", "0.6143289", "0.6101929", "0.60996795", "0.60781634", "0.6035975", "0.60111016", "0.6006345", "0.59958255", "0.59752804", "0.5965309", "0.59316224", "0.589768", "0.58922774", "0.5870257", "0.58558977", "0.5837783", "0.5820678", "0.57838863", "0.5758642", "0.5690088", "0.56857806", "0.5681129", "0.5664048", "0.5658682", "0.56468415", "0.56370646", "0.5629128", "0.5626235", "0.56253195", "0.5593133", "0.5581646", "0.55518645", "0.55318475", "0.5508418", "0.54910004", "0.5477455", "0.5476425", "0.54754263", "0.5467825", "0.54548806", "0.54470545", "0.5445459", "0.5443641", "0.5429302", "0.54260623", "0.54238284", "0.54197216", "0.5409479", "0.540558", "0.53985286", "0.5396933", "0.5390561", "0.5388103", "0.5379377", "0.5361466", "0.53573394", "0.5346931", "0.5346104", "0.53414404", "0.5311326", "0.5309978", "0.5304069", "0.5297505", "0.5269347", "0.52644867", "0.5215538", "0.52099264", "0.52020377", "0.5192911", "0.5191304", "0.5184612", "0.516373", "0.51597077", "0.51573515", "0.51539654", "0.5150611", "0.51492167", "0.5147978", "0.51473266", "0.51370436", "0.51309216" ]
0.7151414
0
Get information about a photo.
function photos_getInfo ($photo_id, $secret = NULL) { $params = array(); $params['method'] = 'flickr.photos.getInfo'; $params['photo_id'] = $photo_id; if ($secret) $params['secret'] = $secret; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photo']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPhotoInfo($photoId);", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function Photo(){\n\t\t$photoId = \"491634914183411\";\n\t\t$imgInfo \t\t\t= 'https://graph.facebook.com/'.$photoId.'?access_token='.$this->session->userdata('oauth_token');\n\t\techo $imgInfo;\n\t}", "public function getPhotoInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t//Zend_Debug::dump($params); die();\n \n \t$result = \\Extended\\socialise_photo::getPhotoInfo( $params['photo_id'] );\n \t \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "function getPhoto($photo_id, $secret){\n\n\t\t/* Get Photo */\n\t\t$photo = $this->askFlickr('photos.getInfo','&photo_id='.$photo_id.'&secret='.$secret);\n\n\t\t/* Return Photo */\n\t\treturn $photo;\n\t}", "function getPhoto()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$response = $this->mapi->getPhoto($id);\n\n\t\techo json_encode($response);\n\t}", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto($id);", "public function getUserPhoto() {\n $response = $this->_connectAndGrabUserData();\n\n if($response && isset($response['picture']) && $response['picture']) {\n return $response['picture'];\n }\n\n return false;\n }", "public function getPhoto() : string\r\n\t{\r\n\t\treturn $this->photo;\r\n\t}", "public function show(Photo $photo)\n {\n return $photo;\n }", "public function getImageDetails($id)\n {\n \tif(!$this->token)\n \t{\n \t\treturn parent::getImageDetails($id);\n \t}\n \t\n static $method = 'flickr.photos.getSizes';\n\n if (empty($id)) {\n /**\n * @see Zend_Service_Exception\n */\n require_once 'Zend/Service/Exception.php';\n throw new Zend_Service_Exception('You must supply a photo ID');\n }\n $options = array(\n \t'api_key' => $this->apiKey,\n \t'auth_token' => $this->token, \n \t'method' => $method, \n \t'photo_id' => $id\n );\n $options = $this->signOptions($this->secret, $options);\n\n $restClient = $this->getRestClient();\n $restClient->getHttpClient()->resetParameters();\n $response = $restClient->restGet('/services/rest/', $options);\n\n $dom = new DOMDocument();\n $dom->loadXML($response->getBody());\n $xpath = new DOMXPath($dom);\n self::_checkErrors($dom);\n $retval = array();\n /**\n * @see Zend_Service_Flickr_Image\n */\n require_once 'Zend/Service/Flickr/Image.php';\n foreach ($xpath->query('//size') as $size) {\n $label = (string) $size->getAttribute('label');\n $retval[$label] = new Zend_Service_Flickr_Image($size);\n }\n\n return $retval;\n }", "public function photo()\n {\n \treturn $this->article->photos->first();\n }", "public function getProfilePicture();", "public function getPhotos();", "public function getProfPic() {\n $response = $this->getRequest(\"me\");\n $response = json_decode($response->getBody()->getContents());\n \n if (count($response->{\"images\"}) == 0) {\n return null;\n } else {\n return $response->{\"images\"}[0]->{\"url\"};\n }\n }", "function showPhoto($sid)\n {\n $result = $this->getPhoto($sid);\n return $result;\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function getPhoto($photo_uid) {\r\n\t\t$photo = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE uid = \"'.intval($photo_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $photo[0];\r\n\t}", "public function show(Photo $photo)\n {\n //\n }", "public function show(Photo $photo)\n {\n //\n }", "public function show(Photo $photo)\n {\n //\n }", "public function getPhotoFile()\n {\n return $this->photoFile;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPicture()\n {\n return $this->picture;\n }", "public function getPhotoFile()\n\t{\n\t\treturn $this->photo_file;\n\t}", "function photos_getExif ($photo_id, $secret = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getExif';\n\t\t$params['photo_id'] = $photo_id;\n\t\tif ($secret) $params['secret'] = $secret;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getImage()\n {\n return $this->get('image');\n }", "public function getPicture() {\n return $this->picture;\n }", "public function getPhoto($iPhoto) {\n \t$aPhoto = Phpfox::getService('photo')->getPhoto($iPhoto);\n\t\t$aPhoto = Phpfox::getService('accountapi.photo')->processPhoto($aPhoto);\n\t\t\n\t\treturn $aPhoto;\n }", "function getPhotoDetail($photo_id=null){\r\n\t\tif($photo_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('id'=>$photo_id));\r\n\t\t$recordSet = $this->db->get(TBL_ALBUM_HAS_PHOTOS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "function getPhotoSetInfo($photoset_id){\n\n\t\t/* Get Photoset Name and Description */\n\t\t$photoset_info = $this->askFlickr('photosets.getInfo','&photoset_id='.$photoset_id);\n\n\t\t/* Return Photo Info Object */\n\t\treturn $photoset_info;\n\t}", "function getSpecificPhoto($id) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n return $flickr->photos_getSizes($id);\r\n }", "function getPicture(){\r\n return $this->picture;\r\n }", "public function getPhoto($id){\n $sql=\"SELECT from_url FROM people WHERE id_people=?\";\n $rs=$this->con->prepare($sql);\n $rs->execute(array($id));\n return $rs->fetch(PDO::FETCH_OBJ);\n }", "public function getAllPhotos();", "public function getPhoto() {\n return DATADIR . 'alumni/' . $this->shortName . '.jpg';\n }", "public function getPhoto(){\r\n\t\tif($this->photo == null){\r\n\t\t\t$googlePlaceData = $this->getGooglePlaceData();\r\n\r\n\t\t\tif($googlePlaceData != null){\r\n\t\t\t\tif(isset($googlePlaceData[\"result\"])){\r\n\t\t\t\t\t$result = $googlePlaceData[\"result\"];\r\n\r\n\t\t\t\t\tif(isset($result[\"photos\"]) && is_array($result[\"photos\"]) && count($result[\"photos\"]) > 0){\r\n\t\t\t\t\t\t$this->photo = $result[\"photos\"][0][\"photo_reference\"];\r\n\r\n\t\t\t\t\t\t$mysqli = \\Database::Instance()->get();\r\n\t\t\t\t\t\t$stmt = $mysqli->prepare(\"UPDATE `hotspots` SET `photo` = ? WHERE `id` = ?\");\r\n\t\t\t\t\t\t$stmt->bind_param(\"si\",$this->photo,$this->id);\r\n\t\t\t\t\t\t$stmt->execute();\r\n\t\t\t\t\t\t$stmt->close();\r\n\r\n\t\t\t\t\t\t$this->saveToCache();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $this->photo;\r\n\t}", "public function getPicture()\n\t{\n\t\treturn $this->picture;\n\t}", "public function getPhotoId()\n {\n return $this->photoId;\n }", "public function getPhotoUrl()\n\t{\n\t\treturn $this->photo_url;\n\t}", "public function getProfilePicture()\n\t{\n\t\treturn $this->info['profile_picture'];\n\t}", "public function getPhoto() : string {\n $hash = crc32($this->name);\n $filename = self::PHOTO_DIRECTORY . $hash . '.png';\n\n if (file_exists($filename))\n return '/images/photos/' . $hash . '.png';\n\n return '/images/no-photo.png';\n }", "public function show(){\n\t\t // Default size is preview\n if(!empty($_GET['size'])) $size = $_GET['size'];\n else $size = 'preview';\n\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n if($pobj !== false && !$pobj->temporary && $pobj->data->status == 'saved') $pobj->show($size);\n else $this->zajlib->reroute('__error', ['system_api_photo_show', []]);\n\t\t}", "public function get_picture(){ return $this->_picture;}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function show($photo_id)\n {\n $photo = $this->photoService->getPhotoByPhotoId($photo_id);\n // $tags = $this->tagService->getTagsByPhotoId($photo_id);\n $history = $this->voteCounterService->getWinRatioByPhotoId($photo_id);\n\n return response()\n ->json([\n 'photo' => $photo,\n // 'tags' => $tags,\n 'history' => $history\n ]);\n }", "public function index()\n {\n return Photo::get();\n }", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function getImageDetails() {\n\t\t$details = getimagesize($this->file);\n\n\t\tif(!$details) throw new Exception('Falha na busca dos parametros da imagem!');\n\n\t\tlist($width, $height, $type, $attr, $mime) = $details;\n\t\t$aspect = ($width > $height)?'landscape':'portrait';\n\t\t$ration = $width / $height;\n\n\t\treturn array('width' => $width,'height' => $height,'aspect' => $aspect,'ratio' => $ratio,'mime' => $mime,'type' => $type);\n\t}", "public function Information()\n {\n $this->imgInfo = list($width, $height, $type, $attr) = getimagesize($this->pathToImage);\n !empty($this->imgInfo) or self::errorMessage(\"The file doesn't seem to be an image.\");\n $mime = $this->imgInfo['mime'];\n\n if($this->verbose) {\n $this->imgInfo['filesize'] = $filesize = filesize($this->pathToImage);\n self::verbose(\"Image file: {$this->pathToImage}\");\n self::verbose(\"Image information: \" . print_r($this->imgInfo, true));\n self::verbose(\"Image width x height (type): {$width} x {$height} ({$type}).\");\n self::verbose(\"Image file size: {$filesize} bytes.\");\n self::verbose(\"Image mime type: {$mime}.\");\n }\n }", "public function getPhoto():?string\n {\n return $this->photo;\n }", "public function get_photo($photo)\n {\n\n $profile_dir = \"student_avatar\";\n $photo_file = $profile_dir . \"/\" . $photo;\n\n // check if the file is existing.\n $exists = Storage::disk('ftp')->exists($photo_file);\n\n if ($exists) {\n $file = Storage::disk('ftp')->get($photo_file);\n\n $fileName = $photo_file;\n return Response::make($file, '200', array(\n 'Content-Type' => 'application/octet-stream',\n 'Content-Disposition' => 'attachment; filename=\"' . $fileName . '\"'\n ));\n } else {\n $res['res'] = \"not_found\";\n print json_encode($res, JSON_FORCE_OBJECT);\n }\n }", "public function info($imageHash)\n {\n $this->setEndpoint(Endpoint::IMAGE);\n\n $this->setQueryImageHash($imageHash);\n\n return $this->get();\n }", "public function getPhoto() {\n if(isset($this->photo) && !empty($this->photo)) {\n return Yii::getAlias('@web'). '/' . $this->photo;\n }\n return Yii::$app->params['defaultProfileImage'];\n }", "public function getFoto()\r\n {\r\n return $this->Foto;\r\n }", "public function getFoto()\n {\n return $this->foto;\n }", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function getPhoto($id)\n {\n $res = $this->db->select(\"SELECT * FROM `{$this->domainPhoto}` WHERE itemName()='{$id}'\", array('ConsistentRead' => 'true'));\n $this->logErrors($res);\n if(isset($res->body->SelectResult->Item))\n return self::normalizePhoto($res->body->SelectResult->Item);\n else\n return false;\n }", "function getImagePathInfo() \n { \n return $this->_imagePathInfo; \n }", "public function getFoto()\n {\n return $this->foto;\n }", "private function retrieveImageInfo() {\n $prepare = $this->database->prepare(\"\n SELECT image_height, image_width\n FROM manuscripts\n WHERE collection = :collection\n AND pointer = :pointer\n LIMIT 1\n \");\n\n $prepare->execute(array(\n \":collection\" => $this->collection,\n \":pointer\" => $this->pointer\n ));\n\n return $prepare->fetch(PDO::FETCH_ASSOC);\n }", "public function getUserInfo() {\n\t\t$userInfo = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => USERINFO,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'user_id' => $this->photo['owner'],\n\t\t\t));\n\t\treturn unserialize($userInfo->body);\n\t}", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage() {\n return $this->image;\n }", "public function getImage()\r\n {\r\n return $this->image;\r\n }", "public function getImage()\r\n {\r\n return $this->image;\r\n }", "function getRecentPhoto()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentPhoto($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "function photosets_getInfo ($photoset_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.getInfo', 'photoset_id' => $photoset_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}" ]
[ "0.7963512", "0.7741481", "0.71406984", "0.7124891", "0.6989152", "0.6989152", "0.6989152", "0.6989152", "0.6989152", "0.698337", "0.69237787", "0.68913174", "0.6807306", "0.67047566", "0.6602409", "0.65635943", "0.65406656", "0.65176606", "0.64829487", "0.64120674", "0.6411043", "0.6409468", "0.6408532", "0.63568586", "0.6344688", "0.6344688", "0.6344688", "0.6331051", "0.6310757", "0.6310757", "0.63022965", "0.6302277", "0.6275217", "0.6270206", "0.62354773", "0.6228356", "0.6224487", "0.62153286", "0.6205312", "0.61874247", "0.61855114", "0.6169264", "0.6162716", "0.615865", "0.61580056", "0.61434555", "0.6141748", "0.6127409", "0.612681", "0.61240554", "0.6104396", "0.609678", "0.6088914", "0.60822666", "0.6071717", "0.6061956", "0.60549", "0.6046951", "0.60343766", "0.6026407", "0.60205686", "0.6010808", "0.5974614", "0.5967132", "0.5964621", "0.5952137", "0.5942257", "0.59161234", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59155136", "0.59147185", "0.59084433", "0.59084433", "0.590442", "0.5896394" ]
0.7335301
2
Returns a list of your photos that are not part of any sets.
function photos_getNotInSet ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = 'all', $extras = NULL) { $params = array(); $params['method'] = 'flickr.photos.getNotInSet'; $params['per_page'] = $per_page; $params['page'] = $page; if ($min_upload_date) $params['min_upload_date'] = $min_upload_date; if ($max_upload_date) $params['max_upload_date'] = $max_upload_date; if ($min_taken_date) $params['min_taken_date'] = $min_taken_date; if ($max_taken_date) $params['max_taken_date'] = $max_taken_date; if ($privacy_filter) $params['privacy_filter'] = $privacy_filter; if ($media) $params['media'] = $media; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllWithoutFolders()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table)\n ->where('folder_id', '=', 0);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "function get_products_to_show()\n{\n $products = get_products();\n\n foreach ($products as $list_id => $product) {\n if (count($product['images']) == 0) {\n unset($products[$list_id]);\n }\n }\n\n return $products;\n}", "public static function get_unused_images(){\n\n $books = Media::get_unused_images_for_table(CONFIG::DBTables()->book);\n $movies = Media::get_unused_images_for_table(CONFIG::DBTables()->movie);\n $games = Media::get_unused_images_for_table(CONFIG::DBTables()->game);\n $users = Media::get_unused_images_for_table(CONFIG::DBTables()->user);\n\n $images = array(\n \"books\" => $books,\n \"movies\" => $movies,\n \"games\" => $games,\n \"users\" => $users\n );\n\n return $images;\n }", "public function getVotosNegativos()\n {\n return $this->getVotos()->where(['positivo' => false]);\n }", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "function get_list_of_non_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 0 ORDER BY date DESC');\n return $result;\n }", "public function filterNotNull(): Set;", "public function getIgnoreItems(): array;", "public function getExcludedIds();", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public static function FindUnusedImages()\n {\n }", "function get_all_unmarked() {\n\n global $CFG;\n\n $sql = \"SELECT s.id as subid, s.userid, s.data2, a.course, a.assignmenttype, a.name, a.description, a.id, c.id as cmid\n FROM {$CFG->prefix}assignment a\n INNER JOIN {$CFG->prefix}course_modules c\n ON a.id = c.instance\n INNER JOIN {$CFG->prefix}assignment_submissions s\n ON s.assignment = a.id\n WHERE c.module = {$this->mainobject->modulesettings['assignment']->id}\n AND c.visible = 1\n AND a.course IN ({$this->mainobject->course_ids})\n AND s.timemarked < s.timemodified\n AND NOT (a.resubmit = 0 AND s.timemarked > 0)\n ORDER BY a.id\";\n\n $unmarked = get_records_sql($sql);\n\n // Due to oracle being rubbish, there is no way to put this bit into sql as the data2 field is\n // a CLOB and so cannot be used with any kind of comparison operator.\n // It used to be:\n // AND NOT (a.assignmenttype = 'upload' AND s.data2 != 'submitted'))\n \n\n foreach ($unmarked as $key => $submission) {\n\n if (($submission->data2 != 'submitted') && ($submission->assignmenttype == 'upload')) {\n unset($unmarked[$key]);\n }\n }\n \n\n $this->all_submissions = $unmarked;\n\n return true;\n }", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public static function delete_unused_images(){\n\n $deleted_books = Media::delete_unused_images_for_table(CONFIG::DBTables()->book);\n $deleted_movies = Media::delete_unused_images_for_table(CONFIG::DBTables()->movie);\n $deleted_games = Media::delete_unused_images_for_table(CONFIG::DBTables()->game);\n $deleted_users = Media::delete_unused_images_for_table(CONFIG::DBTables()->user);\n\n $deleted_images = array(\n \"books\" => $deleted_books,\n \"movies\" => $deleted_movies,\n \"games\" => $deleted_games,\n \"users\" => $deleted_users\n );\n\n return $deleted_images;\n }", "function get_list_of_not_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 0 AND flaggedfile = 0 ORDER BY date DESC');\n return $result;\n }", "public function get_skipped_posttypes() {\n\n $skipped_posttypes = array( 'attachment', 'revision', 'nav_menu_item', 'soliloquy', 'soliloquyv2', 'envira_album' );\n return apply_filters( 'envira_gallery_skipped_posttypes', $skipped_posttypes );\n\n }", "public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}", "public function except(...$post_ids): Collection;", "public function delete_unknown_images() {\n global $wpdb;\n $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image` WHERE gallery_id=0');\n }", "public function get_noPublishedRecipes() {\n\n $query = $this->db\n ->from('recipes')\n ->where('published', 0)\n ->order_by('created_at', 'DESC')\n ->get();\n\n return $result = $query->result();\n }", "private function get_unattached_ids() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col(\"SELECT `ID` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' AND `post_parent` = '0'\");\n\t}", "public function getPartialMatchingImages()\n {\n return $this->partial_matching_images;\n }", "private function filterNotItems(array $output): array\n {\n foreach ($this->not as $exclude) {\n $translator = new PathTranslator($output);\n $paths = $translator->path($exclude);\n\n if (0 === $paths->count()) {\n continue;\n }\n\n foreach ($paths as $keys) {\n if (null !== $keys) {\n $this->removeFromArray($output, $keys->getPath());\n }\n }\n }\n\n return $output;\n }", "public function allWithoutTree()\n {\n return HandbookCategory::all();\n }", "private static function get_unused_images_for_table($table)\n {\n $images = array();\n\n /* Get media images in database */\n $media_images = Media::get_media_images($table);\n\n /* Get media images currently stored */\n if ($table === Config::DBTables()->user){\n $path = FileService::MAIN_DIR . \"/users\";\n $files = array_diff(scandir($path), array('.', '..'));\n $images = Media::add_unused_images_to_array($images, $media_images, $files, $path);\n }else{\n $users = array_diff(scandir(FileService::MAIN_DIR), array('.', '..'));\n foreach($users as $username){\n if ($username !== \"users\"){\n $user_path = FileService::MAIN_DIR . \"/\" . $username . \"/\" . $table . \"s\";\n $files = array_diff(scandir($user_path), array('.', '..'));\n $images = Media::add_unused_images_to_array($images, $media_images, $files, $user_path);\n }\n }\n }\n return $images;\n }", "function fumseck_exclude_image_posts( $query ) {\n\tif ( $query->is_main_query() && $query->is_home() ) {\n\t\t$feip_query = array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'post_format',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => array(\n\t\t\t\t\t'post-format-image'\n\t\t\t\t),\n\t\t\t\t'operator' => 'NOT IN',\n\t\t\t)\n\t\t);\n\t\t$query->set( 'tax_query', $feip_query );\n\t}\n}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function excludedVoters()\n {\n return $this->voters()->where('is_excluded', true);\n }", "public static function getNotSubscribedProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'not-subscribed');\n\n\t}", "public function get_blacklisted_ids() {\n\n\t\t$excluded_meta_ids = WPSOLR_Metabox::get_blacklisted_ids();\n\t\t$excluded_list_ids = WPSOLR_Service_Container::getOption()->get_option_index_post_excludes_ids();\n\n\t\t$all_excluded_ids = array_merge( $excluded_meta_ids, $excluded_list_ids );\n\n\t\treturn $all_excluded_ids;\n\t}", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "function subway_get_excluded_page_id_collection() {\n\n\t$subway_public_post = get_option( 'subway_public_post' );\n\n\t$excluded_pages_collection = array();\n\n\tif ( ! empty( $subway_public_post ) ) {\n\n\t\t$excluded_pages_collection = explode( ',', $subway_public_post );\n\n\t}\n\n\t// Should filter it by integer, spaces will be ignored, other strings.\n\t// Will be converted to zero '0'.\n\treturn array_filter( array_map( 'intval', $excluded_pages_collection ) );\n\n}", "public function clearExcludes()\r\n {\r\n foreach ($this->facetQueries as $facetQuery) {\r\n $facetQuery->clearExcludes();\r\n }\r\n\r\n return parent::clearExcludes();\r\n }", "private function loadUnMatchedCollection()\n {\n $this->unMatchedCollection = collect();\n\n foreach ($this->mergeCollection as $key => $item)\n {\n\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n if(!$this->baseCollection->whereIn($basePivot,$item->$mergePivot)->first())\n {\n $this->unMatchedCollection->push($item);\n continue 2;\n }\n }\n\n\n }\n\n }", "function ibio_dps_exclude_displayed_posts( $args ) {\n global $_genesis_displayed_ids;\n $args['post__not_in'] = !empty( $args['post__not_in'] ) ? array_merge( $args['post__not_in'], $_genesis_displayed_ids ) : $_genesis_displayed_ids;\n return $args;\n}", "public function getExclude() {\n \treturn array_keys($this->exclude);\n }", "public function getMissingRecords()\n {\n $missing = [];\n\n foreach ($this->records as $record) {\n $repo = $this->storage->getRepository($record->getContentType());\n $fields = $record->getRequiredFieldsArray();\n\n if (count($fields)) {\n $results = $repo->findBy($fields);\n if (!$results) {\n $missing[] = $record;\n }\n }\n }\n\n return $missing;\n }", "public function getOfficeImages()\n {\n $officeImages = OfficeImage::select('image')->inRandomOrder()->take(5)->get();\n if($officeImages->count()) {\n return $officeImages;\n }\n\n return false;\n }", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function getExcludes()\n {\n // code...\n return $this->__EXCLUDES__ ?? [];\n }", "protected function getUnmatchedRemoteObjects()\n {\n $query = $this->getRemoteObjectsQuery();\n $table = $this->getRemoteBaseTable();\n $query->addWhere(\"\\\"{$table}\\\".\\\"_ImportedID\\\" = 0\");\n $items = iterator_to_array($this->task->query($query));\n return new ArrayList($items);\n }", "public function notMyFriends()\n\t{\n\t\treturn $this->friendsOfMine()->wherePivot('accepted',false)->get()->merge($this->friendsOf()->wherePivot('accepted',false)->get());\n\t\t\n\t}", "public function tags_excluding($excluded_tags = false)\n {\n\n if (!is_array($excluded_tags)) {\n $tags = [$excluded_tags];\n } else {\n $tags = $excluded_tags;\n }\n\n return $this->tags->where('tag', 'NOT IN', $tags)->find_all();\n\n }", "public function prune($photos = null)\n {\n if ($photos) {\n $this->addUsingAlias(PhotosPeer::ID, $photos->getId(), Criteria::NOT_EQUAL);\n }\n\n return $this;\n }", "public function getUnsquaredBlocks(){\n $unsquaredBlocks = array();\n foreach ($this->blocks as $block){\n if ($block->isNotSquared()){\n array_push($unsquaredBlocks, $block);\n }\n }\n return $unsquaredBlocks;\n }", "public function delete_all_photos() {\r\n return Foto::where('albums_id', '=', $this->id)->delete();\r\n }", "private function removeAllImages($exclusionList = NULL, $dryRun=false) {\n\t\t$count = 0;\n\t\tforeach ($this->imageRepository->findAll() as $image) {\n\t\t\tif (!isset($exclusionList[$image->getIdentifier()])) {\n\t\t\t\tif (!$dryRun) $this->persistenceManager->remove($image);\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\treturn $count;\n\t}", "public function getExcludeListArray() {}", "public function findNotSentToCalendar()\n {\n $sql = <<<SQL\n SELECT s.*, p.title as program_name \n FROM ec_shows s, ec_programs p\n WHERE sent_to_calendar like ''\n AND s.program_id = p.id\nSQL;\n $sqlQuery = new SqlQuery($sql);\n return $this->getList($sqlQuery);\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function getVariantListExceptCurrent()\n {\n $oList = $this->getVariantList();\n if (is_object($oList)) {\n $oList = clone $oList;\n }\n\n $sOxId = $this->getProduct()->getId();\n if (isset($oList[$sOxId])) {\n unset($oList[$sOxId]);\n }\n\n return $oList;\n }", "static function generate_ignore_list(array $meta)\n {\n $ignore = [];\n\n // Big License\n $ignore[] = 'doc/';\n $ignore[] = 'tests/';\n $ignore[] = 'releases~/';\n\n if (isset($meta['pack']))\n {\n if (isset($meta['pack']['ignore']) && is_array($meta['pack']['ignore']))\n {\n $ignore = array_merge($ignore, $meta['pack']['ignore']);\n }\n }\n\n return $ignore;\n }", "public function getAllPossibleMorphologys()\n {\n $sb = $this->skeletalbone()->first();\n $sb_morphologys = $sb->morphologys;\n $morphologys_list = null;\n if ($sb_morphologys->count()) {\n $query = SkeletalElement::whereIn(\"sb_id\", $sb_morphologys->pluck('id'))\n ->where(\"side\", \"!=\", $this->getOppositeSide()) // not opposite side\n ->where(\"id\", \"!=\", $this->id); // not the same se (for bones that can morphology to themselves such as unseriated cervical vertebra)\n $morphologys_list = $query->latest()->get();\n }\n return $morphologys_list;\n }", "function cp_exclude_cats ($id = NULL) {\r\n global $wpdb;\r\n\r\n $output = array();\r\n\r\n if ( $id )\r\n $sql = $wpdb->prepare( \"SELECT form_cats FROM \". $wpdb->prefix .\"cp_ad_forms WHERE id != %s\", $id );\r\n else\r\n $sql = $wpdb->prepare( \"SELECT form_cats FROM \". $wpdb->prefix .\"cp_ad_forms\" );\r\n\r\n $records = $wpdb->get_results( $sql );\r\n\r\n if ( $records ) :\r\n\r\n foreach ( $records as $record )\r\n $output[] = implode( ',',unserialize($record->form_cats) );\r\n\r\n endif;\r\n\r\n $exclude = cp_unique_str( ',', (join( ',', $output )) );\r\n\r\n return $exclude;\r\n}", "function getMissing() {\n\t\t$articleDao =& \\DAORegistry::getDAO('ArticleDAO');\n\t\t$sql = \"SELECT * FROM articles WHERE pages like '%#DFM'\";\n\t\t$blub = $articleDao->retrieve($sql);\n\t\t$result = new \\DAOResultFactory($blub, $this, '_dummy');\n\t\t$result = $result->toArray();\n\t\tforeach ($result as $record) {\n\t\t\t$this->getArticleGalleys($record['article_id']);\n\t\t}\n\t}", "public function findAllRetainedIds()\n\t{\n\t\t$qb = $this->createQueryBuilder('s');\n\n\t\t$qb->select('s.id')\n\t\t ->where('s.level NOT LIKE :syn')\n\t\t ->setParameter('syn', '%syn%')\n ->orderBy('s.id', 'ASC')\n\t\t;\n\n\t\treturn $qb->getQuery()->getResult();\n\t}", "function hmg_get_gallery_ids( $post_id = null ) {\n\n\tif( null == $post_id ) \n\t\t$post_id = get_the_id(); \n\t\t\n\treturn array_filter( (array) get_post_meta( $post_id, '_hmg_gallery_images', true ) );\n\t\n}", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function removed() {\n return array_diff($this->in, $this->out);\n }", "function get_all_but_not_this_user($usr)\n{\n $user=$usr->__get('uid');\n $con = connect();\n\t$q1=mysqli_query($con,\"SELECT * FROM user WHERE UId != '$user'\");\n\treturn $q1;\n}", "function getNotPlantaUsuarios()\r\n\t{\r\n\t\treturn $this->Usuario->find('all',array('conditions' => array('Usuario.planta' => 0)));\r\n\t}", "private function loadMatchUnMatchedCollection()\n {\n foreach ($this->mergeCollection as $key => $item) {\n $search = $this->baseCollection;\n foreach ($this->pivots as $basePivot => $mergePivot) {\n $search = $search->whereIn($basePivot, $item->$mergePivot);\n }\n\n $found = $search->first();\n\n if (!$found) {\n $this->report->unmatched()->push($item);\n } else {\n $this->report->matched()->push($found);\n }\n\n }\n }", "protected function getUnmatchedLocalObjects()\n {\n return $this\n ->getLocalObjects()\n ->filter('LegacyID', 0);\n }", "private static function toDelete(){\n $filesNotToDelete = [];\n $dir = public_path().'/images/';\n $filesInPublicFolder = scandir($dir);\n\n // izbacivanje assets foldera, .. i .\n $ignoreFiles = ['assets', '.', '..', 'pig.png', 'placeholder.png', 'logo.png', 'index.php'];\n foreach ($ignoreFiles as $toIgnore) {\n if (($key = array_search($toIgnore, $filesInPublicFolder)) !== false) {\n unset($filesInPublicFolder[$key]);\n }\n }\n // dd($filesInPublicFolder);\n $images = [];\n $collectionsOfObjectsWithImages = [Product::all(), ProductGroup::all(), Manufacturer::all(),\n Suggestion::all(), ImageSuggestion::all(), MainAd::all(),SecondAd::all()];\n\n foreach ($collectionsOfObjectsWithImages as $collection) {\n foreach ($collection as $object) {\n if($object->images->count()){\n foreach ($object->images as $image) {\n $images[] = $image->name;\n }\n }\n }\n }\n\n // dd($images);\n // dd(array_diff($filesInPublicFolder, $images));\n // dd($filesNotToDelete, $filesInPublicFolder);\n return $toDelete = array_diff($filesInPublicFolder, $images); //za fju array_dif vazan je redoslijed argumenata\n\n }", "public function testWithAllNonExistentTags(): void\n {\n /** @var Collection $models */\n $models = TestModel::withAllTags('Apple,Kumquat')->get();\n\n self::assertEmpty($models);\n }", "public function getNovelties( ) {\n\t $novelties = Product::where('ebook', 0)\n\t ->orderBy('created_at', 'desc')\n\t ->take(6)\n\t ->with('image')\n\t ->with('author')\n\t ->where( 'amount', '>', 0 )\n\t ->get();\n\t return $novelties;\n }", "function getSubsets($arr) {\n if (empty($arr)) {\n return [];\n }\n $result = [];\n for ($i=0; $i < sizeof($arr); $i++) { \n \n $subArr = array_slice($arr, $i);\n if (!in_array($subArr, $result)) {\n $result[] = $subArr;\n }\n \n }\n return $result;\n}", "public static function exclusive()\n {\n // Change setting\n self::$settings['exclude'] = true;\n\n // Return exclusion list\n return self::$exclude;\n }", "public function getAllExcept($id);", "public function returnInvalid(): array\n {\n $permutations = [];\n foreach ($this->buildPermutations() as $perm) {\n $object = $this->buildFromData($perm);\n\n // If any condition fails, add\n if (!$this->allConditionsSucceed($object) && !in_array($object, $permutations)) {\n $permutations[] = $object;\n }\n }\n\n return $permutations;\n }", "public function getNonVotingUsersForEvent($eventId)\n\t{\n\t\t$rows = $this->getTable()->getNonVotingUsersForEvent($eventId);\n\n\t\treturn $this->_getSet($rows);\n\t}", "public function getNotMappedToRDFaDeliverySets()\n {\n $oDelSets = oxNew(\"oxDeliverySetList\");\n $oDelSets->loadNonRDFaDeliverySetList();\n\n return $oDelSets;\n }", "public function get_all_exclude_id(){\n $data = get_object_vars($this);\n unset($data[\"id\"]);\n return $data;\n }", "function getUnansweredQuestions($grouping='', $sorting='sorting', $randomize=false) {\n\t\t$questions = $this->getQuestions();\n\t\t$unanswered = array();\n\t\t\n\t\tforeach((array) $questions as $question) {\n\t\t\tif(!$question->hasAnswer($this->_answers)) {\n\t\t\t\t$unanswered[] = $question;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $unanswered;\n\t}", "public function getFullMatchingImages()\n {\n return $this->full_matching_images;\n }", "public function testWithoutAllTagsIncludingUntagged(): void\n {\n /** @var Collection $models */\n $models = TestModel::withoutAllTags('Apple,Banana', true)->get();\n $keys = $models->modelKeys();\n\n self::assertArrayValuesAreEqual(\n [\n $this->testModel1->getKey(),\n $this->testModel2->getKey(),\n $this->testModel5->getKey(),\n $this->testModel6->getKey(),\n $this->testModel7->getKey(),\n ],\n $keys\n );\n }", "public function deleteUnusedImages()\n {\n $names = app(ExportHelpCenterImages::class)->execute();\n\n $files = Storage::disk('public')->files('article-images');\n $toDelete = array_diff($files, $names->toArray());\n\n return Storage::disk('public')->delete($toDelete);\n }", "public function notIn(array $values);", "public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}", "public static function getWhereSkipIdPhotos($page = 100)\n {\n $skip_id_photos = '';\n if (Config::$domainEnd != 'ru' && Config::$domainEnd != 'by' && $page <= 10) {\n $skip_id_photos = ' AND PH.id_photo NOT IN (';\n foreach (Consta::$skip_id_photos_arr as $v)\n $skip_id_photos .= $v . ', ';\n $skip_id_photos = substr($skip_id_photos, 0, -2) . ')';\n }\n return $skip_id_photos;\n }", "public function testGetUserPhotosEmpty()\n {\n $user = factory(\\App\\User::class)->make();\n\n $response = $this->get('/photos');\n\n $response->assertStatus(200);\n }", "public function wpcd_exclude_app_group_taxonomy_ids() {\n\t\tglobal $wpcd_exclude_app_group; // This global is defined in our CONSTRUCTOR function at the top of this file.\n\n\t\tif ( 'wpcd_app' === get_post_type() ) {\n\t\t\t// This function defined in the metaboxes_for_taxonomies_for_servers_and_apps file.\n\t\t\t$wpcd_exclude_app_group = $this->wpcd_common_code_server_app_group_metabox( 'wpcd_app_group' );\n\t\t}\n\t}", "public function getExcludeTypes()\n {\n return $this->exclude_types;\n }", "public function getAllWhereKeysNotIn(array $keys): CollectionInterface;", "protected function getImageCandidates()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->imgElements as $imgElement)\n\t\t{\n\t\t\t$imageDimensions = $this->getImageDimensions($imgElement);\n\t\t\tif($imageDimensions['width'] >= self::MIN_IMAGE_WIDTH && $imageDimensions['height'] >= self::MIN_IMAGE_HEIGHT)\n\t\t\t{\n\t\t\t\t$result[] = $imgElement['src'];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "static function reject($collection, $function)\n {\n $result = array();\n foreach($collection as $item) {\n if(!$function($item)) {\n $result[] = $item;\n }\n }\n return Ruby::wrap($result);\n }", "public function nonVisible()\n {\n $visible = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && !$page->visible()) {\n $visible[$path] = $slug;\n }\n }\n $this->items = $visible;\n\n return $this;\n }", "public function getMustNotList() {\n return $this->_get(2);\n }", "public function notIn( array $array )\n {\n if ( empty( $array ) ) {\n return $this;\n }\n \n return $this->not()->in( $array );\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}", "public function getPhotos();", "public function materiasHabilitadas(){\n\t\t$connection = Connection::getInstance();\n\t\t$result \t= $connection->query(\"SELECT distinct materias.id \n\t\t\t\t\t\t\t\t\t\t FROM materias, grupos \n\t\t\t\t\t\t\t\t\t\t WHERE grupos.materia_id = materias.id AND \n\t\t\t\t\t\t\t\t\t\t materias.id NOT IN \n\t\t\t\t\t\t\t\t\t\t (SELECT grupos.materia_id \n\t\t\t\t\t\t\t\t\t\t FROM usuarios, inscripciones, grupos \n\t\t\t\t\t\t\t\t\t\t WHERE tipo_usuario = \".Usuario::ESTUDIANTE.\" AND \n\t\t\t\t\t\t\t\t\t\t usuarios.id = $this->id AND \n\t\t\t\t\t\t\t\t\t\t usuarios.id = inscripciones.usuario_id AND \n\t\t\t\t\t\t\t\t\t\t grupos.id = inscripciones.grupo_id)\");\n\t\t$res \t\t= array();\n\t\t\n\t\twhile ($id = pg_fetch_array($result)[0]){\n\t\t\t$res[] = new Materia($id);\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "public function getUnsetFields(): array\n {\n return ['discussion_id', 'images'];\n }", "public function findAllIterator()\n {\n /** @var \\Doctrine\\ORM\\QueryBuilder $queryBuilder */\n $queryBuilder = $this->entityManager->createQueryBuilder();\n return $queryBuilder\n ->select('a')\n ->from($this->getEntityClassName(), 'a')\n ->where('a NOT INSTANCE OF Neos\\Media\\Domain\\Model\\ImageVariant')\n ->getQuery()->iterate();\n }", "public function tag_excluding($excluded_tags = false)\n {\n\n if (!is_array($excluded_tags)) {\n $tags = [$excluded_tags];\n } else {\n $tags = $excluded_tags;\n }\n\n return $this->tags->where('tag', 'NOT IN', $tags)->find();\n\n }", "public function testIsNotTagged(): void\n {\n /** @var Collection $models */\n $models = TestModel::isNotTagged()->get();\n $keys = $models->modelKeys();\n\n self::assertArrayValuesAreEqual(\n [\n $this->testModel1->getKey(),\n ],\n $keys\n );\n }", "public function getAllUnidadNegocio()\r\n {\r\n $sql = \"SELECT id_unidad_negocio, nombre, url_logo, url_imagen, descripcion FROM tbl_unidad_negocio\";\r\n $query = $this->db->prepare($sql);\r\n\r\n $query->execute();\r\n\r\n return $query->fetchAll();\r\n }" ]
[ "0.65620744", "0.62283874", "0.6024571", "0.5930459", "0.58665824", "0.57660234", "0.57490873", "0.5699103", "0.56990856", "0.5698543", "0.56635684", "0.5616267", "0.55531436", "0.5526648", "0.54824513", "0.54305995", "0.542977", "0.53921473", "0.53813857", "0.5373835", "0.5363819", "0.53453374", "0.52664", "0.5251333", "0.5244369", "0.5240236", "0.52371", "0.5231588", "0.5230473", "0.5229071", "0.52099836", "0.51931673", "0.5177165", "0.5177084", "0.5174293", "0.5166804", "0.5145732", "0.5136605", "0.51351285", "0.5125093", "0.5118113", "0.51118416", "0.51047623", "0.5095586", "0.50772697", "0.5072602", "0.5071669", "0.5067488", "0.50568885", "0.5048801", "0.5046257", "0.5030318", "0.502453", "0.50241613", "0.50121707", "0.5011809", "0.50086784", "0.500835", "0.5002634", "0.49730334", "0.4964251", "0.49537632", "0.49511838", "0.49508047", "0.49475178", "0.49399373", "0.49387476", "0.49291924", "0.49157986", "0.4907921", "0.49037233", "0.48890674", "0.48879024", "0.48837295", "0.48800492", "0.48758626", "0.48746693", "0.48688883", "0.4867767", "0.48634094", "0.48632893", "0.4861974", "0.48583958", "0.4857897", "0.48573858", "0.4850821", "0.48498556", "0.48488754", "0.48469952", "0.4844309", "0.48416084", "0.48386505", "0.4835513", "0.4829265", "0.48285174", "0.4817793", "0.48123753", "0.48091602", "0.48053217", "0.48032972" ]
0.70838606
0
Get permissions for a photo.
function photos_getPerms ($photo_id) { $response = $this->execute(array('method' => 'flickr.photos.getPerms', 'photo_id' => $photo_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['perms']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPermissions();", "abstract public function getPermissions();", "public function getPermissions() {}", "public function getPermissions() {}", "public function get_permissions()\n\t{\n\t\treturn $this->area->get_permissions($this->path);\n\t}", "public function getPermissions()\n\t{\n\t\tif(isset($this->permissions))\n\t\t{\n\t\t\treturn $this->permissions;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->permissions = isset($content) && isset($content['permissions']) ? $content['permissions'] : array();\n\t}", "public function get_available_permissions()\n {\n try {\n $url = $this->get_url(\"graph\", \"me\", array(\"metadata\" => \"1\"));\n $data = $this->api_call($url);\n //echo $url;\n } catch (Exception $ex) {\n print_r($ex->getMessage());\n exit;\n }\n\n return $this->convert_array_to_object($data->metadata);\n }", "public function & GetPermissions ();", "public function getPossiblePermissions();", "public function getAllPermissions(): array;", "public function permissions()\n\t{\n\t\treturn $this->get('permissions');\n\t}", "public function getPermissions()\n {\n return $this->get(self::PERMISSIONS);\n }", "public function getAllPermissions();", "public function getAllPermissions();", "public function getObjectPermissions(): array;", "public function getPermissions() {\n\t\treturn $this->addressBookInfo['permissions'];\n\t}", "public function permissions() : ?array\n {\n if ($apiRoot = $this->request('GET', $this->identity->getUrl('/')))\n {\n $payload = $apiRoot->getPayload();\n\n if (isset($payload['permissions']) && is_array($payload['permissions']))\n {\n return $payload['permissions'];\n }\n }\n\n return null;\n }", "public function permissions() {\n\t$this->loadPermissions();\n\treturn $this->permissions;\n}", "public function getPermissions()\n {\n return $this->fileStructure->mode;\n }", "public function getPermissions()\r\n\t{\r\n\t\tif($this->accessToken === null) {\r\n\t\t\tthrow new SkydriveException_InvalidToken();\r\n\t\t}\r\n\t\t$url = self::baseUrl . \"permissions?access_token=\" . $this->accessToken;\r\n\t\t$result = $this->fetch($url);\r\n\t\treturn $result;\r\n\t}", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function getFileOperationPermissions() {}", "public function getPermissions(): array {\n\t\tif ($this->permissions === null) {\n\t\t\t$this->permissions = UserQueries::getUserPermissions($this->id);\n\t\t}\n\n\t\treturn $this->permissions;\n\t}", "private function getPermissions()\n\t{\n\t\tif (!isset($this->permissions)) {\n\t\t\t$this->permissions = $this->permissions()->get();\n\t\t}\n\t\treturn $this->permissions;\n\t}", "public function getPermissions(): array {\n\t\treturn [];\n\t}", "public function permissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\r\n {\r\n return $this->getGuardUser()->getPermissions();\r\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n {\n return $this->permissions;\n }", "public function getPermissions()\n\t{\n\t\tif(!$this->id)\n\t\t\treturn array();\n $role= UserRole::model()->getUserRole($this);\n if(!$role->role_id){\n return array();\n }\n\t\t$permissions = array();\n\t\t$sql = \"SELECT pa.ACTION_ID AS id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_ROLE.\"' and pm.principal_id = {$role->role_id}\";\n\t\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t\t$permissions[$permission['id']] = $permission['key'];\n\t\t\n\n\n\t\t// Direct user permission assignments\n\t\t$sql = \"select pa.ACTION_ID as id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_USER.\"' and pm.principal_id = {$this->id}\";\n\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t$permissions[$permission['id']] = $permission['key'];\n\n\n\t\treturn $permissions;\n\t}", "public static function getPermissions(): array\n {\n return [];\n }", "public function getPermissionsListAttribute()\n {\n return Permission::orderBy('resource')->get();\n }", "function getPermissions($model) {\r\n\t\t$user = $model->getUser();\r\n\t\tif (empty($user)) {\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\tif (!array_key_exists($model->alias, $this->cache)) {\r\n\t\t\t$this->cache[$model->alias] = $model->permissions($user['Contact']);\r\n\t\t}\t\t\r\n\t\treturn $this->cache[$model->alias];\r\n\t}", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function getPermissions() {\n return $this->getGuardUser()->getPermissions();\n }", "public function getPermissions() {\r\n $template = $this->getOne('Template');\r\n if (empty($template)) return array();\r\n\r\n /* get permissions for policy */\r\n $c = $this->xpdo->newQuery('modAccessPermission');\r\n $c->sortby('name','ASC');\r\n $permissions = $template->getMany('Permissions',$c);\r\n\r\n $data = $this->get('data');\r\n $lexicon = $template->get('lexicon');\r\n $list = array();\r\n /** @var modAccessPermission $permission */\r\n foreach ($permissions as $permission) {\r\n $desc = $permission->get('description');\r\n if (!empty($lexicon) && $this->xpdo->lexicon) {\r\n if (strpos($lexicon,':') !== false) {\r\n $this->xpdo->lexicon->load($lexicon);\r\n } else {\r\n $this->xpdo->lexicon->load('core:'.$lexicon);\r\n }\r\n $desc = $this->xpdo->lexicon($desc);\r\n }\r\n $active = array_key_exists($permission->get('name'),$data) && $data[$permission->get('name')] ? 1 : 0;\r\n $list[] = array(\r\n $permission->get('name'),\r\n $permission->get('description'),\r\n $desc,\r\n $permission->get('value'),\r\n $active,\r\n );\r\n }\r\n return $list;\r\n }", "public function getPermissions() :array\n {\n return $this->permissions;\n }", "public function permissions()\n {\n return $this->permissionModel->findAll();\n }", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function getPermissions() {\n if (!$this->cache_permissions) {\n $this->cache_permissions = array();\n //berk... legacy permission code... legacy db functions... berk!\n $sql=\"SELECT ugroup_id, permission_type \n FROM permissions \n WHERE permission_type LIKE 'PLUGIN_TRACKER_FIELD%'\n AND object_id='\". db_ei($this->getId()) .\"' \n ORDER BY ugroup_id\";\n \n $res=db_query($sql);\n if (db_numrows($res) > 0) {\n while ($row = db_fetch_array($res)) {\n $this->cache_permissions[$row['ugroup_id']][] = $row['permission_type'];\n }\n }\n }\n return $this->cache_permissions;\n }", "function get_permission_list() {\n\t\treturn $this->db->get('system_security.security_permission');\n\t\t\n\t}", "public function entityGalleryTypePermissions() {\n $perms = array();\n // Generate entity gallery permissions for all entity gallery types.\n foreach (EntityGalleryType::loadMultiple() as $type) {\n $perms += $this->buildPermissions($type);\n }\n\n return $perms;\n }", "public function permissions()\n {\n if (is_array($this->permissions)) {\n return $this->permissions;\n }\n\n if ($this->permissions) {\n return [ $this->permissions ];\n }\n\n return [];\n }", "public function getPermissionForGroup() {\n $sql = \"SELECT * FROM `SM_PERMISSION` WHERE sm_idGroup = '$this->idGroup'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n $toret = array();\n $i = 0;\n while ($fila = $resultado->fetch_array()) {\n $toret[$i] = $fila;\n $i++;\n }\n return $toret;\n }\n }", "public function getPhotos();", "public function getAllPermissions()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\r\n }", "public function cachedPermissions()\n {\n $rolePrimaryKey = $this->primaryKey;\n $cacheKey = 'guardian_permissions_for_role_' . $this->$rolePrimaryKey;\n if (Cache::getStore() instanceof TaggableStore) {\n return Cache::tags(Config::get('guardian.permission_role_table'))->remember($cacheKey, Config::get('cache.ttl', 60), function () {\n return $this->perms()->get();\n });\n } else {\n return $this->perms()->get();\n }\n }", "public static function permissions(): array\n {\n return [];\n }", "function getPermissions(&$record){\n $auth =& Dataface_AuthenticationTool::getInstance();\n $user =& $auth->getLoggedInUser();\n if ( !isset($user) ) return Dataface_PermissionsTool::READ_ONLY();\n // if the user is null then nobody is logged in... read only\n $role = $user->val('Role');\n return Dataface_PermissionsTool::getRolePermissions($role);\n // Returns all of the permissions for the user's current role.\n }", "public function getAllPermissions() {\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\n }", "public function getPermission($permission);", "public function getEvaluatePermissions() {}", "public function getAllPermissions()\n {\n return $this->repository->getAllPermissions();\n }", "function permissions_get ()\n{\n\tstatic $perms = array (\n\t\t\t\"read\"\t\t=> 0x0001,\n\t\t\t\"create\"\t=> 0x0002,\n\t\t\t\"change\"\t=> 0x0004,\n\t\t\t\"delete\"\t=> 0x0008,\n\t\t\t\"password\"\t=> 0x0040,\n\t\t\t\"admin\"\t\t=> 0x8000,\t// admin\n\t\t\t);\n\treturn $perms;\n}", "public function permissions()\n {\n\n return Permission::all();\n }", "public function getAllPhotos();", "public function getDirectPermissions(): Collection\n {\n return $this->permissions;\n }", "public function getUserPermissions(): Collection\n {\n return $this->model->where('name', 'LIKE', 'view_%')->get();\n }", "public function allowedPermissions()\n {\n return $this->permissions()->wherePivot('has_access', true)->orderBy('name');\n }", "public function getPermissions(Roleable $resource = null);", "public function getPermission($permission) {}", "public function getPermission($permission) {}", "public function mediaTypePermissions() {\n // Generate media permissions for all media types.\n $media_types = $this->entityTypeManager->getStorage('media_type')->loadMultiple();\n return $this->generatePermissions($media_types, [$this, 'buildPermissions']);\n }", "public function getAdminPermissions(): array;", "function getPermissions(&$record){\n $auth =& Dataface_AuthenticationTool::getInstance();\n $user =& $auth->getLoggedInUser();\n if ( $user ) return Dataface_PermissionsTool::ALL();\n return Dataface_PermissionsTool::NO_ACCESS();\n }", "protected function getPermission(){\n if(Session::getKey(\"loggedIn\")):\n $userPermissions = array();\n $userPermission = Session::getKey(\"level\");\n if($userPermission[0]) { // tiene permiso para crear\n $userPermissions[] = \"create\";\n }\n if($userPermission[1]) { // tiene permiso para crear\n $userPermissions[] = \"read\";\n }\n if($userPermission[2]) { // tiene permiso para crear\n $userPermissions[] = \"update\";\n }\n if($userPermission[3]) { // tiene permiso para crear\n $userPermissions[] = \"delete\";\n }\n return $userPermissions; \n else:\n return false;\n endif;\n }", "public function getCustomerResultPermissions(): array;", "public function permissionsById()\n {\n $permissionsById = array();\n\n foreach ($this->perms as $permission) {\n $permissionsById[] = $permission->id;\n }\n\n return $permissionsById;\n }", "static function getPermissions() {\n if(self::$permissions === false) {\n self::$permissions = new NamedList(array(\n\n ));\n\n EventsManager::trigger('on_system_permissions', array(&self::$permissions));\n } // if\n\n return self::$permissions;\n }", "function getPermissions() {\n // For eficientcy, we will just store the names, not the objects\n if ( is_null($this->allPermissions) ) {\n $tmpRole = FactoryObject::newObject(\"_Permission\");\n $this->allPermissions = $tmpRole ->getAllPermissionByIdRole($this->getId());\n } \n\n return $this->allPermissions;\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "function getPhotoInfo($photoId);", "public function cachedPermissions()\n {\n $rolePrimaryKey = $this->primaryKey;\n $cacheKey = 'entrust-branch_permissions_for_role_'.$this->$rolePrimaryKey;\n return Cache::tags(Config::get('entrust-branch.permission_role_table'))->remember($cacheKey, Config::get('cache.ttl'), function () {\n return $this->perms()->get();\n });\n }", "public static function getPermission()\n {\n $permissions = Permission::select('id', 'display_name')->get();\n\n return response()->json($permissions);\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "protected function getPermissions()\n {\n if (!$this->tablePermissionsExists()) {\n return [];\n }\n return Permission::with('roles')->get();\n }", "public static function getAllPermissions()\n {\n return Cache::rememberForever('permissions.all', function() {\n return self::all();\n });\n }", "public static function getAllPermissions()\n\t{\n\t\treturn Permission::all();\n\t}", "function getPermissions() {\n\t\t$permissions = array();\n\t\t//everyone gets permission to log in and out\n\t\t$permissions[]='users:logout';\n\t\t$permissions[]='users:login';\n\t\t//Import the User Model so we can build up the permission cache\n\t\tApp::import('Model', 'User');\n\t\t$thisUser = new User;\n\t\t//Now bring in the current users full record along with groups\n\t\t$thisRoles = $thisUser->find(array('User.id' => $this->Auth->user('id')));\n\t\t$thisRoles = $thisRoles['Role'];\n\t\tforeach($thisRoles as $thisRole) {\n\t\t\t$thisPermissions = $thisUser->Role->find(array('Role.id' => $thisRole['id']));\n\t\t\t$thisPermissions = $thisPermissions['Permission'];\n\t\t\tforeach($thisPermissions as $thisPermission) {\n\t\t\t\t$permissions[] = $thisPermission['name'];\n\t\t\t}\n\t\t}\n\t\treturn $permissions;\n\t}", "public function permissions()\n {\n $model = config('authorization.permission');\n\n return $this->belongsToMany($model);\n }", "public function getPhoto($id);", "public function getPermissions()\n {\n /*\n SELECT\n DISTINCT p.constant\n FROM\n user_permissions up\n INNER JOIN permissions p on up.permission_id = p.id\n WHERE\n up.user_id = 2\n */\n $userPermissions = DB::table('user_permissions')\n ->join('permissions', 'user_permissions.permission_id', '=', 'permissions.id')\n ->where('user_permissions.user_id', '=', $this->id)\n ->select('permissions.constant')\n ->distinct()\n ->get();\n\n // Convert results to single dimensional array of permission constants\n $perms = array();\n foreach ($userPermissions as $permission) {\n $perms[] = $permission->constant;\n }\n return $perms;\n }", "public function getAllPermissions()\n {\n $p = App::$Properties->getAll('permissions');\n if (!$p || !Any::isArray($p)) {\n throw new SyntaxException('User permissions settings is not founded: /Private/Config/Permissions.php');\n }\n\n return $p;\n }", "public function getPerms()\r\n\t{\r\n\t\treturn $this->_perms;\r\n\t}", "public function getAllInUse()\n {\n return $this->auth->getAllPermissions();\n }", "public function listPermissions($user) {\n return $user->permissions;\n }", "public function permissions($idr) {\n\n $stmt = $this->connection->prepare(\"SELECT id, permission_id FROM role_permissions WHERE role_id = ?\");\n $stmt->bind_param(\"s\", $idr);\n $stmt->execute();\n $result = $stmt->get_result();\n return $result->fetch_array();\n }", "function getUserPermissions($userId) {\n return getSingleValue(\"SELECT `permissions` FROM `private_users` WHERE `id` =\" . escape(intval($userId)) . \" LIMIT 0, 1\");\n }", "protected static function getPermissions(): Collection\n {\n return app(PermissionRegistrar::class)->getPermissions();\n }", "protected static function getPermissions(): Collection\n {\n return app(PermissionRegistrar::class)->getPermissions();\n }", "public function authorize()\n {\n return \\Gate::allows('add_picture');\n }", "function getPermissions(&$record){\n\t\t$auth =& Dataface_AuthenticationTool::getInstance();\n\t\t$user =& $auth->getLoggedInUser();\n\t\t//\n\t\t// This returns permissions of ALL for admin, no access when there is no user, and by role if there is a user logged in. 2014-06-08. David Gleba.\n\t\t//\n\t\tif ( !isset($user) ){\n\t\t\treturn Dataface_PermissionsTool::NO_ACCESS(); \t\t\t\t// if the user is null then nobody is logged in... no access. This will force a login prompt. \n\t\t} else if ($user and $user->val('Role') == 'ADMIN'){\n\t\t\treturn Dataface_PermissionsTool::ALL();\t\t\t\t\t\t//returns all permissions if user is ADMIN\n\t\t} else {\n\t\t\t$role = $user->val('Role');\n\t\t\treturn Dataface_PermissionsTool::getRolePermissions($role); // Returns the permissions based on the user's current role.\n\t\t}\n\t}", "public function permissions(): array\n {\n $permissions = $this->getAttribute('permissions') ?: [];\n\n if ( ! is_array($permissions)) {\n $permissions = (array) $permissions;\n }\n\n return $permissions;\n }", "public function getProfilePicture();", "public function userCachedPermissions(): array\n {\n $cacheKey = 'gatekeeper_permissions_for_' . $this->userModelCacheKey() . '_' . $this->user->getKey();\n\n $permissions = $this->user->permissions->first()?->toArray() ?? [];\n\n if (!Config::get('gatekeeper.cache.enabled')) {\n return $permissions;\n }\n\n return Cache::remember($cacheKey, Config::get('gatekeeper.cache.expiration_time', 60), function () use ($permissions) {\n return $permissions;\n });\n }" ]
[ "0.6789415", "0.66065", "0.6573238", "0.6573238", "0.6457416", "0.635394", "0.63504314", "0.6339839", "0.622988", "0.6208075", "0.6201465", "0.61882824", "0.6182389", "0.6182389", "0.61682636", "0.60221034", "0.6005442", "0.596628", "0.59479654", "0.59190667", "0.5911445", "0.5886638", "0.58694404", "0.5850047", "0.58287764", "0.5812963", "0.5804657", "0.58004814", "0.58004814", "0.58004814", "0.578925", "0.5769079", "0.5750223", "0.5718597", "0.5708174", "0.5708174", "0.5708174", "0.5708174", "0.5708174", "0.5702579", "0.56957936", "0.5693894", "0.5678519", "0.5656453", "0.56253123", "0.56237435", "0.5609665", "0.55680996", "0.5561094", "0.5556356", "0.55553675", "0.5543341", "0.5532481", "0.5504794", "0.5501848", "0.5478772", "0.5470017", "0.54514915", "0.54503363", "0.54499567", "0.5436614", "0.5430924", "0.5428484", "0.5402525", "0.5399844", "0.53813785", "0.53813785", "0.5375204", "0.5375127", "0.5352249", "0.53518385", "0.53497064", "0.5347713", "0.5336982", "0.5324181", "0.5323613", "0.5323243", "0.53095436", "0.5306388", "0.52823365", "0.52813286", "0.5271298", "0.52602595", "0.5253796", "0.52415574", "0.5240092", "0.5236397", "0.52353394", "0.5228358", "0.5225692", "0.5222607", "0.5203196", "0.5193339", "0.518838", "0.518838", "0.5187918", "0.51777387", "0.5171809", "0.51695406", "0.5167682" ]
0.6953229
0
Returns a list of the latest public photos uploaded to flickr.
function photos_getRecent ($per_page = 25, $page = 1, $extras = NULL) { $params = array(); $params['method'] = 'flickr.photos.getRecent'; $params['per_page'] = $per_page; $params['page'] = $page; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos();", "public function getAllPhotos();", "public function getTenLatestPhotos();", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photos_recentlyUpdated ($per_page = 25, $page = 1, $min_date = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.recentlyUpdated';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif (!$min_date) {\n\t\t\t$params['min_date'] = time()-604800;;\n\t\t}\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "function get_list_of_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 1 ORDER BY date DESC');\n return $result;\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "function photos_search ($per_page = 25, $page = 1, $tags = NULL, $text = NULL, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.search';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($tags) {\n\t\t\t$tags = explode(',', $tags);\n\t\t\tarray_map('trim', $tags);\n\t\t\t$tags = implode(',', $tags);\n\t\t\t$params['tags'] = $tags;\n\t\t}\n\t\tif ($text) $params['text'] = trim($text);\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "function photos_getContactsPhotos ($count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPhotos';\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getRecentPhoto()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentPhoto($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getRecentUploads($limit = 50)\n {\n $siteConfig = SiteConfig::current_site_config();\n if ($this->getIsAuthenticated()) {\n //get latest videos\n $response = $this->lib->request('/users/' . $siteConfig->VimeoFeed_Username . '/videos', array('per_page' => $limit, 'sort' => 'date', 'direction' => 'desc'), 'GET');\n $uploads = array();\n\n //loop through checking if results already exist in DB\n foreach ($response['body']['data'] as $video) {\n $videoObject = $this->processVideo($video);\n array_push($uploads, $videoObject);\n }\n\n return isset($uploads) ? $uploads : false;\n }\n\n return false;\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getUploads($maxResults);", "function get_photos($groupid, $photo_number=1) {\n\n //parameters to use\n $params = array(\n 'api_key' => $this->flickr_api_key,\n 'method' => 'flickr.groups.pools.getPhotos',\n 'group_id' => $groupid,\n 'per_page' => $this->photos_per_page,\n 'page' => (string) $photo_number,\n 'extras' => 'url_m,path_alias,url_t,url_s,url_o',\n 'format' => 'php_serial',\n );\n //make the parameters nice for api call\n $url_params = array();\n foreach ($params as $k => $v) {\n $url_params[] = urlencode($k) . '=' . urlencode($v);\n }\n \n //make the api call\n $url = 'http://api.flickr.com/services/rest/?' . implode('&', $url_params);\n $response = file_get_contents($url);\n \n $resp_array = unserialize($response);\n\n if ($resp_array['stat'] == 'ok') {\n //Everything ok! Return the photo object\n return $resp_array['photos']['photo'];\n } else {\n //Something went wrong with the flickr call\n //We say this by returning NULL\n \n //Temporary error message\n echo \"Nu blev det nåt fel med flickr! Ojojoj!\";\n \n return NULL;\n \n }\n}", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "function sync_flickr($search,$new_only=false,$photoset=0,$photoset_name=\"\",$private=0)\n\t{\n\t\n\tglobal $flickr_api_key, $flickr_token, $flickr_caption_field, $flickr_keywords_field, $flickr_prefix_id_title, $lang;\n\t\t\t\n\t$results=do_search($search);\n\t\n\tforeach ($results as $result)\n\t\t{\n\t\tglobal $view_title_field;\n\n\t\t# Fetch some resource details.\n\t\t$title=i18n_get_translated($result[\"field\" . $view_title_field]);\n\t\t$description=sql_value(\"select value from resource_data where resource_type_field=$flickr_caption_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$keywords=sql_value(\"select value from resource_data where resource_type_field=$flickr_keywords_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$photoid=sql_value(\"select flickr_photo_id value from resource where ref='\" . $result[\"ref\"] . \"'\",\"\");\n\n\t\t# Prefix ID to title?\n\t\tif ($flickr_prefix_id_title)\n\t\t\t{\n\t\t\t$title=$result[\"ref\"] . \") \" . $title;\n\t\t\t}\n\t\t\t\n\t\tif (!$new_only || $photoid==\"\")\n\t\t\t{\n\t\t\techo \"<li>\" . $lang[\"processing\"] . \": \" . $title . \"\\n\";\n\t\n\t\t\t$im=get_resource_path($result[\"ref\"],true,\"scr\",false,\"jpg\");\n\t\n\t\t\t# If replacing, add the photo ID of the photo to replace.\n\t\t\tif ($photoid!=\"\")\n\t\t\t\t{echo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"updating_metadata_for_existing_photoid\"]);\n\t\t\t\t\n\t\t\t\t# Also resubmit title, description and keywords.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setTags\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"tags\"=>$keywords));\n\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setMeta\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"title\"=>$title, \"description\"=>$description));\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t# New uploads only. Send the photo file.\n\t\t\tif ($photoid==\"\")\t\n\t\t\t\t{\n\n\t\t\t\t$url=\"http://api.flickr.com/services/upload/\";\n\n\t\t\t\t# Build paramater list for upload\n\t\t\t\t$data=array(\n\t\t\t\t\"photo\"=>\"@\" . $im,\n\t\t\t\t\"api_key\"=>$flickr_api_key,\n\t\t\t\t\"auth_token\" => $flickr_token,\n\t\t\t\t\"title\" => $title,\n\t\t\t\t\"description\" => $description,\n\t\t\t\t\"tags\" => $keywords\n\t\t\t\t);\n\n\t\t\t\t# Add the signature by signing the data...\n\t\t\t\t$data[\"api_sig\"]=flickr_sign($data,array(\"photo\"),true);\n\t\t\t\t\n\t\t\t\t# Use CURL to upload the photo.\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\t$photoid=flickr_get_response_tag(curl_exec($ch),\"photoid\");\n\t\t\t\t\n\t\t\t\techo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"photo-uploaded\"]);\n\n\t\t\t\t# Update Flickr tag ID\n\t\t\t\tsql_query(\"update resource set flickr_photo_id='\" . escape_check($photoid) . \"' where ref='\" . $result[\"ref\"] . \"'\");\n\t\t\t\t}\n\n\t\t\t$created_new_photoset=false;\n\t\t\tif ($photoset==0)\n\t\t\t\t{\n\t\t\t\t# Photoset must be created.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.create\",\"auth_token\"=>$flickr_token, \"title\"=>$photoset_name, \"primary_photo_id\"=>$photoid),\"\",\"POST\");\n\t\t\t\tglobal $last_xml;\n\t\t\t\t#echo htmlspecialchars($last_xml);\n\t\t\t\t$pos_1=strpos($last_xml,\"id=\\\"\");\n\t\t\t\t$pos_2=strpos($last_xml,\"\\\"\",$pos_1+5);\n\t\t\t\t$photoset=substr($last_xml,$pos_1+4,$pos_2-$pos_1-4);\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoset_name\", \"%photoset\"), array($photoset_name, $photoset), $lang[\"created-new-photoset\"]);\n\t\t\t\t$created_new_photoset=true;\n\t\t\t\t}\n\n\t\t\t# Add to photoset\n\t\t\tif (!$created_new_photoset) # If we've just created a photoset then this will already be present within it as the primary photo (added during the create photoset request).\n\t\t\t\t{\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.addPhoto\",\"auth_token\"=>$flickr_token, \"photoset_id\"=>$photoset, \"photo_id\"=>$photoid));\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoid\", \"%photoset\"), array($photoid, $photoset), $lang[\"added-photo-to-photoset\"]);\n\t\t\t\t#global $last_xml;echo nl2br(htmlspecialchars($last_xml));\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t# Set permissions\n\t\t\techo \"<li>\" . str_replace(\"%permission\", $private==0 ? $lang[\"flickr_public\"] : $lang[\"flickr_private\"], $lang[\"setting-permissions\"]);\n\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setPerms\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"is_public\"=>($private==0?1:0),\"is_friend\"=>0,\"is_family\"=>0,\"perm_comment\"=>0,\"perm_addmetadata\"=>0),\"\",\"POST\");\n\n\t\t\t\n\t\t\t}\n\t\t}\n\techo \"<li>\" . $lang[\"done\"];\n\t}", "public function getPhotoUrls () {\n\t\t\n\t}", "function tp_mostrecentimages($max = 8, $pagination = true) {\n\treturn list_entities(\"object\", \"image\", 0, $max, false, false, $pagination);\n}", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public static function getList($currentPage=0, $order=\"uploadDate DESC\") {\n\t\t\n\t\t$x = $currentPage * NUM_PER_PAGE;\n\t\t$y = $x+NUM_PER_PAGE;\n\n\t\t$conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n\t\t$sql = \"SELECT * FROM images WHERE published = 1 ORDER BY uploadDate DESC LIMIT :x, :y\";\n\n\t\t$st = $conn->prepare($sql);\n\t\t$st->bindValue(\":x\", $x, PDO::PARAM_INT);\n\t\t$st->bindValue(\":y\", $y, PDO::PARAM_INT);\n\t\t$st->execute();\n\t\t$list = array();\n\t\t\n\t\twhile ($row = $st->fetch()) {\n\t\t\t$image = new Image($row);\n\t\t\t$list[] = $image;\n\t\t}\n\t\t\n\t\t$sql = \"SELECT FOUND_ROWS() AS totalRows\";\n\t\t$totalRows = $conn->query($sql)->fetch();\n\t\t$conn = null;\n\t\t//$row = $st->fetch();\n\t\t//return json_encode($row);\n\t\treturn(array(\"results\"=>$list, \"totalRows\"=>$totalRows[0]));\n\t}", "public function getAllPublicPhotosJson(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0';\n $photos = $this->executeQuery($sql);\n while ($photo = $photos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $photo;\n }\n $photosJson = json_encode($data);\n echo $photosJson;\n }", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function getLatestThumbList()\n {\n return $this->latestThumbList;\n }", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function index()\n {\n //\n $id = Auth()->user()->id;\n $photos = Picture::where('user_id', '=', $id )->latest()->get();\n\n $result = $photos->map(function($photo){\n return [\n \"user_id\" => $photo->user_id,\n \"title\" => $photo->title,\n \"photos\" => $photo->photos\n ];\n });\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Records fetched successfully\",\n \"data\" => $result\n ],StatusCodes::SUCCESS);\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function getFeed()\n\t{ \n // Set a default feed.\n $feed = 'http://api.flickr.com/services/feeds/photos_public.gne'; \n \n switch ($this->get('params')->get('source'))\n {\n case 'recent_photos':\n $feed = 'http://api.flickr.com/services/feeds/photos_public.gne';\n break;\n case 'user_photos':\n if ($this->get('params')->get('flickruser')) return 'http://api.flickr.com/services/feeds/photos_public.gne?id='.$this->nameToId($this->get('params')->get('flickruser'));\n break; \n case 'group_photos':\n if ($this->get('params')->get('flickrgroup')) return 'http://api.flickr.com/services/feeds/groups_pool.gne?id='.$this->nameToId($this->get('params')->get('flickrgroup'));\n break; \n case 'friends_photos':\n if ($this->get('params')->get('flickruser')) return 'http://api.flickr.com/services/feeds/photos_friends.gne?user_id='.$this->nameToId($this->get('params')->get('flickruser'));\n break; \n case 'keyword_photos':\n if ($this->get('params')->get('keywords')) return 'http://api.flickr.com/services/feeds/photos_public.gne?tags='.$this->get('params')->get('keywords');\n break;\n case 'set_photos':\n if ($this->get('params')->get('flickrset')) return 'http://api.flickr.com/services/feeds/photoset.gne?set='.$this->get('params')->get('flickrset').'&nsid='.$this->nameToId($this->get('params')->get('flickruser'));\n break; \n }\n \n return $feed;\n\t}", "public function getPhotos($id)\n {\n $gallery = Gallery::with('photos')->find($id);\n\n $photos = $gallery->photos;\n\n $photoarr = [];\n\n foreach($photos as $photo) {\n $photoarr[] = [\n 'server' => $photo->filename,\n 'size' => app('files')->size(public_path('uploads/photos/' . $photo->filename)),\n 'imageurl' => asset('uploads/photos/thumbs/' . $photo->filename)\n ];\n }\n return response()->json([\n 'photos' => $photoarr\n ]);\n }", "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "function getRecents() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY id DESC LIMIT 30;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "public function get_all_gallery_images() {\n\n\t\tcheck_ajax_referer( 'daylife-gallery-add-nonce', 'nonce' );\n\t\trequire_once( dirname( __FILE__ ) . '/class-wp-daylife-api.php' );\n\t\t$daylife = new WP_Daylife_API( get_option( 'daylife' ) );\n\n\t\t// Should be int but santize value as id can be bigger than maximum int value\n\t\t$gallery_id = sanitize_text_field( $_POST['gallery_id'] );\n\t\tif ( $gallery_id > 0 ) {\n\t\t\t$args['gallery_id'] = $gallery_id;\n\n\t\t\t$images = $daylife->get_gallery_by_id( $args );\n\n\t\t\tforeach ( $images as $image ) {\n\t\t\t\t$image_data[] = $image->url . '|' . $image->caption;\n\t\t\t}\n\t\t\techo json_encode( $image_data );\n\t\t}\n\t\tdie;\n\n\t}", "public function media_upload_picasa_list_content()\n\t{\n\t\t$items_per_page = 20;\n\n\t\t$user_feed = $this->api->get_user_feed();\n\t\t$albums = ($user_feed->entry ? $user_feed->entry : array());\n\n\t\t// get current album\n\t\t$current_album = (isset($_GET['album']) ? $_GET['album'] : 'all');\n\n\t\t// get current page\n\t\t$paged = (isset($_GET['paged']) ? $_GET['paged'] : 1);\n\n\t\t// get photos\n\t\tif(isset($_GET['picasa_search_query']))\n\t\t{\n\t\t\t$query = $_GET['picasa_search_query'];\n\t\t\t$photos_feed = $this->api->search_photos($query);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$photos_feed = $this->api->get_photos($current_album);\n\t\t}\n\n\t\t$photos = $photos_feed->entry;\n\n\t\t// set album options\n\t\t$album_options = array('all' => 'All Albums');\n\t\tforeach($albums as $album)\n\t\t\t$album_options[(string)$album->gphotoId] = $album->getTitle()->text;\n\n\t\t$num_pages = ceil(count($photos) / $items_per_page);\n\n\t\t// start and end of current page\n\t\t$start = ($paged - 1) * $items_per_page;\n\t\t$end = min(count($photos), $start + $items_per_page);\n\n\t\t$this->media_upload_content_tabs();\n\n\t\t?>\n\t\t<form id=\"filter\" method=\"get\" action=\"\">\n\t\t\t<p class=\"search-box\">\n\t\t\t\t<input type=\"hidden\" name=\"type\" value=\"picasa\" />\n\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"picasa_list\" />\n\t\t\t\t<input id=\"media-search-input\" type=\"text\" value=\"<?php echo $query; ?>\" placeholder=\"Search Photos\" name=\"picasa_search_query\" />\n\t\t\t\t<input class=\"button\" type=\"submit\" value=\"Search Photos\" />\n\t\t\t</p>\n\n\t\t <select name=\"album\">\n\t\t <?php foreach($album_options as $id => $title): ?>\n\t\t\t\t<option value=\"<?php echo $id ?>\" <?php echo selected($id, $current_album); ?>><?php echo $title; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\n\t\t\t<input class=\"button\" type=\"submit\" value=\"Filter\" />\n\n\t\t\t<div class=\"tablenav\">\n\t\t\t\t<div class=\"tablenav-pages\">\n\n\t\t\t\t\t<?php if($paged > 1): ?>\n\t\t\t\t\t<a class=\"page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $paged - 1)); ?>\">&laquo;</a>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php for($page = max(1, $paged - 3); $page < $paged; $page++): ?>\n\t\t\t\t\t<a class=\"page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $page)); ?>\"><?php echo $page; ?></a>\n\t\t\t\t\t<?php endfor; ?>\n\n\t\t\t\t\t<a class=\"current page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $paged)); ?>\"><?php echo $page; ?></a>\n\n\t\t\t\t\t<?php for($page = $paged + 1; $page < min($paged + 3, $num_pages + 1); $page++): ?>\n\t\t\t\t\t<a class=\"page-numbers\"\t href=\"<?php echo add_query_arg(array('paged' => $page )); ?>\"><?php echo $page; ?></a>\n\t\t\t\t\t<?php endfor; ?>\n\n\t\t\t\t\t<?php if($paged < $num_pages): ?>\n\t\t\t\t\t<a class=\"page-numbers\" href=\"<?php echo add_query_arg(array('paged' => $paged + 1)); ?>\">&raquo;</a>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</div><!-- .tablenav-pages -->\n\t\t\t</div><!-- .tablenav -->\n\n\n\t\t</form>\n\n\t\t<div id=\"media-items\" class=\"picasa\">\n\n\t\t\t<?php\n\t\t\tfor($photo_index = $start; $photo_index < $end; $photo_index++):\n\t\t\t\t$photo = $photos[$photo_index];\n\n\t\t\t $media = $photo->getMediaGroup();\n\t\t\t\t$thumbnails = $media->getThumbnail();\n\n\t\t\t\t$thumbs = array();\n\t\t\t\t$thumb_sizes = array('small', 'medium', 'large');\n\t\t\t\tforeach($thumbnails as $i => $thumb)\n\t\t\t\t{\n\t\t\t\t\t$thumbs[$thumb_sizes[$i]] = array('url' => $thumb->getUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'width' => $thumb->getWidth(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'height' => $thumb->getHeight());\n\t\t\t\t}\n\n\t\t\t?>\n\n\t\t\t<div class=\"media-item\">\n\t\t\t\t<img src=\"<?php echo $thumbs['small']['url']; ?>\"\n\t\t\t\t\t\t width=\"<?php echo $thumbs['small']['width']; ?>\"\n\t\t\t\t\t\t height=\"<?php echo $thumbs['small']['height']; ?>\"\n\t\t\t\t\t\t style=\"float: left; padding: 4px;\"\n\t\t\t\t\t\t />\n\t\t\t\t\t\n\t\t\t\t<div class=\"filename\">\n\t\t\t\t\t<?php echo $photo->getTitle(); ?>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"insert-options\">\n\n\t\t\t\t\t<form action=\"\" method=\"post\">\n\t\t\t\t\t\t<p class=\"link-url\">\n\t\t\t\t\t\t\t<label for=\"link_url\">Link URL</label>\n\t\t\t\t\t\t\t<input type=\"text\" name=\"link_url\" />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class=\"alignment\">\n\t\t\t\t\t\t\t<label for=\"alignment\">Alignment</label>\n\t\t\t\t\t\t\t<span class=\"alignment-options\">\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"none\" name=\"alignment\" checked=\"checked\"><label>None</label>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"left\" name=\"alignment\"><label>Left</label>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"center\" name=\"alignment\"><label>Center</label>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"right\" name=\"alignment\"><label>Right</label>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t<div class=\"size\">\n\t\t\t\t\t\t\t<label for=\"size\">Size</label>\n\t\t\t\t\t\t\t<div class=\"size-options\">\n\t\t\t\t\t\t\t\t<?php foreach($thumbs as $size => $thumb): ?>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"<?php echo $size; ?>\" name=\"size\">\n\t\t\t\t\t\t\t\t<label><?php echo ucwords($size); ?> Thumbnails (<?php echo $thumb['width']; ?> x <?php echo $thumb['height']; ?>)</label><br />\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t<input type=\"radio\" value=\"full\" name=\"size\" checked=\"checked\">\n\t\t\t\t\t\t\t\t<label>Full (<?php echo $photo->getGphotoWidth(); ?> x <?php echo $photo->getGphotoHeight(); ?>)</label><br />\n\t\t\t\t\t\t\t</div><!-- .size-options -->\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<input type=\"hidden\" value=\"<?php echo $photo->getId()->getText(); ?>\" name=\"photo_id\" />\n\t\t\t\t\t\t\t<input type=\"submit\" class=\"button-secondary\" value=\"Insert\" name=\"picasa_embed\" />\n\t\t\t\t\t\t</p>\n\n\t\t\t\t\t</form>\n\n\t\t\t\t</div><!-- .insert-options-->\n\t\t\t</div><!-- .media-item -->\n\n\t\t\t<?php endfor; ?>\n\n\t\t</div><!-- #media-items -->\n\t\t<?php\n\t}", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "public function allPhotosAction() {\r\n $this->view->photo_id = $photo_id = $this->getRequest()->getParam('photo_id', '0');\r\n $this->view->chanel_id = $album_id = $this->getRequest()->getParam('chanel_id', '0');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $params = array();\r\n // send extra params to view for extra URL parameters\r\n $this->view->params = $params;\r\n $page = isset($_POST['page']) ? $_POST['page'] : 1;\r\n $is_ajax = isset($_POST['is_ajax']) ? $_POST['is_ajax'] : 0;\r\n $params['paginator'] = true;\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n //FETCH photos\r\n $paginator = $this->view->allPhotos = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getPhotoCustom($photo, $params, '', true);\r\n $paginator->setItemCountPerPage(30);\r\n $this->view->limit = ($page - 1) * 30;\r\n $this->view->page = $page;\r\n $this->view->is_ajax = $is_ajax;\r\n $paginator->setCurrentPageNumber($page);\r\n }", "public function get_recentfile_list($u_id){\n\t\t$this->db->select('images.img_id,images.img_name,images.imag_org_name,images.img_create_at,favourite.yes')->from('images');\t\t\n\t\t$this->db->join('favourite', 'favourite.file_id = images.img_id', 'left');\n\n\t\t$curr_date = date('Y-m-d h:i:s A', strtotime('-7 days'));\n\t\t$this->db->where('images.u_id', $u_id);\n\t\t$this->db->where('images.img_create_at >', $curr_date);\n\t\t$this->db->order_by(\"images.img_create_at\", \"DESC\");\n\t\treturn $this->db->get()->result_array();\n\t}", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "public function getImages() : array\n\t{\n\t\treturn $this->images_list;\n\t}", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getUserUploads() {\n\t\tif (!self::COOKIES_ENABLED) {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t/* load form database */\n\t\t$uploads = array();\n\t\t$delete_code = $this->getDeleteCode();\n\t\t$result = $this->db->query('\n\t\t\tSELECT *\n\t\t\tFROM image\n\t\t\tWHERE delete_code = \"'.SQLite3::escapeString($delete_code).'\"\n\t\t\t\tAND gallery_id = \"\"\n\t\t\tORDER BY ROWID DESC');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$uploads[$entry['id']] = $entry;\n\t\t\t}\n\t\t}\n\t\treturn $uploads;\n\t}", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function getLastFiles()\n {\n echo json_encode($this->galery->getLastFiles());\n }", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "function get_from_flickr($db, $card_deck, $tag, $verbose=false, $maxdate='') {\n\n\trequire_once(\"phpFlickr.php\");\n\t$f = new phpFlickr(FLICKRKEY);\n\n\tif ($maxdate =='') {\n\t\t// get flickr photos for search on the tag\n\t\t$found = $f->photos_search( array(\"tags\"=>$tag, \"safe_search\" => 1) );\n\t\t\n\t\tif ($verbose) echo \"<p><strong>Starting fetch for photos tagged '$tag' processed at \" . date('-r') . '</strong></p><ul>';\n\t} else {\n\t\n\t\t// get flickr photos for search on the tag and less than $maxdate\n\t\t$found = $f->photos_search(array(\"tags\"=>$tag, \"safe_search\" => 1, \"max_upload_date\" => strtotime($maxdate)));\n\t\t\n\t\tif ($verbose) echo \"<p><strong>Starting fetch for photos tagged '$tag' and uploaded before '$maxdate' processed at \" . date('-r') . '</strong></p><ul>';\n\t}\n\t\n\t\n\t// track number of photos added\n\t$cnt=0;\n\t\n\t// array to hold mysql query values\n\t$values = array();\n\t\n\tforeach ($found['photo'] as $photo) {\n\t\t\n\t\t// skip a photo that's already in the cards database\n\t\tif (get_tbl_count($db, $card_deck, 'fid=\"' . $photo['id'] . '\"')) continue;\n\t\t\n\t\t// we run an insert when we have 10 values to insert\n\t\tif (count($values) == 10) {\n\t\t\n\t\t\tif ($verbose) echo '<li> --- Inserting next 10 photos into card database... --- </li>';\n\t\t\t$query = \"INSERT INTO $card_deck (fid,farm,server,secret,nsid,username,tag) VALUES \" . implode(',',$values);\n\t\t\t$result = mysqli_query( $db, $query) or die (\"Error Error! \" . mysqli_error($db). \" in query<br>$query\");\n\t\t\t\n\t\t\t// reset array\n\t\t\t$values = array();\n\t\t}\n\t\t\n\t\t// get photo owner\n\t\t$owner = $f->people_getInfo($photo['owner']);\n\t\t\n\t\t// add value strings for query\n\t\t$values[] = \"('\" . \n\t\t\t$photo['id'] . \"', \" . \n\t\t\t$photo['farm'] . \", \" . \n\t\t\t$photo['server'] . \", '\" . \n\t\t\t$photo['secret'] . \"', '\" . \n\t\t\t$photo['owner'] . \"', '\" . \n\t\t\taddslashes($owner['username']) . \"', '\" . \n\t\t\t$tag . \"')\";\n\t\t\n\t\t//update count\n\t\t$cnt++;\n\t\t\n\t\tif ($verbose) echo '<li><img src=\"' . \"https://farm\" . $photo['farm'] . \".static.flickr.com/\" . $photo['server'] . \"/\" . $photo['id'] . \"_\" . $photo['secret'] . '_m.jpg\" /> Processing flickr photo <a href=\"https://www.flickr.com/photos/' . $photo['owner'] . '/' . $photo['id'] . '/\">' . 'https://www.flickr.com/photos/' . $photo['owner'] . '/' . $photo['id'] . '/</a> by ' . $owner['username'] . '</li>';\n\t\t\n\t\t\n\t}\n\t\n\t// if there are pending inserts in the queue, then add them\n\tif (count($values)) {\n\t\t\n\t\t$query = \"INSERT INTO $card_deck (fid,farm,server,secret,nsid,username,tag) VALUES \" . implode(',',$values);\n\t\t$result = mysqli_query($db,$query) or die (\"Error Error! \" . mysqli_error($db). \" in query<br>$query\");\n\t\t\tif ($verbose) echo '<li> --- Inserting last photos into card database... --- </li>';\n\t}\n\t\n\tif ($verbose) echo '</ul>';\n\t\n\treturn($cnt);\n\n}", "function files_get() {\n $files = data_read(\".files_meta\");\n return json_result(array('files' => $files, 'count' => count($files)), 200);\n}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function getTopArtists ()\n {\n $lastFmService = new LastFmService;\n $limit = $this->app->request->params('limit', 20);\n $data = $lastFmService->getTopArtists($limit);\n $this->respond($data);\n }", "public function list_owned_files() {\n $stmt = $this->pdo->prepare('select filename from file where user_id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, $f['filename']);\n }\n return $result;\n }", "public function listWallpapers() {\n\n\t\t$contents = $this->assetLoader->loadAsset( $this->domain . $this->handle );\n\n\t\tpreg_match_all('/\\\"raw\\\":\\s*\\\"(.*?)\\\"/', $contents, $matches);\n\n\t\t$images = array_filter($matches[1], function( $url ) {\n\t\t\treturn ! preg_match('/\\\\\\\\u/', $url );\n\t\t});\n\n\t\t$images = array_values(array_unique( $images ));\n\t\t$output = [];\n\t\tforeach ( $images as $image ) {\n\t\t\t$output[] = new RemoteWallpaper( $image, $this->assetLoader );\n\t\t}\n\t\treturn $output;\n\t}", "function getUserTags(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListUserPopular','user_id='.$this->user);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function getAvatarList(){\n return $this->_get(5);\n }", "function get_all_pics(){\n\t\t$all_pics = $this->db->get('pictures');\n\t\treturn $all_pics->result();\n\t}", "public function listImages()\n {\n $images = $this->docker(\"images --format '\\\"{{.Repository}}:{{.Tag}}\\\"' --filter=reference='*' | jq -r\");\n\n $image = explode(\"\\n\", substr($images, 0, -1));\n\n return $image;\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "function get_list_of_non_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 0 ORDER BY date DESC');\n return $result;\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getPhotos($page, $itemsPerPage);", "function roverPhotos() {\n $apiKey = 'MJNM4W8Ot1jbNzCPVOVLBd5v381zqy7m57Rl9p6d';\n $cam = $_POST['rover'];\n $sol = rand(0, 1000);\n $url = \"https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?sol=\". $sol .\"&camera=\". $cam .\"&api_key=\". $apiKey;\n $json = file_get_contents($url);\n $array = json_decode($json, true);\n echo '<div class=\"img\">';\n echo '<img class=img src='. \"'\" . $array['photos'][0][\"img_src\"]. \"'\" .'>';\n echo \"</div>\";\n}", "public function get_images( $id_element = \"\", $user_login = \"\", $public_only = true, $format = JSON ) \n\t{\n\t\t// TODO: add temporal boundaries\n\t\t$elements = $this->dvdb->get_elements( $id_element, $user_login, $public_only );\n\t\t$this->last_images = array();\n\n\t\t$index = 0;\n\t\tforeach ($elements as $element) {\n\t\t\tif ( !empty($element->filename) ) {\n\t\t\t\t$img_src = ABSDOMAIN.UPLOAD_FOLDER.\"/\".$element->filename.\".\".$element->ext;\n\t\t\t\t$img_thumb_src = ABSDOMAIN.UPLOAD_FOLDER.\"/\".$element->filename.\"-\".THUMB_SUFFIX.\".\".$element->ext;\n\t\t\t\t\n\t\t\t\t$this->last_images[$index]['id_element'] = $element->id_element;\n\t\t\t\t$this->last_images[$index]['is_public'] = $element->is_public;\n\t\t\t\t$this->last_images[$index]['name'] = $img_src;\n\t\t\t\t$this->last_images[$index]['thumb'] = $img_thumb_src;\n\t\t\t\t$index++;\n\t\t\t}\n\t\t}\n\t\tif( $format == JSON ) {\n\t\t\treturn json_encode( $this->last_images );\n\t\t} else {\n\t\t\treturn $this->last_images;\n\t\t}\n\t}", "public function index()\n {\n return Photo::get();\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "public function getImages() {\n if (empty($this->_images) && $this->getImgs()) {\n $images = json_decode($this->getImgs(), true);\n uasort($images, function($a, $b) {\n if (!isset($a['ordering'])) {\n $a['ordering'] = 0;\n }\n\n if (!isset($b['ordering'])) {\n $b['ordering'] = 0;\n }\n\n if ($a['ordering'] == @$b['ordering']) {\n return 0;\n }\n return ($a['ordering'] < $b['ordering']) ? -1 : 1;\n });\n $this->_images = $images;\n }\n\n return $this->_images;\n }", "function fsf_port_getImages($fsf_port_getImage_sort, $fsf_port_getImage_limit)\n {\n global $fsfcms_api_url;\n $fsf_api_file = \"fsf.port.getImages.php\";\n $fsf_api_options = \"\";\n\n if($fsf_port_getImage_sort !=\"\")\n {\n $fsf_api_options = \"?image_sort=\" . $fsf_port_getImage_sort;\n } else {\n $fsf_api_options = \"?image_sort=DESC\";\n }\n if($fsf_port_getImage_sort !=\"\")\n {\n $fsf_api_options .= \"&image_limit=\" . $fsf_port_getImage_limit;\n } else {\n $fsf_api_options .= \"&image_limit=5\";\n }\n $fsf_port_getImages_content = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options); \n return $fsf_port_getImages_content;\n }", "function rip_flickr_data($record)\n{ \n $lics = flickr_get_licenses();\n // echo '<pre>'; print_r($lics); die();\n \n $title = $record['title'];\n $license = $lics[$record['license']];\n \n // echo '<pre>';print_r($license); die();\n \n $description = '';\n $sizes = flickr_request('flickr.photos.getSizes', array('photo_id' => $record['id']));\n $sizes = $sizes['sizes'];\n $thumbs = array(); // w:h => array( file, file, file)\n $largest = array(0,'', 0, 0); \n $smallest = array(3000*3000,'', 3000, 3000); // Ok, hacky, sosumi\n \n foreach($sizes['size'] as $thumb) \n {\n if($thumb['label'] == 'Square') continue; // These are a little smaller than default\n if(!isset($thumbs[\"{$thumb['width']}x{$thumb['height']}\"]))\n {\n $thumbs[\"{$thumb['width']}x{$thumb['height']}\"] = array();\n \n if(($thumb['width'] * $thumb['height']) > $largest[0])\n $largest = array($thumb['width'] * $thumb['height'], $thumb['width'] . 'x' . $thumb['height'], $thumb['width'] , $thumb['height']);\n \n if(($thumb['width'] * $thumb['height']) < $smallest[0])\n $smallest = array($thumb['width'] * $thumb['height'], $thumb['width'] . 'x' . $thumb['height'], $thumb['width'] , $thumb['height']);\n }\n $thumbs[\"{$thumb['width']}x{$thumb['height']}\"][] = $thumb;\n \n }\n\n // Find the main image link\n $mainImage = $thumbs[$largest[1]];\n $mainImage = array_pop($mainImage);\n \n // Find the thumb image link\n $thumbImage = $thumbs[$smallest[1]];\n $thumbImage = array_pop($thumbImage);\n \n // Final image to pass to manager (use query param to record the embed url)\n $combinedImage = $mainImage['source'] . \n '?x-flickr-photo='.rawurlencode($record['id']) .\n '&x-lic='.rawurlencode($license['x-id']) .\n '&x-uid='.rawurlencode($record['owner']) . \n '&x-by='.rawurlencode($record['ownername']) . \n '&x-tn='.rawurlencode($thumbImage['source']);\n \n \n return array\n (\n 'title' => $title,\n 'description' => $description,\n 'dimensions' => \"{$mainImage['width']}x{$mainImage['height']}\",\n 'license' => $license,\n 'mainImage' => $mainImage['source'],\n 'thumbImage' => $thumbImage['source'],\n 'combinedImage' => $combinedImage,\n \n 'smallest' => $smallest,\n 'largest' => $largest,\n 'thumbs' => $thumbs, \n );\n}", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "public function getAllImages() {\n\t\t$returnArr = array();\n\n\t\tforeach (File::allFiles($this->imageFolder) as $file) {\n\t\t\t$fileName = $file->getRelativePathName();\n\n\t\t\t$returnArr[] = url() . '/uploads/images/'.$fileName;\n\t\t}\n\n\t\treturn $returnArr;\n\t}", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function getFiles()\n {\n echo json_encode($this->galery->getFiles());\n }", "public function galleries(){\n\n $parameters = [\n 'sort' => 'position',\n 'sort_direction' => 'asc',\n 'page' => 1,\n 'cover_size' => 4,\n 'rpp' => 40\n ];\n\n $data = $this->api->get_galleries($parameters);\n\n return $data['galleries'];\n }", "protected function getPhotos(Item $album, $number)\n {\n return $album->photos()\n ->uploaded()\n ->orderBy('likes', 'desc')\n ->inRandomOrder()\n ->take($number)\n ->get()\n ->sortBy('number');\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function gp_qry_all_new_photo_gallery($website_id, $limit=_CONST_DEFAULT_LIMIT_PHOTO_GALLERY)\n {\n $stmt = 'Select\n PG.PK_PHOTO_GALLERY\n , PG.C_TITLE\n , PG.C_SLUG\n , PG.C_FILE_NAME\n , PG.C_SUMMARY\n From t_ps_photo_gallery PG\n Where PG.FK_WEBSITE = ?\n And PG.C_STATUS = 3\n Order by PG.C_BEGIN_DATE Desc\n Limit ?';\n $params = array($website_id, $limit);\n \n return $this->db->getAll($stmt, $params);\n }", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}" ]
[ "0.7249395", "0.69313157", "0.68007153", "0.6759807", "0.67369187", "0.6626937", "0.66187114", "0.6544581", "0.65286106", "0.64899457", "0.64456326", "0.635372", "0.63462925", "0.63337475", "0.6289648", "0.62828255", "0.6259937", "0.62378466", "0.622972", "0.62008303", "0.6180229", "0.6165216", "0.61610055", "0.6107723", "0.60979265", "0.60886246", "0.6074455", "0.60358375", "0.6033363", "0.6028678", "0.6003377", "0.59876984", "0.59652543", "0.5929536", "0.5926512", "0.59034365", "0.5879957", "0.58595663", "0.5835116", "0.58115566", "0.58017063", "0.5769489", "0.5767866", "0.5767201", "0.57536435", "0.57451093", "0.5738724", "0.5723203", "0.5710983", "0.57015884", "0.5689848", "0.56786644", "0.566611", "0.56654066", "0.5660649", "0.5649699", "0.56487113", "0.564823", "0.5632494", "0.5621795", "0.56204194", "0.5613971", "0.56039834", "0.55902386", "0.5572768", "0.5572478", "0.55723894", "0.55682", "0.5567401", "0.5560422", "0.5557672", "0.5550578", "0.5546428", "0.55462384", "0.55451846", "0.5541109", "0.5534286", "0.55320007", "0.55176055", "0.5513448", "0.5513282", "0.5511186", "0.5508659", "0.55007994", "0.5500043", "0.54698247", "0.5468255", "0.5463073", "0.54615766", "0.5461012", "0.54575664", "0.5457024", "0.54536986", "0.54410845", "0.542871", "0.5426672", "0.5426484", "0.5422894", "0.54117966", "0.54082006" ]
0.6520917
9
Returns the available sizes for a photo. The calling user must have permission to view the photo.
function photos_getSizes ($photo_id) { $response = $this->execute(array('method' => 'flickr.photos.getSizes', 'photo_id' => $photo_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['sizes']['size']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPhotoSizes($photo_id){ // No Secret Required\n\n\t\t/* Get Photo Size */\n\t\t$photoSizes = $this->askFlickr('photos.getSizes','&photo_id='.$photo_id);\n\n\t\t/* Return Photo Sizes */\n\t\treturn $photoSizes;\n\t}", "function rest_get_avatar_sizes()\n {\n }", "public function getImageSizes(): array\n {\n /** @var BackendUser $user */\n $user = $this->tokenStorage->getToken()->getUser();\n\n return $this->imageSizes->getOptionsForUser($user);\n }", "public static function get_sizes()\n {\n }", "public function getSizes()\n {\n return $this->sizes;\n }", "public function getSizes($photoId)\n {\n $sizes = $this->adapter->getItem($photoId);\n\n if (is_null($sizes)) {\n $sizes = $this->flickr->getSizes($photoId);\n $this->adapter->addItem($photoId, $sizes);\n }\n\n return $sizes;\n }", "public function getSizes() {\n return $this->_sizes;\n }", "function acf_get_image_sizes()\n{\n}", "public function getImageSize()\n\t{\n\t\tlist($width, $height) = getimagesize($this->getFullpath());\n\n\t\treturn compact('width', 'height');\n\t}", "public function get_image_sizes() {\n\t\tif ( ! is_array( $this->image_sizes ) || empty( $this->image_sizes ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->image_sizes;\n\t}", "protected\n function setImageSizes()\n {\n return config('album.sizes');\n }", "private function getAvatarsUploadSize()\n {\n $userId = Auth::user()->id;\n $uploadAmount = Avatar::select('user_id')->where('user_id', $userId)->count();\n return $uploadAmount;\n }", "function wp_get_list_image_size() {\n\tglobal $_wp_additional_image_sizes;\n\t$sizes = array();\n\tforeach ( get_intermediate_image_sizes() as $_size ) {\n\t\tif ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {\n\t\t\t$sizes[] = $_size;\n\t\t} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {\n\t\t\t$sizes[] = $_size;\n\t\t}\n\t}\n\treturn $sizes;\n}", "private function _getResizeSize() {\n\t\t$width = $height = 0;\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.0')) {\n\t\t\t$width = Configure::read('GalleryOptions.Pictures.resize_to.0');\n\t\t}\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.1')) {\n\t\t\t$height = Configure::read('GalleryOptions.Pictures.resize_to.1');\n\t\t}\n\n\t\t$crop = Configure::read('GalleryOptions.Pictures.resize_to.2');\n\t\t$action = $crop ? \"crop\" : \"\";\n\n\t\treturn array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'action' => $action\n\t\t);\n\t}", "function wp_get_attachment_image_sizes($attachment_id, $size = 'medium', $image_meta = \\null)\n {\n }", "public function get_image_sizes( $wordpress_only = false ) {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_image_sizes( $wordpress_only );\n\n }", "public function getImageSizes(): array\n {\n $additionalSizes = wp_get_additional_image_sizes();\n $names = $this->getImageSizesNames();\n\n return array_map(function (string $name) use ($additionalSizes) {\n if (isset($additionalSizes[$name])) {\n return [\n \"name\" => $name,\n \"width\" => $additionalSizes[$name][\"width\"],\n \"height\" => $additionalSizes[$name][\"height\"],\n \"crop\" => $additionalSizes[$name][\"crop\"],\n ];\n }\n \n return [\n \"name\" => $name,\n \"width\" => get_option(\"{$name}_size_w\"),\n \"height\" => get_option(\"{$name}_size_h\"),\n \"crop\" => !!get_option(\"{$name}_crop\"),\n ];\n }, $names);\n }", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSizeDetails();", "function wp_get_additional_image_sizes()\n {\n }", "private function get_image_sizes() {\n\n\t\treturn array(\n\t\t\t'square_medium' => array( 200, 200 ),\n\t\t\t'full' => array( 1200, 1200 ),\n\t\t);\n\n\t}", "public function size()\n { \n $props = $this->uri->ruri_to_assoc();\n\n if (!isset($props['o'])) exit(0);\n $w = -1;\n $h = -1;\n $m = 0;\n if (isset($props['w'])) $w = $props['w'];\n if (isset($props['h'])) $h = $props['h'];\n if (isset($props['m'])) $m = $props['m'];\n\n $this->img->set_img($props['o']);\n $this->img->set_size($w, $h, $m);\n $this->img->set_square($m);\n $this->img->get_img();\n }", "function elk_getimagesize($file, $error = 'array')\n{\n\t$sizes = @getimagesize($file);\n\n\t// Can't get it, what shall we return\n\tif (empty($sizes))\n\t{\n\t\t$sizes = $error === 'array' ? array(-1, -1, -1) : false;\n\t}\n\n\treturn $sizes;\n}", "function size()\n\t\t\t{\n\t\t\t\treturn $this->db->order_by('size_id')->get('size');\n\t\t\t}", "public function getSizes(){\n return (array) $this->getAttr('size');\n }", "public static function getSizes()\n {\n $db = DataBase::connect();\n\n $sortOrder = SIZE_SORT_ORDER ? \"ASC\" : \"DESC\" ;\n $result = $db->query(\"SELECT * FROM `size` ORDER BY `id` {$sortOrder}\");\n\n $sizes = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $sizes[$i]['size'] = $row['size'];\n $sizes[$i]['leonardo_prices'] = $row['leonardo_prices'];\n $sizes[$i]['frodo_prices'] = $row['frodo_prices'];\n $sizes[$i]['back_leg'] = $row['back_leg'];\n $sizes[$i]['image_size'] = $row['image_size'];\n\n $i++;\n }\n return $sizes;\n }", "function get_image_size_dimensions($size) {\n\t\tglobal $_wp_additional_image_sizes;\n\t\tif (isset($_wp_additional_image_sizes[$size])) {\n\t\t\t$width = intval($_wp_additional_image_sizes[$size]['width']);\n\t\t\t$height = intval($_wp_additional_image_sizes[$size]['height']);\n\t\t} else {\n\t\t\t$width = get_option($size.'_size_w');\n\t\t\t$height = get_option($size.'_size_h');\n\t\t}\n\n\t\tif ( $width && $height ) {\n\t\t\treturn array(\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t} else return false;\n\t}", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "public function dimensions() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$dims = null;\n\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn $dims;\n\t\t\t}\n\n\t\t\t$data = @getimagesize($file->path());\n\n\t\t\tif ($data && is_array($data)) {\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => $data[0],\n\t\t\t\t\t'height' => $data[1]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!$data) {\n\t\t\t\t$image = @imagecreatefromstring(file_get_contents($file->path()));\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => @imagesx($image),\n\t\t\t\t\t'height' => @imagesy($image)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $dims;\n\t\t});\n\t}", "public function SelectAllSize()\n\t\t{\n\t\t\t$sizeDAL = new SizeDAL($this->_userinfo);\n\t\t\treturn $sizeDAL->SelectAllSize(null);\n\t\t}", "public function getPhoto($userId, $size);", "public function getSizes(): array\n {\n }", "function get_image_sizes() {\n global $_wp_additional_image_sizes;\n\n $sizes = [];\n\n $default_sizes = [ 'thumbnail', 'medium', 'medium_large', 'large', 'full' ];\n\n foreach ( get_intermediate_image_sizes() as $size ) {\n if ( in_array( $size, $default_sizes ) ) {\n $sizes[ $size ]['width'] = (int) get_option( \"{$size}_size_w\" );\n $sizes[ $size ]['height'] = (int) get_option( \"{$size}_size_h\" );\n $sizes[ $size ]['crop'] = (bool) get_option( \"{$size}_size_crop\" );\n }\n elseif ( isset( $_wp_additional_image_sizes[ $size ] ) ) {\n $sizes[ $size ] = $_wp_additional_image_sizes[ $size ];\n }\n }\n\n return $sizes;\n }", "function get_image_sizes() {\n\tglobal $_wp_additional_image_sizes;\n\n\t$sizes = array();\n\n\tforeach ( get_intermediate_image_sizes() as $_size ) {\n\t\tif ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) {\n\t\t\t$sizes[ $_size ]['width'] = get_option( \"{$_size}_size_w\" );\n\t\t\t$sizes[ $_size ]['height'] = get_option( \"{$_size}_size_h\" );\n\t\t\t$sizes[ $_size ]['crop'] = (bool) get_option( \"{$_size}_crop\" );\n\t\t} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {\n\t\t\t$sizes[ $_size ] = array(\n\t\t\t\t'width' => $_wp_additional_image_sizes[ $_size ]['width'],\n\t\t\t\t'height' => $_wp_additional_image_sizes[ $_size ]['height'],\n\t\t\t\t'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $sizes;\n}", "public function allSizes()\n {\n $sizes = [];\n \n $packs = $this->find()->select('volume')->all();\n\n if (!empty($packs)) {\n foreach ($packs as $pack) {\n $sizes[] = $pack->volume;\n }\n }\n\n return $sizes;\n }", "function wp_ajax_health_check_get_sizes()\n {\n }", "public function getSize()\n {\n return $this->item['size'];\n }", "public function getImageSize()\n {\n return $this->ImageSize;\n }", "public function getImgSize() {\n\t\t$this->imgSize = getimagesize($this->imgUri);\n\t}", "protected function sizeAsset(AssetRepresentation $asset): array\n {\n // The storage adapter should be checked for external storage.\n $storagePath = $this->getStoragePath('asset', $asset->filename());\n $filepath = $this->basePath . DIRECTORY_SEPARATOR . $storagePath;\n return file_exists($filepath)\n ? $this->getWidthAndHeightLocal($filepath)\n : $this->getWidthAndHeightUrl($asset->assetUrl());\n }", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "public function getUsedStorageSize() {\n\t\treturn (int)$this->db->querySingle('SELECT SUM(size) FROM image');\n\t}", "public function getImageSize()\n {\n return (($this->isWrapped() || $this->isTemp()) ?\n getimagesizefromstring($this->getRaw())\n : getimagesize($this->getPathname())\n );\n }", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getImageDimensions()\n {\n $dimension = $this->_getSetting('dimension');\n if ($this->getRow()->use_crop) {\n $parentDimension = $this->_getImageEnlargeComponent()->getImageDimensions();\n $dimension['crop'] = $parentDimension['crop'];\n }\n $data = $this->getImageData();\n return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);\n }", "public function getSize()\n {\n return $this->getStat('size');\n }", "public static function filter_available_sizes() {\n\t\t$sizes = apply_filters( 'image_size_names_choose', array(\n\t\t\t'thumbnail' => __( 'Thumbnail', 'thrive-cb' ),\n\t\t\t'medium' => __( 'Medium', 'thrive-cb' ),\n\t\t\t'large' => __( 'Large', 'thrive-cb' ),\n\t\t\t'full' => __( 'Full size', 'thrive-cb' ),\n\t\t) );\n\n\t\t/* MailPoet 3 adds an extra image size, but we're not using it in our products so we must remove it */\n\t\tif ( ! empty( $sizes['mailpoet_newsletter_max'] ) ) {\n\t\t\tunset ( $sizes['mailpoet_newsletter_max'] );\n\t\t}\n\n\t\treturn $sizes;\n\t}", "function getSpecificPhoto($id) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n return $flickr->photos_getSizes($id);\r\n }", "public function getProfileSize() {}", "function wp_calculate_image_sizes($size, $image_src = \\null, $image_meta = \\null, $attachment_id = 0)\n {\n }", "function getSize() ;", "public function load_image_sizes() {\n\t\tif ( ! is_file( ARI_JSON_DIR . 'image-sizes.json' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$handle = fopen( ARI_JSON_DIR . 'image-sizes.json', 'r' );\n\t\t$contents = fread( $handle, filesize( ARI_JSON_DIR . 'image-sizes.json' ) );\n\t\tfclose( $handle );\n\n\t\t$result = json_decode( $contents );\n\t\tif ( is_array( $result ) && ! empty( $result ) ) {\n\t\t\t$this->image_sizes = $result;\n\t\t}\n\t}", "function wp_get_registered_image_subsizes()\n {\n }", "public function get_all_size() {\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_size');\n\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "protected function getDimensions()\n {\n // Default result\n $result = [0, 0];\n\n // If we have a resource already loaded, this means we have modified the resource since the\n // original image was loaded. This means the \"Variant\" tuple key is out of date, and we don't\n // have a reliable cache key to load from, or save to. If we use the original tuple as a key,\n // we would run the risk of overwriting the original dimensions in the cache, with the values\n // of the resized instead.\n // Instead, we use the immediately available dimensions attached to this resource, and we will\n // rely on cache warming in writeToStore to save these values, where the \"Variant\" becomes available,\n // before the next time this variant is loaded into memory.\n $resource = $this->image;\n if ($resource) {\n return $this->getResourceDimensions($resource);\n }\n\n // Check if we have a container\n $container = $this->getAssetContainer();\n if (!$container) {\n return $result;\n }\n\n // Check cache for unloaded image\n $cache = $this->getCache();\n $key = $this->getDimensionCacheKey($container->getHash(), $container->getVariant());\n if ($cache->has($key)) {\n return $cache->get($key);\n }\n\n // Cache-miss\n $resource = $this->getImageResource();\n if ($resource) {\n $result = $this->getResourceDimensions($resource);\n $cache->set($key, $result);\n }\n return $result;\n }", "public function get_size() {\n $query = $this->db->get('size');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }", "function getSize()\n {\n $this->loadStats();\n return $this->stat['size'];\n }", "function getSize()\r\n\t{\r\n\t\treturn $this->size;\r\n\t}", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize() {\n return $this->size;\n }", "public function getTagsSize() {\n \t$user = GetUser();\n $query = \"SELECT COUNT(dct.tagid) AS tagsize FROM [|PREFIX|]dynamic_content_tags dct \";\n if (!$user->isAdmin()) {\n \t$query .= \" WHERE dct.ownerid = '{$user->Get('userid')}' \";\n }\n $result = $this->db->Query ( $query );\n if($row = $this->db->Fetch ( $result )) {\n return $row ['tagsize'];\n }\n return 0;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n\t{\n\t\treturn $this->size;\n\t}", "public function getSize() {\n\n return $this->size;\n\t}", "public function getTotalSize();", "public function get_size()\n\t{\n\t\treturn $this->area->get_size($this->path);\n\t}", "public function getSize() {\n\n return $this->size;\n }", "public function getSize()\n {\n return $this->size;\n }", "public function getSize()\n {\n return $this->fileInfo['size'];\n }", "public function getAllSize(){\n $query = \"SELECT * FROM tbl_size ORDER BY sizeId DESC\";\n $result = $this->db->select($query);\n return $result;\n }", "function getPhotoContext($photo_id){ // No Secret Required\n\n\t\t/* Get Context */\n\t\t$photoContext = $this->askFlickr('photos.getAllContexts','&photo_id='.$photo_id);\n\n\t\t/* Return Photo Sizes */\n\t\treturn $photoContext;\n\t}", "public static function get_sizes( $post_id ) {\n\t\t$sizes = array();\n\n\t\tif ( has_post_thumbnail( $post_id ) ) {\n\t\t\t$post_thumbnail_id = get_post_thumbnail_id( $post_id );\n\t\t\t$sizes = static::get_image_sizes( $post_thumbnail_id );\n\t\t}\n\n\t\treturn $sizes;\n\t}", "protected static function image_sizes() {\n\t\tif ( null === self::$image_sizes ) {\n\t\t\tglobal $_wp_additional_image_sizes;\n\n\t\t\t// Populate an array matching the data structure of $_wp_additional_image_sizes so we have a consistent structure for image sizes.\n\t\t\t$images = [\n\t\t\t\t'thumb' => [\n\t\t\t\t\t'width' => intval( get_option( 'thumbnail_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'thumbnail_size_h' ) ),\n\t\t\t\t\t'crop' => (bool) get_option( 'thumbnail_crop' ),\n\t\t\t\t],\n\t\t\t\t'medium' => [\n\t\t\t\t\t'width' => intval( get_option( 'medium_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'medium_size_h' ) ),\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t\t'medium_large' => [\n\t\t\t\t\t'width' => intval( get_option( 'medium_large_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'medium_large_size_h' ) ),\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t\t'large' => [\n\t\t\t\t\t'width' => intval( get_option( 'large_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'large_size_h' ) ),\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t\t'full' => [\n\t\t\t\t\t'width' => null,\n\t\t\t\t\t'height' => null,\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t];\n\n\t\t\t// Compatibility mapping as found in wp-includes/media.php.\n\t\t\t$images['thumbnail'] = $images['thumb'];\n\n\t\t\t// Update class variable, merging in $_wp_additional_image_sizes if any are set.\n\t\t\tif ( is_array( $_wp_additional_image_sizes ) && ! empty( $_wp_additional_image_sizes ) ) {\n\t\t\t\tself::$image_sizes = array_merge( $images, $_wp_additional_image_sizes );\n\t\t\t} else {\n\t\t\t\tself::$image_sizes = $images;\n\t\t\t}\n\t\t}\n\n\t\treturn is_array( self::$image_sizes ) ? self::$image_sizes : [];\n\t}", "public function sizes(){\n\t\t$meta = ProductMeta::where('product_id', $this->id)->where('meta', 'product_packages_id')->get();\n\t\t$metaGroup = array();\n\t\tif($meta){\n\t\t\tforeach($meta as $each){\n\t\t\t\t$metaGroup[] = $each->value;\n\t\t\t}\n\t\t}\n\t\treturn ProductPackage::find($metaGroup);\n\t}", "function lambert_get_thumbnail_sizes(){\n if( false == lambert_get_option('enable_custom_sizes') ) return;\n $option_sizes = array(\n 'lambert-gallery-one' =>'galmasonry_thumbnail_size_one',\n 'lambert-gallery-second' =>'galmasonry_thumbnail_size_two',\n 'lambert-gallery-three' =>'galmasonry_thumbnail_size_three',\n\n 'lambert-thumb' =>'blog_image_thumb',\n 'lambert-large' =>'blog_image_large_thumb',\n 'member-thumb' =>'team_member_thumb',\n \n );\n\n foreach ($option_sizes as $name => $opt) {\n $option_size = lambert_get_option($opt);\n if($option_size !== false && is_array($option_size)){\n $size_val = array(\n 'width' => (isset($option_size['width']) && !empty($option_size['width']) )? (int)$option_size['width'] : (int)'9999',\n 'height' => (isset($option_size['height']) && !empty($option_size['height']) )? (int)$option_size['height'] : (int)'9999',\n 'hard_crop' => (isset($option_size['hard_crop']) && !empty($option_size['hard_crop']) )? (bool)$option_size['hard_crop'] : (bool)'0',\n );\n\n add_image_size( $name, $size_val['width'], $size_val['height'], $size_val['hard_crop'] );\n }\n }\n }", "public function getMediaSize()\n {\n return $this->mediaSize;\n }", "function add_image_sizes() {\n\t\t$cover_width = 350;\n\t\t$cover_height = 250;\n\t\t$cover_size = UM()->options()->get( 'um_user_photos_cover_size' );\n\t\tif ( $cover_size && trim( $cover_size ) != '' ) {\n\t\t\t$cover_size = strtolower( $cover_size );\n\t\t\t$size = explode( 'x', $cover_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$cover_width = intval( $size[0] );\n\t\t\t\t$cover_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\t\tadd_image_size( 'album_cover', $cover_width, $cover_height, true );\n\n\t\t$photo_width = 250;\n\t\t$photo_height = 250;\n\t\t$photo_size = UM()->options()->get( 'um_user_photos_image_size' );\n\t\tif ( $photo_size && trim( $photo_size ) != '' ) {\n\t\t\t$photo_size = strtolower( $photo_size );\n\t\t\t$size = explode( 'x', $photo_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$photo_width = intval( $size[0] );\n\t\t\t\t$photo_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\n\t\tadd_image_size( 'gallery_image', $photo_width, $photo_height, true );\n\t}", "function getSize() {\n return $this->size;\n }" ]
[ "0.7653366", "0.73743963", "0.7298074", "0.7223539", "0.6959077", "0.6865854", "0.6809796", "0.6726588", "0.6667807", "0.6662396", "0.6577339", "0.65327454", "0.6521323", "0.6433994", "0.64020485", "0.634591", "0.6323199", "0.62496394", "0.62496394", "0.62496394", "0.62496394", "0.62496394", "0.62496394", "0.62496394", "0.62496394", "0.62496394", "0.62388045", "0.6235933", "0.6210893", "0.61926806", "0.61869425", "0.6182784", "0.6179425", "0.61679304", "0.6147695", "0.6144173", "0.6122317", "0.61019987", "0.6089977", "0.60837036", "0.6063987", "0.60227305", "0.60153633", "0.6013762", "0.60003823", "0.5990677", "0.5976895", "0.5965528", "0.59546447", "0.5953879", "0.5951461", "0.59449124", "0.5943634", "0.5943634", "0.5943634", "0.5943634", "0.5943501", "0.59415966", "0.5928739", "0.59266657", "0.59094673", "0.59073156", "0.5895678", "0.5892991", "0.5879528", "0.5846657", "0.58034885", "0.5795909", "0.57681286", "0.5766169", "0.5752228", "0.57514536", "0.57514536", "0.57511413", "0.57511413", "0.57511413", "0.57511413", "0.57511413", "0.57511413", "0.57511413", "0.57511413", "0.57317644", "0.57286566", "0.57282037", "0.5715999", "0.57046497", "0.56964093", "0.5693139", "0.5691301", "0.5689988", "0.5679286", "0.5679013", "0.5672322", "0.5671116", "0.56661373", "0.5654255", "0.56446624", "0.56439435", "0.5642878", "0.56403464" ]
0.7319266
2
Returns the available sizes for a photo with max key.
function photos_getNamedSizes ($photo_id) { $sizes = $this->photos_getSizes($photo_id); if ($sizes) { $namedSizes = array(); foreach ($sizes as $size) { $namedSizes[$size['label']] = $size; } $namedSizes['Max'] = array_pop($sizes); $namedSizes['Max']['label'] = 'Max'; return $namedSizes; } else { return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rest_get_avatar_sizes()\n {\n }", "function getPhotoSizes($photo_id){ // No Secret Required\n\n\t\t/* Get Photo Size */\n\t\t$photoSizes = $this->askFlickr('photos.getSizes','&photo_id='.$photo_id);\n\n\t\t/* Return Photo Sizes */\n\t\treturn $photoSizes;\n\t}", "public static function get_sizes()\n {\n }", "function acf_get_image_sizes()\n{\n}", "function wp_get_list_image_size() {\n\tglobal $_wp_additional_image_sizes;\n\t$sizes = array();\n\tforeach ( get_intermediate_image_sizes() as $_size ) {\n\t\tif ( in_array( $_size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {\n\t\t\t$sizes[] = $_size;\n\t\t} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {\n\t\t\t$sizes[] = $_size;\n\t\t}\n\t}\n\treturn $sizes;\n}", "public function getImageSizes(): array\n {\n /** @var BackendUser $user */\n $user = $this->tokenStorage->getToken()->getUser();\n\n return $this->imageSizes->getOptionsForUser($user);\n }", "private function get_image_sizes() {\n\n\t\treturn array(\n\t\t\t'square_medium' => array( 200, 200 ),\n\t\t\t'full' => array( 1200, 1200 ),\n\t\t);\n\n\t}", "function photos_getSizes ($photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.getSizes', 'photo_id' => $photo_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['sizes']['size'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_image_sizes() {\n global $_wp_additional_image_sizes;\n\n $sizes = [];\n\n $default_sizes = [ 'thumbnail', 'medium', 'medium_large', 'large', 'full' ];\n\n foreach ( get_intermediate_image_sizes() as $size ) {\n if ( in_array( $size, $default_sizes ) ) {\n $sizes[ $size ]['width'] = (int) get_option( \"{$size}_size_w\" );\n $sizes[ $size ]['height'] = (int) get_option( \"{$size}_size_h\" );\n $sizes[ $size ]['crop'] = (bool) get_option( \"{$size}_size_crop\" );\n }\n elseif ( isset( $_wp_additional_image_sizes[ $size ] ) ) {\n $sizes[ $size ] = $_wp_additional_image_sizes[ $size ];\n }\n }\n\n return $sizes;\n }", "function wp_get_additional_image_sizes()\n {\n }", "public function getMaxSize()\n {\n return self::PREVIEW_SIZE;\n }", "public function getImageSizes(): array\n {\n $additionalSizes = wp_get_additional_image_sizes();\n $names = $this->getImageSizesNames();\n\n return array_map(function (string $name) use ($additionalSizes) {\n if (isset($additionalSizes[$name])) {\n return [\n \"name\" => $name,\n \"width\" => $additionalSizes[$name][\"width\"],\n \"height\" => $additionalSizes[$name][\"height\"],\n \"crop\" => $additionalSizes[$name][\"crop\"],\n ];\n }\n \n return [\n \"name\" => $name,\n \"width\" => get_option(\"{$name}_size_w\"),\n \"height\" => get_option(\"{$name}_size_h\"),\n \"crop\" => !!get_option(\"{$name}_crop\"),\n ];\n }, $names);\n }", "private function get_signature_image_height() {\n\t\t$height = FrmField::get_option( $this->field, 'max' );\n\t\treturn $this->get_signature_image_dimension( $height, 'max' );\n\t}", "function get_image_sizes() {\n\tglobal $_wp_additional_image_sizes;\n\n\t$sizes = array();\n\n\tforeach ( get_intermediate_image_sizes() as $_size ) {\n\t\tif ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) {\n\t\t\t$sizes[ $_size ]['width'] = get_option( \"{$_size}_size_w\" );\n\t\t\t$sizes[ $_size ]['height'] = get_option( \"{$_size}_size_h\" );\n\t\t\t$sizes[ $_size ]['crop'] = (bool) get_option( \"{$_size}_crop\" );\n\t\t} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {\n\t\t\t$sizes[ $_size ] = array(\n\t\t\t\t'width' => $_wp_additional_image_sizes[ $_size ]['width'],\n\t\t\t\t'height' => $_wp_additional_image_sizes[ $_size ]['height'],\n\t\t\t\t'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $sizes;\n}", "function wp_get_attachment_image_sizes($attachment_id, $size = 'medium', $image_meta = \\null)\n {\n }", "public function getSizes()\n {\n return $this->sizes;\n }", "function wp_get_registered_image_subsizes()\n {\n }", "function get_intermediate_image_sizes()\n {\n }", "public function getMaxSize(){\n return $this->maxSize;\n }", "function getMaxKeySize()\n {\n return $this->_key_size;\n }", "public function GetMaxSize ();", "protected\n function setImageSizes()\n {\n return config('album.sizes');\n }", "public static function filter_available_sizes() {\n\t\t$sizes = apply_filters( 'image_size_names_choose', array(\n\t\t\t'thumbnail' => __( 'Thumbnail', 'thrive-cb' ),\n\t\t\t'medium' => __( 'Medium', 'thrive-cb' ),\n\t\t\t'large' => __( 'Large', 'thrive-cb' ),\n\t\t\t'full' => __( 'Full size', 'thrive-cb' ),\n\t\t) );\n\n\t\t/* MailPoet 3 adds an extra image size, but we're not using it in our products so we must remove it */\n\t\tif ( ! empty( $sizes['mailpoet_newsletter_max'] ) ) {\n\t\t\tunset ( $sizes['mailpoet_newsletter_max'] );\n\t\t}\n\n\t\treturn $sizes;\n\t}", "public function load_image_sizes() {\n\t\tif ( ! is_file( ARI_JSON_DIR . 'image-sizes.json' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$handle = fopen( ARI_JSON_DIR . 'image-sizes.json', 'r' );\n\t\t$contents = fread( $handle, filesize( ARI_JSON_DIR . 'image-sizes.json' ) );\n\t\tfclose( $handle );\n\n\t\t$result = json_decode( $contents );\n\t\tif ( is_array( $result ) && ! empty( $result ) ) {\n\t\t\t$this->image_sizes = $result;\n\t\t}\n\t}", "protected function determineMaximumGalleryWidth() {}", "private function get_max_files(){\r\n\t\t$md_setttings = get_option('iemop_market_downloads_settings', array());\r\n\t\t$max_files = isset($md_setttings['mr_max_files']) ? $md_setttings['mr_max_files'] : 50;\r\n\t\t\r\n\t\treturn $max_files;\r\n\t}", "public function getMaxSize(): int;", "public function getIconSizeOptions()\n {\n return ArrayLib::valuekey($this->config()->icon_sizes);\n }", "public function getSize()\n {\n return $this->item['size'];\n }", "public function getImageSize()\n\t{\n\t\tlist($width, $height) = getimagesize($this->getFullpath());\n\n\t\treturn compact('width', 'height');\n\t}", "public function getSizes() {\n return $this->_sizes;\n }", "public function get_image_sizes() {\n\t\tif ( ! is_array( $this->image_sizes ) || empty( $this->image_sizes ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->image_sizes;\n\t}", "public function getMaxSize()\r\n {\r\n return $this->max_size;\r\n }", "public function getMaxImageSize()\n\t{\n\t\treturn $this->maxImageSize;\n\t}", "function elk_getimagesize($file, $error = 'array')\n{\n\t$sizes = @getimagesize($file);\n\n\t// Can't get it, what shall we return\n\tif (empty($sizes))\n\t{\n\t\t$sizes = $error === 'array' ? array(-1, -1, -1) : false;\n\t}\n\n\treturn $sizes;\n}", "public function getSizeDetails();", "public function getMaxStorage() {}", "function getpropsize($width, $height, $max)\n{\n\tif ($width <= $max and $height <= $max)\n\t\treturn array($width, $height);\n\t\t\n\t$lager = ($width > $height) ? $width : $height; // сторона, которая длиннее\n\t\n\t$k = $lager / $max; // во сколько раз уменьшить\n\n\t$w = @round($width / $k); // 1%\n\t$h = @round($height / $k); // 1%\n\n\treturn array($w, $h);\n}", "public function get_image_sizes( $wordpress_only = false ) {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_image_sizes( $wordpress_only );\n\n }", "private function _getResizeSize() {\n\t\t$width = $height = 0;\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.0')) {\n\t\t\t$width = Configure::read('GalleryOptions.Pictures.resize_to.0');\n\t\t}\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.1')) {\n\t\t\t$height = Configure::read('GalleryOptions.Pictures.resize_to.1');\n\t\t}\n\n\t\t$crop = Configure::read('GalleryOptions.Pictures.resize_to.2');\n\t\t$action = $crop ? \"crop\" : \"\";\n\n\t\treturn array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'action' => $action\n\t\t);\n\t}", "public function getMaxSize() : int{\n return $this->maxSize;\n }", "public static function getMaxUploadFileSize() {}", "public function getCachedCloudImageSize()\n\t{\n\t\treturn (int) craft()->config->get('maxCachedCloudImageSize');\n\t}", "function lambert_get_thumbnail_sizes(){\n if( false == lambert_get_option('enable_custom_sizes') ) return;\n $option_sizes = array(\n 'lambert-gallery-one' =>'galmasonry_thumbnail_size_one',\n 'lambert-gallery-second' =>'galmasonry_thumbnail_size_two',\n 'lambert-gallery-three' =>'galmasonry_thumbnail_size_three',\n\n 'lambert-thumb' =>'blog_image_thumb',\n 'lambert-large' =>'blog_image_large_thumb',\n 'member-thumb' =>'team_member_thumb',\n \n );\n\n foreach ($option_sizes as $name => $opt) {\n $option_size = lambert_get_option($opt);\n if($option_size !== false && is_array($option_size)){\n $size_val = array(\n 'width' => (isset($option_size['width']) && !empty($option_size['width']) )? (int)$option_size['width'] : (int)'9999',\n 'height' => (isset($option_size['height']) && !empty($option_size['height']) )? (int)$option_size['height'] : (int)'9999',\n 'hard_crop' => (isset($option_size['hard_crop']) && !empty($option_size['hard_crop']) )? (bool)$option_size['hard_crop'] : (bool)'0',\n );\n\n add_image_size( $name, $size_val['width'], $size_val['height'], $size_val['hard_crop'] );\n }\n }\n }", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "function wp_get_missing_image_subsizes($attachment_id)\n {\n }", "function get_image_size_dimensions($size) {\n\t\tglobal $_wp_additional_image_sizes;\n\t\tif (isset($_wp_additional_image_sizes[$size])) {\n\t\t\t$width = intval($_wp_additional_image_sizes[$size]['width']);\n\t\t\t$height = intval($_wp_additional_image_sizes[$size]['height']);\n\t\t} else {\n\t\t\t$width = get_option($size.'_size_w');\n\t\t\t$height = get_option($size.'_size_h');\n\t\t}\n\n\t\tif ( $width && $height ) {\n\t\t\treturn array(\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t} else return false;\n\t}", "private function getAvatarsUploadSize()\n {\n $userId = Auth::user()->id;\n $uploadAmount = Avatar::select('user_id')->where('user_id', $userId)->count();\n return $uploadAmount;\n }", "protected function _getMax()\n {\n $max = 0;\n if (!empty($this->_tagsArray)) {\n $p_size = 0;\n foreach ($this->_tagsArray as $cKey => $cVal) {\n $c_size = $cVal['size'];\n if ($c_size > $p_size) {\n $max = $c_size;\n $p_size = $c_size;\n }\n }\n }\n return $max;\n }", "public function getMaxSize(): int\n {\n return $this->maxSize;\n }", "function getSize() ;", "protected static function image_sizes() {\n\t\tif ( null === self::$image_sizes ) {\n\t\t\tglobal $_wp_additional_image_sizes;\n\n\t\t\t// Populate an array matching the data structure of $_wp_additional_image_sizes so we have a consistent structure for image sizes.\n\t\t\t$images = [\n\t\t\t\t'thumb' => [\n\t\t\t\t\t'width' => intval( get_option( 'thumbnail_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'thumbnail_size_h' ) ),\n\t\t\t\t\t'crop' => (bool) get_option( 'thumbnail_crop' ),\n\t\t\t\t],\n\t\t\t\t'medium' => [\n\t\t\t\t\t'width' => intval( get_option( 'medium_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'medium_size_h' ) ),\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t\t'medium_large' => [\n\t\t\t\t\t'width' => intval( get_option( 'medium_large_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'medium_large_size_h' ) ),\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t\t'large' => [\n\t\t\t\t\t'width' => intval( get_option( 'large_size_w' ) ),\n\t\t\t\t\t'height' => intval( get_option( 'large_size_h' ) ),\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t\t'full' => [\n\t\t\t\t\t'width' => null,\n\t\t\t\t\t'height' => null,\n\t\t\t\t\t'crop' => false,\n\t\t\t\t],\n\t\t\t];\n\n\t\t\t// Compatibility mapping as found in wp-includes/media.php.\n\t\t\t$images['thumbnail'] = $images['thumb'];\n\n\t\t\t// Update class variable, merging in $_wp_additional_image_sizes if any are set.\n\t\t\tif ( is_array( $_wp_additional_image_sizes ) && ! empty( $_wp_additional_image_sizes ) ) {\n\t\t\t\tself::$image_sizes = array_merge( $images, $_wp_additional_image_sizes );\n\t\t\t} else {\n\t\t\t\tself::$image_sizes = $images;\n\t\t\t}\n\t\t}\n\n\t\treturn is_array( self::$image_sizes ) ? self::$image_sizes : [];\n\t}", "protected function getMaxFilesize()\n {\n return UploadedFile::getMaxFilesize();\n }", "private function getImageConfigSizes() : Array\n\t\t{\n\t\t\t$configKeysToFind = ['large.image.size', 'medium.image.size', 'small.image.size'];\n\t\t\t\n\t\t\t$dql = \"SELECT c.name, c.value \n\t\t\t\t\tFROM ReaccionEstudio\\ReaccionCMSBundle\\Entity\\Configuration c\n\t\t\t\t\tWHERE c.name IN (:configKeys)\";\n\n\t\t\t$query = $this->em->createQuery($dql)\n\t\t\t\t\t\t\t\t->setParameter(\"configKeys\", $configKeysToFind);\n\n\t\t\treturn $query->getResult();\n\t\t}", "function get_image_size($name) {\n\t\t$file['site_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['email_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['site_favicon'] = array('width' => '50', 'height' => '50');\n\t\t$file['store_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['footer_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['app_logo'] = array('width' => '140', 'height' => '140');\n\t\t$file['driver_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['driver_white_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['home_slider'] = array('width' => '1300', 'height' => '500');\n\t\t$file['dietary_icon_size'] = array('width' => '256', 'height' => '256');\n\t\t$file['item_image_sizes'] = [\n\t\t\tarray('width' => '120', 'height' => '120'),\n\t\t\tarray('width' => '600', 'height' => '350'),\n\t\t\tarray('width' => '520', 'height' => '320'),\n\t\t];\n\t\t$file['cuisine_image_size'] = array('width' => '260', 'height' => '200');\n\t\t$file['store_image_sizes'] = [\n\t\t\tarray('width' => '520', 'height' => '280'),\n\t\t\tarray('width' => '480', 'height' => '320'),\n\t\t\tarray('width' => '215', 'height' => '215'),\n\t\t\tarray('width' => '100', 'height' => '100'),\n\t\t\tarray('width' => '320', 'height' => '129'),\n\t\t];\n\t\treturn $file[$name];\n\t}", "function getimagesize($filename){\n\t\treturn we_thumbnail::getimagesize($filename);\n\t}", "public static function getAllImageSizes()\n {\n $sizes = array();\n // make thumbnails and other intermediate sizes\n global $_wp_additional_image_sizes;\n\n foreach (get_intermediate_image_sizes() as $s) {\n $sizes[$s] = array('width' => '', 'height' => '', 'crop' => false);\n if (isset($_wp_additional_image_sizes[$s]['width']))\n $sizes[$s]['width'] = intval($_wp_additional_image_sizes[$s]['width']); // For theme-added sizes\n else\n $sizes[$s]['width'] = get_option(\"{$s}_size_w\"); // For default sizes set in options\n if (isset($_wp_additional_image_sizes[$s]['height']))\n $sizes[$s]['height'] = intval($_wp_additional_image_sizes[$s]['height']); // For theme-added sizes\n else\n $sizes[$s]['height'] = get_option(\"{$s}_size_h\"); // For default sizes set in options\n if (isset($_wp_additional_image_sizes[$s]['crop']))\n $sizes[$s]['crop'] = intval($_wp_additional_image_sizes[$s]['crop']); // For theme-added sizes\n else\n $sizes[$s]['crop'] = get_option(\"{$s}_crop\"); // For default sizes set in options\n }\n\n $sizes = apply_filters('intermediate_image_sizes_advanced', $sizes);\n return $sizes;\n }", "public function getMaxSize() {\n return number_format($this->_max / 1024, 1) . ' KB';\n }", "function size()\n\t\t\t{\n\t\t\t\treturn $this->db->order_by('size_id')->get('size');\n\t\t\t}", "public static function getSizes()\n {\n $db = DataBase::connect();\n\n $sortOrder = SIZE_SORT_ORDER ? \"ASC\" : \"DESC\" ;\n $result = $db->query(\"SELECT * FROM `size` ORDER BY `id` {$sortOrder}\");\n\n $sizes = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $sizes[$i]['size'] = $row['size'];\n $sizes[$i]['leonardo_prices'] = $row['leonardo_prices'];\n $sizes[$i]['frodo_prices'] = $row['frodo_prices'];\n $sizes[$i]['back_leg'] = $row['back_leg'];\n $sizes[$i]['image_size'] = $row['image_size'];\n\n $i++;\n }\n return $sizes;\n }", "private function getAllThumbnailSizes(): array\n {\n $connection = $this->container->get('dbal_connection');\n $joinedSizes = $connection\n ->query('SELECT DISTINCT thumbnail_size FROM s_media_album_settings WHERE thumbnail_size != \"\"')\n ->fetchAll(\\PDO::FETCH_COLUMN);\n\n $sizes = [];\n foreach ($joinedSizes as $sizeItem) {\n $explodedSizes = explode(';', $sizeItem);\n if (empty($explodedSizes)) {\n continue;\n }\n\n $sizes = array_merge($sizes, array_flip($explodedSizes));\n }\n\n return array_keys($sizes);\n }", "function _mai_cmb_image_size_config() {\n\t$sizes = genesis_get_image_sizes();\n\t$size_options = array();\n\tforeach ( $sizes as $index => $value ) {\n\t\t$size_options[$index] = sprintf( '%s (%s x %s)', $index, $value['width'], $value['height'] );\n\t}\n\treturn array(\n\t\t'name' => __( 'Image Size:', 'mai-theme-engine' ),\n\t\t'id' => 'image_size',\n\t\t'type' => 'select',\n\t\t'before_field' => __( 'Image Size:', 'mai-theme-engine' ) . ' ',\n\t\t'default' => 'one-third',\n\t\t'options' => $size_options,\n\t);\n}", "public function getThumbsize()\n {\n return $this->_params['thumbsize'];\n }", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "public function getMaxSize() {\n\t\t\treturn $this->maxSize >= 0 ? $this->maxSize : $this->getTotalMaxSize();\n\t\t}", "public function getMaxSize() : int {\n\t\treturn $this->generator->getMaxSize();\n\t}", "public function getImgSize() {\n\t\t$this->imgSize = getimagesize($this->imgUri);\n\t}", "public function getSize() {\n return 8 * (strlen(Util::base64url_decode($this->data['n'])) - 1);\n }", "function getMaxAttachmentSize()\n {\n $size = Misc::return_bytes(ini_get('upload_max_filesize'));\n return Misc::formatFileSize($size);\n }", "public function getSizeLimit() {\n return $this->sizeLimit;\n }", "function getimagesize($filename){\n\t\treturn ($this->isSvg() ? $this->getSvgSize($filename) : we_thumbnail::getimagesize($filename));\n\t}", "public function getMaxSizeInMegabytes()\n {\n return $this->_maxSizeInMegabytes;\n }", "function gigx_get_image_size( $imageSize ) {\n $out = array();\n switch($imageSize) {\n case 'thumbnail':\n $out['width'] = get_option( 'thumbnail_size_w' );\n $out['height'] = get_option( 'thumbnail_size_h' );\n $out['crop'] = get_option( 'thumbnail_crop' );\n break;\n case 'medium':\n $out['width'] = get_option( 'medium_size_w' );\n $out['height'] = get_option( 'medium_size_h' );\n $out['crop'] = false;\n break;\n case 'large':\n $out['width'] = get_option( 'large_size_w' );\n $out['height'] = get_option( 'large_size_h' );\n $out['crop'] = false;\n break;\n default:\n global $_wp_additional_image_sizes;\n if (isset($_wp_additional_image_sizes[$imageSize])) $out = $_wp_additional_image_sizes[$imageSize]; \n }\n\tif (!empty($out)) return $out;\n\telse return false;\n}", "public function getAllSize(){\n $query = \"SELECT * FROM tbl_size ORDER BY sizeId DESC\";\n $result = $this->db->select($query);\n return $result;\n }", "function get_real_size($size=0) {\n if (!$size) {\n return 0;\n }\n $scan['MB'] = 1048576;\n $scan['Mb'] = 1048576;\n $scan['M'] = 1048576;\n $scan['m'] = 1048576;\n $scan['KB'] = 1024;\n $scan['Kb'] = 1024;\n $scan['K'] = 1024;\n $scan['k'] = 1024;\n\n while (list($key) = each($scan)) {\n if ((strlen($size)>strlen($key))&&(substr($size, strlen($size) - strlen($key))==$key)) {\n $size = substr($size, 0, strlen($size) - strlen($key)) * $scan[$key];\n break;\n }\n }\n return $size;\n}", "function getimagesize($filename){\n\t\t$arr = @getimagesize($filename);\n\n\t\tif(isset($arr) && is_array($arr) && (count($arr) >= 4) && $arr[0] && $arr[1]){\n\t\t\treturn $arr;\n\t\t} else {\n\t\t\tif(we_base_imageEdit::gd_version()){\n\t\t\t\treturn we_base_imageEdit::getimagesize($filename);\n\t\t\t}\n\t\t\treturn $arr;\n\t\t}\n\t}", "public function getUsedStorageSize() {\n\t\treturn (int)$this->db->querySingle('SELECT SUM(size) FROM image');\n\t}", "public function getThumbnailHeightAlbumItemImageEdit()\n {\n return $this->thumbnailHeightAlbumItemImageEdit;\n }", "public static function get_registered_image_subsizes() {\n\t\t$sizes = array();\n\n\t\tif ( function_exists( 'wp_get_registered_image_subsizes' ) ) {\n\t\t\t$sizes = wp_get_registered_image_subsizes();\n\t\t} else {\n\t\t\t$additional_sizes = wp_get_additional_image_sizes();\n\n\t\t\tforeach ( get_intermediate_image_sizes() as $size_name ) {\n\t\t\t\t$size_data = array(\n\t\t\t\t\t'width' => 0,\n\t\t\t\t\t'height' => 0,\n\t\t\t\t\t'crop' => false,\n\t\t\t\t);\n\n\t\t\t\tif ( isset( $additional_sizes[ $size_name ]['width'] ) ) {\n\t\t\t\t\t// For sizes added by plugins and themes.\n\t\t\t\t\t$size_data['width'] = intval( $additional_sizes[ $size_name ]['width'] );\n\t\t\t\t} else {\n\t\t\t\t\t// For default sizes set in options.\n\t\t\t\t\t$size_data['width'] = intval( get_option( \"{$size_name}_size_w\" ) );\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $additional_sizes[ $size_name ]['height'] ) ) {\n\t\t\t\t\t$size_data['height'] = intval( $additional_sizes[ $size_name ]['height'] );\n\t\t\t\t} else {\n\t\t\t\t\t$size_data['height'] = intval( get_option( \"{$size_name}_size_h\" ) );\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $size_data['width'] ) && empty( $size_data['height'] ) ) {\n\t\t\t\t\t// This size isn't set.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$sizes[ $size_name ] = $size_data;\n\t\t\t}\n\t\t}\n\n\t\treturn $sizes;\n\t}", "public function getImageSize()\n {\n return $this->ImageSize;\n }", "function image_sizes(){\n //add folder name\n $img_sizes = array();\n $img_sizes['thumbnail'] = array('width'=>150, 'height'=>150, 'folder'=>'/thumb');\n $img_sizes['medium'] = array('width'=>600, 'height'=>600, 'folder'=>'/medium');\n return $img_sizes;\n }", "private function get_max_filesize(){\r\n\t\t$md_setttings = get_option('iemop_market_downloads_settings', array());\r\n\t\t$file_size = isset($md_setttings['mr_filesize']) ? $md_setttings['mr_filesize'] : 5;\r\n\t\t\r\n\t\treturn $file_size;\r\n\t}", "public function getImgMax()\n {\n return $this->_params['imgmax'];\n }", "public function getImageSize()\n {\n return (($this->isWrapped() || $this->isTemp()) ?\n getimagesizefromstring($this->getRaw())\n : getimagesize($this->getPathname())\n );\n }", "function wp_calculate_image_sizes($size, $image_src = \\null, $image_meta = \\null, $attachment_id = 0)\n {\n }", "public function size()\n { \n $props = $this->uri->ruri_to_assoc();\n\n if (!isset($props['o'])) exit(0);\n $w = -1;\n $h = -1;\n $m = 0;\n if (isset($props['w'])) $w = $props['w'];\n if (isset($props['h'])) $h = $props['h'];\n if (isset($props['m'])) $m = $props['m'];\n\n $this->img->set_img($props['o']);\n $this->img->set_size($w, $h, $m);\n $this->img->set_square($m);\n $this->img->get_img();\n }", "function url_image_size($url)\n{\n\t// Can we pull this from the cache... please please?\n\t$temp = array();\n\tif (Cache::instance()->getVar($temp, 'url_image_size-' . md5($url), 3600))\n\t{\n\t\treturn $temp;\n\t}\n\n\t$url_path = parse_url($url, PHP_URL_PATH);\n\t$extension = pathinfo($url_path, PATHINFO_EXTENSION);\n\n\t// Set a RANGE to read\n\tswitch ($extension)\n\t{\n\t\tcase 'jpg':\n\t\tcase 'jpeg':\n\t\t\t// Size location block is variable, so we fetch a meaningful chunk\n\t\t\t$range = 32768;\n\t\t\tbreak;\n\t\tcase 'png':\n\t\t\t// Size will be in the first 24 bytes\n\t\t\t$range = 1024;\n\t\t\tbreak;\n\t\tcase 'gif':\n\t\t\t// Size will be in the first 10 bytes\n\t\t\t$range = 1024;\n\t\t\tbreak;\n\t\tcase 'bmp':\n\t\t\t// Size will be in the first 32 bytes\n\t\t\t$range = 1024;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Read the entire file then, webp for example might have the exif at the end\n\t\t\t$range = 0;\n\t}\n\n\t$image = new FsockFetchWebdata(array('max_length' => $range));\n\t$image->get_url_data($url);\n\n\t// The server may not understand Range: so lets try to fetch the entire thing\n\t// assuming we were not simply turned away\n\tif ($image->result('code') != 200 && $image->result('code') != 403)\n\t{\n\t\t$image = new FsockFetchWebdata(array());\n\t\t$image->get_url_data($url);\n\t}\n\n\t// Here is the data, getimagesizefromstring does not care if its a complete image, it only\n\t// searches for size headers in a given data set.\n\t$data = $image->result('body');\n\t$size = getimagesizefromstring($data);\n\n\t// Well, ok, umm, fail!\n\tif ($data === false || $size === false)\n\t{\n\t\treturn array(-1, -1, -1);\n\t}\n\n\t// Save this for 1hour, its not like the image size is going to change\n\tCache::instance()->put('url_image_size-' . md5($url), $size, 3600);\n\n\treturn $size;\n}", "public function allSizes()\n {\n $sizes = [];\n \n $packs = $this->find()->select('volume')->all();\n\n if (!empty($packs)) {\n foreach ($packs as $pack) {\n $sizes[] = $pack->volume;\n }\n }\n\n return $sizes;\n }", "public function getAllowedMaxFileSize()\n {\n $size = $this->getValidator()->getAllowedMaxFileSize();\n if($size) {\n $sizeMB = $size / 1024 / 1024;\n return $sizeMB;\n }\n }", "function wp_getimagesize($filename, array &$image_info = \\null)\n {\n }", "public function getThumbnailSize() {\n\t\treturn $this->getQueryParam ( self::THUMB_SIZE_PARAM );\n\t}", "function get_real_size($size=0) {\r\n/// Converts numbers like 10M into bytes\r\n if (!$size) {\r\n return 0;\r\n }\r\n $scan['MB'] = 1048576;\r\n $scan['Mb'] = 1048576;\r\n $scan['M'] = 1048576;\r\n $scan['m'] = 1048576;\r\n $scan['KB'] = 1024;\r\n $scan['Kb'] = 1024;\r\n $scan['K'] = 1024;\r\n $scan['k'] = 1024;\r\n\r\n while (list($key) = each($scan)) {\r\n if ((strlen($size)>strlen($key))&&(substr($size, strlen($size) - strlen($key))==$key)) {\r\n $size = substr($size, 0, strlen($size) - strlen($key)) * $scan[$key];\r\n break;\r\n }\r\n }\r\n return $size;\r\n}" ]
[ "0.6862207", "0.67693436", "0.6706297", "0.66856503", "0.65622836", "0.6487654", "0.6444292", "0.64267355", "0.642385", "0.6420045", "0.64161205", "0.6372527", "0.6361224", "0.6302259", "0.62939", "0.62800676", "0.6252385", "0.6223607", "0.62004566", "0.6180967", "0.6180699", "0.6178597", "0.61719495", "0.6146185", "0.6145911", "0.6127987", "0.6126684", "0.6126335", "0.612373", "0.6118192", "0.6106185", "0.60909694", "0.6082402", "0.60812557", "0.60689", "0.6049724", "0.6039372", "0.6036901", "0.60146344", "0.6003921", "0.6002524", "0.5996337", "0.59956217", "0.5993005", "0.5990423", "0.5990423", "0.5990423", "0.5990423", "0.5990423", "0.5990423", "0.5990423", "0.5990423", "0.5990423", "0.59790695", "0.5942477", "0.59413284", "0.5934372", "0.5930824", "0.5920995", "0.5915568", "0.59152937", "0.5900593", "0.5892784", "0.5882631", "0.5870258", "0.58701587", "0.58644515", "0.5863367", "0.5858168", "0.58529854", "0.58487725", "0.58261883", "0.58224404", "0.58204895", "0.58007973", "0.57990086", "0.5796068", "0.57843775", "0.5782921", "0.578029", "0.57787704", "0.5777946", "0.5777322", "0.5772639", "0.5770958", "0.5769716", "0.5768491", "0.57632196", "0.57431066", "0.5739408", "0.5733481", "0.5729626", "0.57286215", "0.5726197", "0.5719572", "0.5715685", "0.5713924", "0.57122797", "0.56987804", "0.5689706" ]
0.6021206
38
Returns a list of your photos with no tags.
function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) { $params = array(); $params['method'] = 'flickr.photos.getUntagged'; $params['per_page'] = $per_page; $params['page'] = $page; if ($min_upload_date) $params['min_upload_date'] = $min_upload_date; if ($max_upload_date) $params['max_upload_date'] = $max_upload_date; if ($min_taken_date) $params['min_taken_date'] = $min_taken_date; if ($max_taken_date) $params['max_taken_date'] = $max_taken_date; if ($privacy_filter) $params['privacy_filter'] = $privacy_filter; if ($media) $params['media'] = $media; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllWithoutFolders()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table)\n ->where('folder_id', '=', 0);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "function get_products_to_show()\n{\n $products = get_products();\n\n foreach ($products as $list_id => $product) {\n if (count($product['images']) == 0) {\n unset($products[$list_id]);\n }\n }\n\n return $products;\n}", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_list_of_non_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 0 ORDER BY date DESC');\n return $result;\n }", "public function getPhotos();", "public function get_noPublishedRecipes() {\n\n $query = $this->db\n ->from('recipes')\n ->where('published', 0)\n ->order_by('created_at', 'DESC')\n ->get();\n\n return $result = $query->result();\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public static function get_unused_images(){\n\n $books = Media::get_unused_images_for_table(CONFIG::DBTables()->book);\n $movies = Media::get_unused_images_for_table(CONFIG::DBTables()->movie);\n $games = Media::get_unused_images_for_table(CONFIG::DBTables()->game);\n $users = Media::get_unused_images_for_table(CONFIG::DBTables()->user);\n\n $images = array(\n \"books\" => $books,\n \"movies\" => $movies,\n \"games\" => $games,\n \"users\" => $users\n );\n\n return $images;\n }", "public function getVotosNegativos()\n {\n return $this->getVotos()->where(['positivo' => false]);\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "function photos_getNotInSet ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = 'all', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getNotInSet';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAllNoPaginate()\n {\n return $this->projectRepo->all();\n }", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function getAllPhotos();", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getNovelties( ) {\n\t $novelties = Product::where('ebook', 0)\n\t ->orderBy('created_at', 'desc')\n\t ->take(6)\n\t ->with('image')\n\t ->with('author')\n\t ->where( 'amount', '>', 0 )\n\t ->get();\n\t return $novelties;\n }", "protected function _getNoPhotoData() {\n\t\treturn $this->_noPhotoData;\n\t}", "public function testGetUserPhotosEmpty()\n {\n $user = factory(\\App\\User::class)->make();\n\n $response = $this->get('/photos');\n\n $response->assertStatus(200);\n }", "public function delete_all_photos() {\r\n return Foto::where('albums_id', '=', $this->id)->delete();\r\n }", "public function emptyQuery()\n {\n return Image::query();\n }", "public function delete_unknown_images() {\n global $wpdb;\n $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image` WHERE gallery_id=0');\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "function get_list_of_not_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 0 AND flaggedfile = 0 ORDER BY date DESC');\n return $result;\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public static function delete_unused_images(){\n\n $deleted_books = Media::delete_unused_images_for_table(CONFIG::DBTables()->book);\n $deleted_movies = Media::delete_unused_images_for_table(CONFIG::DBTables()->movie);\n $deleted_games = Media::delete_unused_images_for_table(CONFIG::DBTables()->game);\n $deleted_users = Media::delete_unused_images_for_table(CONFIG::DBTables()->user);\n\n $deleted_images = array(\n \"books\" => $deleted_books,\n \"movies\" => $deleted_movies,\n \"games\" => $deleted_games,\n \"users\" => $deleted_users\n );\n\n return $deleted_images;\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "function get_all_pics(){\n\t\t$all_pics = $this->db->get('pictures');\n\t\treturn $all_pics->result();\n\t}", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "public function getImages() {\r\n\t\treturn $this->images === NULL ? array() : $this->images;\r\n\t}", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "protected function reset()\n {\n return [\n '<image:image>',\n 'loc' => '',\n 'title' => '',\n 'caption' => '',\n 'geolocation' => '',\n 'license' => '',\n '</image:image>',\n ];\n }", "public function testWithAnyTagsEmpty(): void\n {\n /** @var Collection $models */\n $models = TestModel::withAnyTags('')->get();\n\n self::assertEmpty($models);\n }", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function prune($photos = null)\n {\n if ($photos) {\n $this->addUsingAlias(PhotosPeer::ID, $photos->getId(), Criteria::NOT_EQUAL);\n }\n\n return $this;\n }", "public function testWithAllTagsEmpty(): void\n {\n /** @var Collection $models */\n $models = TestModel::withAllTags('')->get();\n\n self::assertEmpty($models);\n }", "public function getTenLatestPhotos();", "public function get_default_images() {\n $this->load->model('app_images_model');\n $data = array();\n if ($data['default_images'] = $this->app_images_model->fields(array('image', 'location'))->get_all()) {\n if (count($data['default_images']) === 0) {\n return $this->send_error('NO_RESULTS');\n }\n return $this->send_response($data);\n }\n return $this->send_error('ERROR');\n }", "public function getIgnoreItems(): array;", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public static function FindUnusedImages()\n {\n }", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "public function allWithoutTree()\n {\n return HandbookCategory::all();\n }", "public function removeAllTags() {}", "public function all()\n {\n return DogsGallery::where(\"found_by\", null)\n ->get()\n ->map->format();\n }", "public function getPictures() : ?array\n {\n return $this->get('pictures', 'products');\n }", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function removePhoto($value)\n {\n if($value == 'photo0')\n return $this->photo0 = '';\n if($value == 'photo1')\n return $this->photo1='';\n if($value == 'photo2')\n return $this->photo2='';\n if($value == 'photo3')\n return $this->photo3 = '';\n if($value == 'photo4')\n return $this->photo4='';\n if($value == 'photo5')\n return $this->photo5='';\n\n }", "public function images()\n {\n return get_field('images');\n }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function getItemsWithoutCategory() {\n\t\t$items = array();\n\t\t$q = $this->bdd->prepare('SELECT i.* FROM items i\n\t\t\tLEFT OUTER JOIN item_category r ON r.item_id = i.id\n\t\t\tWHERE r.item_id IS NULL\tORDER BY i.id');\n\t\t$q->execute();\n\t\twhile ($data = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$items[] = new Item($data);\n\t\t\t}\n\t\treturn $items;\n\t}", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "public function photos(){\n return $this->morphMany('cms\\Photo', 'imageable');\n }", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getImages() : array\n\t{\n\t\treturn $this->images_list;\n\t}", "public function actionIndex()\n {\n $searchModel = new PhotoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function _remove_default_images( $sizes ) {\n\tforeach ( wp_get_list_image_size() as $image_size ) {\n\t\tif ( $image_size != \"thumbnail\" ) {\n\t\t\tunset ( $sizes[ $image_size ] );\n\t\t}\n\t}\n\n\treturn $sizes;\n}", "public function listMediaTags() {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->tags;\n\t\t$query\t\t= array('tag_status' => '1');\n\t\t$sort\t\t= array('tag_name' => 1);\n\t\t$cursor\t\t= $collection->find($query)->sort($sort);\n\t\t$resultArray= array();\n\t\t\n\t\twhile($cursor->hasNext())\n\t\t{\n\t\t\t$resultArray[]\t= $cursor->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function actionIndex()\n {\n $searchModel = new PictureSearch(['scenario' => 'public']);\n $dataProvider = $searchModel->search(Yii::$app->request->get());\n $dataProvider->query->publicScope();\n $dataProvider->query->andWhere(['not',['incident_id' => 20]]); // Do not show the satellite incidents here\n\n $dataProvider->sort->defaultOrder = ['id' => SORT_DESC,];\n $dataProvider->pagination->pageSize = 20;\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "public function testWithAllNonExistentTags(): void\n {\n /** @var Collection $models */\n $models = TestModel::withAllTags('Apple,Kumquat')->get();\n\n self::assertEmpty($models);\n }", "public function getKidsNovelties( ) {\n\t\t$novelties = Product::where('ebook', 0)\n\t\t ->orderBy('created_at', 'desc')\n\t\t\t\t\t\t\t->where('category_id', 3)\n\t\t ->with('image')\n\t\t\t\t\t\t\t->where( 'amount', '>', 0 )\n\t\t\t\t\t\t\t->get();\n\t\treturn $novelties;\n\t}", "function fumseck_exclude_image_posts( $query ) {\n\tif ( $query->is_main_query() && $query->is_home() ) {\n\t\t$feip_query = array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'post_format',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => array(\n\t\t\t\t\t'post-format-image'\n\t\t\t\t),\n\t\t\t\t'operator' => 'NOT IN',\n\t\t\t)\n\t\t);\n\t\t$query->set( 'tax_query', $feip_query );\n\t}\n}", "public function headshots()\n {\n $compositeKey = [\n 'ezt_user_id' => $this->ezt_user_id,\n 'image_type' => 2\n ];\n\n return Image::where($compositeKey)->get();\n }", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public static function getNotSubscribedProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'not-subscribed');\n\n\t}", "public function getAllNoneGuestDevices()\n {\n $sql = \"SELECT * FROM `devices` LEFT JOIN users ON (devices.user_id = users.user_id) WHERE users.user_id != 1\";\n\t$query = mysqli_query($this->db_connection, $sql) or trigger_error(mysql_error().\" \".$sql);\n\t$result_data_array = array();\n\twhile($row = mysqli_fetch_assoc($query))\n\t{\n $result_data_array[] = $row;\n }\n return $result_data_array;\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public static function unwatchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 0)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "public function getOfficeImages()\n {\n $officeImages = OfficeImage::select('image')->inRandomOrder()->take(5)->get();\n if($officeImages->count()) {\n return $officeImages;\n }\n\n return false;\n }", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function getImages() {\n\t\treturn($this->images);\n\t}", "public function getImages()\r\n {\r\n return $this->images;\r\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public static function clearImages()\n {\n $session = self::getSession();\n unset($session->ids);\n }", "public function photos()\n {\n return $this->hasMany(Photo::class, 'album_id', 'id');\n }", "public function findWithoutAllTags($tags, $sort = array(), $limit = 0, $page = 0)\n {\n $mongoIds = $this->getMongoIds($tags);\n $qb = $this->createStandardQueryBuilder()->field('tags._id')->notIn($mongoIds);\n\n $qb = $this->addSortAndLimitToQueryBuilder($qb, $sort, $limit, $page);\n\n return $qb->getQuery()->execute();\n }", "private static function get_unused_images_for_table($table)\n {\n $images = array();\n\n /* Get media images in database */\n $media_images = Media::get_media_images($table);\n\n /* Get media images currently stored */\n if ($table === Config::DBTables()->user){\n $path = FileService::MAIN_DIR . \"/users\";\n $files = array_diff(scandir($path), array('.', '..'));\n $images = Media::add_unused_images_to_array($images, $media_images, $files, $path);\n }else{\n $users = array_diff(scandir(FileService::MAIN_DIR), array('.', '..'));\n foreach($users as $username){\n if ($username !== \"users\"){\n $user_path = FileService::MAIN_DIR . \"/\" . $username . \"/\" . $table . \"s\";\n $files = array_diff(scandir($user_path), array('.', '..'));\n $images = Media::add_unused_images_to_array($images, $media_images, $files, $user_path);\n }\n }\n }\n return $images;\n }", "public function photos( $tag, $count = null, $order = null )\n {\n $tag = Tag::with( $this->eagerLoad )->where( 'slug', '=', $tag )->firstOrFail();\n\n if ( $order === null ) {\n list( $orderCol, $orderBy ) = $this->defaultOrder;\n } else {\n list( $orderCol, $orderBy ) = $order;\n }\n\n return $tag->photos()\n ->orderBy( $orderCol, $orderBy )\n ->paginate( $this->perPage( $count ) );\n }", "private function get_unattached_ids() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col(\"SELECT `ID` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' AND `post_parent` = '0'\");\n\t}" ]
[ "0.7284759", "0.6756636", "0.6494362", "0.6389345", "0.619795", "0.6197265", "0.61875093", "0.6183084", "0.61588585", "0.6128163", "0.61215395", "0.61199445", "0.6110181", "0.61087674", "0.5993303", "0.5970716", "0.59406793", "0.59306616", "0.59282225", "0.58693075", "0.58691496", "0.581526", "0.57867527", "0.57765275", "0.5744138", "0.5714762", "0.57074344", "0.567724", "0.5668563", "0.56605834", "0.5656179", "0.5648863", "0.5630864", "0.5621107", "0.5607985", "0.5599771", "0.5590514", "0.55850065", "0.5561481", "0.5515014", "0.55017495", "0.54968977", "0.5494418", "0.54922336", "0.5487787", "0.5466974", "0.5466023", "0.5458514", "0.54568523", "0.5454138", "0.5454045", "0.54524356", "0.54323405", "0.54152656", "0.5411457", "0.5408121", "0.54075575", "0.53975874", "0.53578603", "0.5356383", "0.53206277", "0.53202116", "0.52745223", "0.5273652", "0.52647257", "0.5263242", "0.5263006", "0.5262853", "0.5246979", "0.52396685", "0.5231461", "0.52311", "0.5230785", "0.5230733", "0.52172595", "0.5210935", "0.5208073", "0.52059376", "0.51977456", "0.5194431", "0.51915264", "0.51766914", "0.5171721", "0.5170975", "0.5165807", "0.5158558", "0.5154271", "0.5150281", "0.51491034", "0.5147025", "0.51308846", "0.5111429", "0.51070833", "0.51066756", "0.51012695", "0.5099818", "0.50935256", "0.50930744", "0.5089598", "0.5088261" ]
0.6330918
4
Returns a list of your geotagged photos.
function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) { $params = array(); $params['method'] = 'flickr.photos.getWithGeoData'; $params['per_page'] = $per_page; $params['page'] = $page; if ($min_upload_date) $params['min_upload_date'] = $min_upload_date; if ($max_upload_date) $params['max_upload_date'] = $max_upload_date; if ($min_taken_date) $params['min_taken_date'] = $min_taken_date; if ($max_taken_date) $params['max_taken_date'] = $max_taken_date; if ($privacy_filter) $params['privacy_filter'] = $privacy_filter; if ($media) $params['media'] = $media; if ($extras) $params['extras'] = $extras; if ($sort) $params['sort'] = $sort; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotos();", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getAllPhotos();", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "function rusticmodern_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( 'get_post_galleries' ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0]['ids'] ) )\n\t\t \t$images = explode( ',', $galleries[0]['ids'] );\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( \"/$pattern/s\", get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts['ids'] ) )\n\t\t\t$images = explode( ',', $atts['ids'] );\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'numberposts' => 999,\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'menu_order',\n\t\t\t'post_mime_type' => 'image',\n\t\t\t'post_parent' => get_the_ID(),\n\t\t\t'post_type' => 'attachment',\n\t\t) );\n\t}\n\n\treturn $images;\n}", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "function twentyten_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( 'get_post_galleries' ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0]['ids'] ) ) {\n\t\t\t$images = explode( ',', $galleries[0]['ids'] );\n\t\t}\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( \"/$pattern/s\", get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts['ids'] ) ) {\n\t\t\t$images = explode( ',', $atts['ids'] );\n\t\t}\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts(\n\t\t\tarray(\n\t\t\t\t'fields' => 'ids',\n\t\t\t\t'numberposts' => 999,\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'orderby' => 'menu_order',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'post_parent' => get_the_ID(),\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t)\n\t\t);\n\t}\n\n\treturn $images;\n}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function listImages()\n {\n $images = $this->docker(\"images --format '\\\"{{.Repository}}:{{.Tag}}\\\"' --filter=reference='*' | jq -r\");\n\n $image = explode(\"\\n\", substr($images, 0, -1));\n\n return $image;\n }", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function galleries(){\n\n $parameters = [\n 'sort' => 'position',\n 'sort_direction' => 'asc',\n 'page' => 1,\n 'cover_size' => 4,\n 'rpp' => 40\n ];\n\n $data = $this->api->get_galleries($parameters);\n\n return $data['galleries'];\n }", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function getImages() : array\n\t{\n\t\treturn $this->images_list;\n\t}", "public function listGall()\n {\n $gall = Gallery::latest()->get();\n return view('gallery.list', compact('gall'));\n }", "public function all()\n {\n return DogsGallery::where(\"found_by\", null)\n ->get()\n ->map->format();\n }", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function photos()\n {\n return $this->hasMany('App\\Entities\\QuoteOptionHotelRoomPhoto', 'quote_option_room_id', 'quote_option_room_id');\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "function get_hotel_pictures($hotel_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('hotel_id',$hotel_id);\n\t\t$query=$this->db->get('sb_hotel_album');\n\t\treturn $query->result_array();\n\t}", "public function images()\n {\n return get_field('images');\n }", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos( $tag, $count = null, $order = null )\n {\n $tag = Tag::with( $this->eagerLoad )->where( 'slug', '=', $tag )->firstOrFail();\n\n if ( $order === null ) {\n list( $orderCol, $orderBy ) = $this->defaultOrder;\n } else {\n list( $orderCol, $orderBy ) = $order;\n }\n\n return $tag->photos()\n ->orderBy( $orderCol, $orderBy )\n ->paginate( $this->perPage( $count ) );\n }", "function buildHtmlPhotos($data) {\r\n $photos = null;\r\n foreach ($data as $photo) {\r\n $image = '<img src=\"' . $photo['square_image_url'] .'\" title=\"' . $photo['title'] . '\" alt=\"' . $photo['title'] .'\" />';\r\n $photos .= '<div class=\"image-container\"><div class=\"image\">' . '<a href=\"/view-photo/' . $photo['id'] . '\" target=\"_blank\">' . $image . '</a></div></div>';\r\n }\r\n return $photos;\r\n }", "public function listMediaTags() {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->tags;\n\t\t$query\t\t= array('tag_status' => '1');\n\t\t$sort\t\t= array('tag_name' => 1);\n\t\t$cursor\t\t= $collection->find($query)->sort($sort);\n\t\t$resultArray= array();\n\t\t\n\t\twhile($cursor->hasNext())\n\t\t{\n\t\t\t$resultArray[]\t= $cursor->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "public function getImages()\r\n {\r\n return $this->images;\r\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function photographCollections()\n {\n return $this->hasMany(PhotographCollection::class)->orderBy('title', 'asc');\n }", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "public function get_images(){\n\t\treturn $this->images;\n\t}", "public function getImages(){\n return $this->images;\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function get_all_gallery_images() {\n\n\t\tcheck_ajax_referer( 'daylife-gallery-add-nonce', 'nonce' );\n\t\trequire_once( dirname( __FILE__ ) . '/class-wp-daylife-api.php' );\n\t\t$daylife = new WP_Daylife_API( get_option( 'daylife' ) );\n\n\t\t// Should be int but santize value as id can be bigger than maximum int value\n\t\t$gallery_id = sanitize_text_field( $_POST['gallery_id'] );\n\t\tif ( $gallery_id > 0 ) {\n\t\t\t$args['gallery_id'] = $gallery_id;\n\n\t\t\t$images = $daylife->get_gallery_by_id( $args );\n\n\t\t\tforeach ( $images as $image ) {\n\t\t\t\t$image_data[] = $image->url . '|' . $image->caption;\n\t\t\t}\n\t\t\techo json_encode( $image_data );\n\t\t}\n\t\tdie;\n\n\t}", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "public function tagSearch($search){\n\n $images = [];\n\n /* @var IConnector $connector */\n foreach($this->connectors as $key => $connector) {\n $images = array_merge($images, $connector->tagSearch($search));\n }\n\n return $images;\n }", "function get_post_gallery_imges($item_id){\n\t$images = array(); \n\t$args = array( \n\t\t'post_type' => 'attachment', \n\t\t'posts_per_page' => -1, \n\t\t'post_status' =>'any', \n\t\t'post_parent' => $item_id, \n\t\t'exclude' => get_post_thumbnail_id($item_id) \n\t);\n\t\n\t/* echo '<pre>'; print_r($args); echo '</pre>'; */\n\t\n\t$attachments = get_posts( $args );\n\t\t\n\t\n\tif ( $attachments ) {\n\t\t$x = 1;\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\t$images[$x] = wp_get_attachment_url( $attachment->ID );\n\t\t\t$x = $x + 1;\n\t\t}\n\t}\n\t\n\t/* echo '<pre>'; print_r($images); echo '</pre>'; */\n\treturn $images;\n}", "public function photos()\n {\n return $this->hasMany(Photo::class, 'album_id', 'id');\n }", "public function photographs()\n {\n return $this->hasMany('App\\Photograph');\n }", "public function getGallery()\n {\n return $this->getItems()->getItems()->andWhere(['type' => 'gallery']);\n\n }", "public static function searchGalleryPics($keyword) {\n\t\n\t\t$data = Doctrine_Query::create()->select('g.title as name')\n\t\t->from(\"Gallery g\")\n\t\t->where('g.deleted = 0')\n\t\t->andWhere(\"g.title LIKE ?\", \"%$keyword%\")\n\t\t->orderBy(\"g.title ASC\")\n\t\t->limit(5)\n\t\t->fetchArray();\n\t\treturn $data;\n\t}", "function lc_grab_ids_from_gallery()\n{\n global $post;\n\n if ($post instanceof WP_Post === false) {\n return array();\n }\n\n $pattern = get_shortcode_regex();\n $ids = array();\n\n if (preg_match_all('/' . $pattern . '/s', $post->post_content, $matches)) { //finds the \"gallery\" shortcode and puts the image ids in an associative array at $matches[3]\n\n $count = count($matches[3]); //in case there is more than one gallery in the post.\n for ($i = 0; $i < $count; $i++) {\n $atts = shortcode_parse_atts($matches[3][$i]);\n if (isset($atts['ids'])) {\n $ids = array_merge($ids, explode(',', $atts['ids']));\n }\n }\n }\n return $ids;\n}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function photos()\n {\n return $this->hasMany(Photo::class, 'photo_album_id');\n }", "function get_all_pics(){\n\t\t$all_pics = $this->db->get('pictures');\n\t\treturn $all_pics->result();\n\t}", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getImages() {\n\t\treturn($this->images);\n\t}", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function images()\n {\n // Fetch all properties existing in the database\n $image = Image::all();\n\n // return list of properties;\n return $image;\n\n }", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "public function getPictures() : ?array\n {\n return $this->get('pictures', 'products');\n }", "public function lists_photo(Request $request) {\n $widget = Widget::find($request['id']);\n $total = substr_count($widget->image, ',');\n $json = array();\n if ($widget->image != \"\") {\n for ($i = 1; $i <= substr_count($widget->image, ','); $i++) {\n $imagen = explode(',', $widget->image);\n $json[] = array('nombre' => $imagen[$i]);\n }\n }\n return response()->json($json);\n }", "public function getImages()\n {\n return $this->hasMany(self::class, ['file_id' => 'file_id']);\n }", "public function getImages() {\n if (empty($this->_images) && $this->getImgs()) {\n $images = json_decode($this->getImgs(), true);\n uasort($images, function($a, $b) {\n if (!isset($a['ordering'])) {\n $a['ordering'] = 0;\n }\n\n if (!isset($b['ordering'])) {\n $b['ordering'] = 0;\n }\n\n if ($a['ordering'] == @$b['ordering']) {\n return 0;\n }\n return ($a['ordering'] < $b['ordering']) ? -1 : 1;\n });\n $this->_images = $images;\n }\n\n return $this->_images;\n }", "function getpexelsimages($arr_data)\n{\n require_once INCLUDES_DIR .'/api.php';\n $class = new RFI\\API\\API();\n $arr_pexels = json_decode($class->pexels($arr_data));\n $arr_pex=[];\n if (isset($arr_pexels->photos) && !empty($arr_pexels->photos)) {\n foreach ($arr_pexels->photos as $data) {\n $arr_pex[] = array(\n 'imageurl' => $data->src->large2x,\n 'imageurlsmall' => $data->src->medium,\n 'username' => $data->photographer,\n 'landing' => $data->url,\n 'userimage' => 'https://cdn.pixabay.com/photo/2017/07/18/23/23/user-2517433_960_720.png',\n 'credit' => 'pexels', \n 'userlink' => $data->photographer_url \n );\n }\n }\n return $arr_pex;\n}", "public function getAvatarList(){\n return $this->_get(5);\n }", "public function getImages($tagID)\n\t{\t\t\n\t\treturn Tag::find($tagID)->images;\n\t}", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "public function images()\n {\n return $this->HasMany('App\\Models\\Properties\\Image')->orderBy('index', 'asc');\n }", "public function getPhotos($id)\n {\n $gallery = Gallery::with('photos')->find($id);\n\n $photos = $gallery->photos;\n\n $photoarr = [];\n\n foreach($photos as $photo) {\n $photoarr[] = [\n 'server' => $photo->filename,\n 'size' => app('files')->size(public_path('uploads/photos/' . $photo->filename)),\n 'imageurl' => asset('uploads/photos/thumbs/' . $photo->filename)\n ];\n }\n return response()->json([\n 'photos' => $photoarr\n ]);\n }", "function show_images() {\n global $app;\n $images = new entities\\Image();\n $cursor = $images->getRange($app, 0);\n $posts = array();\n \n foreach ($cursor->toArray() as $post) {\n $posts[] = $post;\n }\n return $app['twig']->render('admin/admin_images.twig', array('images' => $posts));\n}", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "public function photos(){\n return $this->morphMany('cms\\Photo', 'imageable');\n }", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "public function photos() {\n return $this->hasMany('\\P4\\Photo');\n }", "public function imagenes() {\n return $imagenes = ImagenesProducto::where('fk_producto',$this->codigo) -> orderBy('featured','desc') -> get(); //para mostrar las imagenes ordenadas por las destacada\n }", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "public function getTenLatestPhotos();" ]
[ "0.7193251", "0.70301586", "0.6952698", "0.6902225", "0.68915963", "0.6787347", "0.67850775", "0.664902", "0.64323556", "0.64234453", "0.6420629", "0.6374221", "0.63680685", "0.6353996", "0.6319391", "0.63019764", "0.6276599", "0.6275402", "0.6255003", "0.6210964", "0.6205576", "0.6165771", "0.6151869", "0.6148146", "0.6134911", "0.61294365", "0.6129263", "0.6120675", "0.6117917", "0.61117834", "0.6110442", "0.60990816", "0.60905427", "0.6079085", "0.6077622", "0.6064599", "0.6054635", "0.60530484", "0.60284543", "0.60270804", "0.6012011", "0.5979351", "0.5970697", "0.5952876", "0.59359163", "0.59289765", "0.5920385", "0.5908303", "0.59032696", "0.58970886", "0.5881939", "0.58801496", "0.58794624", "0.5878684", "0.58755416", "0.586675", "0.5860274", "0.5850256", "0.5850256", "0.5850256", "0.5850256", "0.5850256", "0.5850256", "0.5840157", "0.5831799", "0.58311003", "0.58094084", "0.57933104", "0.5785254", "0.5782417", "0.57807153", "0.57657164", "0.5763905", "0.57555777", "0.5750899", "0.57500297", "0.57401955", "0.57352036", "0.5729074", "0.57255334", "0.57207185", "0.5709328", "0.5708547", "0.56966895", "0.56960624", "0.569456", "0.56941795", "0.56927955", "0.5684555", "0.5680416", "0.5677955", "0.56731206", "0.5671817", "0.56645364", "0.56611556", "0.56599665", "0.5654489", "0.5644273", "0.5643796", "0.5631592" ]
0.5708514
83
Returns a list of your geotagged photos.
function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) { $params = array(); $params['method'] = 'flickr.photos.getWithoutGeoData'; $params['per_page'] = $per_page; $params['page'] = $page; if ($min_upload_date) $params['min_upload_date'] = $min_upload_date; if ($max_upload_date) $params['max_upload_date'] = $max_upload_date; if ($min_taken_date) $params['min_taken_date'] = $min_taken_date; if ($max_taken_date) $params['max_taken_date'] = $max_taken_date; if ($privacy_filter) $params['privacy_filter'] = $privacy_filter; if ($media) $params['media'] = $media; if ($extras) $params['extras'] = $extras; if ($sort) $params['sort'] = $sort; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotos();", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getAllPhotos();", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "function rusticmodern_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( 'get_post_galleries' ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0]['ids'] ) )\n\t\t \t$images = explode( ',', $galleries[0]['ids'] );\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( \"/$pattern/s\", get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts['ids'] ) )\n\t\t\t$images = explode( ',', $atts['ids'] );\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts( array(\n\t\t\t'fields' => 'ids',\n\t\t\t'numberposts' => 999,\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'menu_order',\n\t\t\t'post_mime_type' => 'image',\n\t\t\t'post_parent' => get_the_ID(),\n\t\t\t'post_type' => 'attachment',\n\t\t) );\n\t}\n\n\treturn $images;\n}", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "function twentyten_get_gallery_images() {\n\t$images = array();\n\n\tif ( function_exists( 'get_post_galleries' ) ) {\n\t\t$galleries = get_post_galleries( get_the_ID(), false );\n\t\tif ( isset( $galleries[0]['ids'] ) ) {\n\t\t\t$images = explode( ',', $galleries[0]['ids'] );\n\t\t}\n\t} else {\n\t\t$pattern = get_shortcode_regex();\n\t\tpreg_match( \"/$pattern/s\", get_the_content(), $match );\n\t\t$atts = shortcode_parse_atts( $match[3] );\n\t\tif ( isset( $atts['ids'] ) ) {\n\t\t\t$images = explode( ',', $atts['ids'] );\n\t\t}\n\t}\n\n\tif ( ! $images ) {\n\t\t$images = get_posts(\n\t\t\tarray(\n\t\t\t\t'fields' => 'ids',\n\t\t\t\t'numberposts' => 999,\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'orderby' => 'menu_order',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'post_parent' => get_the_ID(),\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t)\n\t\t);\n\t}\n\n\treturn $images;\n}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function listImages()\n {\n $images = $this->docker(\"images --format '\\\"{{.Repository}}:{{.Tag}}\\\"' --filter=reference='*' | jq -r\");\n\n $image = explode(\"\\n\", substr($images, 0, -1));\n\n return $image;\n }", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function galleries(){\n\n $parameters = [\n 'sort' => 'position',\n 'sort_direction' => 'asc',\n 'page' => 1,\n 'cover_size' => 4,\n 'rpp' => 40\n ];\n\n $data = $this->api->get_galleries($parameters);\n\n return $data['galleries'];\n }", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function getImages() : array\n\t{\n\t\treturn $this->images_list;\n\t}", "public function listGall()\n {\n $gall = Gallery::latest()->get();\n return view('gallery.list', compact('gall'));\n }", "public function all()\n {\n return DogsGallery::where(\"found_by\", null)\n ->get()\n ->map->format();\n }", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function photos()\n {\n return $this->hasMany('App\\Entities\\QuoteOptionHotelRoomPhoto', 'quote_option_room_id', 'quote_option_room_id');\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "function get_hotel_pictures($hotel_id)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->where('hotel_id',$hotel_id);\n\t\t$query=$this->db->get('sb_hotel_album');\n\t\treturn $query->result_array();\n\t}", "public function images()\n {\n return get_field('images');\n }", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos( $tag, $count = null, $order = null )\n {\n $tag = Tag::with( $this->eagerLoad )->where( 'slug', '=', $tag )->firstOrFail();\n\n if ( $order === null ) {\n list( $orderCol, $orderBy ) = $this->defaultOrder;\n } else {\n list( $orderCol, $orderBy ) = $order;\n }\n\n return $tag->photos()\n ->orderBy( $orderCol, $orderBy )\n ->paginate( $this->perPage( $count ) );\n }", "function buildHtmlPhotos($data) {\r\n $photos = null;\r\n foreach ($data as $photo) {\r\n $image = '<img src=\"' . $photo['square_image_url'] .'\" title=\"' . $photo['title'] . '\" alt=\"' . $photo['title'] .'\" />';\r\n $photos .= '<div class=\"image-container\"><div class=\"image\">' . '<a href=\"/view-photo/' . $photo['id'] . '\" target=\"_blank\">' . $image . '</a></div></div>';\r\n }\r\n return $photos;\r\n }", "public function listMediaTags() {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->tags;\n\t\t$query\t\t= array('tag_status' => '1');\n\t\t$sort\t\t= array('tag_name' => 1);\n\t\t$cursor\t\t= $collection->find($query)->sort($sort);\n\t\t$resultArray= array();\n\t\t\n\t\twhile($cursor->hasNext())\n\t\t{\n\t\t\t$resultArray[]\t= $cursor->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function getImages()\r\n {\r\n return $this->images;\r\n }", "public function photographCollections()\n {\n return $this->hasMany(PhotographCollection::class)->orderBy('title', 'asc');\n }", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "public function get_images(){\n\t\treturn $this->images;\n\t}", "public function getImages(){\n return $this->images;\n }", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function get_all_gallery_images() {\n\n\t\tcheck_ajax_referer( 'daylife-gallery-add-nonce', 'nonce' );\n\t\trequire_once( dirname( __FILE__ ) . '/class-wp-daylife-api.php' );\n\t\t$daylife = new WP_Daylife_API( get_option( 'daylife' ) );\n\n\t\t// Should be int but santize value as id can be bigger than maximum int value\n\t\t$gallery_id = sanitize_text_field( $_POST['gallery_id'] );\n\t\tif ( $gallery_id > 0 ) {\n\t\t\t$args['gallery_id'] = $gallery_id;\n\n\t\t\t$images = $daylife->get_gallery_by_id( $args );\n\n\t\t\tforeach ( $images as $image ) {\n\t\t\t\t$image_data[] = $image->url . '|' . $image->caption;\n\t\t\t}\n\t\t\techo json_encode( $image_data );\n\t\t}\n\t\tdie;\n\n\t}", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "public function tagSearch($search){\n\n $images = [];\n\n /* @var IConnector $connector */\n foreach($this->connectors as $key => $connector) {\n $images = array_merge($images, $connector->tagSearch($search));\n }\n\n return $images;\n }", "function get_post_gallery_imges($item_id){\n\t$images = array(); \n\t$args = array( \n\t\t'post_type' => 'attachment', \n\t\t'posts_per_page' => -1, \n\t\t'post_status' =>'any', \n\t\t'post_parent' => $item_id, \n\t\t'exclude' => get_post_thumbnail_id($item_id) \n\t);\n\t\n\t/* echo '<pre>'; print_r($args); echo '</pre>'; */\n\t\n\t$attachments = get_posts( $args );\n\t\t\n\t\n\tif ( $attachments ) {\n\t\t$x = 1;\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\t$images[$x] = wp_get_attachment_url( $attachment->ID );\n\t\t\t$x = $x + 1;\n\t\t}\n\t}\n\t\n\t/* echo '<pre>'; print_r($images); echo '</pre>'; */\n\treturn $images;\n}", "public function photos()\n {\n return $this->hasMany(Photo::class, 'album_id', 'id');\n }", "public function photographs()\n {\n return $this->hasMany('App\\Photograph');\n }", "public function getGallery()\n {\n return $this->getItems()->getItems()->andWhere(['type' => 'gallery']);\n\n }", "public static function searchGalleryPics($keyword) {\n\t\n\t\t$data = Doctrine_Query::create()->select('g.title as name')\n\t\t->from(\"Gallery g\")\n\t\t->where('g.deleted = 0')\n\t\t->andWhere(\"g.title LIKE ?\", \"%$keyword%\")\n\t\t->orderBy(\"g.title ASC\")\n\t\t->limit(5)\n\t\t->fetchArray();\n\t\treturn $data;\n\t}", "function lc_grab_ids_from_gallery()\n{\n global $post;\n\n if ($post instanceof WP_Post === false) {\n return array();\n }\n\n $pattern = get_shortcode_regex();\n $ids = array();\n\n if (preg_match_all('/' . $pattern . '/s', $post->post_content, $matches)) { //finds the \"gallery\" shortcode and puts the image ids in an associative array at $matches[3]\n\n $count = count($matches[3]); //in case there is more than one gallery in the post.\n for ($i = 0; $i < $count; $i++) {\n $atts = shortcode_parse_atts($matches[3][$i]);\n if (isset($atts['ids'])) {\n $ids = array_merge($ids, explode(',', $atts['ids']));\n }\n }\n }\n return $ids;\n}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function photos()\n {\n return $this->hasMany(Photo::class, 'photo_album_id');\n }", "function get_all_pics(){\n\t\t$all_pics = $this->db->get('pictures');\n\t\treturn $all_pics->result();\n\t}", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getImages() {\n\t\treturn($this->images);\n\t}", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function images()\n {\n // Fetch all properties existing in the database\n $image = Image::all();\n\n // return list of properties;\n return $image;\n\n }", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "public function getPictures() : ?array\n {\n return $this->get('pictures', 'products');\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getImages()\n {\n return $this->hasMany(self::class, ['file_id' => 'file_id']);\n }", "public function lists_photo(Request $request) {\n $widget = Widget::find($request['id']);\n $total = substr_count($widget->image, ',');\n $json = array();\n if ($widget->image != \"\") {\n for ($i = 1; $i <= substr_count($widget->image, ','); $i++) {\n $imagen = explode(',', $widget->image);\n $json[] = array('nombre' => $imagen[$i]);\n }\n }\n return response()->json($json);\n }", "public function getImages() {\n if (empty($this->_images) && $this->getImgs()) {\n $images = json_decode($this->getImgs(), true);\n uasort($images, function($a, $b) {\n if (!isset($a['ordering'])) {\n $a['ordering'] = 0;\n }\n\n if (!isset($b['ordering'])) {\n $b['ordering'] = 0;\n }\n\n if ($a['ordering'] == @$b['ordering']) {\n return 0;\n }\n return ($a['ordering'] < $b['ordering']) ? -1 : 1;\n });\n $this->_images = $images;\n }\n\n return $this->_images;\n }", "function getpexelsimages($arr_data)\n{\n require_once INCLUDES_DIR .'/api.php';\n $class = new RFI\\API\\API();\n $arr_pexels = json_decode($class->pexels($arr_data));\n $arr_pex=[];\n if (isset($arr_pexels->photos) && !empty($arr_pexels->photos)) {\n foreach ($arr_pexels->photos as $data) {\n $arr_pex[] = array(\n 'imageurl' => $data->src->large2x,\n 'imageurlsmall' => $data->src->medium,\n 'username' => $data->photographer,\n 'landing' => $data->url,\n 'userimage' => 'https://cdn.pixabay.com/photo/2017/07/18/23/23/user-2517433_960_720.png',\n 'credit' => 'pexels', \n 'userlink' => $data->photographer_url \n );\n }\n }\n return $arr_pex;\n}", "public function getAvatarList(){\n return $this->_get(5);\n }", "public function getImages($tagID)\n\t{\t\t\n\t\treturn Tag::find($tagID)->images;\n\t}", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "public function images()\n {\n return $this->HasMany('App\\Models\\Properties\\Image')->orderBy('index', 'asc');\n }", "public function getPhotos($id)\n {\n $gallery = Gallery::with('photos')->find($id);\n\n $photos = $gallery->photos;\n\n $photoarr = [];\n\n foreach($photos as $photo) {\n $photoarr[] = [\n 'server' => $photo->filename,\n 'size' => app('files')->size(public_path('uploads/photos/' . $photo->filename)),\n 'imageurl' => asset('uploads/photos/thumbs/' . $photo->filename)\n ];\n }\n return response()->json([\n 'photos' => $photoarr\n ]);\n }", "function show_images() {\n global $app;\n $images = new entities\\Image();\n $cursor = $images->getRange($app, 0);\n $posts = array();\n \n foreach ($cursor->toArray() as $post) {\n $posts[] = $post;\n }\n return $app['twig']->render('admin/admin_images.twig', array('images' => $posts));\n}", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "public function photos(){\n return $this->morphMany('cms\\Photo', 'imageable');\n }", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "public function photos() {\n return $this->hasMany('\\P4\\Photo');\n }", "public function imagenes() {\n return $imagenes = ImagenesProducto::where('fk_producto',$this->codigo) -> orderBy('featured','desc') -> get(); //para mostrar las imagenes ordenadas por las destacada\n }", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "public function getTenLatestPhotos();" ]
[ "0.719486", "0.7030671", "0.6954448", "0.6903919", "0.6893713", "0.67883855", "0.678583", "0.6650657", "0.64338946", "0.6425081", "0.6422891", "0.63746065", "0.6369564", "0.635469", "0.6319882", "0.63038415", "0.62776506", "0.6274835", "0.62569314", "0.6211993", "0.6206232", "0.6166729", "0.6153462", "0.61478287", "0.61359763", "0.6131218", "0.6128421", "0.61216146", "0.61183137", "0.6112037", "0.61097217", "0.60992116", "0.6090173", "0.60813093", "0.6078437", "0.60650945", "0.6056528", "0.6052611", "0.6030589", "0.60274994", "0.6012716", "0.5980373", "0.5970895", "0.59536844", "0.59370214", "0.59293056", "0.59213734", "0.59088975", "0.59054077", "0.5896722", "0.5882483", "0.5882461", "0.5880594", "0.5879381", "0.5875974", "0.58672637", "0.5861006", "0.5850783", "0.5850783", "0.5850783", "0.5850783", "0.5850783", "0.5850783", "0.5840913", "0.58324045", "0.58319014", "0.5808804", "0.5795903", "0.5787298", "0.5783482", "0.5782824", "0.57663095", "0.5764936", "0.5758219", "0.57522345", "0.57504153", "0.5742154", "0.5735727", "0.57302725", "0.57261074", "0.57217216", "0.5710409", "0.57096744", "0.57081425", "0.56969655", "0.56960285", "0.56946146", "0.56932217", "0.569214", "0.5684756", "0.5679657", "0.56784207", "0.5674292", "0.567212", "0.56651306", "0.5663496", "0.56600285", "0.56568646", "0.56456023", "0.564368", "0.56326276" ]
0.0
-1
Return a list of your photos that have been recently created or which have been recently modified.
function photos_recentlyUpdated ($per_page = 25, $page = 1, $min_date = NULL, $extras = NULL) { $params = array(); $params['method'] = 'flickr.photos.recentlyUpdated'; $params['per_page'] = $per_page; $params['page'] = $page; if (!$min_date) { $params['min_date'] = time()-604800;; } if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "public function getRecentCreatedUsers()\n {\n $result = $this\n ->_model\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $result;\n }", "function get_list_of_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 1 ORDER BY date DESC');\n return $result;\n }", "function get_list_of_not_new_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE newfile = 0 AND flaggedfile = 0 ORDER BY date DESC');\n return $result;\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function fetchRecentImages()\n {\n $posts = $this->_hc->get_rooms_history('517400','recent');\n $posts = array_reverse($posts);\n\n $images = array();\n foreach ($posts as $post) {\n $url = Image::parseImageUrl($post->message);\n if ($url !== null) {\n $images[] = array(\n 'url' => $url,\n 'date' => $post->date\n );\n }\n }\n\n return $images;\n }", "public function getTenLatestPhotos();", "public function get_recentfile_list($u_id){\n\t\t$this->db->select('images.img_id,images.img_name,images.imag_org_name,images.img_create_at,favourite.yes')->from('images');\t\t\n\t\t$this->db->join('favourite', 'favourite.file_id = images.img_id', 'left');\n\n\t\t$curr_date = date('Y-m-d h:i:s A', strtotime('-7 days'));\n\t\t$this->db->where('images.u_id', $u_id);\n\t\t$this->db->where('images.img_create_at >', $curr_date);\n\t\t$this->db->order_by(\"images.img_create_at\", \"DESC\");\n\t\treturn $this->db->get()->result_array();\n\t}", "public function recent()\n\t{\n\t\t$this->db->order_by('id', 'desc');\n\t\t$db_result = $this->db->get_where('files', array ('status' => 1), 4);\n\n\t\treturn $db_result->result();\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getAllPhotos();", "public function getPhotos();", "public function photos()\n {\n return $this->belongsToMany('App\\Photo')->withTimestamps();\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "function photos_getRecent ($per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getRecent';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_list_of_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 1 ORDER BY date DESC');\n return $result;\n }", "function get_list_of_flagged_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE flaggedfile = 1 ORDER BY date DESC');\n return $result;\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getNewFiles(): Collection\n {\n return $this->files->filter(function (File $file) {\n return $file->getStatus() === File::FILE_NEW;\n });\n }", "public function changes()\r\n\t{\r\n\t\t$Change = App::make('Change');\r\n\r\n\t\treturn $Change::where('fmodel', 'GalleryItem')\r\n\t\t\t\t \t ->where('fid', $this->id)\r\n\t\t\t\t \t ->with('user')\r\n\t\t\t\t \t ->orderBy('created_at', 'DESC')\r\n\t\t\t\t \t ->get();\r\n\t}", "function getLastViewed();", "function get_recent_files($num = 10)\n{\n return get_records('File', array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "public function headshots()\n {\n $compositeKey = [\n 'ezt_user_id' => $this->ezt_user_id,\n 'image_type' => 2\n ];\n\n return Image::where($compositeKey)->get();\n }", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function getfileModifiedDates($fileArray){\n $imageDatesArray = [];\n date_default_timezone_set('America/Sao_Paulo');\n foreach($fileArray as $file){\n $imageDatesArray[] = date(\"d/m/Y H:i:s\", strtotime($file[\"modifiedTime\"]));\n }\n return $imageDatesArray;\n}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "function getRecentChanges()\r\n\t{\r\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\r\n\t\t$changes = ilWikiPage::getRecentChanges(\"wpg\", $this->wiki_id);\r\n\t\t$this->setDefaultOrderField(\"date\");\r\n\t\t$this->setDefaultOrderDirection(\"desc\");\r\n\t\t$this->setData($changes);\r\n\t}", "public function getLastModifiedTime();", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function listLastupdate() {\n //$fileList = glob(\"../blogs/*.md\");\n $fileList = glob(\"blogs/*.md\");\n array_multisort(\n array_map( 'filemtime', $fileList ),\n SORT_NUMERIC,\n SORT_DESC,\n $fileList\n );\n\n $resultList = array();\n\n foreach ($fileList as $filename) {\n $fp = fopen($filename, \"r\");\n $content = fread($fp, filesize($filename));\n fclose($fp);\n\n $contentSplit = explode('---', $content);\n $headers = Yaml::parse($contentSplit[0]);\n\n if( $headers['published'] == 'true' ) {\n $result = new stdClass;\n $result->title = $headers['title'];\n $result->content = Markdown::defaultTransform($contentSplit[1]);;\n $resultList[$filename] = $result;\n }\n }\n return $resultList;\n}", "private function getHistoricFilesList()\n\t{\n\t\t$historic_files = array();\n\t\t$files = $this->ftpConnection->listFiles($this->shop->ftp_dir);\n\t\tforeach ($files as $file) {\n\t\t\tif (defined('PATHINFO_EXTENSION')) {\n\t\t\t\tif (pathinfo($file, PATHINFO_EXTENSION) == \"csv\") {\n\t\t\t\t\t$historic_files[$file] = array(\n\t\t\t\t\t\t'name' => $file,\n\t\t\t\t\t\t'size' => $this->ftpConnection->getFileSize($file)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $historic_files;\n\t}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "function get_list_of_non_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 0 ORDER BY date DESC');\n return $result;\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "private function getHistoricLocalFilesList()\n\t{\n\t\t$historic_files = array();\n\t\t\n\t\t$files = VideodeskHistoricLog::getFilesForShop($this->shop->id);\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$historic_files[$file['filename']] = array(\n\t\t\t\t'name' => $file['filename'],\n\t\t\t\t'size' => $file['size']\n\t\t\t);\n\t\t}\n\t\treturn $historic_files;\n\t}", "protected function getChangedRemoteObjects()\n {\n $query = $this->getRemoteObjectsQuery();\n $table = $this->getRemoteBaseTable();\n $query->addWhere(\"\\\"{$table}\\\".\\\"_ImportedID\\\" > 0\");\n $query->addWhereAny(array(\n \"\\\"{$table}\\\".\\\"_ImportedDate\\\" IS NULL\",\n \"\\\"{$table}\\\".\\\"_ImportedDate\\\" < \\\"{$table}\\\".\\\"LastEdited\\\"\"\n ));\n $items = iterator_to_array($this->task->query($query));\n return new ArrayList($items);\n }", "public function getLastModifiedAudit();", "public static function recentProducts(){\n $recent = Product::find()\n ->where(['>=','actual_date',time()]) // show before actual_date\n ->orderBy(['created_at'=>SORT_DESC, 'updated_at'=>SORT_DESC])\n ->limit( self::SHOW_NUMBER_OF_FOOTER_PRODUCT)\n ->all();\n return $recent;\n }", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "private function sites_with_outdated_camera()\r\n {\r\n return $this->sites_repository()->sites_with_outdated_camera();\r\n }", "public function listMediaTags() {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->tags;\n\t\t$query\t\t= array('tag_status' => '1');\n\t\t$sort\t\t= array('tag_name' => 1);\n\t\t$cursor\t\t= $collection->find($query)->sort($sort);\n\t\t$resultArray= array();\n\t\t\n\t\twhile($cursor->hasNext())\n\t\t{\n\t\t\t$resultArray[]\t= $cursor->getNext();\n\t\t}\n\t\treturn $resultArray;\n\t}", "function check_if_new($new_photo, $old_photos) {\n foreach ($old_photos as $oldie) {\n if ($oldie->guid == $new_photo['url_m']) {\n //The photo is already in the database!\n return False;\n }\n }\n return True;\n}", "public function getLatestThumbList()\n {\n return $this->latestThumbList;\n }", "protected function getNewOrChangedRemoteObjects()\n {\n $query = $this->getRemoteObjectsQuery();\n $table = $this->getRemoteBaseTable();\n $query->addWhereAny(array(\n \"\\\"{$table}\\\".\\\"_ImportedID\\\" = 0\",\n \"\\\"{$table}\\\".\\\"_ImportedDate\\\" IS NULL\",\n \"\\\"{$table}\\\".\\\"_ImportedDate\\\" < \\\"{$table}\\\".\\\"LastEdited\\\"\"\n ));\n $items = iterator_to_array($this->task->query($query));\n return new ArrayList($items);\n }", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModifiedAt();", "public function getLastModifiedAt();", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function getRecentSearchResults()\n {\n return $this->recent_search_results;\n }", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "function getfileCreateDates($fileArray){\n $imageDatesArray = [];\n foreach($fileArray as $file){\n $imageDatesArray[] = $file[\"imageMediaMetadata\"][\"time\"];\n }\n return $imageDatesArray;\n}", "function sql_recent($sorting)\n{\n $RECENT_DAYS = get_setting('RECENT_PHOTO_UPLOAD_WEEKS') * 4;\n\n if ($sorting == \"year\")\n $sort = \"RP.year, RL.location_name, RP.seqno\";\n else\n $sort = \"DATE(RP.publish_date) desc, RL.location_name, RP.seqno\";\n\n $sql = \"\n select\n RL.line_state,\n RL.line_name,\n RL.location_state,\n RL.location_name,\n RP.file,\n RP.seqno,\n RP.year,\n IFNULL(U.fullname, IFNULL(RP.legacy_owner, 'Rolfe Bozier')) as owner,\n RP.owner_uid,\n RP.caption\n from\n r_line_location RL,\n r_location_photo RP left join r_user U on RP.owner_uid = U.uid\n where\n RL.location_state = RP.location_state\n and\n RL.location_name = RP.location_name\n and\n RL.mainline = 'Y'\n and\n RP.hold is null\n and\n RP.publish_date > DATE_SUB(sysdate(), INTERVAL $RECENT_DAYS DAY)\n order by\n $sort\n \";\n\n return [$sql, [], []];\n}", "function getRecents() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY id DESC LIMIT 30;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public function getTouchTimes()\n {\n return implode('-', array_map(function($file) {\n return filemtime($this->getFile($file));\n },\n array_keys($this->files)\n ));\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "function getModifiedDrivers($modifiedSince) {\n if ($modifiedSince == 'null') {\n $modifiedSince = \"1000-01-01\";\n }\n $drivers = $_SESSION['drivers'];\n $result = array();\n foreach ($drivers as $driver) {\n if ($driver->lastModified > $modifiedSince) {\n $result[] = $driver;\n }\n }\n echo json_encode($result);\n}", "public function recentAlbums(){\n return DB::select('select * from albums order by albums.album_created_at DESC limit 5');\n }", "public function get_date_modified();", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getListRecents(){\n\t\t$resultsUsers = [];\n\t\t$q = $this->pdo->query('SELECT * FROM utilisateur ORDER BY dateCreation DESC LIMIT 4');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsUsers[] = new Utilisateur($donnee);\n\t\t}\n\t\treturn $resultsUsers;\n\t}", "public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function getCreatedObjects()\n {\n if (array_key_exists(\"createdObjects\", $this->_propDict)) {\n return $this->_propDict[\"createdObjects\"];\n } else {\n return null;\n }\n }", "public function lastModified();", "public function lastModified();", "function getRecentPhoto()\n\t{\n\t\t$limit = $this->input->post('limit');\n\t\t$page = $this->input->post('page');\n\t\t$response = $this->mapi->getRecentPhoto($limit,$page);\n\n\t\techo json_encode($response);\n\t}", "function hook_query_file_entity_access_alter(QueryAlterableInterface $query) {\n // Only show files that have been uploaded more than an hour ago.\n $query->condition('timestamp', REQUEST_TIME - 3600, '<=');\n}", "function getImageTimestamps($directory, $makecsv = false, $fileName = 'imgTimestamps.csv')\n{\n $contents = scandir($directory);\n $return = array();\n \n \n //use fnmatch to return only the jpg files in the directory\n foreach($contents as $file)\n {\n //only set the jpg images because only tiff and jpg images have exif timestamps\n if (fnmatch(\"*.jpg\", $file, FNM_CASEFOLD)) {\n $return[$file] = NULL; // just so that the keys are set\n }\n }\n \n //now that we have all the pictures, get their timestamps\n foreach($return as $key=>&$value) //pass by reference so that the assignment works\n {\n $ts = exif_read_data($directory.$key, 'FILE');\n $value = $ts['FileDateTime'];\n }\n \n //make the csv if selected\n if($makecsv)\n {\n $handle = fopen($fileName, 'w+');\n //set csv headers\n $csvData = \"\\\"FileName\\\",\\\"Timestamp\\\"\\n\";\n foreach($return as $key=>$value)\n {\n $csvData .= \"\\\"$key\\\",\\\"$value\\\"\\n\";\n }\n fwrite($handle, $csvData);\n fclose($handle);\n \n //set the file defaults\n setFileDefaults($fileName);\n }\n \n return $return;\n}", "public function getUserGalleries() {\n\t\tif (!self::COOKIES_ENABLED) {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t/* load form database */\n\t\t$galleries = array();\n\t\t$delete_code = $this->getDeleteCode();\n\t\t$result = $this->db->query('\n\t\t\tSELECT gallery_id, delete_time, delete_code, COUNT(*) as num_images\n\t\t\tFROM image\n\t\t\tWHERE delete_code = \"'.SQLite3::escapeString($delete_code).'\"\n\t\t\t\tAND gallery_id != \"\"\n\t\t\tGROUP BY gallery_id\n\t\t\tORDER BY ROWID DESC');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$galleries[$entry['gallery_id']] = $entry;\n\t\t\t}\n\t\t}\n\t\treturn $galleries;\n\t}", "public static function getTiedPhotos(Competition $photoComp) {\r\n \r\n $photos = $photoComp->getPhotosAsArrayByVotes(); \r\n $votes = false;\r\n $tied = [];\r\n \r\n foreach ($photos as $photo) {\r\n if ($votes === false) {\r\n $votes = count($photo['votes']); \r\n $tied[] = $photo;\r\n continue;\r\n }\r\n \r\n if (count($photo['votes']) === $votes) {\r\n $tied[] = $photo;\r\n }\r\n \r\n if (count($photo['votes']) < $votes) {\r\n continue;\r\n }\r\n \r\n }\r\n \r\n if (count($tied) < 2) {\r\n return [];\r\n }\r\n \r\n return $tied;\r\n \r\n }", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "function getUpdatedPages() {\n $this->db->select(\"pageTitle, page_attributes.pageID, pageUpdated, pageContentHTML\");\n $this->db->join('page_content', 'page_content.pageID = page_attributes.pageID');\n $this->db->join('page_meta', 'page_meta.pageID = page_attributes.pageID');\n\t\t$this->db->order_by(\"pageUpdated\", \"desc\");\n\t\t$this->db->limit(5);\n $query = $this->db->get('page_attributes');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "private function getImages() {\n global $wpdb;\n $query = \"select * from `\" . $wpdb->prefix . \"roni_images` where image_status = 1;\";\n $results = $wpdb->get_results( $query );\n if( !empty( $results ) ) {\n return $results;\n }\n\n return false;\n }", "public function generateLastModified()\n {\n\n static $lastModified;\n\n if($lastModified!==null)\n {\n return $lastModified;\n }\n\n $request = Yii::app()->request;\n $row = array();\n\n if($this->action->id=='index')\n {\n\n $listUid = $request->getQuery('list_uid');\n $perPage = (int)$request->getQuery('per_page',10);\n $page = (int)$request->getQuery('page',1);\n\n $maxPerPage = 50;\n $minPerPage = 10;\n\n if($perPage<$minPerPage)\n {\n $perPage = $minPerPage;\n }\n\n if($perPage>$maxPerPage)\n {\n $perPage = $maxPerPage;\n }\n\n if($page<1)\n {\n $page = 1;\n }\n\n $list = Lists::model()->findByAttributes(array(\n 'list_uid' => $listUid,\n 'customer_id' => (int)Yii::app()->user->getId(),\n ));\n\n if(empty($list))\n {\n return $lastModified = parent::generateLastModified();\n }\n\n $limit = $perPage;\n $offset = ($page-1)*$perPage;\n\n $sql\n = '\n SELECT AVG(t.last_updated) as `timestamp`\n FROM (\n SELECT `a`.`list_id`, `a`.`status`, UNIX_TIMESTAMP(`a`.`last_updated`) as `last_updated`\n FROM `{{list_subscriber}}` `a`\n WHERE `a`.`list_id` = :lid\n ORDER BY a.`subscriber_id` DESC\n LIMIT :l OFFSET :o\n ) AS t\n WHERE `t`.`list_id` = :lid\n ';\n\n $command = Yii::app()->getDb()->createCommand($sql);\n $command->bindValue(':lid',(int)$list->list_id,PDO::PARAM_INT);\n $command->bindValue(':l',(int)$limit,PDO::PARAM_INT);\n $command->bindValue(':o',(int)$offset,PDO::PARAM_INT);\n\n $row = $command->queryRow();\n\n }\n elseif($this->action->id=='view')\n {\n\n $listUid = $request->getQuery('list_uid');\n $subscriberUid = $request->getQuery('subscriber_uid');\n\n $list = Lists::model()->findByAttributes(array(\n 'list_uid' => $listUid,\n 'customer_id' => (int)Yii::app()->user->getId(),\n ));\n\n if(empty($list))\n {\n return $lastModified = parent::generateLastModified();\n }\n\n $subscriber = ListSubscriber::model()->findByAttributes(array(\n 'subscriber_uid' => $subscriberUid,\n 'list_id' => $list->list_id,\n ));\n\n if(!empty($subscriber))\n {\n $row['timestamp'] = strtotime($subscriber->last_updated);\n }\n }\n\n if(isset($row['timestamp']))\n {\n $timestamp = round($row['timestamp']);\n if(preg_match('/\\.(\\d+)/',$row['timestamp'],$matches))\n {\n $timestamp += (int)$matches[1];\n }\n return $lastModified = $timestamp;\n }\n\n return $lastModified = parent::generateLastModified();\n }", "public function getFilesAdded(): array\n {\n return $this->files_added;\n }", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "function getHistory() {\n\t\treturn db_query_params ('SELECT * FROM artifact_history_user_vw WHERE artifact_id=$1 ORDER BY entrydate DESC, id ASC',\n\t\t\t\t\tarray ($this->getID())) ;\n\t}", "public function getTmpFilesCreated() {\n return $this->tmpFilesCreated;\n }", "public function getHistory()\n {\n if (0 == $this->_getCollection()->getSize()) {\n return false;\n }\n return $this->_collection;\n }", "public function getHistory()\n {\n if (0 == $this->_getCollection()->getSize()) {\n return false;\n }\n return $this->_collection;\n }", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "public function recentlyLiked()\n\t\t{\n\t\t\t\n\t\t\t$instagram_data = $this->curl_request($uri); \n\t\t\treturn $instagram_data;\n\t\t}", "public static function getLastModified() {}", "public function history()\n\t{\n\t\t$res = $this->hasManyThrough(Revision::class, RevisionSet::class, 'id', 'revision_set_id', 'revision_set_id')\n\t\t\t->where(\n\t\t\t\tfunction ($query) {\n\t\t\t\t\treturn $query->where('revisions.created_at', '<', $this->created_at);\n\t\t\t\t})\n\t\t\t->select('revisions.id', 'revisions.title', 'revisions.created_at', 'revisions.layout_name', 'revisions.layout_version');\n\t\treturn $res;\n\t}", "public function getLastFiles()\n {\n echo json_encode($this->galery->getLastFiles());\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "public function getTodayCreatedStyleList()\n {\n return $this->model->where('created_at','>', Carbon::today())\n ->whereNULL('archived_at')\n ->whereNULL('deleted_at')\n ->get()\n ->toArray();\n }", "public function list_owned_files() {\n $stmt = $this->pdo->prepare('select filename from file where user_id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, $f['filename']);\n }\n return $result;\n }" ]
[ "0.62896436", "0.6068572", "0.6035229", "0.60343254", "0.6008608", "0.5990642", "0.5977693", "0.59443796", "0.5932098", "0.59263486", "0.5916577", "0.5909102", "0.5875987", "0.58674955", "0.58159256", "0.5758879", "0.5749316", "0.5737786", "0.56859195", "0.5674865", "0.56575924", "0.559634", "0.5559205", "0.55494106", "0.55234504", "0.5512572", "0.5507064", "0.549094", "0.54819155", "0.54150045", "0.54070735", "0.5400067", "0.53969586", "0.5382946", "0.5374798", "0.5344687", "0.5325577", "0.53105485", "0.5292067", "0.52905697", "0.52849555", "0.52842724", "0.5282028", "0.52766764", "0.52683276", "0.52380055", "0.52234614", "0.52234614", "0.52234614", "0.52234614", "0.519732", "0.519732", "0.51950526", "0.5192589", "0.51855457", "0.5177415", "0.5175166", "0.5161057", "0.5154857", "0.5153158", "0.51485866", "0.51428545", "0.51405895", "0.5130832", "0.51169056", "0.5115964", "0.51073086", "0.5106506", "0.5096778", "0.50966066", "0.50918376", "0.508962", "0.5088869", "0.5088869", "0.5083316", "0.50702316", "0.50692546", "0.50521004", "0.50490844", "0.5039652", "0.50366044", "0.50343573", "0.5033667", "0.5031402", "0.50281966", "0.50233907", "0.5017902", "0.5007973", "0.5006102", "0.5006102", "0.49940902", "0.49898955", "0.49712488", "0.49700463", "0.4968214", "0.4961603", "0.49535522", "0.49486908", "0.49485904", "0.49400908" ]
0.68096197
0
Remove a tag from a photo.
function photos_removeTag ($tag_id) { $response = $this->execute(array('method' => 'flickr.photos.removeTag', 'tag_id' => $tag_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_tag($tag);", "public function removeTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_tag]);\n\t\t}\n\t}", "public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}", "public function removeByTag($tag, $force = false);", "public function removeTag(string $name);", "function testRemoveTag_UsingCleanTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('something', 'another', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "function testRemoveTag_UsingMessyTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('some thing!', 'a-nother.', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "private function removeTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n $tag = Tag::where('tag', '=', $tagName)->first();\n\n\t\tif (is_object($tag))\n\t\t{\n\t\t\tif ($tag->count > 0) TagUtil::decrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count()) $this->tags()->detach($tag->id);\n\t\t}\n\t}", "public function removePhoto($value)\n {\n $key = array_search($value, $this->photos);\n if($key !== false) {\n unset($this->photos[$key]);\n }\n }", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function delTag($id, $tag)\n {\n $this->db->update(array('id'=>$id), array('$pull'=>array('tags'=>$tag)));\n }", "public function deleteTag($imageID, $tagName) {\n $sql = \"DELETE FROM t_tags_included WHERE fk_pk_tags=? AND fk_pk_bild_id=?\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"ss\", $tagName, $imageID);\n $select->execute();\n $select->close();\n }", "public static function deleteTag($name,$imageID)\n\t{\n\t\t$tag = Tag::getTagByName($name);\n\t\t$entry = DB::table('image_has_tag')->where(array('image_id' => $imageID, 'tag_id' => $tag->id));\n\t\t$entry->delete();\n\t\t\n\t\t$allEntries = DB::table('image_has_tag')->where(array('tag_id' => $tag->id))->get();\n\t\t\n\t\tif($allEntries == null) // Plus aucunes images n'utilisent ce tag, on le supprime de la bdd\n\t\t{\n\t\t\t$tag->delete();\n\t\t}\n\t}", "public function unTag($objid, $tag);", "public function delete($tag)\n {\n $builder = $this->git->getProcessBuilder()\n ->add('tag')\n ->add('-d');\n\n if (!is_array($tag) && !($tag instanceof \\Traversable)) {\n $tag = [$tag];\n }\n\n foreach ($tag as $value) {\n $builder->add($value);\n }\n\n $this->git->run($builder->getProcess());\n }", "public function remove()\n\t{\n\t\t$photosTable = PTA_DB_Table::get('Catalog_Product_Photo');\n\t\t$photos = (array)$photosTable->getPhotos($this->_id);\n\n\t\tif (parent::remove()) {\n\t\t\t$photoFileField = $photosTable->getFieldByAlias('photo');\n\t\t\tforeach ($photos as $photo) {\n\t\t\t\tPTA_Util::unlink(PTA_CONTENT_PATH . '/' . $photo[$photoFileField]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function forget($tag)\n {\n $this->connection()->del($tag);\n }", "public function setRemoveTag($tag) {\n\t\t$this->removeTags[] = $this->trimTags($tag);\n\t}", "public function removeTag($tag){\n\n if (!$tag){\n return false;\n }\n if (is_string($tag)) {\n $tag = array($tag);\n }\n if (!count($tag)) {\n return false;\n }\n $deleteTags = array();\n\n foreach ($tag as $t) {\n $deleteTags[] = $this->_keyFromTag($t);\n $deleteKeys = $this->getKeysByTag($t);\n $this->remove($deleteKeys);\n }\n if ($deleteTags && count($deleteTags)) {\n $this->getAdapter()->delete($deleteTags);\n }\n return true;\n }", "public function removeTags()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $tag) {\n\t\t\t$this->removed_tags[] = $tag;\n\t\t}\n\t}", "public static function delete_tag($tag_id) {\n try {\n if ($tag_id > 0) {\n $tbl_tag = Tbl_tag::get_tag($tag_id);\n\n $db = ADODB::connect();\n $query = \"DELETE FROM tbl_tag_item WHERE tag_id=$tag_id\";\n $rs = $db->Execute($query);\n\n //Delete Image\n if ($tbl_tag->image) {\n if (file_exists(Page::get_abs_base().'/web/image/'.$tbl_tag->image)) {\n unlink(Page::get_abs_base().'/web/image/'.$tbl_tag->image);\n }\n }\n }\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n }\n }", "public function removeTag($tag) {\n $this->init(); //we actually may do without it\n\n if (in_array($tag, $this->tags)) {\n $key = array_search($tag, $this->tags);\n $this->tags['del'][] = $key;\n unset($this->tags[$key]);\n\n return true;\n } else if (in_array($tag, $this->tags['new'])) {\n $key = array_search($tag, $this->tags['new']);\n unset($this->tags['new'][$key]);\n\n return true;\n }\n\n return false;\n }", "protected function removeKeyFromTag($key, $tag){\n return $this->getAdapter()->sRemove( $this->_keyFromId($key), $this->_keyFromTag($tag));\n }", "public function destroy(Photo $photo)\n {\n //\n }", "public function destroy(Photo $photo)\n {\n //\n }", "public function removeUpload()\n {\n $this->picture = null;\n }", "public function delete_photo(){\n $sql=\"DELETE FROM photos WHERE id=\".$this->id;\n self::$connect->query($sql);\n\n }", "function photosets_removePhoto ($photoset_id, $photo_id) {\n\t\t$params['method'] = 'flickr.photosets.orderSets';\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.removePhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function removeTag($tag_name)\n\t{\n\t\t$tag = PortfolioTag::getTagByName($tag_name);\n\n\t\tif (!empty($tag)) // Это не должно произойти, тэг должен быть всегда найден\n\t\t{\n\t\t\t$command = Yii::app()->db->createCommand('DELETE FROM {{portfolio_portfolio_tag}} WHERE portfolio_id = :model_id AND tag_id = :tag_id');\n\n\t\t\t$command->bindValues(\n\t\t\t\tarray(\n\t\t\t\t\t':model_id' => $this->id,\n\t\t\t\t\t':tag_id' => $tag->id,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn $command->execute();\n\t\t}\n\n\t\treturn false;\n\t}", "protected function _linkRemoveTag($tag)\n {\n return Horde::url('browse.php')\n ->add(array('actionID' => 'remove', 'tag' => $tag));\n }", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function removeTag($tagName)\n\t{\n\t\t$tagName = (string)$tagName;\n\n\t\tif ( $this->hasTag($tagName) ) {\n\t\t\treturn $this->tags[ $tagName ];\n\t\t}\n\t}", "public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete the image on the upadate\n $this->temp = $this->image;\n //delete the current image\n $this->setImage(NULL);\n }\n }", "function photo_remove() {\n if ( ! $this->input->is_ajax_request() || ! $this->auth->is_login()) {\n return redirect(config_item('site_url'));\n }\n \n $item = filter($this->uri->segment(3), 'str', 40);\n $photo = $this->media->get_by_id($item);\n \n if ( ! $photo || empty($photo)) {\n log_write(LOG_WARNING, 'Photo not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n \n if ($photo->item_author != $this->auth->get_user_id()) {\n log_write(LOG_ERR, 'User is not the author of the photo, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $image = explode('.', $photo->item_filename);\n\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '_thumb.' . $image[1]);\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '.' . $image[1]);\n\n $this->media->remove($item);\n \n return $this->output->set_output(json_encode(array(\n 'code' => 'luck'\n )));\n }", "public function delete($tag)\n {\n getAuthentication()->requireAuthentication();\n $res = $this->tag->delete($tag);\n if($res)\n return $this->noContent('Tag deleted successfully', true);\n else\n return $this->error('Tag could not be deleted', false);\n }", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function destroy(Tag $tag)\n {\n //\n }", "public function destroy(Tag $tag)\n {\n //\n }", "public function deleteTag($tag){\n\t\tif(is_array($tag)){\n\t\t\t$success = true;\n\t\t\tforeach($tag as $t){\n\t\t\t\tif(!$this->deleteTag($t)){\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $success;\n\t\t}else{\n\t\t\t$user = $this->getUser();\n\t\t\t$singletag = $this->getTag($tag);\n\t\t\tif(!isset($user[\"id\"])||!isset($singletag[\"tagid\"])){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif($user[\"status\"] == DBConfig::$userStatus[\"admin\"]){\n\t\t\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes tag '\".$tag.\"'\");\n\t\t\t\t$query = Queries::deletetag($singletag[\"tagid\"]);\n\t\t\t\tif(!$this->query($query))return false;\n\t\t\t\t$query = Queries::removetag($singletag[\"tagid\"]);\n\t\t\t\treturn $this->query($query);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "private static function DeleteTag($tag)\n {\n global $SESSDB;\n \n // First delete entries in sdat\n $q = $SESSDB->prepare(\"DELETE FROM `sdat` WHERE sdat.id IN(SELECT smap.id FROM `smap` WHERE tag=:tag)\");\n $q->bindParam(':tag', $tag);\n $q->execute();\n\n // Now smap...\n $q = $SESSDB->prepare(\"DELETE FROM `smap` WHERE tag=:tag\");\n $q->bindParam(':tag', $tag);\n $q->execute();\n }", "function deleteTag( $iTag ){\n $oSql = Sql::getInstance( );\n clearCache( 'tags' );\n $oSql->query( 'DELETE FROM tags WHERE iTag = \"'.$iTag.'\" ' );\n $oSql->query( 'DELETE FROM pages_tags WHERE iTag = \"'.$iTag.'\" ' );\n\n generateTagsLinks( );\n}", "public function removeTag($artist, $album, $tag, $api_sig, $sk)\n {\n return $this->getClient()->call('album.removetag', array(\n 'artist' => $artist,\n 'album' => $album,\n 'tag' => $tag,\n 'api_sig' => $api_sig,\n 'sk' => $sk,\n ));\n }", "public function removeShortCode($tag)\n {\n remove_shortcode($tag);\n }", "function TestCase_remove_tag($case_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.remove_tag', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function destroy(\\App\\Models\\Tag $tag)\n {\n $tag->delete();\n }", "public function actionRemoveFromBasket()\n\t{\n\t\t$removeThis = array($_GET['imageid']);\n\t\t$basket = Yii::app()->user->getState('basketContents');\n\t\t$newBasket = array_diff($basket,$removeThis);\n\t\t// reduces useless keys, blank keys, from the array\n\t\t$newBasket = array_values($newBasket);\n\t\tYii::app()->user->setState('basketContents',$newBasket);\n\t}", "public function remove_rewrite_tag($tag)\n {\n }", "public function removePhoto($value)\n {\n if($value == 'photo0')\n return $this->photo0 = '';\n if($value == 'photo1')\n return $this->photo1='';\n if($value == 'photo2')\n return $this->photo2='';\n if($value == 'photo3')\n return $this->photo3 = '';\n if($value == 'photo4')\n return $this->photo4='';\n if($value == 'photo5')\n return $this->photo5='';\n\n }", "public function remove(PersistentImageInterface $image): void\n\t{\n\t}", "public function deleteImage($field, $data) {\n if (isset($data['Tag']['id'])) {\n\n $dir = new Folder(WWW_ROOT . 'files' . DS . 'tag' . DS . $field . DS . $data['Tag']['id']);\n $files = $dir->find();\n\n foreach ($files as $file) {\n $file = new File($dir->pwd() . DS . $file);\n $file->delete();\n $file->close();\n }\n\n }\n }", "function TestRun_remove_tag($run_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.remove_tag', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function removeTag(SessionInterface $session, string $artist, string $track, string $tag): void\n {\n $this->signedCall('track.removeTag', [\n 'artist' => $artist,\n 'track' => $track,\n 'tag' => $tag,\n ], $session, 'POST');\n }", "private function REMOVE_SINGLE_TAG($tagName)\n {\n $tagName = trim($tagName);\n\n $tagSlug = TaggUtility::SLUG($tagName);\n\n return $this->tagModel::DELETE($tagSlug);\n }", "function remTagAssoc( $tag_id ) {\n $assoc_def =& Element_Factory::makeElement( 'Bm_Marks_has_bm_Tags' );\n \n $assoc_def->bm_Marks_id = $this->id;\n $assoc_def->bm_Tags_id = $tag_id;\n\n if ( $assoc_def->find(true) ) {\n\t\t\t$this->debug( \"Suppression de l' association [$this->id / $tag_id].\", __FUNCTION__, 1 );\n $assoc_def->delete();\n return true;\n }\n\n else return Blogmarks::raiseError( \"Le Tag [$tag_id] n'est pas associé au Mark [$this->id]\", 404 );\n }", "public function delete_photo ($photo_id){\n\t\t$q_extension = \"SELECT extension FROM photos WHERE photo_id =\".$photo_id;\t\n\t\t$q_photo = 'WHERE photo_id = '.$photo_id;\n\t\t#delete photo record from database\n\t\t\t\n\t\t$ext = DB::instance(DB_NAME)->select_field($q_extension);\n\t\tDB::instance(DB_NAME)->delete('photos', $q_photo);\t\t\n\t\t//delete photo from uploads images folder\n\t\tunlink(\"uploads/images/\".$photo_id.\".\".$ext);\n\t\t#send user back to message index\n\t\tRouter::redirect(\"/photos/gallery\");\n\t\n\t}", "public function removeTag(Tag $tag, $andFlush = true)\n {\n $this->om->remove($tag);\n\n if (true === $andFlush) {\n $this->om->flush();\n }\n }", "public function removeImage(Image $image){\n $this->images->removeElement($image);\n }", "public function deleteRefTag($id_tag){\n $index = -1;\n foreach ($this->_id_tags_arr as $index_temp => $id_tag_temp){\n if($id_tag_temp == $id_tag){\n $index= $index_temp;\n break;\n }\n }\n if ($index!=-1){\n unset ($this->_id_tags_arr[$index]);\n //reindexo para evitar que me queden posiciones vacias en el array\n $this->_id_tags_arr = array_values($this->_id_tags_arr);\n }else{\n throw new Exception('deleteRefTag');\n }\n }", "public function forgetByTags($tags);", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "public function removeAllTags() {}", "public function removeMetaTag($name)\n\t{\n\t\tif($this->metaTags->offsetExists($name))\n\t\t\t$this->metaTags->offsetUnset($name);\n\n\t\tif($this->pageInitialized)\n\t\t{\n\t\t\t$meta = $this->document->xpath('.//meta[@name=\"' . $name . '\" or @http-equiv=\"' . $name . '\" or @property=\"' . $name . '\"]');\n\n\t\t\tif($meta->length == 1)\n\t\t\t\t$meta->item(0)->remove();\n\t\t}\n\t}", "public function cleanupTagsCommand() {\n\t\t/** @var Tag $tag */\n\t\tforeach ($this->tagRepository->findAll() as $tag) {\n\t\t\tif ($this->assetRepository->countByTag($tag) == 0) {\n\t\t\t\t$this->outputLine('Tag \"%s\" deleted.', [$tag->getLabel()]);\n\t\t\t\t$this->tagRepository->remove($tag);\n\t\t\t}\n\t\t}\n\t}", "function remove_tag($id) {\n global $CFG;\n if (!is_numeric($id)) {\n return false;\n }\n\n $tag = get_record('helpdesk_ticket_tag', 'id', $id);\n\n $result = delete_records('helpdesk_ticket_tag', 'id', $id);\n if (!$result) {\n return false;\n }\n // Lets make an update!\n\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = get_string('tagremovewithnameof', 'block_helpdesk') . $tag->name;\n $dat->status = HELPDESK_NATIVE_UPDATE_UNTAG;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n $this->store();\n return true;\n }", "function lgm_theme_remove_tags_metabox() {\n\t remove_meta_box('tagsdiv-post_tag', 'post', 'side');\n\t}", "public function destroy(underwaterphoto $underwaterphoto)\n {\n //\n }", "public function remove() {}", "public function remove() {}", "public static function delete($name)\r\n {\r\n foreach (self::getPhotos() as $photo) {\r\n if (self::getName($photo) == $name) {\r\n self::getSlider()->removeChild($photo);\r\n }\r\n }\r\n \r\n return self::save();\r\n }", "function DeleteByTagID( $tag_id ) {\n \n $data_dir = TMP. '/data/smart_plate/rotate/';\n $file_name = $data_dir.$tag_id.'.dat';\n if( file_exists($file_name) ){\n unlink($file_name);\n }\n \n return $this->deleteAll(array('tag_id' => $tag_id), false );\n }", "public function destroy(Picture $picture)\n {\n //\n }", "public function deleteImage($image){\n /** @var Image $image */\n $this->em->remove($image);\n $image->onPreRemove();\n $this->em->flush();\n }", "public function removeImage($data)\n\t{\n\t\t$this->db->delete('tbl_gambar', $data);\n\t}", "public function removeImage($image)\n {\n if (file_exists('upload_image/' . $image)) {\n unlink('upload_image/' . $image);\n }\n }", "public static function delete(){\n\t\tglobal $current_user;\n\t\tinsert('DELETE FROM tag WHERE id=' . $_POST['id'] .\n\t\t\t\t'AND user_id=' . $current_user['id']);\n\t}", "function favorites_remove ($photo_id) {\n $response = $this->execute(array('method' => 'flickr.favorites.remove', 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setRemoveTag($tag)\n {\n $this->_removeTags[] = $this->formatTag($tag);\n return $this;\n }", "public function destroy_photo($id)\n {\n //\n if(File::exists(public_path('files/products_img/'.Photo::find($id)->name)))\n {\n File::delete(public_path('files/products_img/'.Photo::find($id)->name));\n Photo::find($id)->delete();\n return redirect()->back();\n }\n }", "function removeTagFromUser($tagId) {\n\t\t\t\n\t\t\t$userId = $this->requestAction(array('controller' => 'users', 'action' => 'getUserId'));\n\t\t\t\n\t\t\t$assoc = $this->User->TagsUser->find('first', array('conditions' => array('TagsUser.tag_id' => $tagId, 'TagsUser.user_id' => $userId)));\n\t\t\t\n\t\t\tif(empty($assoc)) {\n\t\t\t\t$this->setFlash('Something went wrong, try again.', 'user_warning');\n\t\t\t} else {\n\t\t\t\t$this->User->TagsUser->delete($assoc['TagsUser']['id']);\n\t\t\t}\n\t\t\t\n\t\t\t$this->redirect($this->referer());\n\t\t\t\n\t\t}", "public function destroy(Tag $tag)\n {\n $tag->posts()->detach();\n $tag->delete();\n }", "public function removeTagAttributes($tag)\n\t{\n\t\t$args = $this->argsArray(func_get_args());\n\t\tarray_shift($args);\n\t\t\n\t\tforeach ($args as $a) {\n\t\t\t$this->removed_tag_attrs[$tag][] = $a;\n\t\t}\n\t}", "public function deletePhoto($photo)\n {\n if(!isset($photo['id']))\n return false;\n\n $res = $this->db->delete_attributes($this->domainPhoto, $photo['id']);\n $this->logErrors($res);\n return $res->isOK();\n }", "public function delete_tag_by_tagname( $activity_id, $tag_name ) {\n\n\t\t$tag_info = $this->get_tag_by_tagname( $tag_name );\n\n\t\t$sql \t= \"DELETE FROM activities_tags\n\t\t\t\t\t\t\tWHERE tag_id = :tag_id\";\n\t\t$sth = $this->conn->prepare( $sql );\n\t\t$sth->execute(\n\t\t\tarray(\n\t\t\t\t':tag_id' => $tag_info[ \"id\" ],\n\t\t\t\t)\n\t\t\t);\n\t\t$row_count = $sth->rowCount();\n\n\t\treturn $row_count > 0 ? true : false;\n\t}", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function del_image_tag_rela($image_tag_rela)\n\t{\n\t\t$ret = true;\n\t\ttry{\n\t\t\t$t_image_tag_rela = new Model_T_Image_Tag_Rela($this->db, $this->client_id);\n\t\t\t$ret = $t_image_tag_rela->del_by_image_id_image_tag_id($image_tag_rela);\n\t\t}catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$ret = false;\n\t\t}\n\t\treturn $ret;\n\t}", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function remove($name);", "public function undo_tag() {\n\t\t$version = $this->conf['common']['releasever'];\n\t\t$tag = str_replace( '$1', $version, $this->conf['common']['tagname'] );\n\n\t\tforeach ( $this->conf['extensions'] as $ext => $checkout ) {\n\t\t\tchdir( \"{$this->dir}/extensions/$ext\" );\n\t\t\t$cTag = escapeshellarg( $tag );\n\t\t\texec( \"git checkout master\" );\n\t\t\texec( \"git tag -d $cTag\" );\n\t\t\t$cTag = escapeshellarg( \":refs/tags/$tag\" );\n\t\t\texec( \"git push origin $cTag\" );\n\t\t}\n\t}", "public function removeTag(Tag $tag): self\n {\n $tag->removePost($this);\n $this->tags->removeElement($tag);\n\n return $this;\n }", "function delete_tag()\n{\n global $xoopsModule, $xoopsSecurity;\n\n $page = rmc_server_var($_POST, 'page', 1);\n $tags = rmc_server_var($_POST, 'tags', []);\n\n if (!$xoopsSecurity->check()) {\n redirectMsg('tags.php?page=' . $page, __('Sorry, operation not allowed!', 'mywords'), 1);\n die();\n }\n\n if (!is_array($tags) || empty($tags)) {\n redirectMsg('tags.php?page=' . $page, __('Please, specify a valid tag id!', 'mywords'), 1);\n die();\n }\n\n // Delete all relations\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n $sql = 'DELETE FROM ' . $db->prefix('mod_mywords_tagspost') . ' WHERE tag IN(' . implode(',', $tags) . ')';\n if (!$db->queryF($sql)) {\n redirectMsg('tags.php?page=' . $page, __('Errors ocurred while trying to delete tags!', 'mywords') . '<br>' . $db->error(), 1);\n die();\n }\n\n $sql = 'DELETE FROM ' . $db->prefix('mod_mywords_tags') . ' WHERE id_tag IN(' . implode(',', $tags) . ')';\n if (!$db->queryF($sql)) {\n redirectMsg('tags.php?page=' . $page, __('Errors ocurred while trying to delete tags!', 'mywords') . '<br>' . $db->error(), 1);\n die();\n }\n\n redirectMsg('tags.php?page=' . $page, __('Database updated succesfully!', 'mywords'), 0);\n}" ]
[ "0.7347097", "0.7204979", "0.6973377", "0.6935872", "0.69193196", "0.691541", "0.687112", "0.68704104", "0.6707652", "0.66968507", "0.66442585", "0.6489552", "0.6486538", "0.64394325", "0.6409692", "0.63596255", "0.63439107", "0.63427114", "0.6318437", "0.630769", "0.6304296", "0.63020086", "0.629941", "0.62540984", "0.62540984", "0.6185982", "0.6176129", "0.61470777", "0.6116263", "0.61133385", "0.6106458", "0.6077197", "0.6076844", "0.6065945", "0.6054734", "0.60523945", "0.6046336", "0.6046336", "0.6037195", "0.6029711", "0.60196745", "0.60063547", "0.60005546", "0.59937", "0.5950575", "0.5949089", "0.5946917", "0.5946917", "0.5946917", "0.5946917", "0.5925534", "0.5894032", "0.5849486", "0.5848109", "0.5840298", "0.583654", "0.5816394", "0.58112085", "0.5810467", "0.5786716", "0.57843864", "0.57628906", "0.575429", "0.57541436", "0.57455087", "0.57340187", "0.57259893", "0.5717067", "0.5711023", "0.5690708", "0.56727314", "0.56283116", "0.5614929", "0.56147355", "0.5608765", "0.56065226", "0.5605129", "0.55907273", "0.5589938", "0.5589291", "0.5589121", "0.5557915", "0.55555815", "0.5554295", "0.5551174", "0.5544757", "0.5541447", "0.5539322", "0.5537866", "0.55240226", "0.55167174", "0.5510592", "0.5510592", "0.5510592", "0.5510592", "0.5510592", "0.5510592", "0.55022573", "0.54979753", "0.54948115" ]
0.74520034
0
Return a list of photos matching some criteria. Only photos visible to the calling user will be returned.
function photos_search ($per_page = 25, $page = 1, $tags = NULL, $text = NULL, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) { $params = array(); $params['method'] = 'flickr.photos.search'; $params['per_page'] = $per_page; $params['page'] = $page; if ($tags) { $tags = explode(',', $tags); array_map('trim', $tags); $tags = implode(',', $tags); $params['tags'] = $tags; } if ($text) $params['text'] = trim($text); if ($min_upload_date) $params['min_upload_date'] = $min_upload_date; if ($max_upload_date) $params['max_upload_date'] = $max_upload_date; if ($min_taken_date) $params['min_taken_date'] = $min_taken_date; if ($max_taken_date) $params['max_taken_date'] = $max_taken_date; if ($privacy_filter) $params['privacy_filter'] = $privacy_filter; if ($media) $params['media'] = $media; if ($extras) $params['extras'] = $extras; if ($sort) $params['sort'] = $sort; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photos']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPhotos();", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function getAllPhotos();", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "function photos_getContactsPublicPhotos ($user_id, $count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getPhotos($page, $itemsPerPage);", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "private static function _searchImages($criteria){\n\n $db = \\PhotoLibrary\\Shortcuts::getDatabase();\n\n $rows = $db->getImages($criteria);\n\n if (is_null($rows)){\n return null;\n }\n\n $withId = (isset($criteria['withId']) && $criteria['withId'] == true);\n $imageArray = array_map(function($row) use ($withId) {\n return ImageSearch::_buildImageObject($row, $withId);\n }, $rows\n );\n\n return $imageArray;\n }", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function PhotosPublic() {\n return $this->hasMany(Photo::class, 'user_uid', 'uid')\n ->orderBy('photos.moment', 'desc')\n ->whereRaw('datediff(now(), photos.moment) <= 10')\n ->where('status_id', 1);\n }", "function favorites_getPublicList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$user_id = ($user_id) ? $user_id : $this->getUserId();\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getPublicList';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function get_all_image_uploaded(){\n if($this->username && $this->id){\n if(file_exists($this->image_path . DS . $this->username)){\n $images = scandir($this->image_path . DS . $this->username);\n if(!empty($images)){\n $images = array_diff($images,array('.','..'));\n $allowed_ex = array(\"jpg\",\"jpeg\",\"png\"); \n foreach($images as $image){\n $exArr = explode('.',$image);\n $ex = end($exArr);\n $ex = strtolower($ex);\n if(!in_array($ex,$allowed_ex)){\n $images = array_diff($images,array($image));\n }\n }\n sort($images);\n return $images;\n }else{\n return false;\n }\n }\n }else{\n return false;\n }\n }", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public function showList()\n\t{\n\t\t$images = array();\n\t\tif (Auth::user()->name == \"admin\") {\n\t\t\t$images = DB::table('images')->get();\n\t\t} else {\n\t\t\t$images = DB::table('images')\n\t\t\t\t->where('created_by', '=', Auth::user()->name)\n\t\t\t\t->get();\n\t\t}\n\n\t\treturn view('admincp.listImage', ['images' => $images]);\n\t}", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "function photos_getWithoutGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithoutGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photos_getContactsPhotos ($count = 10, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getContactsPhotos';\n\t\t$params['count'] = $count;\n\t\tif ($just_friends) $params['just_friends'] = $just_friends;\n\t\tif ($single_photo) $params['single_photo'] = $single_photo;\n\t\tif ($include_self) $params['include_self'] = $include_self;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function authFilter(Request $request)\n {\n $user_id = Auth::user()->id;\n\n if($request->query('q')){\n $images = Image::where('user_id',$user_id )\n ->where('caption','LIKE','%'.$request->query('q').'%')\n ->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('user_id',$user_id )\n ->where('category','LIKE','%'.$request->query('category').'%')\n ->paginate(6);\n }\n elseif(!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\") ) {\n $images = Image::where('user_id', Auth::user()->id)->paginate(6);\n }\n\n return $images;\n }", "public function getOfficeImages()\n {\n $officeImages = OfficeImage::select('image')->inRandomOrder()->take(5)->get();\n if($officeImages->count()) {\n return $officeImages;\n }\n\n return false;\n }", "public function get_photos($id, $type = 'user', $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n $query = sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false));\n $get_photos = $db->query($query) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM posts_photos INNER JOIN posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "public function allPhotosAction() {\r\n $this->view->photo_id = $photo_id = $this->getRequest()->getParam('photo_id', '0');\r\n $this->view->chanel_id = $album_id = $this->getRequest()->getParam('chanel_id', '0');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $params = array();\r\n // send extra params to view for extra URL parameters\r\n $this->view->params = $params;\r\n $page = isset($_POST['page']) ? $_POST['page'] : 1;\r\n $is_ajax = isset($_POST['is_ajax']) ? $_POST['is_ajax'] : 0;\r\n $params['paginator'] = true;\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n //FETCH photos\r\n $paginator = $this->view->allPhotos = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getPhotoCustom($photo, $params, '', true);\r\n $paginator->setItemCountPerPage(30);\r\n $this->view->limit = ($page - 1) * 30;\r\n $this->view->page = $page;\r\n $this->view->is_ajax = $is_ajax;\r\n $paginator->setCurrentPageNumber($page);\r\n }", "function favorites_getList ($user_id = NULL, $per_page = 25, $page = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.favorites.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($extras) $params['extras'] = $extras;\n $response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function get_listing_data( $params )\n\t{\n\t\tif( $params['allow_albums'] == -1 && $params['allow_cats'] == -1 )\n\t\t{\n\t\t\t$this->total_images = 0;\n\t\t\treturn;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Are we listing images from a category?\n\t\t// ------------------------------------------------------\n\t\tif( $params['category'] == 'no' )\n\t\t{\n\t\t\t$where = \"category_id=0 \";\n\t\t}\n\t\telse if( $params['category'] )\n\t\t{\n\t\t\t$where = \"category_id={$params['category']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Is this an album?\n\t\t// ------------------------------------------------------\n\t\tif( $params['album'] == 'no' )\n\t\t{\n\t\t\t$where = \"album_id=0 \";\n\t\t}\n\t\telse if( $params['album'] > 0 )\n\t\t{\n\t\t\t$where = \"album_id={$params['album']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Is this a favorte?\n\t\t// ------------------------------------------------------\n\t\tif( $params['favorite'] )\n\t\t{\n\t\t\t$fav_tbl = ', ibf_gallery_favorites f';\n\t\t\t$where = \" f.member_id={$params['favorite']} AND i.id=f.img_id \";\n\t\t\t$this->favorite = true;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Pin Images?\n\t\t// ------------------------------------------------------\n\t\tif( $params['pinned'] )\n\t\t{\n\t\t\t$pin = \"pinned DESC,\";\n\t\t\t$this->pin = 1;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Restrict which categories images are pulled from?\n\t\t// ------------------------------------------------------\n\t\tif( is_array( $params['allow_cats'] ) && $params['category'] != 'no' )\n\t\t{\n\t\t\t$cats = implode( \",\", $params['allow_cats'] );\n\t\t\t$cat_restrict = \" i.category_id IN ( {$cats} ) \";\n\t\t}\n\t\telse if( $params['allow_cats'] == -1 )\n\t\t{\n\t\t\t$cat_restrict = \"category_id=0\";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Restrict which albums images are pulled from?\n\t\t// ------------------------------------------------------\n\t\tif( is_array( $params['allow_albums'] ) && $params['album'] != 'no' )\n\t\t{\n\t\t\t$album = implode( \",\", $params['allow_albums'] );\n\t\t\t$album_restrict = \" i.album_id IN ( {$album} ) \";\n\t\t}\n\t\telse if( $params['allow_albums'] == -1 )\n\t\t{\n\t\t\t$album_restrict = \"album_id=0 \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Format the restrict sql\n\t\t// ------------------------------------------------------\n\t\tif( $album_restrict && $cat_restrict )\n\t\t{\n\t\t\t$restrict = \" ( {$cat_restrict} OR {$album_restrict} ) \";\n\t\t}\n\t\telse if( $album_restrict || $cat_restrict )\n\t\t{\n\t\t\t$restrict = \" {$album_restrict} {$cat_restrict} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Only show a certain members images?\n\t\t// ------------------------------------------------------\n\t\tif( $params['member'] )\n\t\t{\n\t\t\t$where = \"i.member_id={$params['member']} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// How many rows are we getting?\n\t\t// ------------------------------------------------------\n\t\tif( isset( $params['st'] ) && isset( $params['show'] ) )\n\t\t{\n\t\t\t$limit = \"LIMIT {$params['st']}, {$params['show']}\";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Show unapproved images?\n\t\t// ------------------------------------------------------\n\t\t$params['approve'] = ( $params['approve'] ) ? ' i.approved=1' : \"\";\n\t\t//$this->mod = ( $params['approve'] ) ? 0 : 1 ;\n\n\t\t/*\n\t\t* Recheck mod status */\n\t\t//$this->mod = $this->ipsclass->member['is_mod'];\n\t\t/*\n\t\t* If input['unapproved'] is set, show only unapproved images */\n\t\t$params['approve'] = ( isset( $this->ipsclass->input['unapproved'] ) ) ? 'i.approved=0' : $params['approve'];\n\t\t\n\t\t// ------------------------------------------------------\n\t\t// Image Sorting\n\t\t// ------------------------------------------------------\n\t\t$sort_key = ( $params['sort_key'] ) ? $params['sort_key'] : 'date';\n\t\t$order_key = ( $params['order_key'] ) ? $params['order_key'] : 'DESC';\n\t\t$prune_key = ( $params['prune_key'] ) ? $params['prune_key'] : '30';\n\t\t\n\t\tif( $sort_key == 'rating' )\n\t\t{\n\t\t\t$sort_key = '(ratings_total/ratings_count)';\t\n\t\t}\n\n\t\tif( $sort_key == 'date' )\n\t\t{\n\t\t\t$sort_extra = \", i.id {$order_key} \";\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Final SQL Formatting\n\t\t// ------------------------------------------------------\n\t\tif( $where )\n\t\t{\n\t\t\t$str = \"{$where} \";\n\t\t}\n\n\t\tif( !empty( $params['approve'] ) )\n\t\t{\n\t\t\t$str = ( $str ) ? \" {$str} AND {$params['approve']} \" : $params['approve'];\n\t\t}\n\n\t\tif( $restrict )\n\t\t{\n\t\t\t$str = ( $str ) ? \" {$str} AND {$restrict} \" : $restrict;\n\t\t}\n\n\t\t// ------------------------------------------------------\n\t\t// Query the images\n\t\t// ------------------------------------------------------\n\t\t$this->ipsclass->DB->cache_add_query( 'get_images', array( 'fav_tbl' => $fav_tbl,\n\t\t'member_id' => $this->ipsclass->member['id'],\n\t\t'where' => $str,\n\t\t'pin' => $pin,\n\t\t'sort_key' => $sort_key,\n\t\t'order_key' => $order_key,\n\t\t'sort_xtra' => $sort_extra,\n\t\t'limit' => $limit ), 'gallery_sql_queries' );\n\n\t\t// ------------------------------------------------------\n\t\t// Store the results?\n\t\t// ------------------------------------------------------\n\t\t$this->res = $this->ipsclass->DB->simple_exec();\n\n\t\t// ------------------------------------------------------\n\t\t// Store the total images found\n\t\t// ------------------------------------------------------\n\t\t$this->total_images = $this->ipsclass->DB->get_num_rows( $this->res );\n\t}", "protected function searchImages($subject, $limit = false) {\n $limit = $limit ? (int) $limit : 50;\n\n // Instantiate the Choreo, using a previously instantiated Temboo_Session object\n $search = new Flickr_Photos_SearchPhotos($this->_tembooSession);\n\n // Get an input object for the Choreo\n $searchInputs = $search->newInputs();\n\n // Set credential to use for execution\n $searchInputs->setCredential(TEMBOO_FLICKR_CREDENTIAL);\n\n // Set inputs\n $searchInputs->setText($subject)->setMedia(\"photos\")->setResponseFormat(\"json\")->setExtras('url_s')->setPerPage($limit);\n\n // Execute Choreo and get results\n $searchResults = $search->execute($searchInputs)->getResults();\n\n $response = json_decode($searchResults->getResponse());\n\n // Render the list\n return $this->renderListResults(__FUNCTION__, $subject, $response->photos->photo);\n }", "public function global_get_photos($id, $type = 'user',$user_id=null, $offset = 0, $pass_check = true)\n {\n global $db, $system;\n $photos = [];\n switch ($type) {\n case 'album':\n $offset *= $system['max_results_even'];\n if (!$pass_check) {\n /* check the album */\n $album = $this->global_get_album($id, false);\n if (!$album) {\n return $photos;\n }\n }\n // echo'<pre>'; print_r($user_id);die;\n if(!empty($user_id)){\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s And posts.user_id= %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($user_id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }else{\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.user_id, posts.user_type, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts_photos.album_id = %s ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['max_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n }\n \n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n /* check the photo privacy */\n if ($photo['privacy'] == \"public\" || $photo['privacy'] == \"custom\") {\n $photos[] = $photo;\n } else {\n /* check the photo privacy */\n if ($this->check_privacy($photo['privacy'], $photo['user_id'])) {\n $photos[] = $photo;\n }\n }\n }\n }\n break;\n\n case 'user':\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_photos FROM users WHERE user_id = %s\", secure($id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_photos'], $id)) {\n return $photos;\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->_data['user_id'] == $id) {\n $manage_photos = true;\n }\n }\n /* get all user photos (except photos from groups or events) */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur, posts.privacy FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'user' AND posts.in_group = '0' AND posts.in_event = '0' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n if ($this->check_privacy($photo['privacy'], $id)) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n }\n break;\n\n case 'page':\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_page_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all page photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.user_id = %s AND posts.user_type = 'page' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'group':\n if (!$pass_check) {\n /* check if the viewer is group member (approved) */\n if ($this->check_group_membership($this->_data['user_id'], $id) != \"approved\") {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_group_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all group photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.group_id = %s AND posts.in_group = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n\n case 'event':\n if (!$pass_check) {\n /* check if the viewer is event member (approved) */\n if (!$this->check_event_membership($this->_data['user_id'], $id)) {\n return $photos;\n }\n }\n /* check manage photos */\n $manage_photos = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $manage_photos = true;\n }\n /* viewer is the author of photos */\n if ($this->check_event_adminship($this->_data['user_id'], $id)) {\n $manage_photos = true;\n }\n }\n /* get all event photos */\n $offset *= $system['min_results_even'];\n $get_photos = $db->query(sprintf(\"SELECT posts_photos.photo_id, posts_photos.source, posts_photos.blur FROM global_posts_photos as posts_photos INNER JOIN global_posts as posts ON posts_photos.post_id = posts.post_id WHERE posts.event_id = %s AND posts.in_event = '1' ORDER BY posts_photos.photo_id DESC LIMIT %s, %s\", secure($id, 'int'), secure($offset, 'int', false), secure($system['min_results_even'], 'int', false))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_photos->num_rows > 0) {\n while ($photo = $get_photos->fetch_assoc()) {\n $photo['manage'] = $manage_photos;\n $photos[] = $photo;\n }\n }\n break;\n }\n return $photos;\n }", "public function gallery()\n {\n $photos = User::find(Auth::id())->photos()->latest()->paginate(10);\n// dd($photos);\n return view('user.gallery', compact('photos'));\n }", "public function guestFilter(Request $request)\n {\n if($request->query('q')){\n $images = Image::where('caption','LIKE','%'.$request->query('q').'%')->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('category','LIKE','%'.$request->query('category').'%')->paginate(6);\n }\n\n elseif (!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\")){\n $images = Image::latest()->paginate(6);\n }\n\n return $images;\n }", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "private function getImages() {\n global $wpdb;\n $query = \"select * from `\" . $wpdb->prefix . \"roni_images` where image_status = 1;\";\n $results = $wpdb->get_results( $query );\n if( !empty( $results ) ) {\n return $results;\n }\n\n return false;\n }", "function company_photos()\n\t\t{\n\t\t\t$type = $this->uri->segment(5);\n\t\t\t$data = $this->photo->company_photos();\n\t\t\t$this->directPageDetails(\"gallery_company/list_photo_company\",\"\",$data);\n\t\t}", "public function getPhotoUrls () {\n\t\t\n\t}", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function index()\n\t{\n\t\tif(Auth::user()){\n\t\t\t\n\t\t\t$photos = Photo::all();\n\n\t\t\treturn View::make('photos.index')->with(array('photos' => $photos));\n\n\t\t}\n\t\n\t\t\n\t}", "public function getphotos(){\n\t\ttry{\n\t\t\t$user_id = DB::table('mobiletokens')->where('token', Input::get('token'))->pluck('user_id');\n\t\t\t//$id = DB::select('select user_id from mobiletokens where token = ?', array(Input::get('token')));\n\t\t\t//$links = DB::table('photos')->select('link'/*,'description','latitude','longitude','created_at'*/)->where('user_id','=',$id)->get();\n\t\t\t$links = DB::table('photos')->select('link')->where('user_id','=',$user_id)->orderBy('created_at','desc')->get();\n\t\t} catch (Exception $e){\n\t\t\treturn Response::json(['status' => 'failed']);\n\t\t}\n\t\treturn Response::json(['status' => 'success', 'links' => $links]);\n\t}", "public function index()\n {\n $photos = Photo::where('is_private',1)->paginate(9);\n return view('home',compact('photos'));\n \n }", "public function getUserProfilePhotos($datas = [])\r\n {\r\n return $this->telegram(\"getUserProfilePhotos\", $datas);\r\n }", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getGalleryImages()\n {\n $user_id = Auth::user()->user_id;\n\n $images = Azure::getImageThumbnailFiles($user_id);\n $imageOrder = DB::table(\"users\")\n ->select(\"gallery_order\")\n ->where(\"user_id\", $user_id)\n ->first();\n\n return array(\"success\" => true, \"data\" => array(\n \"images\" => $images,\n \"order\" => $imageOrder->gallery_order\n ));\n }", "public function imagesAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n \n \n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\") || $logedUser[\"idCompany\"] == 1) {\n $request = $this->getRequest();\n }\n \n $images = $this->getImageTable()->fetchAll($logedUser[\"idWebsite\"]);\n $this->layout(\"layout/images.phtml\");\n return array(\n \"images\" => $images,\n \"idWebsite\" => $logedUser[\"idWebsite\"]\n );\n } else {\n return $this->redirect()->toRoute(\"noPermission\");\n }\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "private function getImagesForAdmin() {\n global $wpdb;\n $query = \"select * from `\" . $wpdb->prefix . \"roni_images`;\";\n $results = $wpdb->get_results( $query );\n if( !empty( $results ) ) {\n return $results;\n }\n\n return false;\n }", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "public function getImages(Request $request)\n\t{\n\t\t$response = Image::all($request);\n\t\t\n\t\tforeach($response['records'] as &$row) {\n\t\t\t$row['rel'] = [\n\t\t\t\t'pages' => sprintf('#visibility', $row['url_hash']),\n\t\t\t];\n\t\t}\n\n\t\treturn $this->response($response, 'images', $request);\n\t}", "public function index()\n {\n // Favorite users photos area\n $PopularPhotos = $this->homeService->getPopularPhotos();\n\n $Top = $PopularPhotos[0];\n $Others = array_slice($PopularPhotos->toArray(), 1);\n\n // Top User Information\n $TopUserPhotos = $this->photoService->getPhotosById($PopularPhotos[0]->user_id, false)->items();\n\n // Random photos area\n $RandomPhotos = $this->homeService->getRandomPhotos();\n\n // New Members photos area\n $NewMembers = $this->homeService->getNewMembersPhotos();\n\n //RankedUsers PopularPhotos\n return compact('TopUserPhotos','RandomPhotos','NewMembers','Top','Others');\n }", "public function getPhotos(): Builder\n {\n return Photo::public()->where(function ($q) {\n return $this->filter($q);\n });\n }", "public function getTenLatestPhotos();", "function getUserAlbumPhotos($album_id=null,$profile_picture=false){\r\n\t\tif($album_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('photo_albums_id'=>$album_id));\r\n\t\tif($profile_picture==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('is_profile_picture'=>true));\t\t\r\n\t\t}\t\t\r\n\t\t$recordSet = $this->db->get(TBL_ALBUM_HAS_PHOTOS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function filterPhotos()\n\t\t\t{\n\t\t\t\tglobal $wpdb;\n\n\t\t\t\t// Get contest ID\n\t\t\t\t$id = isset($_POST['wppc-id']) ? $_POST['wppc-id'] : '';\n\n\t\t\t\t// Get filter\n\t\t\t\t$filter = isset($_POST['wppc-filter']) ? $_POST['wppc-filter'] : '';\n\n\t\t\t\t$wpDir = wp_upload_dir();\n\t\t\t\t$contestDir = $wpDir['baseurl'].'/wppc-photos/wppc-photos-'.$id.'/';\n\t\t\t\t$contest = $wpdb->get_row(\"SELECT contest_name, first_point, second_point, third_point, forth_point, fifth_point, start_date, end_registration, end_vote, contest_social_description FROM \".WPPC_TABLE_ALL_CONTESTS.\" WHERE id=\".$id);\n\t\t\t\t$contestPoints = array($contest->first_point, $contest->second_point, $contest->third_point, $contest->forth_point, $contest->fifth_point);\n\t\t\t\t$weeks = absint(((strtotime($contest->end_registration) - strtotime($contest->start_date)) / (60*60*24)) / 7);\n\n\t\t\t\t// Prepare Ajax response\n\t\t\t\t$ajaxResponse = '<div id=\"vote-results-680263891\" class=\"alert alert-warning\" style=\"\"><p>No photos match the criteria</p></div>';\n\t\t\t\t\n\t\t\t\t// Get filter type\n\t\t\t\t$type = explode('-', $filter);\n\t\t\t\t\n\t\t\t\tswitch ($type[0]):\n\n\t\t\t\t\t// Filter by week\n\t\t\t\t\tcase 'week':\n\t\t\t\t\t\tif ($filter == 'week-all'):\n\t\t\t\t\t\t\t\t$contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND visible=1\");\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t$startDate = strtotime('+'.absint(($type[1]-1)*7).\" day\", strtotime($contest->start_date));\n\t\t\t\t\t\t\t\t$endDate = strtotime('+'.absint($type[1]*7-1).\" day\", strtotime($contest->start_date));\n\t\t\t\t\t\t\t\t$contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND (upload_date>='\".date('Y-m-d, 0:00:00', $startDate).\"' AND upload_date<='\".date('Y-m-d, 0:00:00', $endDate).\"') AND visible=1\");\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Filter by point\n\t\t\t\t\tcase 'point':\n\t\t\t\t\t\tif ($filter == 'point-all'):\n\t\t\t\t\t\t\t\t$contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND visible=1\");\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\tswitch ($type[1]):\n\t\t\t\t\t\t\t\t\tcase 0: $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND votes<\".$contest->first_point.\" AND visible=1\"); break;\n\t\t\t\t\t\t\t\t\tcase 1: $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND votes>=\".$contest->first_point.\" AND votes<\".$contest->second_point.\" AND visible=1\"); break;\n\t\t\t\t\t\t\t\t\tcase 2: $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND votes>=\".$contest->second_point.\" AND votes<\".$contest->third_point.\" AND visible=1\"); break;\n\t\t\t\t\t\t\t\t\tcase 3: $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND votes>=\".$contest->third_point.\" AND votes<\".$contest->forth_point.\" AND visible=1\"); break;\n\t\t\t\t\t\t\t\t\tcase 4: $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND votes>=\".$contest->forth_point.\" AND votes<\".$contest->fifth_point.\" AND visible=1\"); break;\n\t\t\t\t\t\t\t\t\tcase 5: $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND votes>=\".$contest->fifth_point.\" AND visible=1\"); break;\n\t\t\t\t\t\t\t\tendswitch;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t// Filter mobile\n\t\t\t\t\tcase 'mobile':\n\t\t\t\t\t\tif ($type[1] == 'only') $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND photo_mobile=1 AND visible=1\");\n\t\t\t\t\t\t\telse $contestPhotos = $wpdb->get_results(\"SELECT * FROM \".WPPC_TABLE_CONTESTS_ENTRIES.\" WHERE contest_id=\".$id.\" AND visible=1\");\n\t\t\t\t\t\tbreak;\n\t\t\t\tendswitch;\n\n\t\t\t\t// No photos match the criteria\n\t\t\t\tif (!empty($contestPhotos))\n\t\t\t\t\t$ajaxResponse = $this->displayContestPhotos($contestPhotos, $contest->contest_name, $contest->end_vote, $contestDir, $contestPoints, $_POST['wppc-url'], $contest->contest_social_description, $this->photosPerPage);\n\n\t\t\t\t// Send Ajax response and terminate\n\t\t\t\tdie($ajaxResponse);\n\t\t\t}", "public function actionIndex()\n {\n $searchModel = new PictureSearch(['scenario' => 'public']);\n $dataProvider = $searchModel->search(Yii::$app->request->get());\n $dataProvider->query->publicScope();\n $dataProvider->query->andWhere(['not',['incident_id' => 20]]); // Do not show the satellite incidents here\n\n $dataProvider->sort->defaultOrder = ['id' => SORT_DESC,];\n $dataProvider->pagination->pageSize = 20;\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "function getPhotoRows($user_id, $ppid, $offset=0, $limit=1) {\n //get mysql object\n $mysql = new my_mysql();\n //query string\n $query = '';\n //switch based on $ppid\n if ($ppid === true) {\n //only get the profile photo row\n $query = \"SELECT *\n FROM photo_data \n WHERE id IN \n (SELECT ppid\n FROM user_logging\n WHERE id=$user_id);\";\n }else {\n //get all photos associated with user\n $query = \"SELECT * FROM photo_data WHERE owner_id=$user_id LIMIT $offset,$limit;\";\n }\n //run query\n $res = $mysql->readQuery($query);\n //return $query;\n\n if (!$res) {\n return False;\n }else {\n return $res;\n }\n}", "function get_votos() {\n\t\t$condicion = array(\n\t\t\t'IdUsuario' => $this->session->userdata('id_usuario'),\n\t\t);\n\t\t\n\t\t$consulta = $this->db->get_where( 'pa_capacitacion_cursos_votos', $condicion ); \n\t\t\n\t\treturn $consulta;\n\t}", "function getImages ( $searchTerms )\n {\n if(!is_null($searchTerms))\n {\n $imagesForProject = array();\n foreach ($searchTerms as $value) {\n $query_param = preg_replace('/\\s+/', '', $value);\n $images = Image::join('imageclasslabels', 'images.id','=','imageclasslabels.image_id')\n -> join('classlabel', 'imageclasslabels.class_id','=','classlabel.id')\n -> where('classlabel.title', 'like', '%'.$value.'%')\n -> orWhere('tags', 'like', '%'.$value.'%')\n -> select('images.*')\n -> get();\n Log::info(count($images));\n foreach ($images as $image) {\n array_push($imagesForProject, (array)$image);\n }\n }\n return $imagesForProject;\n }\n return false;\n }", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function index()\n {\n return Photo::get();\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "public function getPhotos($iPhotoAlbumId = null, $iPage) {\n \t$oLibSearch = Phpfox::getLib('search');\n \t$oUrlSearch = Phpfox::getLib('url');\n Phpfox::getLib('request')->set('page', $iPage);\n \t$bIsUserProfile = false;\n \t\n \tif (defined('PHPFOX_IS_USER_PROFILE')) {\n \t\t$bIsUserProfile = true;\n \t\t$aUser = Phpfox::getService('user')->get($this->_aParams['user_id']); \t\t\t\n \t}\n \t\n \t$sCategory = $aParentModule = null;\t\n\t\t$aSearch = $this->request()->getArray('search');\n\t\t$bIsTagSearch = false;\n\t\t$sView = $this->request()->get('view', false);\n\n $aPageSizes = (empty($iPhotoAlbumId) ? array(20) : array(1000));\n\t\t\n\t\t$aSort = array(\n\t\t\t'latest' => array('photo.photo_id', Phpfox::getPhrase('photo.latest')),\n\t\t);\n\t\t\n \t$oLibSearch->set(array(\n\t\t\t\t'type' => 'photo',\n\t\t\t\t'field' => 'photo.photo_id',\t\t\t\t\n\t\t\t\t'search_tool' => array(\n\t\t\t\t\t'table_alias' => 'photo',\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t'default_value' => Phpfox::getPhrase('photo.search_photos'),\n\t\t\t\t\t\t'name' => 'search',\n\t\t\t\t\t\t'field' => 'photo.title'\n\t\t\t\t\t),\n\t\t\t\t\t'sort' => $aSort,\n\t\t\t\t\t'show' => $aPageSizes\n\t\t\t\t),\n\t\t\t\t'display' => 1\n\t\t\t)\n\t\t);\t\t\n\n\t\t$aBrowseParams = array(\n\t\t\t'module_id' => 'photo',\n\t\t\t'alias' => 'photo',\n\t\t\t'field' => 'photo_id',\n\t\t\t'table' => Phpfox::getT('photo'),\n\t\t\t'hide_view' => array('pending', 'my')\n\t\t);\t\n\t\t\n\t\tif ($bIsUserProfile) {\n\t\t\t$oLibSearch->setCondition('AND photo.view_id ' . ($aUser['user_id'] == Phpfox::getUserId() ? 'IN(0,2)' : '= 0') . ' AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(' . (Phpfox::getParam('core.section_privacy_item_browsing') ? '%PRIVACY%' : Phpfox::getService('core')->getForBrowse($aUser)) . ') AND photo.user_id = ' . (int) $aUser['user_id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (defined('PHPFOX_IS_CUSTOM_MODULE')) {\n\t\t\t\t$this->search()->setCondition('AND photo.view_id = 0 AND photo.module_id = \\'' . Phpfox::getLib('database')->escape($this->_aParams['module_id']) . '\\' AND photo.group_id = ' . (int) $this->_aParams['item_id'] . ' AND photo.privacy IN(%PRIVACY%)');\n\t\t\t} else {\n\t\t\t\t$oLibSearch->setCondition('AND photo.view_id = 0 AND photo.group_id = 0 AND photo.type_id = 0 AND photo.privacy IN(%PRIVACY%)');\n\t\t\t}\n\t\t}\n \t\n \tif (!empty($iPhotoAlbumId)) {\n \t\t$oLibSearch->setCondition('AND photo.album_id = '. $iPhotoAlbumId);\n \t}\n \t\n \t$oLibSearch->browse()->params($aBrowseParams)->execute();\n\t\t\n\t\t$aPhotos = $oLibSearch->browse()->getRows();\n\t\t$iCnt = $oLibSearch->browse()->getCount();\n\n\n\t\tPhpfox::getLib('pager')->set(array('page' => $oLibSearch->getPage(), 'size' => $oLibSearch->getDisplay(), 'count' => $oLibSearch->browse()->getCount()));\n\t\t\n\t\tforeach ($aPhotos as $iKey => $aPhoto) {\n\t\t\tif (Phpfox::isModule('like')) {\n\t\t\t\t$aPhoto['is_liked'] = $this->database()->select('lik.like_id AS is_liked')->from(Phpfox::getT('like'), 'lik')->where('lik.type_id = \\'photo\\' AND lik.item_id = '. $aPhoto['photo_id']. ' AND lik.user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t}\t\n\t\n\t\t\t$aPhoto['is_friend'] = $this->database()->select('f.friend_id AS is_friend')->from(Phpfox::getT('friend'), 'f')->where('f.user_id = '. $aPhoto['user_id']. ' AND f.friend_user_id = ' . Phpfox::getUserId())->execute('getField');\n\t\t\t\n\t\t\t$aPhoto = $this->processPhoto($aPhoto);\n\t\t\t$aPhoto['type_id'] = 'photo';\n\t\t\t$aPhoto = Phpfox::getService('accountapi.feed')->processFeed($aPhoto, null, $aPhoto['user_id'], true);\n\t\t\t$aPhotos[$iKey] = $aPhoto;\n\t\t}\n\t\t\n\t\treturn array($iCnt, $aPhotos);\n }", "public function listImage()\n {\n $data = Image::all();\n return response()->json($data);\n return $this->showAll($image);\n }", "public function listImages($search, $inicio = 0, $limite = 50){\n $repository = App_Doctrine_Repository::repository(\"Photos\");\n $query = $repository->listAll(array(\"file_name\" => $search));\n $query->setMaxResults($limite)\n ->setFirstResult($inicio);\n return $query->getQuery()->getResult();\n }", "public function view_photos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Photos\";\n $photoListArray = $this->registry->model->run(\"getAllPhotoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->PhotoListArray = $photoListArray;\n $this->registry->template->show(\"view_photos\");\n }", "function photos_getNotInSet ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = 'all', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getNotInSet';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }", "public function lists()\n {\n $data['id'] = Input::get('gallery_id');\n $data['gallery'] = PhotoGallery::where('id', '=', $data['id'])->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $data['photos'] = $this->photo->listByGallery($data['id']);\n\n return view('cms.modules.multicms.photos_listall', $data);\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function index()\n {\n $photos = photo::orderBy('created_at', 'desc')->paginate(12);\n\n return view('photos.index', compact('photos'));\n }", "function get_all_photos($db, $idx, $batch, $cond='1') {\n\t $allphotos = array();\n\n\t $query = \"SELECT * FROM cards WHERE $cond and active=1 ORDER by id DESC LIMIT $idx, $batch\";\n\t \n\t \n\t $result = mysqli_query($db, $query) or die (\"Error Error! \" . mysqli_error($db). \" in query<br>$query\");\n\t \n\t while ($row = mysqli_fetch_array($result)) {\n \t$allphotos[] = $row;\n }\n\t\n return ($allphotos);\n}", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "public function getAvatarList(){\n return $this->_get(5);\n }", "public function viewMultiple(){\n // Default configuration\n $orderBy = Input::get('orderBy') ? Input::get('orderBy') : 'created_at';\n $limit = Input::get('limit') ? Input::get('limit') : 30;\n \n if(!Cache::has('maxStartAt')){\n Cache::add('maxStartAt', DB::table('images')->count() - $limit, 10);\n }\n \n if(Input::has('startAt')){\n $startAt = Input::get('startAt');\n }else{\n if(Cache::get('maxStartAt') > 0){\n $startAt = rand(1, Cache::get('maxStartAt'));\n }else{\n $startAt = 0;\n }\n }\n \n // Take rates relation\n $images = Image::with('ratees')->take($limit)->skip($startAt)->orderBy($orderBy)->get();\n \n\tif($images->count() == 0){\n\t\treturn $this->jsonResponse(\"error\", \"No images found with given parameters\", Input::get('callback'));\n\t}\n\t\t\n\treturn $this->jsonResponse(\"ok\", \"Images found\", Input::get('callback'), $images);\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function testItReturnsUsersFilteredWithImage()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n \"image\" => \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQi1SYU1kgu3FtGlMpm5W7K2zuZHLgBQZzf34TQ3_Qe8LUd8s5C\",\n ]);\n $tenant2 = factory(Tenant::class)->create();\n factory(User::class)->create([\n \"tenant_id\" => $tenant2,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users?filter[has_image]=true\")\n ->assertOk()\n ->assertJson([\n \"data\" => [\n [\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n \"image\" => $user1->image,\n ],\n ],\n ]);\n }", "public function images()\n {\n return $this->hasMany(Image::class, 'owner_id')->whereHas('type', function ($q) {\n return $q->where('type', static::class);\n });\n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function getAllPhotosAndLikes($idMember, $idConnectMember){\n $sql = 'SELECT photos.*, IF(likes.id_photo IS NULL, FALSE, TRUE) as liked \n FROM photos \n LEFT JOIN likes \n ON (likes.id_member = ? AND likes.id_photo = photos.id)\n WHERE photos.memberId = ?\n ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idConnectMember, $idMember));\n return $photos;\n }", "public function index()\n {\n $photos = Photo::all();\n\n return view('backEnd.photos.index', compact('photos'));\n }", "function filter(){\r\n\t$images = new ImageCollection();\r\n\t\r\n\tif( isset($_GET['city']) || isset($_GET['country']) ) {\r\n\t\t$city = 0;\t\t\r\n\t\tif( isset($_GET['city']) && !empty($_GET['city']) ) {\r\n\t\t\t$city = $_GET['city'];\r\n\t\t}\r\n\t\t$country = \"ZZZ\";\r\n\t\tif( isset($_GET['country']) && !empty($_GET['country']) ) {\r\n\t\t\t$country = $_GET['country'];\r\n\t\t}\r\n\t\t\r\n\t\t$images->loadCollection();\r\n\t\t\t\t\r\n\t\tif($city > 0 && $country == \"ZZZ\") { //if city set\r\n\t\t\t$images->loadCollectionByCity($city);\r\n\t\t}\r\n\t\telseif($city == 0 && $country != \"ZZZ\") { //if country set\r\n\t\t\t$images->loadCollectionByCountry($country);\r\n\t\t}\r\n\t\telseif($city > 0 && $country != \"ZZZ\") { //if country and city set\r\n\t\t\t$images->loadCollectionByCityAndCountry($city, $country);\r\n\t\t}\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telseif( isset($_GET['search']) ) {\r\n\t\t$search = $_GET['search'];\r\n\t\t$images->loadCollectionBySearch($search);\r\n\t\t\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telse {\r\n\t\t$images->loadCollection();\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "function get_objects($offset, $count, $order_property = null)\r\n {\r\n $order_property = $this->get_order_property($order_property);\r\n return $this->get_browser()->retrieve_photo_gallery_publications($this->get_condition(), $order_property, $offset, $count);\r\n }", "public function index()\n {\n $today = date('Y-m-d');\n $this->data['photos'] = DB::table('gallery')->where('show_from', '<=', $today)->where('show_until', '>', $today)->get();\n return view('gallery.index', $this->data);\n }" ]
[ "0.7125578", "0.7000065", "0.6926198", "0.6885406", "0.68025374", "0.67725796", "0.6554923", "0.6532322", "0.64730895", "0.64699", "0.6414027", "0.64133227", "0.641315", "0.6353017", "0.6295631", "0.62554723", "0.62262124", "0.62250465", "0.61985236", "0.6194844", "0.61723626", "0.6163127", "0.6146238", "0.6132591", "0.6128849", "0.6128795", "0.61246103", "0.6121595", "0.60984945", "0.6090096", "0.60894704", "0.60759777", "0.60567373", "0.60240394", "0.60108554", "0.601032", "0.59962356", "0.5993835", "0.59474903", "0.5945533", "0.59368247", "0.5915666", "0.59048253", "0.5896224", "0.58931696", "0.5888328", "0.5873926", "0.587332", "0.585673", "0.5826155", "0.5822922", "0.58140415", "0.58114743", "0.58041626", "0.5799863", "0.5787959", "0.57871115", "0.57844484", "0.5780187", "0.57773685", "0.5776388", "0.5771645", "0.57582605", "0.5744841", "0.5742103", "0.5740208", "0.5736889", "0.57257783", "0.5723668", "0.57156724", "0.5698401", "0.56825", "0.5676009", "0.56670016", "0.5655404", "0.56545484", "0.5653884", "0.5648123", "0.5640853", "0.56406134", "0.5630888", "0.56304085", "0.56268436", "0.56264627", "0.5620695", "0.5613045", "0.5610015", "0.56076753", "0.5606529", "0.5594933", "0.5593121", "0.55859137", "0.5580699", "0.5578087", "0.5570142", "0.556652", "0.55654126", "0.55623287", "0.55608785", "0.5552951" ]
0.60450804
33
Set the content type of a photo.
function photos_setContentType ($photo_id, $content_type = 1) { $response = $this->execute(array('method' => 'flickr.photos.setContentType', 'photo_id' => $photo_id, 'content_type' => $content_type)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setContentType($content_type) {}", "public static function setContentType($content_type) {}", "public function setContentType($content_type);", "public function setContentType ($type) {\r\n\t\t$this->content_type = Headers::getMimeType($type) ?: $type;\r\n\t}", "public function setContentType($type)\n\t{\n\t\t$this->contenttype = $type;\n\t}", "public function setContentType($type)\r\n {\r\n $this->repo['header']['Content-Type'] = $type;\r\n }", "public function setContentType($contentType);", "public function setContentType($contentType);", "function http_set_content_type($content_type)\n\t{\n\t\t$this->http_content_type = $content_type;\n\t}", "function setContentType($content_type){\n\t\tsettype($content_type,\"string\");\n\t\tif(preg_match('/^([^;]+); charset=[\"\\']?([^\\s;]+)[\"\\']?$/',$content_type,$matches)){\n\t\t\t$content_type = $matches[1];\n\t\t\t$this->setContentCharset($matches[2]);\n\t\t}\n\t\t$this->_ContentType_Redefined = true;\n\t\t$this->_ContentType = $content_type;\n\t}", "function setImageType($iType)\n\t{\n\t\tswitch ($iType) {\n\t\t\tcase 1:\n\t\t\t\t$this->type = $iType;\n\t\t\t\t$this->mimetype = 'image/gif';\n\t\t\t\t$this->setFilenameExtension();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->type = $iType;\n\t\t\t\t$this->mimetype = 'image/jpeg';\n\t\t\t\t$this->setFilenameExtension();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->type = $iType;\n\t\t\t\t$this->mimetype = 'image/png';\n\t\t\t\t$this->setFilenameExtension();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public function set_content_type($mime);", "public function set_content_type($mime);", "public function ImageType($file_type){\r\n $this->file_type=$file_type;\r\n }", "public function setContentType($content_type) {\r\r\n\t\tif (is_array($content_type))\r\r\n\t\t\t$this->content_type = $content_type;\r\r\n\t\telse\r\r\n\t\t\t$this->content_type = array($content_type);\r\r\n\t}", "public function setContentType( string $type ) : void\n {\n $this->headers->set( 'Content-Type', $type );\n }", "protected function setContentType()\n {\n $this->content_type = 'Page';\n }", "public function setContentType($contentType)\n {\n if (is_string($contentType)) {\n if (strpos($contentType, '/') !== false) {\n $contentType = Mad_Controller_Mime_Type::lookup($contentType);\n } else {\n $contentType = Mad_Controller_Mime_Type::lookupByExtension($contentType);\n }\n }\n \n $this->_contentType = $contentType;\n }", "public function setContentType($value)\n {\n $this->headers['Content-Type'] = $this->fixContentType($value);\n }", "public function set_content_type($mime) {\n $this->content_type = $mime;\n }", "public function set_content_type($contenttype)\n\t{\n\t\t$variables = &$this->cms->variables;\n\t\t$variables['content-type'] = $contenttype;\n\t}", "function setContentType() {\n\n\t// GET START TIME\n\t$start = microtime_float();\n\tglobal $mg2;\n\n\t$writeOK = false;\n\n\t// READ DATABASE\n\tlist($readFolders, $readItems) = $mg2->readDB();\n\n\t// ARE THERE ITEM RECORDS?\n\tif ($readItems > 0) {\n\n\t\t// SET CONTENT TYPE\n\t\tforeach ($mg2->all_images as $key=>$record) {\n\t\t\t$mg2->all_images[$key][16] &= ~2047;\n\t\t\t$mg2->all_images[$key][16] |= $mg2->getContentCode(substr(strrchr($mg2->all_images[$key][6], '.'), 1));\n\t\t}\n\n\t\t// WRITE ITEM DATABASE\n\t\t$writeOK = $mg2->write_iDB('all');\n\t}\n\n\t// BUILD STATUS MESSAGE\n\t$takes = round(microtime_float() - $start,3);\n\t$message = 'Content type set in each item database record';\n\t$message.= ($writeOK)? ', it took '. $takes .' sek.':', Error!';\n\n\t// DISPLAY STATUS MESSAGE\n\t$mg2->displaystatus($message);\n}", "public function setContentType($value)\n {\n return $this->set(self::_CONTENT_TYPE, $value);\n }", "function setContentType($contentType) {\n\t\t$this->setData('content_type', $contentType);\n\t}", "public function setContentType($contentType)\n {\n $this->contentType = $contentType;\n }", "public function setContentType($value)\n {\n return $this->set('ContentType', $value);\n }", "public function setContentType($value)\n {\n return $this->set('ContentType', $value);\n }", "public function setContentType($value)\n {\n return $this->set('ContentType', $value);\n }", "public function setContentType($value)\n {\n return $this->set('ContentType', $value);\n }", "public function setContentType($value)\n {\n return $this->set('ContentType', $value);\n }", "public function setContentType($value)\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTTYPE] \n = $value;\n }", "public function setContentType($val){ return $this->setHeader('Content-Type',$val); }", "public function setContentType($val)\n {\n $this->_propDict[\"contentType\"] = $val;\n return $this;\n }", "function set_content_type($type) {\n $this->response->add_header('Content-Type', $type);\n }", "public function setContentType($contentType) {\r\n\t\t$this->contentType = $contentType;\r\n\t}", "function setFileType($type) {\n // Covert args to array\n $type = func_get_args();\n $type = implode(',',$type);\n\n $this->field['mime_types'] = $type;\n return $this;\n }", "public function setContentType($type) {\n\n if (isset($this->headers['content-type'])) {\n\n // Preserve the charset in the content type\n $h = $this->headers['content-type'];\n $pos = strpos($h['value'], ';');\n\n if ($pos !== false) {\n $type = $type . substr($h['value'], $pos);\n }\n }\n\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => $type\n );\n\n return $this;\n }", "protected function set_type() {\n\n\t\t\t$this->type = 'kirki-editor';\n\n\t\t}", "public function set_content_type( $type ) {\n $this->content_type = $type;\n return $this;\n }", "public function setContentType($contentType) {\n\t\t\n\t\t\t$this->_contentType = $contentType;\n\t\t\n\t\t}", "public function setContentType($contentType) {\n\t\t$this->contentType = $contentType;\n\t}", "public function setContentType($contentType)\n {\n $this->contentType = $contentType;\n }", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function setContentTypeHeader($type)\n {\n switch($type) {\n case 'json':\n $this->app->response->headers->set('Content-Type', 'application/json');\n break;\n case 'javascript':\n $this->app->response->headers->set('Content-Type', 'application/javascript');\n break;\n default:\n // default is html..\n break;\n }\n }", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type) {}", "public function setContentType(string $value)\n\t{\n\t\t$parts = explode(\";\", $value);\n\t\t$type = array_shift($parts);\n\t\t$parameters = [];\n\t\tforeach ($parts as $part)\n\t\t{\n $part = trim($part);\n\t\t\tlist($key, $value) = explode('=', $part, 2);\n\t\t\t$value = trim($value, \"'\\\" \\t\\n\\r\\0\\x0B\");\n\t\t\t$parameters[$key] = $value;\n\t\t}\n\n\t\t$this->header_fields['Content-Type'] = [\n\t\t\t'type' => $type,\n\t\t\t'parameters' => $parameters\n\t\t];\n return $this;\n\t}", "private function setContentType($type = \"html\") \n\t{\n\t\theader('Content-type: application/'.$type);\n\t}", "public function setContentType(string $type, string $charset = 'utf-8');", "public function setContentType(?SubmissionContentType $value): void {\n $this->getBackingStore()->set('contentType', $value);\n }", "public function setContentType( $ctype='' )\n {\n if( !empty( $ctype ) && is_string( $ctype ) )\n {\n $parts = explode( ';', trim( $ctype ) );\n $this->ctype = $this->_value( @$parts[0], '' );\n }\n }", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "public function setType($type){ }", "public function setContentType($content_type) {\n $this->contentType = $content_type;\n $this->addHeaders([\n 'Content-Type' => 'application/json',\n ]);\n return $this;\n }", "function set_post_type($post_id = 0, $post_type = 'post')\n {\n }", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setContentType($contentType)\n {\n header(\"Content-Type: $contentType\");\n }", "public function setContentTypeName($content_type_name);", "public function setMediaType(?string $value): void {\n $this->getBackingStore()->set('mediaType', $value);\n }", "function SetFileType($sFileType = 'jpeg') {\n if (in_array($sFileType, array('gif', 'png', 'jpeg'))) {\n $this->sFileType = $sFileType;\n } else {\n $this->sFileType = 'jpeg';\n }\n }", "public function setContentType(string $value): self\n {\n $this->setHeader(\"Content-Type\", $value);\n return $this;\n }", "public function setUploadType($type = 'image') {\r\n if (in_array($type, array('image', 'video'))) {\r\n $this->getSession()->setUploadType($type);\r\n }\r\n }", "public function setType(string $type);", "function setType($type) {\n $this->type = $type;\n }", "public function setAcceptableContentTypes($value)\n {\n $this->_contentTypes = $value;\n }", "public function setMimeType($mimeType) {}", "public function setTyp( $type );", "private function setContentType($key, $val){\n $trimedKey = trim($key);\n if(strcasecmp($trimedKey, CoreConstants::CONTENT_TYPE) == 0){\n $this->contentType = trim($val);\n }\n }", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setType( $type )\n {\n }", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}", "public function setContentType($contentType)\n {\n $this->app->response->headers->set('Content-Type', $contentType);\n }", "private function SetMessageType() {\n\t if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) {\n\t $this->message_type = 'plain';\n\t } else {\n\t if(count($this->attachment) > 0) {\n\t $this->message_type = 'attachments';\n\t }\n\t if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) {\n\t $this->message_type = 'alt';\n\t }\n\t if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) {\n\t $this->message_type = 'alt_attachments';\n\t }\n\t }\n \t}", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function getContentType() { return $this->content_type; }", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "public function setContentType($type)\n {\n $this->setContentTypeInHeaders($type);\n // Keep track of the value so that if the content-type changes automatically\n // due to added child entities, it can be restored if they are later removed\n $this->userContentType = $type;\n\n return $this;\n }", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "public function pi_set_content_type(){\n \treturn \"text/html\";\n\t}", "public function setContentType(string $contentType): Attachment;", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n\t\tif($type == self::TYPE_TEXT){\n\t\t\t$this->type = self::TYPE_TEXT;\n\t\t} else {\n\t\t\t$this->type = self::TYPE_HTML;\n\t\t}\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "function SetFileType($sFileType) {\n if (in_array($sFileType, array('gif', 'png', 'jpeg'))) {\n $this->sFileType = $sFileType;\n } else {\n $this->sFileType = 'jpeg';\n }\n }" ]
[ "0.7310495", "0.7296814", "0.728849", "0.714099", "0.6927197", "0.6861147", "0.6849323", "0.6849323", "0.68044645", "0.6692697", "0.6678795", "0.66614205", "0.66614205", "0.66188484", "0.6532081", "0.64482546", "0.64389265", "0.6431358", "0.6427285", "0.63871586", "0.6327933", "0.63218", "0.63081175", "0.6272752", "0.62444586", "0.62373155", "0.62373155", "0.62373155", "0.6237115", "0.6237115", "0.6236137", "0.6223837", "0.62093186", "0.61876273", "0.6167756", "0.6164671", "0.61628985", "0.61188394", "0.61152977", "0.61033356", "0.60985744", "0.6057431", "0.6045069", "0.6040312", "0.60263777", "0.60263777", "0.60263777", "0.60263777", "0.60263777", "0.60263777", "0.60263777", "0.60263777", "0.60123426", "0.6010876", "0.5979343", "0.59785086", "0.5975199", "0.59322417", "0.59265494", "0.5912935", "0.5911446", "0.58593595", "0.5840211", "0.5840211", "0.5827828", "0.58255893", "0.58239084", "0.5817171", "0.5811396", "0.5808614", "0.5806773", "0.579216", "0.5787812", "0.5784279", "0.5769026", "0.5765894", "0.57615685", "0.5748825", "0.57486403", "0.5744187", "0.57397956", "0.5715605", "0.56939584", "0.56939584", "0.56939584", "0.5687263", "0.56772935", "0.56696457", "0.5665541", "0.5655693", "0.5650884", "0.564346", "0.56325954", "0.56325954", "0.56308275", "0.56308275", "0.5630541", "0.56295455", "0.56295455", "0.5629541" ]
0.6991919
4
Set one or both of the dates for a photo.
function photos_setDates ($photo_id, $date_posted = NULL, $date_taken = NULL, $date_taken_granularity = NULL) { $params = array(); $params['method'] = 'flickr.photos.setDates'; $params['photo_id'] = $photo_id; if ($date_posted) $params['date_posted'] = $date_posted; if ($date_taken) $params['date_taken'] = $date_taken; if ($date_taken_granularity) $params['date_taken_granularity'] = $date_taken_granularity; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDate($date);", "public function set_dates(){\n // if the id is not set, this means its anew item being created\n if(property_exists($this, 'created_on') && empty($this->id)){\n $this->created_on = date('Y-m-d H:i:s');\n }\n\n // if id is set, its an update\n if(property_exists($this, 'last_updated_on') && isset($this->id)){\n $this->last_updated_on = date('Y-m-d H:i:s');\n }\n }", "public function setDates($dates);", "public function setGalleryDate($newGalleryDate = null) : void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newGalleryDate === null) {\n\t\t\t$this->galleryDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\t\t// store the like date using the ValidateDate trait\n\t\ttry {\n\t\t\t$newGalleryDate = self::validateDateTime($newGalleryDate);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->galleryDate = $newGalleryDate;\n\t}", "public function setDate($value) {\n\t\t$this->_date = $value;\n\t}", "public function setDate($date){\n\t\t$this->date = $date;\n\t}", "private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}", "function set_exif_date($filename) {\n echo \" Setting date for $filename\\n\";\n $cmd = \"/usr/bin/exiftool -overwrite_original '-datetimeoriginal<filename' '$filename' 2>&1 1> /dev/null\";\n $results = shell_exec($cmd);\n if(strpos($results, 'looks more like a PNG') !== false) {\n $results = shell_exec(\"/usr/bin/mogrify -format jpg '$filename'\");\n $results = shell_exec($cmd);\n }\n }", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setCreateDates(){\n $t = date_create(date('Y-m-d H:i:s'));\n $this->created = $t;\n $this->modified = $t;\n }", "public function set(Photo $photo)\n\t{\n\t\t$this->photo_id = $photo->id;\n\t\t$this->timestamps = false;\n\t\t// we set up the created_at\n\t\t$now = now();\n\t\t$this->created_at = $now;\n\t\t$this->updated_at = $now;\n\n\t\tforeach (self::VARIANT_2_INDICATOR_FIELD as $variant => $indicator_field) {\n\t\t\tif ($photo->{$indicator_field} !== null && $photo->{$indicator_field} !== 0 && $photo->{$indicator_field} !== '') {\n\t\t\t\t$this->create($photo, $variant, strval($now));\n\t\t\t}\n\t\t}\n\t}", "public function setDate($date)\n\t{\n\t\t$this->date = $date;\n\t}", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date)\n {\n $this->date = $date;\n }", "public function setDate($date) {\n $this->date = $date;\n }", "public function setDateDuJour()\n{\n$this->setDateSysteme(date(\"Y-m-d\"));\n$this->setDateUtilisateur(date(\"d/m/Y\"));\n}", "public\n\tfunction setPostDate($newPostDate = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newPostDate === null) {\n\t\t\t$this->postDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\n\n\t//store the like date using the ValidateDate trait\n\ttry {\n\t\t$newPostDate = self::validateDateTime($newPostDate);\n\t} catch(\\InvalidArgumentException |\\RangeException $exception) {\n\t\t$exceptionType = get_class($exception);\n\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t}\n\t$this->postDate = $newPostDate;\n\n}", "public function setPropertyDate($date=true)\n {\n if($date === false)\n {\n $this->date =false;\n }\n elseif($date !== true)\n {\n $this->date =$date;\n }\n }", "public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}", "public function setDate($date = false)\n {\n $date = explode('-', $date);\n\n $day = @$date[2] ? : date('d');\n $month = @$date[1] ? : date('m');\n $year = @$date[0] ? : date('Y');\n\n $this->day = @$day;\n $this->month = @$month;\n $this->year = @$year;\n # return Calendar instance\n return $this;\n }", "public function set_date($date) \n\t{\n\t\tif(! is_numeric($date))\n\t\t{\n\t\t\t$date = strtotime($date);\n\t\t}\n\t\t\n\t\tif($this->version == ATOM)\n\t\t{\n\t\t\t$tag = 'updated';\n\t\t\t$value = date(DATE_ATOM, $date);\n\t\t} \n\t\telseif($this->version == RSS2) \n\t\t{\n\t\t\t$tag = 'pubDate';\n\t\t\t$value = date(DATE_RSS, $date);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$tag = 'dc:date';\n\t\t\t$value = date(\"Y-m-d\", $date);\n\t\t}\n\t\t\n\t\t$this->add_element($tag, $value); \n\t}", "private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "function setDate($date = null)\r\n\t{\t\r\n\t\t$day = substr($date ,8, 2);\r\n\t\t$month = substr($date ,5, 2);\r\n\t\t$year = substr($date ,0, 4);\r\n\t\t\r\n\t\t$newDate = $day.'-'.$month.'-'.$year;\r\n\t\t\r\n\t\treturn $newDate;\r\n\t}", "function setData($data)\n {\n $this->date=$data;\n }", "public function set_date_created( $date = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $date ) ) {\n\n\t\t\t$datetime_string = wcs_get_datetime_utc_string( wcs_get_datetime_from( $date ) );\n\n\t\t\t// Don't use wp_update_post() to avoid infinite loops here\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_date = %s, post_date_gmt = %s WHERE ID = %d\", get_date_from_gmt( $datetime_string ), $datetime_string, $this->get_id() ) );\n\n\t\t\t$this->post->post_date = get_date_from_gmt( $datetime_string );\n\t\t\t$this->post->post_date_gmt = $datetime_string;\n\t\t}\n\t}", "public function setDate($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function setModDate($date) {}", "public function setDate($date_string = null)\n {\n\n if ($this->is_date() == 1) {\n $this->now = getdate(strtotime($date_string));\n } else {\n $this->now = getdate();\n }\n }", "public function setModifiedDate($value) {\n if (is_string($value)) {\n try {\n $this->modifiedDate = new \\DateTime($value);\n } catch (\\Exception $ex) {\n $this->modifiedDate = null;\n }\n } elseif (is_a($value, '\\\\DateTime')) {\n $this->modifiedDate = $value;\n } else {\n $this->modifiedDate = null;\n }\n }", "public function setUseDate($use_date) \n \t{\n \t\t$this->use_date = $use_date;\n \t}", "public function setDate($value){\n return $this->setParameter('date', $value);\n }", "function setDatePosted($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "protected function setDateProperty($property, $typoscript, $submittedValues) {\n\n\t\tif (!isset($submittedValues[$typoscript['field']])) {\n\t\t\treturn;\n\t\t}\n\n\t\t$value = $submittedValues[$typoscript['field']];\n\t\t$outputFormat;\n\n\t\tif ($property == 'Birthday') {\n\t\t\t$outputFormat = self::BDAY_FORMAT;\n\t\t} else {\n\t\t\t$outputFormat = self::REV_FORMAT;\n\t\t}\n\n\t\t$format = $typoscript['format'];\n\t\tif ($format !== NULL) {\n\t\t\tif ($property == 'Birthday') {\n\t\t\t\t$format = self::DEFAULT_BDAY_INPUT_FORMAT;\n\t\t\t} else {\n\t\t\t\t$format = self::DEFAULT_REV_INPUT_FORMAT;\n\t\t\t}\n\t\t}\n\n\t\t$date = DateTime::createFromFormat($format, $value);\n\n\t\t$this->vcard->{'set' . $property}($date->format($outputFormat));\n\t}", "public function setDate(Carbon $date) {\n\t\t$this->setDateRange($date, $to);\n\t}", "function set($value){\n if(!$value)return parent::set($value);\n list($d,$m,$y)=explode('/',$value);\n if($y)$value=join('/',array($m,$d,$y));\n elseif($m)$value=join('/',array($m,$d));\n $value=date('Y-m-d',strtotime($value));\n return parent::set($value);\n }", "public function setIdCardImgDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->id_card_img_date !== null || $dt !== null) {\n if ($this->id_card_img_date === null || $dt === null || $dt->format(\"Y-m-d H:i:s.u\") !== $this->id_card_img_date->format(\"Y-m-d H:i:s.u\")) {\n $this->id_card_img_date = $dt === null ? null : clone $dt;\n $this->modifiedColumns[AliMemberTableMap::COL_ID_CARD_IMG_DATE] = true;\n }\n } // if either are not null\n\n return $this;\n }", "function setup_meta_dates() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t$_IPCDateCount = get_post_meta($post_id, \"_IPCDateCount\", true);\n\t\t\tif(empty($_IPCDateCount))\n\t\t\t\t$_IPCDateCount = 1;\n\t\t\t\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-meta-data.php');\n\t\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }", "public function setDateAttribute($value)\n {\n $this->attributes['date'] = Carbon::createFromFormat('d/m/Y', $value);\n }", "public function setCreated($date) \n\t{\n\t\t$this->created = $this->parseDate($date);\n\t}", "private function updatePublishOnDate()\n {\n $this->owner->PublishOnDate = $this->owner->DesiredPublishDate;\n // Remove the DesiredPublishDate.\n $this->owner->DesiredPublishDate = null;\n }", "public function setValue($date = null)\r\n {\r\n if ($date instanceof \\Type\\DateTime)\r\n {\r\n $this->setDay($date->getDay());\r\n $this->setMonth($date->getMonth());\r\n $this->setYear($date->getYear());\r\n $this->setTime($date->getHour(), $date->getMinute(), $date->getSecond());\r\n\r\n return $this;\r\n }\r\n\r\n $this->clean();\r\n\r\n if (!is_null($date))\r\n {\r\n $this->explodeDate($date);\r\n }\r\n\r\n return $this;\r\n }", "public function setPublishedAtAttribute($date){ //guarda el campo published_at como si fuera una instancia de Carbon para que se guarde con hora\n \t$this->attributes['published_at']=Carbon::parse($date); \n }", "public function setDoDate($value)\n {\n if (!array_key_exists('do_date', $this->fieldsModified)) {\n $this->fieldsModified['do_date'] = $this->data['fields']['do_date'];\n } elseif ($value === $this->fieldsModified['do_date']) {\n unset($this->fieldsModified['do_date']);\n }\n\n $this->data['fields']['do_date'] = $value;\n }", "public function setCalendarProperties($date, $recur = false) {\n if(!empty($recur)) {\n $startField = \"InstanceStartDateTime\";\n $finishField = \"InstanceFinishDateTime\";\n } else {\n $startField = \"StartDateTime\";\n $finishField = \"FinishDateTime\";\n }\n\n if(date('Y-m-d', strtotime($this->getField($startField))) != date('Y-m-d', strtotime($this->getField($finishField)))) {\n // If this is a multi-day event\n $this->Span = 'ongoing';\n }\n\n if(date('Y-m-d', strtotime($this->getField($startField))) == $date) {\n // If the specified calendar date is the events start date\n $this->Position = 'first';\n } elseif (date('Y-m-d', strtotime($this->getField($finishField))) == $date) {\n // If the specified calendar date is the events finsh date\n $this->Position = 'last';\n }\n\n return $this;\n\n }", "public function setDateTime($key, \\DateTime $date, $all = false) {\n if ($all) {\n // for Google Calendar\n if ($key === 'DTEND') $date->add(new \\DateInterval('P1D'));\n $this->setProperty($key, $date->format('Ymd'), array('VALUE' => 'DATE'));\n } else {\n $this->setProperty($key, $date->format('Ymd\\THis\\Z'));\n }\n }", "function SetInitialDate ($date)\r\n {\r\n if ($date)\r\n {\r\n $this->_dti = $date; \r\n }\r\n }", "private function setDate(){\n\t// Validate incoming parameters\n\t\t$this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\tif (isset($_GET['month'])) {\n\t\tis_numeric($_GET['month']) or die('month has to be numeric');\n\t}\n\tif (isset($_GET['year'])) {\n\t\tis_numeric($_GET['year']) or die('year has to be numeric');\n\t}\n\n\t// Set new date\n\t$this->newMonth = isset($_GET['month']) ? ($_GET['month']) : $this->currentMonth;\n\t$this->newYear = isset($_GET['year']) ? ($_GET['year']) : $this->currentYear;\n\n\tif ($this->newMonth > 12) {\n\t\t$this->newYear = $this->newYear +1;\n\t\t$this->newMonth = 1;\n\t\t$_GET['month'] = 1;\n\n\t}\n\telse if ($this->newMonth < 1) {\n\t\t$this->newYear = $this->newYear -1;\n\t\t$this->newMonth = 12;\n\t\t$_GET['month'] = 12;\n\t}\n\t\n\t}", "public function setDate($date)\n {\n $this->date = $date;\n \n return $this;\n }", "public function setDate($date = null): object\n\t{\n\t\tif (null !== $date && !($date instanceof FHIRDateTime)) {\n\t\t\t$date = new FHIRDateTime($date);\n\t\t}\n\t\t$this->_trackValueSet($this->date, $date);\n\t\t$this->date = $date;\n\t\treturn $this;\n\t}", "public function setDate( $date ) {\n\t\tif ( !preg_match( self::DATERE, $date ) ) {\n\t\t\tthrow new InvalidArgumentException( \"Not a valid date: \".$date );\n\t\t}\n\t\t$this->setParameter( \"dtreviewed\", $date );\n\t}", "public function save_dates() {\n\t\t// Nothing to do here.\n\t}", "public function setDate( $sDate ) {\n\t\t$this->sDate = $sDate;\n\t}", "protected function setDateUtilisateur($date)\n{\n$this->dateUtilisateur = $date;\t\n}", "public function setDateOfBirth()\n {\n $dateOfBirth = request('dob_year') . '-' . request('dob_month') . '-' . request('dob_day');\n\n $this->date_of_birth = $dateOfBirth;\n $this->save();\n }", "public function setDate($date = null): object\n {\n if (null !== $date && !($date instanceof FHIRDate)) {\n $date = new FHIRDate($date);\n }\n $this->_trackValueSet($this->date, $date);\n $this->date = $date;\n return $this;\n }", "public function setArticleDate($newArticleDate = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newArticleDate === null) {\n\t\t\t$this->articleDate = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\n\t\t// store the like date using the ValidateDate trait\n\t\ttry {\n\t\t\t$newArticleDate = self::validateDateTime($newArticleDate);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->articleDate = $newArticleDate;\n\t}", "public function setCreationDate($date = true) {}", "public function setDateCreated($value)\n {\n $this->validateDate('DateCreated', $value);\n $this->validateNotNull('DateCreated', $value);\n\n if ($this->data['date_created'] === $value) {\n return;\n }\n\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }", "public function setCreationDate($date) {}", "function set( $start = 0, $end = NULL )\n {\n $this->setStart( $start );\n \n if ( NULL === $end )\n {\n $this->setEnd( $start );\n }\n else\n {\n switch ( $end )\n {\n \tcase 'year': \n // add one year to end\n \t\tbreak;\n \tcase 'month':\n \t\t// add one month\n \t\tbreak;\n \tcase 'week': \n // add one year to end\n \t\tbreak;\n \tcase 'day': \n // add one year to end\n \t\tbreak;\n \tcase 'calendarweek': \n // set start and end date to start and end of week for current date\n $this->start->date->setToStartOfWeek();\n $this->setEnd( $start );\n $this->end->date->setToEndOfWeek();\n \t\tbreak;\n \tdefault:\n $this->setEnd( $end );\n } // switch\n }\n \n //$this->updatePorperties();\n }", "private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}", "public function setContactDate($date) {\n $this->date = $date;\n }", "function setFecha($fecha) {\r\n $this->fecha = $fecha;\r\n }", "public function setDateAttribute($date)\n {\n \t$this->attributes['date'] = Carbon::parse($date);\n }", "public function setDate($date){\r\n\t\t$this->wishDate = $date;\r\n\t}", "public function setDateCreated($newDateCreated) {\n //if null for a new profile\n if($newDateCreated === null){\n date_default_timezone_set('America/Denver'); // CDT\n \n $current_date = date('Y-m-d H:i:s');\n \n $this->dateCreated = $current_date;\n return;\n }\n \n //zeroth, if the is a DateTime object, assign it\n if(gettype($newDateCreated) === \"object\" && get_class($newDateCreated) === \"DateTime\") {\n $this->dateCreated = $newDateCreated;\n return;\n }\n \n $newDateCreated = trim($newDateCreated);\n $newDateCreated = filter_var($newDateCreated, FILTER_SANITIZE_STRING);\n \n //second, use a regular expression to extract the date and verify it\n if((preg_match(\"/^(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})$/\", $newDateCreated, $matches)) !== 1) {\n throw(new RangeException(\"DateCreated $newDateCreated is not a mySQL formatted date\"));\n }\n \n //verify the date is valid date\n $year = intval($matches[1]);\n $month = intval($matches[2]);\n $day = intval($matches[3]);\n if((checkdate($month, $day, $year)) === false) {\n throw(new RangeException(\"DateCreated $newDateCreated is not a gregorian date\"));\n }\n \n //convert the date to a DateTime Object\n if(($dateTime = DateTime::createFromFormat(\"Y-m-d H:i:s\", $newDateCreated)) === false) {\n throw(new RangeException(\"DateCreated $newDateCreated cannot be converted to a DateTime object\"));\n }\n $this->dateCreated = $dateTime;\n }", "public function setReviewDate($newReviewDate = null) {\n\t\t\t\t// base case: if the date is null, use the current date and time\n\t\t\t\tif($newReviewDate = null) {\n\t\t\t\t\t$this->reviewDate = new \\DateTime();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// store the review date\n\t\t\t\ttry {\n\t\t\t\t\t$newReviewDate = self::validateDateTime($newReviewDate);\n\t\t\t\t} catch(\\InvalidArgumentException $invalidArgument) {\n//\t\t\t\t\t\tthrow(new \\InvalidArgumentException($invalidArgument->getMessage(), 0, $range));\n\t\t\t\t\tthrow(new \\InvalidArgumentException (\"No date specified\", 405));\n\t\t\t\t} catch(\\RangeException $range) {\n\t\t\t\t\tthrow(new \\RangeException($range->getMessage(), 0, $range));\n\t\t\t\t}\n\t\t\t\t$this->reviewDate = $newReviewDate;\n\t\t\t}", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "public function setDate(?TimeRange $date): void\n {\n $this->date = $date;\n }", "public function setCreated($date)\n {\n $this->created = $date;\n }", "public function setDates($dates)\n {\n $this->dates = $dates;\n return $this;\n }", "private function setPublishedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-published` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setPublishedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-published` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->datePublished = $row['datetime-published'];\n\t\t}\n\n\t\t// Also set the last modified datetime\n\t\t$this->setLastModifiedDateTime();\n\t}", "public function set($post_to_display) {\n foreach ($post_to_display as $key=>&$value) {\n if ($key === \"date\") {\n $this->{$key} = new DateTime($value->date);\n } else {\n $this->{$key} = $value;\n }\n }\n }", "function setStartDate($start_date = \"\") \n\t{\n\t\t$this->start_date = $start_date;\n\t}", "function setDateRated($dateRated) {\n\t\t$this->setData('dateRated', $dateRated);\n\t}", "public function setStartDate(string $date);", "public function setDate($date) {\n $this->date = $date;\n $this->updateData();\n return $this;\n }", "public function test_comicEntityIsCreated_dates_setDates()\n {\n $sut = $this->getSUT();\n $dates = $sut->getDates();\n $expected = [\n ComicDate::create(\n 'onsaleDate',\n '2020-12-31T00:00:00-0500'\n ),\n ComicDate::create(\n 'focDate',\n '2020-12-16T00:00:00-0500'\n ),\n ];\n\n $this->assertEquals($expected, $dates);\n }", "public static function setDateFormatDay()\n {\n self::$settings[0] = 'Y-m-d';\n }", "private function setDate($data, $key, $currentDate, callable $setCallback)\n {\n if (($date = $this->getProperty($data, $key, $currentDate)) !== null) {\n if (is_string($date)) {\n $date = new \\DateTime($data[$key]);\n }\n } else {\n $date = null;\n }\n\n call_user_func($setCallback, $date);\n }", "function set_change_sale_date_enable() {\n $this->sale_lib->set_change_sale_date_enable($this->input->post('change_sale_date_enable'));\n if (!$this->sale_lib->get_change_sale_date()) {\n $this->sale_lib->set_change_sale_date(date(get_date_format()));\n }\n }", "private function setCurDate(DateTime $date):void\n\t{\n\t\t$this->curDate = clone $date;\n\t\tif($this->isVocation($this->curDate)){\n\t\t\t$this->nextDay();\n\t\t}\n\t}", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "public function updateDate( Inx_Api_Recipient_Attribute $attr, $sValue );", "public function setCreatedDate($date)\r\n\t\t{\r\n\t\t\t$this->_created_date = $date;\r\n\t\t}", "protected function setDate($type, $date)\n\t{\n\t\t$this->{'date' . $type} = AdFox::convertDate($date);\n\n\t\treturn $this;\n\t}", "public function setDate($date)\n {\n $this->values['Date'] = $date;\n return $this;\n }", "private function updateUnPublishOnDate()\n {\n $this->owner->UnPublishOnDate = $this->owner->DesiredUnPublishDate;\n // Remove the DesiredUnPublishDate.\n $this->owner->DesiredUnPublishDate = null;\n }", "public function setEndDate($date)\n {\n\t\tif($date==null){\n\t\t\t$this->complete_at = null;\n\t\t\t$this->save();\n\t\t\t$this->fireModelEvent('end-refreshed');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif($this->complete_at){\n\t\t\tif($model->complete_at->greaterThan($date)){\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-delayed');\n\t\t\t}else{\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-forwarded');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->complete_at = $date;\n \t$this->save();\n\t\t\t$this->fireModelEvent('end-inited');\n\t\t}\n }", "protected function set_date_prop( $date_type, $value ) {\n\t\t$datetime = wcs_get_datetime_from( $value );\n\t\t$date = ! is_null( $datetime ) ? wcs_get_datetime_utc_string( $datetime ) : 0;\n\n\t\t$this->set_prop( $this->get_date_prop_key( $date_type ), $date );\n\t\t$this->schedule->{$date_type} = $date;\n\t}", "function setLocalDate($loca,$dat){\n $this->local = $loca;\n $this->dates = $dat;\n }", "public function setVoteDateTime($newVoteDateTime = null): void {\n\t\t// base case: if the date is null, wait for mysql\n\t\tif($newVoteDateTime === null) {\n\t\t\t$this->voteDateTime = null;\n\t\t\treturn;\n\t\t}\n\t\t// store the like date using the ValidateDate trait\n\t\ttry {\n\t\t\t$newVoteDateTime = self::validateDateTime($newVoteDateTime);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->voteDateTime = $newVoteDateTime;\n\t}", "public function setDateRestrictions($start, $end)\n\t{\n\t\t$this->setStartDate($start);\n\t\t$this->setEndDate($end);\n\t}", "function setCommentDate($newCommentDate = null) {\n\tif($newCommentDate === null) {\n\t\t$this->commentDate = new \\DateTime();\n\t\treturn;\n\t}\n\n\t// store the comment date\n\ttry {\n\t\t$newCommentDate = self::validateDateTime($newCommentDate);\n\t} catch(\\InvalidArgumentException $invalidArgument)\n\t{\n\t\tthrow(new \\InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n\t} catch(\\RangeException $range) {\n\tthrow(new \\RangeException($range->getMessage(), 0, $range));\n\t}\n\t$this->commentDate = $newCommentDate;\n}", "public function setSetModifiedDate($value)\n {\n return $this->set('SetModifiedDate', $value);\n }", "public function setEndDateAttribute($date)\n {\n $this->attributes['end_date'] = $date ? Carbon::parse($date) : null;\n }", "function setArray($array) {\n\t\tif ($array['idSemesters'])\n\t\t\t$this->idSemesters = $array['idSemesters'];\n\t\tif ($array['date'])\n\t\t\t$this->date = $array['date'];\n\t\tif ($array['timeStart'])\n\t\t\t$this->timeStart = $array['timeStart'];\n\t\tif ($array['timeEnd'])\n\t\t\t$this->timeEnd = $array['timeEnd'];\n\n\t\t$this->_modified = true;\n\t}" ]
[ "0.63447195", "0.6257269", "0.62071383", "0.59734637", "0.5961761", "0.5905391", "0.58734274", "0.58549273", "0.5837929", "0.58336574", "0.58336574", "0.58186644", "0.58182925", "0.57810664", "0.5757086", "0.5757086", "0.57568836", "0.570078", "0.55858594", "0.557147", "0.5562074", "0.5550414", "0.553638", "0.55278766", "0.54654574", "0.54495627", "0.54495114", "0.5405858", "0.540349", "0.53534865", "0.53411716", "0.5318496", "0.5314493", "0.53104275", "0.5297808", "0.5285412", "0.52547485", "0.52507704", "0.52411467", "0.5235084", "0.52331287", "0.52300197", "0.52288026", "0.5218058", "0.52133435", "0.52118915", "0.5211188", "0.5207073", "0.5203559", "0.5198205", "0.5189384", "0.5168012", "0.5165236", "0.5128759", "0.51277703", "0.51276594", "0.51263136", "0.51149637", "0.51011384", "0.5100436", "0.5098053", "0.50896424", "0.50881726", "0.5083258", "0.5079924", "0.5074948", "0.507243", "0.50691396", "0.50681543", "0.50654405", "0.505658", "0.5051688", "0.50513893", "0.5050373", "0.5046534", "0.50443584", "0.50388265", "0.5030554", "0.5029886", "0.50287074", "0.5027677", "0.5026192", "0.5022874", "0.5018376", "0.5016307", "0.5015509", "0.5007867", "0.5004966", "0.49958846", "0.49849322", "0.49811158", "0.49753308", "0.49734604", "0.4970961", "0.49608505", "0.4951689", "0.49508077", "0.49504322", "0.4948638", "0.4947478" ]
0.68128884
0
Set the meta information for a photo.
function photos_setMeta ($photo_id, $title, $description) { $response = $this->execute(array('method' => 'flickr.photos.setMeta', 'photo_id' => $photo_id, 'title' => $title, 'description' => $description)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function metaInit () {\n $this->imageMeta = new ImageMeta($this->getImagePath());\n $this->imageMeta->getMeta();\n }", "public function setMetaData($metaData);", "public function setMetaInfo($meta) {\n $this->meta = $meta;\n }", "protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}", "protected function set_meta( $meta ) {\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\t}", "public function setMetadata($metadata) {}", "public function setMetadata($metadata) {}", "protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }", "public function setMeta($meta)\n {\n $this->setValue('meta', $meta);\n }", "public function setMeta($meta)\n {\n $this->setValue('meta', $meta);\n }", "function set_metadata($name, $value) {\n if ($name && $value)\n $this->metadata[$name] = $value;\n }", "public function setMetadata($metadata)\n\t{\n\t\t$this->vars['metadata'] = $metadata;\n\t}", "public function setPhoto(Photo $photoObject);", "protected function save_meta() {}", "public function setMeta($key, $value)\n {\n }", "public function set_metadata ($metadata) {\n $this->metadata = $metadata;\n }", "function setMetas($metas = array())\n\t{\n\t\t$defaultMetas = array('Robots'=>'all');\n\t\t$finalMetas = array_merge($defaultMetas,$metas);\n\t\t$metas = '';\n\t\tforeach($finalMetas as $name => $content)\n\t\t\t$metas .= '<meta name=\"'.$name.'\" content=\"'.htmlentities($content).'\" />';\n\t\t$this->setVar(\"meta\",$metas);\n\t}", "function photosets_editMeta ($photoset_id, $title, $description = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.editMeta';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['title'] = $title;\n\t\tif ($description) $params['description'] = $description;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "public function setMeta(array $meta=null) {\n\t\t$this->meta = $meta;\n\t}", "public function setMetaInfo($data = array()) {\n $this->metaInfo = array_merge($this->metaInfo, $data);\n }", "public function set(Photo $photo)\n\t{\n\t\t$this->photo_id = $photo->id;\n\t\t$this->timestamps = false;\n\t\t// we set up the created_at\n\t\t$now = now();\n\t\t$this->created_at = $now;\n\t\t$this->updated_at = $now;\n\n\t\tforeach (self::VARIANT_2_INDICATOR_FIELD as $variant => $indicator_field) {\n\t\t\tif ($photo->{$indicator_field} !== null && $photo->{$indicator_field} !== 0 && $photo->{$indicator_field} !== '') {\n\t\t\t\t$this->create($photo, $variant, strval($now));\n\t\t\t}\n\t\t}\n\t}", "protected function setSubmittedMeta()\n {\n $this->setDataObject( new Tagline, 'tagline' );\n $this->content_obj->setMeta( 'tagline', $this->tagline->get() );\n \n $this->setImage( new Image, 'image_secondary' );\n if ( $this->image_secondary->get('file_name') ) {\n $this->content_obj->setMeta('image_secondary', $this->image_secondary->getFullName() );\n $this->processImage( 'image_secondary' );\n }\n \n $this->setDataObject( new Video, 'video' );\n $this->content_obj->setMeta( 'video', $this->video->get() );\n \n $this->setDataObject( new VideoDescription, 'video_description' );\n $this->content_obj->setMeta( 'video_description', $this->video_description->get() );\n \n $this->setDataObject( new SelectableCharity, 'selectable' );\n $this->content_obj->setMeta( 'selectable', $this->selectable->get() );\n \n $this->setDataObject( new Rank, 'rank' );\n $this->content_obj->setMeta( 'rank', $this->rank->get() );\n \n $this->setDataObject( new Url, 'url' );\n $this->content_obj->setMeta( 'url', $this->url->get() );\n }", "public function setMeta($name, $value)\n\t{\n\t\t$this->metaValues[$name] = $value;\n\t}", "public function setMeta(array $meta)\n {\n $this->meta = $meta;\n }", "public function setMetadata($metadata)\n {\n $this->metadata->set($metadata);\n }", "public function setMeta(array $meta = null)\n {\n $this->meta = $meta;\n }", "public function setMetaOgImageAttribute($value)\n {\n $this->attributes['meta_og_image'] = $value;\n\n if (empty($value)) {\n $this->attributes['meta_og_image'] = config('settings.meta_og_image');\n }\n }", "public function setMetadata($metadata)\n {\n $this->metadata = $metadata;\n }", "protected function setPhoto(string $photo)\r\n\t{\r\n\t\t$this->photo = $photo;\r\n\t}", "public function setPhoto(string $photo): void\n {\n $this->photo = $photo;\n }", "function dcwd_set_image_meta_upon_image_upload( $post_ID ) {\n\tif ( wp_attachment_is_image( $post_ID ) ) {\n\t\t$my_image_title = get_post( $post_ID )->post_title;\n\t\t$my_image_title = dcwd_title_to_words( $my_image_title );\n\t\t// Create an array with the image meta (Title, Caption, Description) to be updated\n\t\t// Note: comment out the Excerpt/Caption or Content/Description lines if not needed\n\t\t$my_image_meta = array(\n\t\t\t'ID' => $post_ID,\t\t\t// Specify the image (ID) to be updated\n\t\t\t'post_title' => $my_image_title,\t\t// Set image Title to sanitized title\n\t\t\t// Damien: Omit setting the caption as I rarely use captions when I insert images.\n\t\t\t//'post_excerpt' => $my_image_title,\t\t// Set image Caption (Excerpt) to sanitized title\n\t\t\t'post_content' => $my_image_title,\t\t// Set image Description (Content) to sanitized title\n\t\t);\n\t\t// Set the image Alt-Text\n\t\tupdate_post_meta( $post_ID, '_wp_attachment_image_alt', $my_image_title );\n\t\t// Set the image meta (e.g. Title, Excerpt, Content)\n\t\twp_update_post( $my_image_meta );\n\t} \n}", "private function _populatePromotorMeta()\n {\n return $this->promotor_meta->set(\n $this->promotorNewsData['promotor_ID'], \n $this->promotorNewsData['name'], \n $this->promotorNewsData['content']\n );\n }", "function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "public function setMeta($key, $value = null)\n {\n collect(is_array($key) ? $key : [$key => $value])->each(function ($value, $key) {\n update_user_meta($this->ID, $key, $value);\n });\n }", "function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function setMetadata($metadata)\n {\n $this->metadata = $this->message['metadata'] = $metadata;\n }", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "private function set_meta( $key, $value ) {\n\t\tupdate_post_meta( $this->get_id(), $key, $value );\n\t}", "public function useMetaData()\n {\n $this->render();\n $metaData = $this->param('meta_data');\n if ($metaData) {\n if (!empty($metaData['layout.yml'])) {\n $layoutData = BYAML::i()->parse(trim($metaData['layout.yml']));\n BLayout::i()->addLayout('viewproxy-metadata', $layoutData)->applyLayout('viewproxy-metadata');\n }\n if (($head = $this->view('head'))) {\n foreach ($metaData as $k=>$v) {\n $k = strtolower($k);\n switch ($k) {\n case 'title':\n $head->addTitle($v); break;\n case 'meta_title': case 'meta_description': case 'meta_keywords':\n $head->meta(str_replace('meta_','',$k), $v); break;\n }\n }\n }\n }\n return $this;\n }", "abstract public function setMetas();", "private function updateMetas() {\n if( is_null($this->Metas) )\n $this->Metas = array();\n\n $this->Metas[0] = '<meta http-equiv=\"Content-Type\" content=\"' . $this->ContentType . '; charset=' . $this->Charset . '\" />';\n }", "private function set_metafile_fields(){\n\n\t\t\t// add more fields for your requierements\n $custom_fields = array( \n\t\t\t\t'field_name1'\t=> __( 'field name 1', self::$plugin_obj->class_name ),\n\t\t\t\t'field_name2'\t=> __( 'field name 2', self::$plugin_obj->class_name ),\n\t\t\t\t'field_name3'\t=> __( 'field name 3', self::$plugin_obj->class_name ),\n\t\t\t );\n\n\n foreach( $custom_fields as $custom_attrname => $custom_value){\n self::$metafile_fields->$custom_attrname = $custom_value;\n } \n\n }", "public function setMeta($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\Update\\V1\\Meta::class);\n $this->meta = $var;\n\n return $this;\n }", "public function setMeta($key, $value): void\n {\n /** @var HasMetadataInterface $this */\n $meta = Meta::metable(static::class, $this->id)\n ->where('key', $key)->first();\n\n if ($meta === null) {\n $meta = new Meta;\n $meta->key = $key;\n }\n\n $meta->value = $value;\n\n $this->meta()->save($meta);\n }", "public function useMetaData()\n {\n if (!$this->getParam('meta_data')) {\n $this->collectMetaData();\n }\n\n $metaData = $this->getParam('meta_data');\n if ($metaData) {\n if (!empty($metaData['layout.include'])) {\n $this->BLayout->applyLayout($metaData['layout.include']);\n }\n if (!empty($metaData['layout.yml'])) {\n $layoutData = $this->BYAML->parse(trim($metaData['layout.yml']));\n $this->BLayout->addLayout('viewproxy-metadata', $layoutData)->applyLayout('viewproxy-metadata');\n }\n if (($head = $this->view('head'))) {\n foreach ($metaData as $k => $v) {\n $k = strtolower($k);\n switch ($k) {\n case 'title':\n $head->addTitle($v);\n break;\n \n case 'set_title':\n $head->setTitle($v);\n break;\n\n case 'meta_title': \n case 'meta_description': \n case 'meta_keywords':\n $head->meta(str_replace('meta_', '', $k), $v); \n break;\n }\n }\n }\n }\n return $this;\n }", "function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}", "public function setMetaFrom($object);", "protected function setMeta($title = '', $desc = '', $keywords = '')\n {\n $this->meta['title'] = $title;\n $this->meta['desc'] = $desc;\n $this->meta['keywords'] = $keywords;\n }", "public function set_meta( $meta, $single = false ) {\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\n\t\tif ( $single ) {\n\t\t\tupdate_comment_meta( $this->id, key( $meta ), $meta[ key( $meta ) ] );\n\t\t} else {\n\t\t\tupdate_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, $this->meta );\n\t\t}\n\t}", "public function updatePostMeta($post_meta_name) {\n $meta = array();\n $meta['image'] = $this->image;\n $meta['sub-images'] = $this->sub_images;\n $meta['link'] = $this->link;\n $meta['price'] = $this->price;\n $meta['product-code'] = $this->product_code;\n\n update_post_meta($this->id, $post_meta_name, $meta);\n }", "public function setMetadata($name, $value)\n {\n $this->metadata[$name] = $value;\n }", "public function setMeta($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Any::class);\n $this->meta = $var;\n\n return $this;\n }", "public function setMeta($key, $value)\n {\n return update_user_meta($this->getID(), $key, $value);\n }", "function _meta(&$img,$opt){\n if($img['meta']){\n // map JPEGMeta calls to opt names\n\n switch($opt){\n case 'title':\n return $img['meta']->getField('Simple.Title');\n case 'desc':\n return $img['meta']->getField('Iptc.Caption');\n case 'cdate':\n return $img['meta']->getField('Date.EarliestTime');\n case 'width':\n return $img['meta']->getField('File.Width');\n case 'height':\n return $img['meta']->getField('File.Height');\n\n\n default:\n return '';\n }\n\n }else{\n // just return the array field\n return $img[$opt];\n }\n }", "public function setMetaAttribute($name, $value)\n {\n $this->metaAttributes[$name] = $value;\n }", "function sw_add_header_meta() {\n\t\t\n\t\t$info['postID'] = get_the_ID();\n\t\t\t\n\t\t// Cache some resource for fewer queries on subsequent page loads\n\t\tif(sw_is_cache_fresh($info['postID']) == false):\n\t\t\n\t\t\t// Check if an image ID has been provided\n\t\t\t$info['imageID'] = get_post_meta( $info['postID'] , 'nc_ogImage' , true );\n\t\t\tif($info['imageID']):\n\t\t\t\t$info['imageURL'] = wp_get_attachment_url( $info['imageID'] );\n\t\t\t\tdelete_post_meta($info['postID'],'sw_open_graph_image_url');\n\t\t\t\tupdate_post_meta($info['postID'],'sw_open_graph_image_url',$info['imageURL']);\n\t\t\telse:\n\t\t\t\t$info['imageURL'] = wp_get_attachment_url( get_post_thumbnail_id( $info['postID'] ) );\n\t\t\t\tdelete_post_meta($info['postID'],'sw_open_thumbnail_url');\n\t\t\t\tupdate_post_meta($info['postID'],'sw_open_thumbnail_url' , $info['imageURL']);\n\t\t\t\tdelete_post_meta($info['postID'],'sw_open_graph_image_url');\n\t\t\tendif;\n\n\t\t\t// Cache the Twitter Handle\n\t\t\t$user_twitter_handle \t= get_the_author_meta( 'sw_twitter' , sw_get_author($info['postID']));\n\t\t\tif($user_twitter_handle):\n\t\t\t\tdelete_post_meta($info['postID'],'sw_twitter_username');\n\t\t\t\tupdate_post_meta($info['postID'],'sw_twitter_username',$user_twitter_handle);\n\t\t\telse:\n\t\t\t\tdelete_post_meta($info['postID'],'sw_twitter_username');\n\t\t\tendif;\n\t\t\n\t\telse:\n\t\t\n\t\t\t// Check if we have a cached Open Graph Image URL\n\t\t\t$info['imageURL'] = get_post_meta( $info['postID'] , 'sw_open_graph_image_url' , true );\n\t\t\t\n\t\t\t// If not, let's check to see if we have an ID to generate one\n\t\t\tif(!$info['imageURL']):\n\t\t\t\t\n\t\t\t\t// Check for an Open Graph Image ID\n\t\t\t\t$info['imageID'] = get_post_meta( $info['postID'] , 'nc_ogImage' , true );\n\t\t\t\tif($info['imageID']):\n\t\t\t\t\n\t\t\t\t\t// If we find one, let's convert it to a link and cache it for next time\n\t\t\t\t\t$info['imageURL'] = wp_get_attachment_url( $info['imageID'] );\n\t\t\t\t\tdelete_post_meta($info['postID'],'sw_open_graph_image_url');\n\t\t\t\t\tupdate_post_meta($info['postID'],'sw_open_graph_image_url',$info['imageURL']);\n\t\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t\t// If we don't find one, let's save the URL of the thumbnail in case we need it\n\t\t\t\t\t$thumbnail_image = get_post_meta($info['postID'],'sw_open_thumbnail_url' , true);\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t\t$user_twitter_handle = get_post_meta( $info['postID'] , 'sw_twitter_username' , true );\n\t\t\t\t\t\t\n\t\tendif;\t\t\t\n\t\t\t\n\t\t// Create the image Open Graph Meta Tag\n\t\t$info['postID'] \t\t\t\t= get_the_ID();\n\t\t$info['title'] \t\t\t\t\t= htmlspecialchars( get_post_meta( $info['postID'] , 'nc_ogTitle' , true ) );\n\t\t$info['description'] \t\t\t= htmlspecialchars( get_post_meta( $info['postID'] , 'nc_ogDescription' , true ) );\n\t\t$info['sw_fb_author'] \t\t\t= htmlspecialchars( get_post_meta( $info['postID'] , 'sw_fb_author' , true ) );\n\t\t$info['sw_user_options'] \t\t= sw_get_user_options();\n\t\t$info['user_twitter_handle'] \t= $user_twitter_handle;\n\t\t$info['header_output']\t\t\t= '';\n\t\t\n\t\t$info = apply_filters( 'sw_meta_tags' , $info );\n\n\t\tif($info['header_output']):\n\t\t\techo PHP_EOL .'<!-- Open Graph Meta Tags & Twitter Card generated by Social Warfare v'.SW_VERSION.' http://warfareplugins.com -->';\n\t\t\techo $info['header_output'];\n\t\t\techo PHP_EOL .'<!-- Open Graph Meta Tags & Twitter Card generated by Social Warfare v'.SW_VERSION.' http://warfareplugins.com -->'. PHP_EOL . PHP_EOL;\n\t\tendif;\n\t}", "public function setMetadata($name, $value)\r\n {\r\n $this->data['props'][$name] = $value;\r\n }", "public function setMetaTags($seo)\n {\n $this->pageTitle = $seo->title;\n $this->keywords = $seo->keywords;\n $this->description = $seo->description;\n }", "public function setMeta(array $data)\n {\n $this->meta = [];\n\n foreach ($data as $key => $item) {\n $this->addMeta($key, $item);\n }\n }", "protected function setMeta(array $meta)\n\t{\n\t\t$this->meta = $meta;\n\n\t\tforeach ($this->meta as $key => $value)\n\t\t{\n\t\t\t$this->router->setGlobal(sprintf('route_%d_%s', $this->index, $key), $value);\n\t\t}\n\t}", "public function setPhotoAttribute($photo)\n {\n if($photo === '') {\n return;\n }\n $this->attributes['photo'] = $photo;\n }", "public function setPhotoData($body) {\n\t\t$cnt = count($body['photos']['photo']);\n\t\t$num = rand(0, $cnt-1);\n\t\t$this->photo = $body['photos']['photo'][$num];\n\t}", "public function setInfo(string $ref, string $title = null, string $content = null, string $image = null) {\n $this->type = $ref;\n $this->titre = $title;\n $this->corps = $content;\n $this->image = $image;\n }", "public function addMeta($key, $value)\n {\n $this->meta[$key] = $value;\n }", "function thmplt_carousel_slide_meta(){\r\n\tadd_meta_box(\"thmplt_carousel_meta_box1\", \"Slide Settings\", \"thmplt_carousel_slide_settings_html\", \"thmplt_carousel\", \"normal\", \"high\");\r\n\tadd_meta_box(\"thmplt_carousel_meta_box2\", \"Slide Images\", \"thmplt_carousel_slide_settings_html2\", \"thmplt_carousel\", \"normal\", \"high\");\r\n}", "function AddMetaData($s3object, $value) {\n\t\t\t$this->__meta[$s3object] = $value;\n\t\t}", "public function setMeta( KCommandContext $context )\n {\n $data = $context->data;\n \n $entity = $this->getItem();\n \n $plugins = KConfig::unbox( pick( $data->plugins, array() ) );\n \n $entity->setPluginsValues( $plugins );\n }", "private function update_attachment_postmeta($post_id)\n {\n // global $wpdb;\n $args = array(\n \"ID\" => $post_id,\n //the type of the upload photo\n \"post_title\" => $this->post_title,\n //description\n \"post_content\" => $this->post_content,\n //post status\n \"post_status\" => \"publish\",\n //post ID for the previous uploaded raw data\n \"post_excerpt\" => $this->post_content2\n );\n /*\n $Keys [] = $NewImage->ID;\n $Captions [] = $NewImage->post_excerpt;\n $Descriptions [] = $NewImage->post_content;*/\n wp_update_post($args);\n }", "public static function meta_box_photo( $post, $args ) {\n\t\t$image_id = get_post_thumbnail_id( $post );\n\t\tif ( ! $image_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$thumb_url = wp_get_attachment_image_src( $image_id, [ 900, 450 ], true );\n\n\t\t$classes = 'photo-thumbnail';\n\n\t\tif ( Photo::is_controversial( $image_id ) ) {\n\t\t\t$classes .= ' blurred';\n\t\t}\n\n\t\tprintf(\n\t\t\t'<a class=\"photos-photo-link row-title\" href=\"%s\" target=\"_blank\" aria-label=\"%s\"><img class=\"%s\" src=\"%s\" style=\"max-width:100%%\" alt=\"\" /></a>',\n\t\t\twp_get_attachment_url( $image_id ),\n\t\t\t/* translators: %s: Post title. */\n\t\t\tesc_attr( sprintf( __( 'Edit photo associated with post &#8220;%s&#8221;', 'wporg-photos' ), $post->post_title ) ),\n\t\t\tesc_attr( $classes ),\n\t\t\tset_url_scheme( $thumb_url[0] )\n\t\t);\n\t}", "public function add_meta( &$object, $meta );", "protected function addMeta() {\n foreach ($this->meta_info as $key => $meta) {\n $this->header.=\"<meta name='\" . $key . \"' content='\" . $meta . \"' /> \\n\";\n }\n }", "public function set_metadata( $name, $content, $type = 'meta' ) {\n $name = htmlspecialchars( strip_tags( $name ) );\n $content = htmlspecialchars( strip_tags( $content ) );\n\n // Keywords with no comments? ARG! comment them\n if ( $name == 'keywords' AND ! strpos( $content, ',' ) ) {\n $content = preg_replace( '/[\\s]+/', ', ', trim( $content ) );\n }\n\n switch ( $type ) {\n case 'meta':\n $this->_metadata[ $name ] = '<meta name=\"' . $name . '\" content=\"' . $content . '\" />';\n break;\n\n case 'link':\n $this->_metadata[ $content ] = '<link rel=\"' . $name . '\" href=\"' . $content . '\" />';\n break;\n }\n\n return $this;\n }", "public function read($mdata, $info)\n {\n // start off by assuming we're updating this instance of ImageMetadata\n $meta = $this;\n // if metadata has IPTC fields\n if (isset($info['APP13'])) {\n $iptc = new IptcWriter();\n $iptc->prime(iptcparse($info['APP13']));\n // pull entire meta block if set, silence warning incase not\n $iptc_special = $iptc->get(IPTC_SPECIAL_INSTRUCTIONS);\n $candidate_meta = @unserialize($iptc_special);\n if (isset($candidate_meta->{'sfun_version'})) {\n // sfun image so use serialized object version of metadata\n $meta = $candidate_meta;\n } else {\n // unable to read metadata object whole, so read field-by-field\n $candidate = array(\n 'iptc_headline' => $iptc->get(IPTC_HEADLINE),\n 'iptc_caption' => $iptc->get(IPTC_CAPTION),\n 'iptc_byline' => $iptc->get(IPTC_BYLINE),\n 'iptc_keywords' => $iptc->get(IPTC_KEYWORDS),\n 'iptc_copyright' => $iptc->get(IPTC_COPYRIGHT_STRING),\n 'iptc_source' => $iptc->get(IPTC_SOURCE),\n );\n // if we retrieved any of the above fields, use them to overwrite defaults\n $this->imbue($candidate, true);\n }\n }\n // if we have basic metadata\n if (is_array($mdata)) {\n // use it to overwrite none/deserialized/candidate metadata\n if (isset($mdata[1])) {\n $meta->setLoadedWidth($mdata[0]);\n $meta->setLoadedHeight($mdata[1]);\n if (!$meta->hasOriginalWidth()) {\n $meta->setOriginalWidth($mdata[0]);\n $meta->setOriginalHeight($mdata[1]);\n }\n }\n if (isset($mdata['mime'])) {\n $meta->setMime($mdata['mime']);\n }\n if (isset($mdata['bits'])) {\n $meta->setBitsPerPixel($mdata['bits']);\n }\n if (isset($mdata['channels']) && $mdata['channels'] == 4) {\n $meta->setMode('cmyk');\n }\n }\n return $meta;\n }", "function set_meta_objs($meta_objs) {\n $this->meta_objs = $meta_objs;\n }", "public function update_meta( &$object, $meta ) {\n\t\t}", "public function initializeByMeta($meta)\n {\n }", "protected function initMeta($attr)\n {\n if (isset($attr[\"id\"])) {\n $this->meta[\"id\"] = $attr[\"id\"];\n }\n\n if (isset($attr[\"class\"])) {\n $this->meta[\"class\"] = $attr[\"class\"];\n }\n\n if (isset($attr[\"html\"])) {\n $this->meta[\"html\"] = $attr[\"html\"];\n }\n\n if (isset($attr[\"properties\"])) {\n $this->meta[\"properties\"] = $attr[\"properties\"];\n if (is_array($this->meta[\"properties\"])) {\n foreach ($this->meta[\"properties\"] as $att => $val) {\n $this->meta[\"prop\"] .= \" {$att} = '{$val}'\";\n }\n }\n }\n\n }", "public function setMeta($key, $value): void\n {\n $this->setMetaWithoutReload($key, $value);\n $this->reload();\n }", "public function uploadMeta()\n\t{\n global $mysql;\n\n Debug::log('<hr><h1>Beginning meta update</h1><hr>', LEVEL_MAIN);\n \n $startTime = new DateTime();\n\n\t\t$version = $this->getVersionNumberFromFolder($this->folderlocation);\n\n\t\tif ($this->getVersionExistsInDatabase($version, $this->versionId) == null)\n\t\t{\n Debug::log('New version detected', LEVEL_MINIMUM);\n\n // Todo: Migrate to stored procedure\n $mysql->insert('wot_versions', array('version' => $version, 'published' => time()));\n\n $this->versionId = $mysql->getLastUpdatedId();\n\t\t}\n \n $this->deserializeWoTMetaFiles();\n $this->copyTranslationFiles();\n $this->updateTranslations();\n \n $this->vehicles_path = 'versions/' . $this->version . '/';\n \n $this->ImportEquipment();\n $this->ImportTankInformation();\n\n\n Debug::log('<hr><h1>Completed meta upate</h1>', LEVEL_MAIN);\n Debug::log('Meta update took '.$startTime->diff(new DateTime())->format('%I minutes and %S seconds'), LEVEL_MAIN);\n \n\t}", "public function setMeta(array $data) : SourceParser\n\t{\n\t\t$this->meta = $data;\n\n\t\treturn $this;\n\t}", "protected function _setTemplateMeta(){\n $this->template->project_name = $this->config['project']['name'] ;\n $this->template->title = $this->config['view']['title'] ;\n $this->template->keywords = $this->config['view']['keywords'];\n $this->template->description = $this->config['view']['description'];\n }", "public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \"&nbsp;by&nbsp;\" . $this->userName;\n\t}", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "protected function addCustomFieldset()\n {\n $this->meta = array_merge_recursive(\n $this->meta,\n [\n static::NOTE_FIELD_INDEX => $this->getFieldsetConfig(),\n ]\n );\n }", "public static function createItemMetaForFile($filename) {\n\t\t$exifData = t3lib_div::makeInstance('Tx_Yag_Domain_Import_MetaData_ExifParser')->parseExifData($filename);\n\t\t$iptcData = t3lib_div::makeInstance('Tx_Yag_Domain_Import_MetaData_IptcParser')->parseIptcData($filename);\n\t\t$xmpData = Tx_Yag_Domain_Import_MetaData_XmpParser::parseXmpData($filename);\n\t\t\n\t\t$itemMeta = new Tx_Yag_Domain_Model_ItemMeta();\n\t\t\n\t\t$itemMeta->setExif(serialize($exifData));\n\t\t$itemMeta->setIptc(serialize($iptcData));\n\t\t$itemMeta->setXmp($xmpData);\n\t\t\n\t\t$itemMeta->setAperture($exifData['ApertureValue']);\n\t\t$itemMeta->setArtist($iptcData[\"2#080\"][0]);\n\n\t\t$itemMeta->setArtistMail(self::getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork'));\n\t\t$itemMeta->setArtistWebsite(self::getXmpValueByKey($xmpData, 'Iptc4xmpCore\\:CiEmailWork')); \n\t\t$itemMeta->setCameraModel($exifData['Make'] . ' - ' . $exifData['Model']);\n\t\t$itemMeta->setCopyright($iptcData[\"2#116\"][0]);\n\t\t$itemMeta->setDescription($exifData['ImageDescription']);\n\t\t$itemMeta->setFlash($exifData['Flash']);\n\t\t$itemMeta->setFocalLength($exifData['FocalLength']);\n\n\t\t$itemMeta->setCaptureDate(new DateTime('@' . $exifData['CaptureTimeStamp']));\n\n\t\t//$itemMeta->setGpsLatitude(); // not available yet\n\t\t//$itemMeta->setGpsLongitude(); // not available yet\n\t\t$itemMeta->setIso($exifData['ISOSpeedRatings']); \n\t\tif(is_array($iptcData['2#025'])) $itemMeta->setKeywords(implode(',', $iptcData['2#025']));\n\t\t$itemMeta->setLens(self::getXmpValueByKey($xmpData, 'aux\\:Lens'));\n\n\t\t$itemMeta->setShutterSpeed($exifData['ShutterSpeedValue']);\n\t\t\n\t\treturn $itemMeta;\n\t}", "public function setMetas($meta)\n {\n if (empty($meta)) {\n return;\n }\n\n foreach ($meta as $key => $value) {\n if (is_callable($value) && !is_string($value)) {\n $value = $value($this);\n }\n\n $this->setMeta($key, $value);\n }\n }", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "function wp_update_attachment_metadata($attachment_id, $data)\n {\n }", "protected function set_open_graph_image_meta_data( Indexable $indexable ) {\n\t\tif ( ! $indexable->open_graph_image_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$image = $this->open_graph_image->get_image_by_id( $indexable->open_graph_image_id );\n\n\t\tif ( ! empty( $image ) ) {\n\t\t\t$indexable->open_graph_image = $image['url'];\n\t\t\t$indexable->open_graph_image_meta = WPSEO_Utils::format_json_encode( $image );\n\t\t}\n\t}", "function meta($name, $content=\"\") {\n\t\t$this->metas[] = array('name' => $name, 'content' => $content);\n\t}", "public function setMeta($strName, $strContent) {\n\t\t\t$this->arMeta[$strName] = $strContent; \n\t\t}", "public function setMetaKey($name)\n\t{\n\t\treturn $this->setKey('meta', $name);\n\t}", "public function setMetadata(?array $metadata): void\n {\n $this->metadata['value'] = $metadata;\n }", "public function set_meta( $key, $value ) {\n\t\t$this->data['meta'][ $key ] = $value;\n\n\t\treturn $this;\n\t}", "public function addMeta(Meta $meta) {\n $this->meta[$meta->getName()] = $meta;\n }", "private function import_metas() {\n\t\tWPSEO_Meta::replace_meta( '_aioseop_description', WPSEO_Meta::$meta_prefix . 'metadesc', $this->replace );\n\t\tWPSEO_Meta::replace_meta( '_aioseop_keywords', WPSEO_Meta::$meta_prefix . 'metakeywords', $this->replace );\n\t\tWPSEO_Meta::replace_meta( '_aioseop_title', WPSEO_Meta::$meta_prefix . 'title', $this->replace );\n\t}", "public function setMetadata($name, $value = '')\n {\n $query = $this->db\n ->get_where(\"registry_object_metadata\",\n array('registry_object_id' => $this->id, 'attribute' => $name));\n if ($query->num_rows() == 1) {\n $this->db->where(array('registry_object_id' => $this->id, 'attribute' => $name));\n $this->db->update('registry_object_metadata', array('value' => $value));\n } else {\n $this->db->insert('registry_object_metadata',\n array('registry_object_id' => $this->id, 'attribute' => $name, 'value' => $value));\n }\n }", "function get_metadata($meta_type, $object_id, $meta_key = '', $single = \\false)\n {\n }" ]
[ "0.70335853", "0.6956919", "0.6756647", "0.66268873", "0.65275466", "0.6520241", "0.6519575", "0.64917016", "0.6443167", "0.6443167", "0.63576895", "0.63283837", "0.62890506", "0.6256569", "0.62511647", "0.62334365", "0.6211461", "0.6210028", "0.61742383", "0.6169706", "0.6161191", "0.6131413", "0.6043135", "0.6031936", "0.60169", "0.6007673", "0.5982999", "0.59725136", "0.5968895", "0.5966519", "0.59636885", "0.59497494", "0.5936993", "0.59326947", "0.5927334", "0.59020156", "0.5882556", "0.5856127", "0.5847412", "0.58323914", "0.58321905", "0.58045703", "0.5801045", "0.5784709", "0.5774353", "0.57731783", "0.57712454", "0.57474524", "0.5698502", "0.5696243", "0.5681158", "0.56620026", "0.5628537", "0.5624231", "0.5620055", "0.56126344", "0.5609811", "0.56072384", "0.56004447", "0.5596298", "0.5595872", "0.55858207", "0.55821", "0.55774647", "0.5569907", "0.5566776", "0.55666", "0.55660075", "0.555999", "0.55420065", "0.55293494", "0.552591", "0.55244756", "0.5522071", "0.5517746", "0.5506378", "0.5502418", "0.5499992", "0.549261", "0.54835516", "0.54781234", "0.54660124", "0.54617953", "0.5460388", "0.5460388", "0.54598606", "0.54498404", "0.54394543", "0.5429891", "0.542645", "0.5417922", "0.54172534", "0.54110587", "0.53924423", "0.5370248", "0.5366166", "0.536287", "0.5356087", "0.534929", "0.5347878" ]
0.7007155
1
Set permissions for a photo.
function photos_setPerms ($photo_id, $is_public = 1, $is_friend = 0, $is_family = 0, $perm_comment = 3, $perm_addmeta = 3) { $response = $this->execute(array('method' => 'flickr.photos.setPerms', 'photo_id' => $photo_id, 'is_public' => $is_public, 'is_friend' => $is_friend, 'is_family' => $is_family, 'perm_comment' => $perm_comment, 'perm_addmeta' => $perm_addmeta)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPermissions($permissions) {}", "public function setPhotoAccess($value)\n {\n return $this->set('PhotoAccess', $value);\n }", "public function setPermissions($permissions);", "public function SetPermissions ($permissions);", "public function setObjectPermissions(array $permissions): void;", "public function setPermissions() {\r\n\t\tif ($this->canSave) {\r\n\t\t\t$this->canSave = $this->resource->checkPolicy('save');\r\n\t\t}\r\n\t\t$this->canEdit = $this->modx->hasPermission('edit_document');\r\n\t\t$this->canCreate = $this->modx->hasPermission('new_document');\r\n\t\t$this->canPublish = $this->modx->hasPermission('publish_document');\r\n\t\t$this->canDelete = ($this->modx->hasPermission('delete_document') && $this->resource->checkPolicy(array('save' => true, 'delete' => true)));\r\n\t\t$this->canDuplicate = $this->resource->checkPolicy('save');\r\n\t}", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "protected function setApplicationPermissions()\n\t{\n\t\t$base = $this->app['path.base'].'/';\n\t\t$app = str_replace($base, null, $this->app['path']);\n\t\t$storage = str_replace($base, null, $this->app['path.storage']);\n\t\t$public = str_replace($base, null, $this->app['path.public']);\n\n\t\t$this->setPermissions($app.'/database/production.sqlite');\n\t\t$this->setPermissions($storage);\n\t\t$this->setPermissions($public);\n\t}", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "protected function setPermissions($filePath, $overrideFilePermissions)\n\t{\n\t\tif ($overrideFilePermissions) {\n\t\t\tchmod($filePath, $overrideFilePermissions & ~umask());\n\t\t}\n\t\telseif (is_null($overrideFilePermissions)) {\n\t\t\tchmod($filePath, 0666 & ~umask());\n\t\t}\n\t}", "public function setPhoto(Photo $photoObject);", "public function givePermission($permissions);", "function setFilePermission (string $path) : void {\n\n\tif (PHP_OS_FAMILY === \"Windows\") return;\n\t$iterator = null;\n\tif (!is_dir($path)) {\n\t\t$iterator = [$path];\n\t} else {\n\t\t$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));\n\t}\n\n\tforeach ($iterator as $item) {\n\t\t@chmod($item, octdec(getConfig(\"UNIX_FILE_PERMISSIONS\")));\n\t\t@chgrp($item, getConfig(\"UNIX_FILE_GROUP\"));\n\t}\n}", "protected function editLockPermissions() {}", "public function attachPermissions($permissions);", "final public function setPermission(int $value):void\n {\n $this->permission = $value;\n }", "public function testPostPermissionsToResource_addsPermissionCorrectly() {\r\n $this->jc->putResource('/', $this->test_folder);\r\n $resource = JasperTestUtils::createImage($this->test_folder);\r\n $this->jc->putResource('', $resource, dirname(__FILE__).'/resources/pitbull.jpg');\r\n $resource = $this->jc->getResource($resource->getUriString());\r\n $joeuser = $this->jc->getUsers('joeuser');\r\n $perms = $this->jc->getPermissions($resource->getUriString());\r\n\r\n $perm = new Permission('32', $joeuser[0], $resource->getUriString());\r\n $perms[] = $perm;\r\n $this->jc->updatePermissions($resource->getUriString(), $perms);\r\n\r\n $updated_perms = $this->jc->getPermissions($resource->getUriString());\r\n\r\n $this->jc->deleteResource($this->test_folder->getUriString());\r\n\r\n $this->assertEquals(sizeof($perms), sizeof($updated_perms));\r\n $this->assertEquals($perm->getPermissionMask(), $updated_perms[count($updated_perms)-1]->getPermissionMask());\r\n $this->assertEquals($perm->getPermissionRecipient(), $updated_perms[count($updated_perms)-1]->getPermissionRecipient());\r\n }", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"uploads\";\n $destination_path = \"products\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function setPermissions(array $permissions = [])\n {\n $this->setType($permissions['users'][$this->user()->name] ?? null);\n $this->permissions = $permissions['permissions'][$this->type];\n }", "protected function setApplicationPermissions()\n {\n $files = (array) $this->rocketeer->getOption('remote.permissions.files');\n foreach ($files as &$file) {\n $this->setPermissions($file);\n }\n\n return true;\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function is_allowed_to_set_content_object_rights();", "public function setIdentityCardPhotosAttribute($value)\n {\n $attribute_name = \"identity_card_photos\";\n $disk = 'contects';\n $destination_path = \"contects/images\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function givePermission($permission);", "public function givePermission($permission);", "function set_permissions($permessi_abilitati)\n {\n $permissions_data=$this->config->item(\"permissions\");\n $permissions_data=array_reverse($permissions_data['mask'],true);\n\n foreach($permissions_data as $value)\n {\n if(in_array($value,array_keys($permessi_abilitati)))\n $this->_permissions[$value]=$permessi_abilitati[$value];\n else\n $this->_permissions[$value]=false;\n }\n\n $bitmask=$this->to_bitmask($this->_permissions);\n return($bitmask);\n }", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::permissions([\n 'create',\n 'read',\n 'update',\n 'delete',\n ]);\n }", "public function setPhoto(string $photo): void\n {\n $this->photo = $photo;\n }", "public function testUpdatePermissionSet()\n {\n }", "private function setPerms($file, $isDir)\n {\n $perm = substr(sprintf(\"%o\", fileperms($file)), -4);\n $dirPermissions = \"0777\";\n $filePermissions = \"0777\";\n\n if ($isDir && $perm != $dirPermissions) {\n chmod($file, octdec($dirPermissions));\n } else if (!$isDir && $perm != $filePermissions) {\n chmod($file, octdec($filePermissions));\n }\n\n flush();\n }", "static function set_sharing_permissions($user_id, $word_list_id, $email, $permissions) {\n $share_with_id = self::email2id($email);\n if ($share_with_id == $user_id) return -1;\n\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `share` WHERE `user` = '\".$share_with_id.\"' AND `list` = '\".$word_list_id.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) {\n $sql = \"INSERT INTO `share` (`user`, `list`, `permissions`, `time`) VALUES (\".$share_with_id.\", \".$word_list_id.\", \".$permissions.\", \".time().\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n } else {\n $sql = \"UPDATE `share` SET `permissions` = $permissions, `time` = \".time().\" WHERE `list` = \".$word_list_id.\" AND (`user` = \".$share_with_id.\");\";\n $query = mysqli_query($con, $sql);\n return 2;\n }\n return 0;\n }", "public function setPermissions(int $mode): void\n {\n /** @psalm-suppress InvalidArgument */\n if (!\\msg_set_queue($this->queue, ['msg_perm.mode' => $mode])) {\n throw new SyncException('Failed to change the semaphore permissions.');\n }\n }", "public function authorize()\n {\n return \\Gate::allows('add_picture');\n }", "public function setPermissionsAttribute($permissions)\n\t{\n\t\t$this->attributes['permissions'] = serialize($permissions);\n\t}", "private function savePermissions(): void\n {\n $this->client->isPayor = $this->isPayor;\n $this->client->isAgencyBankAccountSetup = $this->isAgencyBankAccountSetup;\n $this->client->canViewDocumentation = $this->canViewDocumentation;\n }", "public static function setPermission($event)\n\t{\n\t\t$options = array_merge([\n\t\t\tself::EXTRA_WRITABLE => [],\n\t\t\tself::EXTRA_EXECUTABLE => [],\n\t\t], $event->getComposer()->getPackage()->getExtra());\n\n\t\tforeach ((array)$options[self::EXTRA_WRITABLE] as $path) {\n\t\t\techo \"Setting writable: $path ...\";\n\t\t\tif (is_dir($path)) {\n\t\t\t\tchmod($path, 0777);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"The directory was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tforeach ((array)$options[self::EXTRA_EXECUTABLE] as $path) {\n\t\t\techo \"Setting executable: $path ...\";\n\t\t\tif (is_file($path)) {\n\t\t\t\tchmod($path, 0755);\n\t\t\t\techo \"done\\n\";\n\t\t\t} else {\n\t\t\t\techo \"\\n\\tThe file was not found: \" . getcwd() . DIRECTORY_SEPARATOR . $path . \"\\n\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "static function set_sharing_permissions_by_sharing_id($user_id, $id, $permissions) {\n global $con;\n\n $sql = \"\n\t\tUPDATE `share`, `list`\n\t\tSET `share`.`permissions` = \".$permissions.\", `share`.`time` = \".time().\"\n\t\tWHERE `share`.`id` = \".$id.\" AND (`list`.`id` = `share`.`list` AND `list`.`creator` = \".$user_id.\" OR `share`.`user` = \".$user_id.\");\";\n $query = mysqli_query($con, $sql);\n return 1;\n }", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "public function setImageAttribute($value)\n {\n $attribute_name = \"photo\";\n $disk = \"uploads\";\n $destination_path = \"images/\";\n $this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function attachPermission($permission);", "public function updatePermissions()\n {\n if(! array_key_exists( 'permissions', $this->options['paths'] )) {\n return;\n }\n $file = base_path($this->options['paths']['stubs']) . '/views/components/permissions.blade.php';\n $target = base_path($this->options['paths']['permissions']);\n $hook = '<!-- bread_permissions -->';\n $this->updateFileContent($target, $hook, $file);\n }", "public function setPermissions()\n\t{\n\t\treturn [\n\t\t\t'product.create',\n\t\t 'issue.create',\n\t\t 'issue.edit'\n\t\t];\n\t}", "protected function _actionSetprivacy($context)\n\t{\n\t\t$data = $context->data;\n\t\t$names = KConfig::unbox($data->privacy_name);\n\t\t\n\t\tsettype($names, 'array');\n\t\t\n\t\tforeach($names as $name)\n\t\t\t$this->getItem()->setPermission($name, $data->$name);\t\n\t}", "protected function setPhoto(string $photo)\r\n\t{\r\n\t\t$this->photo = $photo;\r\n\t}", "public function setPhotoAttribute($photo)\n {\n if($photo === '') {\n return;\n }\n $this->attributes['photo'] = $photo;\n }", "static function changePhoto() {\n\t\t\n\t\t$case_intra = rcube_utils::get_input_value('photo_intra', RCUBE_INPUT_POST);\n\t\t$case_ader = rcube_utils::get_input_value('photo_ader', RCUBE_INPUT_POST);\n\n\t\t$info = array();\n\t\tif ( !empty($case_intra) && $case_intra == '1') {\n\t\t\t$info['mineqpublicationphotointranet'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotointranet'] = 0;\n\t\t}\n\t\t\n\t\tif ( !empty($case_ader) && $case_ader == '1' && !empty($case_intra) && $case_intra == '1')\n\t\t{\n\t\t\t$info['mineqpublicationphotoader'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotoader'] = 0;\n\t\t}\n\t\t\t\n\t\t$user_infos = melanie2::get_user_infos(Moncompte::get_current_user_name());\n\t\t\n\t\t$user_dn = $user_infos['dn'];\n\t\t$password = rcmail::get_instance()->get_user_password();\n\t\t\n\t\t$auth = Ldap::GetInstance(Config::$MASTER_LDAP)->authenticate($user_dn, $password);\n\t\t\n\t\tif(Ldap::GetInstance(Config::$MASTER_LDAP)->modify($user_dn, $info)) {\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_ok', 'melanie2_moncompte'), 'confirmation');\n\t\t} else {\n\t\t\t$err = Ldap::GetInstance(Config::$MASTER_LDAP)->getError();\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_nok', 'melanie2_moncompte') . $err, 'error');\n\t\t}\n\t\t\n\t}", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"public_folder\";\n $destination_path = \"uploads/albums\";\n $album_originalName = $_POST['name'];\n // ******** Generate unique album name ********\n $album_name = md5( $album_originalName . time() );\n \n foreach ( $value as $file ) {\n // 0. Generate new size file\n $image = \\Image::make( $file );\n $image_350 = \\Image::make( $file ) -> widen( 350 );\n \n // 1. Generate new file names\n $new_file_name = md5( $file -> getClientOriginalName() . time() ).'.'.$file->getClientOriginalExtension();\n $new_file_name_350 = md5( $file -> getClientOriginalName() . time() ).'_350.'.$file->getClientOriginalExtension();\n \n // 2. Move new files to the correct path\n $file_path = $destination_path . '/' . $album_name . '/' . $new_file_name;\n $file_path_350 = $destination_path . '/' . $album_name . '/' . $new_file_name_350;\n \\Storage::disk( $disk )->put( $file_path, $image -> stream() );\n \\Storage::disk( $disk )->put( $file_path_350, $image_350 -> stream() );\n \n // 3. Add the public path to the database\n $attribute_value[] = [ $file_path, $file_path_350 ];\n }\n $this->attributes[$attribute_name] = str_replace( '\\\\', '', json_encode($attribute_value) );\n }", "function havp_set_file_access($dir, $owner, $mod) {\n\tif (file_exists($dir)) {\n\t\tmwexec(\"/usr/bin/chgrp -R -v $owner $dir\");\n\t\tmwexec(\"/usr/sbin/chown -R -v $owner $dir\");\n\t\tif (!empty($mod)) {\n\t\t\tmwexec( \"/bin/chmod -R -v $mod $dir\");\n\t\t}\n\t}\n}", "public static function setPermissions(array $paths)\n {\n foreach ($paths as $path => $permission) {\n if (is_dir($path) || is_file($path)) {\n try {\n if (chmod($path, octdec($permission))) {\n Console::stdout(\"chmod('$path', $permission). Done.\", Console::FG_GREEN);\n };\n } catch (Exception $e) {\n Console::stderr($e->getMessage(), Console::FG_RED);\n }\n } else {\n Console::stderr('File not found', Console::FG_RED);\n }\n }\n }", "public function silo_permissions($path)\r\n\t{\r\n\t}", "public function silo_permissions($path)\n\t{\n\t}", "public function getFileOperationPermissions() {}", "private function applyPermissions(string $cacheFile): void\n {\n if (! chmod($cacheFile, (int) $this->config['mode'])) {\n trigger_error(sprintf(\n 'Unable to set %s permission for %s',\n $this->config['mode'],\n $cacheFile\n ), E_USER_WARNING);\n }\n }", "public function setAdminPermissions(array $permissions): void;", "public function setFotoAttribute($value)\n\t{\n\t\t$attribute_name = \"foto\";\n\t\t$disk = \"public\";\n\t\t$destination_path = \"images/fotos-patrocinadores\";\n\t\t$this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);\n\t}", "function setAutoAssignPermissions($value) {\n \treturn parent::setAutoAssignPermissions(serialize($value));\n }", "private function batch_patch_permissions($calls) {\n $this->client->setUseBatch(true);\n try {\n $batch = $this->service->createBatch();\n\n foreach ($calls as $call) {\n $patchedpermission = new Google_Service_Drive_Permission();\n $patchedpermission->setRole($call->role);\n $request = $this->service->permissions->patch($call->fileid, $call->permissionid, $patchedpermission);\n $batch->add($request);\n }\n\n $results = $batch->execute();\n\n foreach ($results as $result) {\n if ($result instanceof Google_Service_Exception) {\n debugging($result);\n }\n }\n } finally {\n $this->client->setUseBatch(false);\n }\n }", "public function setFotoAttribute($value)\n\t{\n\t\t$attribute_name = \"foto\";\n\t\t$disk = \"public\";\n\t\t$destination_path = \"images/fotos-proyectos\";\n\t\t$this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);\n\t}", "public function changePhotoAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LISTING ID\n $this->view->listing_id = $listing_id = $this->_getParam('listing_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ITEM\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview);\n //IF THERE IS NO SITEREVIEW.\n if (empty($sitereview)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n //SELECTED TAB\n $this->view->TabActive = \"profilepicture\";\n\n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n //AUTHORIZATION CHECK\n $allowed_upload_photo = Engine_Api::_()->authorization()->isAllowed($sitereview, $viewer, \"photo_listtype_$listingtype_id\");\n if (Engine_Api::_()->sitereviewpaidlisting()->allowPackageContent($sitereview->package_id, \"photo\")) {\n $allowed_upload_photo;\n }\n else\n $allowed_upload_photo = 0;\n }\n else\n $allowed_upload_photo = Engine_Api::_()->authorization()->isAllowed($sitereview, $viewer, \"photo_listtype_$listingtype_id\");\n\n if (empty($allowed_upload_photo)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //AUTHORIZATION CHECK\n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if ($listingType->photo_type != 'listing') {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET FORM\n $this->view->form = $form = new Sitereview_Form_ChangePhoto();\n\n //CHECK FORM VALIDATION\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //CHECK FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //UPLOAD PHOTO\n if ($form->Filedata->getValue() !== null) {\n //GET DB\n $db = Engine_Api::_()->getDbTable('listings', 'sitereview')->getAdapter();\n $db->beginTransaction();\n //PROCESS\n try {\n //SET PHOTO\n $sitereview->setPhoto($form->Filedata);\n $db->commit();\n } catch (Engine_Image_Adapter_Exception $e) {\n $db->rollBack();\n $form->addError(Zend_Registry::get('Zend_Translate')->_('The uploaded file is not supported or is corrupt.'));\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n } else if ($form->getValue('coordinates') !== '') {\n $storage = Engine_Api::_()->storage();\n $iProfile = $storage->get($sitereview->photo_id, 'thumb.profile');\n $iSquare = $storage->get($sitereview->photo_id, 'thumb.icon');\n $pName = $iProfile->getStorageService()->temporary($iProfile);\n $iName = dirname($pName) . '/nis_' . basename($pName);\n list($x, $y, $w, $h) = explode(':', $form->getValue('coordinates'));\n $image = Engine_Image::factory();\n $image->open($pName)\n ->resample($x + .1, $y + .1, $w - .1, $h - .1, 48, 48)\n ->write($iName)\n ->destroy();\n $iSquare->store($iName);\n @unlink($iName);\n }\n\n $file_id = Engine_Api::_()->getDbtable('photos', 'sitereview')->getPhotoId($listing_id, $sitereview->photo_id);\n\n $photo = Engine_Api::_()->getItem('sitereview_photo', $file_id);\n\n if (!$sitereview->draft && time() >= strtotime($sitereview->creation_date)) {\n $action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitereview, 'sitereview_change_photo_listtype_' . $listingtype_id);\n\n if ($action != null) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity($action, $photo);\n }\n }\n\n if (!empty($sitereview->photo_id)) {\n $photoTable = Engine_Api::_()->getItemTable('sitereview_photo');\n $order = $photoTable->select()\n ->from($photoTable->info('name'), array('order'))\n ->where('listing_id = ?', $sitereview->listing_id)\n ->group('photo_id')\n ->order('order ASC')\n ->limit(1)\n ->query()\n ->fetchColumn();\n\n $photoTable->update(array('order' => $order - 1), array('file_id = ?' => $sitereview->photo_id));\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'change-photo', 'listing_id' => $listing_id), \"sitereview_dashboard_listtype_$listingtype_id\", true);\n }", "function setMode($mode)\n {\n $this->mode = $mode;\n $this->determineRequiredPermission();\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function setPermissions($a_parent_node_id, $a_node_id)\r\n\t{\r\n\t\t// nothing to do as owner has irrefutable rights to any portfolio object\r\n\t}", "public function grantPermissions($permissions): void\n {\n if (!is_array($permissions) && !$permissions instanceof Collection) {\n $permissions = func_get_args();\n }\n\n foreach ($permissions as $permission) {\n $permission = $this->resolvePermission($permission);\n\n $permission->assignTo($this);\n }\n }", "public function setAvatar(string $avatar);", "public function setRequiredPermissions($permissions = array())\n {\n $this->requiredPermissions = $permissions;\n }", "protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Yonetici'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Şirket hakkındaki herşeyi yapabilir'));\n\n Jetstream::role('editor', __('İlan Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece ilanları yönetebilir'));\n Jetstream::role('operasyon', __('Operasyon Yöneticisi'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Sadece operasyonları yönetebilir'));\n\n }", "public function attachPermissions($permissions, $reload = true);", "public function changeMode($files, $mode, $umask = 0000, $recursive = false);", "public function testPostPermissions_addsPermissionCorrectly() {\r\n\t\t$this->jc->putResource('/', $this->test_folder);\r\n\t\t$joeuser = $this->jc->getUsers('joeuser');\r\n\t\t$perms[] = new Permission('32', $joeuser[0], $this->test_folder->getUriString());\r\n\t\t$this->jc->updatePermissions($this->test_folder->getUriString(), $perms);\r\n\t\t$test_folder_perms = $this->jc->getPermissions($this->test_folder->getUriString());\r\n\t\t$this->jc->deleteResource($this->test_folder->getUriString());\r\n\t\t$this->assertEquals(sizeof($test_folder_perms), 1);\r\n\t\t$this->assertEquals($test_folder_perms[0]->getPermissionMask(), $perms[0]->getPermissionMask());\r\n\t\t$this->assertEquals($test_folder_perms[0]->getPermissionRecipient()->getUsername(), $perms[0]->getPermissionRecipient()->getUsername());\r\n\t}", "public function testPermissionSet()\n {\n }", "public function seta_permissoes()\n\t{\n\t\tif(!$this->auth->esta_autenticado())\n\t\t{\n\t\t\tredirect(URL_PREFIX, 'location');\n\t\t}else{\n\t\t\t$n_cod_user = $this->input->post('n_cod_user');\n\t\t\t$local = $this->input->post('local');\n\t\t\t$sessao = $this->input->post('sessao');\n\t\t\t$acao = $this->input->post('acao');\n\n\t\t\t$matriz = array('n_cod_user' => $n_cod_user,\n\t\t\t\t\t\t\t'c_sessao' => $local,\n\t\t\t\t\t\t\t'c_subsessao' => $sessao,\n\t\t\t\t\t\t\t'c_acao' => $acao);\n\t\t\t$valida = $this->gph_crud->buscar(DB_PREFIX.'permissoes', 'sql', $matriz);\n\t\t\tif($valida->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$this->gph_crud->excluir(DB_PREFIX.'permissoes', $matriz);\n\t\t\t\techo '<img src=\"'.base_url('sites/admin/_images/botoes/auto_off.jpg').'\" width=\"66\" height=\"28\" />';\n\t\t\t}else{\n\t\t\t\t$this->gph_crud->adiciona(DB_PREFIX.'permissoes', $matriz);\n\t\t\t\techo '<img src=\"'.base_url('sites/admin/_images/botoes/auto_on.jpg').'\" width=\"66\" height=\"28\" />';\n\t\t\t}\n\t\t}\n\t}", "public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }", "public function permissions(Storable $storable, Acl $acl): void;", "public function addPhoto($value)\n {\n $this->photos[] = $value;\n }", "public function setRequiredPermissions($permissionNames)\n\t{\n\t}", "public function setPermission(Request $request)\n {\n $input = $request->all();\n $roles = $this->roleRepository->all();\n $permissionsSync = [];\n foreach ($roles as $role) {\n if (isset($input['roles'][$role->id])) {\n $permissionsSync = $input['roles'][$role->id]['permissions'];\n $role->permissions()->sync($permissionsSync);\n }\n }\n Session::flash('message', trans('permission.message.set_role'));\n return back();\n }", "public function assignPermission(...$permissions)\n {\n $permissions = collect($permissions)\n ->flatten()\n ->map(function ($permission) {\n if (is_string($permission)) {\n $permission = Permission::getByName($permission);\n }\n\n return $permission;\n });\n\n $this->permissions()->saveMany($permissions);\n\n if (config('permissionsHandler.seeder') == true) {\n Seeder::assignPermissionsToRole($this, $permissions);\n }\n\n $this->clearRelatedCache();\n }", "public function setFileExtensionPermissions($allowedFilePermissions, $deniedFilePermissions)\n {\n $this->fileExtensionPermissions['allow'] = GeneralUtility::uniqueList(strtolower($allowedFilePermissions));\n $this->fileExtensionPermissions['deny'] = GeneralUtility::uniqueList(strtolower($deniedFilePermissions));\n }", "public function setChatPhoto($chat_id,$photo)\n {\n return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());\n }", "public function setPermissions($folder)\n\t{\n\t\t$commands = array();\n\n\t\t// Get path to folder\n\t\t$folder = $this->releasesManager->getCurrentReleasePath($folder);\n\t\t$this->command->comment('Setting permissions for '.$folder);\n\n\t\t// Get permissions options\n\t\t$callback = $this->rocketeer->getOption('remote.permissions.callback');\n\t\t$commands = (array) $callback($this, $folder);\n\n\t\t// Cancel if setting of permissions is not configured\n\t\tif (empty($commands)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($commands);\n\t}", "public function setPicture($picture) {\n $this->picture = $picture;\n }", "public function setRights($rights) {\n $this->set('rights', $rights, 'user');\n }", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n \n return $this;\n }", "public function setHasPhotoAttribute($has_photo)\n {\n $this->attributes['has_photo'] = $has_photo == 1 || $has_photo === 'true' || $has_photo === true ? true : false;\n }", "protected function assignPermissions()\n {\n $role = Role::whereName(config('system.default_role.admin'))->first();\n $role->syncPermissions(config('system.default_permission'));\n }", "public function savePermissions($inputPermissions);", "public function allow($resourceType, $folderPath, $permission, $role);", "public function canSetFileable();", "public function setPhoto($file) {\n\n if(!empty($file['name'])){\n //Identificando o tipo de arquivo ****\n //Verificando a extensão\n $extension = explode('.', $file['name']);\n $extension = end($extension);\n switch ($extension) {\n case \"jpg\":\n case \"jpeg\":\n $image = imagecreatefromjpeg($file[\"tmp_name\"]);\n break;\n case \"gif\":\n $image = imagecreatefromgif($file[\"tmp_name\"]);\n break;\n case \"png\":\n $image = imagecreatefrompng($file[\"tmp_name\"]);\n break;\n }\n\n //Definido caminho e nome para imagem\n $dist = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR .\n \"res\" . DIRECTORY_SEPARATOR .\n \"site\" . DIRECTORY_SEPARATOR .\n \"img\" . DIRECTORY_SEPARATOR .\n \"products\" . DIRECTORY_SEPARATOR .\n $this->getidproduct() . \".jpg\";\n imagejpeg($image, $dist);\n imagedestroy($image);\n }\n $this->checkPhoto();\n }", "public function set_download_permissions_granted( $order, $set ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\tupdate_post_meta( $order_id, '_download_permissions_granted', wc_bool_to_string( $set ) );\n\t}", "public function attachPermission($names)\n {\n if (!is_array($names)) {\n $names = [$names];\n }\n\n $permissionIds = Permission::whereIn('name', $names)->pluck('id')->toArray();\n $this->permissions()->attach(array_fill_keys($permissionIds, ['has_access' => true]));\n }", "public function setIsMultiplePhotoAttribute($is_multiple_photo)\n {\n $this->attributes['is_multiple_photo'] = $is_multiple_photo == 1 || $is_multiple_photo === 'true' || $is_multiple_photo === true ? true : false;\n }", "public function chmod($path, $umask);", "public function setAtomPermissions($group_id, $atom_id, $permissions)\n {\n if ($this->getEntityType($group_id) != Constants::ENTITY_GROUP || $this->getEntityType($atom_id) != Constants::ENTITY_ATOM)\n throw new \\Exception(\"Atom or Group doesn't exist\", Constants::ERR_ENTITY_NONEXISTENT);\n\n if ($permissions == Constants::PERM_NONE) {\n// echo \"DELETE FROM group_permissions WHERE group_id='$group_id' AND atom_id='$atom_id'\";\n $this->queryW(\"DELETE FROM group_permissions WHERE group_id='$group_id' AND atom_id='$atom_id'\");\n } else\n\n $this->queryW(\"INSERT INTO group_permissions (group_id, atom_id, permissions) VALUES ('$group_id', '$atom_id', '$permissions') ON DUPLICATE KEY UPDATE group_id='$group_id', atom_id='$atom_id', permissions='$permissions'\");\n }" ]
[ "0.65165776", "0.6263768", "0.6248518", "0.6239904", "0.6045777", "0.5961811", "0.5930788", "0.5808552", "0.57129014", "0.56097484", "0.55647796", "0.5544397", "0.5507477", "0.54466844", "0.5418625", "0.54142654", "0.53981376", "0.53898114", "0.5372746", "0.53506577", "0.53106105", "0.5287578", "0.5287578", "0.5286442", "0.5268198", "0.5219087", "0.5219087", "0.51913226", "0.5144686", "0.5139572", "0.51391125", "0.51387817", "0.51365894", "0.51021117", "0.5090823", "0.5073913", "0.5068861", "0.5055253", "0.5040663", "0.50315636", "0.50210726", "0.5012431", "0.5011411", "0.4974872", "0.49711317", "0.49696907", "0.4963677", "0.49577516", "0.4949337", "0.49424058", "0.4928923", "0.49163783", "0.49124256", "0.49028814", "0.48966476", "0.4889855", "0.48760074", "0.48702824", "0.48648348", "0.4863477", "0.4863084", "0.48617357", "0.4858434", "0.4858434", "0.4858434", "0.4858434", "0.4858434", "0.48550898", "0.48479357", "0.48156846", "0.4815482", "0.48105225", "0.48093587", "0.4796916", "0.47959766", "0.47748548", "0.47581387", "0.47489733", "0.47468942", "0.47362655", "0.473256", "0.47308007", "0.47017398", "0.46970794", "0.4694747", "0.46886393", "0.46871245", "0.46862242", "0.468539", "0.4683342", "0.4674185", "0.46645385", "0.46607986", "0.46604025", "0.46602756", "0.465507", "0.4653802", "0.4652851", "0.46503478", "0.46474144" ]
0.66612005
0
Set the safety level of a photo.
function photos_setSafetyLevel ($photo_id, $safety_level = 1, $hidden = 0) { $response = $this->execute(array('method' => 'flickr.photos.setSafetyLevel', 'photo_id' => $photo_id, 'safety_level' => $safety_level, 'hidden' => $hidden)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLevel($level);", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "public function setLevel($level);", "public function set_level($value) {\n\t\tif (is_anint($value)) {\n\t\t\t$this->init_from_type_and_level($this->type, $value);\n\t\t}\n\t}", "public function setCover($value)\n {\n if (!array_key_exists('cover', $this->fieldsModified)) {\n $this->fieldsModified['cover'] = $this->data['fields']['cover'];\n } elseif ($value === $this->fieldsModified['cover']) {\n unset($this->fieldsModified['cover']);\n }\n\n $this->data['fields']['cover'] = $value;\n }", "public function setCoverAttribute($value) {\n\n\t\tif (!$this->preventAttrSet) {\n\t\t\t$field_name = 'profile.cover';\n\t\t\t$attribute_name = 'cover';\n\t\t\t$disk = config('filesystems.default');\n\n\t\t\t// Set the right field name\n\t\t\t$request = \\Request::instance();\n\t\t\tif (!$request->hasFile($field_name)) {\n\t\t\t\t$field_name = $attribute_name;\n\t\t\t}\n\n\t\t\t// if (!isset($this->country_code) || !isset($this->user_id)) {\n\t\t\t// $this->attributes[$attribute_name] = null;\n\t\t\t// return false;\n\t\t\t// }\n\n\t\t\t// Path\n\t\t\t$destination_path = 'profile/cover/'. $this->user_id;\n\n\t\t\t// Upload\n\t\t\t$this->uploadFileToDiskCustom($value, $field_name, $attribute_name, $disk, $destination_path);\n\t\t} else {\n\t\t\t$this->attributes['cover'] = $value;\n\t\t}\n\t}", "public function initializeSecurityLevel() {\n\t\t// Standart level (GREEN).\n\t\t$this->securityLevel = self::SECURITYLEVEL_GREEN;\n\n\n\t\tif($this->XSSReport !== false) {\n\t\t\t$xssSecurityLevel = $this->XSSReport->getSecurityLevel();\n\t\t\tif($xssSecurityLevel < $this->securityLevel)\n\t\t\t\t$this->securityLevel = $xssSecurityLevel;\n\t\t}\n\t\t\t\n\t\tif($this->SQLInjectionReport !== false) {\n\t\t\t$sqlinjSecurityLevel = $this->SQLInjectionReport->getSecurityLevel();\n\t\t\tif($sqlinjSecurityLevel < $this->securityLevel)\n\t\t\t\t$this->securityLevel = $sqlinjSecurityLevel;\n\t\t}\n\t\t\t\n\t}", "function setImage( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n \n if ( get_class( $value ) == \"ezimage\" )\n {\n $this->ImageID = $value->id();\n }\n elseif( is_numeric( $value ) )\n {\n $this->ImageID = $value;\n }\n }", "public function setLevel($level) {\n $this->level = $level;\n }", "public function setMinDamage(){ $this->minDamage = 10; }", "public function SetLevel($level)\n {\n $this->level = $level;\n }", "function setCompatibilityLevel($value)\n {\n $this->_props['CompatibilityLevel'] = $value;\n }", "private function setLevel()\n\t{\n\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_level` WHERE 1\");\n\t\tif ($level_count > 1) // binary level\n\t\t{\n\t\t\t$this->levelType = 1;\n\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_level` WHERE 1\");\n\t\t}else{\n\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_serial_type` WHERE 1\");\n\t\t\tif ($level_count > 1)\n\t\t\t{\n\t\t\t\t$this->levelType = 2;\n\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_serial_type` WHERE 1\");\n\t\t\t}else{\n\t\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\tif ($level_count > 2) // user group level\n\t\t\t\t{\n\t\t\t\t\t$this->levelType = 3;\n\t\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function setPhotoAccess($value)\n {\n return $this->set('PhotoAccess', $value);\n }", "public function setEscalationLevel($value)\n {\n $this->setItemValue('escalation_level', ['id' => (int)$value]);\n }", "public function setLevel(int $level) {\n\n $this->level = $level;\n\n }", "static function changePhoto() {\n\t\t\n\t\t$case_intra = rcube_utils::get_input_value('photo_intra', RCUBE_INPUT_POST);\n\t\t$case_ader = rcube_utils::get_input_value('photo_ader', RCUBE_INPUT_POST);\n\n\t\t$info = array();\n\t\tif ( !empty($case_intra) && $case_intra == '1') {\n\t\t\t$info['mineqpublicationphotointranet'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotointranet'] = 0;\n\t\t}\n\t\t\n\t\tif ( !empty($case_ader) && $case_ader == '1' && !empty($case_intra) && $case_intra == '1')\n\t\t{\n\t\t\t$info['mineqpublicationphotoader'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotoader'] = 0;\n\t\t}\n\t\t\t\n\t\t$user_infos = melanie2::get_user_infos(Moncompte::get_current_user_name());\n\t\t\n\t\t$user_dn = $user_infos['dn'];\n\t\t$password = rcmail::get_instance()->get_user_password();\n\t\t\n\t\t$auth = Ldap::GetInstance(Config::$MASTER_LDAP)->authenticate($user_dn, $password);\n\t\t\n\t\tif(Ldap::GetInstance(Config::$MASTER_LDAP)->modify($user_dn, $info)) {\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_ok', 'melanie2_moncompte'), 'confirmation');\n\t\t} else {\n\t\t\t$err = Ldap::GetInstance(Config::$MASTER_LDAP)->getError();\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_nok', 'melanie2_moncompte') . $err, 'error');\n\t\t}\n\t\t\n\t}", "public function setVolume(int $volume): void // changing visibility level\n {\n parent::setVolume(volume: $volume); // uses only \"Abstraction\", not \"Implementor\"\n }", "public function setPower()\n {\n $this->_role->power = 200;\n }", "public function setPhoto(Photo $photoObject);", "public function setIllumination($value) {\n $this->illuminate = $value;\n }", "public function setLevel($level) \n {\n $level = abs(filter_var($level, FILTER_SANITIZE_NUMBER_INT));\n if($level < 1 || $level > 12)\n {\n throw new Exception('Level must be between 1, 12');\n } else {\n $this->level = $level;\n }\n }", "public function setPower()\n {\n $this->_role->power = 100;\n }", "public function setProtect($value) {\n\t}", "public function setImageAttribute($value)\n {\n $attribute_name = \"photo\";\n $disk = \"uploads\";\n $destination_path = \"images/\";\n $this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);\n }", "protected function setToLowestQuality(): void\n {\n $this->getItem()->quality = $this->getLowestQuality();\n }", "public function set(Photo $photo)\n\t{\n\t\t$this->photo_id = $photo->id;\n\t\t$this->timestamps = false;\n\t\t// we set up the created_at\n\t\t$now = now();\n\t\t$this->created_at = $now;\n\t\t$this->updated_at = $now;\n\n\t\tforeach (self::VARIANT_2_INDICATOR_FIELD as $variant => $indicator_field) {\n\t\t\tif ($photo->{$indicator_field} !== null && $photo->{$indicator_field} !== 0 && $photo->{$indicator_field} !== '') {\n\t\t\t\t$this->create($photo, $variant, strval($now));\n\t\t\t}\n\t\t}\n\t}", "public function setIntensity($intensity) {}", "function setIssueLevel( $sessionID, $issueID, $level ){\r\n\t \tif($this->userCanSetIssueLevel( $sessionID, $issueID )){\r\n\t \t\t$userID = $_SESSION[ 'userid' ];\r\n\t\t\t$this->sendIssueAlerts($issueID, 'Issue level changed.');\r\n\t\t\t$query=\"UPDATE issues SET Modifier='$userID', Level='$level' WHERE ID='$issueID'\";\r\n\t\t\t$result=mysql_query($query);\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t}", "public function setImageMainAttribute($value)\n {\n $attribute_name = \"image_main\";\n $this->saveImageNormally($attribute_name, $value);\n }", "function setImageQuality($quality)\n {\n $this->imageQuality = $quality;\n }", "function setThumbQuality( $iThumbQuality = 80 ){\n $this->iQuality = $iThumbQuality;\n }", "public function setRenewalThresholdPercentage(?int $value): void {\n $this->getBackingStore()->set('renewalThresholdPercentage', $value);\n }", "function setSensitivity($sensitive) {\n\t\t$this->_sensitive = $sensitive;\n\t}", "public function setCover(SetAlbumCoverRequest $request): void\n\t{\n\t\t$request->album()->cover_id = $request->photo()?->id;\n\t\t$request->album()->save();\n\t}", "public function setRiskScore(?string $value): void {\n $this->getBackingStore()->set('riskScore', $value);\n }", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "public function setRisk($newRisk) {\r\n\t\t$this->ldlRisk = $newRisk;\r\n\t\t$this->cholRisk = $newRisk;\r\n\t}", "public function setCropBox($boundary, $checkBoundary = true) {}", "public function setCrit()\n {\n $this->_role->crit = 100;\n }", "public function setPhoto(string $photo): void\n {\n $this->photo = $photo;\n }", "function setLevel($level) {\n\t\tif (is_string($level)) {\n\t\t\tswitch (strtolower($level)) {\n\t\t\t\tcase \"debug\":\n\t\t\t\t\t$level = MC_LOGGER_DEBUG;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"info\":\n\t\t\t\t\t$level = MC_LOGGER_INFO;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"warn\":\n\t\t\t\tcase \"warning\":\n\t\t\t\t\t$level = MC_LOGGER_WARN;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"error\":\n\t\t\t\t\t$level = MC_LOGGER_ERROR;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"fatal\":\n\t\t\t\t\t$level = MC_LOGGER_FATAL;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$level = MC_LOGGER_FATAL;\n\t\t\t}\n\t\t}\n\n\t\t$this->_level = $level;\n\t}", "public function setQuality($value) {\n\t\t$this->_quality = $value;\n\t}", "public function setvol(int $vol): void\n {\n if ($vol > 100) {\n $vol = 100;\n }\n if ($vol < 0) {\n $vol = 0;\n }\n $this->client->execute(\"setvol {$vol}\");\n }", "public function setResistanceAttribute($value)\n {\n $this->attributes['resistance'] = $this->makeCollection($value);\n }", "public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }", "public function setStatus(?CloudPcGalleryImageStatus $value): void {\n $this->getBackingStore()->set('status', $value);\n }", "function setProfilePicture($a_status)\n\t{\n\t\t$this->ppic = (bool)$a_status;\n\t}", "public function updateQuality(): void\n {\n $this->getItem()->quality = $this->getNewQuality();\n\n if ($this->isQualityOverHighestValue()) {\n $this->setToHighestQuality();\n }\n if ($this->isQualityUnderLowestValue()) {\n $this->setToLowestQuality();\n }\n }", "public function setAttackSpeed()\n {\n $this->_role->attack_speed = 2.50;\n }", "public function setLevel($value)\n {\n return $this->set(self::LEVEL, $value);\n }", "public function setLevel($value)\n {\n return $this->set(self::_LEVEL, $value);\n }", "public function setLevel($value)\n {\n return $this->set(self::_LEVEL, $value);\n }", "public function setLevel($value)\n {\n return $this->set(self::_LEVEL, $value);\n }", "public function setLevel($value)\n {\n return $this->set(self::_LEVEL, $value);\n }", "public function setLevel($value)\n {\n return $this->set(self::_LEVEL, $value);\n }", "public function setLevel($value)\n {\n return $this->set(self::_LEVEL, $value);\n }", "public function setBatteryCapacityPoor(?int $value): void {\n $this->getBackingStore()->set('batteryCapacityPoor', $value);\n }", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "public function quality($quality = 100)\n {\n if(is_numeric($quality))\n {\n $this->quality = $quality;\n }\n else\n {\n trigger_error('Picture quality must be numeric', E_USER_WARNING);\n }\n }", "protected function setImageMagickDetailSettings() {}", "function setImageOrientation()\n\t{\n\n\t\tif ($this->width < $this->height) {\n\t\t\t$this->orientation = 'portrait';\n\t\t}\n\n\t\tif ($this->width > $this->height) {\n\t\t\t$this->orientation = 'landscape';\n\t\t}\n\n\t\tif ($this->width == $this->height) {\n\t\t\t$this->orientation = 'square';\n\t\t}\n\t}", "public function setResource(PersistentResource $resource)\n {\n throw new \\RuntimeException('Setting the resource on an ImageVariant is not supported.', 1366627480);\n }", "protected function setPhoto(string $photo)\r\n\t{\r\n\t\t$this->photo = $photo;\r\n\t}", "public function setBatteryCapacityFair(?int $value): void {\n $this->getBackingStore()->set('batteryCapacityFair', $value);\n }", "public function setLevel($level)\n {\n $this->level = $level;\n $this->childContainer->setLevel($level + 1);\n }", "public function SetThresh($threshold)\n {\n $this->thresh = $threshold;\n }", "public function setIneffectiveAttribute($value)\n {\n $this->attributes['ineffective'] = $this->makeCollection($value);\n }", "public function setResource(?EducationResource $value): void {\n $this->getBackingStore()->set('resource', $value);\n }", "public function setImg($name){\n if(is_null($this->getId())){\n return false;\n }\n\n $file = file_get_contents($name);\n\n if ( $file !== false ) {\n $name = 'cat-'.$this->getId().'-'.time().'.jpg';\n $this->getStorage()->store($name, $file);\n \n // update pictures for associated meal categories\n $this->updateAssociatedCategories();\n \n return true;\n }\n return false;\n }", "public function set_level($level = \"INFO\") {\n if(Validator::isa($level,\"string\") \n && ($k=array_search($level,$this->order))!==false) \n $this->level = $this->order[$k];\n else \n $this->level = \"INFO\";\n }", "public function setCameraBlocked(?bool $value): void {\n $this->getBackingStore()->set('cameraBlocked', $value);\n }", "protected function setProductivity()\n {\n $this->productivity = random_int(8, 12);\n }", "function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}", "function setMode($mode){\n\t\t//Switches the operating mode of\n\t\t//'ScaleTool'.\n\n\t\tif($mode == 'fit' || $mode == 'fill')\n\t\t\t$this->mode = $mode;\n\t}", "public function setSuperEffectiveAttribute($value)\n {\n $this->attributes['super_effective'] = $this->makeCollection($value);\n }", "private function setLevel( int$level )\n\t{\n\t\t$level-= $this->indentLevel;\n\n\t\tif( $level<=0 ){\n\t\t\t$this->closeGroups(-$level);\n\t\t}elseif( $level==1 ){\n\t\t\t$this->indentLevel+= 1;\n\t\t}else{\n\t\t\tthrow new Exception('Indent error.');\n\t\t}\n\t}", "public function setCrit()\n {\n $this->_role->crit = 0;\n }", "public function checkPhoto(Resource $model)\n {\n if (rhas('photo')) {\n $photo = photos()->create();\n $data = [];\n if (rhas('coordinates')) {\n \t$data['location'] = parser()->pointFromCoordinates(input('coordinates'));\n }\n $data['photo_uuid'] = $photo->uuid;\n $data['photo_url'] = config('storage.path') . 'photos/' . $photo->photo_url;\n $model->update($data);\n $model->photos()->attach($photo->uuid);\n }\n\n }", "public function setImageWidth($value)\n\t{\n\t\t$this->setViewState('ImageWidth',$value,'');\n\t}", "private static function setColorAsBit($controlLevel, &$color)\n\t{\n\t\t$color = $controlLevel + self::PIXELDIFF;\n\t\tif ($color > 255) {\n\t\t\t$color -= (2 * self::PIXELDIFF);\n\t\t}\n\n\t\treturn;\n\t}", "public function apply($resource){\n\t\t// Extract arguments\n\t\t@list(,$level)=func_get_args();\n\t\t$level=abs((int)$level);\n\t\tif(!$level){\n\t\t $level=5;\n\t\t}\n\t\t// Get resolution\n\t\t$width=imagesx($resource);\n\t\t$height=imagesy($resource);\n\t\tif(!$width || !$height){\n\t\t\tthrow new Exception(\"An error was encountered while getting image resolution\");\n\t\t}\n\t\t// Apply effect\n\t\t$x=0;\n\t\tdo{\n\t\t\t$y=0;\n\t\t\tdo{\n\t\t\t\t// Get current pixel color\n\t\t\t\tlist($r,$g,$b,$a)=$this->_getColorAt($resource,$x,$y);\n\t\t\t\t// Generate noise\n\t\t\t\t$z=rand(-$level,$level);\n\t\t\t\t// Define color\n\t\t\t\t$r+=$z;\n\t\t\t\t$g+=$z;\n\t\t\t\t$b+=$z;\n\t\t\t\tif($r<0)\t\t$r=0;\n\t\t\t\telseif($r>255)\t$r=255;\n\t\t\t\tif($g<0)\t\t$g=0;\n\t\t\t\telseif($g>255)\t$g=255;\n\t\t\t\tif($b<0)\t\t$b=0;\n\t\t\t\telseif($b>255)\t$b=255;\n\t\t\t\t// Define new pixel\n\t\t\t\timagesetpixel($resource,$x,$y,imagecolorallocatealpha($resource,$r,$g,$b,$a));\n\t\t\t}\n\t\t\twhile(++$y<$height);\n\t\t}\n\t\twhile(++$x<$width);\n\t\treturn $resource;\n\t}", "public function setSensitivity($val)\n {\n $this->_propDict[\"sensitivity\"] = intval($val);\n return $this;\n }", "public function setRatingAttribute($value)\n {\n $this->attributes['rating'] = $value ? (int) $value : 1;\n }", "function editRating($param, $sqlConnection)\r\n{\r\n\t$uid = intval($param['userID']);\r\n\t$aid = intval($param['albumID']);\r\n\t$rating = floatval($param['rating']);\r\n\t$sqlSuccess = get_sql_results($result, $sqlConnection,\r\n\t\t\t\"UPDATE Rates SET rating=$rating \".\r\n\t\t\t\"WHERE userID=$uid AND \".\r\n\t\t\t\"albumID=$aid\");\r\n\treturn $sqlSuccess;\r\n}", "function setImage($image) {\n\t\t$this->_image = $image;\n\t}", "public function setMediaBox($boundary, $checkBoundary = true) {}", "public function setPicture($picture) {\n $this->picture = $picture;\n }", "public function set_luminosity(int $newval): int\n {\n $rest_val = strval($newval);\n return $this->_setAttr(\"luminosity\", $rest_val);\n }", "public function setZoom($value) {\n\t}", "public function setDamage(int $damage)\n {\n if (is_int($damage)){\n $this->_damage = $damage;\n }\n }", "public function setImg($img)\n {\n $this->img = $img;\n\n \n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "private function __setOptimalSizeByPortrait() {\n \n $ratio = $this->__originalImageWidth / $this->__originalImageHeight;\n $newWidth = $this->__requestedHeight * $ratio;\n \n $this->__optimalWidth = $newWidth; \n $this->__optimalHeight = $this->__requestedHeight;\n \n }", "public function setLogLevel($level)\n {\n if (!is_int($level))\n {\n $level = constant('sfLogger::'.strtoupper($level));\n }\n\n $this->level = $level;\n }", "public function setSeverity($value)\n {\n $this->setItemValue('severity', ['id' => (int)$value]);\n }", "function setSign( $value )\r\n {\r\n $this->Sign = $value;\r\n }", "protected function set_cap() {\n \tif(!empty($this->get_db_identifier())) {\n\t \t$db_identifier = Collection::$db_identifier_prefix.$this->get_db_identifier().Collection::$db_identifier_sufix;\n\t \tif(!empty($db_identifier))\n\t \t{\n\t\t \t$post_type_obj = get_post_type_object($db_identifier);\n\t\t \tif(!is_object($post_type_obj)) {\n\t\t \t\tthrow new \\Exception(sprintf(\"Collection post type (%s) is not setted and cannot be registred\", $db_identifier));\n\t\t \t}\n\t\t \t$this->cap = $post_type_obj->cap;\n\t \t}\n \t}\n }", "public static function setPictureAsMain($picture_id, $room_id){\n\n // check whether id's were supplied by AJAX request\n if($picture_id !== null && $room_id !== null){\n\n // first set old main photo main column to 0\n if(static::unsetMainPhoto($room_id)){\n\n // set chosen photo as main\n $sql = 'UPDATE ' . static::$db_table . ' SET main = 1 WHERE id = :picture_id';\n $db = static::getDB();\n\n $stm = $db->prepare($sql);\n $stm->bindValue(':picture_id', $picture_id, PDO::PARAM_INT);\n\n return $stm->execute();\n\n }\n\n }\n\n return false;\n\n }" ]
[ "0.5569952", "0.5566912", "0.52600574", "0.5245245", "0.5139422", "0.50750405", "0.5073039", "0.5030286", "0.49861702", "0.49638963", "0.4949922", "0.49089298", "0.4855177", "0.48063585", "0.4759778", "0.47478795", "0.4747587", "0.47459194", "0.47209734", "0.47175965", "0.47132465", "0.47014716", "0.47009438", "0.46929023", "0.46896267", "0.46882755", "0.46839193", "0.46286592", "0.46266782", "0.46201408", "0.4618536", "0.4597199", "0.45712787", "0.45474762", "0.45472378", "0.45418197", "0.45404723", "0.44914433", "0.44774562", "0.4476649", "0.44632027", "0.44582137", "0.44471937", "0.44223285", "0.44211596", "0.44152793", "0.44145033", "0.4407893", "0.4401755", "0.43993968", "0.4395514", "0.43946767", "0.43946767", "0.43946767", "0.43946767", "0.43946767", "0.43946767", "0.43882298", "0.43754765", "0.43637207", "0.4363017", "0.43612844", "0.43606734", "0.4354487", "0.4339102", "0.43352944", "0.43344054", "0.43266118", "0.43251652", "0.43236706", "0.4317653", "0.4315003", "0.4314194", "0.42936397", "0.42926842", "0.4281231", "0.4280421", "0.42781615", "0.4272684", "0.42615995", "0.4259874", "0.4259365", "0.4254894", "0.42542374", "0.4239171", "0.42303866", "0.42236716", "0.4218261", "0.42158514", "0.42068568", "0.41983703", "0.41968688", "0.41957065", "0.41957065", "0.41924682", "0.41892695", "0.41797453", "0.41750938", "0.41721883", "0.41693944" ]
0.7159577
0
Set the tags for a photo.
function photos_setTags ($photo_id, $tags) { $response = $this->execute(array('method' => 'flickr.photos.setTags', 'photo_id' => $photo_id, 'tags' => $tags)); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_tags($tags) {\n $this->tags = $tags;\n }", "protected function setTags()\n {\n $this->authBasedTag();\n $this->nameBasedTag($this->relatedEntities);\n }", "public function setTags($tags)\n {\n $this->_tags = $tags;\n }", "public function setTags(Collection $tags)\n {\n throw new \\RuntimeException('Settings tags on an ImageVariant is not supported.', 1371237597);\n }", "function setTags($photo_id = false){\n\n\t\t/* Lets get some tags */\n\t\tif($photo_id){\n\n\t\t\t/* This is used on Photo Page */\n\t\t\t$tags = $this->getTags($photo_id);\n\n\t\t\t/* Start Output */\n\t\t\t$output = '';\n\t\t\tforeach($tags->photo->tags->tag as $tag){\n\t\t\t\t$output .= $tag->raw.', ';\n\t\t\t}\n\t\t} else {\n\t\t\t/* This is used on photo page */\n\t\t\t$tags = $this->getUserTags();\n\n\t\t\t/* Start Output */\n\t\t\t$output = '';\n\t\t\tforeach($tags->who->tags->tag as $tag){\n\t\t\t\t$output .= $tag->_content.', ';\n\t\t\t}\n\t\t}\n\n\t\t/* Sets global var */\n\t\t$this->tags = $output;\n\t\treturn $output;\n\t}", "public function setShowTags(SetAlbumTagsRequest $request): void\n\t{\n\t\t$request->album()->show_tags = $request->tags();\n\t\t$request->album()->save();\n\t}", "protected function setTags()\n {\n /*todo check role and flush based on tags*/\n $this->authBasedTag();\n }", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "public function setTags($tags)\n {\n $this->tags = is_array($tags) ? new ArrayCollection($tags) : $tags;\n }", "public function setTags($tags)\n {\n $this->tags = $tags;\n }", "public function setTags($tags)\n {\n $this->tags = $tags;\n }", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "public function setTagsFor($objectid, $tags) {\n $prevTags = $this->getTagsFor($objectid);\n if( !$prevTags ) {\n $prevTags = array();\n }\n $delTags = array_diff($prevTags, $tags);\n $insTags = array_diff($tags, $prevTags);\n\n $this->deleteTagsFor($objectid, $delTags);\n $this->addTagsFor($objectid, $insTags);\n }", "public function setPhoto(Photo $photoObject);", "public function setTags($value)\n {\n if (!array_key_exists('tags', $this->fieldsModified)) {\n $this->fieldsModified['tags'] = $this->data['fields']['tags'];\n } elseif ($value === $this->fieldsModified['tags']) {\n unset($this->fieldsModified['tags']);\n }\n\n $this->data['fields']['tags'] = $value;\n }", "public function setTags($t)\n\t{\n\t\tif (is_array($t)) {\n\t\t\t$this->tags = $t;\n\t\t}\n\t}", "public function setPhoto(string $photo): void\n {\n $this->photo = $photo;\n }", "public function setTags($newVal) {\n $this->tags = $newVal;\n }", "public function setTags(array $tags)\n\t{\n\t\t$this->clearTags();\n\n\t\tforeach ($tags as $tagName => $tagReference) {\n\t\t\t$this->addTag($tagName, $tagReference);\n\t\t}\n\t}", "public function setTags( ArrayCollection $tags )\n {\n $this->tags = $tags;\n }", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"uploads\";\n $destination_path = \"products\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public static function setTags(array $tags, bool $override = false): void\n {\n foreach ($tags as $name => $value) {\n static::setTag($name, $value, $override);\n }\n }", "public function setTags($tags) {\n\t\tTemplate::setSiteMetaTags($tags);\n\t}", "public function setTags($tags)\n {\n// $this->tags = is_array($tags) ? new ArrayCollection($tags) : $tags;\n $this->tags->clear();\n foreach($tags as $tag) {\n $this->tags->add($tag);\n }\n return $this;\n }", "public function set(Photo $photo)\n\t{\n\t\t$this->photo_id = $photo->id;\n\t\t$this->timestamps = false;\n\t\t// we set up the created_at\n\t\t$now = now();\n\t\t$this->created_at = $now;\n\t\t$this->updated_at = $now;\n\n\t\tforeach (self::VARIANT_2_INDICATOR_FIELD as $variant => $indicator_field) {\n\t\t\tif ($photo->{$indicator_field} !== null && $photo->{$indicator_field} !== 0 && $photo->{$indicator_field} !== '') {\n\t\t\t\t$this->create($photo, $variant, strval($now));\n\t\t\t}\n\t\t}\n\t}", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "protected function setPhoto(string $photo)\r\n\t{\r\n\t\t$this->photo = $photo;\r\n\t}", "public function setTag($value)\n {\n if ($value !== null) {\n $this->_params['tag'] = $value;\n } else {\n unset($this->_params['tag']);\n }\n }", "function add_tags($tags) {\n array_merge($this->tags, $tags);\n }", "public function setTags($tagList)\r\n {\r\n $this->data['props']['taglist'] = implode(',', $tagList);\r\n }", "function setTag($name, $value) {\n if( is_array($name)) {\n foreach( $name as $n => $v) {\n $this -> $n = $v ;\n }\n } else {\n $this -> $name = $value ;\n }\n }", "public function setTags(?array $value): void {\n $this->getBackingStore()->set('tags', $value);\n }", "public function setPhotoAttribute($photo)\n {\n if($photo === '') {\n return;\n }\n $this->attributes['photo'] = $photo;\n }", "function setupPreselectedTags() {\n\t\t$model_class = $this->modelClass;\n\t\t$tag_object = $this->$model_class->Tag;\n\t\t$selected_tags = array();\n\t\tif (isset($this->data['Tag'])) {\n\t\t\t$tags = $this->data['Tag'];\n\t\t\tforeach ($tags as $key => $tag) {\n\t\t\t\t$tag_id = (is_array($tag)) ? $tag['id'] : $tag;\n\t\t\t\t$tag_object->id = $tag_id;\n\t\t\t\tif (is_array($tag) && isset($tag['name'])) {\n\t\t\t\t\t$tag_name = $tag['name'];\n\t\t\t\t} else {\n\t\t\t\t\t$tag_name = $tag_object->field('name');\n\t\t\t\t}\n\t\t\t\t$selected_tags[] = array(\n\t\t\t\t\t'id' => $tag_id,\n\t\t\t\t\t'name' => $tag_name\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t$this->set('selected_tags', $selected_tags);\n\t}", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"public_folder\";\n $destination_path = \"uploads/albums\";\n $album_originalName = $_POST['name'];\n // ******** Generate unique album name ********\n $album_name = md5( $album_originalName . time() );\n \n foreach ( $value as $file ) {\n // 0. Generate new size file\n $image = \\Image::make( $file );\n $image_350 = \\Image::make( $file ) -> widen( 350 );\n \n // 1. Generate new file names\n $new_file_name = md5( $file -> getClientOriginalName() . time() ).'.'.$file->getClientOriginalExtension();\n $new_file_name_350 = md5( $file -> getClientOriginalName() . time() ).'_350.'.$file->getClientOriginalExtension();\n \n // 2. Move new files to the correct path\n $file_path = $destination_path . '/' . $album_name . '/' . $new_file_name;\n $file_path_350 = $destination_path . '/' . $album_name . '/' . $new_file_name_350;\n \\Storage::disk( $disk )->put( $file_path, $image -> stream() );\n \\Storage::disk( $disk )->put( $file_path_350, $image_350 -> stream() );\n \n // 3. Add the public path to the database\n $attribute_value[] = [ $file_path, $file_path_350 ];\n }\n $this->attributes[$attribute_name] = str_replace( '\\\\', '', json_encode($attribute_value) );\n }", "public function setTag($tag) {\n $this->_tag = $tag;\n }", "public function setTag($tag) {\n $this->_tag = $tag;\n }", "protected function saveTags()\n {\n $this->checkConstants();\n $articleId = $this->id;\n $tags = $this->tags;\n if ( $this->isNewRecord )\n {\n if ( !empty( $tags ) )\n {\n $this->addTags( $articleId, $tags );\n }\n }\n else\n {\n if ( is_array( $tags ) &&( !empty( $tags ) ) )\n {\n /*\n we received array with the same or different values of tags -\n in any case that will be an array with numbers\n */\n if ( is_numeric( $tags[0] ) )\n {\n $this->changeTags( $articleId, $tags );\n }\n /*\n if $tags was filled with models and user has removed from form all tags\n we will receive empty array and $tags will be the same as after initialization\n */\n elseif( is_object( $tags[0] ) )\n {\n $this->deleteAllTags( $articleId );\n }\n }\n }\n }", "public function set_with_tags($id, $data, $lifetime = NULL, array $tags = NULL);", "protected function setNewsTags() {\r\n\t\t$newsTags = $this->newsItem->getTags();\r\n\t\tforeach ($newsTags as $tag) {\r\n\t\t\t$this->newsTags[] = $tag->getTitle();\r\n\t\t}\r\n\t}", "public function setTags($val)\n {\n $this->_propDict[\"tags\"] = $val;\n return $this;\n }", "function photos_addTags ($photo_id, $tags) {\n $response = $this->execute(array('method' => 'flickr.photos.addTags', 'photo_id' => $photo_id, 'tags' => $tags));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "public function tag($tag) {\n $this->tag = $tag;\n }", "public function addPhoto($value)\n {\n $this->photos[] = $value;\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "public function set($title, $tags) {\n /*\n * For a new set of title and tags the guess has to be cleared first, because if the previous publication\n * actually had a guess and the current one doesnt without clearing it the previous one would be taken for\n * the current one as well.\n */\n $this->guess = '';\n\n $this->title = $title;\n $this->tags = $tags;\n\n $this->makeGuess();\n }", "public function setIdentityCardPhotosAttribute($value)\n {\n $attribute_name = \"identity_card_photos\";\n $disk = 'contects';\n $destination_path = \"contects/images\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "abstract public function setInstanceTags(array $tags, InstanceFilter $instances);", "public function setPictures(?array $pictures) : void\n {\n $this->set('pictures', $pictures, 'products');\n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "function set_book_tags( $id, $tags, $append = false ) {\r\n\treturn wp_set_post_tags($id, $tags, $append);\r\n}", "public function tags();", "public function setPhotoData($body) {\n\t\t$cnt = count($body['photos']['photo']);\n\t\t$num = rand(0, $cnt-1);\n\t\t$this->photo = $body['photos']['photo'][$num];\n\t}", "protected function setOgTags()\n {\n if ($this->arResult['OG_TAGS']['TITLE'])\n {\n Asset::getInstance()->addString('<meta property=\"og:title\" content=\"'.$this->arResult['OG_TAGS']['TITLE'].'\" />', true);\n }\n\n if ($this->arResult['OG_TAGS']['DESCRIPTION'])\n {\n Asset::getInstance()->addString('<meta property=\"og:description\" content=\"'.$this->arResult['OG_TAGS']['DESCRIPTION'].'\" />', true);\n }\n\n if ($this->arResult['OG_TAGS']['URL'])\n {\n Asset::getInstance()->addString('<meta property=\"og:url\" content=\"'.$this->arResult['OG_TAGS']['URL'].'\" />', true);\n }\n\n if ($this->arResult['OG_TAGS']['IMAGE'])\n {\n Asset::getInstance()->addString('<meta property=\"og:image\" content=\"'.$this->arResult['OG_TAGS']['IMAGE'].'\" />', true);\n }\n }", "private function set_tags($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"\\\\ArrayObject\");\n\t\tif (is_array($v)) $v = Client::array2ArrayObject($v);\n\t\t$this->m_tags = $v;\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "private function set_tags($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"\\\\ArrayObject\");\n\t\tif (is_array($v)) $v = Client::array2ArrayObject($v);\n\t\t$this->m_tags = $v;\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "public function setTags($value)\n {\n return $this->set('Tags', $value);\n }", "public function setTags($value)\n {\n return $this->set('Tags', $value);\n }", "public function setCommentTags($value)\n {\n if (!array_key_exists('comment_tags', $this->fieldsModified)) {\n $this->fieldsModified['comment_tags'] = $this->data['fields']['comment_tags'];\n } elseif ($value === $this->fieldsModified['comment_tags']) {\n unset($this->fieldsModified['comment_tags']);\n }\n\n $this->data['fields']['comment_tags'] = $value;\n }", "function initializeTagDialog() {\n include_once(PAPAYA_INCLUDE_PATH.'system/papaya_taglinks.php');\n if ($tags = papaya_taglinks::getInstance($this, 'tg')) {\n $tags->setLinkParams(\n $this->paramName,\n array(\n 'cmd' => $this->params['cmd'],\n 'file_id' => $this->params['file_id'],\n )\n );\n $this->layout->addRight($tags->getTagLinker('media', $this->params['file_id'], TRUE));\n } else {\n $this->addMsg(MSG_WARNING, $this->_gt('You don\\'t have the permission to tag files.'));\n }\n }", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "function testRemoveTag_UsingMessyTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('some thing!', 'a-nother.', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "public function setTags($tags)\n {\n if ( ! is_array($tags))\n {\n throw new \\InvalidArgumentException(\"setTags function only accepts an array of strings.\");\n }\n\n $this->tags = $tags;\n return $this;\n }", "public function getTags() {\n\t\t$tags = array();\n\t\tforeach ($this->photo->tags->tag as $tag) {\n\t\t\t$tags[] = (string) $tag;\n\t\t}\n\t\t\n\t\treturn $tags;\n\t}", "public function setMetaTags($seo)\n {\n $this->pageTitle = $seo->title;\n $this->keywords = $seo->keywords;\n $this->description = $seo->description;\n }", "public function setIgnoreTags(array $tags)\n {\n $this->ignoreTags = $tags;\n }", "public function tags()\r\n {\r\n }", "public function setATagParts() {}", "function setTagId($tagId)\n {\n $this->tagId = $tagId;\n }", "function testRemoveTag_UsingCleanTags() {\n foreach ($this->photo->getTags() as $tag) {\n $this->photo->removeTag($tag);\n }\n $this->photo->addTags(array('something', 'another', '2004'));\n sleep(1);\n\n $this->photo->removeTag('another');\n\n $result = $this->photo->getTags();\n $this->assertEquals(array('something', '2004'), $result);\n }", "public function setRemoveTags($tags) {\n\t\tforeach ($tags as $tag) {\n\t\t\t$this->setRemoveTag($tag);\n\t\t}\n\t}", "public function update($id)\n\t{\n\n // aqui validacion\n $post = Post::findOrFail($id);\n// $post->fill(Input::all());\n\n\n $usuario = Auth::user()->username;\n\n $tags = Input::get('tags');\n\n $etiquetas = explode(',', $tags);\n\n\n foreach($etiquetas as $etiqueta):\n $tag = new Tag();\n $tag->nombre = $etiqueta;\n $tag->save();\n// $tag->posts()->save($post);\n $post->tags()->attach($id);\n endforeach;\n\n\n\n /*$post->tags()->attach($id);*/\n\n\n\n\n $post->titulo = Input::get('titulo');\n $post->resumen = Input::get('resumen');\n $post->cuerpo = Input::get('cuerpo');\n $post->usuario_id = Auth::user()->id;\n $post->username = $usuario;\n $post->categoria_id = Input::get('categoria_id');\n\n // Foto\n if(Input::hasFile('foto'))\n {\n $imagen = Input::file('foto');\n $real_path = $imagen->getRealPath();\n $tipo = Input::file('foto')->getMimeType();\n\n switch($tipo)\n {\n case 'image/jpg': case 'image/jpeg': $ext = '.jpg'; break;\n case 'image/png': case 'image/pneg': $ext = '.png'; break;\n case 'image/gif': $ext = '.gif'; break;\n }\n\n $ruta = 'images/posts/';\n File::delete($post->foto); // Borrar la anterior\n\n $foto_name = uniqid().$ext;\n\n $ancho_in = Image::make($imagen)->width();\n $alto_in = Image::make($imagen)->height();\n\n if ($ancho_in > 800)\n {\n $ancho_out = 800;\n $prop = $ancho_in / $ancho_out;\n $alto_out = $alto_in / $prop;\n $alto_out = (int)$alto_out;\n\n Image::make($real_path)->resize($ancho_out, $alto_out)->save($ruta.$foto_name);\n //Image::make($real_path)->crop($ancho_out, 200)->save($ruta.$foto_name);\n }\n\n $post->foto = $ruta.$foto_name;\n }\n\n $post->save();\n return Redirect::to('posts')->with('mensaje', 'Post actualizado');\n\n\t}", "public function setTagList($taglist){\n\t\t$tags = explode(\",\",$taglist);\n\t\tforeach($tags as $tag) {\n\t\t\tif ($tag) $this->taglist .= \"'\".trim($tag).\"',\";\n\t\t}\n\t\t$this->taglist = substr($this->taglist, 0, -1);\n\t}", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n \n return $this;\n }", "public function tags()\n {\n // the passed URL path segments in the request.\n\n $tags = $this->request->getParam('pass');\n\n // Use the BookmarksTable to find tagged bookmarks.\n $bookmarks = $this->Bookmarks->find('tagged', [\n 'tags' => $tags\n ]);\n\n // Pass variables into the view template context.\n $this->set([\n 'bookmarks' => $bookmarks,\n 'tags' => $tags\n ]);\n }", "function set_allowed_tags( $allowed_tags = '' )\n {\n if ( !empty($allowed_tags) ) {\n $this->allowed_tags = $allowed_tags;\n }\n }", "public function setTags(&$var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->tags = $arr;\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function setImageAttribute($value)\n {\n $attribute_name = \"photo\";\n $disk = \"uploads\";\n $destination_path = \"images/\";\n $this->uploadFileToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function setPhoto(?string $photo)\n {\n $this->photo = $photo;\n\n return $this;\n }", "protected function getTags(){\n $tags = Tag::all();\n foreach ($tags as $tag){\n $this->tags[$tag->id] = $tag->tag;\n }\n }", "protected function save_all_post_tags( $tags = '', $content = '', $post = false ) {\n\t\t$this->set_object_terms( get_post( $post ), $tags, 'post_tag' );\n\t}", "public function updateTags($tags)\n {\n $tagtypes = ['disciplines' => 1, 'applications' => 2,\n 'techniques' => 3, 'facilities' => 4];\n\n $currentTags = $this->getTagIds();\n if (!empty($currentTags)) {\n // merge all input tags for comparison\n $inputTags = [];\n foreach ($tagtypes as $type) {\n if (!empty($tags[$type]) && is_array($tags[$type])) {\n array_merge($inputTags, $tags[$type]);\n }\n }\n // detach all tags that were not input\n foreach ($currentTags as $curTag) {\n if (!in_array($curTag, $inputTags)) {\n $this->tags()->detach($curTag);\n }\n }\n }\n\n foreach ($tagtypes as $type => $key) {\n if (!empty($tags[$type])) {\n foreach ($tags[$type] as $element) {\n $id = is_numeric($element)\n ? $element\n : Tag::create(['name' => $element,\n 'category' => 'Other', 'tagtype_id' => $key]);\n $this->tags()->attach($id);\n }\n }\n }\n }", "function convert_tag( &$obj )\n\t{\n\t\t// set default photo\n\t\t$obj->default_photo = $this->get_default_photo( $obj->id, 'tag' );\n\n\t\t// set default icon \n\t\t$obj->default_icon = $this->get_default_photo( $obj->id, 'tag-icon' );\n\n\t}", "public function setPhoto($photo)\n {\n $this->vkarg_photo = $photo;\n\n return $this;\n }", "public function setPhoto($photo)\n {\n $this->vkarg_photo = $photo;\n\n return $this;\n }", "public function setPhoto($photo)\n {\n if ($photo !== '') {\n $this->_photo = isset($photo) ? htmlspecialchars($photo) : $photo;\n } else {\n throw new Exception('Photo can be null but not empty');\n }\n }", "public function setPhoto($photo) {\n $photo = (string) $photo;\n $this->fields[\"photo\"] = $photo;\n\n return $this;\n }", "function photos_setMeta ($photo_id, $title, $description) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setMeta', 'photo_id' => $photo_id, 'title' => $title, 'description' => $description));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function setTag(string $name, string $value, bool $override = false): void\n {\n if (!isset(static::$tags[$name]) || $override) {\n static::$tags[$name] = new MetaTag($name, $value);\n } else {\n static::$tags[$name]->addValue($value);\n }\n }", "public function processTags($tags = null)\n {\n if (empty($tags)) {\n $tags = $this->tags;\n }\n foreach ($tags as $tag) {\n $this->tags[] = $tag;\n if (preg_match('/[A-Z]+\\-[\\d]+/', $tag)) {\n $this->setTicket($tag);\n continue;\n }\n if ($tag == 'Jira') {\n $this->setLogged(true);\n }\n }\n $this->tags = array_unique($this->tags);\n }", "public function setModifiersFromTags(): void\n {\n $hasFinalTag = count($this->getTags('final')) > 0;\n $hasProtectedTag = count($this->getTags('protected')) > 0;\n $hasPrivateTag = count($this->getTags('private')) > 0;\n $hasPublicTag = count($this->getTags('public')) > 0;\n $hasStaticTag = count($this->getTags('static')) > 0;\n $accessTags = $this->getTags('access');\n $hasAccessTag = count($accessTags) > 0;\n $flags = $this->modifiers ?? 0;\n\n if ($hasAccessTag) {\n $accessTag = strtolower(trim(implode('', $accessTags[0])));\n if ($accessTag === 'protected') {\n $hasProtectedTag = true;\n } elseif ($accessTag === 'private') {\n $hasPrivateTag = true;\n } elseif ($accessTag === 'public') {\n $hasPublicTag = true;\n }\n }\n\n if ($hasFinalTag) {\n $flags |= self::MODIFIER_FINAL;\n }\n if ($hasProtectedTag) {\n $flags |= self::MODIFIER_PROTECTED;\n }\n if ($hasPrivateTag) {\n $flags |= self::MODIFIER_PRIVATE;\n }\n if ($hasPublicTag) {\n $flags |= self::MODIFIER_PUBLIC;\n }\n if ($hasStaticTag) {\n $flags |= self::MODIFIER_STATIC;\n }\n\n $this->setModifiers($flags);\n }", "public function setTags(array $values = array())\n\t{\n\t\treturn $this->setDataAttribute('tags', $values);\n\t}", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }" ]
[ "0.6933218", "0.6773757", "0.67190623", "0.6684508", "0.6675219", "0.65931046", "0.65151954", "0.64920187", "0.64876664", "0.6467937", "0.6467937", "0.6242587", "0.6183994", "0.61774826", "0.6142818", "0.6123194", "0.607157", "0.60697037", "0.60673213", "0.6052014", "0.60146946", "0.597668", "0.5961052", "0.5936439", "0.5920155", "0.58645135", "0.58439", "0.58192337", "0.57788956", "0.5727384", "0.57244086", "0.56962466", "0.56949955", "0.5681699", "0.5666644", "0.5621961", "0.5621961", "0.55245805", "0.55113125", "0.5479064", "0.54676294", "0.54663825", "0.5464708", "0.54596305", "0.5450919", "0.5412946", "0.5402719", "0.5401852", "0.53945386", "0.53835434", "0.53806084", "0.5375952", "0.5364595", "0.53616667", "0.53423566", "0.53371465", "0.5325006", "0.5325006", "0.5318647", "0.5318647", "0.5317341", "0.52785856", "0.5263691", "0.5255938", "0.5255938", "0.52354646", "0.52291", "0.5221453", "0.5218424", "0.5209069", "0.51978683", "0.51832", "0.51796776", "0.5163902", "0.5148418", "0.514272", "0.5136997", "0.51361114", "0.5126623", "0.5117678", "0.5097147", "0.5069289", "0.50609994", "0.5056544", "0.50542307", "0.504219", "0.50416565", "0.50309366", "0.5008185", "0.5008185", "0.50051755", "0.4999821", "0.4997332", "0.4988999", "0.49752402", "0.49751508", "0.49710256", "0.49548924", "0.49548924", "0.49548924" ]
0.6941952
0
/ Photos::comments methods Add comment to a photo as the currently authenticated user.
function photos_comments_addComment ($photo_id, $comment_text) { $response = $this->execute(array('method' => 'flickr.photos.comments.addComment', 'photo_id' => $photo_id, 'comment_text' => $comment_text), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['comment']['id']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addComment($comment)\n\t{\n\t\t$comment->status=Comment::STATUS_APPROVED;\n\t\t$comment->photo_id=$this->id;\n\t\t$comment->author_id=Yii::app()->user->id;\n\t\treturn $comment->save();\n\t}", "public function addComment($photo_uid, $comment) {\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('INSERT INTO tx_cwtcommunity_photo_comments (pid, crdate, cruser_id, photo_uid, text) VALUES ('.tx_cwtcommunity_lib_common::getGlobalStorageFolder().',\"'.time().'\", \"'.tx_cwtcommunity_lib_common::getLoggedInUserUID().'\", \"'.$photo_uid.'\", \"'.$comment.'\");');\r\n\t}", "public function addCommentToThePhotoAction()\n {\n \t$param = $this->getRequest()->getParams();\n \n \t$ret_r = array();\n \t\n \t$photo_id = $param['photo_id'] ;\n \t$photo_posted_by_user_id = $param['album_posted_by'];\n \t$comment = $param['comment'] ;\n \n \t//Making a entry to like table for wallpost.\n \t$filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$comm_text = nl2br($filterObj->filter($this->getRequest()->getParam( 'comment' ) ));\n \t$comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), NULL, NULL, $photo_id );\n \t$comments_obj = \\Extended\\comments::getRowObject( $comment_on_photo_id );\n \n \t//setting comment count for photo\n \t\\Extended\\socialise_photo::commentCountIncreament( $photo_id );\n \t\t\t\n \t// get socialise photo object \n \t$socialisephoto_obj = \\Extended\\socialise_photo::getRowObject( $photo_id );\n \t\n \t\n \t//Adding comment for wallpost in comments table( for special case only. )\n \tif( $socialisephoto_obj->getWallPost() )\n \t{\n \t\tif( $socialisephoto_obj->getWallPost()->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED )\n \t\t{\n \t\t\t$wallpost_comment_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), null, $socialisephoto_obj->getWallPost()->getId() );\n \t\t\t//Adding same comment id in photo comment record.\n \t\t\t$photo_comment_obj = \\Extended\\comments::getRowObject($comment_on_photo_id);\n \t\t\t$photo_comment_obj->setSame_comment_id($wallpost_comment_id);\n \t\t\t$em = Zend_Registry::get('em');\n \t\t\t$em->persist( $photo_comment_obj );\n \t\t\t$em->flush();\n \t\t\t\n \t\t\t$ret_r['wallpost_id'] = $socialisephoto_obj->getWallPost()->getId();\n \t\t\t$ret_r['wallpost_comment_id'] = $wallpost_comment_id;\n \t\t}\n \t}\n \t\n \t/* \tIf there is single photo inside the group\n \t in default album, then also add comment for its\n \tassociated wallpost.\n \t*/\n \tif( $socialisephoto_obj->getPhotoGroup() )\n \t{\n \t\tif( $socialisephoto_obj->getPhotoGroup()->getSocialisePhoto()->count() == 1 )\n \t\t{\n \t\t\t$wallpost_comment_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), null, $socialisephoto_obj->getPhotoGroup()->getWallPost()->getId() );\n \t\t\t//Adding same comment id in photo comment record.\n \t\t\t$photo_comment_obj = \\Extended\\comments::getRowObject($comment_on_photo_id);\n \t\t\t$photo_comment_obj->setSame_comment_id($wallpost_comment_id);\n \t\t\t$em = Zend_Registry::get('em');\n \t\t\t$em->persist( $photo_comment_obj );\n \t\t\t$em->flush();\n \t\t\t$ret_r['wallpost_id'] = $socialisephoto_obj->getPhotoGroup()->getWallPost()->getId();\n \t\t\t$ret_r['wallpost_comment_id'] = $wallpost_comment_id;\n \t\t}\n \t}\n \t\n \t\t\t\n \t$ret_r['comment_id'] = $comment_on_photo_id;\n \t$ret_r['comm_text'] = $comm_text;\n \t$ret_r['commenter_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t$ret_r['commenter_fname'] = Auth_UserAdapter::getIdentity()->getFirstname();\n \t$ret_r['commenter_lname'] = Auth_UserAdapter::getIdentity()->getLastname();\n \t$ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto(Auth_UserAdapter::getIdentity()->getId(), 3);\n \t$ret_r['comment_count'] = $socialisephoto_obj->getSocialise_photosComment()->count();\n \t$ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n \t\n \t\n \t//gathering information for sending email to user on whom post, comment is done.\n \t$subject = \"iLook - User commented on your photo\";\n \t$msg='';\n \t$msg = \"<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t\".ucfirst($ret_r['commenter_fname']).\" \".ucfirst($ret_r['commenter_lname']).\" commented on your photo</p>\n \t<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t<b>'\".$ret_r['comm_text'].\"'</b>\n \t</p>\";\n \t$recipient_name = ucfirst($socialisephoto_obj->getSocialise_photosPosted_by()->getFirstname()).\" \".ucfirst($socialisephoto_obj->getSocialise_photosPosted_by()->getLastname());\n \t$recipient_email = $socialisephoto_obj->getSocialise_photosPosted_by()->getEmail();\n \t\t\n \t// check if user is not commenting on his own post, only then mail will be sent\n \tif(Auth_UserAdapter::getIdentity()->getId() != $socialisephoto_obj->getSocialise_photosPosted_by()->getId())\n \t{\n \t\t//sending email to user on whom post comment is done\n \t\t\\Email_Mailer::sendMail(\n $subject,\n \t\t\t\t$msg,\n \t\t\t\t$recipient_name,\n \t\t\t\t$recipient_email,\n \t\t\t\tarray(),\n \t\t\t\t\"iLook Team\",\n \t\t\t\tAuth_UserAdapter::getIdentity()->getEmail(),\n \t\t\t\t\"Hello \",\n \t\t\t\t\"Thank you\");\n \t}\n \t\n \techo Zend_Json::encode($ret_r);\n \t\t\n \tdie;\n }", "public function add_comment(){\r\n\r\n\t\t/* Require user */\r\n\t\tif (!$commenter = $this->_requireUser('Please sign in, or sign up, to post a comment.')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t/* Build comment arguments from request variables. */\r\n\t\t$arguments = array();\r\n\t\t$this->add_comment_parse_args($arguments);\r\n\t\t$arguments['commentOwner'] = $commenter->userid;\r\n\r\n\t\t/* Do the deed. */\r\n\t\tif ($this->add_comment_call_model_add($arguments)){\r\n\t\t\t$message = $this->add_comment_success_message();\r\n\t\t\t$messageType = 'info';\r\n\t\t} else {\r\n\t\t\t$message = $this->add_comment_failure_message();\r\n\t\t\t$messageType = 'error';\r\n\t\t}\r\n\r\n\t\t/* Tidy up */\r\n\t\tMessages::addMessage($message, $messageType);\r\n\t\treturn $this->_redirect($this->get_redirect_page());\r\n\r\n\t}", "public function postAddComment()\n {\n \n \n $user_id = Input::get('user_id');\n $object_id = Input::get('object_id');\n $object_type = Input::get('object_type');\n $comment = Input::get('comment');\n $spoiler = 0;\n if(Input::has('spoiler'))\n {\n $spoiler = 1;\n }\n if(strlen($user_id) > 0)\n {\n\n $c = Comment::addComment($user_id, $object_id, $object_type, $comment, $spoiler);\n return Response::json(array('result'=> $c,\n 'username' => Auth::user()->username, \n 'name' => Auth::user()->name,\n 'profile_pic' => Auth::user()->profile_pic \n ));\n }\n else\n {\n return Response::json(array('result' => 'false')); \n }\n \n \n }", "public function actionAddComment()\n {\n $profile = (new UsersProfile())->getProfile();\n $model = new Comment();\n $model->task_id = Yii::$app->request->get('task_id');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->task_id]);\n }\n\n return $this->render('add-comment', \\compact('model', 'profile'));\n }", "public function addComment()\n {\n $this->isConnect();\n\n $post = $this->token->check($_POST);\n\n $formMessage = $this->commentsValidationForm->checkForm($post);\n\n if(!$formMessage)\n {\n $post['user_id'] = $_SESSION['id'];\n $post['validated'] = ($_SESSION['statut'] === 'admin') ? 1 : null;\n $this->comments->add($post);\n header('Location: index.php?route=front.postById&id=' . $_POST['post_id'] . '&success=' . $_SESSION['statut'] . '#comments');\n exit;\n }\n else\n {\n $postAddUnvalid = $post;\n $post = $this->posts->postById($_GET['id']);\n $comments = $this->comments->commentsById($_GET['id']);\n $this->render('postById', compact('formMessage', 'postAddUnvalid', 'post', 'comments'));\n }\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function add() {\n $post_id = $this->request->data['Comment']['post_id'];\n $user_id = $this->Auth->user('id');\n \n \n if ($this->request->is('post')) {\n \n //Post id is not numeric (avoid SQL injection)\n if (!is_numeric($post_id)) {\n $this->Flash->setError(__(\"Vous ne pouvez pas commenter ce post\"));\n return $this->redirect($this->referer());\n }\n \n //Everything is ok, create the comment\n $this->Comment->create();\n $this->request->data['Comment']['user_id'] = $user_id;\n if ($this->Comment->save($this->request->data)) {\n return $this->redirect($this->referer());\n }\n \n $this->Flash->error(__('Ajout de commentaire impossible.'));\n }\n }", "public function addComment($user, $comment) {\r\n\r\n $timestamp = date(\"Y-m-d-h-i-s-a\", time());\r\n $sql = \"INSERT INTO RecipeComments(page, comment, username, timestamp) VALUES ('$this->page', '$comment', '$user', '$timestamp')\";\r\n \r\n mysqli_query($this->conn, $sql);\r\n\r\n }", "function addImageComments($args)\n{\n global $_zp_current_album, $_zp_authority;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('addImageComments', ($args['loglevel']));\n $imageobject = getItemByID('images', $args['id']);\n $userobj = $_zp_authority->getAnAdmin([\n 'user=' => $args['loginUsername'],\n 'valid=' => 1,\n ]);\n $username = $args['loginUsername'];\n $commentText = $args['commentText'];\n $date = date('Y-m-d H:m:s');\n if ($imageobject->filename) {\n query('INSERT INTO '.prefix('comments').\"(`ownerid`,`name`,`email`,`website`,`date`,`comment`,`type`,`IP`) VALUES ('\".$args['id'].\"','\".$username.\"','\".$userobj->getEmail().\"','','\".$date.\"','\".$commentText.\"','images','\".$_SERVER['REMOTE_ADDR'].\"')\");\n } else {\n return new ZEN_Error(-1, 'Image not found on server '.$obj['filename']);\n }\n\n return true;\n}", "abstract protected function add(Comment $comment);", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "function addComment($user, $message) {\n $this->comments[] = new Comment($user, $message);\n }", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "function addcomment(&$username, &$comment, &$date, &$users, &$comments, &$dates) {\n $comment = $_POST['comment'];\n $date = date('m/d/y');\n $users[] = $username;\n $comments[] = $comment;\n $dates[] = $date;\n }", "public function addCommentToTheAlbumAction()\n{\n\t\t$current_user_obj = Auth_UserAdapter::getIdentity();\n\ttry {\n\t\t//getting the album's object.\n\t\t$album_obj = \\Extended\\socialise_album::getRowObject( $this->getRequest()->getParam( 'album_id' ) );\n\n\t\tif( $album_obj )\n\t\t{\n\t\t\t//Making a entry to comment table for album's comment .\n\t\t\t$filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n\t\t\t$comm_text = $filterObj->filter( $this->getRequest()->getParam( 'comment' ) );\n\t\t\t \n\t\t\t$comment_on_album_id = \\Extended\\comments::addComment( $comm_text, $current_user_obj->getId(), null, NULL, NULL, $album_obj->getId() );\n\t\t\t \n\t\t\t$comments_obj = \\Extended\\comments::getRowObject( $comment_on_album_id );\n\t\t\t \n\t\t\t \n\t\t\t$ret_r = array();\n\t\t\t$ret_r['comm_id'] = $comment_on_album_id;\n\t\t\t$ret_r['comm_text'] = $comm_text;\n\t\t\t$ret_r['commenter_id'] = $current_user_obj->getId();\n\t\t\t$ret_r['commenter_fname'] = $current_user_obj->getFirstname();\n\t\t\t$ret_r['commenter_lname'] = $current_user_obj->getLastname();\n\t\t\t$ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto($current_user_obj->getId(), 3);\n\t\t\t$ret_r['comment_count'] = $album_obj->getSocialise_albumsComment()->count();\n\t\t\t$ret_r['wp_id'] = $album_obj->getId();\n\t\t\t$ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n\t\t\t\n\t\t\t//gathering information for sending email to user on whom post, comment is done.\n\t\t\t$subject = \"iLook - User commented on your album\";\n\t\t\t$msg='';\n\t\t\t$msg = \"<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t\t\t\".ucfirst($ret_r['commenter_fname']).\" \".ucfirst($ret_r['commenter_lname']).\" commented on your <a href='\".PROJECT_URL.'/'.PROJECT_NAME.\"profile/photos/uid/\".$album_obj->getSocialise_albumIlook_user()->getId().\"/id/\".$ret_r['wp_id'].\"'>album</a></p>\n\t\t\t<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t\t\t<b>'\".$ret_r['comm_text'].\"'</b>\n\t\t\t</p>\";\n\t\t\t$recipient_name = ucfirst($album_obj->getSocialise_albumIlook_user()->getFirstname()).\" \".ucfirst($album_obj->getSocialise_albumIlook_user()->getLastname());\n\t\t\t$recipient_email = $album_obj->getSocialise_albumIlook_user()->getEmail();\n\t\t\t\n\t\t\t// check if user is not commenting on his own post, only then mail will be sent\n\t\t\tif(Auth_UserAdapter::getIdentity()->getId() != $album_obj->getSocialise_albumIlook_user()->getId())\n\t\t\t{\n\t\t\t\t//sending email to user on whom post comment is done\n\t\t\t\t\\Email_Mailer::sendMail($subject,\n\t\t\t\t\t\t$msg,\n\t\t\t\t\t\t$recipient_name,\n\t\t\t\t\t\t$recipient_email,\n\t\t\t\t\t\tarray(),\n\t\t\t\t\t\t\"iLook Team\",\n\t\t\t\t\t\tAuth_UserAdapter::getIdentity()->getEmail(),\n\t\t\t\t\t\t\"Hello \",\n\t\t\t\t\t\t\"Thank you\");\n \t\t\n\t\t\t}\n\t\t\techo Zend_Json::encode($ret_r);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Album does not exist anymore.\n\t\t\techo Zend_Json::encode(2);\n\t\t}\n\t}\n\tcatch (Exception $e)\n\t{\n\t\techo Zend_Json::encode(0);\n\t}\n\tdie;\n}", "public function addComment( $comment )\n\t{\n\t\tif ( Yii::app()->params['commentNeedApproval'] )\n\t\t\t$comment->status = Comment::STATUS_PENDING;\n\t\telse\n\t\t\t$comment->status = Comment::STATUS_APPROVED;\n\t\t$comment->howto_id = $this->id;\n\t\treturn $comment->save();\n\t}", "public function addPhoto($username, AddProfilePhotoRequest $request) {\n\n // Set $photo to the fromFile() function,\n // and get the $requested file which is set to 'photo',\n // and upload it using the upload function().\n // -- 'photo' comes from the <script> tags in profile/index.blade.php.\n\n // Create a new photo instance from a file upload.\n $photo = ProfilePhoto::fromFile($request->file('photo'))->upload();\n\n // Set User::loacatedAt() in (User Model)\n // = to the username, and add the photo.\n // -- Find the user and add the Profile Photo.\n User::locatedAt($username)->addProfilePhoto($photo);\n\n }", "public function add_comment_user()\n\t{\n\t\t$data = array(\n\t\t\t\t'post_comment_description'=>$this->input->post('comment'),\n\t\t\t\t'comment_created'=>date('Y-m-d H:i:s'),\n\t\t\t\t'member_id'=>$this->input->post('member_id'),\n\t\t\t\t'post_comment_status'=>1,\n\t\t\t\t'post_id'=>$this->input->post('post_id')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('post_comment', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function add_comment( $id, $comment ) {\n\n\t\tif ( isset( $_POST['wp_reviews_score'] ) and ! empty( $_POST['wp_reviews_score'] ) ) {\n\n\t\t\t//Save Rating\n\t\t\tupdate_comment_meta( $id, 'score', sanitize_text_field( $_POST['wp_reviews_score'] ) );\n\n\t\t\t//Send Email\n\t\t\tif ( WP_REVIEWS_INSURANCE::$option['email_auth'] == 1 ) {\n\n\t\t\t\t//Generate User Link\n\t\t\t\t$auth_key = wp_generate_password( 50, false );\n\t\t\t\t$link = add_query_arg( array( 'wp_confirm_reviews_insurance' => $auth_key ), home_url() );\n\t\t\t\tupdate_comment_meta( $id, 'auth_key', sanitize_text_field( $auth_key ) );\n\n\t\t\t\t//Email text\n\t\t\t\t$email_opt = get_option( 'wp_reviews_email_opt' );\n\t\t\t\t$email_text = str_replace( array( '[fullname]', '[link]' ), array( $comment->comment_author, '<a href=\"' . $link . '\" target=\"_blank\">Confirm Your Review</a>' ), $email_opt['email_body'] );\n\t\t\t\t$email_subject = str_replace( array( '[fullname]', '[sitename]' ), array( $comment->comment_author, get_bloginfo( 'name' ) ), WP_REVIEWS_INSURANCE::$option['email_subject'] );\n\t\t\t\tUtility::send_mail( $comment->comment_author_email, $email_subject, $email_text );\n\n\t\t\t} else {\n\t\t\t\tupdate_comment_meta( $id, 'comment_approve_user', 'yes' );\n\t\t\t}\n\t\t}\n\t}", "public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "public function add($comment)\n {\n $comments = $this->session->get('comments', []);\n $comments[] = $comment;\n $this->session->set('comments', $comments);\n }", "public function insertComment($comment, $userid, $username, $profile_image_url, $battle_id, $date) {\n\n $stmt = $this->db->query(\"INSERT INTO comments (comment, userid, created_at, battle_id) VALUES ('$comment', '$userid', '$date', $battle_id)\");\n $stmt->execute();\n }", "public function addComment(User $user, Comment $comment)\n {\n return $this->authorized();\n }", "public function add(Comment $comments)\n {\n $query = $this->db->pdo->prepare('INSERT INTO comments(idnews, idparent, niveau, moderate, content, membre, addDate) VALUES (:idnews, :idparent, :niveau, :moderate, :content, :membre, NOW())');\n $query->bindValue(':idnews', $comments->idnews(), PDO::PARAM_INT);\n $query->bindValue(':idparent', $comments->idparent(), PDO::PARAM_INT);\n $query->bindValue(':niveau', $comments->niveau(), PDO::PARAM_INT);\n $query->bindValue(':moderate', $comments->moderate(), PDO::PARAM_INT);\n $query->bindValue(':content', $comments->content(), PDO::PARAM_STR);\n $query->bindValue(':membre', $comments->membre(), PDO::PARAM_STR);\n\n $query->execute();\n }", "public function addComment(Request $request, $id){\n\n $comments = new comment();\n $comments->uid = Auth::user()->id;\n $comments->statusId = $id;\n $comments->comment = $request['comment'];\n \n $comments->save();\n return back();\n }", "function comment()\n {\n // form validation\n $this->load->library('form_validation');\n $this->form_validation->set_rules('eventID', 'eventID', 'trim|xss_clean');\n $this->form_validation->set_rules('comment', 'comment', 'trim|xss_clean|strip_tags|htmlspecialchars');\n $this->form_validation->run();\n\n $eventID = $this->input->post('eventID');\n $comment = $this->input->post('comment');\n $userID = $this->session->userdata('UserID');\n\n // check that user is logged in\n if($userID <= 0)\n {\n $this->returnError($this->lang->line('error_logged_out'),false,false);\n return;\n }\n\n // check event id is valid\n if($eventID <= 0)\n {\n $this->returnError($this->lang->line('error_event_invalid'),false,false);\n return;\n }\n\n $this->load->model('User');\n $this->User->addComment($eventID, $userID, $comment);\n\n // add new comment (in HTML) to response so it can be added to the current page\n $this->load->library('md');\n $result['comment'] = $this->md->defaultTransform($comment);\n $result['username'] = $this->session->userdata('Username');\n $result['profileImage'] = $this->session->userdata('ProfileImage');\n $result['userID'] = $userID;\n\n // return success\n $result['error'] = false; \n echo json_encode($result);\n }", "public function addComment(Comment $comment)\n {\n $this->comments[] = $comment;\n }", "public function addComment($post_id, $comment, $uid = null, $session_key = null) \n {\n if (!$session_key) {\n $session_key = $this->_core->getClient()->hasUserAuth();\n }\n\n $uid = ($uid) ? $uid : $this->_core->getUserId();\n if (!$uid && !$session_key) {\n throw new Zend_Service_Facebook_Exception('UID or Session Key Required');\n }\n\n $args = array('post_id'=>$post_id, 'comment'=>$comment);\n if ($session_key) $args['session_key'] = $session_key;\n if ($uid) $args['uid'] = $uid;\n\n return $this->callRestMethod('stream.addComment', $args);\n }", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function AddComment(Request $request,$id)\n {\n $comment = new Comment();\n if ($request->isMethod('post')){\n $comment->content=$request->commentcontent;\n $comment->user_id=Auth::User()->id;\n $comment->post_id=$id;\n $comment->save();\n return back();\n }\n return view('posts');\n }", "public function add(Comment $comment)\n {\n $sql = \"INSERT INTO comments(idArticle, author, content, publishDate)\n VALUES(:idArticle, :author, :content, NOW())\";\n $query = $this->db->prepare($sql);\n $query->execute([\n 'idArticle' => $comment->idArticle(),\n 'author' => $comment->author(),\n 'content' => $comment->content()\n ]);\n }", "public function savePictureComment(Request $request) {\n $this->validate($request, [\n 'picture_id' => 'required|integer|exists:pictures,id',\n 'comment' => 'required|min:2|max:255',\n ]);\n\n /*\n * Create a new comment by following general eloquent model principles.\n * Strip html-tags where possible.\n */\n $comment = new Comment;\n $comment->user_id = Auth::user()->id;\n $comment->picture_id = $request->picture_id;\n $comment->comment = strip_tags($request->comment);\n $comment->likes = 0;\n $comment->dislikes = 0;\n $comment->save();\n\n $user = User::find(Auth::user()->id);\n $userProfilePicturePath = $user->profile_picture_path;\n if(is_null($userProfilePicturePath)) {\n // User has not set his or her profile picture.\n $userProfilePicturePath = '';\n }\n $comment->profile_picture_path = $userProfilePicturePath;\n \n $comment->username = $user->username;\n\n return response()->json($comment);\n }", "public function addComment($id_user, $title, $content, $note)\n {\n $req = $this->pdo->prepare('INSERT INTO comments (id_user, title, content, note)\n VALUE (?, ?, ?, ?)');\n $req->execute([$id_user, $title, $content, $note]);\n //Récupère l'id de l'insertion dans la table\n return $this->pdo->lastInsertId();\n }", "public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }", "public function addTaskComment(CommentRequest $comment): Comment\n\t{\n\t\t$query = 'INSERT INTO comments (task_id, created_by, created_at, comment) VALUES ( ? , ? , ? , ? )';\n\t\t$stmt = $this->pdo->prepare($query);\n\t\t$stmt->execute([\n\t\t\t$comment->getTaskId(),\n\t\t\t$comment->getCreatedBy(),\n\t\t\t$comment->getCreatedAt(),\n\t\t\t$comment->getComment()\n\t\t]);\n\n\t\t$query = 'SELECT username FROM users WHERE id = ?';\n\t\t$stmt = $this->pdo->prepare($query);\n\t\t$stmt->execute([$comment->getCreatedBy()]);\n\t\t$res = $stmt->fetch();\n\n\t\t$newComment = new Comment($res['username'], $comment->getCreatedAt(), $comment->getComment());\n\n\t\treturn $newComment;\n\t}", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }", "public function add($optional = [])\n {\n return $this->apiCall('post', '/files.comments.add', ['json' => array_merge([\n ], $optional)]);\n }", "public static function addComment($id = null, $comment = null) {\n if($id == null || $comment == null) {\n return false;\n } else if( $comment['content'] == null ) {\n return false;\n }\n\n $commentdata = array(\n 'comment_post_ID' => $id, // to which post the comment will show up\n 'comment_author' => $comment['name'], //fixed value - can be dynamic \n 'comment_author_email' => $comment['email'], //fixed value - can be dynamic \n 'comment_content' => $comment['content'], //fixed value - can be dynamic \n 'comment_approved' => 0, //set comment's status is pending\n // 'comment_parent' => 0, //0 if it's not a reply to another comment; if it's a reply, mention the parent comment ID here\n // 'user_id' => $current_user->ID, //passing current user ID or any predefined as per the demand\n );\n\n //Insert new comment and get the comment ID\n $cmt_id = wp_new_comment( $commentdata );\n\n return true;\n\n }", "public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }", "public function add_comment(request $request){\n // dd(Carbon::now());\n \n $user = user_data();\n\n $request->validate([\n 'comment_content' => 'required',\n // 'lost_lead_reason' => 'required',\n \n ]);\n Comments::create([\n 'comment_content' => $request->comment_content,\n 'lost_lead_reason' => $request->lost_lead_reason, \n 'user_id' => $request->user_id,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n \n ]);\n return response()->json([ 'success'=> 'Form is successfully submitted!']);\n\n }", "public function AddComment($param){\n $param=$param = $this->_check_param($param,array(SERVICE_PARAM_INT,SERVICE_PARAM_INT,SERVICE_PARAM_STRING));\n $user_id=$param[0];\n $article_id=$param[1];\n $comment_contents=$param[2];\n $time=time();\n $this->comment_model->AddComment($user_id,$article_id,$time,$comment_contents); //把评论加入\n $this->article_model->UpdateCommentCount($article_id); //把article_model中的comment_count+1\n return $this->output(true,1000);\n }", "public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}", "public function insertComment($name,$comment,$idOfRecord,$typeOfRecord = \"photo\")\r\n {\r\n \r\n //If passed , insert the comment.\r\n }", "public function addComment(Request $request, $id){\n $mess = $request->input('comment'); \n $email = \\Auth::user()->email;\n $user_data = User::all()->where('email', $email)->first();\n $blog_data = Blog::all()->where('user_id', $user_data[\"id\"])->first();\n \n Comment::create([\n 'user_id' => $user_data[\"id\"],\n 'blog_id' => $blog_data[\"id\"],\n 'comment_body' => trim($request->comment)\n ]);\n\n return redirect()->route('allblogs');\n }", "public function addComment($body){\n // Comment::create([\n // 'body' => $body,\n // 'post_id' => $this->id\n // ]);\n\n\t\t$this->comments()->create(compact('body'));\n\t}", "public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function addComment(Comment $comment)\n {\n $comment->setArticle($this);\n $this->comments[] = $comment;\n }", "function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}", "public function addcomment($entry_id, $trip_id) {\n if (empty($_POST['content'])) {\n Router::redirect(\"/trips/dashboard/missing\");\n }\n\n # Associate this trip with this user\n $_POST['user_id'] = $this->user->user_id;\n\n $_POST['entry_id'] = $entry_id;\n\n # Unix timestamp of when this trip was created / modified\n $_POST['created'] = Time::now();\n\n DB::instance(DB_NAME)->insert(\"comments\", $_POST);\n\n Router::redirect(\"/trips/dashboard/\".$trip_id);\n }", "public function addAction()\n {\n $isPosted = $this->request->getPost('doCreate');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->add($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function addComment(\\TYPO3\\Amazingcomments\\Domain\\Model\\Comment $item) {\n\t\t// this is a workaround as the object is sometimes empty with TYPO3 6.0 and then a \"called a member function on a non-object-function\" error shows up\n\t\tif(!$this->comments) {\n\t\t\t#$this->comments = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\t$this->comments = $this->objectManager->create('\\\\TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ObjectStorage');\n\t\t}\n\t\t$this->comments->attach($item);\n\t}", "function createComment($comments, $is_user){\n $createComment = new \\Project\\Models\\GuestbookCommentManager();\n $createComments = $createComment->createComment($comments, $is_user);\n\n header('Location: administration.php?action=dashboard');\n }", "public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function comment(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'bail|required|max:200',\n 'postId' => 'required|numeric',\n ]);\n\n // creating a new comment\n $comment = new Post_comment();\n $comment->post_id = $request->postId;\n $comment->comment = $request->comment;\n $comment->artist_id = Auth::user()->id;\n \n $comment->save(); \n }", "public function comments()\n {\n return $this->hasMany(PhotoComment::class);\n }", "public function create(Comment $comment, array $data)\n {\n $comment->rates()->attach(request()->user(), $data);\n }", "public function addComment($name, $email, $comment, $postId = null, $parentCommentId = null)\n {\n if (empty($name) || empty($email) || empty($comment)) {\n throw new \\InvalidArgumentException('One of the required variables is not set');\n }\n\n $requestBody = [\n 'name' => $name,\n 'email' => $email,\n 'comment' => $comment\n ];\n\n if (!is_null($postId)) {\n $requestBody = array_merge($requestBody, ['postId' => $postId]);\n }\n\n if (!is_null($parentCommentId)) {\n $requestBody = array_merge($requestBody, ['parentComment' => $parentCommentId]);\n }\n\n return $this->_doRequest('/comments', $requestBody);\n }", "public function commentAction() {\r\n $data = json_decode($_POST['data'], true);\r\n if (empty($data['comments'])) {\r\n exit('access deny!');\r\n }\r\n\r\n if (stristr($data['sourceid'], 'nav_fun_')) {\r\n $id = intval(str_ireplace('nav_fun_', '', $data['sourceid']));\r\n $info = Nav_Service_NewsDB::getRecordDao()->get($id);\r\n if (!empty($info['id'])) {\r\n $total = $info['c_num'] + 1;\r\n Nav_Service_NewsDB::getRecordDao()->update(array('c_num' => $total), $id);\r\n $rcKey = 'NAV_FUN_OP:' . intval($info['id']);\r\n Common::getCache()->hSet($rcKey, 'c_num', $total);\r\n }\r\n }\r\n\r\n $addData = array(\r\n 'content' => trim($data['comments'][0]['content']),\r\n 'ctime' => substr($data['comments'][0]['ctime'], 0, 10),\r\n 'ip' => $data['comments'][0]['ip'],\r\n 'cmtid' => $data['comments'][0]['cmtid'],\r\n 'userid' => $data['comments'][0]['user']['userid'],\r\n 'sourceid' => $data['sourceid'],\r\n 'url' => $data['url'],\r\n 'created_at' => Common::getTime(),\r\n );\r\n\r\n // error_log(date('Y-m-d H:i:s') . \" \" . Common::jsonEncode($addData) . \"\\n\", 3, '/tmp/3g_changyan_comment');\r\n User_Service_Changyan::getDao()->insert($addData);\r\n\r\n exit;\r\n }", "function add_comment($comment, $obj_id, $reply_to = NULL) {\n global $myquery, $db;\n\n if (!$this->topic_exists($obj_id))\n e(lang(\"grp_tpc_err4\"));\n else {\n $owner = $this->get_group_owner_from_topic($obj_id);\n $add_comment = $myquery->add_comment($comment, $obj_id, $reply_to, 't', $owner);\n if ($add_comment) {\n //Loggin Comment\t\t\t\n $log_array = array\n (\n 'success' => 'yes',\n 'details' => \"comment on a topic\",\n 'action_obj_id' => $obj_id,\n 'action_done_id' => $add_comment,\n );\n insert_log('topic_comment', $log_array);\n\n //Updating Number of comments of topics\n $this->update_comments_count($obj_id);\n }\n return $add_comment;\n }\n }", "public function created(Comment $comment)\n {\n //\n }", "function create_comment($album_id, $comment){\n $album_id = (int)$album_id;\n $comment = mysql_real_escape_string($comment);\n\n mysql_query(\"INSERT INTO comments (album_id, user_id, comment, timestamp) VALUES ($album_id, \". $_SESSION['user_id'] .\", '$comment', UNIX_TIMESTAMP()) \");\n \n }", "public function userPostComments()\n {\n // $comments = Auth('user')->user()->comments;\n $comments = Auth::user()->comments;\n return view('frontend.user.comments', compact('comments'));\n }", "function tp_comm_add_meta($comment_id) {\r\n\t$tw = tp_get_credentials();\r\n\tif ($tw) {\r\n\t\tupdate_comment_meta($comment_id, 'twuid', $tw->screen_name);\r\n\t}\r\n}", "public function createComment(Request $request){\n try{\n // strip html tags and add authorisation data to request\n $request->request->add(['content' => strip_tags($request->content)]);\n $request->request->add(['authorised' => Auth::check()]);\n\n // parse wether the comment is being made on a post or a comment\n if($request->request->get('post_id') != null){\n // add comment target type to request data\n $request->request->add(['commentable_type' => Post::class]);\n // strip html tags and re-order input for validation\n $request->request->add(['id' => strip_tags($request->post_id)]);\n $request->request->remove('post_id');\n // check the post being commented on exists\n $this->validate($request, [\n 'id' => 'exists:posts',\n ]);\n } else if($request->request->get('comment_id') != null){\n // add comment target type to request data\n $request->request->add(['commentable_type' => Comment::class]);\n // strip html tags and re-order input for validation\n $request->request->add(['id' => strip_tags($request->comment_id)]);\n $request->request->remove('comment_id');\n // check the comment being commented on exists\n $this->validate($request, [\n 'id' => 'exists:comments',\n ]);\n } else{\n // return nothing for unknown error\n return \"\";\n }\n\n // validate the new comment is not empty and the user is authorised (logged in)\n $this->validate($request, [\n 'content' => 'required',\n 'authorised' => 'accepted',\n ]);\n\n // create the new comment and save it to the DB\n $comment = new Comment;\n $comment->content = $request->request->get('content');\n $comment->commentable_id = $request->request->get('id');\n $comment->commentable_type = $request->request->get('commentable_type');\n $comment->profile_id = Auth::user()->profile->id;\n $comment->save();\n\n \n // check if the comment is on an item written by a different user\n if($comment->profile != $comment->commentable->profile){\n // if so, notify the author of the commented item via ItemCommented event\n ItemCommented::dispatch($comment->commentable->profile);\n }\n\n // return the comment to be displayed by the website\n // (seperate fields with \"<a>\", guaranteed no mistakes as html tags were stripped from input data)\n return $comment->id.\"<a>\". $comment->content;\n }catch(\\Exception $e){\n // return nothing to indicate unknown error\n return \"\";\n }\n }", "public function addComment($comment)\n\t{\n\t\tif(Yii::$app->params['commentNeedApproval'])\n\t\t\t$comment->status=Workflow::STATUS_DRAFT;\n\t\telse\n\t\t\t$comment->status=Workflow::STATUS_APPROVED;\n\t\t$comment->comment_table=Workflow::MODULE_BLOG;\n\t\t$comment->comment_id=$this->id;\n\t\treturn $comment->save();\n\t}", "public function addComment(\n Comment $comment,\n ObjectManager $manager,\n Trick $trick\n ) {\n $comment->setCommentedAt(new \\DateTime);\n $comment->setTrick($trick);\n $comment->setUser($this->getUser());\n $manager->persist($comment);\n $manager->flush();\n }", "public function comment($comment) {\n $comment['InsertUserID'] = Gdn::session()->UserID;\n $comment['DateInserted'] = Gdn_Format::toDateTime();\n $comment['InsertIPAddress'] = ipEncode(Gdn::request()->ipAddress());\n\n $this->Validation->applyRule('ActivityID', 'Required');\n $this->Validation->applyRule('Body', 'Required');\n $this->Validation->applyRule('DateInserted', 'Required');\n $this->Validation->applyRule('InsertUserID', 'Required');\n\n $this->EventArguments['Comment'] = &$comment;\n $this->fireEvent('BeforeSaveComment');\n\n if ($this->validate($comment)) {\n $activity = $this->getID($comment['ActivityID'], DATASET_TYPE_ARRAY);\n\n $_ActivityID = $comment['ActivityID'];\n // Check to see if this is a shared activity/notification.\n if ($commentActivityID = val('CommentActivityID', $activity['Data'])) {\n Gdn::controller()->json('CommentActivityID', $commentActivityID);\n $comment['ActivityID'] = $commentActivityID;\n }\n\n $storageObject = FloodControlHelper::configure($this, 'Vanilla', 'ActivityComment');\n if ($this->checkUserSpamming(Gdn::session()->User->UserID, $storageObject)) {\n return false;\n }\n\n // Check for spam.\n $spam = SpamModel::isSpam('ActivityComment', $comment);\n if ($spam) {\n return SPAM;\n }\n\n // Check for approval\n $approvalRequired = checkRestriction('Vanilla.Approval.Require');\n if ($approvalRequired && !val('Verified', Gdn::session()->User)) {\n LogModel::insert('Pending', 'ActivityComment', $comment);\n return UNAPPROVED;\n }\n\n $iD = $this->SQL->insert('ActivityComment', $comment);\n\n if ($iD) {\n // Check to see if this comment bumps the activity.\n if ($activity && val('Bump', $activity['Data'])) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $activity['ActivityID']]);\n if ($_ActivityID != $comment['ActivityID']) {\n $this->SQL->put('Activity', ['DateUpdated' => $comment['DateInserted']], ['ActivityID' => $_ActivityID]);\n }\n }\n\n // Send a notification to the original person.\n if (val('ActivityType', $activity) === 'WallPost') {\n $this->notifyWallComment($comment, $activity);\n }\n }\n\n return $iD;\n }\n return false;\n }", "public function InsertComment($details)\n {\n $this->comments[] = $details;\n }", "public function addNewComment($data){\n $this->db->query(\"INSERT INTO comments (comment_description, rating, recipe_id, ownerid) VALUES (:description, :rating, :recipeid, :ownerid)\");\n $this->db->bind(':description', $data['comment']);\n $this->db->bind(':rating', $data['rating']);\n $this->db->bind(':recipeid', $data['rid']);\n $this->db->bind(':ownerid',$_SESSION['user_id']);\n try {\n $this->db->execute();\n } catch (PDOException $e) {\n return false;\n }\n\n // Return the comment added from the INSERT operation above\n //$this->db->query('SELECT * FROM comments WHERE comment_id = (SELECT MAX(comment_id) FROM comments)');\n $this->db->query('SELECT comments.*, users.user_username FROM comments JOIN users ON ownerid=user_id WHERE comment_id = (SELECT MAX(comment_id) FROM comments)');\n return $this->db->single();\n }", "public function actionAdd()\n {\n $apiName = 'comment/add';\n $sessionId = null;\n \n $_JSON = $this->getJsonInput();\n \n try\n {\n if(!isset($_JSON) || empty($_JSON))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'No input received.');\n else if(!isset($_JSON['sessionId']) || empty($_JSON['sessionId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter session id.');\n else if(!isset($_JSON['postId']) || empty($_JSON['postId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter post id.');\n else if(!isset($_JSON['comment']) || empty($_JSON['comment']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter your comment.');\n else\n {\n $userId = $this->isAuthentic($_JSON['sessionId']);\n $user = User::model()->findByPk($userId);\n if (is_null($user))\n $result = $this->error($apiName, WS_ERR_WONG_USER, 'Please login before using this service.');\n else\n {\n $postId = filter_var($_JSON['postId'], FILTER_SANITIZE_NUMBER_INT);\n $post = Post::model()->findByPk($postId);\n if (is_null($post))\n $result = $this->error($apiName, WS_ERR_WONG_VALUE, 'Selected post does not exist.');\n else\n {\n $comment = new Comment('add_api');\n $comment->userId = $userId;\n $comment->postId = $postId;\n $comment->postUserId = $post->userId;\n $comment->comment = trim(mb_convert_encoding( $_JSON['comment'], \"UTF-8\", \"BASE64\" ));\n \n// $comment->comment = filter_var(base64_decode($_JSON['comment']), FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n// $comment->comment = $_JSON['comment'];\n //$comment->comment = filter_var($_JSON['comment'], FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n //save record\n $comment->save();\n \n $ignore_user = array(); \n \n if(isset($_JSON['userMentioned']) && count($_JSON['userMentioned']) > 0){\n \tforeach ($_JSON['userMentioned']as $userM){\t\n\t \t$userMentioned = new UserMentioned();\n\t \t$userMentioned->userId = filter_var($userM['userId'], FILTER_SANITIZE_NUMBER_INT);\n// \t \t$userMentioned->userName = filter_var(base64_decode($userM['userName']), FILTER_SANITIZE_STRING | FILTER_SANITIZE_MAGIC_QUOTES);\n\t \t$userMentioned->userName = $userM['userName'];\n\t \t$userMentioned->postId = $postId;\n\t \t$userMentioned->commentId = $comment->id;\n\t \t$userMentioned->save();\n\t \tEvent::saveEvent(Event::USER_MENTIONED_COMMENT, $userId, $comment->postId, $comment->createDate, $userMentioned->userId);\n\t \t$ignore_user[] = $userMentioned->userId;\n \t}\n }\n \n \n \n\n \n if ($comment->hasErrors()) \n {\n throw new Exception(print_r($comment->getErrors(), true), WS_ERR_UNKNOWN);\n }\n \n //save event\n if($post->type == 'question'){\n \t$eventtype = 14;\n \t$message1 = $user->userName.' answered your question.';\n }\n else{\n \t$eventtype = Event::COMMENT_CREATED;\n \t$message1 = false;\n }\n \n Event::saveEvent($eventtype, $userId, $comment->postId, $comment->createDate, $post->userId);\n \n $ignore_user[] = $post->userId;\n $sql = 'SELECT DISTINCT userId FROM `comment` WHERE postId = '.$postId;\n \n $user_comments = Yii::app()->db->createCommand($sql)->queryAll(true);\n \n \n// var_dump($post->user->userName);\n \n if($post->type == 'question'){\n \t$eventtype = 15;\n \t$message1 = $user->userName.' also answered '.$post->user->userName.\"'s question.\";\n }\n else{\n \t$eventtype = 12;\n \t$message1 = $user->userName.' also commented on '.$post->user->userName.\"'s post.\";\n }\n \n// $message = $user->userName.' also commented on '.$post->user->userName.\"'s post.\";\n \n \n foreach ($user_comments as $comm){\n \t\n \tif(!in_array($comm['userId'], $ignore_user))\n// \t\t Event::saveEvent(12, $userId, $comment->postId, $comment->createDate, $comm['userId']);\n \t\tEvent::saveEvent(12, $userId, $comment->postId, $comment->createDate, $comm['userId'], $message1 );\n }\n \n //send notifications to followers of the post user\n// $sql = Follower::getQueryForFollower($post->userId);\n// $sql .= \" AND (s.deviceToken is not null OR s.deviceToken!='')\";\n// $followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// $message = $user->userName . ' has commented on a post.';\n// \n// foreach($followers as $follower)\n// {\n// $session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// if($session)\n// {\n// $session->deviceBadge += 1;\n// $session->save();\n// sendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// }\n// }\n \n $imagePath = Yii::app()->getBaseUrl(true) . '/images/user/';\n $thumbPath = Yii::app()->getBaseUrl(true) . '/images/user/thumb/';\n \n $sql = Comment::getQuery($imagePath, $thumbPath, $postId);\n $sql .= ' AND c.id=' . $comment->id;\n $newComment = Yii::app()->db->createCommand($sql)->queryRow(true);\n $newComment['timeElapsed'] = getTimeElapsed(date_create($newComment['createDate']), date_create($newComment['currentDate']));\n $newComment['userMentioned'] = UserMentioned::getUserByComment($newComment['id']);\n \n \n $result = array(\n 'api' => $apiName,\n 'apiMessage' => 'Comment saved successfully.',\n 'status' => 'OK',\n 'commentId' => $comment->id,\n 'comment' => $newComment\n );\n }\n }\n }\n } \n catch (Exception $e)\n {\n $result = $this->error($e->getCode(), Yii::t('app', $e->getMessage()),'TSASTT');\n }\n $this->sendResponse(json_encode($result, JSON_UNESCAPED_UNICODE));\n }", "public function addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "public function addComment($author, $content, $idPoem) {\n \n $sql = 'INSERT INTO T_COMMENT( COM_DATE, COM_AUTHOR, ' .\n ' COM_CONTENT, ARTICLE_ID ) ' .\n 'VALUES (?, ?, ?, ?) ';\n \n $dt = date(DATE_W3C); // Get current date\n \n $this->executeQuery($sql, array($dt, $author, \n $content, $idPoem));\n \n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function updateComment(ImageComments $comment){\n \n try {\n \n $sql = \"UPDATE image_comments SET\n content = ?,\n date = ?,\n users_id = ?,\n images_id = ?\n WHERE id = ?\";\n \n $statement = $this->connection->prepare($sql);\n $success = $statement->execute([\n $comment->getContent(),\n $comment->getDate(),\n $comment->getUserId(),\n $comment->getImagesId(),\n $comment->getId()\n ]);\n \n if($success){\n $result = [\n 'status' => 200,\n 'message' => 'Success'\n ];\n }\n \n }catch(PDOException $e){\n \n return [\n 'status' => 304,\n 'message' => $e->getMessage(),\n 'data' => []\n ];\n }\n \n return $result;\n }", "function add_comments()\n {\n $result = $this->comment->verify_comment();\n if($result != NULL)\n {\n $this->session->set_flashdata('errors', $result);\n redirect('/messages/'.$this->session->userdata(\"selected_user_to_view\").'');\n }\n else\n {\n $this->comment->add_comment($this->input->post(NULL, TRUE));\n redirect('/messages/'.$this->session->userdata(\"selected_user_to_view\").'');\n }\n\n }", "public function addComment($uid, Request $request)\n {\n $bookmark = $this->bookmarkCollection->findOne(\n ['_id' => new ObjectID($uid)]\n );\n\n if ($bookmark) {\n $document = [\n 'bookmarkId' => $uid,\n 'text' => $request->request->get(\"text\"),\n 'created_at' => (new \\DateTime())->getTimestamp(),\n 'ip' => $request->getClientIp(),\n ];\n\n $comment = $this->commentsCollection->insertOne($document);\n\n return ['uid' => (string)$comment->getInsertedId()];\n }\n }", "public function commenting() {\n if(strlen($this->request->getParameter(\"content\")) > 10)\n {\n $postId = $this->request->getParameter(\"id\");\n $author = $this->request->getParameter(\"author\");\n $content = $this->request->getParameter(\"content\");\n \n $this->comment->addComment($author, $content, $postId);\n $this->redirect('Post','index/'.$postId);\n }\n else {\n echo \"Commentaire trop court\";\n }\n \n // Execute the default action to reload and display the Posts list\n $this->executeAction(\"index\");\n\n }", "public function comments() {\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = image_id, localKey = id)\n\t\treturn $this->hasMany('App\\Comment')->with('user')->orderBy('id', 'desc');\n\t}", "public function comments(){\n return $this->hasMany(Comment::class, \"authenticatedUser_id\");\n }", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "public function create($comment)\n {\n\n }", "function postComment() {\n $username = $_POST['username'];\n $content = $_POST['content'];\n $commentDate = $_POST['commentDate'];\n $repliedCommentId = null;\n \n if (array_key_exists('repliedCommentId', $_POST)) {\n $repliedCommentId = $_POST['repliedCommentId'];\n }\n\n $response = insertComment($username, $content, $commentDate, $repliedCommentId);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function edit(ImageComment $imageComment)\n {\n //\n }", "private function wp_new_comment( $commentdata ) {\n $commentdata = apply_filters('preprocess_comment', $commentdata);\n\n $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];\n if ( isset($commentdata['user_ID']) ) {\n $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];\n } elseif ( isset($commentdata['user_id']) ) {\n $commentdata['user_id'] = (int) $commentdata['user_id'];\n }\n\n $commentdata['comment_date'] = current_time('mysql');\n $commentdata['comment_date_gmt'] = current_time('mysql', 1);\n\n $commentdata = wp_filter_comment($commentdata);\n\n $commentdata['comment_approved'] = 1;\n\n $comment_ID = wp_insert_comment($commentdata);\n\n do_action('comment_post', $comment_ID, $commentdata['comment_approved']);\n \n if (get_option('comments_notify')) {\n wp_notify_postauthor($comment_ID);\n }\n \n return $comment_ID;\n }", "public function comments($comments, $initialviewmode, $addcommentlink = '') {\n global $OUTPUT, $DB;\n\n $template = new StdClass;\n $template->addcommentlink = $addcommentlink;\n\n $template->initialcommentsviewmode = $initialviewmode;\n\n if ($comments) {\n foreach ($comments as $comment) {\n $commenttpl = new StdClass;\n $user = $DB->get_record('user', array('id' => $comment->userid));\n $commenttpl->user = $this->user($user);\n $commenttpl->datecreated = userdate($comment->datecreated);\n $commenttpl->comment = format_text($comment->comment);\n $template->comments[] = $commenttpl;\n }\n }\n\n return $OUTPUT->render_from_template('mod_tracker/comments', $template);\n }", "public function commentOnUser($request)\n {\n return $this->start()->uri(\"/api/user/comment\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public static function createComment($userid, $content)\n {\n $user = UserUtil::getUser($userid);\n\n $author = UserUtil::getLoggedInUser();\n\n if(is_null($author) || is_null($user))\n return false;\n\n $comment = new Comments();\n\n $comment->user = $user;\n $comment->author = $author;\n $comment->content = $content;\n\n $comment->save();\n }", "public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function addComment($comment) {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"INSERT INTO comments_table (parent_id, name, comment, create_date) VALUES (\" . $comment['parent_id'] . \", \" . $comment['name'] . \", \" . $comment['comment'] . \", NOW())\";\n $result = mysql_query($sql, $db);\n if($result) {\n $id = mysql_insert_id();\n $sql = \"SELECT * FROM comments_table where id=\" . $id . \";\";\n $result = mysql_query($sql, $db);\n $comment = mysql_result($result, 0);\n return $comment;\n } else {\n return 'save failed';\n }\n }", "public function addCommentToTheWallpostAction()\n {\n try {\n //getting the wall post object.\n\t\t$wall_post_obj = \\Extended\\wall_post::getRowObject( $this->getRequest()->getParam( 'wallpost_id' ) );\n \tif( $wall_post_obj )\n \t{\n\t\t\t//Making a entry to like table for wallpost.\n\t $filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n\t $comm_text = $filterObj->filter( $this->getRequest()->getParam( 'comment' ) );\n\t $comment_on_wallpost_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), NULL, $wall_post_obj->getId() );\n\t //setting like count for wall post.\n\t $comment_count = \\Extended\\wall_post::commentCountIncreament( $wall_post_obj->getId() );\n\t \n\t //Adding comment for album in comments table( for special case only. )\n\t if( $wall_post_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_ALBUM )\n\t {\n\t\t\t\t$comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), $comment_on_wallpost_id, NULL, NULL, $wall_post_obj->getWall_postsSocialise_album()->getId() );\n\t }\n\t \n\t //Adding comment for photo in comments table( for special case only. )\n\t if( $wall_post_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED )\n\t {\n\t $comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), $comment_on_wallpost_id, NULL, $wall_post_obj->getSocialisePhoto()->getId() );\n\t }\n\t \n\t //Adding comment for photo in comments table when there is only one photo\n\t //in group inside default album.\n\t if( \n\t \t$wall_post_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM\n\t\t\t\t|| $wall_post_obj->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING\n\t )\n\t {\n\t \tif( $wall_post_obj->getPhotoGroup()->getSocialisePhoto()->count() == 1 )\n\t \t{\n\t \t\t$photo_obj = $wall_post_obj->getPhotoGroup()->getSocialisePhoto();\n\t\t \t$comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), $comment_on_wallpost_id, NULL, $photo_obj[0]->getId() );\n\t \t}\n\t }\n\t \n\t $comments_obj = \\Extended\\comments::getRowObject( $comment_on_wallpost_id );\n\t \n\t $ret_r = array();\n\t $ret_r['comm_id'] = $comment_on_wallpost_id;\n\t $ret_r['comm_text'] = $comm_text;\n\t $ret_r['commenter_id'] = Auth_UserAdapter::getIdentity()->getId();\n\t $ret_r['commenter_fname'] = Auth_UserAdapter::getIdentity()->getFirstname();\n\t $ret_r['commenter_lname'] = Auth_UserAdapter::getIdentity()->getLastname();\n\t $ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto(Auth_UserAdapter::getIdentity()->getId(), 3);\n\t $ret_r['comment_count'] = $wall_post_obj->getWall_postsComment()->count();\n\t $ret_r['wp_id'] = $wall_post_obj->getId();\n\t $ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n\t \n\t //gathering information for sending email to user on whom post, comment is done.\n\t $subject = \"iLook - User commented on your post\";\n\t $msg='';\n\t $msg = \"<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t \".ucfirst($ret_r['commenter_fname']).\" \".ucfirst($ret_r['commenter_lname']).\" commented on your <a href='\".PROJECT_URL.'/'.PROJECT_NAME.\"post/detail/id/\".$ret_r['wp_id'].\"'>Post.</a></p>\n\t <p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n\t <b>'\".$ret_r['comm_text'].\"'</b>\n\t </p>\";\n\t $recipient_name = ucfirst($wall_post_obj->getWall_postsFrom_user()->getFirstname()).\" \".ucfirst($wall_post_obj->getWall_postsFrom_user()->getLastname());\n\t $recipient_email = $wall_post_obj->getWall_postsFrom_user()->getEmail();\n\t \n\t \n\t // check if user is not commenting on his own post, only then mail will be sent\n\t if(Auth_UserAdapter::getIdentity()->getId() != $wall_post_obj->getWall_postsFrom_user()->getId())\n\t {\n\t \t//sending email to user on whom post comment is done\n\t \t\\Email_Mailer::sendMail($subject,\n\t \t\t\t$msg,\n\t \t\t\t$recipient_name,\n\t \t\t\t$recipient_email,\n\t \t\t\tarray(),\n\t \t\t\t\"iLook Team\",\n\t \t\t\tAuth_UserAdapter::getIdentity()->getEmail(),\n\t \t\t\t\"Hello \",\n\t \t\t\t\"Thank you\");\n\t }\n\t echo Zend_Json::encode($ret_r);\n \t}\n \telse\n \t{\n \t\t//Wallpost doesnot exist anymore.\n \t\techo Zend_Json::encode(2);\n \t}\n\t}\n\tcatch (Exception $e) \n\t{\n\t\techo Zend_Json::encode(0);\n\t}\n die;\n}", "public function addComment($issueIdOrKey, $comment): Comment\n {\n $this->log->info(\"addComment=\\n\");\n\n if (!($comment instanceof Comment) || empty($comment->body)) {\n throw new JiraException('comment param must be instance of Comment and have body text.');\n }\n\n $data = json_encode($comment);\n\n $ret = $this->exec($this->uri.\"/$issueIdOrKey/comment\", $data);\n\n $this->log->debug('add comment result='.var_export($ret, true));\n $comment = $this->json_mapper->map(\n json_decode($ret),\n new Comment()\n );\n\n return $comment;\n }", "public static function make($photo_id, $author=\"Anonymous\", $body=\"\") {\n\t\tif (!empty($photo_id) && !empty($author) && !empty($body)) {\n\t\t\t$comment = new Comment();\n\t\t\t$comment->photograph_id = (int)$photo_id;\n\t\t\t$comment->created = strftime(\"%Y-%m-%d %H:%M:%S\", time());\n\t\t\t$comment->author = $author;\n\t\t\t$comment->body = $body;\t\t\n\t\t\treturn $comment;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function create_comment_object($photo_id,$author=\"Anonymous\",$body=\"\"){\n\n if(!empty($photo_id) && !empty($author) && !empty($body)){\n global $database;\n $comment= new Comment();\n $comment->photo_id=(int)$photo_id;\n $comment->author=$author;\n $comment->body=\"$body\";\n $properties=$comment->getCleanAssArrOfObjPro();\n\n $sql=\"INSERT INTO \".static::$db_table.\"(\".implode(\",\",array_keys($properties)).\")\";\n $sql.=\"VALUES ('\".implode(\"','\",array_values($properties)).\"')\";\n if($database->query($sql)){\n $comment->id= $database->insertId();\n\n return true;\n\n }else{\n\n return false;\n }\n } else{\n\n return false;\n }\n\n }", "public function store(Request $request, Post $post, Comment $comment = null)\n {\n $validator = Validator::make($request->all(), [\n 'body' => ['required', 'string'],\n ]);\n\n if ($validator->fails()) {\n return response()->json(['error' => $validator->errors()]);\n }\n\n try {\n if ($comment) {\n if (\n $comment->commentable->user != Auth::user() ||\n $comment->comments()->get()->isEmpty() ||\n $comment->comments()->get()->last()->user != Auth::user()\n ) {\n $new_comment = new Comment();\n $new_comment->body = $request->body;\n $new_comment->user_id = Auth::user()->id;\n $reactant = $new_comment->loveReactant()->create([\n 'type' => $new_comment->getMorphClass(),\n ]);\n $new_comment->setAttribute('love_reactant_id', $reactant->getId());\n $comment->comments()->save($new_comment);\n } else {\n return response()->json(['error' => 'You may not create consecutive comments.']);\n }\n } else {\n if (!$post->comments()->get()->isEmpty() && $post->comments()->get()->last()->user != Auth::user()) {\n $new_comment = new Comment();\n $new_comment->body = $request->body;\n $new_comment->user_id = Auth::user()->id;\n $reactant = $new_comment->loveReactant()->create([\n 'type' => $new_comment->getMorphClass(),\n ]);\n $new_comment->setAttribute('love_reactant_id', $reactant->getId());\n $post->comments()->save($new_comment);\n } else {\n return response()->json(['error' => 'You may not create consecutive comments.']);\n }\n }\n return response()->json($new_comment);\n } catch (QueryException $e) {\n return response()->json(['error' => 'There was a problem creating the post.']);\n }\n }", "public function CommentOnAuthorPost($txtPostId,$txtComment){\n\t\t$object=array(\n\t\t\t'PostId' => $txtPostId,\n\t\t\t'CommentDate' => date('Y/m/d'),\n\t\t\t'commentTime' => date('H:i:s'),\n\t\t\t'UserId' => $this->session->userdata('userid'),\n\t\t\t'CommentText' => $txtComment\n\t\t);\n\t\t$this->db->insert('tbl_postcomment', $object);\n\t}", "public function addCommentCollaborator(Comment $comment)\n {\n $this->collaborators[] = array('issue' => $comment->getIssue(), 'user' => $comment->getUser());\n }" ]
[ "0.6902462", "0.68949336", "0.6741255", "0.6264645", "0.6221626", "0.6216631", "0.62049496", "0.6168133", "0.61480266", "0.61472666", "0.6126682", "0.6072381", "0.605467", "0.60528207", "0.5969632", "0.5945974", "0.59293014", "0.5926184", "0.5922152", "0.59220034", "0.59160405", "0.5885636", "0.58846587", "0.5865127", "0.58563906", "0.5855009", "0.58282715", "0.5820358", "0.5812498", "0.58062845", "0.5793383", "0.57776916", "0.57690746", "0.5758627", "0.57517636", "0.5738539", "0.57367814", "0.5717171", "0.5707069", "0.56959605", "0.56939197", "0.5691907", "0.5665233", "0.5647518", "0.56321794", "0.56037307", "0.55978054", "0.5593621", "0.55926836", "0.55917037", "0.5588441", "0.55829173", "0.55734324", "0.5569264", "0.555665", "0.5553328", "0.5532262", "0.55302405", "0.5521852", "0.55149287", "0.5507493", "0.5497174", "0.5495851", "0.54934275", "0.54885197", "0.5480542", "0.54782224", "0.5473756", "0.5467339", "0.54668015", "0.5444753", "0.54348433", "0.5427846", "0.5427108", "0.54243094", "0.5422682", "0.54170287", "0.54141", "0.5401115", "0.5395678", "0.5393091", "0.5361425", "0.5357217", "0.5356917", "0.5352925", "0.5351742", "0.5346295", "0.5345157", "0.53431606", "0.5333261", "0.533249", "0.5314088", "0.53116435", "0.5311573", "0.5309039", "0.53060555", "0.5303852", "0.53033024", "0.5302965", "0.5301094" ]
0.6776433
2
Delete a comment as the currently authenticated user.
function photos_comments_deleteComment ($comment_id) { $response = $this->execute(array('method' => 'flickr.photos.comments.deleteComment', 'comment_id' => $comment_id), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n\t\tif(isset($this->args[1]) && $this->user()) {\n\t\t\ttry {\n\t\t\t\t$this->commentsModel->delete($this->args[1], $this->user->model->userID);\n\t\t\t\t$this->view->setVar('message', 'Deleted comment');\n\t\t\t} catch(exception $excpt) {\n\t\t\t\t$this->view->setError($excpt);\n\t\t\t}\n\t\t}\n\t}", "public function commentDelete(){\n if (Security::isAuthenticated()) {\n $commentid = $_GET['id'];\n $commentRepository = new CommentRepository();\n //call to readById\n $comment = $commentRepository->readById($commentid);\n if ($comment->id == Security::getUserId()) {\n if($commentRepository->deleteById($commentid)){\n header('Location: /comment/showComments?id='.$comment->postid);\n }\n }\n }\n }", "public function deleteCommentAction()\n {\n $this->confirmSession();\n $this->view->disable();\n if ($this->request->hasPost('commentId')) {\n $comment = Comments::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0 AND userId = ?1',\n 'bind' => [\n $this->request->getPost('commentId'),\n $this->session->get('user')['id']\n ]\n ]);\n \n if (!$comment) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment->isDeleted = 1;\n $comment->updatedAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$comment->newsId}\");\n }\n }", "public function delete(User $user, Comment $comment)\n {\n //\n }", "public function delete()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view = Foundry::view( 'comments', false );\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\t$id\t= JRequest::getInt( 'id', 0 );\n\n\t\t$table\t= Foundry::table( 'comments' );\n\n\t\t$state = $table->load( $id );\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\tif( ! ( $access->allowed( 'comments.delete' ) || ( $access->allowed( 'comments.deleteown' ) && $table->isAuthor() ) ) )\n\t\t{\n\t\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_COMMENTS_NOT_ALLOWED_TO_DELETE' ) , SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$state\t= $table->delete();\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t}\n\n\t\t$view->call( __FUNCTION__ );\n\t}", "public function delete() {\n $commentid = $_GET['commentid'];\n Comment::deleteComment($commentid);\n \n //note to self: might be a solution to redirect after deleting?\n// require_once('views/comments/readwithcomments.php');\n }", "public function deleteComment(Request $request){\n try{\n // strip html tags and re-order input for validation\n $request->request->add(['id' => strip_tags($request->comment_id)]);\n $request->request->remove('comment_id');\n\n // validate the target comment exists\n $this->validate($request, [\n 'id' => 'exists:comments',\n ]);\n\n // get the details of the comment being deleted and the user trying to delete it\n $profile = Auth::user()->profile;\n $comment = Comment::where('id', $request->request->get('id'))->first();\n $author = $comment->profile;\n\n \n // add authorisation data to the request (user must be the author or an admin to delete a comment)\n $request->request->add(['authorised' => ($profile->auth == 'admin' || $profile == $author)]);\n \n // validate that the user is authorised to edit the comment\n $this->validate($request, [\n 'authorised' => 'accepted',\n ]);\n \n // check if deletion was authorised by a user who isnt the author\n if($comment->profile->id != $profile->id){\n // if so, notify author of deletion via ItemDeleted event\n ItemDeleted::dispatch($comment->profile);\n }\n \n //delete the comment\n $comment->delete();\n\n // return \"True\" to indicate success\n return \"True\";\n\n }catch(\\Exception $e){\n // return nothing to indicate unknown error\n return \"\";\n }\n }", "public function deleteComment($id){\n $comment = $this->comment->find($id);\n if(!$comment || !Auth::user()->isAdmin() && Auth::user()->id != $comment->user_id){\n return redirect('home');\n }\n $this->comment->deleteComment($id);\n return redirect('home');\n }", "public function deleteComment() {\n parse_str(file_get_contents('php://input'), $_DELETE);\n if(isset($_DELETE['idComm'])) {\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->deleteComment($_DELETE['idComm']);\n\n $this->commentLog(\"/\", \"DELETE\", 204);\n } catch (\\PDOException $ex) {\n $this->errorLog(\"deleteComment()\", $ex->getMessage());\n\n }\n\n } else {\n $this->json(null, 403);\n }\n }", "public function deleteComment($id)\n {\n $comment = Comment::findOrFail($id);\n $user = Auth::user();\n if(!$user){\n return view('auth.login');\n }\n if($user->can(\"delete\", $comment)) {\n $comment->delete();\n\n return redirect()->back();\n }\n else{\n return redirect()->back();\n\n }\n }", "public function destroy(Comment $comment)\n {\n if(Auth::user()->id != $comment->user_id){\n abort(403);\n }\n\n $article_id = $comment->article_id;\n $comment->delete();\n\n return redirect(\"/articles/{$article_id}\");\n }", "public function destroy(Comment $comment)\n {\n if($comment->user_id != auth()->user()->id && auth()->user()->is_admin == false) {\n flash()->overlay(\"You can't delete other peoples comment.\");\n return redirect('/admin/posts');\n }\n\n $comment->delete();\n flash()->overlay('Comment deleted successfully.');\n\n return redirect('/admin/comments');\n }", "public function destroy($id)\n {\n if ( $user = Auth::user() ) {\n $comment = Comment::findOrFail($id);\n \n $comment->delete();\n \n return redirect('/posts')->with('success', 'Comment deleted.');\n }\n return redirect('/posts');\n }", "public function destroy($id)\n {\n $user = Auth::user();\n $comment = Comment::find($id);\n $comment->delete();\n return redirect()->route('users.index');\n }", "public function deleteComment(Request $req, $id, $comment_id) { $comment = Comment::find($comment_id);\n if (!$comment) {\n return response()->json([\n 'status' => 'fail',\n 'message' => 'Bình luận này không tồn tại' \n ], 404);\n }\n\n // check if the user is the owner of this comment? \n if ($comment->idUser != $req->input('user')->id) {\n return response()->json([\n 'status' => 'fail',\n 'message' => 'Chỉ chủ bình luận mới có thể thực hiện thao tác này' \n ], 403);\n }\n \n // delete comment's photo\n if ($comment->photo != null) \n ImageHandler::deleteImage($comment->photo);\n \n // delete that comment\n $comment->delete();\n\n return response()->json([\n 'status' => 'success',\n 'data' => null\n ], 204);\n }", "private function deleteComment()\n {\n try\n {\n $request = $_REQUEST;\n //check if video id provided\n if( !isset($request['comment_id']) || $request['comment_id']==\"\" )\n throw_error_msg(\"comment id not provided\");\n\n if(!is_numeric($request['comment_id']))\n throw_error_msg(\"invalid comment id\");\n\n //check if type provided\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n global $myquery;\n\n $cdetails = $myquery->get_comment((int)$request['comment_id']);\n \n if(!$cdetails)\n throw_error_msg(\"provided comment not exist\");\n \n $myquery->delete_comment((int)$request['comment_id'], clean($request['type']));\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'comments deleted', \"data\" => array());\n $this->response($this->json($data));\n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function postDeleteComment()\n {\n \n \n $id = Input::get('id');\n $user_id = Input::get('user_id');\n \n if(Auth::user()->id == $user_id)\n {\n $c = new Comment();\n return Response::json( $c->deleteComment( $id )); \n }\n else\n {\n echo json_encode('false'); \n }\n \n \n }", "public function deleted(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_delete_author'));\n }", "public function deleteAction()\n {\n $authorization = Zend_Auth::getInstance();\n if(!$authorization -> hasIdentity()) {\n $this->redirect('/users/login');\n }\n else\n {\n // Check if user is Admin\n $userObj = $authorization->getIdentity();\n \n //$this -> view -> data = $this -> model -> listAllUsers(); \n // Get User Id\n $id = $this->getRequest()->getParam('id');\n $thread_id = $this->getRequest()->getParam('thread_id');\n if($comment = $this->model ->getCommentById($id)){\n if ($this->model->deleteComment($id))\n {\n $this->redirect('threads/index/id/'.$thread_id);\n }\n }\n else\n {\n $this->redirect('thread/view/id/'.$thread_id);\n }\n\n\n \n }\n }", "public function delete($id) {\n $id = (int)$id;\n if ($this->user->can('delete_comment')) {\n $comment = ORM::factory('comment')->where('id', $id)->find();\n $comment->delete();\n Tip::set(T::_('Comment deleted.'));\n }\n\n $redirect_uri = $this->input->get('redirect_uri');\n if (empty($redirect_uri)) {\n url::admin_redirect('comments');\n } else {\n url::redirect($redirect_uri);\n }\n }", "public function deleteComment(int $id);", "public function deleteAction()\n {\n $isPosted = $this->request->getPost('doDelete');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = [\n 'id' => $this->request->getPost('id'),\n 'pageKey' => $this->request->getPost('pageKey')\n ];\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->delete($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function destroy(Comment $comment)\n {\n $post = Post::find($comment->post_id);\n if($comment->owner->id == Auth::id()){\n $comment->delete();\n return redirect(route('post.show',compact('post')))->with('_success', 'Comentario eliminado exitosamente!');\n } else {\n return redirect(route('post.show',compact('post')))->with('_failuer', 'No se ha borrado el comentario!');\n }\n }", "public function remove()\n {\n $model = $this->getModel('comments');\n $count = $model->delete();\n if($count === false){\n $msg = JText::_('COM_JOOMGALLERY_COMMAN_MSG_ERROR_DELETING_COMMENT');\n } else {\n if($count == 1){\n $msg = JText::_('COM_JOOMGALLERY_COMMAN_MSG_COMMENT_DELETED');\n } else {\n $msg = JText::sprintf('COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_DELETED', $count);\n }\n }\n\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg);\n }", "public function delete(Comment $comment)\n {\n $comment->rates()->detach(request()->user());\n }", "public function deleteCommentAction(Comment $comment)\n\t{\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\t$em->remove($comment);\n\t\t\t$em->flush();\n\t\t\n\t\treturn $this->redirectToRoute('oc_web_agency_admin');\n\t}", "public function destroy(Comment $comment)\n {\n $comment->delete();\n return redirect('/admin/comments');\n }", "public function destroy($id)\n {\n $comment = Comment::findOrFail($id);\n if ($comment->userId == Auth::user()->id || Auth::user()->isUserAdmin()) {\n $comment->delete();\n }\n\n return redirect(URL::previous());\n }", "public function deleteComment(?User $user, $comment): bool\n {\n return $user->id === $comment->user_id || $user->hasRole('admin');\n }", "public function DeleteComment(){\r\n $this->idPost();\r\n $this->comment(); \r\n $this->_commentManager->DeleteComment($this->_idPostSecure);\r\n header('location: Gestioncommentaire'); \r\n }", "public function destroy($id)\n {\n $com = Comments::where('user',$id);\n $com->delete();\n $user = User::find($id);\n $user->delete();\n return redirect()->back();\n }", "public function destroy(Comment $comment)\n {\n $this->authorize('delete', $comment);\n\n $comment->delete();\n\n return back();\n }", "public function delete(Request $request)\n {\n if(isset($request->comment_id) && $request->comment_id != '')\n {\n $data = Comment::find($request->comment_id);\n if(empty($data))\n {\n $response = [\n 'status' => false,\n 'message' => 'Comment does not exists!!',\n ];\n return response()->json($response);\n }\n try{\n $token = $request->header('token');\n $gettoken = JWT::decode($token, env('JWT_KEY'), array('HS256'));\n // $gettoken[0] = 123;\n if($data->user_id == $gettoken[0])\n {\n $data->delete();\n $response = [\n 'status' => true,\n 'message' => 'Delete success!!!',\n ];\n return response()->json($response);\n }\n else\n {\n $response = [\n 'status' => false,\n 'message' => 'You are not allowed to fix this comment !!!',\n ];\n return response()->json($response);\n }\n }catch(\\Exception $e)\n {\n $response = [\n 'status' => false,\n 'message' => 'Delete fail!!!',\n ];\n return response()->json($response);\n }\n }\n else\n {\n $response = [\n 'status' => false,\n 'message' => 'Please fill the comment_id !!!',\n ];\n return response()->json($response);\n }\n }", "function delete_comment($comment_id) {\n $comment_id = (int)$comment_id;\n \n mysql_query(\"DELETE FROM `comments` WHERE `comment_id`=$comment_id AND `user_id`=\".$_SESSION['user_id']);\n}", "public function delete(Request $request, $id)\n {\n //Get Bearer Token\n $getToken = $request->bearerToken();\n\n //Get comment\n $getComment = Comment::find($id);\n\n if (!$getComment) {\n return response([\n 'message' => 'Comment does not exist'\n ]);\n }\n\n if (!isset($getToken)) {\n return response([\n 'message' => 'Bearer token not found'\n ]);\n }\n\n //Decode\n $decoded = JWT::decode($getToken, new Key('ProgrammersForce', 'HS256'));\n\n //Get Id\n $userId = $decoded->data;\n\n //Get friends of this user\n $sentRequests = SentFriendRequest::all()->where('user_id', $userId)->where('status', true)->pluck('receiver_id')->toArray();\n $recievedRequests = ReceivedFriendRequest::all()->where('user_id', $userId)->where('status', true)->pluck('sender_id')->toArray();\n\n //Get Post id\n $postId = $getComment->post_id;\n $getPost = Post::find($postId);\n\n //user_id of author of this post\n $author = $getPost->user_id;\n\n //user_id of commenter\n $commenter = $getComment->user_id;\n\n /*\n If author of the posts is\n > User's friend\n > User of the author of the post\n > Post is public\n allow user to comment otherwise return unauthorized response\n */\n if (in_array($author, $sentRequests) || in_array($author, $recievedRequests) || $author == $userId || $getPost->privacy == false && $commenter == $userId) {\n\n $comment = Comment::where('id', $id)->where('user_id', $userId)->first();\n\n if ($comment) {\n $comment->delete();\n\n return response([\n 'message' => 'Comment deleted successfully',\n 'comment' => $comment\n ]);\n } else {\n return response([\n 'message' => 'You are not allowed to comment on this post'\n ], 404);\n }\n } else {\n return response([\n 'message' => 'You are not allowed to comment on this post'\n ], 404);\n }\n }", "public function destroy($id)\n {\n $comment = Comment::find($id);\n $userAuth = Auth::user();\n\n // Si esta autenticado y (Comprobar si es dueño del comentario o de la publicacion de la imagen)\n if ($userAuth && ($comment->user_id == $userAuth->id || $comment->image->user_id == $userAuth->id)) {\n $comment->delete();\n\n return redirect()->route('images.show', ['id' => $comment->image->id])\n ->with('flash', 'Comment delete successfully ');\n } else {\n\n return redirect()->route('images.show', ['id' => $comment->image->id])\n ->with('flash', 'Comment not delete ');\n }\n }", "function wp_delete_comment($comment_id, $force_delete = \\false)\n {\n }", "public function delete(User $user, Comment $comment)\n {\n return $this->view($user, $comment)\n && ($user->hasCapability('comments::delete') || $comment->user_id === $user->id);\n }", "function delete_comment( $path, $blog_id, $comment_id ) {\n\t\t$comment = get_comment( $comment_id );\n\t\tif ( !$comment || is_wp_error( $comment ) ) {\n\t\t\treturn new WP_Error( 'unknown_comment', 'Unknown comment', 404 );\n\t\t}\n\n\t\tif ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) { // [sic] There is no delete_comment cap\n\t\t\treturn new WP_Error( 'unauthorized', 'User cannot delete comment', 403 );\n\t\t}\n\n\t\t$args = $this->query_args();\n\t\t$return = $this->get_comment( $comment->comment_ID, $args['context'] );\n\t\tif ( !$return || is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t/** This action is documented in json-endpoints/class.wpcom-json-api-site-settings-endpoint.php */\n\t\tdo_action( 'wpcom_json_api_objects', 'comments' );\n\n\t\twp_delete_comment( $comment->comment_ID );\n\t\t$status = wp_get_comment_status( $comment->comment_ID );\n\t\tif ( false === $status ) {\n\t\t\t$return['status'] = 'deleted';\n\t\t\treturn $return;\n\t\t}\n\n\t\treturn $this->get_comment( $comment->comment_ID, $args['context'] );\n\t}", "public static function deleteComments(Request $request);", "public function deleteComment($comment_id)\n {\n $comment = Comment::find($comment_id);\n $comment->delete();\n\n return back()->with('success', 'Comment deleted successfully');\n }", "public function actionDelete($id)\n {\n $comment = $this->findModel($id);\n if ($comment->belongsTo(Yii::$app->user->id)) {\n try {\n $comment->delete();\n } catch (StaleObjectException $e) {\n Yii::error($e, __METHOD__);\n Yii::$app->session->setFlash('error', 'Error while deleting comment: #' . $id);\n return Response::$httpStatuses[400];\n } catch (Throwable $e) {\n Yii::error($e, __METHOD__);\n Yii::$app->session->setFlash('error', 'Error while deleting comment: #' . $id);\n return Response::$httpStatuses[400];\n }\n\n return ['success' => true];\n }\n\n Yii::error('Error while deleting comment: #' . $id . ' deletion not allowed');\n Yii::$app->session->setFlash('error', 'Error while deleting comment: #' . $id . ' deletion not allowed');\n return Response::$httpStatuses[403];\n }", "function deleteComment($id)\n {\n $userLogged = Auth::check(['administrateur']);\n\n $errors = [];\n \n // we delete the comment \n $commentManager = new CommentManager();\n try{\n $comment = $commentManager->deleteComment($id);\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n\n setFlashErrors($errors); // pour gerer les erreurs en message flash (voir fichier globalFunctions.php)\n require_once'../app/Views/errors.php';\n return http_response_code(302);\n \n }\n\n setFlashErrors($errors);\n\n require'../app/Views/backViews/comment/backDeleteCommentView.php';\n }", "function deleteComment($commentid) {\n\t$commentid = intval($commentid);\n\treturn(dbQuery(\"UPDATE comments SET deleted=1 WHERE id=$commentid AND userid=$_SESSION[id]\"));\n}", "public function delete(User $user, Comment $comment)\n {\n return (($user->role==config('samk.roles')[1]&& Auth()->is_now_commentator==true) && Auth::id == $comment->user->id) || $user->role=='admin';\n }", "public function deleteTextPostComment(TextPostComment $comment){\n if(Auth::user()->can('delete', $comment))\n {\n $comment->delete();\n }\n return redirect()->back();\n }", "public function destroy($id)\n {\n $comment = Comment::find($id);\n if(auth()->user()->id!=$comment->user_id){\n return redirect('/posts')->with('error', \"Unauthorized Page!\");\n }\n if($comment->image!='noImageUpload.jpg'||$comment->image!='NULL'){\n Storage::delete('public/images/'.$comment->image);\n }\n $comment->delete();\n return redirect('/posts/'.$comment->post_id)->with('success', 'Comment has been deleted!');\n }", "public function destroy(Comment $post_comment)\n {\n if (!auth()->user()->ability('admin','delete_post_comments')) {\n return abort(403);\n }\n $post_comment->delete();\n return redirect()->route('admin.post_comments.index')->with([\n 'message' => 'Comment deleted successfully',\n 'alert-type' => 'success',\n ]);\n }", "public function actionDelete()\n {\n $apiName = 'comment/delete';\n $sessionId = null;\n \n $_JSON = $this->getJsonInput();\n \n try\n {\n if(!isset($_JSON) || empty($_JSON))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'No input received.');\n else if(!isset($_JSON['sessionId']) || empty($_JSON['sessionId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter session id.');\n else if(!isset($_JSON['commentId']) || empty($_JSON['commentId']))\n $result = $this->error($apiName, WS_ERR_POST_PARAM_MISSED, 'Please enter comment id.');\n else\n {\n $userId = $this->isAuthentic($_JSON['sessionId']);\n $user = User::model()->findByPk($userId);\n if (is_null($user))\n $result = $this->error($apiName, WS_ERR_WONG_USER, 'Please login before using this service.');\n else\n {\n $commentId = filter_var($_JSON['commentId'], FILTER_SANITIZE_NUMBER_INT);\n $comment = Comment::model()->findByAttributes(array('id'=>$commentId), '(userId=:uid or postUserId=:uid)', array(':uid'=>$userId));\n if (is_null($comment))\n $result = $this->error($apiName, WS_ERR_WONG_VALUE, 'Selected comment does not exist.');\n else\n {\n //delete record\n $comment->delete();\n \n $result = array(\n 'api' => $apiName,\n 'apiMessage' => 'Comment deleted successfully.',\n 'status' => 'OK'\n );\n }\n }\n }\n } \n catch (Exception $e)\n {\n $result = $this->error($e->getCode(), Yii::t('app', $e->getMessage()));\n }\n $this->sendResponse(json_encode($result, JSON_UNESCAPED_UNICODE));\n }", "public function remove(Request $request, Comment $comment)\n {\n $comment->voteFromUser($request->user())->delete();\n\n return response()->json(null, 200);\n }", "public function delete_comment() {\n\t\tif ($this->request->is('get')) {\n\t\t\t$comment_id = $_GET['comment_id'];\n\t\t\t$content_id = $_GET['content_id'];\n\t\t\t$db = ConnectionManager::getDataSource('default');\n\t\t\t$db->rawQuery(\"DELETE FROM tweet_comments WHERE id=\".$comment_id.' AND comment_type= \"tweets\"');\n\t\t\t\n\t\t\t$total_tweet_reply = ClassRegistry::init('tweet_comments')->find('all',array('fields'=>array('tweet_comments.content_id'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('tweet_comments.content_id='.$content_id.' AND tweet_comments.comment_type=\"tweets\"')));\n\t\t\techo $total_tweet_reply = sizeof($total_tweet_reply);\n\t\t\t$this->autorender = false;\n\t \t$this->layout = false;\n\t \t$this->render('delete_comment');\n\t\t}\n\t\t\n\t}", "public function deleted(Comment $comment)\n {\n Cache::forget('comment_'.$comment->id);\n }", "public function destroy(Comment $comment)\n {\n $this->authorize('delete', $comment);\n\n $comment->delete();\n\n return response()->json([], 204);\n }", "public function delete()\n {\n $data = Comment::where(\"reply\", $this->id)->get();\n foreach ($data as $comment) {\n $comment->delete();\n }\n\n /**\n * Delete self\n */\n parent::delete();\n }", "public function destroy(Comment $comment)\n {\n if ($comment) {\n $result = $comment->delete();\n } else {\n Toastr::warning('W00ps! Something went wrong. Try again.', 'warning');\n return redirect()->back();\n }\n\n\n if ($result) {\n Toastr::success('Comment has deleted successfully.', 'success');\n return redirect()->back();\n } else {\n Toastr::warning('W00ps! Something went wrong. Try again.', 'warning');\n return redirect()->back();\n }\n }", "public function delete($user, Comment $comment) : bool\n {\n// $user->id == $comment->commenter_id ||\n return $user->role == 'admin' || $user->role == 'moderator';\n }", "public function deleteComment($commentId) {\n\t\tif($this->checkAdmin()) { \n\t\t\t$this->commentDAO->deleteComment($commentId);\n\t\t\t$this->session->set('delete_comment', 'Le commentaire a bien été supprimé.');\n\t\t\theader('Location: index.php?action=administration');\n\t\t}\n\t}", "public function get_delete($id)\n\t{\n\t\tAcl::can('get_comments_delete');\n\n\t\t$comment = Blog_Comment::find($id);\n\n\t\tif( ! is_null($comment))\n\t\t{\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\t$comment->delete();\n\n\t\t\tSession::flash('message', 'Deleted comment #'.$comment->id);\n\t\t}\n\n\t\treturn Redirect::to('blog/comments');\n\t}", "public function destroy(Comment $comment, $id)\n {\n Comment::destroy($id);\n return redirect('/comment')->with('message','comment berhasil di delete');\n }", "public function destroy(comment $comment)\n {\n //\n }", "public function destroy($id)\n\t{\n\t\t$delete_data = fc_comment::where('id',$id)->first();\n\t\t$delete_data->delete();\n\t\treturn redirect(\"admin/comments\");\n\t}", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function destroy(Comment $comment)\n {\n $this->authorize('destroy', $comment);\n $comment->delete();\n return redirect()->route('boards.index');\n }", "public function destroy($id)\n {\n try {\n $comment = Comment::findOrFail($id);\n $comment->delete();\n session()->put('message', 'Selected comment successfully removed.');\n session()->put('type', 'success');\n } catch (\\Exception $exception) {\n// return to main page if post does not exist\n session()->put('message', 'Failed to remove comment.');\n session()->put('type', 'warning');\n }\n return redirect('admin/comments');\n }", "public function destroy(string $user, string $path, Blog $blog, Comment $comment)\n {\n $coworkers = Coworker::where('page_id', $blog->page_id)->where('user_id',Auth::user()->id)->first();\n if( Auth::check() ) { # user is logged in\n if (Auth::user() == $comment->user or Auth::user() == $blog->user or Auth::user()->id==$coworkers->user_id) { # user is owner of comment\n $comment->delete();\n }\n }\n return redirect()->route('blog.show', ['user'=>$user, 'path'=> $path, 'blog' =>$blog]);\n }", "public function destroy(Comment $comment)\n {\n $comment->delete();\n return 'success';\n }", "public function destroy(commentes $commentes)\n {\n $id =request('id');\n $comments =new commentes;\n $res=commentes::where('id',$id)->get();\n foreach ($res as $res) {\n $userid=$res->user_id;\n }\n\n if(Auth::user()->id == $userid ){\n commentes::where('id',$id)->delete();\n return back();\n }\nelse{\n\n echo \"<script type='text/javascript'>alert('failed!');\n window.location.href='/blog/public/';\n </script>\";\n}\n }", "public function destroy($id)\n {\n $comment=Comments::findOrFail($id);\n $comment->delete();\n Session::flash('message_danger','Se eliminó el comentario');\n return redirect()->route('user.profile.tasks');\n }", "public function destroy(Comment $comment)\n {\n $this->apiDelete('api.comments.destroy', [], ['comment' => $comment->id]);\n\n if (Response::HTTP_NO_CONTENT !== $this->getLastApiStatus()) {\n session()->flash(\n 'errors',\n [sprintf('Comment \"%1$s\" could not be deleted.', $comment->name)]);\n } else {\n session()->flash(\n 'success',\n sprintf('Comment \"%1$s\" successfully deleted.', $comment->name)\n );\n }\n\n return redirect(route('admin.comments.index'));\n }", "public function delQuestionComment(Request $request, QuestionModel $question, Comment $comment)\n {\n $user = $request->user();\n if ($user->id !== $comment->user_id) {\n return response()->json(['message' => [trans('plus-question::comments.not-owner')]], 403);\n }\n\n $question->getConnection()->transaction(function () use ($question, $comment, $user) {\n $comment->delete();\n $question->decrement('comments_count', 1);\n $user->extra()->decrement('comments_count', 1);\n });\n\n return response()->json()->setStatusCode(204);\n }", "public function getDelete($commentId)\n {\n $comment = $this->comments->requireById($commentId);\n if (Auth::user()->id != $comment->author_id) return Redirect::to('/');\n $this->view('forum.delete', compact('comment'));\n }", "public function forceDelete(User $user, Comment $comment)\n {\n //\n }", "public function forceDelete(User $user, Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n if ($comment->user_id != auth()->id()) {\n return errorResponse(401, 'Permission denied');\n }\n\n $comment->delete();\n\n return resourceCreatedResponse([], 'Comment deleted successfully', 200);\n }", "public function delete($comment_id) {\n if ($response = $this->podio->delete('/comment/'.$comment_id)) {\n return TRUE;\n }\n }", "public function destroy(Comment $comment)\n {\n activity()->performedOn($comment)->causedBy(getLoggedInUser())\n ->useLog('Comment deleted.')\n ->log($comment->description.' Comment deleted.');\n\n $this->commentRepository->delete($comment->id);\n\n return $this->sendSuccess('Comment deleted successfully.');\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function destroy(Comment $comment)\n {\n //\n }", "public function deleteComment($comment_id, $username)\n {\n\n // Get username from the database for this comment\n if ($stmt = $this->database->prepare(\"SELECT username FROM comments WHERE comment_id = ? \")) {\n $stmt->bind_param('i', $comment_id);\n $stmt->execute();\n $stmt->bind_result($username_in_DB);\n $stmt->fetch();\n $stmt->close();\n } else {\n printf(\"Query Prep Failed: %s\\n\", $this->database->error);\n return false;\n }\n\n // Check if the right user is deleting\n if (strcmp($username, $username_in_DB) != 0) {\n printf(\"Comment belongs to another user: cannot delete\");\n return false;\n }\n\n // Delete the comment\n if ($stmt = $this->database->prepare(\"DELETE FROM comments where comment_id = ?\")) {\n $stmt->bind_param('i', $comment_id);\n $success = false;\n if ($stmt->execute()) {\n $success = true;\n }\n $stmt->close();\n return ($success);\n }\n printf(\"Query Prep Failed: %s\\n\", $this->database->error);\n return false;\n }", "public function delete($id) {\n // Delete the comment\n $this->getDb()->delete('t_comment', array('com_id' => $id));\n }", "public function destroy($id)\n {\n $comment=comments::find($id)->delete();\n return redirect('commenttable');\n }", "public function destroy($id)\n {\n $comment = Comment::find($id);\n if($comment->user_id != Auth::id())\n {\n return response()->json('Error!');\n }\n $comment->delete();\n\n return response()->json('The post successfully deleted');\n }", "public function delete(User $user, Comment $comment)\n {\n return !!(auth()->check() && $comment->user_id == $user->id);\n }", "public function deleteComment($id)\n {\n $comment = CourseComment::where('id', $id);\n\n if($comment)\n {\n $comment->delete();\n }\n\n session()->flash('success', 'Comment Deleted Successfully');\n\n return redirect()->back();\n }", "public function destroy(Request $request, $id)\n {\n $comment = Comment::findOrFail($id);\n if ($request->user()->can('create', $comment)) {\n $article = $comment->articles()->first()->id;\n $comment->delete();\n flash('댓글이 삭제되었습니다.');\n return redirect(route('article.show', $article));\n } else {\n flash('승인되지 않은 사용자 행위입니다.');\n return redirect()->back();\n }\n }", "public function removeCommentAction($id, Request $request, Application $app)\n {\n $app['dao.comment']->delete($id);\n $app['session']->getFlashBag()->add('success', 'Le commentaire a bien été supprimé.');\n // Redirect to admin home page\n return $app->redirect($app['url_generator']->generate('admin'));\n }", "public function destroy(Request $request, $id)\n {\n $com = Comment::find($id);\n $com->delete();\n //get the post id\n $post = $request->post;\n\n //create notification\n session()->put('msg', 'Comment Deleted ');\n return redirect()->route('posts.show', $post);\n\n }", "public function destroy($account, $id, Request $request)\n {\n $comment = Comment::find($id);\n $comment->delete();\n\n $request->session()->flash('alert-success', 'Comment was successful deleted!');\n return Redirect::back();;\n }", "public function destroy(Comment $comment)\n {\n $comment->delete();\n\n return response(null, 204);\n }", "public function delete($id)\n {\n $this->getDb()->delete('comments', ['id' => $id]);\n }", "public function destroy(Request $request, User $user)\n {\n $this->authorize('delete', $user);\n Auth::guard('web')->logout();\n $request->session()->invalidate();\n $request->session()->regenerateToken();\n $user->comments()->each(function($comment) {\n $comment->delete(); // <-- direct deletion\n });\n $user->posts()->each(function($post) {\n if(!is_null($post->file)) $post->file->delete();\n $post->delete(); // <-- direct deletion\n });\n $user->delete();\n\n return redirect(route('login'))->with('message', 'User Deleted Successfully!');\n }", "public function delete(Comment $comment)\n {\n $this->db->pdo->exec('DELETE FROM comments WHERE idnews = '. $comment->idNews());\n }", "public function deleteUser()\n {\n $this->delete();\n }", "public function destroy(Comment $comment)\n {\n $comment->delete();\n return redirect()->back();\n }", "function delete_comment($comment_id) {\n global $db;\n $query = 'DELETE FROM comments\n WHERE comment_id = :comment_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':comment_id', $comment_id);\n $statement->execute();\n $statement->closeCursor();\n }" ]
[ "0.7822346", "0.7548663", "0.74190027", "0.72601783", "0.71056306", "0.7054036", "0.7052628", "0.7047756", "0.70430076", "0.69205445", "0.69114107", "0.6890185", "0.6844323", "0.68412", "0.6835261", "0.68135774", "0.6742028", "0.67405355", "0.67285347", "0.67265874", "0.6704342", "0.6691444", "0.6671041", "0.66590726", "0.66581255", "0.66300064", "0.6629967", "0.66058743", "0.65494525", "0.6540729", "0.6528408", "0.65141296", "0.6513712", "0.650292", "0.65016747", "0.6499999", "0.6496398", "0.64844173", "0.6479862", "0.6475493", "0.64679307", "0.6458647", "0.64506614", "0.645032", "0.6449598", "0.644459", "0.6442466", "0.6436811", "0.6434633", "0.6433793", "0.6433766", "0.6432797", "0.6412453", "0.640351", "0.63985884", "0.6382185", "0.63725805", "0.6361021", "0.63595253", "0.63430893", "0.6337766", "0.6332383", "0.6326425", "0.63262546", "0.6320085", "0.6316244", "0.6308628", "0.6302906", "0.62995857", "0.62828684", "0.6276054", "0.62745893", "0.62745893", "0.62689203", "0.6258354", "0.6249146", "0.62478215", "0.62478215", "0.62478215", "0.62478215", "0.62478215", "0.62478215", "0.62478215", "0.62478215", "0.6245571", "0.6233621", "0.62292224", "0.62272894", "0.622599", "0.6223929", "0.6209531", "0.6206776", "0.6197465", "0.61868", "0.6179727", "0.6176189", "0.61751294", "0.61747867", "0.6174017", "0.6172307", "0.6164357" ]
0.0
-1
Edit the text of a comment as the currently authenticated user.
function photos_comments_editComment ($comment_id, $comment_text) { $response = $this->execute(array('method' => 'flickr.photos.comments.editComment', 'comment_id' => $comment_id, 'comment_text' => $comment_text), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editComment()\n {\n session_start();\n if (isset($_SESSION['isLoggedIn']) && !empty($_SESSION['isLoggedIn'])) {\n $post = $this->postRepository->readById($_GET['post_id']);\n $comment = $this->commentRepository->readById($_GET['comment_id']);\n $view = new View('comment/edit');\n $view->comment = $comment;\n $view->title = 'Post editieren';\n $view->post = $post;\n $view->display();\n } else {\n header('Location: /user/index?error=Du bist nicht eingeloggt!');\n }\n }", "public function commentUpdate() {\n\t\t$id = $_POST['id'];\n\t\t$text = $_POST['text'];\n\t\t$c = Comment::find($id);\n\t\t$c->text = $text;\n\t\t$c->save();\n\t}", "public function doUpdateComment()\n {\n session_start();\n if (isset($_SESSION['isLoggedIn']) && !empty($_SESSION['isLoggedIn'])) {\n if (isset($_POST)) {\n if (!$this->comment_update_is_valid($_POST['comment_id'], $_POST['text'])) {\n header('Location: /post/index');\n exit();\n }\n $text = htmlspecialchars($_POST['text']);\n $comment_id = $_POST['comment_id'];\n $post_id = $_POST['post_id'];\n $this->commentRepository->update($post_id, $comment_id, $text);\n }\n } else {\n header('Location: /user/index?error=Du bist nicht eingeloggt!');\n }\n }", "public function setCommentText($value)\n {\n $this->commentText=$value;\n }", "public function editComment(Request $request){\n try{\n // strip html tags and re-order input for validation\n $request->request->add(['id' => strip_tags($request->comment_id)]);\n $request->request->remove('comment_id');\n $request->request->add(['content' => strip_tags($request->content)]); \n\n // validate the target comment exists and replacement content has been submitted\n $this->validate($request, [\n 'id' => 'exists:comments',\n 'content' => 'required',\n ]);\n\n // get the details of the comment being edited and the user trying to edit it\n $profile = Auth::user()->profile;\n $comment = Comment::where('id', $request->request->get('id'))->first();\n $author = $comment->profile;\n\n // add authorisation data to the request (user must be the author to edit a comment)\n $request->request->add(['authorised' => $profile == $author]);\n \n // validate that the user is authorised to edit the comment\n $this->validate($request, [\n 'authorised' => 'accepted',\n ]);\n\n // update the comment with the new content\n $comment->content = $request->request->get('content');\n $comment->save();\n\n // return the comment to be displayed by the website\n // (seperate fields with \"<a>\", guaranteed no mistakes as html tags were stripped from input data)\n return $comment->id.\"<a>\".$comment->content;\n\n }catch(\\Exception $e){\n //return nothing (caught as an error on client side)\n return \"\";\n }\n }", "public function update_comment_id_user_form_info_text($comment_id,$submission_id,$user_form_info_text_id)\n {\n $this->db->where('submission_id',$submission_id); \n $this->db->where('user_form_info_text_id',$user_form_info_text_id);\n $this->db->update('user_form_info_text',array('comment_id'=>$comment_id));\n }", "public function edit($text){\n global $db;\n $this->_text = $text;\n $update = $db->prepare('UPDATE posts SET text =? WHERE id =?');\n $update->execute([$this->_text, $this->_id]);\n }", "function jal_edit_comment_link($text = 'Edit This', $before = '', $after = '', $editing_message = '<strong>EDITING</strong>') {\n\tglobal $comment, $jal_minutes, $user_ID, $post;\n \n $time_ago = time() - strtotime($comment->comment_date_gmt . ' GMT');\n\n if (user_can_edit_post_comments($user_ID, $post->ID))\n edit_comment_link($text, $before, $after);\n \n\telseif ($comment->comment_author_IP == $_SERVER['REMOTE_ADDR']\n\t // show the link for the allotted time - 5 minutes\n\t && $time_ago < 60 * ($jal_minutes - 5)\n\t // don't show edit links if they're already editing\n\t && !isset($_GET['jal_edit_comments'])) {\n\t \n\t echo \"\\n{$before}<a href='\".add_query_arg('jal_edit_comments', \"$comment->comment_ID\").\"#commentform' title='Edit this Comment'>{$text}</a>{$after}\\n\";\n\t}\n\t\n\t// When the author has clicked Edit, the comment they are editing is highlighted as EDITING\n\telseif (isset($_GET['jal_edit_comments']) && $comment->comment_ID == $_GET['jal_edit_comments'])\n\t\techo $editing_message;\n\n}", "function edit_comment($comment)\n {\n }", "public function editCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new EditCommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = Comments::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0 AND userId = ?1',\n 'bind' => [\n $this->request->getPost('commentId'),\n $this->session->get('user')['id']\n ]\n ]);\n \n if (!$comment) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment->content = $this->request->getPost('content');\n $comment->updatedAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$comment->newsId}\");\n }\n }", "public function editComment($ucid, $content)\n {\n $content = $this->md_to_html->text(htmlspecialchars(urldecode($content)));\n $timestamp = date(DateTime::ISO8601);\n $stmt = $this->db->prepare('UPDATE comments SET content = :content, timestamp = :timestamp WHERE ucid = :ucid');\n $stmt->bindValue(':content', $content);\n $stmt->bindValue(':timestamp', $timestamp);\n $stmt->bindValue(':ucid', $ucid);\n $stmt->execute();\n }", "public function edit(Comment $comment) {\n //\n }", "public function edit(comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit(Comment $comment)\n {\n //\n }", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function editCommentAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t$zend_filter_obj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$comment_text_filtered = $zend_filter_obj->filter( $params['comment_text'] );\n \t\n \techo Zend_Json::encode( \\Extended\\comments::editComment( $params['comment_id'], $comment_text_filtered ) );\n \tdie;\n }", "public function edit(Comment $comment)\n {\n echo json_encode($comment);\n }", "public function update()\n {\n $id=request('id');\n\n $res=commentes::where('id',$id)->get();\n\n $comment=new commentes;\n foreach ($res as $res) {\n $userid=$res->user_id;\n }\n if(Auth::user()->id == $userid){\n $comment= commentes::find($id);\n $comment->body=request('body');\n $comment->save();\n return redirect('/');\n }\n else {\n echo \"<script type='text/javascript'>alert('call the owner plz!');\n window.location.href='/blog/public/';\n </script>\";\n }\n }", "public function editAction()\n {\n $authorization = Zend_Auth::getInstance();\n if(!$authorization -> hasIdentity()) {\n $this->redirect('/users/login');\n }\n else\n {\n // Check if user is Admin\n $userObj = $authorization->getIdentity();\n // Create Form Object\n $form = new Application_Form_Comments();\n \n //$this -> view -> data = $this -> model -> listAllUsers(); \n // Get User Id\n $id = $this->getRequest()->getParam('id');\n $thread_id = $this->getRequest()->getParam('thread_id');\n if($comment = $this->model ->getCommentById($id)){\n if($comment[0]['u_id'] == $userObj-> id or $userObj-> type == 1 ){\n $form->populate($comment[0]); \n }\n else\n {\n $this->redirect('/');\n }\n // Found user\n \n }\n else\n {\n $this->redirect('thread/view/id/'.$thread_id);\n }\n\n\n if($this->getRequest()->isPost()){\n $data = $this->getRequest()->getParams();\n \n //var_dump($info);\n\n if($form->isValid($data)){\n if ($this->model->editComment($id, $data))\n {\n $this->redirect('threads/index/id/'.$thread_id);\n }\n \n }\n } \n $this->view->form = $form;\n \n }\n }", "public function actionSaveEdit($id){\n $model = Comments::model()->findByPk($id);\n $model->text = CHtml::encode(print_r($_POST['Comments']['text'], true));\n \n if($model->save()) {\n //happy dance\n } \n else {\n throw new CHttpException(500, 'Something went wrong');\n }\n echo '<script type=\"text/javascript\">';\n echo 'var element = document.getElementById(\"text' . $model->id . '\");';\n echo 'element.innerHTML = \"<p class=\\\"comment-text\\\">' . $model->text . '</p>\";';\n echo '</script>';\n }", "public function update()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view\t\t= Foundry::view( 'comments', false );\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\t$id\t\t= JRequest::getInt( 'id', 0 );\n\n\t\t$table = Foundry::table( 'comments' );\n\t\t$state = $table->load( $id );\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\tif( ! ( $access->allowed( 'comments.edit' ) || ( $access->allowed( 'comments.editown' ) && $table->isAuthor() ) ) )\n\t\t{\n\t\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_COMMENTS_NOT_ALLOWED_TO_EDIT' ) , SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$input\t= JRequest::getVar( 'input', '' );\n\n\t\t$newData = array(\n\t\t\t'comment' => $input\n\t\t);\n\n\t\t$state = $table->update( $newData );\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t}\n\n\t\t$view->call( __FUNCTION__, $table );\n\t}", "function warquest_home_comment_edit_do() {\r\n\r\n\t/* input */\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\t\t \r\n\t/* output */\r\n\tglobal $page;\r\n\t\t\t\r\n\tif ($uid!=0) {\r\n\t\t$query = 'select comment from comment where id='.$uid;\r\n\t\t$result = warquest_db_query($query);\r\n\t\t$data = warquest_db_fetch_object($result);\r\n\t\t\r\n\t\t$comment = $data->comment;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t/* Clear input parameters */\r\n\t\t$comment = \"\";\r\n\t}\r\n\t\r\n\t$page .= \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">function limitText(limitField, limitNum) { if (limitField.value.length >= limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } </script>\";\r\n\t\t\r\n\t$page .= '<div class=\"box\">';\t\r\n\t\r\n\t$page .= '<table>';\r\n\t$page .= '<tr>';\r\n\t$page .= '<td width=\"500\">';\r\n\r\n\tif (isset($other->pid)) {\r\n\t\t$tmp = player_format($other->pid, $other->name, $other->country);\r\n\t} else {\r\n\t\t$tmp = t('GENERAL_ALL');\r\n\t}\r\n\t$page .= t('ALLIANCE_COMMENT_TEXT2', $tmp).'<br/>'; \r\n\t\r\n\t$page .= '<textarea style=\"width:100%\" id=\"comment\" name=\"comment\" rows=\"5\" ';\r\n\t$page .= 'onKeyDown=\"limitText(this,400)\">'.$comment.'</textarea><br/>';\r\n\t$page .= warquest_show_smilies();\r\n\t$page .= '<br/><br/>';\r\n\t\r\n\tif (isset($other->pid)) {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&oid='.$other->pid.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t} else {\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_SAVE.'&uid='.$uid, t('LINK_SAVE'), 'save').' ';\r\n\t}\r\n\t\r\n\tif ($uid!=0) {\r\n\t\t$page .= ' ';\r\n\t\t$page .= warquest_link('mid='.$mid.'&sid='.$sid.'&eid='.EVENT_HOME_COMMENT_DELETE.'&uid='.$uid, t('LINK_DELETE'), 'delete');\r\n\t}\r\n\t\r\n\t$page .= '</td>';\r\n\t$page .= '</tr>';\r\n\t$page .= '</table>';\r\n\r\n\t$page .= '</div>';\t\r\n}", "public function edit($id)\n {\n $user = Auth::user();\n $comment = Comment::find($id);\n\n if ($comment->user->id == $user->id) {\n return view('comments.edit', compact('comment'));\n } else {\n // return redirect()->route('home');\n return back()->with('flash', 'Can not edit comment ');\n }\n }", "public function editAction()\n {\n $isPosted = $this->request->getPost('doEdit');\n if (!$isPosted) {\n $this->response->redirect($this->request->getPost('redirect'));\n }\n $comment = $this->getCommentSessionValuesFromForm();\n $comments = new \\Anax\\Comment\\CommentsInSession();\n $comments->setDI($this->di);\n $comments->edit($comment);\n $this->response->redirect($this->request->getPost('redirect'));\n }", "public function edit(Comment $comment)\n {\n return $this->sendResponse($comment, 'Comment retrieved successfully.');\n }", "public function setCommentText($commentText) {\n\t\t$this->commentText = $commentText;\n\t}", "public function iN_UpdateComment($userID, $postID, $commentID, $editedText) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\t$postID = mysqli_real_escape_string($this->db, $postID);\n\t\t$commentID = mysqli_real_escape_string($this->db, $commentID);\n\t\tif ($this->iN_CheckUserExist($userID) == 1 && $this->iN_CheckPostIDExist($postID) == 1 && $this->iN_CheckCommentIDExistUniq($commentID) == 1) {\n\t\t\tmysqli_query($this->db, \"SET character_set_client=utf8mb4\") or die(mysqli_error($this->db));\n\t\t\tmysqli_query($this->db, \"SET character_set_connection=utf8mb4\") or die(mysqli_error($this->db));\n\t\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\t\t$updateComment = mysqli_query($this->db, \"UPDATE i_post_comments SET comment = '$editedText' WHERE com_id = '$commentID'\") or die(mysqli_error($this->db));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$updateComment = mysqli_query($this->db, \"UPDATE i_post_comments SET comment = '$editedText' WHERE com_id = '$commentID' AND comment_uid_fk = '$userID'\") or die(mysqli_error($this->db));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function edit($id)\n {\n $comment = Comment::find($id);\n if(auth()->user()->id!=$comment->user_id){\n return redirect('/posts')->with('error', \"Unauthorized Page!\");\n }\n return view('comments.edit')->with('comment',$comment);\n }", "public function editComment(?User $user, $comment): bool\n {\n return $user->id === $comment->user_id;\n }", "public function formEdit($id){\n $comment = $this->comment->find($id);\n if(Auth::user()->id != $comment->user_id){\n return redirect('home');\n }\n return view('comment.edit', ['comment' => $comment]);\n }", "public function edit() {\n\n\t\t$db = Manager::getDatabase();\n\n\t\t$title = $_POST['title'];\n\t\t$content = $_POST['content'];\n\t\t$commentId = (int) $_POST['commentId'];\n\t\t$chapterId = (int) $_POST['chapterId'];\n\n\t\tif (!empty($title) && !empty($content) && !empty($commentId)) {\n\t\t\t\n\t\t\t$title = Str::secured($_POST['title']);\n\t\t\t$content = Str::secured($_POST['content']);\n\t\t\t\n\t\t\t$commentManager = new CommentManager();\n\n\t\t\tif ($commentManager->idExist($db, $commentId)) {\n\t\t\t\t\n\t\t\t\t$commentManager->update($db, $commentId, $title, $content);\n\t\t\t}\n\t\t}\n\n\t\t$hiddenChapterId = Str::encrypt($chapterId);\n\t\theader('Location: ./index.php?controller=reading&id=' . $hiddenChapterId);\n\n\t}", "public function commentEdit() {\n\t\t$id = $_POST['id'];\n\t\t$c = Comment::find($id);\n\t\techo json_encode($c);\n\t}", "public function changeComment($comment)\r\n {\r\n\r\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "public function post_edit($id)\n\t{\n\t\tAcl::can('post_comments_edit');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = Blog_Comment::find($id);\n\n\t\t\tif(is_null($comment))\n\t\t\t{\n\t\t\t\treturn Redirect::to('blog/comments');\n\t\t\t}\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Updated comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/edit/'.$id)\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public function get_edit($id)\n\t{\n\t\tAcl::can('get_comments_edit');\n\n\t\t$comment = Blog_Comment::find($id);\n\n\t\tif(is_null($comment))\n\t\t{\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\t\t\n\t\t\t\t\n\t\t$blog_post = array('' => 'SELECIONE') + Blog_post::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\t\t\t\t\n\t\t$user = array('' => 'SELECIONE') + User::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\n\t\t$this->layout->title = 'Editing Blog Comment';\n\t\t$this->layout->content = View::make('blog.comments.edit')->with('comment', $comment)->with('blog_post', $blog_post)->with('user', $user);\n\t}", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "public function edit($id)\n {\n if ( $user = Auth::user() ) {\n\n $comment = Comment::findOrFail($id);\n\n if ( isset($comment->is_gif ) && ($comment->is_gif === 'true') ) {\n \n $comment->is_gif = 1;\n \n }\n\n return view( 'comments.edit', compact('comment') );\n }\n return redirect('/posts');\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "function handle_editcomment($commentid)\n{\n\tdie(\"A hozzászólások nem szerkeszthetőek. A bejegyzések tulajdonosai <a href=\\\"/delcomment/$commentid\\\">törölhetik</a> a hozzászólásokat.\");\n}", "public function edit(string $user, string $path, Blog $blog, Comment $comment)\n {\n if( Auth::check() ) { # user is logged in\n if (Auth::user() == $comment->user) { # user is owner of comment\n return view('comments.edit')->withComment($comment);\n }\n }\n return redirect()->route('blog.show', ['user'=>$user, 'path'=> $path, 'blog' =>$blog]);\n\n }", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "public function edit($id)\n {\n\n $comment = Coment::find($id);\n if ($comment->user_id == Auth::user()->id){\n return view('newComment', compact('comment'));\n }else{\n return redirect('/');\n }\n }", "public function editComment($commentMsg, $pageID, $oldTimeStamp){\n $comment = new Comment($_SESSION['tastyRecipeUser'], $commentMsg, $pageID);\n $comment->edit($oldTimeStamp);\n }", "public function changeCommentary()\n {\n global $data, $imageId, $size, $zoom;\n $this->getParams();\n\n $this->setContentView();\n $this->setMenuView();\n }", "public function edit(DirectComment $directComment)\n {\n //\n }", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "public static function UpdateComment($core, $commentId, $text)\n {\n $comment = new ComunityComment($core);\n $comment->GetById($commentId);\n $comment->Message->Value = $text;\n $comment->Save();\n }", "public function updateComment() {\n parse_str(file_get_contents('php://input'), $_PUT);\n\n if (isset($_PUT['btnUpdateComment'])) {\n $comment = $_PUT['comment'];\n $idComm = $_PUT['idComm'];\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->updateComment($comment, $idComm);\n\n $this->commentLog(\"$comment\", \"UPDATE\", 204);\n\n\n } catch (\\PDOException $ex) {\n $this->errorLog(\"updateComment()\", $ex->getMessage());\n\n }\n } else {\n $this->json(null, 403);\n }\n }", "private function comment_edit_submit( ) {\n\n if ( ! ( in('post_ID') || in('comment_ID') || in('comment_parent') ) ) ferror(-500481, \"None of post_ID, comment_ID, comment_parent has provided.\");\n $comment_ID = in( 'comment_ID' );\n $update = $comment_ID ? true : false;\n \n \n if ( $update ) {\n $comment = get_comment( $comment_ID );\n $post_ID = $comment->comment_post_ID;\n }\n else {\n $post_ID = in('post_ID');\n if ( empty( $post_ID ) ) {\n $comment = get_comment(in('comment_parent'));\n $post_ID = $comment->comment_post_ID;\n }\n }\n forum()->setCategoryByPostID($post_ID);\n\n\n\n //\n if ( $update ) { // update\n $this->endIfNotMyComment( $comment_ID );\n remove_filter( 'pre_comment_content', 'wp_filter_kses' );\n $re = wp_update_comment([\n 'comment_ID' => $comment_ID,\n 'comment_content' => in('comment_content')\n ]);\n add_filter( 'pre_comment_content', 'wp_filter_kses' );\n\n if ( ! $re ) {\n // error or content has not changed.\n }\n }\n else { // new\n $user_ID = $this->get_post_author();\n $user = get_user_by( 'id', $user_ID );\n $comment_ID = wp_insert_comment([\n 'comment_post_ID' => $post_ID,\n 'comment_parent' => in('comment_parent'),\n 'comment_author' => $user->user_login,\n 'user_id' => $user_ID,\n 'comment_content' => in('comment_content'),\n 'comment_approved' => 1,\n ]);\n if ( ! $comment_ID ) {\n $this->errorResponse(-50302, \"Comment was not created\");\n }\n }\n\n //$this->updateFileWithPost( FORUM_COMMENT_POST_NUMBER + $comment_ID );\n\n // $url = get_permalink( $post_ID ) . '#comment-' . $comment_ID ; // this is not used.\n\n //\n $files = in('files');\n if ( $files ) {\n $arr = explode('| |', $files);\n $files = array_filter( $arr );\n comment()->meta( $comment_ID, 'files', $files );\n }\n\n\n\n // Save All extra input into post meta.\n comment()->saveAllMeta( $comment_ID );\n\n\n $o = [ 'post_ID' => $post_ID, 'comment_ID' => $comment_ID ];\n // if ( in('response') == 'ajax' ) $o['comment'] = comment()->get_comment_with_meta( $comment_ID );\n $this->response( $o );\n }", "function user_edit($user_info)\n {\n }", "function updateComment($id_comment, $content)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"UPDATE comments\n\t\t\t\tSET content = :content,\n\t\t\t\t\tdateModified = NOW()\n\n\t\t\t\tWHERE id_comment = :id_comment\";\n\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(':id_comment', $id_comment);\n\t\t$stmt->bindValue(':content', $content);\n\n\t\t// si execute retourne à la page en question\n\t\tif ($stmt->execute())\n\t\t{\n\t\t\t// on verra ce que l'on affiche\n\t\t\t//goHome();\n\t\t}\n\t}", "function get_comment_to_edit($id)\n {\n }", "public function update(Request $request,$id)\n {\n $commentaire=Commentaire::find($id);\n $commentaire->text=$request->text;\n $commentaire->save();\n return redirect(\"commentaire\");\n }", "function EditComments($conn)\n\t{\n\t\t// if the submit button is pressed\n\t\tif (isset($_POST['CommentSubmit']))\n\t\t{\n\t\t\t// new varaibles for comment data\n\t\t\t$cid = $_POST['cid'];\n\t\t\t$uid = $_POST['uid'];\n\t\t\t$date = $_POST['date'];\n\t\t\t$message = $_POST['message'];\n\n\t\t\t// new varaible for updating data in the database\n\t\t\t$sql = \"UPDATE comments SET message='$message' WHERE cid='$cid'\";\n\n\t\t\t// query the database\n\t\t\t$result = $conn->query($sql);\n\n\t\t\t// return to the privous page\n\t\t\tRedirect(\"zombie.php\");\n\t\t}\n\t}", "public function setComment($comment);", "public function setComment($comment);", "function comment_text($comment_id = 0, $args = array())\n {\n }", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "public function commentDo() {\n\t\tif($this->user() || $this->fbUser) { \n\t\t\tif(isset($this->args[1]) && isset($_POST['comment']) && isset($_POST['redirect'])) {\n\t\t\t\t$userName = ($this->user()) ? $this->user->model->userName : $this->fbUser['username'];\n\t\t\t\t$_POST['name'] = $userName;\n\n\t\t\t\ttry {\n\t\t\t\t\t$this->commentsModel->insertComment($this->args[1], $_POST);\t\n\t\t\t\t\tHTML::redirect($_POST['redirect']);\n\t\t\t\t} catch(Exception $excpt) {\n\t\t\t\t\t$this->view->setError($excpt);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->view->setError(new Exception('Unable to set up function'));\n\t\t\t}\n\t\t}\n\t}", "public function update(Request $request, string $user, string $path, Blog $blog, Comment $comment)\n {\n if( Auth::check() ) { # user is logged in\n if (Auth::user() == $comment->user) { # user is owner of comment\n $this->validate($request, [\n 'contents' => 'required'\n ]);\n $comment->contents = $request->contents;\n $comment->save();\n return redirect()->route('blog.show', ['user'=>$user, 'path'=> $path, 'blog' =>$blog]);\n }\n }\n return redirect()->route('blog.show', ['user'=>$user, 'path'=> $path, 'blog' =>$blog]);\n }", "public function editPhotoCommentAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t\n \t$zend_filter_obj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$comment_text_filtered = $zend_filter_obj->filter( $params['comment_text'] );\n \techo Zend_Json::encode( \\Extended\\comments::editPhotoComment( $params['comment_id'], $comment_text_filtered ) );\n \tdie;\n }", "public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function getCommentText()\n {\n return $this->commentText;\n }", "public function edit($user_id)\n\t{\n\t\t//\n\t}", "function adminUpdateComment() {\r\n\r\n\t\t$chapterManager = new \\Alaska2\\Model\\ChapterManager();\r\n\t\t$commentManager = new \\Alaska2\\Model\\CommentManager();\r\n\r\n\t\t$chapter = $chapterManager->getChapter($_GET['chapter_id']);\r\n\t\t$comment = $commentManager->getComment($_GET['id']);\r\n\r\n\t\trequire ('view/backend/updateCommentView.php');\r\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'commentText' => 'required',\n ]);\n\n $comment = Comment::find($id);\n\n $comment->update([\n 'commentText' => $request->input('commentText'), \n ]);\n\n return redirect('/comments')->with('success', 'Comment has been updated');\n }", "public function add_edit_activity_comment_button() {\r\n\r\n\t\tglobal $activities_template;\r\n\t\t\r\n\t\tif ( yzea_is_activity_editable( $activities_template->activity ) ) {\r\n\r\n\t\t\t?>\r\n\r\n\t\t\t<a class=\"bp-secondary-action yz-edit-activity\" data-activity-id=\"<?php echo $activities_template->activity->current_comment->id;?>\" data-activity-type=\"activity_comment\"><?php _e( 'Edit', 'youzer-edit-activity' ); ?>\r\n\t\t\t</a>\r\n\r\n\t\t\t<?php \r\n\t\t}\r\n\t}", "public function edit(Comment $post_comment)\n {\n if (!auth()->user()->ability('admin','update_post_comments')) {\n return abort(403);\n }\n return view('backend.post_comments.edit', compact('post_comment'));\n }", "public function edit($id)\n {\n // If the user is logged in...\n if (Auth::check()) {\n // get the text\n $text = Text::find($id);\n\n // show the edit form and pass the text\n return View::make('texts.edit')\n ->with('text', $text)\n ->with('entity', 'text')\n ->with('title', 'Text edit');\n } else {\n // User is not logged in\n Session::flash('message', 'Please log in');\n return Redirect::to('/');\n }\n }", "function editCommentsPost($id)\n {\n $userLogged = Auth::check(['administrateur']);\n\n $errors = [];\n \n $commentManager = new CommentManager();\n $listCommentsForPost = $commentManager->getListCommentsForPost($id);\n\n require'../app/Views/backViews/comment/backEditCommentsPostView.php';\n }", "public function updateComment($uid, Request $request)\n {\n $comment = $this->commentsCollection->findOne(['_id' => new ObjectID($uid)]);\n\n $currentTimestamp = (new \\DateTime())->getTimestamp();\n\n if ($comment && $request->getClientIp(\n ) == $comment['ip'] && $currentTimestamp - $comment['created_at'] < 3600\n ) {\n\n $this->commentsCollection->updateOne(\n ['_id' => new ObjectID($uid)],\n ['$set' => ['text' => $request->request->get(\"text\")]]\n );\n }\n }", "public function update(Request $request, $id)\n {\n try {\n// getting comment content\n $content = $request->get('content');\n\n $comment = Comment::findOrFail($id);\n $comment->content = $content;\n $comment->save();\n\n session()->put('message', 'Your changes was successfully saved on comment.');\n session()->put('type', 'success');\n } catch (\\Exception $exception) {\n// return to main page if post does not exist\n session()->put('message', 'Failed to edit comment.');\n session()->put('type', 'warning');\n }\n return redirect('admin/comments');\n }", "public function edit($id)\n {\n $comment = InstagramAutoComments::findOrFail($id);\n\n return view('instagram.auto_comments.edit', compact('comment'));\n }", "public function edit(HashtagPostComment $hashtagPostComment)\n {\n //\n }", "public function update(User $user, Comment $comment)\n {\n //\n }", "function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}", "public function edit($username)\n {\n //\n }", "public function edit($id)\n {\n return 'Aqui editamos el usuario: ' . $id;\n }" ]
[ "0.6760691", "0.67507976", "0.6666843", "0.66576135", "0.6498748", "0.6477748", "0.64683175", "0.6378413", "0.6357717", "0.6322349", "0.6273392", "0.6260314", "0.6259816", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6248422", "0.6162449", "0.6126311", "0.61100084", "0.605326", "0.5975838", "0.59579915", "0.5921049", "0.59073067", "0.5875064", "0.58723", "0.58586663", "0.58406436", "0.5827238", "0.58068955", "0.5761715", "0.57576466", "0.57525617", "0.5751384", "0.57500124", "0.5741048", "0.5740024", "0.5736303", "0.57281464", "0.5723216", "0.570462", "0.5694745", "0.5682086", "0.5679598", "0.5675432", "0.56699467", "0.5658635", "0.565231", "0.5651636", "0.564343", "0.5625869", "0.5607849", "0.5606558", "0.5604363", "0.5586301", "0.5578758", "0.5565698", "0.5563556", "0.555891", "0.555891", "0.55527574", "0.5548198", "0.554422", "0.5542935", "0.55417705", "0.5528918", "0.55282414", "0.5525908", "0.5509022", "0.55088377", "0.55084425", "0.55079347", "0.55018187", "0.54922664", "0.5486434", "0.54806215", "0.5473526", "0.5460835", "0.54488856", "0.54485744", "0.5438935", "0.54295164" ]
0.62976575
10
Returns the comments for a photo
function photos_comments_getList ($photo_id, $min_comment_date = NULL, $max_comment_date = NULL) { $params = array(); $params['method'] = 'flickr.photos.comments.getList'; $params['photo_id'] = $photo_id; if ($min_comment_date) $params['min_comment_date'] = $min_comment_date; if ($max_comment_date) $params['max_comment_date'] = $max_comment_date; $response = $this->execute($params, 300); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['comments']['comment']; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getComments($photo_uid) {\r\n\t\t$comments = tx_cwtcommunity_lib_common::dbQuery('SELECT c.uid, c.crdate, c.cruser_id, c.text, u.username, u.tx_cwtcommunityuser_image AS image FROM tx_cwtcommunity_photo_comments c, fe_users u WHERE c.cruser_id = u.uid AND photo_uid = \"'.intval($photo_uid).'\" AND NOT c.deleted = \"1\" AND NOT c.hidden = 1 ORDER BY c.crdate DESC;');\r\n\t\treturn $comments;\r\n\t}", "public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}", "public function comments()\n {\n return $this->hasMany(PhotoComment::class);\n }", "function get_image_comments($imgID)\n {\n $this->db->join('users AS U', 'cms_image_comments.authorID = U.id', 'INNER');\n $this->db->where('imgID', $imgID);\n $query = $this->db->get('cms_image_comments');\n\n return $query->result();\n }", "function getImageComments($args)\n{\n global $_zp_current_image;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('getImageComments', ($args['loglevel']));\n $imageobject = getItemByID('images', $args['id']);\n if ($imageobject->filename) {\n $comments = $imageobject->getComments();\n } else {\n return new ZEN_Error(-1, 'Image not found on server');\n }\n for ($i = 0; $i < count($comments); $i++) {\n $x = $i + 1;\n $commentList[] = entitysave([\n 'commentData' => $comments[$i]['comment'],\n 'commentId' => $comments[$i]['id'],\n 'commentDate' => strtotime(str_replace('.000000', '', $comments[$i]['date'])),\n 'commentUsername' => $comments[$i]['email'],\n 'commentRealname' => $comments[$i]['name'],\n 'commentUrl' => $args['url'].'#zp_comment_id_'.$x,\n ]);\n } //$i = 0; $i < count( $comments ); ++$i\n if (empty($commentList)) {\n return '';\n } else {\n return $commentList;\n }\n}", "public function getPhotos();", "public function selectCommentsByImageId($imageId) {\n $sql = \"SELECT * FROM `comments` WHERE `image_id` = :image_id ORDER BY `id` ASC\"; \n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('image_id', $imageId); \n $stmt->execute(); \n return $stmt->fetchAll(PDO::FETCH_ASSOC); \n }", "public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.user_id \" .\n \" WHERE acp.article_id = $id \"\n ;\n\n $sql = DB::instance()->query( $stmt );\n\n $rows = $sql->fetchAll(\\PDO::FETCH_UNIQUE|\\PDO::FETCH_ASSOC );\n\n $result = CommentCollection::toTree( $rows );\n\n return $result;\n }", "public function comments() {\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = image_id, localKey = id)\n\t\treturn $this->hasMany('App\\Comment')->with('user')->orderBy('id', 'desc');\n\t}", "public function getComments() {}", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function getComments($pictures_id)\n {\n $select = $this->sql\n ->select()\n ->columns(['comments_comment'])\n ->from('comments')\n ->where('pictures_id = '.$pictures_id.'');\n ;\n \n $query = $this->sql->buildSqlString($select);\n\n return $this->adapter->query($query)->execute();\n }", "function photo_data($post) {\n $post_meta = get_post_meta($post->ID);\n // Busca a imagem do post.\n $src = wp_get_attachment_image_src($post_meta[\"img\"][0], \"large\")[0];\n // Busca os dados do usuário que fez o post.\n $user = get_userdata($post->post_author);\n // Busca os comentários do post.\n $total_comments = get_comments_number($post->ID);\n\n // Retorna os dados estruturados.\n return [\n \"id\" => $post->ID,\n \"author\" => $user->user_login,\n \"title\" => $post->post_title,\n \"date\" => $post->post_date,\n \"src\" => $src,\n \"peso\" => $post_meta[\"peso\"][0],\n \"idade\" => $post_meta[\"idade\"][0],\n \"acessos\" => $post_meta[\"acessos\"][0],\n \"total_comments\" => $total_comments\n ];\n}", "public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }", "function view_comments($album_id){\n $album_id = (int)$album_id;\n $comments = array();\n $query = mysql_query(\"SELECT * FROM comments WHERE album_id = $album_id\");\n\n while($comment_row = mysql_fetch_assoc($query)){\n $comments[] = array(\n 'id' => $comment_row['comment_id'],\n 'user_id' => $comment_row['user_id'],\n 'comment' => $comment_row['comment'],\n 'timestamp' => $comment_row['timestamp']\n );\n }\n return $comments;\n }", "function getPhotoInfo($photoId);", "public function addCommentToThePhotoAction()\n {\n \t$param = $this->getRequest()->getParams();\n \n \t$ret_r = array();\n \t\n \t$photo_id = $param['photo_id'] ;\n \t$photo_posted_by_user_id = $param['album_posted_by'];\n \t$comment = $param['comment'] ;\n \n \t//Making a entry to like table for wallpost.\n \t$filterObj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$comm_text = nl2br($filterObj->filter($this->getRequest()->getParam( 'comment' ) ));\n \t$comment_on_photo_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), NULL, NULL, $photo_id );\n \t$comments_obj = \\Extended\\comments::getRowObject( $comment_on_photo_id );\n \n \t//setting comment count for photo\n \t\\Extended\\socialise_photo::commentCountIncreament( $photo_id );\n \t\t\t\n \t// get socialise photo object \n \t$socialisephoto_obj = \\Extended\\socialise_photo::getRowObject( $photo_id );\n \t\n \t\n \t//Adding comment for wallpost in comments table( for special case only. )\n \tif( $socialisephoto_obj->getWallPost() )\n \t{\n \t\tif( $socialisephoto_obj->getWallPost()->getPost_update_type() == \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED )\n \t\t{\n \t\t\t$wallpost_comment_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), null, $socialisephoto_obj->getWallPost()->getId() );\n \t\t\t//Adding same comment id in photo comment record.\n \t\t\t$photo_comment_obj = \\Extended\\comments::getRowObject($comment_on_photo_id);\n \t\t\t$photo_comment_obj->setSame_comment_id($wallpost_comment_id);\n \t\t\t$em = Zend_Registry::get('em');\n \t\t\t$em->persist( $photo_comment_obj );\n \t\t\t$em->flush();\n \t\t\t\n \t\t\t$ret_r['wallpost_id'] = $socialisephoto_obj->getWallPost()->getId();\n \t\t\t$ret_r['wallpost_comment_id'] = $wallpost_comment_id;\n \t\t}\n \t}\n \t\n \t/* \tIf there is single photo inside the group\n \t in default album, then also add comment for its\n \tassociated wallpost.\n \t*/\n \tif( $socialisephoto_obj->getPhotoGroup() )\n \t{\n \t\tif( $socialisephoto_obj->getPhotoGroup()->getSocialisePhoto()->count() == 1 )\n \t\t{\n \t\t\t$wallpost_comment_id = \\Extended\\comments::addComment( $comm_text, Auth_UserAdapter::getIdentity()->getId(), null, $socialisephoto_obj->getPhotoGroup()->getWallPost()->getId() );\n \t\t\t//Adding same comment id in photo comment record.\n \t\t\t$photo_comment_obj = \\Extended\\comments::getRowObject($comment_on_photo_id);\n \t\t\t$photo_comment_obj->setSame_comment_id($wallpost_comment_id);\n \t\t\t$em = Zend_Registry::get('em');\n \t\t\t$em->persist( $photo_comment_obj );\n \t\t\t$em->flush();\n \t\t\t$ret_r['wallpost_id'] = $socialisephoto_obj->getPhotoGroup()->getWallPost()->getId();\n \t\t\t$ret_r['wallpost_comment_id'] = $wallpost_comment_id;\n \t\t}\n \t}\n \t\n \t\t\t\n \t$ret_r['comment_id'] = $comment_on_photo_id;\n \t$ret_r['comm_text'] = $comm_text;\n \t$ret_r['commenter_id'] = Auth_UserAdapter::getIdentity()->getId();\n \t$ret_r['commenter_fname'] = Auth_UserAdapter::getIdentity()->getFirstname();\n \t$ret_r['commenter_lname'] = Auth_UserAdapter::getIdentity()->getLastname();\n \t$ret_r['commenter_small_image'] = Helper_common::getUserProfessionalPhoto(Auth_UserAdapter::getIdentity()->getId(), 3);\n \t$ret_r['comment_count'] = $socialisephoto_obj->getSocialise_photosComment()->count();\n \t$ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n \t\n \t\n \t//gathering information for sending email to user on whom post, comment is done.\n \t$subject = \"iLook - User commented on your photo\";\n \t$msg='';\n \t$msg = \"<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t\".ucfirst($ret_r['commenter_fname']).\" \".ucfirst($ret_r['commenter_lname']).\" commented on your photo</p>\n \t<p style='margin:20px 20px 0 0; padding:0; font-size:14px; font-family:Arial, Helvetica, sans-serif; color:#3a3a3a'>\n \t<b>'\".$ret_r['comm_text'].\"'</b>\n \t</p>\";\n \t$recipient_name = ucfirst($socialisephoto_obj->getSocialise_photosPosted_by()->getFirstname()).\" \".ucfirst($socialisephoto_obj->getSocialise_photosPosted_by()->getLastname());\n \t$recipient_email = $socialisephoto_obj->getSocialise_photosPosted_by()->getEmail();\n \t\t\n \t// check if user is not commenting on his own post, only then mail will be sent\n \tif(Auth_UserAdapter::getIdentity()->getId() != $socialisephoto_obj->getSocialise_photosPosted_by()->getId())\n \t{\n \t\t//sending email to user on whom post comment is done\n \t\t\\Email_Mailer::sendMail(\n $subject,\n \t\t\t\t$msg,\n \t\t\t\t$recipient_name,\n \t\t\t\t$recipient_email,\n \t\t\t\tarray(),\n \t\t\t\t\"iLook Team\",\n \t\t\t\tAuth_UserAdapter::getIdentity()->getEmail(),\n \t\t\t\t\"Hello \",\n \t\t\t\t\"Thank you\");\n \t}\n \t\n \techo Zend_Json::encode($ret_r);\n \t\t\n \tdie;\n }", "function get_comments(){\n\n\t}", "public function getAllPhotos();", "public function getPhotos()\n {\n return $this->photos;\n }", "function getComment() {\n\tglobal $db;\n\t\n\t$query = \"SELECT idComment, content, photo, date, Comment.idUser, idEvent, parentComment, firstName AS userFirstName, lastName AS userLastName FROM Comment,User WHERE User.idUser = Comment.idUser\";\n\t\n\tif (isset($_GET['idComment']))\n\t\t$query .= \" AND idComment = \" . $_GET['idComment'];\n\tif (isset($_GET['idUser']))\n\t\t$query .= \" AND idUser = \" . $_GET['idUser'];\n\tif (isset($_GET['idEvent']))\n\t\t$query .= \" AND idEvent = \" . $_GET['idEvent'];\n\tif (isset($_GET['parentComment']))\n\t\t$query .= \" AND parentComment = \" . $_GET['parentComment'];\n\t\t\t\t\n\t$stmt = $db->prepare($query);\n\t$stmt->execute(); \n\t$comments = $stmt->fetchAll();\n\t\n\t\n\t\n\t/* Content-Type must be defined, otherwise the output is seen as plain text */\n\theader(\"Content-Type: application/json\");\n\techo json_encode($comments);\n}", "public function postGetComments()\n {\n \n \n $object_id = Input::get('object_id');\n $type = Input::get('object_type');\n $num = Input::get('num');\n if(strlen($object_id) > 0)\n {\n \n $c = Comment::getComments($object_id, $type, $num);\n foreach($c as &$com)\n {\n if(strlen($com->profile_pic) < 1)\n $com->profile_pic = DEFAULT_PROFILE_PIC;\n }\n return Response::json($c);\n }\n else\n {\n return Response::json('false'); \n }\n \n \n }", "public function getComments() {\n if(!isset($this->comments)) {\n $this->comments = MergeRequestComment::getListByExample(\n new DBExample(array(\n 'mergeRequestId' => $this->id\n )),\n null,\n array(),\n array(\n 'parentId' => DB::SORT_ASC,\n 'ctime' => DB::SORT_ASC\n )\n );\n }\n\n return $this->comments;\n }", "public function get_comments()\n {\n }", "public function list_comments()\n {\n $url = $this->instanceUrl() . '/comments';\n list($response, $opts) = $this->_request('get', $url, null, null);\n\n // This is needed for nextPage() and previousPage()\n $response['url'] = $url;\n\n $obj = Util\\Util::convertToTelnyxObject($response, $opts);\n return $obj;\n }", "public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }", "public function getAllComments() {\r\n \r\n $commentEntries = array();\r\n\r\n $sql = \"SELECT *\r\n FROM RecipeComments\r\n WHERE page = '$this->page'\r\n ORDER BY timestamp\"; \r\n \r\n $result = $this->conn->query($sql);\r\n \r\n $rows = $result->num_rows;\r\n \r\n for($i=1; $i<=$rows; $i++) {\r\n $row = $result->fetch_assoc();\r\n array_push($commentEntries, $row[\"username\"]);\r\n array_push($commentEntries, $row[\"comment\"]);\r\n array_push($commentEntries, $row[\"timestamp\"]);\r\n \r\n }\r\n\r\n return $commentEntries;\r\n \r\n }", "public function getCommentsForAlbumAction()\n {\n $params = $this->getRequest()->getParams();\n //Get users blocked and users who have blocked logged in user.\n\t$blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n\t\n\techo Zend_Json::encode( \\Extended\\comments::getCommentsForAlbum( \\Auth_UserAdapter::getIdentity()->getId(), $params['album_id'], $params['offset'], 10, $blocked_user ) );\n\t\n\n\tdie;\n }", "public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}", "function sp_most_commented($comment_posts = 5 , $avatar_size = 60){\n$comments = get_comments('status=approve&number='.$comment_posts);\nforeach ($comments as $comment) { ?>\n\t<li>\n\t\t<div class=\"post-thumbnail\">\n\t\t\t<?php echo get_avatar( $comment, $avatar_size ); ?>\n\t\t</div>\n\t\t<a href=\"<?php echo get_permalink($comment->comment_post_ID ); ?>#comment-<?php echo $comment->comment_ID; ?>\">\n\t\t<?php echo strip_tags($comment->comment_author); ?>: <?php echo wp_html_excerpt( $comment->comment_content, 60 ); ?>... </a>\n\t</li>\n<?php } \n}", "public function selectByImageId($imageId) {\n $sql = \"SELECT * FROM `comments` WHERE `image_id`= :image_id\"; \n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('image_id', $imageId); \n $stmt->execute(); \n return $stmt->fetchAll(PDO::FETCH_ASSOC); \n }", "function getAlbumImageComment($albumid, $imageid) {\n $status = 1;\n try {\n $query1 = \"SELECT *,DATE_FORMAT(createdDate,'%d %b %Y %h:%i %p') as commentDate FROM Tbl_Analytic_AlbumComment WHERE albumId = :albumid and imageId = :imgid and status = :status\";\n $stmt1 = $this->DB->prepare($query1);\n $stmt1->bindParam(':albumid', $albumid, PDO::PARAM_STR);\n $stmt1->bindParam(':imgid', $imageid, PDO::PARAM_STR);\n $stmt1->bindParam(':status', $status, PDO::PARAM_STR);\n $stmt1->execute();\n $rows = $stmt1->fetchAll();\n\n $response[\"posts\"] = array();\n\n\n if ($rows) {\n $forimage = SITE;\n\n $response[\"success\"] = 1;\n $response[\"message\"] = \"comments available\";\n\n for ($i = 0; $i < count($rows); $i++) {\n $post = array();\n\n $post[\"comment_id\"] = $rows[$i][\"commentId\"];\n $post[\"albumid\"] = $rows[$i][\"albumId\"];\n $post[\"imageId\"] = $rows[$i][\"imageId\"];\n $post[\"content\"] = $rows[$i][\"comments\"];\n $post[\"commentby\"] = $rows[$i][\"userId\"];\n $mailid = $rows[$i][\"userId\"];\n\n $query2 = \"SELECT Tbl_EmployeeDetails_Master.*, Tbl_EmployeePersonalDetails.* FROM Tbl_EmployeeDetails_Master join Tbl_EmployeePersonalDetails on Tbl_EmployeeDetails_Master.employeeId = Tbl_EmployeePersonalDetails.employeeId WHERE Tbl_EmployeeDetails_Master.employeeId =:maid\";\n $stmt2 = $this->DB->prepare($query2);\n $stmt2->bindParam(':maid', $mailid, PDO::PARAM_STR);\n $stmt2->execute();\n $row = $stmt2->fetchAll();\n\n $post[\"firstname\"] = $row[0][\"firstName\"];\n $post[\"lastname\"] = $row[0][\"lastName\"];\n $post[\"designation\"] = $row[0][\"designation\"];\n // $post[\"userimage\"] = ($row[0][\"userImage\"]==''?'':$forimage . $row[0][\"userImage\"]);\n\n $post[\"userimage\"] = ($row[0][\"linkedIn\"] == '1' ? $row[0][\"userImage\"] : ($row[0][\"userImage\"] == '' ? '' : $forimage . $row[0][\"userImage\"]));\n\n $post[\"cdate\"] = $rows[$i][\"createdDate\"];\n\n\n array_push($response[\"posts\"], $post);\n }\n\n return json_encode($response);\n } else {\n $response[\"success\"] = 0;\n $response[\"message\"] = \"There is no comments for this post\";\n return json_encode($response);\n }\n } catch (PDOException $e) {\n echo $e;\n }\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n\t{\n\n\t\treturn $this->comments;\n\t}", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "private function getPhotoList($html)\n {\n $matches = array();\n $photoList = array();\n $profileSharedData = array();\n\n if (preg_match(\"#_sharedData = (\\{.*});<\\/script>#\", $html, $matches)) {\n if ((isset($matches[1])) && (!empty($matches[1]))) {\n $profileSharedData = json_decode($matches[1], true);\n }\n }\n\n if (isset($profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'])) {\n $timeLineMedia = $profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'];\n\n if (!isset($timeLineMedia['count']) || ($timeLineMedia['count'] == 0)) {\n throw new Exception(\"This profile doesn't have any photo.\", self::ERROR_PROFILE_NO_PHOTO);\n } elseif (isset($timeLineMedia['edges']) && (count($timeLineMedia['edges']) === 0)) {\n throw new Exception(\"This is a private account.\", self::ERROR_PROFILE_NO_PHOTO);\n }\n\n foreach ($timeLineMedia['edges'] as $photo) {\n if (true == $photo['node']['is_video']) {\n continue;\n }\n\n $photoList[] = array(\n 'shortcode' => $photo['node']['shortcode'],\n 'display_url' => $photo['node']['display_url'],\n 'thumbnail_src' => $photo['node']['thumbnail_src'],\n 'thumbnail_resources' => $photo['node']['thumbnail_resources'],\n 'dimensions' => $photo['node']['dimensions'],\n 'liked_by' => $photo['node']['edge_liked_by']['count'],\n 'comment_by' => $photo['node']['edge_media_to_comment']['count'],\n );\n }\n }\n\n return $photoList;\n }", "public function getComments() {\n \n return $this->comments;\n }", "public function getCommentCount($photo_uid) {\r\n\t\t$count = tx_cwtcommunity_lib_common::dbQuery('SELECT COUNT(uid) AS COUNT FROM tx_cwtcommunity_photo_comments WHERE photo_uid = \"'.intval($photo_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $count[0]['COUNT'];\r\n\t}", "public static function getAllComment() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function getComment()\n {\n return array();\n }", "function GetComments($f_id)\n\t{\n\t\t$sql_query = \"SELECT comments.*, members.nick_name, members.logo_file FROM `\".$this->sCommentTb.\"` AS comments LEFT JOIN `\".$GLOBALS['g_egltb_members'].\"` AS members ON comments.author_id=members.id HAVING comments.\".$this->sField.\"=\".(int)$f_id.\" ORDER BY comments.created DESC\";\n\t\treturn $this->pDBInterface->FetchArrayObject( $this->pDBInterface->Query( $sql_query ) );\n\t}", "function comments() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['video_id'];\n if ($id > 0) {\n $query = \"select * from comments where video_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n } \n }", "public function getComments() {\n\t\treturn $this->arrComments;\n\t}", "public function comments()\n {\n return $this->morphMany(Comments::getCommentsRepository()->getModel(), 'entity');\n }", "public function getAllComments(){\n $comments = $this->db->query('SELECT * FROM comments');\n return $comments;\n }", "public function getComments()\n {\n $data['comments'] = $this->ReviewModel->getComments($this->input->get('slug'));\n echo json_encode($data['comments']);\n }", "public function getAllTheComments(){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $comments=array();\n\t\t\t foreach($result as $comment){\n\t\t\t\t$c1=new Comment();\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\tarray_push($comments,$c1);\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $comments;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function getAllComment()\n {\n return Comment::find()->with('user')->orderBy(['created_date'=>SORT_DESC])->all();\n \n }", "function fetchArticleComments()\r\n\t{\r\n\t\t$comments = array();\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_artikel_kommentare WHERE Publik = '1' AND ArtId = '\" . (int)$_REQUEST['product_id'] . \"' ORDER BY Id DESC\");\r\n\t\twhile($row = $sql->fetchrow())\r\n\t\t{\r\n\t\t\t$sql_u = $GLOBALS['db']->Query(\"SELECT Vorname,Nachname FROM \" . PREFIX . \"_users WHERE Id = '$row->Benutzer'\");\r\n\t\t\t$row_u = $sql_u->fetchrow();\r\n\r\n\t\t\t$row->Titel = htmlspecialchars($row->Titel);\r\n\t\t\t$row->Kommentar = nl2br(htmlspecialchars($row->Kommentar));\r\n\t\t\t$row->Autor = substr($row_u->Vorname,0,1) . '. ' . $row_u->Nachname;\r\n\t\t\tarray_push($comments, $row);\r\n\t\t}\r\n\t\treturn $comments;\r\n\t}", "protected function getComment() {\n\t\t$comment_body = elgg_view('output/longtext', array(\n\t\t\t'value' => $this->comment->description,\n\t\t));\n//\t\tif (elgg_view_exists('output/linkify')) {\n//\t\t\t$comment_body = elgg_view('output/linkify', array(\n//\t\t\t\t'value' => $comment_body\n//\t\t\t));\n//\t\t}\n\t\t$comment_body .= elgg_view('output/attached', array(\n\t\t\t'entity' => $this->comment,\n\t\t));\n\n\t\t$attachments = $this->comment->getAttachments(array('limit' => 0));\n\t\tif ($attachments && count($attachments)) {\n\t\t\t$attachments = array_map(function(\\ElggEntity $entity) {\n\t\t\t\treturn elgg_view('output/url', [\n\t\t\t\t\t'href' => $entity->getURL(),\n\t\t\t\t\t'text' => $entity->getDisplayName(),\n\t\t\t\t]);\n\t\t\t}, $attachments);\n\n\t\t\t$attachments_text = implode(', ', array_filter($attachments));\n\t\t\tif ($attachments_text) {\n\t\t\t\t$comment_body .= elgg_echo('interactions:attachments:labelled', array($attachments_text));\n\t\t\t}\n\t\t}\n\n\t\treturn strip_tags($comment_body, '<p><strong><em><span><ul><li><ol><blockquote><img><a>');\n\t}", "public function getComments(): Collection\n {\n return $this->comments;\n }", "public function comments_for_carddeck() {\n global $DB, $OUTPUT;\n $ufields = \\user_picture::fields('u');\n\n $sql = \"SELECT c.id AS cid, $ufields, c.feedback AS feedback, c.timecreated AS feedbackcreated\n FROM {swipe_swipefeedback} c\n JOIN {user} u ON u.id = c.userid\n WHERE c.swipeid = :swipeid\n ORDER BY c.timecreated DESC\";\n $params['swipeid'] = $this->cm->instance;\n\n $comments = $DB->get_records_sql($sql, $params);\n\n if (count($comments)) {\n foreach ($comments as &$comment) {\n $comment->name = fullname($comment);\n $comment->avatar = $OUTPUT->user_picture($comment, array('size' => 18));\n }\n }\n return array_values($comments);\n }", "public function editPhotoCommentAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t\n \t$zend_filter_obj = Zend_Registry::get('Zend_Filter_StripTags');\n \t$comment_text_filtered = $zend_filter_obj->filter( $params['comment_text'] );\n \techo Zend_Json::encode( \\Extended\\comments::editPhotoComment( $params['comment_id'], $comment_text_filtered ) );\n \tdie;\n }", "public function getComments()\n\t\t{\n\t\t\tif ($this->comments === NULL)\n\t\t\t{\n\t\t\t\t$this->comments = new ECash_Application_Comments($this->db, $this->application_id, $this->getCompanyId());\n\t\t\t}\n\n\t\t\treturn $this->comments;\n\t\t}", "public function getCommentsData()\n {\n $query = $this->getComments()->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC]);\n $dependency = new TagDependency(['tags' => [self::CACHE_TAG_POST_ALL_COMMENTS]]);\n return self::getDb()->cache(static function () use ($query) {\n return $query->all();\n }, self::CACHE_DURATION, $dependency);\n }", "public function getComments ()\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('SELECT id_comment,signalement,id_chapter,author,comment,DATE_FORMAT(dateComment, \\'%d/%m/%Y \\') AS dateComment FROM comments WHERE ? ORDER BY id_comment DESC ');\n $req->execute (array ( 1 ));\n return $req;\n }", "public function getComments($idPoem) {\n \n $sql = 'SELECT COM_ID as id, ' . \n ' COM_DATE as date, ' . \n ' COM_AUTHOR as author, ' . \n ' COM_CONTENT as content ' . \n 'FROM T_COMMENT ' . \n 'WHERE ARTICLE_ID = ? ';\n \n $comments = $this->executeQuery($sql, array($idPoem));\n \n return $comments;\n }", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function getComments() : Collection\n {\n return $this->comments;\n }", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "function addImageComments($args)\n{\n global $_zp_current_album, $_zp_authority;\n if (is_object($login_state = authorize($args))) {\n return $login_state;\n }\n $args = decode64($args);\n logger('addImageComments', ($args['loglevel']));\n $imageobject = getItemByID('images', $args['id']);\n $userobj = $_zp_authority->getAnAdmin([\n 'user=' => $args['loginUsername'],\n 'valid=' => 1,\n ]);\n $username = $args['loginUsername'];\n $commentText = $args['commentText'];\n $date = date('Y-m-d H:m:s');\n if ($imageobject->filename) {\n query('INSERT INTO '.prefix('comments').\"(`ownerid`,`name`,`email`,`website`,`date`,`comment`,`type`,`IP`) VALUES ('\".$args['id'].\"','\".$username.\"','\".$userobj->getEmail().\"','','\".$date.\"','\".$commentText.\"','images','\".$_SERVER['REMOTE_ADDR'].\"')\");\n } else {\n return new ZEN_Error(-1, 'Image not found on server '.$obj['filename']);\n }\n\n return true;\n}", "protected function get_comment_ids()\n {\n }", "function buildHtmlPhotos($data) {\r\n $photos = null;\r\n foreach ($data as $photo) {\r\n $image = '<img src=\"' . $photo['square_image_url'] .'\" title=\"' . $photo['title'] . '\" alt=\"' . $photo['title'] .'\" />';\r\n $photos .= '<div class=\"image-container\"><div class=\"image\">' . '<a href=\"/view-photo/' . $photo['id'] . '\" target=\"_blank\">' . $image . '</a></div></div>';\r\n }\r\n return $photos;\r\n }", "public function Photo(){\n\t\t$photoId = \"491634914183411\";\n\t\t$imgInfo \t\t\t= 'https://graph.facebook.com/'.$photoId.'?access_token='.$this->session->userdata('oauth_token');\n\t\techo $imgInfo;\n\t}", "public function getAjaxPhotos() {\n // define the fb page id\n $facebook_page_id = sfConfig::get('app_facebook_page_id');\n\n // fetch the photos\n $photos = $this->facebook->api('/' . $facebook_page_id . '/photos');\n\n // return JSON encoded list of photos\n $this->renderText(json_encode($photos));\n }", "public function getPostComments($pid = null) { \r\n // if the query is made using findOne(), the method will return just the element being queried \r\n $comments = $this->_comment_collection->find(array('post_id' => new MongoId($pid) ) ); \r\n return $comments; \r\n }", "public function getPhotoInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t//Zend_Debug::dump($params); die();\n \n \t$result = \\Extended\\socialise_photo::getPhotoInfo( $params['photo_id'] );\n \t \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "public function getAlbumComments($albumId){\n return DB::select('SELECT comments.*, users.username\n FROM comments\n LEFT JOIN users ON comments.user_id = users.id\n WHERE album_id = ?', array($albumId));\n }", "public function getComments() {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"SELECT * FROM comments_table where parent_id=0 ORDER BY create_date DESC;\";\n $result = mysql_query($sql, $db);\n $comments = [];\n while ($row = mysql_fetch_assoc($result)) {\n $comment = $row;\n $reply_1_sql = \"SELECT * FROM comments_table where parent_id=\" . $row['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_1 = mysql_query($reply_1_sql, $db);\n $replies = [];\n while ($row1 = mysql_fetch_assoc($result)) {\n $reply = $row1;\n $reply_2_sql = \"SELECT * FROM comments_table where parent_id=\" . $row1['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_2 = mysql_query($reply_2_sql, $db);\n $replies_to_replies = [];\n while ($row2 = mysql_fetch_assoc($result)) {\n $replies_to_replies[] = $row2;\n }\n $reply['replies'] = $replies_to_replies;\n $replies[] = $reply;\n }\n $comment['replies'] = $replies;\n $comments[] = $comment;\n }\n return $comments;\n }", "public function getAllComments()\n {\n $req = $this->pdo->prepare('SELECT * FROM comments ORDER BY `date` DESC');\n $req->execute();\n\n return $req->fetchAll();\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function readComment(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "public function comments(){\n }", "public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }", "public function getTopComments()\n {\n $comments = array();\n $db= DB::conn();\n\n $rows = $db->rows('SELECT * FROM comment WHERE liked != 0 ORDER BY liked DESC, disliked ASC');\n\n foreach ($rows as $row) {\n $comments[] = new Comment($row);\n }\n \n return $comments;\n }", "public function comments()\n {\n $get = $this->getGet('articleId');\n $result = Db::sharedDb()->comments($get['articleId']);\n\n return $this->successResponse($result);\n\n }", "public function GetAllComments() {\n if(isset($_GET['idNews']) && isset($_GET['pagComm'])){\n $idNews = $_GET['idNews'];\n $pagination = $_GET['pagComm'];\n\n $modelComment = new Comments(Database::instance());\n\n $comments = $modelComment->GetAllCommentsPagination($idNews, $pagination);\n\n $this->json($comments);\n }else if(isset($_GET['idNews'])){\n $idNews = $_GET['idNews'];\n $pagination = 0;\n\n $modelComment = new Comments(Database::instance());\n\n $comments = $modelComment->GetAllCommentsPagination($idNews, $pagination);\n\n $this->json($comments);\n } else {\n $this->json(\"No action\", 403);\n }\n }", "public function getComments($idPost)\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE id_post='.$idPost);\n\n\t\t$comments=[];\n\t\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\t\n\t\t\t\t\t$comments[]=new Comments($datas);\t\t\n\t\t\t}\n\t\treturn $comments;\n\t\t\t\t\n\t}", "public function index()\n {\n return $this->service->fetchResources(Comment::class, 'comments');\n }", "function showComments()\n\t{\n $qry = mysql_query(\"SELECT * FROM `comments` \n WHERE '\" . $this->ytcode .\"' = `youtubecode`\n ORDER BY upload_date DESC\n LIMIT 0,4 \");//DEFAULT: Comments shown=3\n if (!$qry)\n die(\"FAIL: \" . mysql_error());\n\n $html = '';\n while($row = mysql_fetch_array($qry))\n {\n \n $com_user=$row['com_user'];\n $com_user = str_replace('\\\\','',$com_user);\n $comment_dis=$row['com_dis'];\n $comment_dis = str_replace('\\\\', '', $comment_dis);\n $date = new DateTime($row['upload_date']);\n\n $html .= '<p class=\"comment-p\">\n <span class=\"userName\">' . $com_user . '</span>\n <span class=\"divider\">//</span>\n <time datetime=\"' . $date->format('Y-m-d') .'\">'.\n $date->format('d/m/y g:i a')\n .'</time> : '. $comment_dis .'\n </p>'; \n }\n \n return $html;\n\t}", "public function shortlisted_property_comments_file($post_data){\n $searchId = $post_data['searchId'];\n $shortlistedId = $post_data['shortlistedId'];\n\n //$sql = \"SELECT c.commentFile,c.fileType,c.video_thumbnail FROM comments c WHERE c.searchId = $searchId AND c.shortlistedId = $shortlistedId AND c.deleteFlag !=1 AND c.commentFile !='' AND c.fileType !=''\";\n //$sql = \"SELECT CONCAT('\".site_url().\"', c.commentFile) AS commentFile,c.fileType,CONCAT('\".site_url().\"', c.video_thumbnail) AS video_thumbnail FROM comments c WHERE c.searchId = $searchId AND c.shortlistedId = $shortlistedId AND c.deleteFlag !=1 AND c.commentFile !='' AND c.fileType !=''\";\n\t\t $sql = \"SELECT\n CASE WHEN c.commentFile IS NOT NULL THEN CONCAT('\".site_url().\"', c.commentFile)\n ELSE '' END AS commentFile,\n c.fileType,\n CASE WHEN c.video_thumbnail IS NOT NULL THEN CONCAT('\".site_url().\"', c.video_thumbnail)\n ELSE '' END AS video_thumbnail\n FROM comments c WHERE c.searchId = $searchId AND c.shortlistedId = $shortlistedId AND c.deleteFlag !=1 AND c.commentFile !='' AND c.fileType !=''\";\n\t\t$record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array();\n }\n }", "public function getComments() \n {\n return $this->hasMany(Comment::className(), [\n 'post_id' => 'id',\n ]);\n }", "public function getComments($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state >= 2 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function getPhoto($photo_uid) {\r\n\t\t$photo = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE uid = \"'.intval($photo_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $photo[0];\r\n\t}", "public function getAllPostsWithComments(){\n $entityManager = $this->getEntityManager();\n $queryBuilder = $entityManager->createQueryBuilder();\n $queryBuilder\n ->select('bp','c')\n ->from('App:BlogPost', 'bp')\n ->join('bp.comments','c','WITH', 'bp.id=c.blogPost');\n\n return $queryBuilder->getQuery()->getResult();\n }" ]
[ "0.7853535", "0.77983266", "0.7052826", "0.66702425", "0.65463954", "0.6534006", "0.6468264", "0.64541787", "0.63510656", "0.62784433", "0.62507683", "0.62415063", "0.6240517", "0.623515", "0.6225219", "0.6196308", "0.61476904", "0.61448", "0.6120888", "0.6106155", "0.60902625", "0.6053608", "0.6050678", "0.60363686", "0.6033089", "0.6031874", "0.6000178", "0.5990325", "0.59669745", "0.59523994", "0.5940824", "0.5924517", "0.59014493", "0.5875676", "0.587348", "0.5872726", "0.5872726", "0.5872726", "0.5872726", "0.58593136", "0.58568084", "0.5854699", "0.58504534", "0.5849116", "0.58425707", "0.58388996", "0.58331287", "0.5819905", "0.581455", "0.58133405", "0.5801541", "0.57976145", "0.5786671", "0.57799315", "0.5743065", "0.57403255", "0.5736592", "0.57273114", "0.57268524", "0.57170534", "0.5716701", "0.57145065", "0.5711983", "0.57057595", "0.56889516", "0.56705374", "0.5665612", "0.5665612", "0.5665612", "0.5665612", "0.5665612", "0.5665612", "0.56416476", "0.56381524", "0.5634601", "0.56322646", "0.56282806", "0.56190974", "0.5619007", "0.561357", "0.5611682", "0.56020415", "0.5583501", "0.5582012", "0.5577521", "0.5574786", "0.5574784", "0.55729353", "0.5572378", "0.5557205", "0.5553412", "0.5550315", "0.5546318", "0.5544196", "0.55416805", "0.55407244", "0.553087", "0.5525776", "0.5523377", "0.5517604" ]
0.70973897
2
/ Photosets methods Add a photo to the end of an existing photoset.
function photosets_addPhoto ($photoset_id, $photo_id) { $response = $this->execute(array('method' => 'flickr.photosets.addPhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addPhoto($value)\n {\n $this->photos[] = $value;\n }", "abstract public function addItems(\\Media\\Entity\\Photo\\PhotoBase $item);", "public function addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "private function _add_photo(){\n global $db;\n\n $photo_name = $db->quote($this->_photo_name);\n $photo_caption = $db->quote($this->_photo_caption);\n $file_name = $db->quote($this->_file_name);\n $file_type = $db->quote($this->_file_type);\n\n $sql = \"SELECT * FROM photos WHERE file_name = \".$file_name.\" LIMIT 1\";\n\n // if photo with file name $file_name is not present in database, insert into database\n if(!$db->query1($sql)->rowCount()){\n $sql = \"INSERT INTO photos (\";\n $sql .= \"photo_name, photo_caption, file_name, file_size, file_type, user_id\";\n $sql .= \") VALUES ( \";\n $sql .= $photo_name .\", \". $photo_caption .\", \". $file_name.\", \". $this->_file_size .\", \". $file_type.\",\" .$this->_user_id;\n $sql .= \")\";\n try {\n //adding photo to db\n $db->exec($sql);\n return \"Photo with name \".$photo_name.\" added, query Successful.\";\n } catch (Exception $e) {\n throw $e;\n }\n }\n else{\n throw new Exception(\"The file name \".$file_name. \" alrady exists\");\n }\n }", "public function addImage(ImageMedia $image);", "public function addPhoto()\n\t{\n\t\t// check if any key in request is of error type\n\t\tif ($this->request->hasKey(ErrorEnum::ERROR))\n\t\t{\n\t\t\t// setting general error message and view style for a template\n\t\t\t$this->view->add_new_photo_message_class = ErrorEnum::ERROR;\n\t\t\t$this->view->add_new_photo_message = MessageBundle::getMessage('form.validation.field.addphoto.noimage.exists');\n\t\t\t\n\t\t\tif ($this->request->hasKey(ErrorEnum::FILENOIMAGE))\n\t\t\t{\n\t\t\t\t$this->view->add_new_photo_message = MessageBundle::getMessage('form.validation.field.addphoto.filenoimage');\n\t\t\t}\n\t\t}\n\t\t$this->view->add_to_existing_album = $this->helper->getExistingAlbumsToForm();\n\t\t$this->view->show('profile_gallery_add');\n\t}", "public function addPhoto(ProductPhoto $ProductPhoto) {\n return $this->photos()->save($ProductPhoto);\n }", "public function addPicture()\n {\n\n $flags = $this->language->getAllDataNoPagination();\n $id = Input::get('id');\n $page = $this->photoGallery->getDataById($id);\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n\n return view('cms.modules.multicms.photoGallery_addpic', compact('page', 'flags'), $data);\n }", "public function addPhoto($file){\r\n\t\t$XMLObject = $this->getXMLObject();\r\n\t\tif($uid = $this->access->getUserId()){\r\n\t\t\t$img = new Image($file);\r\n\t\t\tif($img->isImage()){\r\n\t\t\t\t$w = $img->getWidth();\r\n\t\t\t\t$h = $img->getHeight();\r\n\t\t\t\t$d = $img->getDimensions($w, $h);\r\n\t\t\t\t$query = 'INSERT INTO blog_photos (user_id, width, height) VALUES ('.(int)$uid.', '.$d['width'].', '.$d['height'].')';\r\n\t\t\t\tif(DB::query($query)){\r\n\t\t\t\t\t$bln_success = FALSE;\r\n\t\t\t\t\t$pid = DB::insertId();\r\n\t\t\t\t\t//create image:\r\n\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_THUMB, MAX_PHOTO_WIDTH_THUMB, Utils::getPhotoPath($uid,$pid,'thumb','blog'))){//Thumb\r\n\t\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_MEDIUM, MAX_PHOTO_HEIGHT_MEDIUM, Utils::getPhotoPath($uid,$pid,'medium','blog'))){//Medium\r\n\t\t\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_LARGE, MAX_PHOTO_HEIGHT_LARGE, Utils::getPhotoPath($uid,$pid,'large','blog'))){//Large\t\r\n\t\t\t\t\t\t\t\t$bln_success = TRUE;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!$bln_success){\r\n\t\t\t\t\t\t$this->removePhoto($pid);\r\n\t\t\t\t\t\tparent::throwError($img->errorNo, $img->errorMessage);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else $this->throwError(7);\r\n\t\t\t}else parent::throwError($img->errorNo, $img->errorMessage);\r\n\t\t\t$img->destroy();\r\n\t\t}else $this->throwError(10);\r\n\t\treturn $XMLObject;\r\n\t}", "public function add_pic() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['add_pic']) && !empty($_POST['add_pic'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if ($this->_model->addPicture($_POST['picture'])) {\n $this->_model->setFlash(\"add_success\", \"Photo ajoutée avec succès!\");\n $this->redirect(\"/montage\");\n }\n }\n }\n $this->_model->setFlash(\"add_error\", \"Erreur lors de l'ajout de votre photo!\");\n $this->redirect(\"/montage\");\n }", "public function addPhoto($paramsPhoto)\n {\n return DB::table('photos')->insert(\n [\n 'photos_link' => trim(strip_tags($paramsPhoto['link'])),\n 'album_id' => trim(strip_tags($paramsPhoto['albumId'])),\n ]\n ); }", "public function add_image() {\n\t $this->use_layout=false;\n\t $this->page = new $this->model_class(Request::get('id'));\n\t\t$this->join_name = \"images\";\n\t if(Request::post(\"id\")) {\n\t\t $this->image = new WildfireFile(Request::post('id'));\n\t\t $this->image->join_order = Request::post('order');\n\t\t $this->page->images = $this->image;\n\t }\n\t}", "private function addProductPhotos(array $request){\n\n if(array_key_exists('photos', $request)){\n \n foreach($request['photos'] as $photos){\n\n $photo = new Photo();\n\n $photoProduct = Product::where('name', $request['name'])->get();\n $path = $photos->store('/storage/products');\n $filename = basename($path);\n $extension = $photos->getClientOriginalExtension();\n \n $photo->product_id = $photoProduct[0]->id; \n $photo->path = $filename;\n $photo->extension = $extension;\n\n $photo->save();\n }\n }\n }", "protected function addPhoto($remote_id, $item)\n {\n if( !empty($item['photos']) )\n {\n $photos = array_filter(array_map('trim', explode(';', $item['photos'])));\n $needCover = true;\n $i = 1;\n foreach($photos as $photoUrl)\n {\n $image_type = 0;\n if($needCover)\n {\n $image_type = 1;\n $needCover = false;\n }\n $this->photos[$remote_id][($image_type === 1)? 'cover':$i] = [\n 'url' => $photoUrl,\n 'image_type' => $image_type,\n 'size' => 'original',\n 'associated_type' => Spot::class,\n 'created_at' => $this->date,\n 'updated_at' => $this->date\n ];\n $i++;\n }\n }\n }", "public function addImage(Image $image){\n $this->images->add($image);\n }", "protected function addMediaGallery($productCollection) {\n $ids = array(); \n $products = array();\n foreach($productCollection as $product) {\n $ids[] = $product->getId();\n $products[$product->getId()] = $product;\n }\n if(!$ids) return false;\n \n \n $table = $productCollection->getTable(Mage_Catalog_Model_Resource_Product_Attribute_Backend_Media::GALLERY_TABLE);\n $adapter = $productCollection->getConnection();\n \n $select = $adapter->select()->from($table)->where('entity_id IN (?)',$ids);\n $rows = $adapter->query($select)->fetchAll();\n\n foreach($rows as $row) {\n $product = $products[$row['entity_id']];\n \n $images = (array)$product->getData('images');\n if($row['value']) {\n $images[] = $row['value'];\n }\n $product->setData('images',$images);\n }\n //echo $select.PHP_EOL;\n \n \n \n \n }", "public function addImage($url, $attributes = []);", "public function addRelatedImage(Request $request, $id)\n {\n Validator::make($request->all(), [\n 'photos.*' => \"file|image|mimes:jpeg,png,jpg,gif,svg|max:5000\"\n ])->validate();\n $product = Product::find($id);\n $lastID = DB::table('products_photos')->latest('id')->first()->id;\n\n // Store related images into Storage/app\n $arr_img = [];\n if ($photos = $request->file('photos')) {\n $i = $lastID + 1;\n foreach ($photos as $photo) {\n $photoExt = $photo->getClientOriginalExtension();\n $photoName = $product['name'] . \"_\" . $i . \".\" . $photoExt;\n $photo->move(base_path('storage/app/public/product_images'), $photoName);\n $arr_img[] = $photoName;\n $i++;\n }\n }\n // Insert database\n foreach ($arr_img as $key => $value) {\n $insertPhoto = DB::table('products_photos')->insert(\n ['product_id' => $id, 'photos' => $value]\n );\n }\n\n return redirect()->route(\"adminAddRelatedImageForm\",$id)->withSuccess('Related Images has already inserted');\n }", "public function add($data)\n {\n return PhotoGalleryLg::create($data);\n }", "public function add(array $images, $mode = self::DUPLICATES_IGNORE) {\n foreach ($images as $id => $image) {\n if (!(isset($this->_images[$id]) && $mode == self::DUPLICATES_IGNORE)) {\n $this->_images[$id] = $image;\n }\n }\n }", "public function add_image_post() {\n $itemId = $this->input->post('item_id');\n $uploadResult= $this->upload();\n if ($uploadResult['upload'] === 'ok') {\n $fileData = $uploadResult['fileData'];\n $updatePayload = array(\n 'photo' => $fileData['file_name']\n );\n $res = $this->model->update($itemId, $updatePayload);\n return $this->response(\n array(\n \"status\" => \"ok\",\n \"result\" => $res\n ),\n parent::HTTP_ACCEPTED\n );\n\n }else{\n return $this->response(\n array( 'status' => 'UPLOADING FAILED', \n 'code' => '200', \n 'message' => $uploadResult['err']), \n parent::HTTP_BAD_GATEWAY );\n }\n }", "public function addimage($newitem)\n\t{\n\t\t// check if the inserted item is an image\n\t\tif(!is_a($newitem,'ImageItem'))\n\t\t\tthrow new Exception('ImageItem type was expected.');\n\t\t// insert image\n\t\tarray_push($this->collection, $newitem);\n\t}", "public function upload_photo(){\n $sql=\"INSERT INTO photos \";\n $sql.=\"(name,size,type,date,img_navigacija_id) VALUES ('{$this->name}',$this->size,'{$this->type}',NOW(),2)\";\n self::$connect->query($sql);\n\n\n }", "function addFileSet(FileSet $fileset)\n\t{\n\t\t$this->filesets[] = $fileset;\n\t}", "public function addImages(array $urls);", "function addPhotoToDatabase($photo) {\n global $db_dsn, $db_username, $db_password;\n\n $date = date('d-m-Y');\n $albumName = getCategoryAlbumNames()[1];\n\n $dbh = new PDO($db_dsn, $db_username, $db_password);\n $sql = \"INSERT INTO photos (photo_name, photo_album, date_of_creation) \"\n . \"VALUES ('$photo', '$albumName', '$date')\";\n $q = $dbh->prepare($sql);\n $q->execute();\n}", "public function addPhoto(FlyerPhoto $FlyerPhoto) {\n return $this->photos()->save($FlyerPhoto);\n }", "public function photosAdd($id, PhotosRequest $photosrequest){\n\n $directory = '/uploads/photos/'.$id;\n\n if (!File::exists(public_path().$directory)){\n File::makeDirectory(public_path().$directory, 0775,true);\n }\n\n $files = $photosrequest->file('file');\n\n\n\n foreach ($files as $file) {\n\n $name = Auth::id().'_'.$id.'_'.str_slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME),'-').rand(1000,9999);\n $name_thumb = 'thumb_'.$name;\n $name_thumb2 = 'thumb2_'.$name;\n $file_path = $name.'.'.$file->getClientOriginalExtension();\n\n $img = Image::make($file);\n $img->interlace();\n $img->save('uploads/photos/'.$id.'/' . $name .'.'. $file->getClientOriginalExtension());\n\n $img->fit(200, 200);\n $img->save('uploads/photos/'.$id.'/' . $name_thumb .'.'. $file->getClientOriginalExtension());\n\n $img = Image::make($file);\n $img->resize(180, null, function($constraint){\n $constraint->aspectRatio();\n });\n $img->save('uploads/photos/'.$id.'/' . $name_thumb2 .'.'. $file->getClientOriginalExtension());\n\n $picture = new Pictures();\n\n $picture->name = $file_path;\n $picture->directory = $directory;\n $picture->albums_id = $id;\n\n $picture->save();\n }\n\n\n Session::flash('success', \"Vos photos on été ajoutées à l'album\");\n\n return redirect('/albums/'.$id);\n\n }", "function addMedia($a)\n\t{\n\t\tinclude FLGALLERY_GLOBALS;\n\n\t\t$album_id = isset($a['album_id']) ? (int)$a['album_id'] : 0;\n\t\t$gallery_id = isset($a['gallery_id']) ? (int)$a['gallery_id'] : 0;\n\n\t\t$order = $wpdb->get_var(\"\n\t\t\tSELECT MAX(`order`)\n\t\t\tFROM `{$plugin->dbImages}`\n\t\t\tWHERE\n\t\t\t\t`album_id` = '{$album_id}' AND\n\t\t\t\t`gallery_id` = '{$gallery_id}'\n\t\t\");\n\t\tif ($order === false) {\n\t\t\t$order = 0;\n\t\t\t$this->warning($wpdb->last_error);\n\t\t\t$this->debug($wpdb->last_query, array('Warning', $this->warningN));\n\t\t}\n\n\t\t$added = $media->addFiles($plugin->imgDir);\n\t\tif (count($added)) {\n\t\t\tforeach ($added as $key => $path) {\n\t\t\t\tif (!empty($path)) {\n\t\t\t\t\tif (preg_match('#^(/|[a-z]:)#i', $path)) {\n\t\t\t\t\t\t$fullPath = $path;\n\t\t\t\t\t\t$path = '/' . preg_replace('/^' . preg_quote(ABSPATH, '/') . '/', '', $path);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$fullPath = $plugin->imgDir . '/' . $path;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tlist($width, $height) = $imageSize = getimagesize($fullPath);\n\n\t\t\t\t\t$insert = $wpdb->insert(\n\t\t\t\t\t\t$plugin->dbImages,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'album_id' => $album_id,\n\t\t\t\t\t\t\t'gallery_id' => $gallery_id,\n\t\t\t\t\t\t\t'order' => ++$order,\n\t\t\t\t\t\t\t'type' => $imageSize['mime'],\n\t\t\t\t\t\t\t'path' => $path,\n\t\t\t\t\t\t\t'name' => basename($this->files[$key]),\n\t\t\t\t\t\t\t'title' => $this->filesInfo[$key]['title'],\n\t\t\t\t\t\t\t'description' => $this->filesInfo[$key]['description'],\n\t\t\t\t\t\t\t'link' => '',\n\t\t\t\t\t\t\t'target' => '',\n\t\t\t\t\t\t\t'width' => $width,\n\t\t\t\t\t\t\t'height' => $height,\n\t\t\t\t\t\t\t'size' => filesize($fullPath)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\tif ($insert !== false) {\n\t\t\t\t\t\t$this->error($wpdb->last_error);\n\t\t\t\t\t\t$this->debug($wpdb->last_query, array('Error', $media->errorN));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($album_id)) {\n\t\t\t\t$wpdb->update($plugin->dbAlbums, array('modified' => $func->now()), array('id' => $album_id));\n\t\t\t}\n\t\t}\n\t}", "public function addPhoto($id, Request $request)\n {\n $this->validate($request, [\n 'photo' => 'required|mimes:jpg,jpeg,png,bmp'\n ]);\n\n $photo = $this->makePhoto($request->file('photo'));\n\n //Save and associate photo with PhotoSession\n PhotoSession::findOrFail($id)->addPhoto($photo);\n }", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "public function addImage( OpenGraphProtocolImage $image ) {\n\t\t$image_url = $image->getURL();\n\t\tif ( empty($image_url) )\n\t\t\treturn;\n\t\t$image->removeURL();\n\t\t$value = array( $image_url, array($image) );\n\t\tif ( ! isset( $this->image ) )\n\t\t\t$this->image = array( $value );\n\t\telse\n\t\t\t$this->image[] = $value;\n\t\treturn $this;\n\t}", "private function addImages($id_album){\n foreach ($_FILES['images']['type'] as $type) {\n if($type != 'image/jpeg'){\n return false;\n }\n }\n //Almaceno cada una de las imagenes en la BBDD\n foreach ($_FILES['images']['tmp_name'] as $tempDir) {\n $this->imagesModel->saveImage($id_album, $tempDir);\n }\n return true;\n }", "public function addimage($entry_id, $trip_id) {\n if ($_FILES['img']['error'] == 0 && $_FILES['coverimg']['size'] < 1500*1500) {\n $entry_image = Upload::upload($_FILES, \"/uploads/entries/\", array(\"JPG\", \"JPEG\", \"jpg\", \"jpeg\", \"gif\", \"GIF\", \"png\", \"PNG\"), \"entry_image_\".$entry_id.\"_\".Utils::generate_random_string());\n\n # Error message if the file type isn't on the list\n if($entry_image == 'Invalid file type.') {\n Router::redirect(\"/trips/dashboard/invalid\");\n }\n\n else {\n \n # Process the upload\n $data = Array(\"img\" => $entry_image,\n \"entry_id\" => $entry_id,\n \"caption\" => $caption,\n \"created\" => Time::now());\n DB::instance(DB_NAME)->insert(\"pics\", $data);\n\n # Boolean for entries table so we know there are pictures associated with this entry\n $pic = Array(\"pic_id\" => \"1\");\n DB::instance(DB_NAME)->update(\"entries\", $pic, \"WHERE entry_id = \".$entry_id);\n\n # Instantiate new image object using uploaded file\n $imgObj = new Image(APP_PATH.\"uploads/entries/\".$entry_image);\n\n # Resize the image\n $imgObj->resize(500,500, \"crop\");\n $imgObj->save_image(APP_PATH.\"uploads/entries/\".$entry_image, 100);\n Router::redirect(\"/trips/dashboard/\".$trip_id);\n }\n }\n else\n {\n # Error message if file isn't able to be processed\n Router::redirect(\"/trips/dashboard/process/\");\n }\n }", "function photos_addTags ($photo_id, $tags) {\n $response = $this->execute(array('method' => 'flickr.photos.addTags', 'photo_id' => $photo_id, 'tags' => $tags));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function add_new_recursive($startnum, $old_photos, $gallery) {\n \n //now search for new photos\n $new_photos = $this->get_photos($gallery['groupid'], $startnum);\n if (!$new_photos) {\n //something is wrong\n return;\n }\n \n $old = false; //flag if some of the photos are already inte tha database\n foreach ($new_photos as $photo) {\n if ($photo && $this->check_if_new($photo, $old_photos))\n {\n //if the photo is new, \n //add it to the wordpress database\n $this->add_photo($photo, $gallery);\n } else {\n $old = true;\n }\n }\n if (!$old) {\n //If no photos were old, there might be more to find\n $this->add_new_recursive($startnum + 1, $old_photos, $gallery);\n }\n}", "function add_image_sizes() {\n\t\t$cover_width = 350;\n\t\t$cover_height = 250;\n\t\t$cover_size = UM()->options()->get( 'um_user_photos_cover_size' );\n\t\tif ( $cover_size && trim( $cover_size ) != '' ) {\n\t\t\t$cover_size = strtolower( $cover_size );\n\t\t\t$size = explode( 'x', $cover_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$cover_width = intval( $size[0] );\n\t\t\t\t$cover_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\t\tadd_image_size( 'album_cover', $cover_width, $cover_height, true );\n\n\t\t$photo_width = 250;\n\t\t$photo_height = 250;\n\t\t$photo_size = UM()->options()->get( 'um_user_photos_image_size' );\n\t\tif ( $photo_size && trim( $photo_size ) != '' ) {\n\t\t\t$photo_size = strtolower( $photo_size );\n\t\t\t$size = explode( 'x', $photo_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$photo_width = intval( $size[0] );\n\t\t\t\t$photo_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\n\t\tadd_image_size( 'gallery_image', $photo_width, $photo_height, true );\n\t}", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"uploads\";\n $destination_path = \"products\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function actionAddPhoto()\n {\n $form = new HomeImageForm();\n if ($form->load(Yii::$app->request->post()) && $form->validate()) {\n try {\n $this->service->create($form);\n Yii::$app->session->setFlash('success','Успешно загружено. Ожидайте модерацию' );\n return $this->redirect(['index']);\n }catch (\\RuntimeException $e) {\n Yii::$app->session->setFlash('danger', $e->getMessage());\n }\n }\n\n return $this->render('create', [\n 'model' => $form,\n ]);\n\n }", "public function add($product_id, $image_id = 1){\n $query = 'INSERT INTO product_image(product_id, image_id) VALUES(?,?)';\n $prepare = $this->connection->prepare($query);\n return $prepare->execute([$product_id, $image_id]);\n }", "public function addPhoto($idMember, $title, $description, $url, $lat, $lng, $status){\n $sql = 'INSERT INTO photos(memberId, name, description, url, lat, lng, status, date_added) VALUES(?, ?, ?, ?, ?, ?, ?, NOW())';\n $this->executeQuery($sql, array($idMember, $title, $description, $url, $lat, $lng, $status));\n }", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"public_folder\";\n $destination_path = \"uploads/albums\";\n $album_originalName = $_POST['name'];\n // ******** Generate unique album name ********\n $album_name = md5( $album_originalName . time() );\n \n foreach ( $value as $file ) {\n // 0. Generate new size file\n $image = \\Image::make( $file );\n $image_350 = \\Image::make( $file ) -> widen( 350 );\n \n // 1. Generate new file names\n $new_file_name = md5( $file -> getClientOriginalName() . time() ).'.'.$file->getClientOriginalExtension();\n $new_file_name_350 = md5( $file -> getClientOriginalName() . time() ).'_350.'.$file->getClientOriginalExtension();\n \n // 2. Move new files to the correct path\n $file_path = $destination_path . '/' . $album_name . '/' . $new_file_name;\n $file_path_350 = $destination_path . '/' . $album_name . '/' . $new_file_name_350;\n \\Storage::disk( $disk )->put( $file_path, $image -> stream() );\n \\Storage::disk( $disk )->put( $file_path_350, $image_350 -> stream() );\n \n // 3. Add the public path to the database\n $attribute_value[] = [ $file_path, $file_path_350 ];\n }\n $this->attributes[$attribute_name] = str_replace( '\\\\', '', json_encode($attribute_value) );\n }", "function photosets_removePhoto ($photoset_id, $photo_id) {\n\t\t$params['method'] = 'flickr.photosets.orderSets';\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.removePhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function addImage($conn, $itemid, $imageid)\n\t{\n\t\t\n\t}", "function add_image_to_object($obj_type, $obj_id, $img_id)\n{\n /* $row = db_get_item_by_query('SELECT `order` FROM object_images WHERE obj_type = \"' .\n strtok($obj_type, \" \") . '\" AND obj_id = ' . (int)$obj_id .\n ' ORDER BY `order` DESC');\n\n $last_order = $row['order'] ? $row['order'] : 0;*/\n\n $r= db()->insert('object_images', array(\n 'obj_type' => strtok($obj_type, \" \"),\n 'obj_id' => (int)$obj_id,\n 'img_id' => (int)$img_id));\n return $r;\n}", "protected function _actionAdd($context)\n\t{\t\n\t\t$data = $context->data;\t\t\n\t\t$file = KRequest::get('files.file', 'raw');\n\t\t$content = @file_get_contents($file['tmp_name']);\n\t\t$filesize = strlen($content);\n\t\t$uploadlimit = $this->_max_upload_limit * 1024 * 1024; \n\t\t\n\t\t$exif = (function_exists('exif_read_data')) ? @exif_read_data($file['tmp_name']) : array();\n\n\t\tif($filesize == 0)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('File is missing');\t\n\t\t\t\n\t\t return;\n\t\t}\n\t\t\n\t\tif($filesize > $uploadlimit)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('Exceed maximum size');\t\n\n\t\t return;\n\t\t}\n\n\t\t$orientation = 0;\n\t\t\n\t\tif(!empty($exif) && isset($exif['Orientation']) )\n {\n $orientation = $exif['Orientation']; \n }\t\t\n\t\t\n\t\t$data['portrait'] = array('data'=>$content,'rotation'=>$orientation,'mimetype'=>isset($file['type']) ? $file['type'] : null);\t\t\t\t\n \n\t\t$photo = $this->actor->photos->addNew($data);\t\n\t\t\n\t\t$photo->setExifData($exif);\n\t\t\n\t\t$photo->save();\n\t\t\n\t\t$this->setItem($photo);\n\t\t\n\t\t$this->getResponse()->status = KHttpResponse::CREATED;\n\t\t\n if($photo->body && preg_match('/\\S/',$photo->body))\n {\n $context->append(array( \n 'story' => array('body'=>$photo->body)\n )); \n }\n\n\t\treturn $photo;\n\t}", "function main() {\n \n //first, dig out the photos we already have\n $args = array(\n 'orderby' => 'date',\n 'order' => 'DESC'\n );\n \n //Check and add new photos\n foreach ($this->galleries as $gallery) {\n $args['media_tags'] = $gallery['mediatag'];\n\n $old_photos = get_attachments_by_media_tags($args);\n $this->add_new_recursive(1, $old_photos, $gallery);\n }\n}", "public function save(Photo $photo);", "function addImage( $value, $categoryid = false )\r\n {\r\n if ( is_a( $value, \"eZImage\" ) )\r\n $imageID = $value->id();\r\n else if ( is_numeric( $value ) )\r\n $imageID = $value;\r\n else\r\n return false;\r\n\r\n if ( !$categoryid )\r\n $categoryid = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n\r\n $imageID = $value->id();\r\n\r\n $db->begin( );\r\n $db->lock( \"eZImageCatalogue_ImageCategoryLink\" );\r\n\r\n// $query = \"DELETE FROM eZImageCatalogue_ImageCategoryLink WHERE\r\n// CategoryID='$categoryid' AND ImageID='$imageid'\";\r\n\r\n $query = \"DELETE FROM eZImageCatalogue_ImageCategoryLink WHERE\r\n ImageID='$imageid'\";\r\n\r\n $db->query( $query );\r\n\r\n $nextID = $db->nextID( \"eZImageCatalogue_ImageCategoryLink\", \"ID\" );\r\n\r\n $query = \"INSERT INTO eZImageCatalogue_ImageCategoryLink ( ID, CategoryID, ImageID )\r\n VALUES ( '$nextID', '$categoryid', '$imageID' )\";\r\n\r\n $res = $db->query( $query );\r\n\r\n $db->unlock();\r\n\r\n if ( $res == false )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n }", "public function add_gallery($image_data) {\n $business_details = $this->session->userdata('logged_in_vendor_data');\n\n if ($image_data['file']['name'] != '') {\n\n $path = $this->config->item('business_providers_gallery_path');\n $files = $image_data;\n $file = $files['file']['name'];\n\n $count = count($file);\n if ($count > 0) {\n $new_path = $path . $business_details->business_id . \"/\";\n if ($files['file']['name']) {\n $fname = $business_details->name . \"_\" . time() . '_' . $file;\n $img_name = str_replace('', '_', $fname);\n copy($files['file']['tmp_name'], $new_path . $img_name);\n $image_name = $business_details->name . \"_\" . time() . '_' . $files['file']['name'];\n $gallery = array(\n 'business_id' => $business_details->business_id,\n 'images' => $image_name\n );\n }\n }\n $this->db->insert('business_gallery', $gallery);\n }\n\n return true;\n }", "public function insertImageOrderAction()\n {\n $offers = $this->galleryTable->getOfferIds()->toArray();\n $ids = [];\n foreach ($offers as $key => $value) {\n array_push($ids, $value['offer_id']);\n }\n\n foreach ($ids as $key => $value) {\n $images = [];\n $images = $this->galleryTable->getImages($value)->toArray();\n\n foreach ($images as $key => $value) {\n $this->galleryTable->insertImageOrder($value['id'], $value['offer_id'], $key + 1);\n }\n }\n }", "function addImages($images){\n\t$table = 'stjohn_image';\n\t// $imagename = $_POST['imagename'];\n\n\t$image = array('imagename'=>\"\");\n\n\t$keys = array_keys($_POST);\n\n\t$image['mid'] = $_SESSION['mid'];\n\t\n\tif(in_array('did', $keys)){\n\t\t$image['did'] = $_POST['did'];\n\t}\n\tif(in_array('abid', $keys)){\n\t\t$image['abid'] = $_POST['abid'];\n\t}\n\tif(in_array('meetid', $keys)){\n\t\t$image['meetid'] = $_POST['meetid'];\n\t}\n\n\tforeach ($images as $imageFile) {\n\t\t$image['imagename'] = \"\";\n\t\t$imagename = $imageFile['name'];\n\t\t$image['imagename'] = \"'$imagename'\";\n\n\t\t// print_r($image);\n\t\t// echo \"<br/>\\n\";\n\n\t\tinsert($table, $image);\n\t}\n\n\t\n\n\treturn 'images uploaded';\n}", "function add() {\n\t\t$this->account();\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Album->create();\n $data['Album'] = $this->data['Album'];\n\t\t\t$data['Album']['images']=$_POST['userfile'];\n\t\t\tif ($this->Album->save($data['Album'])){\n\t\t\t\t$this->Session->setFlash(__('Thêm mới danh mục thành công', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Thêm mơi danh mục thất bại. Vui long thử lại', true));\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function make_a_photo()\n {\n $product = factory(Product::class, 1)->create();\n\n $file = new UploadedFile(\n 'C:\\Users\\Admin\\Projects\\whimsical\\storage\\test\\test_file.jpg',\n 'test_file.jpg',\n 'jpg',\n 'null',\n 'null',\n true\n );\n\n $this->assertTrue(file_exists($file->path()), 'Test file does not exist');\n\n $product->addPhoto($product, $file);\n\n }", "public function setPhoto(Photo $photoObject);", "public function store($id, AddPhotoRequest $request)\n {\n $property = Property::find($id);\n\n if($property->photos()->count() === 10) {\n\n return response()->json([\n \"Property cannot have more than 10 photos\"\n ], 403);\n \n }\n\n $photo = $request->file('photo');\n\n try {\n\n (new AddPhotoToProperty($property, $photo))->saveToImgur();\n\n } catch(\\Exception $e) {\n\n return $e->getMessage();\n }\n\n \n\n }", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "function add_images_meta_box($post) {\n $images = get_post_meta($post->ID, 'imagegallery_images', true);\n\t$count = 1;\n\tif (!empty($images) ) {\n\t\tforeach($images as $image) {\n\t\t\toutput_image_add_box($count++, $image);\n\t\t}\n\t}\n\techo '<div id=\"admin-list-end-marker\" style=\"clear: both;\"></div><a rel=\"image\" href=\"#\" id=\"add-admin-list\" name=\"add-admin-list\">Add Images</a>';\n}", "public function actionAddImage()\n {\n $this->goHomeIfNotPost();\n $this->goHomeIfNotCinema();\n\n $email = $this->userMail;\n $imageName = isset($_FILES[\"newImage\"][\"name\"]) ? $_FILES[\"newImage\"][\"name\"] : null;\n $imageTempFile = $this->request->getFile(\"newImage\");\n\n $validationResult = $this->isValid(\"actionAddGalleryImage\", [\n \"imageName\" => $imageName,\n \"newImage\" => $imageTempFile\n ]);\n if ($validationResult != 1)\n {\n setcookie(\"addGalleryImageErrors\", http_build_query($validationResult), time() + 3600, \"/\");\n header(\"Location: /Theatre\");\n exit();\n }\n\n try\n {\n $image = base64_encode(file_get_contents($imageTempFile));\n $galleryRow = new Gallery([\n \"email\" => $email,\n \"name\" => $imageName,\n \"image\" => $image\n ]);\n (new GalleryModel())->insert($galleryRow);\n }\n catch (Exception $e)\n {\n $msg = \"Adding a new image to the gallery failed!<br/>\".$e->getMessage();\n return view(\"Exception.php\",[\"msg\" => $msg,\"destination\" => \"/Theatre\"]);\n }\n\n\n header(\"Location: /Theatre\");\n exit();\n }", "public function add_image( &$data ) {\n\t\tif ( $this->context->has_image ) {\n\t\t\t$data['primaryImageOfPage'] = [ '@id' => $this->context->canonical . WPSEO_Schema_IDs::PRIMARY_IMAGE_HASH ];\n\t\t}\n\t}", "function photosets_editPhotos ($photoset_id, $photo_ids, $primary_photo_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.editPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$photo_ids = explode(',', $photo_ids);\n\t\tarray_map('trim', $photo_ids);\n\t\tif (!$primary_photo_id) {\n\t\t\t$params['primary_photo_id'] = $photo_ids[0];\n\t\t} else {\n\t\t\t$params['primary_photo_id'] = $primary_photo_id;\n\t\t}\n\t\t$photo_ids = implode(',', $photo_ids);\n\t\t$params['photo_ids'] = $photo_ids;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function addImage()\n {\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\n\t\t\t$image = new ImageModel();\n\t\t\t$this->saveImageModel($image, $user);\n\t\t\treturn $this->sendResponse('Your image has been successfully uploaded');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to add an image');\n }", "private function addImage($data)\n\t{\n//\t\t\t\t\t\t\"date\"\t\t=> $data['date'],\n//\t\t\t\t\t\t\"time\"\t\t=> $data['time'],\n//\t\t\t\t\t\t\"createdBy\"\t=> $this->session->userdata('id'));\n\t\t$this->db->delete(\"user_journal_images\", array(\t\"utID\"\t\t=> $data['utID'],\t// delete any current image\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"date\"\t\t=> $data['date'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"time\"\t\t=> $data['time'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"createdBy\"\t=> $this->session->userdata('id')));\n\n\t\t$data['createdBy']\t= $this->session->userdata('id');\n\t\t$data['createdOn']\t= date(\"Y-m-d H:i:s\");\n\t\t$this->db->insert(\"user_journal_images\", $data);\t\t// insert new image\n\t\t}", "public function actionAddToBasket($addThisToBasket='')\n\t{\t\t\n\t\tif(isset($_GET['imageid']))\n\t\t{\n\t\t\t// The imageid of the image to be submitted to the basket\n\t\t\t$addThisToBasket = $_GET['imageid'];\n\t\t}\t\t\n\t\t// The current contents of the basket are loaded\n\t\t$basket = Yii::app()->user->getState('basketContents');\n\t\t// if the basket is empty, it will be created with a blank array so the in_array can compare the two\n\t\tif(!isset($basket)) $basket = array();\n\t\t// Searches if the image is already in the basket, will be only added if its not already there \n\t\tif( !in_array($addThisToBasket,$basket) )\n\t\t{\n\t\t\t$i = count($basket);\n\t\t\t$basket[$i] = $addThisToBasket;\n\t\t\tYii::app()->user->setState('basketContents', $basket);\n\t\t}\t\n\t}", "function setThumbAdd( $iThumbAdd = '_m' ){\n $this->iThumbAdd = $iThumbAdd;\n }", "public function addPhoto(Request $request) {\n\n // Log::info($request->all());\n \n if(Input::hasFile('file') && Input::file('file')->isValid() && !is_null($request->id))\n {\n\n $file = Input::file('file');\n\n $extension = $file->getClientOriginalExtension(); \n\n $fileName = str_random(10) .'.'. $extension;\n\n $clientMimeType = $file->getClientMimeType();\n\n if(!preg_match(\"/^(image).+$/\", $clientMimeType)) {\n Log::info(\"error not an image \". $clientMimeType);\n return response()->json([\"error\" => \"Not an Image\"], 200);\n }\n\n $original = config('image.profile.original.path') . $fileName;\n\n \\Storage::disk('public')->put( $original , file_get_contents( $file->getRealPath()) );\n \n //persist the record to the db\n $photo = new Photo();\n $photo->property_id = $request->id;\n $photo->url = $original;\n $photo->save();\n\n return response()->json([\"url\" => $original], 200);\n }\n \n return response()->json([\"error\" => \"No File Selected\"], 504);\n }", "public function addImg($item_id, $imgfile)\n {\n // if this is the first added img, set it as defimg also\n $defimg = array();\n if ( ! $this->db->getOne(array('id'=>$item_id), array('imgs')))\n $defimg = array('defimg'=>$imgfile);\n\n if ( $this->db->update(array('id'=>$item_id), array_merge($defimg, array('$addToSet'=>array('imgs'=>$imgfile)))) )\n $msg = array('status'=>'success', 'action'=>'add_img', 'info'=>$imgfile);\n else if ( $error = $this->db->getError() )\n $msg = array('status'=>'failure', 'action'=>'add_img', 'info'=>$error);\n else\n $msg = array('status'=>'failure', 'action'=>'add_img', 'info'=>'unknown error');\n\n return $msg;\n }", "public function addImage($url){\n //todo add images in xml simetamp\n $f=Francis::get($url);\n if ( $f->exists() && $f->isImage()) {\n $this->images[]=GiveMe::urlFile(Robert::fromImage($f->path)->jpg(80),true);\n }\n }", "private function addData()\n {\n $data=new Image();\n $file =Input::file('gallery');\n $image_name=time().\"-gallery-\".$file->getClientOriginalName();\n $file->move(public_path().'/upload',$image_name);\n $data->image=$image_name;\n $data->save();\n return true;\n }", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "public function add(){\n // TODO\n // Validar que sea imagen\n // Validar que solo admins puedan mover esto\n\n // Verificamos que sea un envio por POST\n\t\tif ($this->request->is('post')) {\n $this->Game->create();\n if ($this->Game->saveWithOptionalFile($this->request, $this->Session,\n array(\n 'fileColumnName' => 'thumbnail',\n 'fileInputName' => 'game_logo',\n 'fileOptional' => false,\n )\n )){\n $this->redirect(array('action' => 'index'));\n }\n }\n\t}", "public static function putImages($model, $images, $path, $type, $quantity)\n {\n $images = (array) $images;\n $number = $model->media()->get()->count();\n $difference = null;\n $limitedImgs = null;\n\n if($number < $quantity)\n {\n $difference = $quantity - $number;\n // dd($images);\n $limitedImgs = array_slice($images,0,$difference);\n\n foreach ($limitedImgs as $key => $image) \n {\n $img = Image::make($image->getRealPath());\n\n $img->resize(800, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $image_name = $key. '-' .time().'.'.$image->getClientOriginalExtension();\n\n /*\n ** check if directory exists\n ** if not, create it\n */\n $directory = public_path('/uploads/'. $path);\n if (!file_exists($directory)) \n {\n File::makeDirectory($directory, $mode = 0777, true, true); \n }\n if($directory)\n {\n /*\n ** Save image\n */\n $img->save(public_path('/uploads/'. $path . '/' .$image_name));\n }\n\n $model->media()->create([\n 'id' => (string) Uuid::generate(4),\n 'media_key' => $type,\n 'media_value' => $image_name,\n ]);\n }\n\n // $cover = $model->media()->where('image_key', 'cover')->first();\n\n // if(!$cover)\n // {\n // $model->media()->first()->update(['image_key' => 'cover']);\n // }\n \n }\n else{\n \\Session::flash('msg', trans('session.you_uploaded_max_img_number'));\n return back();\n }\n \n }", "function add_img(){\n\t\t/*if ($ext==\"jpg\" || $ext==\"png\" || $ext=\"gif\"){*/\n\t\t$data = array();\n\t\t$filePath=\"data/upload/\";\n\n\t\tif (!file_exists($filePath)){//如果指定文件夹不存在,则创建文件夹\n\t\t\tmkdir($filePath, 0777, true);\n\t\t}\n\n\t\t/*if(move_uploaded_file($_FILES['file1']['tmp_name'],$name))\n\t\t{\n\t\t\t$is_success=1;\n\t\t\t$reason=$name;\n\t\t}*/\n\t\t$image_data = $_POST['data'];\n\t\t$index = 0;\n\t\tforeach ($image_data as $image) {\n\t\t\t$newfile = microtime().\".jpg\";\n\t\t\t$name=$filePath.$newfile;\n\t\t\tif (preg_match('/^(data:\\s*image\\/(\\w+);base64,)/', $image['src'], $result)){\n\t\t\t\t$type = $result[2];\n\t\t\t\tif (file_put_contents($name, base64_decode(str_replace($result[1], '', $image['src'])))){\n\t\t\t\t\t$data[$index]['sort'] = $image['sort'];\n\t\t\t\t\t$data[$index]['src'] = $name;\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo $data=$this->JSON($data);\n\t\t/*}else {\n\t\t\techo 'error';\n\t\t}*/\n\t}", "public function addPhoto( $fish_id, $photo_name )\n {\n\n $result = false;\n\n try {\n \n if ($this->conn->query(\"INSERT INTO photos (fish_id,photo_name) VALUES ($fish_id, $photo_name)\") === FALSE ) {\n throw new Exception($this->conn->error);\n }\n\n $result = true;\n\n }\n catch( Exception $e ){\n\n $this->errors[] = $e->getMessage();\n\n }\n finally {\n\n // Return results\n return $result;\n\n }\n\n }", "public function addPhoto($username, AddProfilePhotoRequest $request) {\n\n // Set $photo to the fromFile() function,\n // and get the $requested file which is set to 'photo',\n // and upload it using the upload function().\n // -- 'photo' comes from the <script> tags in profile/index.blade.php.\n\n // Create a new photo instance from a file upload.\n $photo = ProfilePhoto::fromFile($request->file('photo'))->upload();\n\n // Set User::loacatedAt() in (User Model)\n // = to the username, and add the photo.\n // -- Find the user and add the Profile Photo.\n User::locatedAt($username)->addProfilePhoto($photo);\n\n }", "public function addImg($insert){\n $this->db->insert($this->product_img, $insert);\n }", "public function uploadPhoto($currentAlbumId, $currentUserID, $photoName, $shortDescription, $placeTaken, $selectedCategories, $writtenTags, $photoFile, $titlePhoto,$users){\n\n $insertedPhotoId = 'nothing to upload';\n\n // upload photo to server\n if (!empty($photoFile)){\n\n foreach($photoFile as $file) {\n $destinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n if($fileSize <= 1024*1024*10){\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n //upload photo in database\n $insertedPhotoId = DB::table('photos')->insertGetId(\n array('photo_name' => $photoName,\n 'photo_short_description' => $shortDescription,\n 'photo_taken_at' => $placeTaken,\n 'album_id' => $currentAlbumId,\n 'user_id' => $currentUserID,\n 'photo_size' => $fileSize\n )\n );\n\n UserAction::add('Photo \"' . $photoName . '\" was uploaded');\n\n $explodedTags = preg_replace(\"/[^\\w\\ _]+/\", '', $writtenTags); // strip all punctuation characters, news lines, etc.\n $explodedTags = preg_split(\"/\\s+/\", $explodedTags); // split by left over spaces\n $tagLine = \"\";\n for($i=0; $i<sizeOf($explodedTags); $i++)\n $tagLine = $tagLine.$explodedTags[$i].\", \";\n $tagLine = substr($tagLine, 0, -2);\n\n DB::insert('insert into photo_tags (photo_id, tags) values (?,?)', array($insertedPhotoId, $tagLine));\n\n\n\n $upload_success = $file->move($destinationPath, $insertedPhotoId.\".\".$extension);\n if($upload_success){\n //makes photo thumb\n $fileForThumb = $destinationPath.\"/\".$insertedPhotoId.\".\".$extension;\n App::make('phpthumb')\n ->create('resize', array($fileForThumb, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", $insertedPhotoId.\"_thumb.\".$extension);\n\n DB::update('update photos set\n photo_destination_url = ?,\n photo_thumbnail_destination_url = ?\n where photo_id = ?',\n array(\n $destinationPath.\"/\".$insertedPhotoId.\".\".$extension,\n $destinationPath.\"/\".$insertedPhotoId.\"_thumb.\".$extension,\n $insertedPhotoId));\n }\n\n //add categories\n for($i = 0; $i < sizeOf($selectedCategories); $i++){\n $catId = DB::select('select * from categories where category_name = ?', array($selectedCategories[$i]));\n if($catId)\n DB::table('photo_categories')->insert(\n array(\n 'photo_id' => $insertedPhotoId,\n 'category_id' => $catId[0]->category_id,\n )\n );\n }\n //add users\n $ob = new User();\n foreach($users as $user){\n if($user != \"\"){\n $usId = $ob->getUserNameById($user);\n $photoP = DB::insert('insert into photo_people (photo_id, user_id) values (?,?)',array($insertedPhotoId,$usId));\n }\n }\n\n //-----------------Editing album title photo data---------------------//\n //if 'make uploaded photo to title album photo' property is selected\n if($titlePhoto){\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //gets current photo url\n $newTitlePhoto = DB::table('photos')->where('photo_id', $insertedPhotoId)->get();\n if($newTitlePhoto){\n\n //photo\n $photo = null;\n $photo = $newTitlePhoto[0]->photo_destination_url;\n if($photo != null ){\n if(is_file($photo)){\n $photoExtension = File::extension($photo);\n $newPhoto = $destinationPath.\"/title_\".$currentAlbumId.\".\".$photoExtension;\n File::copy($photo, $newPhoto);\n $photo = $newPhoto;\n }\n }\n\n //thumb\n $photoThumb = null;\n $photoThumb = $newTitlePhoto[0]->photo_thumbnail_destination_url;\n if($photoThumb != null){\n if(is_file($photoThumb)){\n $thumbExtension = File::extension($photoThumb);\n $newPhotoThumbUrl = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$thumbExtension;\n File::copy($photoThumb, $newPhotoThumbUrl);\n $photoThumb = $newPhotoThumbUrl;\n }\n }\n else if($photoThumb == null && is_file($photo) != null){\n App::make('phpthumb')\n ->create('resize', array($photo, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$photoExtension);\n $photoThumb = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$photoExtension;\n }\n\n //insert uploaded/unuploaded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $photo,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n }\n }\n return $insertedPhotoId;\n }", "public function add_image($file)\n {\n $this->add(\"image\", $file);\n }", "public function addImage($url)\n {\n if (count($this->images) < 4) {\n $this->images[] = $url;\n }\n\n return $this;\n }", "public function photoManage()\n {\n\n $flags = $this->language->getAllDataNoPagination();\n $id = Input::get('picture_id');\n $photoLg = $this->photoLg->getAllDataNoPagination();\n $photo = $this->photo->getDataById($id);\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n\n return view('cms.modules.multicms.photosLg_addnew', compact('photo', 'flags', 'photoLg'), $data);\n }", "public static function addInstanceToPool(MissionPhoto $obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getId();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}", "protected function combineImages() {}", "private function setImgArray($data)\n {\n //====================================================================//\n // Safety Check\n if (!is_array($data) && !is_a($data, \"ArrayObject\")) {\n return false;\n }\n //====================================================================//\n // Load Object Images List for Whole Product\n $this->imagesCache = Image::getImages(SLM::getDefaultLangId(), $this->object->id);\n\n //====================================================================//\n // UPDATE IMAGES LIST\n //====================================================================//\n\n $this->imgPosition = 0;\n $visibleImageIds = array();\n //====================================================================//\n // Given List Is Not Empty\n foreach ($data as $inValue) {\n //====================================================================//\n // Check Image Array is here\n if (!isset($inValue[\"image\"]) || empty($inValue[\"image\"])) {\n continue;\n }\n $this->imgPosition++;\n //====================================================================//\n // Search For Image In Current List\n $psImage = $this->searchImage($inValue[\"image\"][\"md5\"]);\n if (false == $psImage) {\n //====================================================================//\n // If Not found, Add this object to list\n $psImage = $this->addImageToProduct(\n $inValue[\"image\"],\n $this->getImagePosition($inValue),\n $this->getImageCoverFlag($inValue)\n );\n }\n //====================================================================//\n // Safety Check\n if (!($psImage instanceof Image)) {\n continue;\n }\n //====================================================================//\n // Update Image Position in List\n $this->updateImagePosition($psImage, $inValue);\n $this->updateImageCoverFlag($psImage, $inValue);\n //====================================================================//\n // Update Image Object in Database\n $this->updateImage($psImage);\n //====================================================================//\n // Add Ps Image Id to Visible\n if ($this->getImageVisibleFlag($inValue)) {\n $visibleImageIds[] = $psImage->id;\n }\n }\n\n //====================================================================//\n // Update Combination Images List\n $this->updateAttributeImages($visibleImageIds);\n\n //====================================================================//\n // If Current Image List Is Empty => Clear Remaining Local Images\n $this->cleanImages($this->imagesCache);\n\n //====================================================================//\n // Generate Images Thumbnail\n $this->updateImgThumbnail();\n\n //====================================================================//\n // Flush Images Infos Cache\n $this->flushImageCache();\n\n return true;\n }", "public function photoCreate()\n {\n $gallery_id = Input::get('gallery_id');\n $gallery = PhotoGallery::where('id', '=', $gallery_id)->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $flags = $this->language->getAllDataNoPagination();\n\n return view('cms.modules.multicms.photos_addnew', compact('flags', 'gallery'), $data);\n\n }", "private function addImageToProduct($imgArray, $position, $isCover)\n {\n //====================================================================//\n // Read File from Splash Server\n $newImageFile = Splash::file()->getFile($imgArray[\"file\"], $imgArray[\"md5\"]);\n //====================================================================//\n // File Imported => Write it Here\n if (false == $newImageFile) {\n return Splash::log()->err(\"Reading Raw Image from Server failled...\");\n }\n $this->needUpdate();\n //====================================================================//\n // Create New Image Object\n $objectImage = new Image();\n $objectImage->legend = isset($newImageFile[\"name\"]) ? $newImageFile[\"name\"] : $newImageFile[\"filename\"];\n $objectImage->id_product = $this->ProductId;\n $objectImage->position = $position;\n $objectImage->cover = $isCover;\n //====================================================================//\n // Write Image To Database\n if (!$objectImage->add()) {\n return false;\n }\n //====================================================================//\n // Write Image On Folder\n $path = dirname($objectImage->getPathForCreation());\n $filename = \"/\".$objectImage->id.\".\".$objectImage->image_format;\n Splash::file()->writeFile($path, $filename, $newImageFile[\"md5\"], $newImageFile[\"raw\"]);\n\n return $objectImage;\n }", "public function photoEdit()\n {\n $flags = $this->language->getAllDataNoPagination();\n $data['id'] = Input::get('picture_id');\n $data['photo'] = Pictures::where('id', '=', $data['id'])->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n\n return view('cms.modules.multicms.photoslg_addnew', $data, $flags);\n }", "public function actionPhotoUpload() {\n \n $model = new InfoBlockGallery();\n \n if ($model->load(Yii::$app->request->post())) {\n foreach(\\yii\\web\\UploadedFile::getInstances($model, 'image') as $k => $image) {\n \\Yii::$app->session->setFlash('multipleIndex', $k);\n $modelImages = new InfoBlockGallery();\n $modelImages->block_id = $model->block_id;\n $modelImages->save();\n }\n \n return $this->redirect(Yii::$app->getRequest()->getReferrer());\n } else {\n print_r($model->getErrors());\n exit();\n return $this->redirect(Yii::$app->getRequest()->getReferrer());\n// return $this->refresh();\n // or redirect to refferer\n } \n }", "public function addImage($url) {\r\n\t\tif (count($this->images) > $this->nrOfImages) return false;\r\n\t\tif (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) return false;\r\n\t\tarray_push($this->images, substr($url, 0, 255));\r\n\t\treturn true;\r\n\t}", "public function extend($photo)\n {\n if (!is_object($photo) && !is_array($photo)) {\n if ($this->debugEnabled) {\n wp_die ('Invalid $photo parameter specified');\n }\n }\n\n $photo = (object) $photo;\n\n $usedTimes = $this->getUsedTimes($photo);\n\n $photo->attachment = wp_prepare_attachment_for_js($photo->attachment_id);\n $photo->is_used = (($usedTimes > 0) ? true : false);\n $photo->used_times = $usedTimes;\n\n if (class_exists('GridGalleryPro_Galleries_Model_Tags')) {\n $tags = new GridGalleryPro_Galleries_Model_Tags();\n $result = $tags->getByPhotoId($photo->id);\n $photo->tags = array();\n\n if (is_object($result) && property_exists($result, 'tags')) {\n $photo->tags = explode(',', $result->tags);\n }\n }\n\n return $photo;\n }", "public function savePhoto(){\n if($this->imageFile && $this->photo = $this->upload($this->user_id, $this->getPrimaryKey())) {\n //off the events to avoid infinite loop\n $this->off(self::EVENT_AFTER_INSERT, [$this, 'savePhoto']);\n $this->off(self::EVENT_AFTER_UPDATE, [$this, 'savePhoto']);\n \n return $this->save(false);\n } \n return true;\n }", "function add_image($image,$imageTitle,$imageDescription,$imageUrlMain,$imageLink2Title,$imageLink2Url,$imageLink3Title,$imageLink3Url,$imageLink4Title,$imageLink4Url)\n\t\t{\n\t\t\t$this -> load -> helper('security');\n\n\t\t\t$data = array('Image' => $image, 'Title' => $imageTitle, 'Description' => $imageDescription, 'Urlmain' => $imageUrlMain, 'link2title' => $imageLink2Title, 'Link2' => $imageLink2Url, 'Link3title' => $imageLink3Title, 'Link3' => $imageLink3Url, 'Link4title' => $imageLink4Title, 'Link4' => $imageLink4Url);\n\n\t\t\t$this -> db -> insert('MediaSlider', $data);\n\t\t}", "public static function addPhotos($room_id, $pictures){\n\n // array for errors\n $errors_on_update = array();\n\n foreach ($pictures as $picture){\n\n if($picture->save($room_id, true)){\n\n $errors_on_update[] = true;\n\n }\n\n }\n\n return in_array(0, $errors_on_update, false) ? false : true;\n\n }", "function add_image($file, $rid){\n\n\t//Image id for the new image\n\t$iid = rows_count('pacs_images');\n\n\t$conn = connect();\n\t$sql = \"insert into pacs_images (record_id, image_id, thumbnail, regular_size, full_size) VALUES(\".$rid.\", \".$iid.\", empty_blob(), empty_blob(), empty_blob()) RETURNING thumbnail, regular_size, full_size into :tn, :rs, :fs\";\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\techo 'fail';\n\t\treturn FALSE;\n\t}\n\t\n\t$full_size = oci_new_descriptor($conn, OCI_DTYPE_LOB);\n\t$regular_size = oci_new_descriptor($conn, OCI_DTYPE_LOB);\n\t$thumb = oci_new_descriptor($conn, OCI_DTYPE_LOB);\n\n\toci_bind_by_name($statement, \":fs\", $full_size, -1, OCI_B_BLOB);\n\toci_bind_by_name($statement, \":rs\", $regular_size, -1, OCI_B_BLOB);\n\toci_bind_by_name($statement, \":tn\", $thumb, -1, OCI_B_BLOB);\n\n\t$exec = oci_execute($statement, OCI_DEFAULT);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo $err['message'];\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$file = fopen($file[\"tmp_name\"][0], 'r');\n\t$image_binary = fread($file, 1000000);\n\n\t$image = imagecreatefromstring($image_binary);\n\n\t//Thumbnail\n\t$width = imagesx($image);\n\t$height = imagesy($image);\n\n\t$thumb_width = 50;\n\t$thumb_height = floor($height * ($thumb_width / $width));\n\n\t$reg_width = ((400 < $width) ? 400 : $width);\n\t$reg_height = floor($height * ($reg_width / $width));\n\n\t$thumbnail = imagecreatetruecolor($thumb_width, $thumb_height);\n\t$regular = imagecreatetruecolor($reg_width, $reg_height);\n\n\n\timagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height);\n\timagecopyresampled($regular, $image, 0, 0, 0, 0, $reg_width, $reg_height, $width, $height);\n\n\tob_start();\n\timagejpeg($thumbnail);\n\t$thumbnail_binary = ob_get_contents();\n\tob_end_clean();\n\n\tob_start();\n\timagejpeg($regular);\n\t$reg_binary = ob_get_contents();\n\tob_end_clean();\n\n\t$t = $thumb->save($thumbnail_binary);\n\t$r = $regular_size->save($reg_binary);\n\t$f = $full_size->save($image_binary);\n\n\tif(!($t && $r && $f)) {\n\t\toci_rollback($conn);\n\t}\n\telse {\n\t\toci_commit($conn);\n\t}\n\n\toci_close($conn);\n\toci_free_statement($statement);\n}", "public function createPhotoZipfile()\n {\n $zip = new ZipArchive();\n $result = $zip->open($this->photoZip, ZipArchive::CREATE | ZipArchive::OVERWRITE);\n if ($result !== true) {\n throw new RuntimeException(\"Failed to create zip file [{$this->photoZip}] result=[$result]\");\n }\n\n foreach ($this->bmids as $bmid) {\n // pull down each file\n $data = $bmid->person->person_photo->readImage();\n $image = self::buildPhotoName($bmid->person);\n $result = $zip->addFromString($image, $data);\n if ($result !== true) {\n throw new RuntimeException(\"Failed to add photo file [$image] result=[$result]\");\n }\n // Force garbage collection.\n unset($data);\n gc_collect_cycles();\n }\n $zip->close();\n\n unset($zip);\n\n gc_collect_cycles();\n }", "public function add(){\n $errors = false;\n $sdate = date('Y-m-d H:i:s');\n $dtime = time();\n\n if(!empty($_POST)){\n $artiste_hash = 'artiste+' . md5(uniqid());\n if(!empty($_FILES['fichier']['name'])){\n $art_photo = $_FILES['fichier']['name'];\n $path = ROOT . '/public/medias/images/interviews/';\n $ext = substr($art_photo, strpos($art_photo,'.'), strlen($art_photo)-1);\n $allowed = array('.jpeg','.jpg','.png','.GIF','.JPEG','.JPG','.PNG','.GIF');\n $art_photo = $_FILES[\"fichier\"][\"name\"] = $dtime . 'iphoto' . uniqid() . rand(1,99999) . $ext;\n $filename = $art_photo;\n if(!in_array($ext, $allowed)){\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Oops, l'extension de ce fichier n'est pas pris en compte !</div><?php\n }else{\n if(!is_writable($path)){\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Oops, vous n'avez pas accès à ce dossier !</div><?php\n }else{\n if(move_uploaded_file($_FILES['fichier']['tmp_name'],$path.$filename)){\n $naissdate = $_POST['annee'] . '-' . $_POST['mois'] . '-' . $_POST['jour'];\n $result = $this->Artiste->create([\n 'pseudo' => $_POST['pseudo'],\n 'noms' => $_POST['noms'],\n 'annee' => $naissdate,\n 'photo' => $filename,\n 'bio' => $_POST['biographie'],\n 'genre_id' => $_POST['genre'],\n 'artiste_hash' => $artiste_hash,\n 'dtime' => $dtime,\n 'sdate' => $sdate\n ]);\n if($result){\n $errors = true;\n }\n }else{\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Oops, Impossible d'uploader ce fichier !</div><?php\n }\n }\n }\n }else{\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Vous devez choisir un fichier (.mp4) !</div><?php\n }\n }\n\n $form = new DafstyleForm($_POST);\n\n $this->loadModel('Genre');\n $genres = $this->Genre->extractThis('id', 'titre');\n\n $this->render('admin.artistes.add', compact('form', 'genres', 'errors'));\n }", "public function store(ImageFormRequest $request)\n {\n $data = [];\n foreach ($request->asset_uri_group as $asset_uri) {\n array_push($data, \n [\n 'asset_uri' => $asset_uri,\n 'product_id' => $request->product_id,\n 'description' => $request->description,\n ]);\n }\n Image::insert($data);\n\n return redirect(route('products.view_details', $request->product_id))->with('success', __('image_created'));\n }", "function photosets_create ($title, $primary_photo_id, $description = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.create';\n\t\t$params['title'] = $title;\n\t\t$params['primary_photo_id'] = $primary_photo_id;\n\t\tif ($description) $params['description'] = $description;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function addImage($img_name){\n\t\t\n\t\t$db = $this->_connect;\n\t\t$img = $db->prepare(\"INSERT INTO img(id,img_name) VALUES( NULL,? )\");\n\t\t$img->bind_param(\"s\",$img_name);\n\t\tif(!$img->execute()){\n\t\t\techo $db->error;\n\t\t}\n\t\n\t}", "function addImage($path,$title,$description,$thumb,$lightbox,$uniqueID,$limitImages=0) {\n\t // count of images\n\t if ($limitImages > 1 || $limitImages==0) {\n $this->config['count']++;\n\t }\n // just add the wraps if there is a text for it\n $title = (!$title) ? '' : \"<h3>$title</h3>\";\n $description = (!$description) ? '' : \"<p>$description</p>\";\n \n // generate images\n if ($this->config['watermark']) {\n $imgTSConfigBig = $this->conf['big2.'];\n $imgTSConfigBig['file.']['10.']['file'] = $path;\n $imgTSConfigLightbox = $this->conf['lightbox2.'];\n $imgTSConfigLightbox['file.']['10.']['file'] = $path; \n } else {\n $imgTSConfigBig = $this->conf['big.'];\n $imgTSConfigBig['file'] = $path;\n $imgTSConfigLightbox = $this->conf['lightbox.'];\n $imgTSConfigLightbox['file'] = $path; \n } \n $bigImage = $this->cObj->IMG_RESOURCE($imgTSConfigBig);\n\n $lightbox = ($lightbox=='#' || $lightbox=='' || $this->config['showLightbox']!=1) ? 'javascript:void(0)' : $this->cObj->IMG_RESOURCE($imgTSConfigLightbox);\n \t$lightBoxImage='<a href=\"'.$lightbox.'\" title=\"'.$this->pi_getLL('textOpenImage').'\" class=\"open\"></a>';\n\n if ($thumb) {\n $imgTSConfigThumb = $this->conf['thumb.'];\n $imgTSConfigThumb['file'] = $path; \n $thumbImage = '<img src=\"'.$this->cObj->IMG_RESOURCE($imgTSConfigThumb).'\" class=\"thumbnail\" />';\n }\n\n\t // if just 1 image should be returned\n if ($limitImages==1) {\n \treturn '<img src=\"'.$bigImage.'\" class=\"full\" />';\n }\n\n // build the image element \n $singleImage .= '\n <div class=\"imageElement\">'.$title.$description.\n $lightBoxImage.'\n <img src=\"'.$bigImage.'\" class=\"full\" />\n '.$thumbImage.'\n </div>';\n\n\t\t// Adds hook for processing the image\n\t\t$config['path'] = $path;\n $config['title'] = $title;\n\t\t$config['description'] = $description;\n\t\t$config['uniqueID'] = $uniqueID;\n\t\t$config['thumb'] = $thumb;\n\t\t$config['large'] = $large;\n\t\t$config['lightbox'] = $lightbox;\n\t\t$config['limitImages'] = $limitImages;\n\t\t$config['lightBoxCode'] = $lightBoxImage;\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraImageHook'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraImageHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$singleImage = $_procObj->extraImageProcessor($singleImage,$config, $this);\n\t\t\t}\n\t\t} \n \n return $singleImage;\n }" ]
[ "0.6447367", "0.5967513", "0.5963022", "0.58876604", "0.5765217", "0.5613605", "0.56116784", "0.5552352", "0.55000025", "0.5419363", "0.53597254", "0.5341553", "0.53407776", "0.53404325", "0.53361213", "0.5311107", "0.52692103", "0.5262326", "0.5248917", "0.5248222", "0.5230116", "0.52097106", "0.5196261", "0.5194303", "0.51890695", "0.515775", "0.5146404", "0.51331484", "0.51321024", "0.512521", "0.51073784", "0.506625", "0.50648254", "0.5059556", "0.50567424", "0.50558203", "0.5031814", "0.50222015", "0.5014926", "0.50078267", "0.49982268", "0.4977522", "0.49669093", "0.49630585", "0.4960367", "0.49593532", "0.49592105", "0.49408004", "0.49383914", "0.49381217", "0.4920127", "0.49135402", "0.49058598", "0.48875046", "0.487908", "0.48788935", "0.48739278", "0.48559713", "0.4850527", "0.48439997", "0.48295486", "0.48082793", "0.48080397", "0.48074007", "0.48069617", "0.47990587", "0.47915846", "0.4781157", "0.47798756", "0.47759107", "0.47658476", "0.47588083", "0.47549027", "0.4750633", "0.4746314", "0.47438878", "0.47431916", "0.47370356", "0.47343707", "0.47289318", "0.47267783", "0.47251743", "0.4717418", "0.47135022", "0.47133833", "0.4711097", "0.4687345", "0.46801302", "0.46772838", "0.46745557", "0.46690914", "0.46685323", "0.46471697", "0.463898", "0.46295196", "0.4628519", "0.46250436", "0.46247312", "0.4624458", "0.46209937" ]
0.67797565
0
Create a new photoset for the calling user.
function photosets_create ($title, $primary_photo_id, $description = NULL) { $params = array(); $params['method'] = 'flickr.photosets.create'; $params['title'] = $title; $params['primary_photo_id'] = $primary_photo_id; if ($description) $params['description'] = $description; $response = $this->execute($params, 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photoset']; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newSet($set, $userid, $connection) {\r\n\t\t$connection -> exec(\"INSERT INTO \".$GLOBALS['dbPrefix'].\"question_set (`setname`,`setdescription`, `ownerid`, `editcount`, `createtimestamp`, `firstowner`) VALUES ('\" . $set -> getSetName() . \"', '\" . $set -> getSetDescription() . \"', \" . $userid . \", 1, '2009-00-00 00:00:00', \" . $userid . \");\");\r\n\t\t$set -> setSetId($connection -> lastInsertId());\r\n\t\tarray_push($this -> sets, $set);\r\n\t}", "function photosets_addPhoto ($photoset_id, $photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.addPhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function store(Request $request)\n {\n return response()->json( Gallery::CreateUserPhoto(), 200);\n }", "public function createUserViaRequest()\n {\n $photo = photos()->createPhotoViaRequest();\n $user = User::create(array_merge([\n 'user_uuid' => authenticated()->uuid,\n 'photo_uuid' => $photo->uuid,\n 'photo_url' => config('storage.path') . $photo->photo_url,\n 'password' => bcrypt(input('password')),\n 'location' => parser()->pointFromCoordinates(input('coordinates')),\n ], only('name', 'email', 'is_public')));\n $user->photos()->attach($photo->uuid);\n $user->load('photo', 'user');\n return $user;\n }", "public function create($userId, $params = array())\n\t{\n\t\t$directory = $this->parameters->params['directory'];\n\n\t\t$albumsDir = $directory . DIRECTORY_SEPARATOR . 'albums';\n\n\t\tFileSystem::createDir($albumsDir);\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$id = Strings::random(32);\n\t\t\t$i ++;\n\t\t} while ($i <= self::MAX_TRIES && is_dir($albumsDir . DIRECTORY_SEPARATOR . $id));\n\n\t\tif($i > self::MAX_TRIES) {\n\t\t\tthrow new \\Exception(sprintf(\"Unable to find unique id for the new album.\"));\n\t\t}\n\n\t\t$albumDir = $albumsDir . DIRECTORY_SEPARATOR . $id;\n\t\tFileSystem::createDir($albumDir);\n\t\t\n\t\t$params = Arrays::mergeTree(array('id' => $userId), $params);\n\n\t\t$this->saveMetadata($albumDir, $params);\n\n\t\t$this->addAlbumToUser($id, $userId);\n\n\t\t$this->cache->clean(array(\n\t\t\tCache::TAGS => [\"user-$userId\"]\n\t\t));\n\n\t\treturn $this->find($id);\n\t}", "public function createSet(Entity\\Set $set) {\n $data = array(\n 'name' => $set->get('name'),\n 'description' => $set->get('description', null)\n );\n\n $id = parent::create($data);\n\n return $set->setId($id);\n }", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "public function testGetUserPhotosSuccess()\n {\n $user = factory(\\App\\User::class)->make();\n\n $user->photos()->createMany(\n factory(\\App\\Photo::class, 3)->make()->toArray()\n );\n\n $response = $this->get('/photos');\n\n $response->assertStatus(200);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'file' => 'required|image|max:10240',\n ]);\n\n $photo = new Photo();\n $photo->user_id = Auth::id();\n $photo->path = $this->uploadImg($request->file('file'), 'submissions/img');\n $photo->thumbnail_path = $this->createThumbnail($request->file('file'), 600, null, 'submissions/img/thumbs');\n $photo->save();\n\n return new PhotoResource($photo);\n }", "public function store(Request $request)\n {\n $user = JWTAuth::parseToken()->authenticate();\n\n if (Gate::forUser($user)->allows('albums-create', $user)) {\n $validator = Validator::make($request->all(), $this->validations);\n\n if ($validator->fails()) {\n return response()->json([\n 'success'=> false,\n 'errors' => $validator->errors()->all()\n ],400);\n }\n\n $record = $user->albums()->create($request->all());\n $album = $this->prepareAlbumData($record,[]);\n\n if($request->hasFile('image')){\n $image = $request->file('image');\n $this->createImage($user,$record,$image);\n\n $album['image'] = $this->getFileURL($record->image);\n }\n\n return response()->json([\n 'success' => true,\n 'album' => $album,\n 'message' => 'Album successfully created'\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied. You can't create albums, you need to be an author.\"]\n ],403);\n }\n }", "public function create()\n {\n\n $postData = $this->request->request->all();\n $imageData = $postData['image'];\n\n $user = $this->user;\n $user->setUpdateDate(new \\DateTime());\n $timeStamp = $user->getUpdateDate()->getTimestamp();\n\n # Ensure directory is created\n $dirPath = '/images/photos/checkins/' . $user->getId();\n\n if (!file_exists(ROOTDIR . \"/\" . $dirPath)) {\n mkdir(ROOTDIR . \"/\" . $dirPath, 0777, true);\n }\n\n $filePath = $dirPath . '/' . (time() * rand(100, 1000)) . '.jpg';\n $photoUrl = filter_var($imageData, FILTER_VALIDATE_URL);\n\n if ($photoUrl !== false) {\n $uri = $photoUrl;\n } else {\n ImageHelper::saveImageFromBase64($imageData, ROOTDIR . $filePath);\n $uri = $filePath . \"?\" . $timeStamp;\n }\n\n $postData['uri'] = $uri;\n\n $checkIn = $this->checkInRepo->map($postData, $this->user);\n $this->checkInRepo->insert($checkIn);\n\n return $this->_generateResponse($checkIn->toArray(), Status::CREATED);\n }", "public function store(PhotoCreateRequest $request)\n {\n DB::beginTransaction();\n $photo = $this->createPhotoInstance($request->all());\n $photo->owner()->associate(auth()->user());\n $photo->save();\n\n $photo->location()->save(\n new PhotoLocation($request->only('location'))\n );\n\n $tags = $this->createTags(explode(',', $request->tags));\n\n $photo->tags()->sync($tags->pluck('id')->toArray());\n\n // Execute processing to external photo: download, apply geocoding...\n dispatch(new ProcessingExternalPhoto($photo));\n\n DB::commit();\n\n // 201\n return $photo;\n }", "public function create()\n {\n\n $this->data = array(\n 'templates' => \\Pageblok::getTemplates(\"gallery\"),\n );\n\n return parent::create();\n }", "public function create()\n {\n return view('backEnd.photos.create');\n }", "public function create()\n {\n $path = request()->file('photo')->store('testing');\n return response()->json(['path' => $path], 200);\n }", "public function create()\n {\n return view('backend.photos.create');\n }", "public function createNewStickerSet($user_id,$name,$title,$png_sticker,$emojis,$contains_masks=null,$mask_position=null){\n return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());\n }", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function create()\n {\n //\n\t\treturn View::make('photos.create');\n }", "public function create($group)\n {\n $view = view(\"groups.photos.create\");\n $view->group_id = $group;\n return $view;\n }", "public function create($request) {\n\n\t\t$image = $request['photo'];\n\t\tif($image !== null) {\n\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t$request['photo'] = $name;\n\t\t} else {\n\t\t\t$request['photo'] = \"product-empty.png\";\n\t\t}\n\t\t$request['user_id'] = auth()->user()->id;\n\t\treturn $this->product->create($request);\n\t}", "public function create()\n {\n $albums = Album::all();\n return view('image.create')->with(['albums' => $albums]);\n }", "public function store($user_id, Request $request)\n {\n\n //data validation\n $validatedData = $request->validate([\n 'title' => 'required|max:512',\n 'picture' => 'required',\n ]);\n\n $last_id = Post::get()->last()->id;\n\n $post = new Post;\n $post->title = $validatedData['title'];\n $post->user_id = $user_id;\n\n $post->save();\n\n if(!is_null($request['tag_checkbox_1']))\n {\n $post->tags()->attach($request['tag_checkbox_1']);\n }\n\n if(!is_null($request['tag_checkbox_2']))\n {\n $post->tags()->attach($request['tag_checkbox_2']);\n }\n\n $post->image()->delete();\n $post->image()->create(['filename' => $validatedData['picture']]);\n\n session()->flash('message', 'Post created successfully');\n\n return $this->show_per_user($user_id);\n }", "public function store()\n {\n $photo = Photo::create($this->validateRequest());\n return redirect('recitals/photos');\n }", "public function photoCreate()\n {\n $gallery_id = Input::get('gallery_id');\n $gallery = PhotoGallery::where('id', '=', $gallery_id)->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $flags = $this->language->getAllDataNoPagination();\n\n return view('cms.modules.multicms.photos_addnew', compact('flags', 'gallery'), $data);\n\n }", "public function create()\n\t{\n\t\t$userGroupId = $this->data('name', $this->request->post('name'))->insert($this->table)->lastId();\n\n\t\t// Remove any empty value in the array\n\t\t$pages = array_filter($this->request->post('pages'));\n\n\t\tforeach ($pages as $page) {\n\t\t\t$this->data([\n\t\t\t\t'user_groups_id' => $userGroupId,\n\t\t\t\t'page' => $page,\n\t\t\t])->insert('users_permissions');\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$input = Input::all();\n\n\t\t$image = new Photo();\n\t\t$image->user_id \t= $input['user_id'];\n\t\t$image->fileName \t= $input['fileName']->getClientOriginalName();\n\t\t$image->title \t\t= $input['title'];\n\t\t\n\t\tif($image->save()){\n\t\t\t\n\t\t\t$path = user_photos_path();\n\n\t\t\t$move_image = Image::make($input['fileName']->getRealPath());\n\n\t\t\tFile::exists($path) or File::makeDirectory($path);\n\n\t\t\t$move_image->save($path.$image->fileName)\n\t\t\t\t\t->resize(200,200)\n\t\t\t\t\t->greyscale()\n\t\t\t\t\t->save($path. 'tn-'.$image->fileName);\n\n\t\t\treturn Redirect::to('photos');\t\n\t\t}else{\n\t\t\treturn Ridirect::to('photos.create');\n\t\t}\n\t\n\t}", "public function create(Request $request)\n {\n $disciplines = Discipline::query()\n ->select('id', 'name')\n ->with('events')\n ->get()\n ->toArray();\n $watermarks = Watermark::query()->pluck('name', 'id');\n $licenses = License::query()->pluck('name', 'id');\n\n // Creates a random form session number\n $formSession = md5(microtime());\n Session::push('uploads.' . $formSession, time());\n // Create temp folders\n File::makeDirectory(public_path(UPLOAD_TEMP_FOLDER . $formSession));\n File::makeDirectory(public_path(UPLOAD_TEMP_FOLDER . $formSession . '/big'));\n\n return view('member/photos/create', [\n 'pageTitle' => 'Nouvelle photo',\n 'disciplines' => $disciplines,\n 'watermarks' => $watermarks,\n 'licenses' => $licenses,\n 'event' => $request->get('event'),\n 'formSession' => $formSession,\n ]);\n }", "function create_album($name, $cover_photo)\n {\n $conn = db_connect();\n\n $user_id = $_SESSION['user_id'];\n //created an album based on the user's id and the parameters they provided\n \t$sql = \"INSERT INTO album (album_name, cover_photo, user_id) VALUES \n \t('$name', '$cover_photo', '$user_id')\";\n\n \tmysqli_query($conn, $sql);\n\n \techo '<h2>Your album was created!</h2>';\n\n }", "public function store(Request $request)\n {\n $foods = $request->get('foods');\n\n $price = 0;\n foreach ($foods as $food1) {\n $food = Food::find($food1['id']);\n $price += $food['quantity'] * $food['price'];\n };\n\n Log::info($request->get('category_id'));\n $set = Set::create([\n 'name' => $request->get('name'),\n 'type' => 1,\n 'category_id' => (int)$request->get('category_id'),\n 'price' => $price\n ]);\n\n foreach ($foods as $food){\n $set->foods()->attach($food['id'], ['quantity' => $food['quantity']]);\n }\n\n $image = $request['image']['file']['thumbUrl'];\n Cloudder::upload($image, null);\n $result = Cloudder::getResult();\n $image_id = $result['public_id'] . '.' . $result['format'];\n $set->image = $image_id;\n\n\n $set->save();\n//\n return $set->toJson();\n }", "public function store(Request $request)\n {\n //validate the request\n if (\\Gate::allows('isAdmin') || \\Gate::allows('isAuthor')) {\n if ($request->image) {\n $name = time() . '.' . explode('/', explode(':', substr($request->image, 0, strpos($request->image, ';')))[1])[1];\n $img = \\Image::make($request->image);\n $img->resize(600, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img->save(public_path('img/gallery/' . $name));\n $request->merge(['image' => $name]);\n }\n $this->validate($request, [\n 'title' => 'required|string|max:191',\n 'status' => 'required|integer|max:191',\n 'source' => 'required|string|max:500',\n 'image' => 'required|string|max:191',\n ]);\n //create the gallery\n Gallery::create([\n 'title' => $request->input('title'),\n 'status' => $request->input('status'),\n 'source' => $request->input('source'),\n 'image' => $request->input('image'),\n 'uploaded_by' => auth('api')->user()->id\n ]);\n }\n }", "protected function _createCidSet() {}", "public function create()\n {\n $this->data['pageHead'] = \"Add New Photo\";\n if ( $this->permission(4) ) {\n $this->data['authUser'] = $this->asUsualData()['authUser'];\n $this->data['asUsualData'] = $this->asUsualData();\n $this->data['dashboardData'] = $this->dashboardData();\n $this->data['classes'] = CourseClass::arrOfClassName();\n return view('admin.gallery.gallery_create', $this->data);\n }else{\n return view('admin.gallery.gallery_create', $this->data);\n }\n }", "public function addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "public function create()\n {\n $genres = Genre::all();\n $tags = Tag::all();\n $users = User::all();\n return view('album.create', compact(['genres', 'tags', 'users']));\n }", "public function store(Request $request)\n {\n // \\Log::info($request->all());\n $gallery = new Gallery;\n $picture = new Image;\n $gallery->name = request()->input('name');\n $gallery->description = request()->input('description');\n $gallery->user_id = request()->input('user_id'); \n $gallery->save();\n\n foreach ($request->input('image_url') as $image) {\n // \\Log::info($image);\n $gallery->images()->create(['image_url' => $image]);\n }\n return $gallery;\n }", "public function create()\n {\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $rootParent = $this->photoGallery->rootParentList();\n\n $dash = \"\";\n $dropdown = [ ];\n $galleryList = [ \"\" => 'Select Gallery' ] + $this->recur($rootParent, $dash, $dropdown);\n\n $flags = $this->language->getAllDataNoPagination();\n $galleryLg = $this->photoGalleryLg->getAllDataNoPagination();\n\n return view('cms.modules.multicms.photoGallery_addnew', compact('galleryList', 'galleryLg', 'flags'), $data);\n }", "public function creating(Tag $album): void\n {\n if (empty($album->user_id) && auth()->check()) {\n $album->user_id = auth()->id();\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'product_id' => 'required|integer',\n 'photo' => 'required|image|max:1024',\n 'is_default' => 'nullable|integer'\n ]);\n $data = $request->all();\n $data['photo'] = $request->photo->store('photo_product', 'public');\n $gallery = GalleryProduct::create($data);\n return response()->json($gallery);\n }", "public function store(PostsCreateRequest $request)\n {\n //\n $input = $request->all();\n $user = Auth::user();\n if($file = $request->file('photo_id'))\n {\n //grab the file name from client machine and append current dat and time to it, creating an unique name\n $tempname = time().$file->getClientOriginalName();\n //replace any blank spaces \n $name = str_replace(' ','',$tempname);\n //move the file to host machine i.e under public/images\n $file->move('images',$name);\n //Persist data('name') into Photo database\n $photo=Photo::create(['name'=>$name]);\n //grab the photo_id generated while persisting the photo into Photo Database(step above). \n $input['photo_id'] = $photo->id;\n }\n //encrypt the password\n $input['user_id'] = $user->id;\n //persist the data into User database\n Post::create($input);\n //redirect to view users page\n return redirect('/admin/posts');\n //return $request->all();\n }", "public function create()\n {\n return response()->view('admin.photos.create');\n }", "public function actionCreate()\n {\n $model = new Gallery();\n $file = new UploadForm();\n $file->imageFile = UploadedFile::getInstance($file, 'imageFile');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($file->upload($model->id, null, $file::TYPE_GALLERY)) {\n $model->image = $file->getNameImage($model->id, null, $file::TYPE_GALLERY);\n $model->save();\n } else {\n $model->image = null;\n $model->save();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', compact('file', 'model'));\n }\n }", "public function create()\n {\n $model = $this->createOrFind();\n $model->created_by = \\Auth::user()->id;\n if (!$model->sizes) {\n $model->sizes = serialize(config('base.images'));\n }\n if (!$model->images_types) {\n $model->images_types = serialize(config('base.images_types'));\n }\n\n $model->save();\n return view($this->view . '.create', compact('model'));\n }", "public function create()\n\t{\n\t\treturn View::make('photos.create');\n\t}", "public function create()\n {\n return view('gallery.albums.create');\n }", "public function create()\n {\n \n return view('photos.create');\n }", "public static function create_by_user($a_user_id){\n\n\t\t$request = self::_get_connection()->select(\"SELECT ID from `apine_images` where user_id=$a_user_id\");\n\t\t$liste = new Liste();\n\t\tif($request != null && count($request) > 0){\n\t\t\tforeach($request as $item){\n\t\t\t\t$liste->add_item(new ApineImage($item['ID']));\n\t\t\t}\n\t\t}\n\t\treturn $liste;\n\t\n\t}", "public function postAdd($setId) \n\t\t{\n\t\t\t$validator = Validator::make(Input::all(),\n\t\t\t\tarray(\n\t\t\t\t\t'oTitle' \t=> 'required|max:50|min:5',\n\t\t\t\t\t'oDesc'\t=> 'max:500|min:5'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif($validator->fails()) \n\t\t\t{\n\t\t\t\treturn Redirect::back()\n\t\t\t\t\t->withErrors($validator)\n\t\t\t\t\t->withInput(); \n\t\t\t\t\t // redirect with inputs\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t//Get value from Input\n\t $title = Input::get('oTitle');\n\t $desc = Input::get('oDesc');\n\n\t\t\t\t// Create a new user in the database...\n\t //$img = Input::file('setThumb');\n\t $img = $_FILES[\"objectThumb\"];\n\n\t $language = Set::find($setId)->language;\n\n\t\t\t\t$create = Object::create(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'set_id' => $setId,\n\t\t\t\t\t\t\t\t\t'title' => $title,\n\t\t\t\t\t\t\t\t\t'desc' => $desc,\n\t\t\t\t\t\t\t\t\t'language' => $language\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif($create) \n\t\t\t\t{\n\t\t\t\t\t//Get objectId, lastest if of inserted\n\t\t\t\t\t$objectId = $create->id;\n\t\t\t\t\t// upload Object thumbnail\n\t\t\t\t\tMimg::uploadObjectThumbnail($img,$objectId);\n\n\t\t\t\t\t//Event::fire('object.create',$create->id);\n\n\t\t\t\t\t$data[\"authId\"] = Auth::id();\n\t\t\t\t\t$data[\"setId\"] = $create->id;\n\n\t\t\t\t\treturn Redirect::back()\n\t\t\t\t\t\t->with('message', 'Tạo chủ đề thành công');\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\treturn Redirect::back()\n\t\t\t\t\t\t->with('global', 'Lỗi, xin vui lòng liên hệ Admin.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "public function store(CreatePhotoServicesRequest $request)\n\t{\n\t $request = $this->saveFiles($request);\n\t\tPhotoServices::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.photoservices.index');\n\t}", "public function create($id)\n {\n auth()->user()->can('master-policy.perform',['gallery','add']);\n $gallery = $this->gallery->find($id);\n return view('admin.gallery.uploadImages')->withGallery($gallery);\n }", "public function store(Request $request)\n { \n $owner = $this->photoService->getUserByPhotoId($request->photo_id);\n $owner === $request->user()->id ? $request->owner = \"1\" : $request->owner = \"0\";\n\n $request->user_id = $request->user()->id;\n $this->stageService->createStage($request);\n\n $form = $this->stageService->getCurrentStageById($request->user_id);\n return $this->responseOK($form);\n }", "public function actionCreate()\r\n {\r\n $model = new PhotoAlbum;\r\n\r\n // Uncomment the following line if AJAX validation is needed\r\n // $this->performAjaxValidation($model);\r\n\r\n if (isset($_POST['PhotoAlbum'])) {\r\n $model->attributes = $_POST['PhotoAlbum'];\r\n if ($model->save()) {\r\n if (Yii::app()->request->isAjaxRequest) {\r\n exit(CJSON::encode(array(\r\n 'status' => 'success',\r\n 'message' => \"PhotoAlbum successfully added\"\r\n )\r\n ));\r\n\r\n } else\r\n $this->redirect(array('view', 'id' => $model->id));\r\n }\r\n }\r\n\r\n $model->uid = user()->getId();\r\n\r\n if (Yii::app()->request->isAjaxRequest) {\r\n exit(CJSON::encode(array(\r\n 'status' => 'failure',\r\n 'form' => $this->renderPartial('_form', array('model' => $model), true)\r\n )\r\n )\r\n );\r\n\r\n } else\r\n $this->render('create', array('model' => $model,));\r\n\r\n }", "public function store(UserRequest $request)\n {\n\n if($request->hasFile(\"image\")){\n $filename = $request->file(\"image\")->getClientOriginalName();\n $filesave = $request->file(\"image\")->storeAs(\"public/images\", $filename);\n $image = Photo::create([\"name\"=>$filename]);\n }else{\n $photo_id = \"\";\n }\n $photo_id = $image->id;\n $user = User::create([\"name\"=>$request->get(\"name\"), \"is_active\"=>$request->get(\"is_active\"), \"email\"=>$request->get(\"email\"), \"role_id\"=>$request->get(\"role\"), \"photo_id\"=>$photo_id,\"password\"=>bcrypt($request->get(\"password\"))]);\n return view(\"admin.users.index\")->with(\"message\", \"New User successfully added!\");\n }", "public function store(PostsCreateRequest $request)\n {\n //\n $input= $request->all();\n $user= Auth::user();\n //return $user;\n if($file= $request->file('photo_id')){\n\n $name= time() .$file->getClientOriginalName();\n $file->move('images', $name);\n $photo = Photo::create(['file' =>$name]);\n $input['photo_id'] = $photo->id;\n }\n //usefull to create post and inject it in the user post table by using the relationship\n $user->posts()->create($input);\n // Post::create($input);\n return redirect('/admin/posts');\n\n }", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "public function store($user_id)\n {\n request()->validate([\n 'title' => 'required',\n 'catagories' => 'required',\n 'post' => 'required',\n 'image' => 'mimes:jpg,png,jpeg|max:1048576'\n ]);\n\n if (request('premium') === \"true\") {\n $premium = true;\n } else {\n $premium = false;\n }\n\n\n if (request('image')) {\n\n $newImageName = time() . '-' . request('title') . '.' . request('image')->extension();\n request('image')->move(public_path('images'), $newImageName);\n\n\n $image = new Images();\n $image->name = $newImageName;\n $image->path = 'images/' . $newImageName;\n $image->save();\n }\n\n foreach (request('catagories') as $catagory) {\n // CR :: Catagories::firstOrCreate()\n if (Catagories::where('name', '=', $catagory)->count() <= 0 && $catagory) {\n $DBcatagory = new Catagories();\n $DBcatagory->name = $catagory;\n $DBcatagory->save();\n }\n }\n\n // CR :: dit zou wel mooier kunnen denk ik\n foreach (Catagories::all() as $DBcatagory) {\n foreach (request('catagories') as $request_catagory) {\n if ($DBcatagory->name == $request_catagory) {\n $post_catagories[] = $DBcatagory->id;\n }\n }\n }\n\n // CR :: je hebt toch al het user_id, waarom nog een keer ophalen?\n $users_DB = Users::where('id', $user_id)->first();\n $user_id = $users_DB->id;\n\n // CR :: Posts::create()\n $post = new Posts();\n $post->user_id = $user_id;\n $post->title = request('title');\n $post->body = request('post');\n if (request('image')) {\n $post->image_id = $image->id;\n } else {\n $post->image_id = NULL;\n }\n $post->premium = $premium;\n $post->save();\n\n $post->catagories()->sync($post_catagories);\n\n return redirect()->route('posts.overview', ['user_id' => $user_id]);\n }", "public function create()\n {\n $sets = \\App\\Set::all();\n $users = \\App\\User::all();\n\n if(\\Auth::user()->is(\"Administrator\") || \\Auth::user()->is(\"Redaktor\") || \\Auth::user()->is(\"Super Redaktor\"))\n {\n return view('backend/results.create', compact('sets', 'users'));\n }\n else\n {\n return redirect('frontwelcome');\n }\n\n \n }", "public function store(Request $request) {\n // Validates inputs as required\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required',\n 'photo' => 'required|image|max:1999|'\n ]);\n\n /* GET PHOTO */\n //Get full file\n $fileNameWithExt = $request->file('photo')->getClientOriginalName();\n // Get file name\n $fileName = pathinfo($fileNameWithExt, PATHINFO_FILENAME);\n //Get file extension\n $fileExt = $request->file('photo')->getClientOriginalExtension();\n // Compose final file\n $fileToUpload = $fileName . '_' . time() . '.' . $fileExt;\n // Upload image\n $path = $request->file('photo')->storeAs('public/photos/'.$request->input('album_id'), $fileToUpload);\n\n /* MAKE NEW ALBUM */\n $photo = new Photo;\n $photo->album_id = $request->input('album_id');\n $photo->title = $request->input('title');\n $photo->description = $request->input('description');\n $photo->size = $request->file('photo')->getClientSize();\n $photo->photo = $fileToUpload;\n $photo->save();\n\n return redirect('/albums/'.$request->input('album_id'))->with('success', 'Photo Uploaded');\n }", "public function create()\n {\n return view('back.photo.create'); \n }", "public function actionCreate()\n\t{\n\t\t$model=new Photo;\n\t\tif(isset($_POST['Photo']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Photo'];\n if (!empty($_POST['Photo']['subcategoryArr']))\n $model->subcategory = implode(\",\", $_POST['Photo']['subcategoryArr']);\n if (!empty($_POST['Photo']['sizesArr']) && $_POST['Photo']['size'] == 1)\n $model->sizes = implode(\",\", $_POST['Photo']['sizesArr']);\n if (!empty($_POST['Photo']['colorArr']))\n $model->color = implode(\",\", $_POST['Photo']['colorArr']);\n\t\t\tif($model->save()){\n\t\t\t\t$this->redirect('/admin/photo/create');\n }\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function create(){\n\t\t\t//getting default circle\n\t\t\t$def_circle = $this->circle_model->get_Circle(\"cursos\");\n\t\t\t$id = new MongoID($def_circle['_id']);\n\t\t\t\n\t\t\t$document = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'acl' => array(\n\t\t\t\t//asignamos el circulo cursos por default\n\t\t\t\t0 => array('circle' => $id)\n\t\t\t\t)\n\t\t\t);\t\t\n\t\t\t$this->user_model->add_User($document);\n\t\t}", "public function run()\n {\n $user = [\n 1 => [\n 'link' => 'photos/reebook.png',\n 'product_id' => 1,\n ],\n 2 => [\n 'link' => 'photos/reebook.png',\n 'product_id' => 1,\n ],\n ];\n foreach ($user as $value) {\n ProductPhoto::firstOrCreate($value);\n }\n }", "public function executeCreate(sfWebRequest $request) {\n $this->forward404Unless($this->getUser()->getGuardUser()->getType() != 3);\n $this->forward404Unless($request->isMethod(sfRequest::POST));\n $collectionId = sfToolkit::getArrayValueForPath($request->getParameter('asset_group'), 'parent_node_id');\n\n $this->form = new AssetGroupForm(null, array(\n 'creatorID' => $this->getUser()->getGuardUser()->getId(),\n 'collectionID' => $collectionId));\n $this->collection = Doctrine_Query::Create()\n ->from('Collection c')\n ->select('c.*')\n ->where('c.id = ?', $collectionId)\n ->fetchOne();\n\n $this->processForm($request, $this->form);\n\n $this->setTemplate('new');\n }", "public function store(Requests\\StoreUserRequest $request)\n {\n $input = $request->all();\n\n $input['profile_photo'] = 'default.jpg';\n\n if ($request->hasFile('profile_photo') && $request->file('profile_photo')->isValid()) {\n $input['profile_photo'] = $this->photoUpload($request);\n }\n\n $input['password'] = bcrypt($request['password']);\n\n $user = User::create($input);\n\n if ($input['profile_photo'] != 'default.jpg') {\n $photo = new Photo(['file_name' => $input['profile_photo']]);\n $user->photos()->save($photo);\n }\n\n return redirect('admin/users')->with('message', 'User successfully created!');\n }", "public function actionCreate()\n {\n $model = new User;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // получаем изображение для последующего сохранения\n $file = UploadedFile::getInstance($model, 'image');\n if ($file && $file->tempName) {\n $fileName = self::_saveFile($model, $file);\n if ($fileName) {\n $model->image = $fileName;\n } else {\n // уведомить пользователя, админа о невозможности сохранить файл\n }\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n MainFunctions::register('Добавлен пользователь ' . $model->name);\n return $this->redirect(['view', 'id' => $model->_id]);\n } else {\n return $this->render('create', ['model' => $model]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(Request $request)\n {\n $gallery = $request->isMethod('put') ? Gallery::findOrFail($request->id) : new Gallery;\n\n $gallery->id = $request->input('id');\n $gallery->account_id = $request->input('account_id');\n //$gallery->asset_id = (Job::select('asset_id')->find($request->input('job_id')))->asset_id;\n $gallery->asset_id = 1;\n $gallery->job_id = $request->input('job_id');\n // $gallery->date = $request-> Carbon::parse($request->input('date'));\n $gallery->image = $this->manageImages($request->input('image'), $gallery->image);\n $gallery->description = $request->input('description');\n $gallery->created_by = $request->input('created_by');\n $gallery->updated_by = $request->input('updated_by');\n \n if($gallery->save()) \n {\n return new GalleryResource($gallery);\n }\n }", "public function create(array $data)\n {\n $geoloc = $data['geoloc'];\n $geoloc = str_replace([\"(\", \")\"], \"\", $geoloc);\n $geoloc = explode(\",\", $geoloc);\n $geoloc[0] = (Double)($geoloc[0]);\n $geoloc[1] = (Double)($geoloc[1]);\n\n $ville = Ville::firstOrCreate([\n 'nom' => $data['ville'],\n 'wilaya' => $data['wilaya'],\n 'longitude' => $geoloc[0],\n 'latitude' => $geoloc[1],\n ]);\n $user = User::create([\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'nom' => ucfirst($data['nom']),\n 'prenom' => ucfirst($data['prenom']),\n 'genre' => $data['genre'],\n 'date_nais' => $data['date_nais'],\n 'num_tel' => $data['num_tel'],\n 'ville_id' => $ville->getAttribute('id'),\n 'pref_musique' => $data['pref_musique'],\n 'pref_animeaux' => $data['pref_animeaux'],\n 'pref_discussion' => $data['pref_discussion'],\n 'pref_fumeur' => $data['pref_fumeur'],\n 'description' => $data['description'],\n ]);\n if (Input::file('photo')) {\n $destination = '../storage/app'; // path\n $fileName = $user->getAttribute('id') . '.jpg'; // renameing image\n Input::file('photo')->move($destination, $fileName);\n // redimensionner\n $largeur = 64;\n $hauteur = 64;\n $image = imagecreatefromjpeg($destination.'/'.$fileName);\n $taille = getimagesize($destination.'/'.$fileName);\n\n $sortie = imagecreatetruecolor($largeur,$hauteur);\n $coef = min($taille[0]/$largeur,$taille[1]/$hauteur);\n\n $deltax = $taille[0]-($coef * $largeur);\n $deltay = $taille[1]-($coef * $hauteur);\n\n imagecopyresampled($sortie,$image,0,0,$deltax/2,$deltay/2,$largeur,$hauteur,$taille[0]-$deltax,$taille[1]-$deltay);\n imagejpeg($sortie,$destination.'/mini_'.$fileName);\n }\n return $user;\n }", "protected function create()\n {\n $this->preCreate();\n if ($this->owner_resource) {\n $api_owner = $this->owner_resource;\n $this->data = $this\n ->api\n ->$api_owner($this->owner_id)\n ->create($this->data)[static::$api_name];\n } else {\n $this->data = $this->api->create($this->data)[static::$api_name];\n }\n $this->id = $this->data['id'];\n $this->postCreate();\n\n return $this;\n }", "public function create()\n {\n\n $category = Gallery_category::all();\n\n // echo \"<pre>\";\n // print_r($category);\n // die();\n\n\n return view('backend.photo.create', get_defined_vars());\n }", "public function setUp(): void\n {\n parent::setUp();\n $user = factory(User::class)->create();\n // Create album with 5 pictures in each.\n factory(Album::class)->create(['user_id' => $user->id])\n ->each(function ($album) use ($user) {\n $album->pictures()->attach(factory(Picture::class, 5)->create(['user_id' => $user->id]));\n });\n }", "public function create()\n {\n return view('fotos.create');\n }", "public function create()\n {\n //\n\n $user_id = Auth::id();\n\n $profileimage = Application::where('user_id', $user_id)->first();\n return view('uploads.create')->with('profileimage',$profileimage);\n }", "function createUsers(){\n\n\t\t\n\t\t\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute\n\t}", "public function store(Requests\\UsersRequest $request)\n {\n $this->checkAccess('create');\n $input = $request->only([\n 'username','name','email','photo','group_id'\n ]);\n\n $input['password'] = bcrypt($request->get['password']);\n\n if ($request->hasFile('photo')) {\n $input['photo'] = (new \\ImageUpload($request))->upload();\n }\n\n $query = $this->model->create($input);\n\n $result = $query->id;\n $save_continue = \\Input::get('save_continue');\n $redirect = empty($save_continue) ? $this->url : \n $this->url.'/'.$result.'/edit';\n\n return redirect()->to($redirect)->with('message', \n $this->title.' berhasil dibuat.'\n );\n }", "public function addPhoto($file){\r\n\t\t$XMLObject = $this->getXMLObject();\r\n\t\tif($uid = $this->access->getUserId()){\r\n\t\t\t$img = new Image($file);\r\n\t\t\tif($img->isImage()){\r\n\t\t\t\t$w = $img->getWidth();\r\n\t\t\t\t$h = $img->getHeight();\r\n\t\t\t\t$d = $img->getDimensions($w, $h);\r\n\t\t\t\t$query = 'INSERT INTO blog_photos (user_id, width, height) VALUES ('.(int)$uid.', '.$d['width'].', '.$d['height'].')';\r\n\t\t\t\tif(DB::query($query)){\r\n\t\t\t\t\t$bln_success = FALSE;\r\n\t\t\t\t\t$pid = DB::insertId();\r\n\t\t\t\t\t//create image:\r\n\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_THUMB, MAX_PHOTO_WIDTH_THUMB, Utils::getPhotoPath($uid,$pid,'thumb','blog'))){//Thumb\r\n\t\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_MEDIUM, MAX_PHOTO_HEIGHT_MEDIUM, Utils::getPhotoPath($uid,$pid,'medium','blog'))){//Medium\r\n\t\t\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_LARGE, MAX_PHOTO_HEIGHT_LARGE, Utils::getPhotoPath($uid,$pid,'large','blog'))){//Large\t\r\n\t\t\t\t\t\t\t\t$bln_success = TRUE;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!$bln_success){\r\n\t\t\t\t\t\t$this->removePhoto($pid);\r\n\t\t\t\t\t\tparent::throwError($img->errorNo, $img->errorMessage);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else $this->throwError(7);\r\n\t\t\t}else parent::throwError($img->errorNo, $img->errorMessage);\r\n\t\t\t$img->destroy();\r\n\t\t}else $this->throwError(10);\r\n\t\treturn $XMLObject;\r\n\t}", "public function store(PhotoSessionRequest $request)\n {\n $user = User::findOrFail($request->client);\n $photosession = PhotoSession::create([\n 'user_id' => $request->client,\n 'title' => $request->title,\n 'category' => $request->category,\n 'date' => $request->date,\n 'photo_download_limit' => $request->photo_download_limit,\n 'expiry_date' => $request->expiry_date,\n ]);\n\n $user->photosessions()->save($photosession);\n\n flash()->success('Nice one! :)', 'You have successfully created a new Photosession!');\n return redirect('/admin/photosessions/' . $photosession->id . '/edit');\n }", "public function create($data,$user_id,$photo){\n $customer = new Customer();\n $customer->name = strip_tags($data['name']);\n $customer->address = strip_tags($data['address']);\n $customer->fonction = strip_tags($data['fonction']);\n $customer->wilaya = strip_tags($data['wilaya']);\n $customer->commune = strip_tags($data['commune']);\n $customer->type = $data['type'];\n $customer->photo=$photo;\n $customer->id = $user_id;\n $customer->save();\n }", "public function createGallery($name_gallery,$is_private=false,$password=false){\n $this->nameGallery = $name_gallery;\n if($is_private || $password){\n $this->isPrivate = true;\n }\n if(!$password){ $password = \"\"; }\n \n $query = \"insert into gallery (ui_id_user,name,is_private,passwd,num_photos) values \" . \n \"(\" . $this->idUser . \",'\" .$this->nameGallery.\"',\" . $this->isPrivate . \",'\" .\n $password . \"',0);\";\n $insertGalleryResult = $this->oPhoto->dm->makeQuery($query);\n \n $this->logger->put(\"<Gallery::createGallery($name_gallery,$is_private,$password)> \" .\n \" query[ \" . $query . \"] : \" . $insertGalleryResult );\n \n $this->idGallery = $this->oPhoto->dm->getVar(\"select last_insert_id();\");\n \n $this->logger->put(\"<Gallery::createGallery()> new id gallery: \" . $this->idGallery);\n \n return $this->idGallery;\n }", "public function create($album_id) {\n // Find album with the id passed\n $album = Album::find($album_id);\n // If logged in user id matches user_id of album\n if(auth()->user()->id != $album->user_id) {\n return redirect('/albums/'.$album_id)->with(\"error\", \"You\\'re Unauthorized to Upload Photo to this Album\");\n }\n return view('photos.create')->with('album_id', $album_id);\n }", "public function store()\n\t{\n\t\t// get the user's id and the group name\n\t\t$userid = Auth::user() -> id;\n\t\t$input = Input::json();\n\t\t$groupname = $input -> get('groupname');\n\n\t\t// create the group\n\t\t$group = Group::create(array(\n\t\t\t'user_id' => $userid,\n\t\t\t'groupname' => $groupname\n\t\t));\n\n\t\t// add the creator to the group\n\t\t$group -> addUser($userid);\n\n\t\t// log the request\n\t\tLog::info('Group created', array(\n\t\t\t'userid' => $userid,\n\t\t \t'groupname' => $groupname\n\t\t));\n\t}", "public function add($data)\n {\n return PhotoGalleryLg::create($data);\n }", "function photos_setPerms ($photo_id, $is_public = 1, $is_friend = 0, $is_family = 0, $perm_comment = 3, $perm_addmeta = 3) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setPerms', 'photo_id' => $photo_id, 'is_public' => $is_public, 'is_friend' => $is_friend, 'is_family' => $is_family, 'perm_comment' => $perm_comment, 'perm_addmeta' => $perm_addmeta));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function create($pks) {\n \n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n \n // Get data about user from table \"users\"\n $query\n ->select(\"a.id, a.name\")\n ->from($db->quoteName(\"#__users\") . \" AS a\")\n ->where(\"a.id IN (\".implode(\",\", $pks).\")\");\n \n $db->setQuery($query);\n $results = $db->loadAssocList(\"id\");\n \n // Preparing data for inserting\n $values = array();\n foreach($results as $result) {\n $values[] = $db->quote($result[\"id\"]).','.$db->quote($result[\"name\"]).','.$db->quote(JApplication::stringURLSafe($result[\"name\"])) ;\n }\n \n $query = $db->getQuery(true);\n $query\n ->insert($db->quoteName(\"#__itpsc_profiles\"))\n ->columns( $db->quoteName(array(\"id\", \"name\", \"alias\")) )\n ->values($values);\n \n $db->setQuery($query);\n $db->query();\n \n }", "public function store(Request $request)\n {\n // \n\n $input = $request->all();\n $user = auth()->user();\n $photos = Photo::where(['user_id' => auth()->user()->id])->orderBy('created_at', 'desc')->get(); \n\n if($file = $request->file('photo_id')){\n $name = time() . $file->getClientOriginalName();\n $file->move('images/' . auth()->user()->id . '/', $name);\n $photo = Photo::create(['photo' => $name, 'user_id' => auth()->user()->id]);\n $input['photo_id'] = $photo->id;\n\n }\n\n if ($cover_image = Photo::where(['photo' => str_replace('/images/' . auth()->user()->id . '/', '', request()->cover_photo)])->first()) {\n $input['photo_id'] = $cover_image->id;\n }\n\n $draft = $user->drafts()->create($input);\n \n\n return redirect('/draft');\n }", "public function createFileSet() {\n $this->fileset = new TarFileSet();\n $this->filesets[] = $this->fileset;\n return $this->fileset;\n }", "public function create()\n {\n $user = UserDetail::findOrFail(Session::get('id'));\n\n // TODO: displayed areas should be that are not assigned maps\n $areas = Area::all();\n\n return view('admin.area-images.create', compact('areas', 'user'));\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function create()\n {\n return view('gallery::admin.albums.create');\n }", "public function store(Request $request, $id)\n {\n auth()->user()->can('master-policy.perform',['gallery','add']);\n $data = $request->except(['file']);\n $file = $request->file('file');\n $file_name = time().\"_\".$file->getClientOriginalName();\n $data['gallery_id'] = $id;\n $data['image'] = 'galleryImages/'. $id. '/' .$file_name;\n Storage::put('galleryImages/'.$id.'/'.$file_name, file_get_contents($file->getRealPath()));\n\n $this->image->create($data);\n }", "public function create()\n {\n $galleryAlbums = GalleryAlbum::with(['category'])->get();\n return view('admin_dashboard.gallery.image.create', compact(['galleryAlbums']));\n }", "public function store(PictureRequest $request)\n {\n //\n $id = Auth()->user()->id;\n $validatedData = $request->validated();\n $data = [\n \"user_id\" => $id,\n \"title\" => $validatedData[\"title\"],\n \"photos\" => $validatedData[\"photos\"],\n \"photoCount\" => count($validatedData[\"photos\"]),\n \"photoTag\" => Str::slug($validatedData[\"title\"])\n ];\n\n Picture::create($data);\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Photos uploaded successfully\",\n \"data\" => array(\n \"user_id\" => $data[\"user_id\"],\n \"title\" => $data[\"title\"],\n \"photos\" => $data[\"photos\"]\n )\n ],StatusCodes::SUCCESS);\n }", "public function store(Request $request)\n {\n $input = $request->all();\n $user = Auth::user();\n\n\n if ($user) {\n $input['user_id'] = $user->id;\n $products = new Product();\n\n if ($file = $request->file('photo_id')) {\n $year = date('Y');\n $month = date('m');\n $day = date('d');\n $sub_folder = $year . '/' . $month . '/' . $day . '/';\n $upload_url = 'images/' . $sub_folder;\n\n if (!File::exists(public_path() . '/' . $upload_url)) {\n File::makeDirectory(public_path() . '/' . $upload_url, 0777, true);\n }\n\n $name = time() . $file->getClientOriginalName();\n\n\n $file->move($upload_url, $name);\n\n $photo = Photo::create(['file' => $upload_url . $name]);\n\n\n $input['photo_id'] = $photo->id;\n }\n\n $products->create($input);\n\n\n return redirect('admin/products');\n } else {\n return view(\"errors.submit-error\", [\"data\" => \"Please login as administrator!\"]);\n }\n }", "public function createOwner();", "public function store(Request $request)\n {\n $data = $request->except('user_id');\n $data['user_id_report'] = Auth::user()->id;\n $data['lng'] = Session::get('userLng');\n $data['lat'] = Session::get('userLat');\n $photo = new Photo();\n if ($file = $request->file('photo')) {\n $data['photo_id'] = $photo->photoUpload($request->file('photo'), 'raport_', '0', Auth::user()->id);\n }\n Raport::create($data);\n return redirect('/');\n }", "public function uploadPhoto($currentAlbumId, $currentUserID, $photoName, $shortDescription, $placeTaken, $selectedCategories, $writtenTags, $photoFile, $titlePhoto,$users){\n\n $insertedPhotoId = 'nothing to upload';\n\n // upload photo to server\n if (!empty($photoFile)){\n\n foreach($photoFile as $file) {\n $destinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n if($fileSize <= 1024*1024*10){\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n //upload photo in database\n $insertedPhotoId = DB::table('photos')->insertGetId(\n array('photo_name' => $photoName,\n 'photo_short_description' => $shortDescription,\n 'photo_taken_at' => $placeTaken,\n 'album_id' => $currentAlbumId,\n 'user_id' => $currentUserID,\n 'photo_size' => $fileSize\n )\n );\n\n UserAction::add('Photo \"' . $photoName . '\" was uploaded');\n\n $explodedTags = preg_replace(\"/[^\\w\\ _]+/\", '', $writtenTags); // strip all punctuation characters, news lines, etc.\n $explodedTags = preg_split(\"/\\s+/\", $explodedTags); // split by left over spaces\n $tagLine = \"\";\n for($i=0; $i<sizeOf($explodedTags); $i++)\n $tagLine = $tagLine.$explodedTags[$i].\", \";\n $tagLine = substr($tagLine, 0, -2);\n\n DB::insert('insert into photo_tags (photo_id, tags) values (?,?)', array($insertedPhotoId, $tagLine));\n\n\n\n $upload_success = $file->move($destinationPath, $insertedPhotoId.\".\".$extension);\n if($upload_success){\n //makes photo thumb\n $fileForThumb = $destinationPath.\"/\".$insertedPhotoId.\".\".$extension;\n App::make('phpthumb')\n ->create('resize', array($fileForThumb, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", $insertedPhotoId.\"_thumb.\".$extension);\n\n DB::update('update photos set\n photo_destination_url = ?,\n photo_thumbnail_destination_url = ?\n where photo_id = ?',\n array(\n $destinationPath.\"/\".$insertedPhotoId.\".\".$extension,\n $destinationPath.\"/\".$insertedPhotoId.\"_thumb.\".$extension,\n $insertedPhotoId));\n }\n\n //add categories\n for($i = 0; $i < sizeOf($selectedCategories); $i++){\n $catId = DB::select('select * from categories where category_name = ?', array($selectedCategories[$i]));\n if($catId)\n DB::table('photo_categories')->insert(\n array(\n 'photo_id' => $insertedPhotoId,\n 'category_id' => $catId[0]->category_id,\n )\n );\n }\n //add users\n $ob = new User();\n foreach($users as $user){\n if($user != \"\"){\n $usId = $ob->getUserNameById($user);\n $photoP = DB::insert('insert into photo_people (photo_id, user_id) values (?,?)',array($insertedPhotoId,$usId));\n }\n }\n\n //-----------------Editing album title photo data---------------------//\n //if 'make uploaded photo to title album photo' property is selected\n if($titlePhoto){\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //gets current photo url\n $newTitlePhoto = DB::table('photos')->where('photo_id', $insertedPhotoId)->get();\n if($newTitlePhoto){\n\n //photo\n $photo = null;\n $photo = $newTitlePhoto[0]->photo_destination_url;\n if($photo != null ){\n if(is_file($photo)){\n $photoExtension = File::extension($photo);\n $newPhoto = $destinationPath.\"/title_\".$currentAlbumId.\".\".$photoExtension;\n File::copy($photo, $newPhoto);\n $photo = $newPhoto;\n }\n }\n\n //thumb\n $photoThumb = null;\n $photoThumb = $newTitlePhoto[0]->photo_thumbnail_destination_url;\n if($photoThumb != null){\n if(is_file($photoThumb)){\n $thumbExtension = File::extension($photoThumb);\n $newPhotoThumbUrl = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$thumbExtension;\n File::copy($photoThumb, $newPhotoThumbUrl);\n $photoThumb = $newPhotoThumbUrl;\n }\n }\n else if($photoThumb == null && is_file($photo) != null){\n App::make('phpthumb')\n ->create('resize', array($photo, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$photoExtension);\n $photoThumb = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$photoExtension;\n }\n\n //insert uploaded/unuploaded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $photo,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n }\n }\n return $insertedPhotoId;\n }", "public function create()\n\t{\n\t\t$artistList = Artist::orderBy('display_name')->lists('display_name', 'id');\n\t\t$categoryList = Category::orderBy('name')->lists('name', 'id');\n\t\t$imageTypeList = ImageType::orderBy('name')->lists('name', 'id');\n\t\t$path = $_SERVER[\"DOCUMENT_ROOT\"].'/public/img/watermarks/';\n\t\tif(file_exists($path) && is_dir($path)){\n\t\t\t$result = scandir($path);\t\n\t\t\t$files = array_diff($result, array('.', '..'));\n\t\t\tif(count($files) > 0){\n\t\t\t\t$n = 0;\n\t\t\t\tforeach($files as $file){\n if(is_file(\"$path/$file\")){\n\t\t\t\t\t\t\t\t\t$filenamelist[$n] = $file;\n\t\t\t\t\t\t\t\t\t$n++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\techo \"ERROR: The directory does not exist.\";\n\t\t}\n\t\treturn View::make('admin.photo.create', compact('artistList', 'categoryList', 'imageTypeList', 'filenamelist'));\n\t}", "public static function upload(UploadInterface $file, $userId)\n {\n if (parent::whereUserId($userId)->count() > 3) {\n throw new UserPhotoLimitException;\n }\n\n \t$file->store();\n\n \tparent::create([\n \t\t'user_id' => $userId,\n \t\t'path' => $file->getFileName()\n \t]);\n }", "public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function create()\n\t{\n\t\tif(Auth::user())\n\t\t{\n\t\t\t// $cat = DB::table('categories')->lists('desc', 'id_cat');\n\t\t\t$block = DB::table('blocks')->lists('id_block', 'id_block');\n\t\t\treturn View::make('dashboard.imgs.create', compact('block'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('/login');\n\t\t}\n\t}" ]
[ "0.5859416", "0.5695981", "0.5670443", "0.5606731", "0.5290574", "0.5285441", "0.52847236", "0.5263133", "0.5246096", "0.5227062", "0.522608", "0.52151823", "0.5202057", "0.5195578", "0.5190853", "0.5186903", "0.51649785", "0.5164225", "0.51553214", "0.5144366", "0.51269615", "0.51257724", "0.5123117", "0.51154864", "0.51121914", "0.51100445", "0.51078683", "0.51023287", "0.5098634", "0.5091095", "0.50885874", "0.5083767", "0.5081822", "0.506082", "0.50606763", "0.5046054", "0.50368994", "0.5031833", "0.50172645", "0.50046235", "0.5003625", "0.49850035", "0.49789426", "0.49760565", "0.49623942", "0.49483004", "0.49468192", "0.4945691", "0.4943137", "0.49392304", "0.49388897", "0.4936678", "0.49354643", "0.49271137", "0.49181426", "0.49163666", "0.49125743", "0.4911068", "0.4909823", "0.48938656", "0.4892542", "0.4883931", "0.48797953", "0.48765504", "0.48730233", "0.4872291", "0.48567805", "0.48533562", "0.48517153", "0.48465338", "0.48413172", "0.48413047", "0.4840299", "0.483971", "0.48376578", "0.48366758", "0.4816445", "0.48061073", "0.48026356", "0.4796523", "0.47958598", "0.47953424", "0.47943243", "0.47928584", "0.4790619", "0.47885993", "0.47819108", "0.47803104", "0.47766382", "0.4770605", "0.47682956", "0.476407", "0.47625828", "0.4761256", "0.47595456", "0.47539616", "0.47515634", "0.47507837", "0.47507837", "0.4750589" ]
0.61232895
0
Modify the metadata for a photoset.
function photosets_editMeta ($photoset_id, $title, $description = NULL) { $params = array(); $params['method'] = 'flickr.photosets.editMeta'; $params['photoset_id'] = $photoset_id; $params['title'] = $title; if ($description) $params['description'] = $description; $response = $this->execute($params, 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMetadata($metadata) {}", "public function setMetadata($metadata) {}", "public function setMetaData($metaData);", "public function set_metadata ($metadata) {\n $this->metadata = $metadata;\n }", "public function setMetadata($metadata)\n {\n $this->metadata->set($metadata);\n }", "public function setMetadata($metadata)\n {\n $this->metadata = $metadata;\n }", "public function setMetadata($metadata)\n\t{\n\t\t$this->vars['metadata'] = $metadata;\n\t}", "function photos_setMeta ($photo_id, $title, $description) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setMeta', 'photo_id' => $photo_id, 'title' => $title, 'description' => $description));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function set_metadata($name, $value) {\n if ($name && $value)\n $this->metadata[$name] = $value;\n }", "public function setMetadata($metadata)\n {\n $this->metadata = $this->message['metadata'] = $metadata;\n }", "public function setMetadata($metadata)\n {\n return $this->set('metadata', $metadata);\n }", "public function setMetadata(array $metadata)\n {\n $this->_metadata = $metadata;\n }", "public function setMetadata(array $metadata)\n {\n $this->_metadata = $metadata;\n }", "function setMetadata(array $inMetadata = array()) {\n\t\tif ( $inMetadata !== $this->_Metadata ) {\n\t\t\t$this->_Metadata = $inMetadata;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setMetadata(array $metadata)\n {\n $this->metadata = $metadata;\n }", "function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function setMetadata(?array $metadata): void\n {\n $this->metadata['value'] = $metadata;\n }", "public function testModifyMetadata()\n {\n }", "protected function addCustomFieldset()\n {\n $this->meta = array_merge_recursive(\n $this->meta,\n [\n static::NOTE_FIELD_INDEX => $this->getFieldsetConfig(),\n ]\n );\n }", "abstract public function setMetas();", "public function testUpdateMetadata1UsingPUT()\n {\n }", "public abstract function set_pairwise_metadata(string $their_did, array $metadata = null, array $tags = null);", "public function setMetadata($name, $value)\n {\n $this->metadata[$name] = $value;\n }", "function wp_update_attachment_metadata($attachment_id, $data)\n {\n }", "function photosets_editPhotos ($photoset_id, $photo_ids, $primary_photo_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.editPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$photo_ids = explode(',', $photo_ids);\n\t\tarray_map('trim', $photo_ids);\n\t\tif (!$primary_photo_id) {\n\t\t\t$params['primary_photo_id'] = $photo_ids[0];\n\t\t} else {\n\t\t\t$params['primary_photo_id'] = $primary_photo_id;\n\t\t}\n\t\t$photo_ids = implode(',', $photo_ids);\n\t\t$params['photo_ids'] = $photo_ids;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function syncMetadata() {}", "function sync_flickr($search,$new_only=false,$photoset=0,$photoset_name=\"\",$private=0)\n\t{\n\t\n\tglobal $flickr_api_key, $flickr_token, $flickr_caption_field, $flickr_keywords_field, $flickr_prefix_id_title, $lang;\n\t\t\t\n\t$results=do_search($search);\n\t\n\tforeach ($results as $result)\n\t\t{\n\t\tglobal $view_title_field;\n\n\t\t# Fetch some resource details.\n\t\t$title=i18n_get_translated($result[\"field\" . $view_title_field]);\n\t\t$description=sql_value(\"select value from resource_data where resource_type_field=$flickr_caption_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$keywords=sql_value(\"select value from resource_data where resource_type_field=$flickr_keywords_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$photoid=sql_value(\"select flickr_photo_id value from resource where ref='\" . $result[\"ref\"] . \"'\",\"\");\n\n\t\t# Prefix ID to title?\n\t\tif ($flickr_prefix_id_title)\n\t\t\t{\n\t\t\t$title=$result[\"ref\"] . \") \" . $title;\n\t\t\t}\n\t\t\t\n\t\tif (!$new_only || $photoid==\"\")\n\t\t\t{\n\t\t\techo \"<li>\" . $lang[\"processing\"] . \": \" . $title . \"\\n\";\n\t\n\t\t\t$im=get_resource_path($result[\"ref\"],true,\"scr\",false,\"jpg\");\n\t\n\t\t\t# If replacing, add the photo ID of the photo to replace.\n\t\t\tif ($photoid!=\"\")\n\t\t\t\t{echo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"updating_metadata_for_existing_photoid\"]);\n\t\t\t\t\n\t\t\t\t# Also resubmit title, description and keywords.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setTags\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"tags\"=>$keywords));\n\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setMeta\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"title\"=>$title, \"description\"=>$description));\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t# New uploads only. Send the photo file.\n\t\t\tif ($photoid==\"\")\t\n\t\t\t\t{\n\n\t\t\t\t$url=\"http://api.flickr.com/services/upload/\";\n\n\t\t\t\t# Build paramater list for upload\n\t\t\t\t$data=array(\n\t\t\t\t\"photo\"=>\"@\" . $im,\n\t\t\t\t\"api_key\"=>$flickr_api_key,\n\t\t\t\t\"auth_token\" => $flickr_token,\n\t\t\t\t\"title\" => $title,\n\t\t\t\t\"description\" => $description,\n\t\t\t\t\"tags\" => $keywords\n\t\t\t\t);\n\n\t\t\t\t# Add the signature by signing the data...\n\t\t\t\t$data[\"api_sig\"]=flickr_sign($data,array(\"photo\"),true);\n\t\t\t\t\n\t\t\t\t# Use CURL to upload the photo.\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\t$photoid=flickr_get_response_tag(curl_exec($ch),\"photoid\");\n\t\t\t\t\n\t\t\t\techo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"photo-uploaded\"]);\n\n\t\t\t\t# Update Flickr tag ID\n\t\t\t\tsql_query(\"update resource set flickr_photo_id='\" . escape_check($photoid) . \"' where ref='\" . $result[\"ref\"] . \"'\");\n\t\t\t\t}\n\n\t\t\t$created_new_photoset=false;\n\t\t\tif ($photoset==0)\n\t\t\t\t{\n\t\t\t\t# Photoset must be created.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.create\",\"auth_token\"=>$flickr_token, \"title\"=>$photoset_name, \"primary_photo_id\"=>$photoid),\"\",\"POST\");\n\t\t\t\tglobal $last_xml;\n\t\t\t\t#echo htmlspecialchars($last_xml);\n\t\t\t\t$pos_1=strpos($last_xml,\"id=\\\"\");\n\t\t\t\t$pos_2=strpos($last_xml,\"\\\"\",$pos_1+5);\n\t\t\t\t$photoset=substr($last_xml,$pos_1+4,$pos_2-$pos_1-4);\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoset_name\", \"%photoset\"), array($photoset_name, $photoset), $lang[\"created-new-photoset\"]);\n\t\t\t\t$created_new_photoset=true;\n\t\t\t\t}\n\n\t\t\t# Add to photoset\n\t\t\tif (!$created_new_photoset) # If we've just created a photoset then this will already be present within it as the primary photo (added during the create photoset request).\n\t\t\t\t{\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.addPhoto\",\"auth_token\"=>$flickr_token, \"photoset_id\"=>$photoset, \"photo_id\"=>$photoid));\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoid\", \"%photoset\"), array($photoid, $photoset), $lang[\"added-photo-to-photoset\"]);\n\t\t\t\t#global $last_xml;echo nl2br(htmlspecialchars($last_xml));\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t# Set permissions\n\t\t\techo \"<li>\" . str_replace(\"%permission\", $private==0 ? $lang[\"flickr_public\"] : $lang[\"flickr_private\"], $lang[\"setting-permissions\"]);\n\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setPerms\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"is_public\"=>($private==0?1:0),\"is_friend\"=>0,\"is_family\"=>0,\"perm_comment\"=>0,\"perm_addmetadata\"=>0),\"\",\"POST\");\n\n\t\t\t\n\t\t\t}\n\t\t}\n\techo \"<li>\" . $lang[\"done\"];\n\t}", "public function update_metadata($metadata_id, $metadata)\n\t{\n\t\t$this->db->where('id', $metadata_id);\n\t\t$this->db->update('metadata', $metadata);\n\t}", "public function fakeImageResize($metadata)\n {\n $file = pathinfo(realpath($this->uploads->getBasePath().'/'.$metadata['file']));\n if (! in_array($file['extension'], ['jpg', 'jpeg', 'png', 'gif'], true)) {\n return $metadata;\n }\n\n foreach ($this->sizes as $name => $size) {\n // figure out what size WP would make this:\n $newsize = image_resize_dimensions($metadata['width'], $metadata['height'], $size['width'], $size['height'], $size['crop']);\n\n if ($newsize) {\n // build the fake meta entry for the size in question\n // TODO update for density\n $metadata['sizes'][$name] = [\n 'file' => sprintf('%s-%sx%s.%s', $file['filename'], $newsize[4], $newsize[5], $file['extension']),\n 'width' => $newsize[4],\n 'height' => $newsize[5],\n ];\n }\n }\n\n $metadata['sizes']['full'] = [\n 'file' => $file['basename'],\n 'width' => $metadata['width'],\n 'height' => $metadata['height'],\n ];\n\n return $metadata;\n }", "protected function setup_metadata() {\n\t\tif ( $this->get_meta_type() ) {\n\t\t\t$this->fill( $this->get_metadata() );\n\t\t}\n\t}", "public function resetMetadata(array $metadata);", "protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }", "public function testUpdateDocumentMetadata()\n {\n }", "public function setMetadata($aCid, $aMetadata) {\n $lMetadata = $aMetadata;\n $lCid = intval($aCid);\n \n foreach($lMetadata as $lMetaId => $lVal) {\n $lMetaId = intval($lMetaId);\n if($lMetaId < 1) continue;\n \n $lSql = 'SELECT count(*) FROM `al_cms_ref_meta` WHERE `content_id`='.esc($lCid).' AND `meta_id`='.esc($lMetaId).' AND `val`='.esc($lVal);\n $lCount = CCor_Qry::getInt($lSql);\n if($lCount < 1) {\n // insert new metadata reference\n $lSql = 'INSERT INTO `al_cms_ref_meta` (`content_id`, `meta_id`, `val`) VALUES ('.esc($lCid).', '.esc($lMetaId).', '.esc($lVal).')';\n CCor_Qry::exec($lSql);\n }\n }\n }", "function metadata_image($metadata_conf) \r\n {\r\n if(is_array($metadata_conf) && count($metadata_conf)>0)\r\n {\r\n include_once 'metadata/Toolkit_Version.php';\r\n error_reporting(0);\r\n include_once 'metadata/JPEG.php';\r\n include_once 'metadata/XMP.php';\r\n include_once 'metadata/Photoshop_IRB.php';\r\n include_once 'metadata/EXIF.php';\r\n include_once 'metadata/Photoshop_File_Info.php';\r\n \r\n \r\n // Copy all of the HTML Posted variables into an array\r\n //$new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS'];\r\n $new_ps_file_info_array = $metadata_conf;\r\n \r\n $filename = $new_ps_file_info_array['filename'];\r\n //echo $filename;\r\n // Protect against hackers editing other files\r\n \r\n $path_parts = pathinfo($filename);\r\n $array_extention = array('png', 'jpg');\r\n if (strcasecmp($path_parts[\"extension\"], \"jpg\") != 0) {\r\n //if (!in_array($path_parts[\"extension\"], $array_extention)) \r\n #echo \"Incorrect File Type - JPEG Only\\n\";\r\n return array('status' => 'failed', 'message' => 'Incorrect File Type - JPEG Only');\r\n exit();\r\n }\r\n // Change: removed limitation on file being in current directory - as of version 1.11\r\n // Retrieve the header information\r\n $jpeg_header_data = get_jpeg_header_data($filename);\r\n \r\n // Retreive the EXIF, XMP and Photoshop IRB information from\r\n // the existing file, so that it can be updated\r\n $Exif_array = get_EXIF_JPEG($filename);\r\n $XMP_array = read_XMP_array_from_text(get_XMP_text($jpeg_header_data));\r\n $IRB_array = get_Photoshop_IRB($jpeg_header_data);\r\n \r\n // Update the JPEG header information with the new Photoshop File Info\r\n $jpeg_header_data = put_photoshop_file_info($jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array);\r\n \r\n // Check if the Update worked\r\n if ($jpeg_header_data == FALSE) {\r\n //echo '$jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure update Photoshop File Info : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n \r\n // Attempt to write the new JPEG file\r\n if (FALSE == put_jpeg_header_data($filename, $filename, $jpeg_header_data)) {\r\n //echo 'put_jpeg_header_data false';\r\n return array('status' => 'failed', 'message' => 'Error - Failure to write new JPEG : ' . $filename);\r\n // Abort processing\r\n exit();\r\n }\r\n return array('status' => 'succes', 'message' => $filename . ' updated');\r\n }\r\n }", "public function setMetadata($name, $value = '')\n {\n $query = $this->db\n ->get_where(\"registry_object_metadata\",\n array('registry_object_id' => $this->id, 'attribute' => $name));\n if ($query->num_rows() == 1) {\n $this->db->where(array('registry_object_id' => $this->id, 'attribute' => $name));\n $this->db->update('registry_object_metadata', array('value' => $value));\n } else {\n $this->db->insert('registry_object_metadata',\n array('registry_object_id' => $this->id, 'attribute' => $name, 'value' => $value));\n }\n }", "public function updatePostMeta($post_meta_name) {\n $meta = array();\n $meta['image'] = $this->image;\n $meta['sub-images'] = $this->sub_images;\n $meta['link'] = $this->link;\n $meta['price'] = $this->price;\n $meta['product-code'] = $this->product_code;\n\n update_post_meta($this->id, $post_meta_name, $meta);\n }", "public function setMetaInfo($meta) {\n $this->meta = $meta;\n }", "function getPhotosetInfo ($set_id) {\n global $config;\n $json = cacheGet('photosetinfo-' . $set_id);\n if (!$json) {\n $json = file_get_contents('https://api.flickr.com/services/rest/?method=flickr.photosets.getInfo&user_id=' . $config['user_id'] . '&photoset_id=' . $set_id . '&format=json&api_key=' . $config['api_key']);\n cacheSet('photosetinfo-' . $set_id, $json);\n }\n return json_decode(substr($json, 14, -1), true);\n}", "public function testUpdateMetadata3UsingPUT()\n {\n }", "function getPhotoSetInfo($photoset_id){\n\n\t\t/* Get Photoset Name and Description */\n\t\t$photoset_info = $this->askFlickr('photosets.getInfo','&photoset_id='.$photoset_id);\n\n\t\t/* Return Photo Info Object */\n\t\treturn $photoset_info;\n\t}", "public function testUpdateMetadata2UsingPUT()\n {\n }", "private function update_attachment_postmeta($post_id)\n {\n // global $wpdb;\n $args = array(\n \"ID\" => $post_id,\n //the type of the upload photo\n \"post_title\" => $this->post_title,\n //description\n \"post_content\" => $this->post_content,\n //post status\n \"post_status\" => \"publish\",\n //post ID for the previous uploaded raw data\n \"post_excerpt\" => $this->post_content2\n );\n /*\n $Keys [] = $NewImage->ID;\n $Captions [] = $NewImage->post_excerpt;\n $Descriptions [] = $NewImage->post_content;*/\n wp_update_post($args);\n }", "protected function save_meta() {}", "public function updateSet(Entity\\Set $set) {\n $data = array(\n 'name' => $set->get('name'),\n 'description' => $set->get('description', null)\n );\n\n return parent::update($set->getId(), $data);\n }", "public function setMetadata($data)\n {\n foreach ($this->getMetadatas() as $metadatum) {\n // If there already are metadata with the given name update them\n if (array_key_exists($metadatum->getCode(), $data)) {\n $metadatum->setPayload($data[$metadatum->getCode()]);\n unset($data[$metadatum->getCode()]);\n } else {\n $metadatum->setPayload(null);\n }\n }\n // Otherwize create a new metadata and add it to the current metadata\n foreach ($data as $code => $payload) {\n array_push($this->_metadata, $this->_createMetadata($code, $payload));\n }\n return $this;\n }", "function addUpdateMetadata(){\n\t \n\t\t $this->getMakeMetadata(); //get previously saved metadata\n\t\t \n\t\t $chValue = $this->checkParam(\"title\"); \n\t\t if($chValue != false ){\n\t\t\t\t$this->tableName = $chValue;\n\t\t }\n\t\t \n\t\t $chValue = $this->checkParam(\"description\"); \n\t\t if($chValue != false ){\n\t\t\t\t$this->tableDesciption = $chValue;\n\t\t }\n\t\t \n\t\t $chValue = $this->checkParam(\"doi\"); \n\t\t if($chValue != false ){\n\t\t\t\t$this->tableDOI = $chValue;\n\t\t }\n\t\t \n\t\t $chValue = $this->checkParam(\"ark\"); \n\t\t if($chValue != false ){\n\t\t\t\t$this->tableARK = $chValue;\n\t\t }\n\t\t \n\t\t $chValue = $this->checkParam(\"versionControl\");\n\t\t if($chValue != false){\n\t\t\t\t$this->versionControl = $chValue;\n\t\t }\n\t\t \n\t\t $chValue = $this->checkParam(\"pubCreated\");\n\t\t if($chValue != false){\n\t\t\t\t$this->pubCreated = $chValue;\n\t\t }\n\t\t \n\t\t $chValue = $this->checkParam(\"tags\"); \n\t\t if($chValue != false ){\n\t\t\t\tif(stristr($chValue, self::tagDelim)){\n\t\t\t\t\t $rawTags = explode(self::tagDelim, $chValue);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $rawTags = array($chValue);\n\t\t\t\t}\n\t\t\t\t$tags = array();\n\t\t\t\tforeach($rawTags as $tag){\n\t\t\t\t\t $tags[] = trim($tag);\n\t\t\t\t}\n\t\t\t\t$this->tableTags = $tags;\n\t\t }\n\t\t \n\t\t $this->saveMetadata(); //save the upated metadata\n\t }", "public function setMetadata(?array $value): void {\n $this->getBackingStore()->set('metadata', $value);\n }", "public function setMetadata(?array $value): void {\n $this->getBackingStore()->set('metadata', $value);\n }", "function wp_image_add_srcset_and_sizes($image, $image_meta, $attachment_id)\n {\n }", "public function saveMetadata(){\n foreach ($this->_metadata as $metadatum) {\n $metadatum->save();\n }\n return $this;\n }", "function update_metadata_by_mid($meta_type, $meta_id, $meta_value, $meta_key = \\false)\n {\n }", "public function mergeMetadata(array $metadata);", "public function setMetaData(array $data): void\n {\n $data = array_change_key_case($data, CASE_LOWER);\n\n //@todo sanitize attributes\n\n $this->data = $data + $this->data;\n\n try {\n Application::getInstance()->getVxPDO()->updateRecord('folders', $this->id, $this->data);\n }\n catch (\\PDOException $e) {\n throw new MetaFolderException(sprintf(\"Data commit of folder '%s' failed. PDO reports %s\", $this->filesystemFolder->getPath(), $e->getMessage()));\n }\n }", "function set_meta_objs($meta_objs) {\n $this->meta_objs = $meta_objs;\n }", "function dcwd_set_image_meta_upon_image_upload( $post_ID ) {\n\tif ( wp_attachment_is_image( $post_ID ) ) {\n\t\t$my_image_title = get_post( $post_ID )->post_title;\n\t\t$my_image_title = dcwd_title_to_words( $my_image_title );\n\t\t// Create an array with the image meta (Title, Caption, Description) to be updated\n\t\t// Note: comment out the Excerpt/Caption or Content/Description lines if not needed\n\t\t$my_image_meta = array(\n\t\t\t'ID' => $post_ID,\t\t\t// Specify the image (ID) to be updated\n\t\t\t'post_title' => $my_image_title,\t\t// Set image Title to sanitized title\n\t\t\t// Damien: Omit setting the caption as I rarely use captions when I insert images.\n\t\t\t//'post_excerpt' => $my_image_title,\t\t// Set image Caption (Excerpt) to sanitized title\n\t\t\t'post_content' => $my_image_title,\t\t// Set image Description (Content) to sanitized title\n\t\t);\n\t\t// Set the image Alt-Text\n\t\tupdate_post_meta( $post_ID, '_wp_attachment_image_alt', $my_image_title );\n\t\t// Set the image meta (e.g. Title, Excerpt, Content)\n\t\twp_update_post( $my_image_meta );\n\t} \n}", "public function setFileMetadata(array $fileMetadata)\n {\n $this->_fileMetadata = $fileMetadata;\n }", "function photos_setPerms ($photo_id, $is_public = 1, $is_friend = 0, $is_family = 0, $perm_comment = 3, $perm_addmeta = 3) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setPerms', 'photo_id' => $photo_id, 'is_public' => $is_public, 'is_friend' => $is_friend, 'is_family' => $is_family, 'perm_comment' => $perm_comment, 'perm_addmeta' => $perm_addmeta));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function initMetadata($data, $metadata) {}", "public function setMetadata(?\\ArrayObject $metadata): self\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "public function setMetas($meta)\n {\n if (empty($meta)) {\n return;\n }\n\n foreach ($meta as $key => $value) {\n if (is_callable($value) && !is_string($value)) {\n $value = $value($this);\n }\n\n $this->setMeta($key, $value);\n }\n }", "public function setMetadata($name, $value)\r\n {\r\n $this->data['props'][$name] = $value;\r\n }", "public static function ADMIN_ARCHIVE_UPDATE_META_DATA( $MmodifyFields = array(1) ){\n\t $condition = array();\n\t foreach($MmodifyFields as $field){\n\t $condition[] = $field.'=:'.$field;\n\t }\n\t $SQL_String = \"UPDATE metadata SET \".join(',',$condition).\" WHERE identifier=:identifier AND _keep=1;\";\n\t return $SQL_String;\n\t}", "public function setMetadata($metadata)\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "protected function set_meta( $meta ) {\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\t}", "public function setMetaInfo($data = array()) {\n $this->metaInfo = array_merge($this->metaInfo, $data);\n }", "protected function setSubmittedMeta()\n {\n $this->setDataObject( new Tagline, 'tagline' );\n $this->content_obj->setMeta( 'tagline', $this->tagline->get() );\n \n $this->setImage( new Image, 'image_secondary' );\n if ( $this->image_secondary->get('file_name') ) {\n $this->content_obj->setMeta('image_secondary', $this->image_secondary->getFullName() );\n $this->processImage( 'image_secondary' );\n }\n \n $this->setDataObject( new Video, 'video' );\n $this->content_obj->setMeta( 'video', $this->video->get() );\n \n $this->setDataObject( new VideoDescription, 'video_description' );\n $this->content_obj->setMeta( 'video_description', $this->video_description->get() );\n \n $this->setDataObject( new SelectableCharity, 'selectable' );\n $this->content_obj->setMeta( 'selectable', $this->selectable->get() );\n \n $this->setDataObject( new Rank, 'rank' );\n $this->content_obj->setMeta( 'rank', $this->rank->get() );\n \n $this->setDataObject( new Url, 'url' );\n $this->content_obj->setMeta( 'url', $this->url->get() );\n }", "function photosets_getInfo ($photoset_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.getInfo', 'photoset_id' => $photoset_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function modify(Fieldset $fieldset);", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "public function setMeta($meta)\n {\n $this->setValue('meta', $meta);\n }", "public function setMeta($meta)\n {\n $this->setValue('meta', $meta);\n }", "function AddMetaData($s3object, $value) {\n\t\t\t$this->__meta[$s3object] = $value;\n\t\t}", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "function setMetas($metas = array())\n\t{\n\t\t$defaultMetas = array('Robots'=>'all');\n\t\t$finalMetas = array_merge($defaultMetas,$metas);\n\t\t$metas = '';\n\t\tforeach($finalMetas as $name => $content)\n\t\t\t$metas .= '<meta name=\"'.$name.'\" content=\"'.htmlentities($content).'\" />';\n\t\t$this->setVar(\"meta\",$metas);\n\t}", "public function update_meta( &$object, $meta ) {\n\t\t}", "public function unsetMetadata(): void\n {\n $this->metadata = [];\n }", "public function _syncCustomMetadata($name) {}", "public function setPhoto(Photo $photoObject);", "public function setMetaData( $id, $metaKey, $meta_value ){\n\n\t\t$checkMeta = $this->getMetaData( $id, $metaKey, true );\n\n\t\tif( is_array( $meta_value ) ) {\n\t\t\t$meta_value = json_encode( $meta_value );\n\t\t}\n\n\t\tif( empty( $checkMeta ) ) {\n\t\t\t$this->db->insert(\n\t\t\t\t$this->metaDataTable,\n\t\t\t\t[\n\t\t\t\t\t\"meta_key\" => $metaKey,\n\t\t\t\t\t\"meta_value\" => $meta_value,\n\t\t\t\t\t$this->metaDataQueryBy => $id\n\t\t\t\t]\n\t\t\t);\n\t\t}else{\n\t\t\t$this->db->update(\n\t\t\t\t$this->metaDataTable,\n\t\t\t\t[\"meta_value\" => $meta_value],\n\t\t\t\t[\n\t\t\t\t\t\"meta_key\" => $metaKey,\n\t\t\t\t\t$this->metaDataQueryBy => $id\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}", "public function delMetadata() {}", "public function delMetadata() {}", "public function delMetadata() {}", "public function setMetadata($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\Metadata::class);\n $this->metadata = $var;\n\n return $this;\n }", "private function updateMetas() {\n if( is_null($this->Metas) )\n $this->Metas = array();\n\n $this->Metas[0] = '<meta http-equiv=\"Content-Type\" content=\"' . $this->ContentType . '; charset=' . $this->Charset . '\" />';\n }", "function photosets_removePhoto ($photoset_id, $photo_id) {\n\t\t$params['method'] = 'flickr.photosets.orderSets';\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.removePhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setMetadata($metadata): self\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "public function setMetadata($metadata): self\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "public function setMetadata($metadata): self\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "public function setMetadata($metadata): self\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "public function setMetadata($metadata): self\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "public function setMeta($key, $value)\n {\n }", "function acf_update_metadata($post_id = 0, $name = '', $value = '', $hidden = \\false)\n{\n}", "public function modifyMeta(array $meta)\n {\n $this->meta = $meta;\n $this->addCustomFieldset();\n\n return $this->meta;\n }", "public function setMetadata(array $metadata)\n {\n $this->metadata = $metadata;\n\n return $this;\n }", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function useMetaData()\n {\n if (!$this->getParam('meta_data')) {\n $this->collectMetaData();\n }\n\n $metaData = $this->getParam('meta_data');\n if ($metaData) {\n if (!empty($metaData['layout.include'])) {\n $this->BLayout->applyLayout($metaData['layout.include']);\n }\n if (!empty($metaData['layout.yml'])) {\n $layoutData = $this->BYAML->parse(trim($metaData['layout.yml']));\n $this->BLayout->addLayout('viewproxy-metadata', $layoutData)->applyLayout('viewproxy-metadata');\n }\n if (($head = $this->view('head'))) {\n foreach ($metaData as $k => $v) {\n $k = strtolower($k);\n switch ($k) {\n case 'title':\n $head->addTitle($v);\n break;\n \n case 'set_title':\n $head->setTitle($v);\n break;\n\n case 'meta_title': \n case 'meta_description': \n case 'meta_keywords':\n $head->meta(str_replace('meta_', '', $k), $v); \n break;\n }\n }\n }\n }\n return $this;\n }", "function autoMetadata(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $this->getProjects();\n\t\t $this->getPersons();\n\t\t $this->getProjectCreators();\n\t\t $this->saveMetadata(); //save the results\n\t }", "function metaInit () {\n $this->imageMeta = new ImageMeta($this->getImagePath());\n $this->imageMeta->getMeta();\n }", "public function setMeta( KCommandContext $context )\n {\n $data = $context->data;\n \n $entity = $this->getItem();\n \n $plugins = KConfig::unbox( pick( $data->plugins, array() ) );\n \n $entity->setPluginsValues( $plugins );\n }" ]
[ "0.7089243", "0.7088521", "0.6776059", "0.6623159", "0.6577129", "0.6437518", "0.63803154", "0.6280251", "0.622669", "0.6037982", "0.59757626", "0.5906002", "0.5906002", "0.5889698", "0.5838597", "0.5781361", "0.575651", "0.57553005", "0.5692061", "0.5626392", "0.5610376", "0.56097573", "0.5585536", "0.55545014", "0.554662", "0.5532516", "0.5492434", "0.5475493", "0.5442635", "0.5441265", "0.54292643", "0.5424029", "0.54152685", "0.54121894", "0.53963315", "0.5387144", "0.5373839", "0.53557444", "0.53439415", "0.5341686", "0.5330051", "0.5312212", "0.5311139", "0.53095204", "0.5300544", "0.5296231", "0.528955", "0.525691", "0.525691", "0.5218829", "0.5217323", "0.5216306", "0.51914567", "0.51663977", "0.5165499", "0.51610804", "0.5156485", "0.515389", "0.5149202", "0.51410216", "0.51391023", "0.5137422", "0.51269525", "0.51264465", "0.51026934", "0.50985837", "0.5087668", "0.5086948", "0.5085925", "0.50854987", "0.5078639", "0.5078639", "0.5077239", "0.5065234", "0.50568086", "0.50533533", "0.5050709", "0.5047567", "0.5043955", "0.503987", "0.50372446", "0.50372446", "0.50372446", "0.5036221", "0.5026858", "0.50262994", "0.5017522", "0.5017522", "0.5017522", "0.5017522", "0.5017522", "0.5016915", "0.50161785", "0.5008985", "0.50082886", "0.5007999", "0.4998971", "0.4996436", "0.4993222", "0.49914128" ]
0.69520354
2
Modify the photos in a photoset. Use this method to add, remove and reorder photos.
function photosets_editPhotos ($photoset_id, $photo_ids, $primary_photo_id = NULL) { $params = array(); $params['method'] = 'flickr.photosets.editPhotos'; $params['photoset_id'] = $photoset_id; $photo_ids = explode(',', $photo_ids); array_map('trim', $photo_ids); if (!$primary_photo_id) { $params['primary_photo_id'] = $photo_ids[0]; } else { $params['primary_photo_id'] = $primary_photo_id; } $photo_ids = implode(',', $photo_ids); $params['photo_ids'] = $photo_ids; $response = $this->execute($params, 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "public static function renumberPostionsToAccountForNewlyDeletedPhotos()\n {\n $position = 1;\n $photos = parent::whereUserId(auth()->id())->orderBy('position')->orderBy('updated_at')->get();\n foreach ($photos as $photo) {\n $photo->update(['position' => $position]);\n $position++;\n }\n }", "function photosets_removePhoto ($photoset_id, $photo_id) {\n\t\t$params['method'] = 'flickr.photosets.orderSets';\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.removePhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function sync_flickr($search,$new_only=false,$photoset=0,$photoset_name=\"\",$private=0)\n\t{\n\t\n\tglobal $flickr_api_key, $flickr_token, $flickr_caption_field, $flickr_keywords_field, $flickr_prefix_id_title, $lang;\n\t\t\t\n\t$results=do_search($search);\n\t\n\tforeach ($results as $result)\n\t\t{\n\t\tglobal $view_title_field;\n\n\t\t# Fetch some resource details.\n\t\t$title=i18n_get_translated($result[\"field\" . $view_title_field]);\n\t\t$description=sql_value(\"select value from resource_data where resource_type_field=$flickr_caption_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$keywords=sql_value(\"select value from resource_data where resource_type_field=$flickr_keywords_field and resource='\" . $result[\"ref\"] . \"'\",\"\");\n\t\t$photoid=sql_value(\"select flickr_photo_id value from resource where ref='\" . $result[\"ref\"] . \"'\",\"\");\n\n\t\t# Prefix ID to title?\n\t\tif ($flickr_prefix_id_title)\n\t\t\t{\n\t\t\t$title=$result[\"ref\"] . \") \" . $title;\n\t\t\t}\n\t\t\t\n\t\tif (!$new_only || $photoid==\"\")\n\t\t\t{\n\t\t\techo \"<li>\" . $lang[\"processing\"] . \": \" . $title . \"\\n\";\n\t\n\t\t\t$im=get_resource_path($result[\"ref\"],true,\"scr\",false,\"jpg\");\n\t\n\t\t\t# If replacing, add the photo ID of the photo to replace.\n\t\t\tif ($photoid!=\"\")\n\t\t\t\t{echo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"updating_metadata_for_existing_photoid\"]);\n\t\t\t\t\n\t\t\t\t# Also resubmit title, description and keywords.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setTags\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"tags\"=>$keywords));\n\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setMeta\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"title\"=>$title, \"description\"=>$description));\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t# New uploads only. Send the photo file.\n\t\t\tif ($photoid==\"\")\t\n\t\t\t\t{\n\n\t\t\t\t$url=\"http://api.flickr.com/services/upload/\";\n\n\t\t\t\t# Build paramater list for upload\n\t\t\t\t$data=array(\n\t\t\t\t\"photo\"=>\"@\" . $im,\n\t\t\t\t\"api_key\"=>$flickr_api_key,\n\t\t\t\t\"auth_token\" => $flickr_token,\n\t\t\t\t\"title\" => $title,\n\t\t\t\t\"description\" => $description,\n\t\t\t\t\"tags\" => $keywords\n\t\t\t\t);\n\n\t\t\t\t# Add the signature by signing the data...\n\t\t\t\t$data[\"api_sig\"]=flickr_sign($data,array(\"photo\"),true);\n\t\t\t\t\n\t\t\t\t# Use CURL to upload the photo.\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t\t\t$photoid=flickr_get_response_tag(curl_exec($ch),\"photoid\");\n\t\t\t\t\n\t\t\t\techo \"<li>\" . str_replace(\"%photoid\", $photoid, $lang[\"photo-uploaded\"]);\n\n\t\t\t\t# Update Flickr tag ID\n\t\t\t\tsql_query(\"update resource set flickr_photo_id='\" . escape_check($photoid) . \"' where ref='\" . $result[\"ref\"] . \"'\");\n\t\t\t\t}\n\n\t\t\t$created_new_photoset=false;\n\t\t\tif ($photoset==0)\n\t\t\t\t{\n\t\t\t\t# Photoset must be created.\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.create\",\"auth_token\"=>$flickr_token, \"title\"=>$photoset_name, \"primary_photo_id\"=>$photoid),\"\",\"POST\");\n\t\t\t\tglobal $last_xml;\n\t\t\t\t#echo htmlspecialchars($last_xml);\n\t\t\t\t$pos_1=strpos($last_xml,\"id=\\\"\");\n\t\t\t\t$pos_2=strpos($last_xml,\"\\\"\",$pos_1+5);\n\t\t\t\t$photoset=substr($last_xml,$pos_1+4,$pos_2-$pos_1-4);\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoset_name\", \"%photoset\"), array($photoset_name, $photoset), $lang[\"created-new-photoset\"]);\n\t\t\t\t$created_new_photoset=true;\n\t\t\t\t}\n\n\t\t\t# Add to photoset\n\t\t\tif (!$created_new_photoset) # If we've just created a photoset then this will already be present within it as the primary photo (added during the create photoset request).\n\t\t\t\t{\n\t\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photosets.addPhoto\",\"auth_token\"=>$flickr_token, \"photoset_id\"=>$photoset, \"photo_id\"=>$photoid));\n\t\t\t\techo \"<li>\" . str_replace(array(\"%photoid\", \"%photoset\"), array($photoid, $photoset), $lang[\"added-photo-to-photoset\"]);\n\t\t\t\t#global $last_xml;echo nl2br(htmlspecialchars($last_xml));\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t# Set permissions\n\t\t\techo \"<li>\" . str_replace(\"%permission\", $private==0 ? $lang[\"flickr_public\"] : $lang[\"flickr_private\"], $lang[\"setting-permissions\"]);\n\t\t\tflickr_api(\"http://flickr.com/services/rest/\",array(\"api_key\"=>$flickr_api_key,\"method\"=>\"flickr.photos.setPerms\",\"auth_token\"=>$flickr_token, \"photo_id\"=>$photoid, \"is_public\"=>($private==0?1:0),\"is_friend\"=>0,\"is_family\"=>0,\"perm_comment\"=>0,\"perm_addmetadata\"=>0),\"\",\"POST\");\n\n\t\t\t\n\t\t\t}\n\t\t}\n\techo \"<li>\" . $lang[\"done\"];\n\t}", "private function addProductPhotos(array $request){\n\n if(array_key_exists('photos', $request)){\n \n foreach($request['photos'] as $photos){\n\n $photo = new Photo();\n\n $photoProduct = Product::where('name', $request['name'])->get();\n $path = $photos->store('/storage/products');\n $filename = basename($path);\n $extension = $photos->getClientOriginalExtension();\n \n $photo->product_id = $photoProduct[0]->id; \n $photo->path = $filename;\n $photo->extension = $extension;\n\n $photo->save();\n }\n }\n }", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"uploads\";\n $destination_path = \"products\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "private function setImgArray($data)\n {\n //====================================================================//\n // Safety Check\n if (!is_array($data) && !is_a($data, \"ArrayObject\")) {\n return false;\n }\n //====================================================================//\n // Load Object Images List for Whole Product\n $this->imagesCache = Image::getImages(SLM::getDefaultLangId(), $this->object->id);\n\n //====================================================================//\n // UPDATE IMAGES LIST\n //====================================================================//\n\n $this->imgPosition = 0;\n $visibleImageIds = array();\n //====================================================================//\n // Given List Is Not Empty\n foreach ($data as $inValue) {\n //====================================================================//\n // Check Image Array is here\n if (!isset($inValue[\"image\"]) || empty($inValue[\"image\"])) {\n continue;\n }\n $this->imgPosition++;\n //====================================================================//\n // Search For Image In Current List\n $psImage = $this->searchImage($inValue[\"image\"][\"md5\"]);\n if (false == $psImage) {\n //====================================================================//\n // If Not found, Add this object to list\n $psImage = $this->addImageToProduct(\n $inValue[\"image\"],\n $this->getImagePosition($inValue),\n $this->getImageCoverFlag($inValue)\n );\n }\n //====================================================================//\n // Safety Check\n if (!($psImage instanceof Image)) {\n continue;\n }\n //====================================================================//\n // Update Image Position in List\n $this->updateImagePosition($psImage, $inValue);\n $this->updateImageCoverFlag($psImage, $inValue);\n //====================================================================//\n // Update Image Object in Database\n $this->updateImage($psImage);\n //====================================================================//\n // Add Ps Image Id to Visible\n if ($this->getImageVisibleFlag($inValue)) {\n $visibleImageIds[] = $psImage->id;\n }\n }\n\n //====================================================================//\n // Update Combination Images List\n $this->updateAttributeImages($visibleImageIds);\n\n //====================================================================//\n // If Current Image List Is Empty => Clear Remaining Local Images\n $this->cleanImages($this->imagesCache);\n\n //====================================================================//\n // Generate Images Thumbnail\n $this->updateImgThumbnail();\n\n //====================================================================//\n // Flush Images Infos Cache\n $this->flushImageCache();\n\n return true;\n }", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"public_folder\";\n $destination_path = \"uploads/albums\";\n $album_originalName = $_POST['name'];\n // ******** Generate unique album name ********\n $album_name = md5( $album_originalName . time() );\n \n foreach ( $value as $file ) {\n // 0. Generate new size file\n $image = \\Image::make( $file );\n $image_350 = \\Image::make( $file ) -> widen( 350 );\n \n // 1. Generate new file names\n $new_file_name = md5( $file -> getClientOriginalName() . time() ).'.'.$file->getClientOriginalExtension();\n $new_file_name_350 = md5( $file -> getClientOriginalName() . time() ).'_350.'.$file->getClientOriginalExtension();\n \n // 2. Move new files to the correct path\n $file_path = $destination_path . '/' . $album_name . '/' . $new_file_name;\n $file_path_350 = $destination_path . '/' . $album_name . '/' . $new_file_name_350;\n \\Storage::disk( $disk )->put( $file_path, $image -> stream() );\n \\Storage::disk( $disk )->put( $file_path_350, $image_350 -> stream() );\n \n // 3. Add the public path to the database\n $attribute_value[] = [ $file_path, $file_path_350 ];\n }\n $this->attributes[$attribute_name] = str_replace( '\\\\', '', json_encode($attribute_value) );\n }", "public function DeletePhotos()\n\t{\tforeach ($this->imagesizes as $sizename=>$size)\n\t\t{\t@unlink($this->GetImageFile($sizename));\n\t\t}\n\t}", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "function local_ltiprovider_membership_service_update_userphotos( $userphotos ) {\n\n // Sync of user photos.\n mtrace( \"Sync user profile images\" );\n $counter = 0;\n if ( $userphotos ) {\n foreach ( $userphotos as $userid => $url ) {\n if ( $url ) {\n $result = local_ltiprovider_update_user_profile_image( $userid, $url );\n if ( $result === true ) {\n $counter ++;\n mtrace( \"Profile image succesfully downloaded and created from $url\" );\n } else {\n mtrace( $result );\n }\n }\n }\n }\n mtrace( \"$counter profile images updated\" );\n}", "public static function replenishPhotosCollection($photos_collection, $columns_number = self::COLUMNS_DEFAULT)\n\t{\n\t\t$helper = new self($photos_collection, $columns_number);\n\t\t\n\t\treturn $helper->photos_collection;\n\t}", "public function setPhoto(Photo $photoObject);", "function main() {\n \n //first, dig out the photos we already have\n $args = array(\n 'orderby' => 'date',\n 'order' => 'DESC'\n );\n \n //Check and add new photos\n foreach ($this->galleries as $gallery) {\n $args['media_tags'] = $gallery['mediatag'];\n\n $old_photos = get_attachments_by_media_tags($args);\n $this->add_new_recursive(1, $old_photos, $gallery);\n }\n}", "private function replenishImagesCollectionWithGaps()\n\t{\t\t\n\t\t$gaps_indexes = $this->itemboard->gapsIndexes();\n\t\t$photos_collection = $this->photos_collection;\n\t\t$photos_gallery = new Illuminate\\Database\\Eloquent\\Collection;\n\t\t\n\t\t$photos_collection_count = $photos_collection->count() + count($this->itemboard->gapsIndexes());\n\t\t\n\t\tfor($i = 0; $i < $photos_collection_count; $i++)\n\t\t{\n\t\t\tif (in_array($i, $gaps_indexes))\n\t\t\t{\n\t\t\t\t$photo = new Photo();\n\t\t\t\t$photo->file_path = self::GAP_IMAGE_FILE_PATH;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$photo = $photos_collection->pop();\n\t\t\t}\n\n\t\t\t$photos_gallery->push($photo);\n\t\t}\n\t\t\n\t\t$this->photos_collection = $photos_gallery;\n\t}", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "public function getAllPhotos();", "function photosets_addPhoto ($photoset_id, $photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.addPhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function update(Request $request)\n {\n\n\n $validator = Validator::make($request->all(), [\n 'file-multiple-input' => 'required',\n 'file-multiple-input.*' => 'mimes:jpg,png,jpeg'\n\n ]);\n if ($validator->passes()) {\n\n\n $photos = $request->file('file-multiple-input');\n if (!is_array($photos)) {\n $photos = [$photos];\n }\n\n if (!is_dir($this->photos_path)) {\n mkdir($this->photos_path, 0777);\n }\n $deleteImages = Image::where('property_id', $request->input('property_id'))\n ->delete();\n\n for ($i = 0; $i < count($photos); $i++) {\n $photo = $photos[$i];\n $name = sha1(date('YmdHis') . Str::random(30));\n $save_name = $name . '.' . $photo->getClientOriginalExtension();\n $resize_name = $name . Str::random(2) . '.' . $photo->getClientOriginalExtension();\n\n InterventionImage::make($photo)\n ->encode('jpg', 75)\n ->resize(1000, 750)\n ->crop(1000, 750)\n ->save($this->photos_path . '/' . $resize_name);\n\n $photo->move($this->photos_path, $save_name);\n $upload = new Image();\n $upload->file = $save_name;\n $upload->resizedfilename = $resize_name;\n $upload->originalfilename = basename($photo->getClientOriginalName());\n $upload->property_id = $request->input('property_id');\n $upload->save();\n }\n }\n\n return redirect()->route('property_details', ['id' => $request->input('property_id')]);\n }", "private function setImgArray(array $data): bool\n {\n //====================================================================//\n // Load Object Images List for Whole Product\n $this->imagesCache = Image::getImages(\n SLM::getDefaultLangId(),\n (int) $this->object->id,\n null,\n Shop::getContextShopID(true)\n );\n\n //====================================================================//\n // UPDATE IMAGES LIST\n //====================================================================//\n\n $this->imgPosition = 0;\n $visibleImageIds = array();\n //====================================================================//\n // Given List Is Not Empty\n /** @var array|ArrayObject $value */\n foreach ($data as $value) {\n $value = ($value instanceof ArrayObject) ? $value->getArrayCopy() : $value;\n //====================================================================//\n // Check Image Array is here\n if (!isset($value[\"image\"]) || empty($value[\"image\"])) {\n continue;\n }\n $inImage = ($value[\"image\"] instanceof ArrayObject) ? $value[\"image\"]->getArrayCopy() : $value[\"image\"];\n $this->imgPosition++;\n //====================================================================//\n // Search For Image In Current List\n $psImage = $this->searchImage($value[\"image\"][\"md5\"]);\n if (false == $psImage) {\n //====================================================================//\n // If Not found, Add this object to list\n $psImage = $this->addImageToProduct(\n $inImage,\n (int) $this->getImagePosition($value),\n (bool) $this->getImageCoverFlag($value)\n );\n }\n //====================================================================//\n // Safety Check\n if (!($psImage instanceof Image)) {\n continue;\n }\n //====================================================================//\n // Update Image Position in List\n $this->updateImagePosition($psImage, $value);\n $this->updateImageCoverFlag($psImage, $value);\n //====================================================================//\n // Update Image Object in Database\n $this->updateImage($psImage);\n //====================================================================//\n // Add Ps Image Id to Visible\n if ($this->isImageVisible($value)) {\n $visibleImageIds[] = $psImage->id;\n }\n }\n\n //====================================================================//\n // Update Combination Images List\n $this->updateAttributeImages($visibleImageIds);\n\n //====================================================================//\n // If Current Image List Is Empty => Clear Remaining Local Images\n $this->cleanImages($this->imagesCache);\n\n //====================================================================//\n // Generate Images Thumbnail\n $this->updateImgThumbnail();\n\n //====================================================================//\n // Flush Images Infos Cache\n $this->flushImageCache();\n\n return true;\n }", "public function sort() {\n\t\tif ($this->request->is('post')) {\n\t\t\t$order = explode(\",\", $_POST['order']);\n\t\t\t$i = 1;\n\t\t\tforeach ($order as $photo) {\n\t\t\t\t$this->Picture->read(null, $photo);\n\t\t\t\t$this->Picture->set('order', $i);\n\t\t\t\t$this->Picture->save();\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$this->render(false, false);\n\t}", "public function setPictures(?array $pictures) : void\n {\n $this->set('pictures', $pictures, 'products');\n }", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "function photosets_orderSets ($photoset_ids) {\n\t\t$params['method'] = 'flickr.photosets.orderSets';\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.orderSets', 'photoset_ids' => $photoset_ids), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "public function updateWithImages($request) {\n $images = $request->has('files-keep-data.*.id')? $request->input('files-keep-data.*.id'): [];\n $remove_images = $request->has('files-remove-data.*.id')? $request->input('files-remove-data.*.id'): [];\n\n if($request->hasFile(\"images\")) {\n // fileService is declared by the extending controller\n $ids = $this->fileService->createBatch($request->file(\"images\"), ($request->only('files-data')) ? $request->only('files-data') : []);\n foreach($ids as $new_id) {\n $images[] = $new_id;\n }\n }\n if(!empty($remove_images) && !empty($images)) {\n foreach($images as $k => $image) {\n if(in_array($image, $remove_images)) {\n unset($images[$k]);\n }\n }\n }\n return $images;\n }", "function add_new_recursive($startnum, $old_photos, $gallery) {\n \n //now search for new photos\n $new_photos = $this->get_photos($gallery['groupid'], $startnum);\n if (!$new_photos) {\n //something is wrong\n return;\n }\n \n $old = false; //flag if some of the photos are already inte tha database\n foreach ($new_photos as $photo) {\n if ($photo && $this->check_if_new($photo, $old_photos))\n {\n //if the photo is new, \n //add it to the wordpress database\n $this->add_photo($photo, $gallery);\n } else {\n $old = true;\n }\n }\n if (!$old) {\n //If no photos were old, there might be more to find\n $this->add_new_recursive($startnum + 1, $old_photos, $gallery);\n }\n}", "public function photosAdd($id, PhotosRequest $photosrequest){\n\n $directory = '/uploads/photos/'.$id;\n\n if (!File::exists(public_path().$directory)){\n File::makeDirectory(public_path().$directory, 0775,true);\n }\n\n $files = $photosrequest->file('file');\n\n\n\n foreach ($files as $file) {\n\n $name = Auth::id().'_'.$id.'_'.str_slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME),'-').rand(1000,9999);\n $name_thumb = 'thumb_'.$name;\n $name_thumb2 = 'thumb2_'.$name;\n $file_path = $name.'.'.$file->getClientOriginalExtension();\n\n $img = Image::make($file);\n $img->interlace();\n $img->save('uploads/photos/'.$id.'/' . $name .'.'. $file->getClientOriginalExtension());\n\n $img->fit(200, 200);\n $img->save('uploads/photos/'.$id.'/' . $name_thumb .'.'. $file->getClientOriginalExtension());\n\n $img = Image::make($file);\n $img->resize(180, null, function($constraint){\n $constraint->aspectRatio();\n });\n $img->save('uploads/photos/'.$id.'/' . $name_thumb2 .'.'. $file->getClientOriginalExtension());\n\n $picture = new Pictures();\n\n $picture->name = $file_path;\n $picture->directory = $directory;\n $picture->albums_id = $id;\n\n $picture->save();\n }\n\n\n Session::flash('success', \"Vos photos on été ajoutées à l'album\");\n\n return redirect('/albums/'.$id);\n\n }", "function photos_setPerms ($photo_id, $is_public = 1, $is_friend = 0, $is_family = 0, $perm_comment = 3, $perm_addmeta = 3) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setPerms', 'photo_id' => $photo_id, 'is_public' => $is_public, 'is_friend' => $is_friend, 'is_family' => $is_family, 'perm_comment' => $perm_comment, 'perm_addmeta' => $perm_addmeta));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getPhotos();", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public function syncPhotos($photos = [])\n {\n if ( empty( $photos ) )\n {\n return $this->detachPhotos();\n }\n\n $do = [];\n $i = 0;\n foreach ( $photos as $photo )\n {\n $do[$photo] = ['ordering' => $i];\n $i++;\n }\n return $this->photos()->sync($do, true);\n }", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "public function updatePhoto($id,$photo){\n $this->findById($id)->update(['photo'=>$photo]);\n }", "public function getPhotos()\n {\n return $this->photos;\n }", "public function sortImage($id, Request $request) {\n\n foreach ($request->row as $k => $itm) {\n $articlePhoto = Photo::find($itm);\n $articlePhoto->sequence = $k + 1;\n $articlePhoto->updated_at = date('Y-m-d H:i:s');\n $articlePhoto->save();\n }\n\n DB::table('articles')\n ->where('id', $id)\n ->update(['updated_at' => date('Y:m:d H:i:s')]);\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function set_images($files){\n\t\t$image_dir = \"{$GLOBALS['core_path']}/user_content/item_images/{$this->id}\";\n\t\t\n\t\tif (!file_exists($image_dir)){\n\t\t\tmkdir($image_dir, 0750);\n\t\t}\n\t\t\n\t\tforeach (glob(\"{$image_dir}/*.png\") as $existing){\n\t\t\tunlink($existing);\n\t\t}\n\t\t\n\t\tforeach ($files as $key => $image_file){\n\t\t\t$image = imagecreatefromstring(file_get_contents($image_file));\n\t\t\t\t\n\t\t\t$preview = self::resize_image($image, item_image::PREVIEW_WIDTH, item_image::PREVIEW_HEIGHT);\n\t\t\t$cover = self::resize_image($image, item_image::COVER_WIDTH, item_image::COVER_HEIGHT);\n\t\t\t$thumb = self::resize_image($image, item_image::THUMB_WIDTH, item_image::THUMB_HEIGHT);\n\t\t\t\t\n\t\t\timagepng($preview, \"{$image_dir}/{$key}_preview.png\", 9);\n\t\t\timagepng($cover, \"{$image_dir}/{$key}_cover.png\", 9);\n\t\t\timagepng($thumb, \"{$image_dir}/{$key}_thumb.png\", 9);\n\t\t\timagepng($image, \"{$image_dir}/{$key}_full.png\", 9);\n\t\t\t\t\n\t\t\timagedestroy($preview);\n\t\t\timagedestroy($cover);\n\t\t\timagedestroy($image);\n\t\t\timagedestroy($thumb);\n\t\t\t\t\n\t\t\tunlink($image_file);\n\t\t}\n\t}", "public function updatePhotos(array $photoDetails){\n $query = 'UPDATE `photos` SET\n `id` = :id,\n `name_image` = :name_image\n WHERE id_photos = :id_photos';\n \n // je prepare requête à l'aide de la methode prepare pour me premunir des injections SQL \n $updatePhotosQuery = $this->dataBase->prepare($query);\n \n // On bind les values pour renseigner les marqueurs nominatifs\n $updatePhotosQuery->bindValue(':id_photos', $photoDetails['id_photos'], PDO::PARAM_STR);\n $updatePhotosQuery->bindValue(':name_image', $photoDetails['name_image'], PDO::PARAM_STR);\n $updatePhotosQuery->bindValue(':id', $photoDetails['id'], PDO::PARAM_STR);\n\n\n if ($updatePhotosQuery->execute()) {\n return true;\n } else {\n return false;\n }\n }", "public function photos(Builder $photos_sql)\n\t{\n\n\t\t$previousPhotoID = '';\n\t\t$return_photos = array();\n\t\t$photo_counter = 0;\n\t\t$photos = $photos_sql->get();\n\t\tforeach ($photos as $photo_model) {\n\n\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t$photo = $photo_model->prepareData();\n\n\t\t\t// Set previous and next photoID for navigation purposes\n\t\t\t$photo['previousPhoto'] = $previousPhotoID;\n\t\t\t$photo['nextPhoto'] = '';\n\n\t\t\t// Set current photoID as nextPhoto of previous photo\n\t\t\tif ($previousPhotoID !== '') {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $photo['id'];\n\t\t\t}\n\t\t\t$previousPhotoID = $photo['id'];\n\n\t\t\t// Add to return\n\t\t\t$return_photos[$photo_counter] = $photo;\n\n\t\t\t$photo_counter++;\n\t\t}\n\n\t\tif (count($return_photos) > 0) {\n\t\t\t// Enable next and previous for the first and last photo\n\t\t\t$lastElement = end($return_photos);\n\t\t\t$lastElementId = $lastElement['id'];\n\t\t\t$firstElement = reset($return_photos);\n\t\t\t$firstElementId = $firstElement['id'];\n\n\t\t\tif ($lastElementId !== $firstElementId) {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $firstElementId;\n\t\t\t\t$return_photos[0]['previousPhoto'] = $lastElementId;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_photos;\n\t}", "public function edit(Fotos $fotos)\n {\n //\n }", "static function changePhoto() {\n\t\t\n\t\t$case_intra = rcube_utils::get_input_value('photo_intra', RCUBE_INPUT_POST);\n\t\t$case_ader = rcube_utils::get_input_value('photo_ader', RCUBE_INPUT_POST);\n\n\t\t$info = array();\n\t\tif ( !empty($case_intra) && $case_intra == '1') {\n\t\t\t$info['mineqpublicationphotointranet'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotointranet'] = 0;\n\t\t}\n\t\t\n\t\tif ( !empty($case_ader) && $case_ader == '1' && !empty($case_intra) && $case_intra == '1')\n\t\t{\n\t\t\t$info['mineqpublicationphotoader'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotoader'] = 0;\n\t\t}\n\t\t\t\n\t\t$user_infos = melanie2::get_user_infos(Moncompte::get_current_user_name());\n\t\t\n\t\t$user_dn = $user_infos['dn'];\n\t\t$password = rcmail::get_instance()->get_user_password();\n\t\t\n\t\t$auth = Ldap::GetInstance(Config::$MASTER_LDAP)->authenticate($user_dn, $password);\n\t\t\n\t\tif(Ldap::GetInstance(Config::$MASTER_LDAP)->modify($user_dn, $info)) {\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_ok', 'melanie2_moncompte'), 'confirmation');\n\t\t} else {\n\t\t\t$err = Ldap::GetInstance(Config::$MASTER_LDAP)->getError();\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_nok', 'melanie2_moncompte') . $err, 'error');\n\t\t}\n\t\t\n\t}", "public function remove()\n\t{\n\t\t$photosTable = PTA_DB_Table::get('Catalog_Product_Photo');\n\t\t$photos = (array)$photosTable->getPhotos($this->_id);\n\n\t\tif (parent::remove()) {\n\t\t\t$photoFileField = $photosTable->getFieldByAlias('photo');\n\t\t\tforeach ($photos as $photo) {\n\t\t\t\tPTA_Util::unlink(PTA_CONTENT_PATH . '/' . $photo[$photoFileField]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function addPhoto($value)\n {\n $this->photos[] = $value;\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function photos(){\n return $this->morphMany('cms\\Photo', 'imageable');\n }", "function add_images_meta_box($post) {\n $images = get_post_meta($post->ID, 'imagegallery_images', true);\n\t$count = 1;\n\tif (!empty($images) ) {\n\t\tforeach($images as $image) {\n\t\t\toutput_image_add_box($count++, $image);\n\t\t}\n\t}\n\techo '<div id=\"admin-list-end-marker\" style=\"clear: both;\"></div><a rel=\"image\" href=\"#\" id=\"add-admin-list\" name=\"add-admin-list\">Add Images</a>';\n}", "public function update(array $parameters = [])\n {\n json_decode(self::put(\"/photos/{$this->id}\", ['query' => $parameters])->getBody(), true);\n parent::update($parameters);\n }", "public function photoEdit()\n {\n $flags = $this->language->getAllDataNoPagination();\n $data['id'] = Input::get('picture_id');\n $data['photo'] = Pictures::where('id', '=', $data['id'])->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n\n return view('cms.modules.multicms.photoslg_addnew', $data, $flags);\n }", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "public function updatePhoto()\n {\n //Intenta subir la foto que viene en el campo 'photo'\n if ($photo = $this->uploadPhoto('photo')) {\n //Modifica el campo photo del usuario y lo intenta actualizar\n $this->photo = $photo;\n return $this->update();\n }\n }", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "function photos_setTags ($photo_id, $tags) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setTags', 'photo_id' => $photo_id, 'tags' => $tags));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "public function changePhotoAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LISTING ID\n $this->view->listing_id = $listing_id = $this->_getParam('listing_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ITEM\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview);\n //IF THERE IS NO SITEREVIEW.\n if (empty($sitereview)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n //SELECTED TAB\n $this->view->TabActive = \"profilepicture\";\n\n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n //AUTHORIZATION CHECK\n $allowed_upload_photo = Engine_Api::_()->authorization()->isAllowed($sitereview, $viewer, \"photo_listtype_$listingtype_id\");\n if (Engine_Api::_()->sitereviewpaidlisting()->allowPackageContent($sitereview->package_id, \"photo\")) {\n $allowed_upload_photo;\n }\n else\n $allowed_upload_photo = 0;\n }\n else\n $allowed_upload_photo = Engine_Api::_()->authorization()->isAllowed($sitereview, $viewer, \"photo_listtype_$listingtype_id\");\n\n if (empty($allowed_upload_photo)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //AUTHORIZATION CHECK\n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if ($listingType->photo_type != 'listing') {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET FORM\n $this->view->form = $form = new Sitereview_Form_ChangePhoto();\n\n //CHECK FORM VALIDATION\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //CHECK FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //UPLOAD PHOTO\n if ($form->Filedata->getValue() !== null) {\n //GET DB\n $db = Engine_Api::_()->getDbTable('listings', 'sitereview')->getAdapter();\n $db->beginTransaction();\n //PROCESS\n try {\n //SET PHOTO\n $sitereview->setPhoto($form->Filedata);\n $db->commit();\n } catch (Engine_Image_Adapter_Exception $e) {\n $db->rollBack();\n $form->addError(Zend_Registry::get('Zend_Translate')->_('The uploaded file is not supported or is corrupt.'));\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n } else if ($form->getValue('coordinates') !== '') {\n $storage = Engine_Api::_()->storage();\n $iProfile = $storage->get($sitereview->photo_id, 'thumb.profile');\n $iSquare = $storage->get($sitereview->photo_id, 'thumb.icon');\n $pName = $iProfile->getStorageService()->temporary($iProfile);\n $iName = dirname($pName) . '/nis_' . basename($pName);\n list($x, $y, $w, $h) = explode(':', $form->getValue('coordinates'));\n $image = Engine_Image::factory();\n $image->open($pName)\n ->resample($x + .1, $y + .1, $w - .1, $h - .1, 48, 48)\n ->write($iName)\n ->destroy();\n $iSquare->store($iName);\n @unlink($iName);\n }\n\n $file_id = Engine_Api::_()->getDbtable('photos', 'sitereview')->getPhotoId($listing_id, $sitereview->photo_id);\n\n $photo = Engine_Api::_()->getItem('sitereview_photo', $file_id);\n\n if (!$sitereview->draft && time() >= strtotime($sitereview->creation_date)) {\n $action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitereview, 'sitereview_change_photo_listtype_' . $listingtype_id);\n\n if ($action != null) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity($action, $photo);\n }\n }\n\n if (!empty($sitereview->photo_id)) {\n $photoTable = Engine_Api::_()->getItemTable('sitereview_photo');\n $order = $photoTable->select()\n ->from($photoTable->info('name'), array('order'))\n ->where('listing_id = ?', $sitereview->listing_id)\n ->group('photo_id')\n ->order('order ASC')\n ->limit(1)\n ->query()\n ->fetchColumn();\n\n $photoTable->update(array('order' => $order - 1), array('file_id = ?' => $sitereview->photo_id));\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'change-photo', 'listing_id' => $listing_id), \"sitereview_dashboard_listtype_$listingtype_id\", true);\n }", "public function getPhotos($page, $itemsPerPage);", "function albums_reorder_images($album) {\n\t$images = albums_get_images($album);\n\n\t//Only reorder if album contains images.\n\tif ($images != FALSE) {\n\t\t$number = 1;\n\t\tforeach ($images as $image) {\n\t\t\t$parts = explode('.', $image['filename']);\n\t\t\tif (isset($parts[3])) {\n\t\t\t\trename(ALBUMS_DIR.'/'.$album.'/'.$image['filename'], ALBUMS_DIR.'/'.$album.'/'.$number.'.'.$parts[1].'.'.$parts[2].'.'.$parts[3]);\n\t\t\t\t$number++;\n\t\t\t}\n\t\t}\n\t}\n}", "public function setPhotoData($body) {\n\t\t$cnt = count($body['photos']['photo']);\n\t\t$num = rand(0, $cnt-1);\n\t\t$this->photo = $body['photos']['photo'][$num];\n\t}", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "private function updateImgThumbnail(): void\n {\n //====================================================================//\n // Load Object Images List\n $allImages = Image::getImages(\n SLM::getDefaultLangId(),\n $this->ProductId,\n null,\n Shop::getContextShopID(true)\n );\n //====================================================================//\n // Walk on Object Images List\n foreach ($allImages as $image) {\n $imageObj = new Image($image['id_image']);\n $imagePath = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n if (!file_exists($imagePath.'.jpg')) {\n continue;\n }\n foreach (ImageType::getImagesTypes(\"products\") as $imageType) {\n $imgThumb = _PS_PROD_IMG_DIR_.$imageObj->getExistingImgPath();\n $imgThumb .= '-'.Tools::stripslashes($imageType['name']).'.jpg';\n if (!file_exists($imgThumb)) {\n ImageManager::resize(\n $imagePath.'.jpg',\n $imgThumb,\n (int)($imageType['width']),\n (int)($imageType['height'])\n );\n }\n }\n }\n }", "abstract public function addItems(\\Media\\Entity\\Photo\\PhotoBase $item);", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "public function resizeImages()\n {\n $conn = $this->getConnection();\n if ($images = $this->getImages($conn)) {\n $imagePath = $this->getNameImages($conn, $images[0]['image_id']);\n\n if ($images[0]['image_id'] == $images[1]['image_id']) {\n //blocks records while they are in resizing, status in progress\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n $this->changeStatus($conn, 'in progress', 'new', $id);\n }\n for ($i = 0; $i < 2; $i++) {\n $id = $images[$i]['id'];\n // $image_id = $images[$i]['image_id'];\n if ($this->setNewSize($imagePath, $this->size[$i], $this->size[$i])) {\n $this->updateImages($conn, 'complete', 'done', $imagePath, $id, $this->size[$i]);\n } else\n $this->updateImages($conn, 'error', 'something wrong', $imagePath, $id, $this->size[$i]);\n }\n }\n $conn = null;\n } else echo \"everything is done \\n\";\n }", "public function setIdentityCardPhotosAttribute($value)\n {\n $attribute_name = \"identity_card_photos\";\n $disk = 'contects';\n $destination_path = \"contects/images\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function edit(PhotoArray $photoArray)\n {\n //\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function photos(): HasMany\n\t{\n\t\treturn $this->hasMany('App\\Models\\Photo', 'album_id', 'id');\n\t}", "public function setPhoto($photo, $subject, $needToUplode = false,$params=array()) {\n\t\ttry {\n\n\t\t\tif ($photo instanceof Zend_Form_Element_File) {\n\t\t\t\t$file = $photo->getFileName();\n\t\t\t} else if (is_array($photo) && !empty($photo['tmp_name'])) {\n\t\t\t\t$file = $photo['tmp_name'];\n\t\t\t} else if (is_string($photo) && file_exists($photo)) {\n\t\t\t\t$file = $photo;\n\t\t\t} else {\n\t\t\t\tthrow new Group_Model_Exception('invalid argument passed to setPhoto');\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t}\n\n\t\t$imageName = $photo['name'];\n\t\t$name = basename($file);\n\t\t$path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'temporary';\n\n\t\t$params = array(\n\t\t\t'parent_type' => 'sitepage_page',\n\t\t\t'parent_id' => $subject->getIdentity()\n\t\t);\n\n\t\t// Save\n\t\t$storage = Engine_Api::_()->storage();\n\n\t\t// Resize image (main)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file)\n\t\t\t\t->resize(720, 720)\n\t\t\t\t->write($path . '/m_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Resize image (profile)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file)\n\t\t\t\t->resize(200, 400)\n\t\t\t\t->write($path . '/p_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Resize image (normal)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file)\n\t\t\t\t->resize(140, 160)\n\t\t\t\t->write($path . '/in_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Resize image (icon)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file);\n\n\t\t$size = min($image->height, $image->width);\n\t\t$x = ($image->width - $size) / 2;\n\t\t$y = ($image->height - $size) / 2;\n\n\t\t$image->resample($x, $y, $size, $size, 48, 48)\n\t\t\t\t->write($path . '/is_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Store\n\t\t$iMain = $storage->create($path . '/m_' . $imageName, $params);\n\t\t$iProfile = $storage->create($path . '/p_' . $imageName, $params);\n\t\t$iIconNormal = $storage->create($path . '/in_' . $imageName, $params);\n\t\t$iSquare = $storage->create($path . '/is_' . $imageName, $params);\n\n\t\t$iMain->bridge($iProfile, 'thumb.profile');\n\t\t$iMain->bridge($iIconNormal, 'thumb.normal');\n\t\t$iMain->bridge($iSquare, 'thumb.icon');\n\n\t\t// Remove temp files\n\t\t@unlink($path . '/p_' . $imageName);\n\t\t@unlink($path . '/m_' . $imageName);\n\t\t@unlink($path . '/in_' . $imageName);\n\t\t@unlink($path . '/is_' . $imageName);\n\n\t\t// Update row\n\t\tif (empty($needToUplode)) {\n\t\t\t$subject->modified_date = date('Y-m-d H:i:s');\n\t\t\t$subject->save();\n\t\t}\n\n\t\t// Add to album\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\t$photoTable = Engine_Api::_()->getItemTable('sitepage_photo');\n\t\tif(isset($params['album_id']) && !empty($params['album_id']))\n\t\t{\n\t\t\t$album = Engine_Api::_()->getItem('sitepage_album', $params['album_id']);\n\t\t\tif(!$album->toArray())\n\t\t\t{\n\t\t\t\t$album = $subject->getSingletonAlbum();\n\t\t\t\t$album->owner_id = $viewer->getIdentity();\n\t\t\t\t$album->save();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$album = $subject->getSingletonAlbum();\n\t\t\t$album->owner_id = $viewer->getIdentity();\n\t\t\t$album->save();\n\t\t}\n\t\t$photoItem = $photoTable->createRow();\n\t\t$photoItem->setFromArray(array(\n\t\t\t'page_id' => $subject->getIdentity(),\n\t\t\t'album_id' => $album->getIdentity(),\n\t\t\t'user_id' => $viewer->getIdentity(),\n\t\t\t'file_id' => $iMain->getIdentity(),\n\t\t\t'collection_id' => $album->getIdentity()\n\t\t));\n\t\t$photoItem->save();\n\n\t\treturn $subject;\n\t}", "private function updateImages(&$model, $request)\n {\n if ($request->get('delete_preview') || $request->file('preview_picture')) {\n @unlink(base_path() . '/public/uploads/'.$model->preview_picture);\n $model->preview_picture = NULL;\n $model->update();\n }\n if ($request->get('delete_detail') || $request->file('detail_picture')) {\n @unlink(base_path() . '/public/uploads/'.$model->detail_picture);\n $model->detail_picture = NULL;\n $model->update();\n }\n }", "public function action_block_content_photoset_randomphotos($block)\n\t{\n\t\t$assets = array();\n\t\t$posts = Posts::get(array('content_type' => Post::type('photoset'), 'status' => Post::status('published')));\n\t\tforeach($posts as $post) {\n\t\t\tforeach(explode(\"\\n\", $post->content_media) as $asset) {\n\t\t\t\t$assets[] = $asset;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$photos = array();\n\t\t$photocount = Options::get(__CLASS__ . '__randomphotosblock_count', 8);\n\t\tif(count($assets) >= $photocount) {\n\t\t\twhile(count($photos) < $photocount) {\n\t\t\t\t// By using the output as index duplicates are impossible\n\t\t\t\t$random = $assets[array_rand($assets)];\n\t\t\t\t$photos[$random] = $random;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$block->photos = $photos;\n\t}", "public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }", "public function setImagesets()\n {\n $this->_imagesets = [];\n try {\n $pnmain = $this->_qobject->getPNMainTable();\n $type = $this->_image->getImageParams('type');\n if ($type == 'rgb') {\n $model = $this->_image->getImageParams('R_model');\n } else {\n $model = $this->_image->getImageParams('in_model');\n }\n\n if (!$model || $model == null) {\n return $this->mylogger->logMessage(\"Model for the parameter 'run_id' is not defined.\", $this, 'warning',\n false);\n }\n $runs = $pnmain->{$model}()\n ->where('found', 'y')\n ->distinct('run_id')\n ->pluck('run_id')\n ->toArray();\n\n if (!$runs || $runs == null || empty($runs)) {\n return $this->mylogger->logMessage(\"No results.\", $this, 'warning', false);\n }\n\n// $old_base_file_names = array_column($this->_oldresults, 'OutImage');\n\n foreach ($runs as $run_id) {\n $run_id = ($run_id == null || !$run_id) ? \"-1\" : $run_id;\n\n $base_file_name = $this->pngName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'), $run_id);\n\n $full_file_name = MyFunctions::pathslash($this->_getOutDir()) . $base_file_name;\n\n $outimages = $this->_setOutimages($full_file_name);\n if (empty($outimages)) {\n continue;\n }\n\n $metadata = [\n 'type' => $type,\n 'run_id' => $run_id,\n 'OutImage' => $base_file_name,\n \"rgb_cube\" => ($type == 'rgb') ? $this->getRGBcubeName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'),\n $run_id) : null,\n \"out_images\" => $outimages,\n ];\n\n\n// if (in_array($base_file_name, $old_base_file_names)) {\n// continue;\n// }\n\n $rgb_components = $this->_getRGBComponents($pnmain, $run_id);\n\n if ($rgb_components) {\n $this->_imagesets[$run_id] = array_merge($metadata, $rgb_components);\n } else {\n $this->mylogger->logMessage(\"Missing fits image(s).\", $this, 'warning', false);\n }\n }\n } catch (\\Exception $e) {\n $this->_imagesets = [];\n return $this->mylogger->logMessage(\"Problem with setting imagesets: \" . $e . \".\", $this, 'warning', false);\n }\n if (empty($this->_imagesets)) {\n return false;\n }\n return true;\n\n }", "function admin_gallery_set()\n {\n // Require admin login\n if(!(isset($_SESSION['active_user']) && $_SESSION['active_user']['type'] == 'admin'))\n redirect_to('/');\n\n $this->load_outer_template('admin');\n\n if(!isset($this->params[2]) || (!is_numeric($this->params[2])))\n throw new exception(\"No user specified\");\n\n $user = $this->params[2];\n\n $m_set = instance_model('gallery_set');\n $set = $m_set->get_by_user($user);\n\n $list = array();\n foreach($set as $row)\n {\n $list []= array(\n 'name' => $row['Title'],\n 'options' => array(\n 'Edit Gallery' => make_url('members', 'admin_gallery', $row['ID']),\n 'Edit' => make_url('members', 'admin_set_edit', $row['ID']),\n 'Delete' => make_url('members', 'admin_set_delete', $row['ID']))\n );\n }\n\n $view = instance_view('admin/index_generic');\n $view = $view->parse_to_variable(array(\n 'back_url' => make_url('members', 'admin_pages'),\n 'sortable' => false,\n 'title' => 'In Categories',\n 'new_url' => make_url('members', 'admin_set_create', $user),\n 'new_name' => 'Add to category',\n 'list' => $list,\n 'col_classes' => array('tbl_set_name', 'tbl_set_opt')\n ));\n\n\n $this->set_template_paramiters(array(\n 'content' => $view\n ));\n\n }", "public function photos(){\n return $this->morphMany('App\\Models\\Photo','image');\n \n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function updatePictureViews($p_pet_id, $p_pic_id) {\n $stmt = $this->adapter->conn->prepare(\n \"UPDATE PICTURES SET views = views + 1 \". \n \"WHERE pic_id=? and pet_id=?\");\n $stmt->bindParam(1,$p_pic_id);\n $stmt->bindParam(2,$p_pet_id);\n\n $result=null;\n try{\n $result = $this->adapter->executeUpdatePrepared($stmt);\n }catch(PDOException $e){\n return false;\n }\n if($result > 0) {\n return true;\n }\n\n return false;\n }", "function add_image_sizes() {\n\t\t$cover_width = 350;\n\t\t$cover_height = 250;\n\t\t$cover_size = UM()->options()->get( 'um_user_photos_cover_size' );\n\t\tif ( $cover_size && trim( $cover_size ) != '' ) {\n\t\t\t$cover_size = strtolower( $cover_size );\n\t\t\t$size = explode( 'x', $cover_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$cover_width = intval( $size[0] );\n\t\t\t\t$cover_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\t\tadd_image_size( 'album_cover', $cover_width, $cover_height, true );\n\n\t\t$photo_width = 250;\n\t\t$photo_height = 250;\n\t\t$photo_size = UM()->options()->get( 'um_user_photos_image_size' );\n\t\tif ( $photo_size && trim( $photo_size ) != '' ) {\n\t\t\t$photo_size = strtolower( $photo_size );\n\t\t\t$size = explode( 'x', $photo_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$photo_width = intval( $size[0] );\n\t\t\t\t$photo_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\n\t\tadd_image_size( 'gallery_image', $photo_width, $photo_height, true );\n\t}", "function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }", "function wr_add_image_portfolio_metaboxes() {\n\tadd_meta_box(\n\t\t'image2',\n\t\t'Image Slide 2',\n\t\t'wr_image2_portfolio',\n\t\t'portfolio',\n\t\t'side',\n\t\t'default'\n\t);\n\tadd_meta_box(\n\t\t'image3',\n\t\t'Image Slide 3',\n\t\t'wr_image3_portfolio',\n\t\t'portfolio',\n\t\t'side',\n\t\t'default'\n\t);\n}", "public static function putImages($model, $images, $path, $type, $quantity)\n {\n $images = (array) $images;\n $number = $model->media()->get()->count();\n $difference = null;\n $limitedImgs = null;\n\n if($number < $quantity)\n {\n $difference = $quantity - $number;\n // dd($images);\n $limitedImgs = array_slice($images,0,$difference);\n\n foreach ($limitedImgs as $key => $image) \n {\n $img = Image::make($image->getRealPath());\n\n $img->resize(800, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $image_name = $key. '-' .time().'.'.$image->getClientOriginalExtension();\n\n /*\n ** check if directory exists\n ** if not, create it\n */\n $directory = public_path('/uploads/'. $path);\n if (!file_exists($directory)) \n {\n File::makeDirectory($directory, $mode = 0777, true, true); \n }\n if($directory)\n {\n /*\n ** Save image\n */\n $img->save(public_path('/uploads/'. $path . '/' .$image_name));\n }\n\n $model->media()->create([\n 'id' => (string) Uuid::generate(4),\n 'media_key' => $type,\n 'media_value' => $image_name,\n ]);\n }\n\n // $cover = $model->media()->where('image_key', 'cover')->first();\n\n // if(!$cover)\n // {\n // $model->media()->first()->update(['image_key' => 'cover']);\n // }\n \n }\n else{\n \\Session::flash('msg', trans('session.you_uploaded_max_img_number'));\n return back();\n }\n \n }", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "function photosets_editMeta ($photoset_id, $title, $description = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.editMeta';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['title'] = $title;\n\t\tif ($description) $params['description'] = $description;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function addMediaGallery($productCollection) {\n $ids = array(); \n $products = array();\n foreach($productCollection as $product) {\n $ids[] = $product->getId();\n $products[$product->getId()] = $product;\n }\n if(!$ids) return false;\n \n \n $table = $productCollection->getTable(Mage_Catalog_Model_Resource_Product_Attribute_Backend_Media::GALLERY_TABLE);\n $adapter = $productCollection->getConnection();\n \n $select = $adapter->select()->from($table)->where('entity_id IN (?)',$ids);\n $rows = $adapter->query($select)->fetchAll();\n\n foreach($rows as $row) {\n $product = $products[$row['entity_id']];\n \n $images = (array)$product->getData('images');\n if($row['value']) {\n $images[] = $row['value'];\n }\n $product->setData('images',$images);\n }\n //echo $select.PHP_EOL;\n \n \n \n \n }", "function admin_gallery()\n {\n // Require admin login\n if(!(isset($_SESSION['active_user']) && $_SESSION['active_user']['type'] == 'admin'))\n redirect_to('/');\n\n $this->load_outer_template('admin');\n\n if(!isset($this->params[2]) || (!is_numeric($this->params[2])))\n throw new exception(\"No set specified\");\n\n $item = $this->params[2];\n\n $m_gallery = instance_model('gallery');\n $m_set = instance_model('gallery_set');\n $m_member = instance_model('members');\n\n $set = $m_set->get_by_id($item);\n if($set == array())\n throw new exception('Set does not exist');\n\n $member = $m_member->get_by_id($set[0]['Owner']);\n\n if($member == array())\n throw new exception('Member does not exist');\n\n $gallery = $m_gallery->get_in_set($item);\n\n $list = array();\n foreach($gallery as $image)\n {\n $list []= array(\n 'name' => make_url('res', 'gallery', $member[0]['Clean_title'], 'thumbs', $image['File']),\n 'options' => array(\n 'Delete' => make_url('members', 'admin_gallery_delete', $item, $image['ID']))\n );\n }\n\n $view = instance_view('admin/index_generic');\n $view = $view->parse_to_variable(array(\n 'image_mode' => true,\n 'back_url' => make_url('members', 'admin_gallery_set', $set[0]['Owner']),\n 'sortable' => false,\n 'title' => 'Group: ' . $set[0]['Title'],\n 'new_url' => make_url('members', 'admin_gallery_create', $item),\n 'new_name' => 'Upload image',\n 'list' => $list\n ));\n\n\n $this->set_template_paramiters(array(\n 'content' => $view\n ));\n }", "public function testImagesPositionStoreView(\n string $addFromStore,\n array $newImages,\n string $viewFromStore,\n array $expectedImages\n ): void {\n $storeId = (int)$this->storeRepository->get($addFromStore)->getId();\n $product = $this->getProduct($storeId);\n $images = $product->getData('media_gallery')['images'];\n $images = array_merge($images, $newImages);\n $product->setData('media_gallery', ['images' => $images]);\n $updateHandler = Bootstrap::getObjectManager()->create(UpdateHandler::class);\n $updateHandler->execute($product);\n $storeId = (int)$this->storeRepository->get($viewFromStore)->getId();\n $product = $this->getProduct($storeId);\n $this->block->setData('product', $product);\n $actualImages = array_map(\n function ($item) {\n return [\n 'img' => parse_url($item['img'], PHP_URL_PATH),\n 'caption' => $item['caption'],\n 'position' => $item['position'],\n ];\n },\n $this->serializer->unserialize($this->block->getGalleryImagesJson())\n );\n $this->assertEquals($expectedImages, array_values($actualImages));\n }", "private function SetProductImages()\n\t{\n\n\t\t$GLOBALS['ProductThumbWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_STANDARD);\n\t\t$GLOBALS['ProductThumbHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_STANDARD);\n\n\t\t$GLOBALS['ProductMaxTinyWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\t\t$GLOBALS['ProductMaxTinyHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\n\n\t\t$GLOBALS['ProductTinyBoxWidth'] = $GLOBALS['ProductMaxTinyWidth']+4;\n\t\t$GLOBALS['ProductTinyBoxHeight'] = $GLOBALS['ProductMaxTinyHeight']+4;\n\n\n\t\t$GLOBALS['ProductMaxZoomWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t$GLOBALS['ProductMaxZoomHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\n\t\t$GLOBALS['ProductZoomWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t$GLOBALS['ProductZoomHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\n\n\t\t$productImages = ISC_PRODUCT_IMAGE::getProductImagesFromDatabase($GLOBALS['ProductId'], null, false, true);\n\t\t$GLOBALS['NumProdImages'] = count($productImages);\n\n\t\t$GLOBALS['CurrentProdThumbImage'] = 0;\n\t\t$thumb = '';\n\t\t$curZoomImage = '';\n\t\t$GLOBALS['SNIPPETS']['ProductTinyImages'] = '';\n\t\t$GLOBALS['HideImageCarousel'] = 'display:none;';\n\t\t$GLOBALS['HideMorePicturesLink'] = 'display:none;';\n\t\t$thumbImageDescription = '';\n\t\t$i = 0;\n\n\t\t$GLOBALS['ProdImageJavascript'] = '';\n\t\t$GLOBALS['ProdImageZoomJavascript'] = '';\n\t\t$GLOBALS['LightBoxImageList'] = '';\n\t\t$GLOBALS['ZoomImageMaxWidth'] = 0;\n\t\t$GLOBALS['ZoomImageMaxHeight'] = 0;\n\t\t$GLOBALS['ZoomImageMaxWidthHeight'] = 0;\n\t\t$GLOBALS['HideAlwaysLinkedMorePicturesLink'] = 'display: none';\n\n\t\tif ($GLOBALS['NumProdImages']) {\n\t\t\t//Show image carousel\n\n\t\t\tif ($GLOBALS['NumProdImages'] == 2) {\n\t\t\t\t$var = \"MorePictures1\";\n\t\t\t} else if ($GLOBALS['NumProdImages'] == 1) {\n\t\t\t\t$var = \"SeeLargerImage\";\n\t\t\t} else {\n\t\t\t\t$var = \"MorePictures2\";\n\t\t\t}\n\n\t\t\t$GLOBALS['SeeMorePictures'] = sprintf(GetLang($var), count($productImages) - 1);\n\t\t\t$GLOBALS['HideAlwaysLinkedMorePicturesLink'] = '';\n\n\t\t\tif (GetConfig('ProductImagesTinyThumbnailsEnabled')) {\n\t\t\t\t$GLOBALS['HideImageCarousel'] = '';\n\t\t\t} else {\n\t\t\t\t$GLOBALS['HideMorePicturesLink'] = '';\n\t\t\t}\n\n\t\t\t$continue=false;\n\n\t\t\tforeach ($productImages as $productImage) {\n\n\t\t\t\t$thumbURL = '';\n\t\t\t\t$zoomImageURL = '';\n\n\t\t\t\ttry{\n\t\t\t\t\t$thumbURL = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_STANDARD, true);\n\t\t\t\t\t//$GLOBALS['ProductThumbURL'] = $thumbURL;\n\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t}\n\n\t\t\t\ttry{\n\t\t\t\t\t$zoomImageURL = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_ZOOM, true);\n\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t}\n\n\t\t\t\tif($thumbURL == '' && $zoomImageURL == '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$resizedZoomDimension = $productImage->getResizedFileDimensions(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t\t\t$resizedTinyDimension = $productImage->getResizedFileDimensions(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\n\t\t\t\t//calculate the max zoom image width and height\n\t\t\t\tif ($GLOBALS['ZoomImageMaxWidth'] < $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH]) {\n\n\t\t\t\t\t$GLOBALS['ZoomImageMaxWidth'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH];\n\t\t\t\t\t//the height of the image has got the max width needed to calulate the image fancy box size.\n\t\t\t\t\t$GLOBALS['ZoomImageMaxWidthHeight'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t}\n\n\t\t\t\tif ($GLOBALS['ZoomImageMaxHeight'] < $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT]) {\n\t\t\t\t\t$GLOBALS['ZoomImageMaxHeight'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t\t//the width of the image has got the max height needed to calulate the image fancy box size.\n\t\t\t\t\t$GLOBALS['ZoomImageMaxHeightWidth'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t}\n\n\t\t\t\t$GLOBALS['ImageDescription'] = isc_html_escape($productImage->getDescription());\n\t\t\t\tif($GLOBALS['ImageDescription'] == '') {\n\t\t\t\t\t$GLOBALS['ImageDescription'] = GetLang(\"Image\") . \" \" . ($i + 1);\n\t\t\t\t}\n\n\t\t\t\t//show image carousel\n\t\t\t\tif(GetConfig('ProductImagesTinyThumbnailsEnabled')==1) {\n\n\t\t\t\t\t$GLOBALS['ProdImageJavascript'] .= \"\n\t\t\t\t\t\tThumbURLs[\".$i.\"] = \" . isc_json_encode($thumbURL) . \";\n\t\t\t\t\t\tProductImageDescriptions[\".$i.\"] = \" . isc_json_encode($GLOBALS['ImageDescription']) . \";\n\t\t\t\t\t\";\n\t\t\t\t\t$GLOBALS['TinyImageOverJavascript'] = \"showProductThumbImage(\".$i.\")\";\n\t\t\t\t\t//$GLOBALS['ProductTinyImageURL'] = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_TINY, true);\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$GLOBALS['ProductTinyImageURL'] = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_TINY, true);\n\t\t\t\t\t\t//$GLOBALS['ProductThumbURL'] = $thumbURL;\n\t\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['ProductThumbIndex'] = $i;\n\t\t\t\t\tif(GetConfig('ProductImageMode') == 'lightbox') {\n\t\t\t\t\t\t$GLOBALS['TinyImageClickJavascript'] = \"showProductImageLightBox(\".$i.\"); return false;\";\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$GLOBALS['TinyImageClickJavascript'] = \"showProductImage('\".GetConfig('ShopPath').\"/productimage.php', \".$GLOBALS['ProductId'].\", \".$i.\");\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['TinyImageWidth'] = $resizedTinyDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH];\n\t\t\t\t\t$GLOBALS['TinyImageHeight'] = $resizedTinyDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t\t$GLOBALS['TinyImageTopPadding'] = floor(($GLOBALS['ProductMaxTinyHeight'] - $GLOBALS['TinyImageHeight']) / 2);\n\t\t\t\t\t$GLOBALS['SNIPPETS']['ProductTinyImages'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductTinyImage\");\n\t\t\t\t\t$continue = true;\n\t\t\t\t}\n\n\t\t\t\tif(GetConfig('ProductImagesImageZoomEnabled') == 1) {\n\t\t\t\t\t//check if zoom image is large enough for image zoomer\n\t\t\t\t\tif($resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH]<ISC_PRODUCT_IMAGE_MIN_ZOOM_WIDTH && $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT]<ISC_PRODUCT_IMAGE_MIN_ZOOM_HEIGHT) {\n\t\t\t\t\t\t$zoomImageURL = '';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ProdImageZoomJavascript'] .= \"\n\t\t\t\t\t\tZoomImageURLs[\".$i.\"] = \" . isc_json_encode($zoomImageURL) . \";\n\t\t\t\t\t\";\n\t\t\t\t\t$continue = true;\n\t\t\t\t}\n\n\t\t\t\t//\t$GLOBALS['ProductZoomImageURL'] = $zoomImageURL;\n\n\t\t\t\t//this image is the product page thumbnail\n\t\t\t\tif($i==0) {\n\t\t\t\t\t//get the thumb image for product page\n\t\t\t\t\t$thumb = $thumbURL;\n\t\t\t\t\t$curZoomImage = $zoomImageURL;\n\t\t\t\t\t$thumbImageDescription = $GLOBALS['ImageDescription'];\n\t\t\t\t\t//if there is no need to loop through images anymore, get out from the loop.\n\t\t\t\t\tif($continue === false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['VisibleImageTotal'] = $i+1;\n\n\t\t$GLOBALS['ShowImageZoomer'] = GetConfig('ProductImagesImageZoomEnabled');\n\t\tif ($GLOBALS['ShowImageZoomer']) {\n\t\t\t$GLOBALS['SNIPPETS']['ProductImageZoomer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductImageZoomer\");\n\t\t}\n\t\t$GLOBALS['ZoomImageURL'] = $curZoomImage;\n\n\t\t//if no product thumb images\n\t\tif($thumb == '') {\n\t\t\tif(GetConfig('DefaultProductImage') == 'template') {\n\t\t\t\t$thumb = $GLOBALS['IMG_PATH'].'/ProductDefault.gif';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$thumb = GetConfig('ShopPath').'/'.GetConfig('DefaultProductImage');\n\t\t\t}\n\t\t}\n\n\t\t// need to check for variation images\n\t\t$GLOBALS['ImageDescription'] = $thumbImageDescription;\n\t\t$GLOBALS['ThumbImageURL'] = $thumb;\n\n\t\tif ($GLOBALS['NumProdImages']) {\n\t\t\t$GLOBALS['SNIPPETS']['ProductThumbImage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('FastProductThumbImage');\n\t\t} else {\n\t\t\t$GLOBALS['SNIPPETS']['ProductThumbImage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductThumbImagePlaceholder');\n\t\t}\n\t}", "public function multiUpload()\n {\n $gallery_id = Input::get('gallery_id');\n $gallery = PhotoGallery::where('id', '=', $gallery_id)->first();\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $flags = $this->language->getAllDataNoPagination();\n\n return view('cms.modules.multicms.photos_multiUp', compact('flags', 'gallery'), $data);\n\n }", "public function processImages()\n \t{\n $this->save();\n if (! $this->errorMessage)\n \t\t parent::uploadImages('image', 'RecipeImage', \"recipeID\");\n \n \t}", "public function removePhoto($value)\n {\n $key = array_search($value, $this->photos);\n if($key !== false) {\n unset($this->photos[$key]);\n }\n }", "public function photos() {\n return $this->hasMany('\\P4\\Photo');\n }", "public function setPhotoID($value)\n {\n return $this->set('PhotoID', $value);\n }", "public function setPhotoID($value)\n {\n return $this->set('PhotoID', $value);\n }", "public function setPhotoID($value)\n {\n return $this->set('PhotoID', $value);\n }", "public function reassignFeaturedImage()\n {\n\n }", "public static function renumberImages($numOfPics, $sid, $modvars) {\n $uploaddir = $modvars['picupload_uploaddir'] . DIRECTORY_SEPARATOR;\n $lastfile = 0;\n for ($i=0; $i<$numOfPics; $i++){\n $filename = 'pic_sid' . $sid . \"-\";\n if (file_exists($uploaddir . $filename . $i . \"-norm.jpg\")) {\n rename($uploaddir . $filename . $i . \"-norm.jpg\", $uploaddir . $filename . $lastfile . \"-norm.jpg\");\n rename($uploaddir . $filename . $i . \"-thumb.jpg\", $uploaddir . $filename . $lastfile . \"-thumb.jpg\");\n rename($uploaddir . $filename . $i . \"-thumb2.jpg\", $uploaddir . $filename . $lastfile . \"-thumb2.jpg\");\n // create a new hometext image if needed\n if ($lastfile == 0 && !file_exists($uploaddir . $filename . $lastfile . \"-thumb2.jpg\")) {\n require_once ('modules/News/lib/vendor/phpthumb/ThumbLib.inc.php');\n $method = ($modvars['picupload_sizing'] == '0') ? 'Resize' : 'adaptiveResize';\n $thumb2 = PhpThumbFactory::create($uploaddir . $filename . $lastfile . \"-norm.jpg\", array('jpegQuality' => 80));\n $thumb2->$method($modvars['picupload_thumb2maxwidth'],$modvars['picupload_thumb2maxheight']);\n $thumb2->save($uploaddir . $filename . $lastfile . '-thumb2.jpg', 'jpg');\n }\n $lastfile++;\n }\n }\n //LogUtil::registerStatus(__f('Images renumbered (%s)', $lastfile, ZLanguage::getModuleDomain('News')));\n return $lastfile;\n }", "public function photos() {\n return $this->hasMany('App\\Models\\ProductPhoto');\n }", "public function productimages() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){\n //upload and save image\n if (!empty($this->request->get['other']) && $this->request->get['other'] == 1) {\n $this->addProductImage($this->request);\n } else {\n $this->updateProductImage($this->request);\n }\n }\n }" ]
[ "0.61253875", "0.58572537", "0.57873374", "0.5724591", "0.56968266", "0.5540416", "0.55236626", "0.54659045", "0.5458521", "0.5396567", "0.5370602", "0.5351635", "0.534072", "0.5332234", "0.5330528", "0.53213567", "0.5305942", "0.52972233", "0.5249905", "0.52400357", "0.52374434", "0.5222922", "0.5196542", "0.51654136", "0.5161003", "0.51488006", "0.51370203", "0.51263833", "0.5109929", "0.51023376", "0.51019436", "0.5091793", "0.5077167", "0.5072066", "0.50619614", "0.50550294", "0.5048906", "0.503913", "0.5031719", "0.5031185", "0.5015099", "0.50062484", "0.49914345", "0.4976739", "0.49705216", "0.4956737", "0.49460432", "0.49328586", "0.49285915", "0.4917168", "0.49134144", "0.4910454", "0.4907105", "0.49047568", "0.48992303", "0.48904628", "0.48866022", "0.48858333", "0.48729792", "0.4870208", "0.4868034", "0.48633412", "0.4857818", "0.48441726", "0.48237097", "0.48227", "0.48104692", "0.47981456", "0.4788679", "0.47874743", "0.47838765", "0.47826082", "0.47781414", "0.47781333", "0.4768484", "0.4764779", "0.47587463", "0.47501442", "0.47496283", "0.4747895", "0.47449714", "0.47313675", "0.47257304", "0.47213468", "0.47084814", "0.47014546", "0.469825", "0.4690953", "0.46879333", "0.46681854", "0.4667918", "0.4667079", "0.4665486", "0.46642977", "0.4661804", "0.4661804", "0.46587312", "0.46529377", "0.4649961", "0.46454385" ]
0.6656051
0
Returns next and previous photos for a photo in a set.
function photosets_getContext ($photoset_id, $photo_id) { $response = $this->execute(array('method' => 'flickr.photosets.getContext', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { unset($object['stat']); return $object; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function photos(Builder $photos_sql)\n\t{\n\n\t\t$previousPhotoID = '';\n\t\t$return_photos = array();\n\t\t$photo_counter = 0;\n\t\t$photos = $photos_sql->get();\n\t\tforeach ($photos as $photo_model) {\n\n\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t$photo = $photo_model->prepareData();\n\n\t\t\t// Set previous and next photoID for navigation purposes\n\t\t\t$photo['previousPhoto'] = $previousPhotoID;\n\t\t\t$photo['nextPhoto'] = '';\n\n\t\t\t// Set current photoID as nextPhoto of previous photo\n\t\t\tif ($previousPhotoID !== '') {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $photo['id'];\n\t\t\t}\n\t\t\t$previousPhotoID = $photo['id'];\n\n\t\t\t// Add to return\n\t\t\t$return_photos[$photo_counter] = $photo;\n\n\t\t\t$photo_counter++;\n\t\t}\n\n\t\tif (count($return_photos) > 0) {\n\t\t\t// Enable next and previous for the first and last photo\n\t\t\t$lastElement = end($return_photos);\n\t\t\t$lastElementId = $lastElement['id'];\n\t\t\t$firstElement = reset($return_photos);\n\t\t\t$firstElementId = $firstElement['id'];\n\n\t\t\tif ($lastElementId !== $firstElementId) {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $firstElementId;\n\t\t\t\t$return_photos[0]['previousPhoto'] = $lastElementId;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_photos;\n\t}", "private function getNextPrevIds() {\n $arrReturn = array();\n\n //Load all images on the current level\n $objCur = class_objectfactory::getInstance()->getObject($this->getSystemid());\n $arrImagesLevel = class_module_mediamanager_file::loadFilesDB($objCur->getPrevId(), class_module_mediamanager_file::$INT_TYPE_FILE, true);\n //Sort out the unallowed ones\n foreach($arrImagesLevel as $intKey => $objOneImage) {\n if(!$objOneImage->rightView())\n unset($arrImagesLevel[$intKey]);\n }\n\n //make array-keys numeric\n /** @var $arrImagesLevel class_module_mediamanager_file[] */\n $arrImagesLevel = array_values($arrImagesLevel);\n //Search the current image\n $intKeyHit = 0;\n foreach ($arrImagesLevel as $intKeyHit => $objOneImage) {\n if($objOneImage->getSystemid() == $this->getSystemid()) {\n break;\n }\n }\n\n $arrReturn[\"forward_1\"] = (isset($arrImagesLevel[$intKeyHit+1]) ? $arrImagesLevel[$intKeyHit+1]->getSystemid() : \"\");\n $arrReturn[\"forward_2\"] = (isset($arrImagesLevel[$intKeyHit+2]) ? $arrImagesLevel[$intKeyHit+2]->getSystemid() : \"\");\n $arrReturn[\"forward_3\"] = (isset($arrImagesLevel[$intKeyHit+3]) ? $arrImagesLevel[$intKeyHit+3]->getSystemid() : \"\");;\n\n $arrReturn[\"backward_1\"] = (isset($arrImagesLevel[$intKeyHit-1]) ? $arrImagesLevel[$intKeyHit-1]->getSystemid() : \"\");;\n $arrReturn[\"backward_2\"] = (isset($arrImagesLevel[$intKeyHit-2]) ? $arrImagesLevel[$intKeyHit-2]->getSystemid() : \"\");;\n $arrReturn[\"backward_3\"] = (isset($arrImagesLevel[$intKeyHit-3]) ? $arrImagesLevel[$intKeyHit-3]->getSystemid() : \"\");;\n\n return $arrReturn;\n }", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotoNextPrevious($id, $filterOpts = null)\n {\n $buildQuery = $this->buildQuery($filterOpts, null, null);\n $photo = $this->getPhoto($id);\n if(!$photo)\n return false;\n\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} AND dateTaken>'{$photo['dateTaken']}' ORDER BY dateTaken ASC LIMIT 1\");\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} AND dateTaken<'{$photo['dateTaken']}' ORDER BY dateTaken DESC LIMIT 1\");\n $responses = $this->db->batch($queue)->send();\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $ret = array();\n if(isset($responses[0]->body->SelectResult->Item))\n $ret['previous'] = self::normalizePhoto($responses[0]->body->SelectResult->Item);\n if(isset($responses[1]->body->SelectResult->Item))\n $ret['next'] = self::normalizePhoto($responses[1]->body->SelectResult->Item);\n\n return $ret;\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function getSiblings()\n\t{\n\t\t$folderFiles = $this->Parent->Files;\n\t\tforeach ($folderFiles as $key => $item) {\n\t\t\tif ($this->name == $item->name) {\n\t\t\t\t$prev = $key - 1;\n\t\t\t\t$current = $key + 1;\n\t\t\t\t$next = $key + 1;\n\t\t\t}\n\t\t}\n\t\tif ($next >= count($folderFiles)) {\n\t\t\t$next = 0;\n\t\t}\n\t\tif ($prev < 0) {\n\t\t\t$prev = count($folderFiles) - 1;\n\t\t}\n\n\t\t$result = new stdClass();\n\t\t$result->next = $folderFiles[$next];\n\t\t$result->previous = $folderFiles[$prev];\n\t\t$result->current = $current;\n\t\t$result->count = count($folderFiles);\n\n\t\treturn $result;\n\t}", "public function getPhotos();", "public function getPrevious();", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "public function getPhotos($page, $itemsPerPage);", "function getFirstPhoto()\n\t{\n\t\treturn array_shift( $this->getPhotos() ); \n\t}", "public function prevNext(): array\n {\n $file = $this->model;\n $siblings = $file->templateSiblings()->sortBy(\n 'sort',\n 'asc',\n 'filename',\n 'asc'\n );\n\n return [\n 'next' => function () use ($file, $siblings): ?array {\n $next = $siblings->nth($siblings->indexOf($file) + 1);\n return $next ? $next->panel()->toLink('filename') : null;\n },\n 'prev' => function () use ($file, $siblings): ?array {\n $prev = $siblings->nth($siblings->indexOf($file) - 1);\n return $prev ? $prev->panel()->toLink('filename') : null;\n }\n ];\n }", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "function photos_getNotInSet ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = 'all', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getNotInSet';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPrevious() {}", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "private function get_prev_next($array, $current) {\n $pn = new stdClass();\n\n $hascurrent = $pn->next = $pn->prev = false;\n\n foreach ($array as $a) {\n if ($hascurrent) {\n $pn->next = $a;\n break;\n }\n if ($a == $current) {\n $hascurrent = true;\n } else {\n if (!$hascurrent) {\n $pn->prev = $a;\n }\n }\n }\n return $pn;\n }", "public function getPhotoUrls () {\n\t\t\n\t}", "public function prev_next_post($id_post)\n\t\t{\n\t\t\t$this->set_files_by_published();\n\n\t\t\t$filename['prev'] = false;\n\t\t\t$filename['next'] = false;\n\n\t\t\t$i = 0;\n\n\t\t\twhile($this->files_count>$i)\n\t\t\t{\n\t\t\t\t$explode = explode(\".\",$this->files[$i]);\n\n\t\t\t\t$id = (int)$explode[1];\n\n\t\t\t\tif($id==$id_post)\n\t\t\t\t{\n\t\t\t\t\t$filename['prev'] = isset($this->files[$i+1])?$this->files[$i+1]:false;\n\t\t\t\t\t$filename['next'] = isset($this->files[$i-1])?$this->files[$i-1]:false;\n\t\t\t\t}\n\n\t\t\t\t$i = $i + 1;\n\t\t\t}\n\n\t\t\t$tmp['prev'] = $filename['prev']==false?false:$this->get_items($filename['prev']);\n\t\t\t$tmp['next'] = $filename['next']==false?false:$this->get_items($filename['next']);\n\n\t\t\treturn $tmp;\n\t\t}", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getPrevSibling();", "function get_object_images($obj_type, $obj_id, $image_sizes = array(), $order = 'ASC')\n{\n $rows = db_get_list_by_query('SELECT * FROM object_images WHERE obj_type = \"' . \n strtok($obj_type, \" \") . '\" AND obj_id = ' . (int)$obj_id . \n ' ORDER by `order` ' . strtok($order, \" \"));\n if (!$rows)\n return;\n\n\n $images = array();\n foreach ($rows as $id => $row) {\n $images[$id] = get_images($row['img_id'], $image_sizes);\n $images[$id]['id'] = $row['id'];\n }\n\n $images = add_prev_next($images);\n return $images;\n}", "public function getPicturesInSlider(): PictureCollection;", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getPrevSiblings(array $columns = ['*']);", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "function be_make_prev_next( $output, $id, $size, $permalink, $icon, $text ) {\n\tif( '&laquo; Previous Photo' == $text )\n\t\t$output = '<span class=\"prev\">' . $output . '</span>';\n\t\n\tif( 'Next Photo &raquo;' == $text )\n\t\t$output = '<span class=\"next\">' . $output . '</span>';\n\t\t\n\treturn $output;\n}", "public function getAllPhotos();", "public function previous() {\r\n return prev($this->collection);\r\n }", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function getTenLatestPhotos();", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "function get_pics($db,$tag,$current,$num=5) {\n\t\n\t// holder for pictures selected\n\t$pics = array();\n\t\n\t// condition to search on to avoid picking dupes\n\t$cond = (count($current)) ? 'id !=' . implode(\" AND id !=\", $current) : '1';\n\t\n\t\n\t$card_deck = CARD_DECK; // database table for photos\n\t\n\t// query for random selection from database\n\t$query = \"SELECT * FROM $card_deck WHERE $cond and tag='$tag' and active=1 ORDER BY RAND() limit 0,$num\";\n\t\n\t$result = mysqli_query($db, $query);\t\n\tif (mysqli_error($db) ) echo 'Ouch! Database problem:' . mysqli_error($db);\n\t\n\t while ($row = mysqli_fetch_array($result)) {\n\t \t$pics[] = array(\n\t \t\t'id' => $row['id'], \n\t \t\t'url' => \"https://farm\" . $row['farm'] . \".static.flickr.com/\" . $row['server'] . \"/\" . $row['fid'] . \"_\" . $row['secret'] . \"_m.jpg\",\n\t \t\t'link' => \"http://www.flickr.com/photos/\" . $row['nsid'] . \"/\" . $row['fid'] . \"/\",\n\t \t\t'credit' => stripslashes($row['username']),\n\t \t\t);\n }\n\n\treturn $pics;\n}", "public function previousElement();", "public function getNext ()\n {\n return prev ( $this->_list ) ;\n }", "function prev() {\n\n $next = $this->find('first', array('conditions'=>array('position <'=>$this->data['Ringsite']['position']),\n 'order'=>'position DESC'));\n\n if (empty($next)) {\n $next = $this->find('first', array('conditions'=>array('position >='=>0),\n 'order'=>'position DESC'));\n }\n\n return $next;\n }", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "function prev_next($id, $type){\n\tglobal $db;\n\t$total_count_query = \"SELECT count(*) FROM shit WHERE type = '\".$type.\"' ORDER BY id ASC\";\n\t$r_total = $db->get_results($total_count_query, ARRAY_A);\n\t\n\t$q_prev = \"SELECT * FROM shit WHERE id > \".$id.\" AND type = '\".$type.\"' ORDER BY id ASC LIMIT 0,1\";\n\t$r_prev = $db->get_results($q_prev, ARRAY_A);\n\n\t$q_next = \"SELECT * FROM shit WHERE id < \".$id.\" AND type = '\".$type.\"' ORDER BY id DESC LIMIT 0,1\"; \n\t$r_next = $db->get_results($q_next, ARRAY_A);\n\n\t#print_r($r_total);\n\t\n\t$return = '';\n\tif($r_total[0]['count(*)'] > 0){\n\t\t$return.= '<li>';\n\t\tif(count($r_prev) > 0) {\n\t\t\t$return.= ' <a href=\"index.php?select='.$r_prev[0]['type'].'&id='.$r_prev[0]['id'].'\" title=\"'.ucwords(stripslashes($r_prev[0]['title'])).'\">Previous</a> / ';\n\t\t} else { \n\t\t\t$return.= ' <span style=\"color:#ccc;\">Previous</span> / ';\n\t\t}\n\t\t\n\t\t$return.= '</li> <li>';\n\t\tif(count($r_next) > 0) {\n\t\t\t$return.= ' <a href=\"index.php?select='.$r_next[0]['type'].'&id='.$r_next[0]['id'].'\" title=\"'.ucwords(stripslashes($r_next[0]['title'])).'\">Next</a> / ';\n\t\t} else {\n\t\t\t$return.= ' <span style=\"color:#ccc;\">Next</span> / ';\n\t\t} \n\n\t\t\n\t\t$return.= '</li>';\n\t} else { $return = null;}\n\t\n\treturn($return);\n}", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPreviousAndNextSibblings($id)\n {\n $sibblings = $this->getSibblings($id);\n\n for ($i = 0; $i < count($sibblings); $i++) {\n\n if ($sibblings[$i]->id === $id) {\n $prev = $sibblings[$i - 1] ?? null;\n $next = $sibblings[$i + 1] ?? null;\n return [$prev, $next];\n }\n }\n }", "function get_adjacent_image_link($prev = true, $text = \"test\") {\n\t\tglobal $post;\n\t\t$post = get_post($post);\n\t\t$attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));\n\t\tforeach ( $attachments as $k => $attachment )\n\t\t\tif ( $attachment->ID == $post->ID )\n\t\t\t\tbreak;\n\t\t$k = $prev ? $k - 1 : $k + 1;\n\t\tif ( isset($attachments[$k]) )\n\t\t\treturn wp_get_attachment_link($attachments[$k]->ID, '' , true, false, $text);\n\t}", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function getPrevSibling(array $columns = ['*']);", "public function getPrev() {\n\t\treturn $this->pagefiles->getPrev($this); \n\t}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "private function getPhotoList($html)\n {\n $matches = array();\n $photoList = array();\n $profileSharedData = array();\n\n if (preg_match(\"#_sharedData = (\\{.*});<\\/script>#\", $html, $matches)) {\n if ((isset($matches[1])) && (!empty($matches[1]))) {\n $profileSharedData = json_decode($matches[1], true);\n }\n }\n\n if (isset($profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'])) {\n $timeLineMedia = $profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'];\n\n if (!isset($timeLineMedia['count']) || ($timeLineMedia['count'] == 0)) {\n throw new Exception(\"This profile doesn't have any photo.\", self::ERROR_PROFILE_NO_PHOTO);\n } elseif (isset($timeLineMedia['edges']) && (count($timeLineMedia['edges']) === 0)) {\n throw new Exception(\"This is a private account.\", self::ERROR_PROFILE_NO_PHOTO);\n }\n\n foreach ($timeLineMedia['edges'] as $photo) {\n if (true == $photo['node']['is_video']) {\n continue;\n }\n\n $photoList[] = array(\n 'shortcode' => $photo['node']['shortcode'],\n 'display_url' => $photo['node']['display_url'],\n 'thumbnail_src' => $photo['node']['thumbnail_src'],\n 'thumbnail_resources' => $photo['node']['thumbnail_resources'],\n 'dimensions' => $photo['node']['dimensions'],\n 'liked_by' => $photo['node']['edge_liked_by']['count'],\n 'comment_by' => $photo['node']['edge_media_to_comment']['count'],\n );\n }\n }\n\n return $photoList;\n }", "function ve_get_360_photos() {\n\t$field_name_repeater = '';\n\t$photo_url_field = '';\n\tif ( is_singular( 'companies' ) ) {\n\t\t$field_name_repeater = 'company_threesixty_photos_repeater';\n\t\t$photo_url_field = 'company_threesixty_photo_url';\n\t}\n\tif ( is_singular( 'group_of_companies' ) ) {\n\t\t$field_name_repeater = 'group_of_companies_threesixty_photos_repeater';\n\t\t$photo_url_field = 'group_of_companies_threesixty_photo_url';\n\t}\n\tif (have_rows($field_name_repeater) ) {\n\t\t/**\n\t\t * Go through all the data in company_youtube_repeater field:\n\t\t */\n\t\t?>\n\t\t<div id=\"owl-threesixty-photos\" class=\"owl-carousel owl-theme\">\n\t\t\t<?php\n\t\t\twhile (have_rows($field_name_repeater) ) {\n\t\t\t\tthe_row();\n\t\t\t\t?>\n\t\t\t\t<div class=\"item\">\n\t\t\t\t\t<blockquote data-mode=\"click2play\" data-width=\"100%\" data-height=\"500px\" class=\"ricoh-theta-spherical-image\" ><?php echo get_sub_field($photo_url_field); ?><a href=\"<?php echo get_sub_field($photo_url_field); ?>\" target=\"_blank\"></a></blockquote>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<script async src=\"https://theta360.com/widgets.js\" charset=\"utf-8\"></script>\n\t\t<?php\n\t}\n\t/**\n\t * If there are NO 360 photos:\n\t */\n\telse {\n\t\t// Do nothing\n\t}\n}", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "function get_images_at_begining($image_array){\n $images = array();\n if(count($image_array) > 7 ){\n for($i=0;$i<7;$i++){\n $images[$i] = $image_array[$i];\n }\n return $images;\n }\n else{\n return $image_array;\n }\n }", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function sel_next_image_id()\n\t{\n\t\t$image_id = null;\n\t\ttry{\n\t\t\t$m_image = new Model_M_Image($this->db, $this->client_id);\n\t\t\t$image_id = $m_image->sel_next_id();\n\t\t} catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$image_id = null;\n\t\t}\n\t\treturn $image_id;\n\t}", "public function getPreviousPage();", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "public function getPrev($criteria = null)\n\t{\n\t\treturn $this->_getRelativeElement($criteria, -1);\n\t}", "function get_adjacent_image_link($prev = \\true, $size = 'thumbnail', $text = \\false)\n {\n }", "public function getSortedImages()\n {\n $images = ArrayHelper::index($this->images, 'id');\n if ($images) {\n $image = $images[$this->primaryImage->id];\n unset($images[$this->primaryImage->id]);\n $images = array_merge([$image], $images);\n }\n \n return $images;\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getPrevSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rightAttribute).'='.($owner->{$this->leftAttribute}-1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "public function prevNext(): array\n {\n $user = $this->model;\n\n return [\n 'next' => function () use ($user) {\n $next = $user->next();\n return $next ? $next->panel()->toLink('username') : null;\n },\n 'prev' => function () use ($user) {\n $prev = $user->prev();\n return $prev ? $prev->panel()->toLink('username') : null;\n }\n ];\n }", "public static function get_prev_next_post( $previous ) {\n\t\tif ( ! TpsOptions::get( 'button_behaviour' ) === 'post' ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( TpsOptions::get( 'post_navigation_inverse' ) ) {\n\t\t\t$previous = ! $previous;\n\t\t}\n\n\t\t$post = get_adjacent_post( TpsOptions::get( 'post_navigation_same_category' ), '', $previous );\n\t\tif ( ! $post ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $post->ID;\n\t}", "function photos_search ($per_page = 25, $page = 1, $tags = NULL, $text = NULL, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.search';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($tags) {\n\t\t\t$tags = explode(',', $tags);\n\t\t\tarray_map('trim', $tags);\n\t\t\t$tags = implode(',', $tags);\n\t\t\t$params['tags'] = $tags;\n\t\t}\n\t\tif ($text) $params['text'] = trim($text);\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_pages_images_list() {\n\t$files = scandir(BASEPATH . \"/../public/images/pages\");\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\treturn $files;\n}", "public function getNext() {\n\t\treturn $this->pagefiles->getNext($this); \n\t}", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function countPrevSiblings();", "function combo_get_image_paths($selected_path, $base_url, $base_path)\n{\n $out = new Tempcode();\n\n $paths = get_image_paths($base_url, $base_path);\n $i = 0;\n foreach ($paths as $pretty => $url) {\n $checked = (($url == $selected_path) || (($selected_path == '') && ($i == 0)));\n $out->attach(do_template('FORM_SCREEN_INPUT_RADIO_LIST_ENTRY_PICTURE', array('_GUID' => 'd2ff01291e5f0c0e4cf4ee5b6061593c', 'CHECKED' => $checked, 'NAME' => 'path', 'VALUE' => $url, 'URL' => $url, 'PRETTY' => $pretty)));\n $i++;\n }\n\n return $out;\n}", "function cs_media_pagination(){\n\tforeach ( $_REQUEST as $keys=>$values) {\n\t\t$$keys = $values;\n\t}\n\t$records_per_page = 10;\n\tif ( empty($page_id) ) $page_id = 1;\n\t$offset = $records_per_page * ($page_id-1);\n?>\n\t<ul class=\"gal-list\">\n <?php\n $query_images_args = array('post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,);\n $query_images = new WP_Query( $query_images_args );\n if ( empty($total_pages) ) $total_pages = count( $query_images->posts );\n\t\t$query_images_args = array('post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => $records_per_page, 'offset' => $offset,);\n $query_images = new WP_Query( $query_images_args );\n $images = array();\n foreach ( $query_images->posts as $image) {\n \t$image_path = wp_get_attachment_image_src( $image->ID, array( get_option(\"thumbnail_size_w\"),get_option(\"thumbnail_size_h\") ) );\n ?>\n \t<li style=\"cursor:pointer\"><img src=\"<?php echo $image_path[0]?>\" onclick=\"javascript:clone('<?php echo $image->ID?>')\" alt=\"\" /></li>\n <?php\n }\n ?>\n </ul>\n <br />\n <div class=\"pagination-cus\">\n \t<ul>\n\t\t\t\t<?php\n if ( $page_id > 1 ) echo \"<li><a href='javascript:show_next(\".($page_id-1).\",$total_pages)'>Prev</a></li>\";\n for ( $i = 1; $i <= ceil($total_pages/$records_per_page); $i++ ) {\n if ( $i <> $page_id ) echo \"<li><a href='javascript:show_next($i,$total_pages)'>\" . $i . \"</a></li> \";\n else echo \"<li class='active'><a>\" . $i . \"</a></li>\";\n }\n if ( $page_id < $total_pages/$records_per_page ) echo \"<li><a href='javascript:show_next(\".($page_id+1).\",$total_pages)'>Next</a></li>\";\n ?>\n\t\t\t</ul>\n </div>\n<?php\n\tif ( isset($_POST['action']) ) die();\n}", "public function getImages(){\n\t\t@$dom = new DOMDocument();\n\t\t@$dom->loadHTML($this->html);\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// Create DOMXpath and get images\n\t\t$xpath = new DOMXpath($dom);\n\t\t$imgs = $xpath->query(\"//img\");\n\t\t\n\t\t// Return array\n\t\t$ret = array();\n\t\t\n\t\t// Loop results and return\n\t\tfor ($i = 0; $i < $imgs->length; $i++) {\n\t\t\t$img = $imgs->item($i);\n\t\t\t$src = $img->getAttribute(\"src\");\n\t\t\t\n\t\t\t// Make sure it's a complete URL\n\t\t\t$src = self::filterUrl($src);\n\t\t\tif($src === false) continue;\n\t\t\t\n\t\t\tarray_push($ret, $src);\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "function get_previous_comic($in_same_category = false, $category = null) { return get_adjacent_comic($category, true, $in_same_category); }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "private function next()\n {\n if ($this->firstIteration) {\n $this->firstIteration = false;\n\n return $this->getSetValues();\n }\n\n if (false === $this->isSelector2AtRowEnd()) {\n $this->setCollection[$this->setSelectorIndex2]->next();\n\n return $this->getSetValues();\n }\n\n while ($this->isSelector2AtRowEnd() && $this->setSelectorIndex1 < $this->setSelectorIndex2) {\n $this->decreaseSetSelectorIndex2();\n }\n\n if ($this->areSelectorsOnSameRow()) {\n if (\n $this->setSelectorIndex1 === 0\n && $this->isSelector1AtRowEnd()\n && $this->isSelector2AtRowEnd()\n ) {\n return false;\n }\n\n if ($this->isSelector1AtRowEnd()) {\n $this->decreaseSetSelectorIndex1();\n }\n\n $this->setCollection[$this->setSelectorIndex1]->next();\n $this->resetSetSelectorIndex2();\n $this->resetIndexesBelowSetSelector1();\n return $this->getSetValues();\n }\n\n if (false === $this->areSelectorsOnSameRow()) {\n $this->setCollection[$this->setSelectorIndex2]->next();\n $this->resetIndexesBelowSetSelector2();\n $this->resetSetSelectorIndex2();\n\n return $this->getSetValues();\n }\n\n return false;\n }", "public function next($search=null){\n\t\treturn $this->look_on_same_row(\"next\",$search);\n\t}", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "protected function getPhotos(Item $album, $number)\n {\n return $album->photos()\n ->uploaded()\n ->orderBy('likes', 'desc')\n ->inRandomOrder()\n ->take($number)\n ->get()\n ->sortBy('number');\n }", "function thumb_imagenavigation($currImage, &$images, $thumbset) {\n\n\t\t// SET THUMB NUMBER AND SIZE\n\t\t$nthumbs = 5;\t\t// default displayed nav thumbs total\n\t\t$divisor = 2.5;\t// default divisor (thumb size)\n\t\t$poscurr = 3;\t\t// default position of current thumb\n\t\t$isuffix = '';\t\t// image suffix\n\t\tif (is_array($thumbset)) {\n\t\t\t$nthumbs = ($thumbset['num'] < 1)? 0: (int)$thumbset['num'];\n\t\t\t$divisor = ($thumbset['div'] < 1)? 1:(float)$thumbset['div'];\n\t\t\t$poscurr = (int)ceil($nthumbs/2);\n\t\t}\n\t\telseif (defined('USER_ADMIN')) {\n\t\t\t$divisor = 3.2;\n\t\t\t$isuffix = (string)('?'. rand(0,10000));\n\t\t}\n\n\t\t// GET START AND END INDEX\n\t\t$totalImages = count($images);\n\t\t$idx = max($currImage - $poscurr, 0);\n\t\tif ($idx + $nthumbs < $totalImages)\n\t\t\t$end = $idx + $nthumbs;\n\t\telse {\n\t\t\t$end = $totalImages;\n\t\t\t$idx = max($end - $nthumbs, 0);\n\t\t}\n\n\t\t// CREATE THUMB NAVIGATION LINE\n\t\t$imageTag\t\t = '<img class=\"%s\" src=\"./%s'.$isuffix.'\" %s title=\"%4$s\" alt=\"%4$s\" />';\n\t\t$this->nav_this = '';\n\t\tfor (; $idx < $end; $idx++) {\n\n\t\t\t// CURRENT IMAGE ID\n\t\t\t$currID = (int)$images[$idx][0];\n\n\t\t\t// GET THUMB FILE\n\t\t\tlist($thumbID, $thumbFile, $thumbWidth, $thumbHeight) = $this->getFileIcon($currID);\n\n\t\t\t// THUMB SIZE ATTRIBUTE\n\t\t\t$thumbSize = sprintf('width=\"%d\" height=\"%d\"',\n\t\t\t\t\t\t\t\t max(round($thumbWidth/$divisor, 0), 5),\n\t\t\t\t\t\t\t\t max(round($thumbHeight/$divisor, 0), 5)\n\t\t\t\t\t\t\t );\n\n\t\t\t// THUMB TITLE\n\t\t\t$title = ($idx+1) .' '. $this->lang['of'] .' '. $totalImages;\n\n\t\t\t// DISPLAYED IMAGE\n\t\t\tif ($currImage === $idx+1) {\n\t\t\t\t$class = 'activ';\n\t\t\t\t$this->nav_this.= sprintf($imageTag, $class, $thumbFile, $thumbSize, $title);\n\t\t\t\t$this->nav_this.= \"&nbsp;\\n\";\n\t\t\t}\n\t\t\t// NOT DISPLAYED IMAGES\n\t\t\telseif (is_readable($thumbFile)) {\n\t\t\t\t$class = 'inactiv';\n\t\t\t\t$this->nav_this.= (defined('USER_ADMIN'))?\n\t\t\t\t\t\t\t\t\t\tsprintf(\"<a href=\\\"%s?editID=%s\\\">%s</a>&nbsp;\\n\",\n\t\t\t\t\t\t\t\t\t\t\tADMIN_INDEX,\n\t\t\t\t\t\t\t\t\t\t\t$currID,\n\t\t\t\t\t\t\t\t\t\t\tsprintf($imageTag, $class, $thumbFile, $thumbSize, $title)\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t\t\t\tsprintf(\"<a href=\\\"%s\\\">%s</a>&nbsp;\\n\",\n\t\t\t\t\t\t\t\t\t\t\t$this->getGalleryLink(array('iID'=>$currID)),\n\t\t\t\t\t\t\t\t\t\t\tsprintf($imageTag, $class, $thumbFile, $thumbSize, $title)\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function getAllThePhotosAccordingTolAlbum($offset,$photo_per_page,$albumId){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myQuery=\"SELECT photo FROM photo WHERE album_id='\".$albumId.\"' LIMIT $offset,$photo_per_page\";\n\t\t\t $result=$conn->query($myQuery);\n\t\t\t foreach($result as $image){\n\t\t\t\t array_push($this->photos,$image['photo']);\n\t\t\t }\n\t\t\t $conn=null;\n\t\t\t return $this->photos;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function getAroundPhotos($latMin, $latMax, $lngMin, $lngMax, $photosArray){\n $sql = 'SELECT * FROM photos WHERE lat > ? && lat < ? && lng > ? && lng < ? && status=0';\n $aroundPhotos = $this->executeQuery($sql, array($latMin, $latMax, $lngMin, $lngMax));\n $array = json_decode($photosArray);\n $data = [];\n //retain the prefix to retrieve the id of the photo\n foreach($array as $key => $element){\n $array[$key]= str_replace('photo_', '', $element);\n }\n while ($aPhoto = $aroundPhotos->fetch(\\PDO::FETCH_ASSOC))\n {\n $data [] = $aPhoto;\n }\n /*for each photo of the secondary gallery if is id already present in the\n main gallery we remove the photo of the secondary gallery*/\n foreach ($data as $photo){\n if (in_array($photo['id'], $array)){\n unset($data[array_search($photo, $data)]);\n }\n }\n return $data;\n }", "function email_get_nextprevmail($mailid, $mails, $nextorprevious) {\n\n\t// To array\n\t// Character alfanumeric, becase optional_param clean anothers tags.\n\t$mailsids = explode('a', $mails);\n\n\tif ( $mailsids ) {\n\t\t$prev = 0;\n\t\t$next = false;\n\t\tforeach ($mailsids as $mail) {\n\t\t\tif ( $next ) {\n\t\t\t\treturn $mail; // Return next \"record\"\n\t\t\t}\n\t\t\tif ( $mail == $mailid ) {\n\t\t\t\tif ($nextorprevious) {\n\t\t\t\t\t$next = true;\n\t\t\t\t} else {\n\t\t\t\t\treturn $prev; // Return previous \"record\"\n\t\t\t\t}\n\t\t\t}\n\t\t\t$prev = $mail;\n\t\t}\n\t}\n\n\treturn false;\n}", "function getUrlImages($parser, $url) {\n global $alreadyFoundImages;\n\n $imageArray = $parser->getImgTags();\n foreach ($imageArray as $image) {\n $src = $image->getAttribute(\"src\");\n $alt = $image->getAttribute(\"alt\");\n $title = $image->getAttribute(\"title\");\n\n if (!$title && !$alt) {\n continue;\n }\n\n $src = convertRealtiveToAbsoluteUrl($src, $url);\n\n // avoiding to display images multiple times\n if (!in_array($src, $alreadyFoundImages)) {\n $alreadyFoundImages[] = $src;\n\n insertImageInDatabase($url, $src, $alt, $title);\n }\n }\n}", "public static function getPhotoContext($photos, $imageObject) {\r\n \r\n /**\r\n * Loop through the array once until we find the provided image. Add photos to a temporary array, and then we slice it to return the last 4 entries to the array\r\n */\r\n \r\n $return = array(); \r\n $split = 0;\r\n $tmp = array(); \r\n \r\n foreach ($photos as $key => $data) {\r\n \r\n if ($data['image_id'] == $imageObject->id) {\r\n $split = $key;\r\n break;\r\n }\r\n \r\n $tmp[] = $data; \r\n }\r\n \r\n $return = array_slice($tmp, -2);\r\n \r\n /**\r\n * Add the current photo to the array\r\n */\r\n \r\n $return[] = array_merge($photos[$split], array(\"current\" => true));\r\n \r\n /**\r\n * Loop through the array starting at $split\r\n */\r\n \r\n $tmp = array(); \r\n \r\n foreach ($photos as $key => $data) {\r\n if ($key >= $split + 1) {\r\n $tmp[] = $data;\r\n }\r\n }\r\n \r\n $return = array_merge($return, array_slice($tmp, 0, 2));\r\n \r\n return array_reverse($return);\r\n \r\n }", "public function getImages() {\n if (empty($this->_images) && $this->getImgs()) {\n $images = json_decode($this->getImgs(), true);\n uasort($images, function($a, $b) {\n if (!isset($a['ordering'])) {\n $a['ordering'] = 0;\n }\n\n if (!isset($b['ordering'])) {\n $b['ordering'] = 0;\n }\n\n if ($a['ordering'] == @$b['ordering']) {\n return 0;\n }\n return ($a['ordering'] < $b['ordering']) ? -1 : 1;\n });\n $this->_images = $images;\n }\n\n return $this->_images;\n }", "public function previous(): static\n {\n $link = Arr::get($this->links, 'prev');\n\n throw_unless($link, NoPreviousPageException::class);\n\n return $this->getResults($link);\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function get_query_pagination_arrow($block, $is_next)\n {\n }", "public static function next_prev_item() {\n\t\t\t$cpt = self::get_post_type();\n\t\t\t$tax = ( $cpt === 'post' ) ? 'category' : $cpt . '_cat';\n\t\t\t$prevPost = get_previous_post( true, '', $tax ) ? get_previous_post( true, '', $tax ) : get_previous_post();\n\t\t\t$nextPost = get_next_post( true, '', $tax ) ? get_next_post( true, '', $tax ) : get_next_post();\n\n\t\t\tob_start();\n\t\t\tif ( $prevPost || $nextPost ) { ?>\n\t\t\t\t<ul class=\"next_prev clr\">\n\t\t\t\t\t<?php if( $prevPost ) { ?>\n\t\t\t\t\t\t<li class=\"previous\">\n\t\t\t\t\t\t\t<?php $prevthumbnail = get_the_post_thumbnail( $prevPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php previous_post_link( '%link', '<i class=\"fa fa-angle-' . ( self::$is_rtl ? 'right' : 'left' ) . '\"></i><h4><small>' . esc_html( do_shortcode( self::option( 'prev_' . $cpt, self::option( 'prev_post' ) ) ) ) . '</small>%title</h4>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } if( $nextPost ) { ?>\n\t\t\t\t\t\t<li class=\"next\">\n\t\t\t\t\t\t\t<?php $nextthumbnail = get_the_post_thumbnail( $nextPost->ID, 'thumbnail' ); ?>\n\t\t\t\t\t\t\t<?php next_post_link( '%link', '<h4><small>' . esc_html( do_shortcode( self::option( 'next_' . $cpt, self::option( 'next_post' ) ) ) ) . '</small>%title</h4><i class=\"fa fa-angle-' . ( self::$is_rtl ? 'left' : 'right' ) . '\"></i>' ); ?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php } \n\n\t\t\t\t\t\t$archive_icon = false; //self::option( 'next_prev_archive_icon' );\n\t\t\t\t\t\tif ( $archive_icon ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"cz-next-prev-archive\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $cpt ) ); ?>\" title=\"<?php echo ucwords( $cpt ); ?>\"><i class=\"<?php echo esc_attr( $archive_icon ); ?>\"></i></a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php \n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php \n\t\t\t}\n\n\t\t\treturn ob_get_clean();\n\t\t}", "public function prevPage(): array\n {\n return $this->prev()->getPage();\n }", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "public function additional_images() {\n\t\t$image_list = array();\n\t\t\n\t\tif (is_single () || is_page ()) {\n\t\t\t$fb_image1 = get_post_meta ( get_the_ID(), 'essb_post_og_image1', true );\n\t\t\t$fb_image2 = get_post_meta ( get_the_ID(), 'essb_post_og_image2', true );\n\t\t\t$fb_image3 = get_post_meta ( get_the_ID(), 'essb_post_og_image3', true );\n\t\t\t$fb_image4 = get_post_meta ( get_the_ID(), 'essb_post_og_image4', true );\n\t\t\t\n\t\t\tif (!empty($fb_image1) && is_string($fb_image1)) {\n\t\t\t\t$image_list[] = $fb_image1;\n\t\t\t}\n\n\t\t\tif (!empty($fb_image2) && is_string($fb_image2)) {\n\t\t\t\t$image_list[] = $fb_image2;\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($fb_image3) && is_string($fb_image3)) {\n\t\t\t\t$image_list[] = $fb_image3;\n\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($fb_image4) && is_string($fb_image4)) {\n\t\t\t\t$image_list[] = $fb_image4;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $image_list;\n\t}", "public function get_near_images(Request $request) {\n $before = VideoImage::where('id', '<', $request->id)->latest('id')->limit(3)->get();\n // get 5 records after from current image\n $after = VideoImage::where('id', '>', $request->id)->oldest('id')->limit(2)->get();\n // get current record cause we lazy\n $current = VideoImage::findOrFail($request->id);\n // put into array\n $results = [$before, $current, $after];\n // return that shit\n return response()->json($results);\n }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "protected function getImageCandidates()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->imgElements as $imgElement)\n\t\t{\n\t\t\t$imageDimensions = $this->getImageDimensions($imgElement);\n\t\t\tif($imageDimensions['width'] >= self::MIN_IMAGE_WIDTH && $imageDimensions['height'] >= self::MIN_IMAGE_HEIGHT)\n\t\t\t{\n\t\t\t\t$result[] = $imgElement['src'];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function photos( $tag, $count = null, $order = null )\n {\n $tag = Tag::with( $this->eagerLoad )->where( 'slug', '=', $tag )->firstOrFail();\n\n if ( $order === null ) {\n list( $orderCol, $orderBy ) = $this->defaultOrder;\n } else {\n list( $orderCol, $orderBy ) = $order;\n }\n\n return $tag->photos()\n ->orderBy( $orderCol, $orderBy )\n ->paginate( $this->perPage( $count ) );\n }" ]
[ "0.6159016", "0.5985409", "0.5919204", "0.57603997", "0.555737", "0.54664415", "0.5457094", "0.54158825", "0.53048027", "0.5297472", "0.5242712", "0.5230706", "0.51977247", "0.518588", "0.51804775", "0.5178973", "0.51466763", "0.5111908", "0.5085377", "0.5073863", "0.50493306", "0.5002173", "0.49754897", "0.49716538", "0.4958213", "0.49218404", "0.49031407", "0.4897385", "0.4866411", "0.48604092", "0.48432946", "0.4830356", "0.48186907", "0.48036015", "0.47943497", "0.47863445", "0.4784409", "0.47746292", "0.47695643", "0.47642353", "0.47516412", "0.47423849", "0.4732236", "0.47265404", "0.47218633", "0.47094157", "0.47085333", "0.47031206", "0.4684764", "0.46828055", "0.4657372", "0.46438074", "0.46429273", "0.46366253", "0.46332943", "0.4627874", "0.46210635", "0.46176884", "0.4594383", "0.45912135", "0.45906672", "0.45821303", "0.45743498", "0.45487422", "0.45481285", "0.45473674", "0.45416605", "0.4540137", "0.45376328", "0.45255807", "0.45250642", "0.4518183", "0.45155343", "0.4512238", "0.45099306", "0.45077974", "0.45033428", "0.45027056", "0.4500078", "0.44996455", "0.449432", "0.44899377", "0.4485559", "0.44834206", "0.4483128", "0.44812372", "0.44791472", "0.4474313", "0.44723827", "0.44710946", "0.4470243", "0.4469686", "0.44655612", "0.44642353", "0.44513804", "0.4451214", "0.44481736", "0.44420642", "0.4441576", "0.44386607", "0.44328135" ]
0.0
-1
Gets information about a photoset.
function photosets_getInfo ($photoset_id) { $response = $this->execute(array('method' => 'flickr.photosets.getInfo', 'photoset_id' => $photoset_id)); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photoset']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPhotoSetInfo($photoset_id){\n\n\t\t/* Get Photoset Name and Description */\n\t\t$photoset_info = $this->askFlickr('photosets.getInfo','&photoset_id='.$photoset_id);\n\n\t\t/* Return Photo Info Object */\n\t\treturn $photoset_info;\n\t}", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "function getPhotosetInfo ($set_id) {\n global $config;\n $json = cacheGet('photosetinfo-' . $set_id);\n if (!$json) {\n $json = file_get_contents('https://api.flickr.com/services/rest/?method=flickr.photosets.getInfo&user_id=' . $config['user_id'] . '&photoset_id=' . $set_id . '&format=json&api_key=' . $config['api_key']);\n cacheSet('photosetinfo-' . $set_id, $json);\n }\n return json_decode(substr($json, 14, -1), true);\n}", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "function getPhotoInfo($photoId);", "public function getPhotos();", "public function getPhotos()\n {\n return $this->photos;\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "function getsetinfo($set_id)\n {\n\t\t$this->db->select('sets.id AS sid, year, DATE_FORMAT(start, \\'%d/%m/%Y\\') AS start, DATE_FORMAT(end, \\'%d/%m/%Y\\') AS end, users.id, firstname, lastname, professor_attr', FALSE);\n\t\t$this->db->from('users');\n\t\t$this->db->join('sets', 'sets.professor_id = users.id');\n\t\t$this->db->where('sets.id', $set_id);\n\n\t\t$query = $this->db->get();\n\n\t\treturn $query->row_array();\n }", "function photosets_getContext ($photoset_id, $photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.getContext', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\tunset($object['stat']);\n\t\t\treturn $object;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "function see_photos()\n{\n\tinclude 'storedInfo.php';\n\tini_set('display_errors', 'On');\n\t$photo_set_num = $_POST['photo_set_num'];\n\t\n\t$mysqli = new mysqli(\"oniddb.cws.oregonstate.edu\", \"jonesmi-db\", $myPassword, \"jonesmi-db\");\n\tif ($mysqli->connect_errno) \n\t{\n\t\techo \"Failed to connect to MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n\t} else \n\t{\n\t\t//echo \"connection worked!<br><br>\";\n\t} \n\tif (!($stmt = $mysqli->prepare(\"SELECT UserPhotos.filename\n\t\tFROM UserPhotos\n\t\tWHERE UserPhotos.set_num = ?\"))) \n\t{\n\t\techo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\t\n\tif(!($stmt->bind_param(\"i\",$photo_set_num)))\n\t{\n\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t}\n\tif (!$stmt->execute()) \n\t{\n\techo \"Execute failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\n\t$out_filename = NULL;\n\n\tif (!$stmt->bind_result($out_filename)) \n\t{\n\t\techo \"Binding output parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t}\n\t$new_file = (string)$out_filename;\n\t$counter = 0;\n\twhile($stmt->fetch())\n\t{\t\n\t\t$display_string = \"<img src = $out_filename >\";\n\t\techo $display_string;\n\t\t$counter ++;\n\t}\n\t\t\t/*counter is used to count the photos found.\n\t\t\t\tIf counter is still 0 then no photos were found. */\n\tif ($counter == 0)\n\t{\n\t\techo \"There were no Lego sets by that set number. <br>\";\n\t}\n\t$mysqli->close();\n}", "public function getMetadataSet($set) {\n\t\treturn array();\n\t}", "public function getImageSet()\n {\n if (!$this->imageSet instanceof ImageSetStorage) {\n $this->imageSet = new ImageSetStorage($this->repository);\n }\n return $this->imageSet;\n }", "private function retrieveImageInfo() {\n $prepare = $this->database->prepare(\"\n SELECT image_height, image_width\n FROM manuscripts\n WHERE collection = :collection\n AND pointer = :pointer\n LIMIT 1\n \");\n\n $prepare->execute(array(\n \":collection\" => $this->collection,\n \":pointer\" => $this->pointer\n ));\n\n return $prepare->fetch(PDO::FETCH_ASSOC);\n }", "public function getImageDetails($id)\n {\n \tif(!$this->token)\n \t{\n \t\treturn parent::getImageDetails($id);\n \t}\n \t\n static $method = 'flickr.photos.getSizes';\n\n if (empty($id)) {\n /**\n * @see Zend_Service_Exception\n */\n require_once 'Zend/Service/Exception.php';\n throw new Zend_Service_Exception('You must supply a photo ID');\n }\n $options = array(\n \t'api_key' => $this->apiKey,\n \t'auth_token' => $this->token, \n \t'method' => $method, \n \t'photo_id' => $id\n );\n $options = $this->signOptions($this->secret, $options);\n\n $restClient = $this->getRestClient();\n $restClient->getHttpClient()->resetParameters();\n $response = $restClient->restGet('/services/rest/', $options);\n\n $dom = new DOMDocument();\n $dom->loadXML($response->getBody());\n $xpath = new DOMXPath($dom);\n self::_checkErrors($dom);\n $retval = array();\n /**\n * @see Zend_Service_Flickr_Image\n */\n require_once 'Zend/Service/Flickr/Image.php';\n foreach ($xpath->query('//size') as $size) {\n $label = (string) $size->getAttribute('label');\n $retval[$label] = new Zend_Service_Flickr_Image($size);\n }\n\n return $retval;\n }", "public function getAllPhotos();", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "function photos_getInfo ($photo_id, $secret = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getInfo';\n\t\t$params['photo_id'] = $photo_id;\n\t\tif ($secret) $params['secret'] = $secret;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function printSet($photoset_id, $packery = true, $parentNav = false, $size = 'n'){\n\n\t\t/* Gets Photo Info */\n\t\t$info = $this->getPhotoSetInfo($photoset_id);\n\n\t\t/* Redefine loadContentDescription */\n\t\t$this->pageDescription = $info->photoset->title->_content;\n\t\t$this->contentDescription = $info->photoset->description->_content;\n\n\t\t/* Add Content Description */\n\t\t$output = $parentNav ? '' : $this->printContentDescription();\n\n\t\t/* Start HTML */\n\t\tif(!$parentNav) $output .= '<section class=\"photogroup\"><div id=\"gallery\">';\n\n\t\t/* Check for Packery */\n\t\t$packery ? $packery = 'packery' : $packery = '';\n\t\t$output .= '<ul class=\"set '.$packery.'\">';\n\n\t\t/* Gets some photos */\n\t\t$photoSet = $this->getPhotoSet($photoset_id);\n\n\t\tforeach($photoSet->photoset->photo as $photo){\n\n\t\t\t/* Add Special Class to Primary */\n\t\t\t$primary = $photo->isprimary == '1' ? 'primary' : '';\n\n\t\t\t/* Add Video class if Video */\n\t\t\t$output .= '<li class=\"item '.$photo->media.' '.$primary.'\">';\n\t\t\t$output .= '<a class=\"imagelink\" href=\"#!/photo_id='.$photo->id.'&secret='.$photo->secret.'\">';\n\n\t\t\t/* Lets get some Photos */\n\t\t\tif($photo->media !== 'video' || $packery == false){ // Photos\n\n\t\t\t\t$info = $this->getPhoto($photo->id, $photo->secret);\n\n\t\t\t\t/* Check for Animated Gifs */\n\t\t\t\tif($info->photo->originalformat == 'gif') {\n\t\t\t\t\t$secret = $info->photo->originalsecret.'_o';\n\t\t\t\t\t$format = 'gif';\n\t\t\t\t} else {\n\t\t\t\t\t$secret = $photo->secret;\n\t\t\t\t\t$format = 'jpg';\n\t\t\t\t}\n\n\t\t\t\t$sizeUrl = 'url_'.$size;\n\t\t\t\t$url = isset($photo->$sizeUrl) ? $photo->$sizeUrl : 'http://farm'.$photo->farm.'.staticflickr.com/'.$photo->server.'/'.$photo->id.'_'.$secret.'.'.$format;\n\t\t\t\t$output .= '<img src=\"'.$url.'\" alt=\"'.$photo->title.'\">';\n\t\t\t} else {\n\n\t\t\t\t/* Videos Baby! */\n\t\t\t\t$output .= $this->printVideo($photo->id,$photo->secret,false);\n\t\t\t}\n\t\t\t$output .= '</a>';\n\t\t\t$output .= '</li>';\n\t\t}\n\t\t$output .= '</ul>';\n\t\t\n\t\tif(!$parentNav) $output .= '</div>';\n\n\t\t/* Add Parent Nav */\n\t\tif(!$parentNav) {\n\t\t\t$parentNav = $this->printSets(false);\n\t\t\t$output .= '<section class=\"parentnav\"><div class=\"before\">&laquo;</div>'.$parentNav.'<div class=\"after\">&raquo;</div></section>';\n\t\t\t$output .= '<nav class=\"pagenav\"><ul>'\n\t\t\t\t.'<li class=\"back\"><a href=\"#!/home\">&laquo; Back to Projects</a></li>'\n\t\t\t\t.'</ul></nav>';\n\t\t} else {\n\n\t\t\t$title = isset($parentNav->title) ? $parentNav->title : 'Projects';\n\t\t\t$link = isset($parentNav->id) ? strtolower(urlencode($parentNav->title)).'&amp;id='.$parentNav->id : '';\n\n\t\t\t$output = '<section class=\"parentnav\"><div class=\"before\">&laquo;</div>'.$output.'<div class=\"after\">&raquo;</div></section>';\n\t\t\t$output .= '<nav class=\"pagenav\"><ul>'\n\t\t\t\t.'<li class=\"back\"><a href=\"#!/set='.$link.'\">&laquo; Back to '.$title.'</a></li>'\n\t\t\t\t.'</ul></nav>';\n\t\t}\n\n\t\t/* End HTML */\n\t\tif(!$parentNav) $output .= '</section>';\n\n\t\t/* Output HTML */\n\t\treturn $output;\n\t}", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "function getSpecificPhoto($id) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n return $flickr->photos_getSizes($id);\r\n }", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "function tmt_gallery_get()\n\t{\n\t\t$galleries = $this->gallery_model->display_one_gallery();\n\t\t\n\t\t//$data = array('returned: '. $this->get('id'));\n\t\t$this->response($galleries);\n\t\t\n\t}", "public function getPhoto($id);", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function getPhotoInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t//Zend_Debug::dump($params); die();\n \n \t$result = \\Extended\\socialise_photo::getPhotoInfo( $params['photo_id'] );\n \t \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "function getPhotoSizes($photo_id){ // No Secret Required\n\n\t\t/* Get Photo Size */\n\t\t$photoSizes = $this->askFlickr('photos.getSizes','&photo_id='.$photo_id);\n\n\t\t/* Return Photo Sizes */\n\t\treturn $photoSizes;\n\t}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function getPhotoUrls () {\n\t\t\n\t}", "public function getMetadata();", "public function getMetadata();", "public function getMetadata();", "function get_image() {\n $sql = \"SELECT * FROM photos\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function getDisplayStockPhotos()\n {\n return $this->displayStockPhotos;\n }", "public function getMetadataSet($set) {\n\n\t\tif(array_key_exists($set, $this->cachedMetadata)) {\n\t\t\treturn $this->cachedMetadata[$set];\n\t\t}\n\n\t\t$metadataSet = $this->load($set);\n\t\tif($metadataSet === NULL) {\n\t\t\t$metadataSet = array();\n\t\t}\n\n\t\t/* Add the entity id of an entry to each entry in the metadata. */\n\t\tforeach ($metadataSet AS $entityId => &$entry) {\n\t\t\tif (preg_match('/__DYNAMIC(:[0-9]+)?__/', $entityId)) {\n\t\t\t\t$entry['entityid'] = $this->generateDynamicHostedEntityID($set);\n\t\t\t} else {\n\t\t\t\t$entry['entityid'] = $entityId;\n\t\t\t}\n\t\t}\n\n\t\t$this->cachedMetadata[$set] = $metadataSet;\n\n\t\treturn $metadataSet;\n\t}", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function photo()\n {\n \treturn $this->article->photos->first();\n }", "public function headshots()\n {\n $compositeKey = [\n 'ezt_user_id' => $this->ezt_user_id,\n 'image_type' => 2\n ];\n\n return Image::where($compositeKey)->get();\n }", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getMetaSummary()\n {\n return $this->dbObject('ImageMetaCaption');\n }", "public function getMetaData(): iterable;", "function getPhoto()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$response = $this->mapi->getPhoto($id);\n\n\t\techo json_encode($response);\n\t}", "public function getMetaData();", "public function getPhoto()\n {\n return $this->photo;\n }", "public function showZoomPics()\n {\n $aPicGallery = $this->getPictureGallery();\n\n return $aPicGallery['ZoomPic'];\n }", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "function showPhoto($sid)\n {\n $result = $this->getPhoto($sid);\n return $result;\n }", "function getPhoto($photo_id, $secret){\n\n\t\t/* Get Photo */\n\t\t$photo = $this->askFlickr('photos.getInfo','&photo_id='.$photo_id.'&secret='.$secret);\n\n\t\t/* Return Photo */\n\t\treturn $photo;\n\t}", "public function getZoomPics()\n {\n $aPicGallery = $this->getPictureGallery();\n\n return $aPicGallery['ZoomPics'];\n }", "function photos_getExif ($photo_id, $secret = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getExif';\n\t\t$params['photo_id'] = $photo_id;\n\t\tif ($secret) $params['secret'] = $secret;\n $response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photo'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }", "public function getMetadata(): array;", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "function printSets($packery = true, $size = 'q'){ // This one has different formatting\n\n\t\t/* Gets Sets for User */\n\t\t$sets = $this->getSets($this->user);\n\n\t\t/* Generate output */\n\t\t$packery ? $packery = 'packery' : $packery = '';\n\t\t$output = '<section class=\"sets\"><ul class=\"photosets '.$packery.'\">';\n\t\tforeach($sets->photosets->photoset as $set){\n\t\t\tif($set->title->_content[0] !== ' '){ // I use a Space in front of sets to make them private\n\t\t\t\t$output .= '<li class=\"set item\"><figure>';\n\n\t\t\t\t/* Add Link */\n\t\t\t\t$link = '<a href=\"#!/set='.strtolower(urlencode($set->title->_content)).'&amp;id='.$set->id.'\">';\n\t\t\t\t$output .= $link;\n\t\t\t\t$output .= '<img src=\"http://static.flickr.com/'.$set->server.'/'.$set->primary.'_'.$set->secret.'_'.$size.'.jpg\" alt=\"'.$set->title->_content.'\" /></a>';\n\t\t\t\t$output .= '<figcaption>'.$link.$set->title->_content.'</a></figcaption>';\n\t\t\t\t$output .= '</figure></li>';\n\t\t\t}\n\t\t}\n\t\t$output .= '</ul></section>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "public function getAllMetadata(): Collection;", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function images()\n {\n // Fetch all properties existing in the database\n $image = Image::all();\n\n // return list of properties;\n return $image;\n\n }", "public function getPicture($id, Request $request)\n {\n $set = Set::find($id);\n if ($set == null) {\n return response([\"error\" => \"Invalid ID was given.\"], 400);\n }\n $imageName = $set->set_image_name_final;\n $strURL = \"/images/cards/full/\" . (string)$imageName . \".jpg\";\n if (file_exists(public_path() . $strURL)) {\n $input = $request->all();\n if (array_key_exists('size', $input)) {\n if (!is_numeric($input['size'])) {\n return response([\"error\" => \"Size must be a numerical value.\"], 400);\n }\n $size = intval($input['size']);\n return Image::make(public_path() . $strURL)->resize($size, null, function($constraint){$constraint->aspectRatio();})->response('png');\n }\n return Image::make(public_path() . $strURL)->response('png');\n }\n return response([\"error\" => \"An error occurred.\"], 500);\n }", "public static function getGalleryInfo(int $id) {\n $thumbURL = ImageGalleryController::getThumbnailUploadURL();\n return self::select(DB::raw(\"`id`, `name`,\" . self::_getImageSelectString($thumbURL, 'thumbnail') . \", `gallery_type`,`image_description`,`created_at`\"))\n ->where('id', $id)\n ->first();\n }", "public function get_images(){\n\t\treturn $this->images;\n\t}", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "function photosets_create ($title, $primary_photo_id, $description = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.create';\n\t\t$params['title'] = $title;\n\t\t$params['primary_photo_id'] = $primary_photo_id;\n\t\tif ($description) $params['description'] = $description;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getFirstPhoto()\n\t{\n\t\treturn array_shift( $this->getPhotos() ); \n\t}", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "public function index()\n {\n return Photo::get();\n }", "public function getMetadata() {}", "public function getMetadata() {}", "public function getImages(){\n return $this->images;\n }", "public function getImage()\n {\n return $this->get('image');\n }", "function photosets_editMeta ($photoset_id, $title, $description = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.editMeta';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['title'] = $title;\n\t\tif ($description) $params['description'] = $description;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function getUsersInfoAction(array $setUserId): array\n\t{\n\t\t$res = UserTable::getList([\n\t\t\t'select' => [\n\t\t\t\t'NAME',\n\t\t\t\t'LAST_NAME',\n\t\t\t\t'PERSONAL_PHOTO',\n\t\t\t],\n\t\t\t'filter' => [\n\t\t\t\t'ID' => $setUserId\n\t\t\t]\n\t\t]);\n\t\t$setName = [];\n\t\t$personalPhoto = [];\n\n\t\twhile ($row = $res->fetch())\n\t\t{\n\t\t\t$name = new PublicActionResult();\n\t\t\t$name->setResult([\n\t\t\t\t'NAME' => \\CUser::formatName(\n\t\t\t\t\t\\CSite::getNameFormat(false),\n\t\t\t\t\t$row, true, false\n\t\t\t\t)\n\t\t\t]);\n\t\t\t$setName[] = $name->getResult()['NAME'];\n\t\t\tif ($row['PERSONAL_PHOTO'])\n\t\t\t{\n\t\t\t\t$personalPhoto[] = $row['PERSONAL_PHOTO'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$personalPhoto[] = null;\n\t\t\t}\n\t\t}\n\n\t\t$data = [];\n\t\t$data['name'] = $setName;\n\t\t$data['personalPhoto'] = $personalPhoto;\n\n\t\treturn $data;\n\t}", "public function getImages()\r\n {\r\n return $this->images;\r\n }", "public function getPhotos($album_id)\n {\n $client = new Client();\n\n // get JSON from the webservice and convert it into an assoc. array\n return json_decode($client->get(\"http://jsonplaceholder.typicode.com/album/${album_id}/photos\")->getBody(), true);\n\n }", "function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }", "function getImageInfo ( $imagesize, $item_result = null )\n\t{\n\t\t$imageurl = $this->info['graphics_url'];\n\t\t$imageset = null;\n\t\tif ( null != $item_result ) {\n\t\t\tif ( is_array( $item_result['Items']['Item']['ImageSets']['ImageSet'] ) ) {\n\t\t\t\tif ( isset( $item_result['Items']['Item']['ImageSets']['ImageSet'][0] ) && is_array( $item_result['Items']['Item']['ImageSets']['ImageSet'][0] ) ) {\n\t\t\t\t\t$imageset = $item_result['Items']['Item']['ImageSets']['ImageSet'][0];\n\t\t\t\t} else {\n\t\t\t\t\t$imageset = $item_result['Items']['Item']['ImageSets']['ImageSet'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$imageset = $item_result['Items']['Item'];\n\t\t\t}\n\t\t}\n\n\t\tswitch ( strtolower( $imagesize ) )\n\t\t{\n\t\t\tcase 'medium' :\n\t\t\t\tif ( NULL === $imageset ) {\n\t\t\t\t\t$img['url']='';\n\t\t\t\t} else {\n\t\t\t\t\t$img['url'] = $imageset['MediumImage']['URL'];\n\t\t\t\t\t$img['h'] = $imageset['MediumImage']['Height'];\n\t\t\t\t\t$img['w'] = $imageset['MediumImage']['Width'];\n\t\t\t\t}\n\t\t\t\tif ( empty( $img['url'] ) ) {\n\t\t\t\t\t$img['url'] = $imageurl . '/no-image-160.gif';\n\t\t\t\t\t$img['h'] = 160;\n\t\t\t\t\t$img['w'] = 160;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'small' :\n\t\t\t\tif ( NULL === $imageset ) {\n\t\t\t\t\t$img['url']='';\n\t\t\t\t} else {\n\t\t\t\t\t$img['url'] = $imageset['SmallImage']['URL'];\n\t\t\t\t\t$img['h'] = $imageset['SmallImage']['Height'];\n\t\t\t\t\t$img['w'] = $imageset['SmallImage']['Width'];\n\t\t\t\t}\n\t\t\t\tif ( empty( $img['url'] ) ) {\n\t\t\t\t\t$img['url'] = $imageurl . '/no-image-75.gif';\n\t\t\t\t\t$img['h'] = 75;\n\t\t\t\t\t$img['w'] = 75;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'large' :\n\t\t\t\tif ( NULL === $imageset ) {\n\t\t\t\t\t$img['url']='';\n\t\t\t\t} else {\n\t\t\t\t\t$img['url'] = $imageset['LargeImage']['URL'];\n\t\t\t\t\t$img['h'] = $imageset['LargeImage']['Height'];\n\t\t\t\t\t$img['w'] = $imageset['LargeImage']['Width'];\n\t\t\t\t}\n\t\t\t\tif ( empty( $img['url'] ) ) {\n\t\t\t\t\t$img['url'] = $imageurl . '/no-image-500.gif';\n\t\t\t\t\t$img['h'] = 500;\n\t\t\t\t\t$img['w'] = 500;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'swatch' :\n\t\t\t\tif ( NULL === $imageset ) {\n\t\t\t\t\t$img['url']='';\n\t\t\t\t} else {\n\t\t\t\t\t$img['url'] = $imageset['SwatchImage']['URL'];\n\t\t\t\t\t$img['h'] = $imageset['SwatchImage']['Height'];\n\t\t\t\t\t$img['w'] = $imageset['SwatchImage']['Width'];\n\t\t\t\t}\n\t\t\t\tif ( empty( $img['url'] ) ) {\n\t\t\t\t\t$img['url'] = '';\n\t\t\t\t\t$img['h'] = 0;\n\t\t\t\t\t$img['w'] = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tif ( NULL === $imageset ) {\n\t\t\t\t\t$img['url']='';\n\t\t\t\t} else {\n\t\t\t\t\t$img['url'] = $imageset['MediumImage']['URL'];\n\t\t\t\t\t$img['h'] = $imageset['MediumImage']['Height'];\n\t\t\t\t\t$img['w'] = $imageset['MediumImage']['Width'];\n\t\t\t\t}\n\t\t\t\tif ( empty( $img['url'] ) ) {\n\t\t\t\t\t$img['url'] = $imageurl . '/no-image-160.gif';\n\t\t\t\t\t$img['h'] = 160;\n\t\t\t\t\t$img['w'] = 160;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn ($img);\n\t}", "public function getInformation();", "public function single($photo_id) {\n\t\t$params = array(\n\t\t\t'api_key'\t=> $this->api_key,\n\t\t\t'method'\t=> 'flickr.photos.getSizes',\n\t\t\t'photo_id'\t=> $id,\n\t\t\t'format'\t=> 'php_serial',\n\t\t);\n\t\t\n\t\t$encoded_params = array();\n\t\t\n\t\tforeach ($params as $k => $v){\n\t\t\t$encoded_params[] = urlencode($k).'='.urlencode($v);\n\t\t}\n\t\t\n\t\t$res = curl_init($this->url.implode('&', $encoded_params));\n\t\t\n\t\tcurl_setopt($res, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\treturn $response = curl_exec($res);\n\t}", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPictures() : ?array\n {\n return $this->get('pictures', 'products');\n }", "public function getStudentPhotoRequest() {\n $this->db->where('publicationstatus', 0);\n $qu = $this->db->get($this->_imgrequest);\n return $qu->result_array();\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "private function load($set) {\n\n\t\t$metadatasetfile = $this->directory . $set . '.php';\n\n\t\tif (!file_exists($metadatasetfile)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$metadata = array();\n\n\t\tinclude($metadatasetfile);\n\n\t\tif (!is_array($metadata)) {\n\t\t\tthrow new Exception('Could not load metadata set [' . $set . '] from file: ' . $metadatasetfile);\n\t\t}\n\n\t\treturn $metadata;\n\t}", "function see_photo_listing_func()\n{\n\tinclude 'storedInfo.php';\n\tini_set('display_errors', 'On');\n\t\n\t$mysqli = new mysqli(\"oniddb.cws.oregonstate.edu\", \"jonesmi-db\", $myPassword, \"jonesmi-db\");\n\tif ($mysqli->connect_errno) \n\t{\n\t\techo \"Failed to connect to MySQL: (\" . $mysqli->connect_errno . \") \" . $mysqli->connect_error;\n\t} else \n\t{\n\t\t//echo \"connection worked!<br><br>\";\n\t} \n\tif (!($stmt = $mysqli->prepare(\"SELECT UserPhotos.set_num, UserPhotos.filename, LibraryUsers.userName\n\t\tFROM UserPhotos\n\t\tINNER JOIN LibraryUsers ON LibraryUsers.id = UserPhotos.photo_owner\t\"))) \n\t{\n\t\techo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\tif (!$stmt->execute()) \n\t{\n\techo \"Execute failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t}\n\n\t$out_filename = NULL;\n\t$out_photo_owner = NULL;\n\t$out_set_numb = NULL;\n\n\tif (!$stmt->bind_result($out_set_numb, $out_filename, $out_photo_owner)) \n\t{\n\t\techo \"Binding output parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t}\n\n\t$display_string = \"<table style = 'text-align:center;' border = '1';> <tr> <th> Owner </th> <th> Set Number </th> \";\n\n\t\t// Insert a new row in the table for each person returned\n\t\t// Table creation used with assistance from http://www.tutorialspoint.com/php/php_and_ajax.htm\n\t\twhile($stmt -> fetch())\n\t\t{\n\t\t\t$display_string .= \"<tr>\";\n\t\t\t//$display_string .= \"<td>\".$out_filename.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_photo_owner.\"</td>\";\n\t\t\t$display_string .= \"<td>\".$out_set_numb.\"</td>\";\n\t\t\t$display_string .= \"</tr>\";\n\t\t//\t$counter ++;\n\t\t}\n\t$display_string .= \"</table>\";\n\techo $display_string;\n\t$mysqli->close();\n}", "protected\n function setImageSizes()\n {\n return config('album.sizes');\n }", "public function getGallery()\n {\n return $this->gallery;\n }", "function getImagePathInfo() \n { \n return $this->_imagePathInfo; \n }", "private function displayPhotossearch() {\n $this->addCSS(\"flickr_simplelist.css\");\n\n $params = tx_tendflickr_pi1::ParseTSFlickrParams($this->flickr, $this->conf_ts[\"show.\"][\"params.\"]);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n\n $photos = $this->flickr->restFlickr_Photos_Search($params);\n if(!$photos) return $this->callFlickrError();\n\n $this->smarty->assign(\"photos\", $photos[\"photos\"][\"photo\"]);\n $this->smarty->assign(\"cache_till\", $photos[\"cache_till\"]);\n $this->smarty->assign(\"cache_time_diff\", date(\"i\\m s\\s\",strtotime($photos[\"cache_till\"])-strtotime(\"now\") ) );\n\n return $this->smarty_display(\"flickr_simplelist.xhtml\");\n }", "public function getPhotos($page, $itemsPerPage);" ]
[ "0.7983389", "0.7624878", "0.75235385", "0.71805054", "0.6704652", "0.652162", "0.6079326", "0.6019746", "0.5936873", "0.5889445", "0.5870294", "0.58312434", "0.5807532", "0.5791189", "0.57457685", "0.5726683", "0.5694535", "0.56459624", "0.5619843", "0.55982786", "0.5570566", "0.5540493", "0.5483874", "0.543947", "0.54150456", "0.54025984", "0.5372116", "0.5361323", "0.53463316", "0.5338272", "0.526152", "0.52351785", "0.5234612", "0.52248234", "0.5181376", "0.5178891", "0.517371", "0.517371", "0.517371", "0.5172365", "0.516969", "0.51671445", "0.51527494", "0.5152268", "0.5152268", "0.5152268", "0.5152268", "0.5152268", "0.5147083", "0.51243293", "0.5121146", "0.5112706", "0.5090796", "0.5089659", "0.5084804", "0.5079244", "0.5065394", "0.5048612", "0.50465935", "0.50399387", "0.5037888", "0.50375915", "0.5036888", "0.5033218", "0.5024092", "0.50216264", "0.5012176", "0.5009802", "0.50080043", "0.50046474", "0.49962047", "0.49947625", "0.49796143", "0.49788672", "0.49787176", "0.49767238", "0.4963689", "0.49517614", "0.49517614", "0.49454758", "0.49386448", "0.49338135", "0.49256444", "0.4916591", "0.49157202", "0.49146616", "0.49146065", "0.4911248", "0.4907634", "0.49047035", "0.48993614", "0.4897737", "0.48943213", "0.4893378", "0.48916045", "0.48832783", "0.48772827", "0.48733684", "0.48726523", "0.486921" ]
0.7850466
1
Returns the photosets belonging to the specified user.
function photosets_getList ($user_id = NULL) { $params = array(); $params['method'] = 'flickr.photosets.getList'; if ($user_id) $params['user_id'] = $user_id; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photosets']['photoset']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}", "public function getPhotoPublications($user)\n {\n return $this->getByCategoryType('Photo', $user);\n }", "public static function get_photos_by_user($user_id) {\n\t\t$photos_array = array();\n\n\t\t$sql = \"SELECT * \n\t\t FROM photo_directory \n\t\t WHERE user_id = {$user_id}\n\t\t ORDER BY time_uploaded DESC;\";\n\t\t$photos_dbo = mysql_query($sql);\n\t\twhile ($row = mysql_fetch_assoc($photos_dbo)) {\n\t\t\tarray_push($photos_array, $row);\n\t\t} \n\n\t\tglobal $firephp;\n\t\t$firephp->log('get_photos_by_user:');\n\t\t$firephp->log($photos_array);\n\t\treturn $photos_array;\n\t}", "public function getAllUserAlbums($userId){\n $albums = DB::select('\n select albums.*\n from albums\n where albums.user_id = ?\n order by album_created_at', array($userId));\n return $albums;\n }", "public function getAllAvatarsByUser()\n {\n $userId = Auth::user()->id;\n $avatar = Avatar::select('image_url', 'id')->where('user_id', $userId)->get();\n return $avatar;\n }", "public function getUserimages()\n {\n return $this->hasMany(Userimage::className(), ['user_id' => 'id']);\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "public function getMusicPublications($user)\n {\n return $this->getByCategoryType('Music', $user);\n }", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "public function findPartnerCollections($user) {\n $table = $this->_db->getTable('Collection');\n $collections = $table->findBy(array('owner_id' => $user->id));\n return $collections;\n }", "public function getUserAlbums($user_id, $start, $page_size) {\n $query_params = array(\n 'columns' => 'id, name, description',\n 'where' => 'user_id = ?',\n 'orderby' => 'create_date DESC',\n 'limit' => '?, ?'\n );\n \n $bind_params = array($user_id, $start, $page_size);\n $albums = $this->find($query_params, $bind_params);\n \n return $albums;\n }", "public function findByOwners(User $user) {\r\n $qb = $this->createQueryBuilder('i');\r\n $qb = $this->qbByOwners($qb, $user);\r\n \r\n return $qb->getQuery()->getResult();\r\n }", "public static function getListAllCam($user_id = NULL){\n if(empty($user_id)){\n $user_id = Yii::$app->user->identity->id;\n if(empty($user_id)) return false;\n }\n $query = Camera::find()\n -> leftJoin('relations_cam_user', 'relations_cam_user.cam_id=camera.id')\n ->where(['=', 'relations_cam_user.user_id', $user_id])\n ->all();\n return $query;\n }", "function &getImages( $user, $category = false )\r\n {\r\n return eZImageCategory::images( \"time\", 0, -1, $category );\r\n }", "public function getPhotos($userid)\n {\n $stmt = $this->con->prepare(\"SELECT id_foto, caminho, disciplina, dataCreate FROM tbl_foto WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $userid);\n $stmt->execute();\n $stmt->bind_result($id, $caminho, $disciplina, $data);\n $photos = array();\n\n while ($stmt->fetch()) {\n $photo = array();\n $photo['id'] = $id;\n $photo['caminho'] = $caminho;\n $photo['disciplina'] = $disciplina;\n $photo['userid'] = $userid;\n $photo['data'] = $data;\n array_push($photos, $photo);\n }\n\n $stmt->close();\n return $photos;\n }", "public function filterOwnedBy($user)\n {\n return $this->getData()->filter($this->owner_field, $user);\n }", "public static function getCollections($user_id, $options = []) {\n\t\t$options = array_merge([\n\t\t\t'type' => 'all',\n\t\t\t'conditions' => []\n\t\t], $options);\n\n\t\t//Remove contain flag, all must be included!\n\t\tif (isset($options['contain'])) {\n\t\t\tunset($options['contain']);\n\t\t}\n\n\t\t//Conditions\n\t\t$options['conditions']['UserCollection.deleted'] = 0;\n\t\t$options['conditions']['UserCollection.revision_id'] = 0;\n\t\t$options['conditions']['UserCollection.user_id'] = $user_id;\n\n\t\treturn parent::$db->selectEx(new self(), $options);\n\t}", "public static function get_all( WP_User $user ) {\n\n\t\tglobal $wpdb;\n\n\t\t$mids = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\"SELECT `umeta_id` FROM {$wpdb->usermeta} WHERE `meta_key` = %s AND `user_id` = %d\",\n\t\t\tself::META_KEY,\n\t\t\t$user->ID\n\t\t) );\n\n\t\t$sessions = array();\n\n\t\tforeach ( $mids as $meta_id ) {\n\t\t\tif ( ! is_wp_error( $session = self::get( $meta_id ) ) ) {\n\t\t\t\t$sessions[] = $session;\n\t\t\t}\n\t\t}\n\n\t\treturn $sessions;\n\t}", "function getUserPhotoAlbums($user_id=null,$profile_picture_album=false){\r\n\t\tif($user_id==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('user_id'=>$user_id));\r\n\t\tif($profile_picture_album==true)\r\n\t\t{\r\n\t\t\t$this->db->where(array('title'=>PROFILE_PICTURES));\t\t\r\n\t\t}\r\n\t\t$recordSet = $this->db->get(TBL_PHOTO_ALBUMS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public static function listByUsers($user_id){\n $projects = Project::listByUsers($user_id);\n\n $project_ids = [];\n foreach ($projects as $project){\n $project_ids[] = $project->id;\n }\n $risks = static::whereIn('project_id', $project_ids);\n return $risks;\n }", "public function getFilesCurrentUser(User $user)\n {\n }", "public function getAllPublications($user)\n {\n return $this->getByUser($user);\n }", "function getFilesByUserId($user_id) {\r\n $sql = '\r\n SELECT\r\n *\r\n FROM\r\n files\r\n WHERE\r\n user_id = ?\r\n ORDER BY\r\n uuid DESC\r\n ';\r\n\r\n return $this->query_result($sql, array($user_id));\r\n }", "function getPhotosOfUser($idUser){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$tab = new Data();\r\n\t\t$r = mysql_query(\"select login from Utilisateur where id_user = \" . $idUser);\r\n\r\n\t\tif(mysql_num_rows($r) == 0){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\t\t$name = mysql_result($r,0,0);\r\n\t\t$connectService->close();\r\n\t\tif(!is_dir(\"../v2.0/espace/\" . $name . \"/photos/sd\")){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\r\n\t\t$tab->addInfo(\"root\",\"../v2.0/espace/\" . $name . \"/photos\");\r\n\t\t$tab->addInfo(\"photos\",$this->getPhotosOfDir($tab->getInfo(\"root\")));\r\n\t\t$tab->addInfo(\"type\",\"scan\");\r\n\r\n\t\treturn $tab;\r\n\t}", "static public function getOwnerCriteria($user)\n {\n $criteria = array('user:' . $user);\n $mygroups = $GLOBALS['injector']\n ->getInstance('Horde_Group')\n ->listGroups($GLOBALS['registry']->getAuth());\n foreach ($mygroups as $id => $group) {\n $criteria[] = 'group:' . $id;\n }\n return $criteria;\n }", "function get_user_images($user_id) {\n $images = DAO_user::DAO_fetch_user_images($user_id);\n if (is_array($images)) {\n $i = 0;\n $result = array();\n foreach ($images as $image) {\n $result[$i++] = $image;\n }\n return $result;\n }\n else return -1;\n }", "public function getFullObjects(UserGroup $userGroup)\n {\n $images = $userGroup->getAssignedObjects(self::OBJECT_TYPE);\n $galleries = $userGroup->getAssignedObjects(Gallery::OBJECT_TYPE);\n $albums = $userGroup->getAssignedObjects('nggAlbum');\n\n foreach ($albums as $albumId => $albumType) {\n $albumPictures = $this->nextGenGallery->find_images_in_album($albumId);\n }\n\n foreach ($galleries as $galleryId => $galleryType) {\n $galleryImages = $this->nextGenGallery->getImagesByGallery($galleryId);\n }\n\n return $images;\n }", "public function getGamesByUserUID( $userUID ){\n\t\n\t\t//Run a find to get the user and all of their associated games\n\t\t$games = $this->find( 'all', [\n\t\t\t\t\t\t\t\t'conditions' => [\n\t\t\t\t\t\t\t\t\t'UserGame.users_uid' => $userUID,\n\t\t\t\t\t\t\t\t\t'Game.active' => 1\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t'joins' => [\n\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t'table' => 'games',\n\t\t\t\t\t\t\t\t\t\t'alias' => 'Game',\n\t\t\t\t\t\t\t\t\t\t'type' => 'inner',\n\t\t\t\t\t\t\t\t\t\t'conditions' => [\n\t\t\t\t\t\t\t\t\t\t\t'Game.uid = UserGame.games_uid'\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t'recursive' => -1\n\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\n\t\t//Return the games we found\t\n\t\treturn $games;\n\t\n\t}", "public function getBlocks($user)\n\t{\n\t\t$staff = $user->staff;\n\n\t\t// Start an array for storing the blocks\n\t\t$blocks = array();\n\n\t\tif ($staff)\n\t\t{\n\t\t\tif ($staff->appointments->count() > 0)\n\t\t\t{\n\t\t\t\t// Get today\n\t\t\t\t$today = Date::now();\n\n\t\t\t\treturn $staff->appointments->filter(function($a) use ($today)\n\t\t\t\t{\n\t\t\t\t\treturn (int) $a->service_id === 1 and $a->start->startOfDay() >= $today->startOfDay();\n\t\t\t\t})->sortBy(function($a)\n\t\t\t\t{\n\t\t\t\t\treturn $a->start;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn new Collection;\n\t\t}\n\n\t\treturn new Collection;\n\t}", "public function findOther($user): array\n {\n return $this->createQueryBuilder('c')\n ->where('c.creator != :user')\n ->andWhere('c.private = false')\n ->setParameter('user', $user )\n ->setMaxResults(4)\n ->getQuery()\n ->getResult();\n }", "public function get_portfolio_item($user_id){\n\n $user_id = intval($user_id);\n\n $portfolio_items = [];\n\n $query = \"SELECT `id`, `uid`, `full_size`, `crop_size` FROM `user_portfolio` WHERE `user_id`='$user_id'\";\n\n if ($res = sql::$con->query($query)) {\n\n while ($data = $res->fetch_array(MYSQLI_ASSOC)) {\n //$data['file_name'] = '/education-certificats/'.$data['type'].'/'.$data['uid'].'/'.$data['file_name'];\n $data['full_size'] = '/file/user-portfolio/'.$data['uid'].'/'.$data['full_size'];\n $data['crop_size'] = '/file/user-portfolio/'.$data['uid'].'/'.$data['crop_size'];\n $portfolio_items[] = $data;\n }\n\n if(is_object($res)){\n $res->free_result();\n }\n\n }\n\n return $portfolio_items;\n }", "public function getRecipes_fromUser($user) {\n\n $query = $this->db\n ->from('recipes')\n ->where('id_owner', $user)\n ->order_by('created_at', 'DESC')\n ->get();\n\n return $result = $query->result();\n }", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function findViewLists(User $user)\n {\n return $this->createQueryBuilder()\n ->find()\n ->addOr(\n $this->createQueryBuilder()\n ->expr()\n ->field('createdUserId')\n ->equals($user->getId()),\n $this->createQueryBuilder()\n ->expr()\n ->field('viewUserIds')\n ->equals($user->getId()),\n $this->createQueryBuilder()\n ->expr()\n ->field('editUserIds')\n ->equals($user->getId())\n )\n ->getQuery()\n ->execute();\n }", "public function getAlbums($feuser_uid) {\r\n\t\t$res = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\treturn $res;\r\n\t}", "public function allForUser($userId);", "public function allForUser($userId);", "public function findAllMedicByUserId($userId)\n\t{\n\t\tglobal $bdd;\n\n\t\t$q = $bdd->prepare(\"SELECT *\n\t\t\t\t\t\t\tFROM relation \n\t\t\t\t\t\t\tWHERE user_id = :user_id\n\t\t\t\t\t\t\t\");\n\t\t$q->execute(array(\n\t\t\t'user_id' => $userId\n\t\t\t));\n\n\t\t$data = $q->fetchAll(PDO::FETCH_OBJ);\n\n\t\treturn $data;\n\t}", "function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAllSetlistArtists($user_id, $name = false) {\n\t\t\t$user_id = intval($user_id);\n\t\t\t$orderBy = \"artist_count DESC\";\n\t\t\tif($name) {\n\t\t\t\t$orderBy = \"artist.artist_name\";\n\t\t\t}\n\n\t\t\t$query = \"SELECT COUNT(artist.artist_id) as artist_count, artist.artist_name, artist.artist_id\n\t\t\t\t\tFROM setlist\n\t\t\t\t\tJOIN artist\n\t\t\t\t\tON artist.artist_id = setlist.artist_id\n\t\t\t\t\tGROUP BY artist.artist_name\n\t\t\t\t\tORDER BY \" . $orderBy;\n\n\t\t\t$result = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\t\t\t$setlist_array = array();\n\t\t\tif($result->num_rows > 0) {\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t}", "static function list()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n $collections = [];\n\n foreach ($user_meta as $id => $attrs) {\n $collections[] = new self($id);\n }\n\n return $collections;\n }", "public function getProfileGallery($uid){\n\t\t/* Needs to return the profile album media for the given user */\n\t}", "public function findGivenOwnerRatings(User $user): ?array\n {\n\n return $this->createQueryBuilder('r')\n ->join('r.booking', 'b')\n ->where('b.user = :user')\n ->andWhere('r.user = :user')\n ->orderBy('r.createdAt', 'DESC')\n ->setParameter('user', $user)\n ->getQuery()\n ->getResult()\n ;\n\n }", "public function getUserSpreadsheets() {\n\t\treturn $this->findSpreadsheetsByUserId($this->user_id);\n\t}", "public function findCalendarsByUser(UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('c');\r\n $qb->where('c.createdBy = :user');\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->execute();\r\n }", "public static function get_image($user_id);", "public function get_users_items($user,$from_marketplaces=array()){\n $files = array();\n if(!is_array($from_marketplaces))$from_marketplaces=array($from_marketplaces);\n foreach($from_marketplaces as $marketplace){\n //http://marketplace.envato.com/api/v2/new-files-from-user:collis,themeforest.json\n $url = \"http://marketplace.envato.com/api/v2/new-files-from-user:$user,$marketplace.json\";\n if(_ENVATO_DEBUG_MODE){\n echo \" Grabbing API url: $url <bR>\\n\";\n }\n $data = $this->get_url($url,array(),false);\n if(!empty($data)) {\n $json_data = json_decode($data, true);\n if(_ENVATO_DEBUG_MODE){\n echo \"data: \";print_r($json_data);\n }\n $files = array_merge($files,$json_data['new-files-from-user']);\n }\n }\n return $files;\n }", "public function getUserFiles()\n {\n $user_files = Helper::getUserFiles();\n return $user_files;\n }", "public function getAlbumsForRole($feuser_uid) {\r\n\t\t$loggedIn = tx_cwtcommunity_lib_common::getLoggedInUserUID();\r\n\t\t// Check if we have an owner or not\r\n\t\tif ($feuser_uid == $loggedIn) {\r\n\t\t\t// OWNER\r\n\t\t\treturn tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\t} else {\r\n\t\t\tif (tx_cwtcommunity_lib_common::isBuddy($feuser_uid, $loggedIn)){\r\n\t\t\t\t// FRIEND\r\n\t\t\t\treturn tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND access_policy IN (1,2) AND NOT deleted = \"1\" AND NOT hidden = 1;');\t\r\n\t\t\t} else {\r\n\t\t\t\t// NORMAL USER\r\n\t\t\t\treturn tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_albums WHERE cruser_id = \"'.intval($feuser_uid).'\" AND access_policy IN (2) AND NOT deleted = \"1\" AND NOT hidden = 1;');\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $res;\r\n\t}", "public function getFavoritesPublications($user)\n {\n return $this->getByFavorite($user);\n }", "public function getPredictionsByUser($user_id)\n\t{\n\t\treturn $this->em->getRepository('IchnaeaWebAppPredictionBundle:PredictionMatrix')->findByOwner($user_id);\n\t}", "public function findByUserId($userId){\n return self::find()->where(['user_id' => $userId])->all();\n }", "public function getPhoto($userId, $size);", "public static function getCollectionsIds($user_id) {\n\t\treturn parent::$db->getIds(self::getCollections($user_id), 'UserCollection.collection_id');\n\t}", "function get_data_for_user( $user_id = null, $type = null ) {\n\t$allowed_types = [ 'beers', 'photos' ];\n\n\tif ( is_null( $user_id ) || ! in_array( $type, $allowed_types, true ) ) {\n\t\treturn [];\n\t}\n\n\t/**\n\t * Get user beers\n\t */\n\tif ( $type !== 'photos' ) {\n\t\t$cpt = substr( $type, 0, -1 );\n\n\t\t$items = get_posts( [\n\t\t\t'post_type' => $cpt,\n\t\t\t'author' => (int) $user_id,\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => 9999,\n\t\t] );\n\n\t\tif ( ! is_wp_error( $items ) && ! empty( $items ) ) {\n\t\t\treturn $items;\n\t\t}\n\t}\n\n\t/**\n\t * Get photos (WP medias)\n\t */\n\telse {\n\t\t$items = get_posts( [\n\t\t\t'post_type' => 'attachment',\n\t\t\t'author' => (int) $user_id,\n\t\t\t'posts_per_page' => 9999,\n\t\t] );\n\n\t\tif ( ! is_wp_error( $items ) && ! empty( $items ) ) {\n\t\t\treturn $items;\n\t\t}\n\t}\n\n\treturn [];\n}", "public function getList($user);", "public function getUserRepos($user)\n {\n $cacheKey = self::OWN_REPOS_CACHE_KEY . $user;\n\n if ($data = $this->checkForCache($cacheKey)) {\n return $data;\n }\n\n $repos = array_filter($this->client->api('user')->setPerPage(100)->repositories($user), function ($repo) {\n return false === $repo['fork'];\n });\n\n $this->storeCache($cacheKey, $repos);\n\n return $repos;\n }", "public static function get_asset_where($user = '') \n {\n $user = (empty($user)) ? self::get_session_user() : $user;\n \n $where = '';\n \n if (count($_SESSION['_user_vision']['asset']['host']) > 0) \n {\n $where = \"SELECT asset_id FROM alienvault.user_host_perm WHERE login = '\".$user.\"'\";\n }\n \n if (count($_SESSION['_user_vision']['asset']['net']) > 0) \n {\n if ($where != '') \n { \n $where .= ' UNION '; \n }\n \n $where .= \"SELECT asset_id FROM alienvault.user_net_perm WHERE login = '\".$user.\"'\";\n }\n }", "public function getItems($user_id){\r\n $this->db->query('SELECT *, FROM items WHERE user_id = :user_id');\r\n $this->db->bind(':user_id', $user_id);\r\n\r\n $results = $this->db->resultSet();\r\n return $results;\r\n }", "private function getUserResources()\n {\n $result = array();\n $userdata = $this->get('security.context')->getToken()->getUser();\n $groups = $userdata->getUserGroups()->toArray();\n foreach ($groups as $grp) {\n $resources = $grp->getResources();\n foreach ($resources as $res) {\n $result[$res->getId()] = $res->getName();\n }\n }\n\n return $result;\n }", "public function findListBySelected(int $user_id)\n {\n $list = $this->cart->findListBySelected($user_id);\n\n return $list;\n }", "public function get_user_items($user_id) {\n\n $query = $this->db->get_where('items', array('user_id' => $user_id));\n\n return $query->result_array();\n }", "function getAllAffinityGroupsFromUser()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllAffinityGroupsFromUser($userID);\n }", "public function getAlbums($id, $site, $userId)\n\t{\n\t\tif (true === isset($id)) {\n\t\t\t// get by uniq id\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t WHERE\n\t\t\t \ts.url = :site\n\t\t\t AND\n\t\t\t \ta.id = :id\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':id', $id);\n\t\t\t$db->param(':site', $site);\n\t\t} elseif (true === isset($userId)) {\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t INNER JOIN\n\t\t\t user_album ua ON ua.album_id = a.id\n\t\t\t WHERE\n\t\t\t \tua.user_id = :userid\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':userid', $userId);\n\t\t} elseif (true === isset($site)) {\n\t\t\t// get by by site category\n\t\t\t$exec = \"SELECT\n a.id, a.title\n\t\t\t FROM\n\t\t\t albums a\n\t\t\t INNER JOIN \n\t\t\t sites s ON s.id = a.site_id\n\t\t\t WHERE\n\t\t\t \ts.url = :site\n\t\t\t ORDER BY a.id DESC\";\n\t\t\t$db = DB::query(Database::SELECT, $exec);\n\t\t\t$db->param(':site', $site);\n\t\t}\n\n\t\t$albums = $db->execute()\n\t\t\t ->as_array();\n\t\t\n\t\treturn $albums;\n\t\t\n\t\tprint_r($albums);\n\n\t\treturn array();\n\t}", "public function scopeUserAlbums($query, $user_id)\n {\n return $query->where('user_id', $user_id);\n }", "public static function get_allowed_clusters($usersetid) {\n global $DB;\n $ids = userset::get_allowed_clusters($usersetid);\n if (!empty($ids)) {\n list($idswhere, $idsparams) = $DB->get_in_or_equal($ids);\n $sql = 'SELECT id as clusterid FROM {'.userset::TABLE.'} WHERE id '.$idswhere;\n return $DB->get_records_sql($sql, $idsparams);\n } else {\n return array();\n }\n }", "public function getValidatedObservationsByUser($user)\n {\n $qb = $this->createQueryBuilder('o')\n ->where('o.validate = :validate')\n ->andWhere('o.observer = :user')\n ->setParameters(array(\n 'validate' => 1,\n 'user' => $user));\n\n return $qb\n ->getQuery()\n ->getResult();\n }", "public static function getListAvailablePresets(int $userId): array\n\t{\n\t\t$query =\n\t\t\tOptionGroupTable::query()\n\t\t\t\t->setSelect(['ID', 'NAME'])\n\t\t\t\t->registerRuntimeField(\n\t\t\t\t\t'OPTION_ACCESS',\n\t\t\t\t\tnew Reference(\n\t\t\t\t\t\t'OPTION_ACCESS',\n\t\t\t\t\t\tOptionAccessTable::class,\n\t\t\t\t\t\tJoin::on('this.ID', 'ref.GROUP_ID'),\n\t\t\t\t\t\t['join_type' => Join::TYPE_INNER]\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->registerRuntimeField(\n\t\t\t\t\t'USER_ACCESS',\n\t\t\t\t\tnew Reference(\n\t\t\t\t\t\t'USER_ACCESS',\n\t\t\t\t\t\tUserAccessTable::class,\n\t\t\t\t\t\tJoin::on('this.OPTION_ACCESS.ACCESS_CODE', 'ref.ACCESS_CODE'),\n\t\t\t\t\t\t['join_type' => Join::TYPE_INNER]\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->where('USER_ACCESS.USER_ID', $userId)\n\t\t;\n\t\t$presets = [];\n\t\tforeach ($query->exec() as $row)\n\t\t{\n\t\t\t$presets[] = [\n\t\t\t\t'id' => $row['ID'],\n\t\t\t\t'name' => self::getPresetName($row),\n\t\t\t];\n\t\t}\n\n\t\treturn $presets;\n\t}", "function getIds($user = null) {\n return DB::executeFirstColumn('SELECT user_id FROM ' . TABLE_PREFIX . 'project_users WHERE project_id = ?', $this->object->getId());\n }", "public static function getFilesMetadata($userId);", "public function getListByUserId($userid){\n $qb = $this->createQueryBuilder('kuchigroup')\n ->join('kuchigroup.users', 'users')\n ->where('users.id = :userid')\n ->setParameter('userid', $userid);\n\n return $qb->getQuery()->getResult();\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getUserUploads() {\n\t\tif (!self::COOKIES_ENABLED) {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t/* load form database */\n\t\t$uploads = array();\n\t\t$delete_code = $this->getDeleteCode();\n\t\t$result = $this->db->query('\n\t\t\tSELECT *\n\t\t\tFROM image\n\t\t\tWHERE delete_code = \"'.SQLite3::escapeString($delete_code).'\"\n\t\t\t\tAND gallery_id = \"\"\n\t\t\tORDER BY ROWID DESC');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$uploads[$entry['id']] = $entry;\n\t\t\t}\n\t\t}\n\t\treturn $uploads;\n\t}", "public function allForUser($userId)\n {\n return $this->model->where('staff_id', $userId)->get();\n }", "function getUsersBands($id_user, $userObj, $bandObj){\n $bandIds = $userObj->getBands(\"\", array(0 => array(\"column\" => \"uzivatel_id_uzivatel\", \"value\" => intval($id_user), \"symbol\" => \"=\")), \"\");\n $bands = array();\n for($i = 0; $i < sizeof($bandIds); $i++){\n $row = $bandObj->getBand($bandIds[$i]['kapela_id_kapela'], \"\");\n $bands[$i] = $row;\n }\n \n return $bands;\n}", "public function getUserProfilePhotos(int $user_id, int $offset = 0, int $limit = 100)\n {\n return current($this->sendRequest('GET', 'getUserProfilePhotos', [\n 'user_id' => $user_id\n ]));\n }", "public function getUserGalleries() {\n\t\tif (!self::COOKIES_ENABLED) {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t/* load form database */\n\t\t$galleries = array();\n\t\t$delete_code = $this->getDeleteCode();\n\t\t$result = $this->db->query('\n\t\t\tSELECT gallery_id, delete_time, delete_code, COUNT(*) as num_images\n\t\t\tFROM image\n\t\t\tWHERE delete_code = \"'.SQLite3::escapeString($delete_code).'\"\n\t\t\t\tAND gallery_id != \"\"\n\t\t\tGROUP BY gallery_id\n\t\t\tORDER BY ROWID DESC');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$galleries[$entry['gallery_id']] = $entry;\n\t\t\t}\n\t\t}\n\t\treturn $galleries;\n\t}", "public function allByUser($user)\n {\n $this->andWhere('[[account_id]]=' . $user);\n return $this;\n }", "public function getIdsForUser($user_id, $client_id);", "public function getOwnedListings($userId)\r\n\t{\r\n\t\t$query = 'SELECT m.marketID\r\n\t\t\tFROM marketplace AS m\r\n\t\t\t\tLEFT JOIN marketplacePayments AS mpp ON mpp.marketID = m.marketID\r\n\t\t\tWHERE mpp.startDate <= NOW()\r\n\t\t\t\tAND mpp.endDate >= NOW()\r\n\t\t\t\tAND mpp.paid = 1\r\n\t\t\t\tAND m.mLive = 1\r\n\t\t\t\tAND m.mUserID = '.(int) $userId;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$listings = $this->_db->loadAssocList('marketID');\r\n\t\tif (!$listings) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Add listing details and return\r\n\t\t$this->addDetails($listings);\r\n\t\treturn $listings;\r\n\t}", "public function getGroupFilesFromDatabase() {\n $db = \\Helper::getDB();\n $db->where('g.groupId', $db->escape($this->getId()));\n $db->join('documents d', 'd.id = g.documentId', 'LEFT');\n $db->join('users u', 'u.id = d.ownerId', 'LEFT');\n $results = $db->get('group_documents g', NULL, 'd.*, u.*, d.id AS fileId, u.id AS userId');\n // Process all files and their owners\n foreach($results as $result) {\n $user = new \\Models\\User($result['userId'], $result['username'], $result['email'], $result['firstName'], $result['lastName'], $result['lastLogin']);\n $file = new \\Models\\File($result['fileId'], $result['type'], $result['title'], $user, $result['creationDate'], $result['modificationDate'], $result['file']);\n $this->addFile($file);\n }\n }", "public function getVideoPublications($user)\n {\n return $this->getByCategoryType('Video', $user);\n }", "public function getProjectsByUserId(int $userId) : array;", "public function getTinyUserCollection($userId){\n try {\n \n $tinyUserCollection=UserCollection::model()->getTinyUserCollection((int)$userId); \n return $tinyUserCollection;\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getTinyUserCollection::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n }", "public function media_kit_images($user){\n global $base_secure_url;\n $uid = $user->id();\n $options = [];\n $options['uid'] = $uid;\n $options['element_id'] = 'mk-vmt-two';\n $options['mk_select'] = 1;\n $options['search'] = 1;\n $options['tabs']['photo'] = ['cols' => ['multi_asset_chk' => 1, 'photo' => 1, 'title' => 1, 'tags' => 1, 'dimension' => 1], 'active' => 0];\n $options['tabs']['audio'] = [];\n $options['tabs']['video'] = [];\n $options['tabs']['text'] = [];\n $variables['media_kit_two'] = \\Drupal::service('media.kit.selector')->getMediaKitSelector($options);\n if(isset($_GET['masoom'])){print \"<pre>\";print_r($variables);exit;}\n $libraries[] = 'media_vault_tool/react.min';\n\t\t$libraries[] = 'media_vault_tool/react.dom.min';\n\t\t$libraries[] = 'media_vault_tool/axios';\n\t\t$libraries[] = 'media_vault_tool/km_global';\n $libraries[] = 'media_kit_selector/media.kit.global';\n $response = $variables;\n return new JsonResponse($response);\n }", "public function findPartnerCollectionIds($user) {\n $collection_ids = array();\n $collections = $this->findPartnerCollections($user) ;\n foreach ($collections as $c) {\n $collection_ids[] = $c->id;\n }\n return $collection_ids;\n }", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function pg_master_list($id_user){\n\n\t\t\t$q = new Query();\n\t\t\t$q->tables = array(\"pg_view\");\n\t\t\t$q->fields = array(\"Username\",\"id\",\"photo\");\n\t\t\t$q->filters = \"pg_view.id_sito=\". $this->let_id_sito() .\" and pg_view.MasterID = '\".$id_user.\"'\";\n\t\t\t\n\t\t\tif($q->Open()){\n\t\t\t\t$pg_master=\"\";\n\t\t\t\twhile($row=$q->GetNextRecord(true)){\n\t\t\t\t\t$pg_master[]=$row;\n\t\t\t\t}\n\t\t\t\tif(is_array($pg_master)){\n\t\t\t\t\treturn $pg_master;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}", "public function getAllPermissionsForUser($user): array;", "public function getAllOwned($userID, ILoggerService $logger){\n \n $logger->info(\"Entering AffinityGroupService.getAllOwned()\");\n \n //Creates a connection to the database\n $connection = new Connection();\n \n //Creates an instance of the dao\n $DAO = new AffinityGroupDAO($connection, $logger);\n \n //Stores the results of the dao method call\n $results = $DAO->getOwned($userID);\n \n $connection = null;\n \n $logger->info(\"Exiting AffinityGroupService.getAllOwned()\");\n \n return $results;\n }", "public function findAllByUser( $userId )\n {\n return $this->getMapper()\n ->findAllByUser( $userId );\n }", "function get_groups_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM groups\r\n WHERE is_active = '1' AND local = '1' AND created_by = '$user_id';\";\r\n\r\n $groups_data = array();\r\n $groups = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $groups_data[$key] = $value;\r\n foreach ($groups_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $groups[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $groups;\r\n}", "public function getList(User $user): array\n {\n $participateTeams = $user->participateTeams()->get();\n\n $ownedTeams = $user->ownedTeams()->get()->map(static function ($team) {\n $team['owned'] = true;\n return $team;\n });\n\n return $participateTeams->merge($ownedTeams)->toArray();\n }", "public function getImageSizes(): array\n {\n /** @var BackendUser $user */\n $user = $this->tokenStorage->getToken()->getUser();\n\n return $this->imageSizes->getOptionsForUser($user);\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function getFavoriteSongs($userId){\n return $this->DB->queryFetchAllAssoc(\"SELECT s.* FROM user u, song s, favorite_songs fs WHERE fs.user_id = u.id AND fs.song_id = s.id AND u.id = $userId\");\n }", "private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}", "public function getResultsOfUser($user_id);", "public function forUser(User $user)\n\t{\n\t\treturn $user->indicadores()\n\t\t\t\t\t->orderBy('nome', 'asc')\n\t\t\t\t\t->get();\n\t}" ]
[ "0.76590306", "0.69626945", "0.6388711", "0.59604466", "0.5868237", "0.5824793", "0.58002084", "0.5741096", "0.57019824", "0.5700303", "0.5661259", "0.5622172", "0.56107265", "0.5604882", "0.55912995", "0.55279803", "0.55277044", "0.55081683", "0.54907244", "0.548561", "0.5483802", "0.547936", "0.5474477", "0.5462978", "0.5451737", "0.5418412", "0.5410218", "0.5390644", "0.5352495", "0.5350298", "0.5315636", "0.52933764", "0.5286657", "0.5279726", "0.5277779", "0.5247966", "0.5242521", "0.5242521", "0.52293456", "0.5220321", "0.5208345", "0.5203042", "0.5193699", "0.5192172", "0.5183401", "0.5160074", "0.5159151", "0.5156621", "0.515097", "0.51488686", "0.51467055", "0.5142819", "0.5134112", "0.5124072", "0.5120711", "0.51081854", "0.5107398", "0.5106543", "0.5102486", "0.5093065", "0.50913256", "0.5081489", "0.50806314", "0.50763017", "0.5067164", "0.50534695", "0.5051665", "0.5051322", "0.50441986", "0.50406176", "0.50389826", "0.5038082", "0.5032158", "0.5029292", "0.5026191", "0.50019073", "0.50003046", "0.49823728", "0.49801046", "0.49795896", "0.4966299", "0.49477294", "0.49396566", "0.49292445", "0.4928736", "0.4919272", "0.49148872", "0.4913689", "0.49134132", "0.49114078", "0.49112725", "0.4909278", "0.4907282", "0.49036035", "0.4899526", "0.48967722", "0.48912162", "0.4879149", "0.48758847", "0.48653537" ]
0.7680268
0
Get the list of photos in a set.
function photosets_getPhotos ($photoset_id, $per_page = 25, $page = 1, $media = 'photos', $extras = NULL) { $params = array(); $params['method'] = 'flickr.photosets.getPhotos'; $params['photoset_id'] = $photoset_id; $params['per_page'] = $per_page; $params['page'] = $page; $params['media'] = $media; if ($extras) $params['extras'] = $extras; $response = $this->execute($params); $object = unserialize($response); if ($object['stat'] == 'ok') { return $object['photoset']; } else { $this->setError($object['message'], $object['code']); return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos();", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "public function photos() {\n\t\t$photos = $this->client->getPhotos( [\n\t\t\t'group_urlname' => $this->group,\n\t\t] );\n\n\t\treturn $photos;\n\t}", "public function getAllPhotos();", "public function getPhotos()\n {\n return $this->photos;\n }", "public function photos()\n {\n return $this->morphedByMany(Photo::class, 'taggable');\n }", "private static function getPhotos()\r\n {\r\n return self::getDoc()->getElementsByTagName('photo');\r\n }", "public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }", "public function getUnsplashCollectionPhotos(){\n $images = $this->unsplash->unsplashCollectionPhotos();\n return $images;\n }", "function photos_getNotInSet ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = 'all', $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getNotInSet';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getFotos()\n\t{\n\t\treturn $this->fotos;\n\t}", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function photos()\n {\n return $this->morphMany(Photo::class, \"viewable\");\n }", "public function getPhotos($page, $itemsPerPage);", "public function getPhotos($album_uid) {\r\n\t\t$photos = tx_cwtcommunity_lib_common::dbQuery('SELECT * FROM tx_cwtcommunity_photos p WHERE album_uid = \"'.intval($album_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1 ORDER BY crdate ASC;');\r\n\t\treturn $photos;\r\n\t}", "public function getPhotoUrls () {\n\t\t\n\t}", "private function getPictures( $count ){\n\t\t$flickr_group_id = Yii::$app->params['flickr-group-id'];\n\t\t$flickr_api_key = Yii::$app->params['flickr-api-key'];\n\n\t\t$flickr_url = 'https://api.flickr.com/services/rest/?method=flickr.groups.pools.getPhotos&api_key=' . urlencode( $flickr_api_key ) . '&group_id=' . urlencode($flickr_group_id) . '&per_page=' . urlencode($count) . '&format=json&nojsoncallback=1&extras=url_q';\n\t\t$json_array = $this->getFromApi( $flickr_url );\n\n\t\tif( isset($json_array['photos']) && isset($json_array['photos']['photo']) ){\n\t\t\tif( isset($_GET['debug']) ){\n\t\t\t\tvar_dump($json_array['photos']['photo']);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\treturn $json_array['photos']['photo'];\n\t\t}\n\n\t\treturn array();\n\t}", "public function getPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "function find_public_photos($ids_of_private_photos, $ids_of_all_users_photos_on_page)\n{\n $public_photos = [];\n\n foreach ($ids_of_all_users_photos_on_page as $photo_id)\n if (!in_array($photo_id, $ids_of_private_photos))\n array_push($public_photos, $photo_id);\n\n return $public_photos;\n}", "public function getAll()\n {\n $query = $this->getQueryBuilder()->select('*')\n ->from($this->table);\n\n if ($photos = $this->db->get_results($query->build())) {\n foreach ($photos as $index => $photo) {\n $photos[$index] = $this->extend($photo);\n }\n }\n\n return $photos;\n }", "function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}", "public function getPublicPopularPhotos(){\n $sql = 'SELECT p.*, m.pseudo, m.idMember \n FROM members AS m \n INNER JOIN photos AS p \n ON memberId = idMember\n WHERE status=0\n ORDER BY likes DESC LIMIT 9';\n $photos = $this->executeQuery($sql, array());\n return $photos;\n }", "public function getPictures()\n {\n\n return $this->pictures;\n }", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function get_photos($args = array())\r\n\t{\r\n\t\tif(empty($args))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&max-results=10\");\r\n\t\t}\r\n\t\telseif(isset($args['album']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"/albumid/\" . $args['album'] . \"?prettyprint=true\");\r\n\t\t}\r\n\t\telseif(isset($args['tag']))\r\n\t\t{\r\n\t\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=photo&tag=\" . $args['tag'] . \"&prettyprint=true\");\r\n\t\t}\r\n\t\treturn $xml;\r\n\t}", "public function getImages() : array\n\t{\n\t\treturn $this->images_list;\n\t}", "public function getPhotos()\n {\n try {\n if (!$this->profileUrl) {\n throw new Exception(\"The profile url is empty.\", self::ERROR_PROFILE_URL_EMPTY);\n }\n $html = $this->getHtmlProfile();\n $photoList = $this->getPhotoList($html);\n } catch (Exception $e) {\n $photoList = array();\n $this->errorCode = $e->getCode();\n $this->errorMessage = $e->getMessage();\n }\n\n return $photoList;\n }", "public function photos()\n {\n return $this->morphToMany(\n 'App\\RentalManager\\AddOns\\Photo', // model\n 'node', // node\n 'photo_node', // table\n 'node_id',\n 'photo_id'\n );\n }", "public static function find_all_photos(){\n global $db;\n $sql = \"SELECT * FROM photos\";\n try {\n $result = $db->query($sql);\n $rows=$result->fetchall();\n return $rows;\n } catch (Exception $e) {\n throw $e;\n }\n }", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "public function getMetadataSet($set) {\n\t\treturn array();\n\t}", "public function photos() {\n \treturn $this->morphMany('App\\Photo', 'imageable');\n }", "public function getImages()\r\n {\r\n if (!isset($this->_images)) {\r\n $this->_images = [];\r\n for ($i=1; $i<=6; $i++) {\r\n if ($data = $this->getData('image' . $i)) {\r\n $image = $this->imageRepository->getById($data);\r\n if ($image->isActive()) {\r\n $this->_images[] = $image->getUrl();\r\n }\r\n }\r\n }\r\n }\r\n return $this->_images;\r\n }", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function getPhotos($term, $limit = 10, $page = 1) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n $results = $flickr->photos_search(\r\n array('tags' => $term, 'tag_mode' => 'any', 'per_page' => $limit, 'page' => $page)\r\n );\r\n\r\n\t\tforeach ($results['photo'] as $key => $result) {\r\n\t\t\t$results['photo'][$key]['square_image_url'] = $flickr->buildPhotoURL($result, 'square');\r\n $results['photo'][$key]['large_image_url'] = $flickr->buildPhotoURL($result, 'large');\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n }", "public function get_images()\r\n\t\t{\r\n\t\t\t$images = $this->obj->result;\r\n\t\t\treturn $images;\r\n\t\t}", "public function getImages()\n {\n return GalleryImage::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function getPhotoByLikes($allPhotos)\n {\n return $allPhotos;\n \n }", "function tidypics_list_photos(array $options = array()) {\n\tglobal $autofeed;\n\t$autofeed = true;\n\n\t$defaults = array(\n\t\t'offset' => (int) max(get_input('offset', 0), 0),\n\t\t'limit' => (int) max(get_input('limit', 10), 0),\n\t\t'full_view' => true,\n\t\t'list_type_toggle' => false,\n\t\t'pagination' => true,\n\t);\n\n\t$options = array_merge($defaults, $options);\n\n\t$options['count'] = true;\n\t$count = elgg_get_entities($options);\n\n\t$album = get_entity($options['container_guid']);\n\tif ($album) {\n\t\t$guids = $album->getImageList();\n\t\t// need to pass all the guids and handle the limit / offset in sql\n\t\t// to avoid problems with the navigation\n\t\t//$guids = array_slice($guids, $options['offset'], $options['limit']);\n\t\t$options['guids'] = $guids;\n\t\tunset($options['container_guid']);\n\t}\n\t$options['count'] = false;\n\t$entities = elgg_get_entities($options);\n\n\t$keys = array();\n\tforeach ($entities as $entity) {\n\t\t$keys[] = $entity->guid;\n\t}\n\t\n\t$entities = array_combine($keys, $entities);\n\n\t$sorted_entities = array();\n\tforeach ($guids as $guid) {\n\t\tif (isset($entities[$guid])) {\n\t\t\t$sorted_entities[] = $entities[$guid];\n\t\t}\n\t}\n\n\t// for this function count means the total number of entities\n\t// and is required for pagination\n\t$options['count'] = $count;\n\n\treturn elgg_view_entity_list($sorted_entities, $options);\n}", "public function getPicturesInSlider(): PictureCollection;", "public function photos() {\n return $this->morphMany('App\\Models\\Photo', 'imageable'); //'imageable' - method in Photos model\n }", "private function getPersonalPhotos()\n {\n if (!isset($this->personalPhotos)) {\n $individual = $this->getIndividual();\n $immediateFamily = $this->getImmediateFamily();\n $individuals = array_merge(array($individual), $immediateFamily);\n $this->personalPhotos = $this->getCommonUtility()->getIndividualsPersonalPhotos($individuals);\n }\n \n return $this->personalPhotos;\n }", "function getInstagramPhotos()\n{\n\tif (!defined('INSTAGRAM_CLIENT_KEY') || empty('INSTAGRAM_CLIENT_KEY')) {\n\t\treturn array(\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c164.0.752.752/24327718_979693195521145_5926320459137155072_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/25007328_463374084057486_4202366662931906560_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24274537_883051235206270_1674945273010323456_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/24254161_820673758094437_8968843062188965888_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c1.0.1077.1077/24254633_169558897114728_8684804801751416832_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.95.1080.1080/24124861_1912156219101611_2164421152179486720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/23966876_1820539604904919_3278452324921507840_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c0.102.1080.1080/23098704_2000753523539026_3531175532127322112_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/22352341_434368616964185_2080880902946160640_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/c4.0.1072.1072/22069330_391481964600723_3757044722602868736_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21435441_393873154348738_3350035200519176192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/20766112_1528362793892144_4693568255665635328_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20837064_1247676548677748_6997650835094110208_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22280937_285539518619563_506657844297203712_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/22221084_1964345760508959_1278426307331358720_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/21980596_337488053381076_4425065935614771200_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/e35/21576527_274519029730042_4177729622420488192_n.jpg',\n\t\t\t'https://instagram.fmex7-2.fna.fbcdn.net/t51.2885-15/s640x640/sh0.08/e35/20759926_278135109335844_835068519971291136_n.jpg',\n\t\t);\n\t}\n}", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "public function findDistinctUrlPics()\n {\n return $this->createStandardQueryBuilder()->distinct('pics.url')->sort('public_date', 1)->getQuery()->execute();\n }", "public function getPhotos($filters = array(), $limit = 20, $offset = null)\n {\n $buildQuery = $this->buildQuery($filters, $limit, $offset);\n $queue = $this->getBatchRequest();\n $this->db->batch($queue)->select(\"SELECT * FROM `{$this->domainPhoto}` {$buildQuery['where']} {$buildQuery['sortBy']} LIMIT {$buildQuery['limit']}\", $buildQuery['params']);\n if(isset($buildQuery['params']['NextToken']))\n unset($buildQuery['params']['NextToken']);\n $this->db->batch($queue)->select(\"SELECT COUNT(*) FROM `{$this->domainPhoto}` {$buildQuery['where']}\", $buildQuery['params']);\n $responses = $this->db->batch($queue)->send();\n\n $this->logErrors($responses);\n if(!$responses->areOK())\n return false;\n\n $photos = array();\n foreach($responses[0]->body->SelectResult->Item as $photo)\n $photos[] = $this->normalizePhoto($photo);\n\n if(!empty($photos))\n $photos[0]['totalRows'] = intval($responses[1]->body->SelectResult->Item->Attribute->Value);\n\n return $photos;\n }", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "public static function getPopularPhotos()\n {\n $c = new Criteria();\n $c->setLimit(4);\n $c->add(self::APPROVED, 1);\n $c->add(PhotoPeer::POPULAR_PHOTO, 1);\n $c->add(PhotoPeer::VISIBILITY, 0);\n $c->addDescendingOrderByColumn(PhotoPeer::RATING);\n $photos=PhotoPeer::doSelect($c); \n return $photos;\n }", "function photos_getUntagged ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getUntagged';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "static function getList()\n {\n $out = array();\n\n if ($dh = opendir(__DIR__ . '/../img/')) {\n while (($file = readdir($dh)) !== false) {\n if (substr($file, -4) === '.jpg') {\n $filename = substr($file, 0, -4);\n $out[$filename] = realpath(__DIR__ . '/../img/' . $file);\n }\n }\n\n closedir($dh);\n }\n\n return $out;\n }", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "public function getImages()\r\n {\r\n return $this->images;\r\n }", "function people_getPublicPhotos ($user_id, $per_page = 25, $page = 1, $safe_search = 1, $extras = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.people.getPublicPhotos';\n\t\t$params['user_id'] = $user_id;\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\t$params['safe_search'] = $safe_search;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getPhotos(): Builder\n {\n return Photo::public()->where(function ($q) {\n return $this->filter($q);\n });\n }", "public function getPhotosData() {\n\t\t// 画像データ取得\n\t\t$results = $this->HttpSocket->get(FLICKR_API_URL,\n\t\t\tarray(\n\t\t\t\t'method' => PHOTOSSEARCH,\n\t\t\t\t'format' => DATAFORMAT,\n\t\t\t\t'api_key' => $this->api_key,\n\t\t\t\t'sort' => SORTTYPE,\n\t\t\t\t'accuracy' => ACCURACY,\n\t\t\t\t'content_type' => CONTENTTYPE,\n\t\t\t\t'license' => LICENSE,\n\t\t\t\t'privacy_filter' => PRIVACYFILTER,\n\t\t\t\t'per_page' => PERPAGE,\n\t\t\t\t'safe_search' => SAFESEARCH,\n\t\t\t\t'tags' => TAGS,\n\t\t\t));\n\n\t\t$body = $results->body;\n\t\treturn unserialize($body);\n\t}", "public function photos(): HasMany\n\t{\n\t\treturn $this->hasMany('App\\Models\\Photo', 'album_id', 'id');\n\t}", "public function photos(){\n return $this->morphMany('cms\\Photo', 'imageable');\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "public function getImages()\n {\n return $this->images;\n }", "function getImages() {\n $bdd = getBdd();\n $users = $bdd->query('select IMG_PATH as path,'\n . ' USER_ID as user_id, REV_ID as rev_id'\n . ' from T_IMAGES')->fetchAll(PDO::FETCH_ASSOC);\n return $users;\n}", "public function getImages()\n {\n $url = str_replace(\"[:action]\", \"images\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n $_images = '';\n foreach ($result['data'] as $item) {\n $_img = new ImgUrImage();\n $_img->setAttributes($item);\n $_images[] = $_img;\n }\n\n return $_images;\n }", "public function get_images(){\n\t\treturn $this->images;\n\t}", "private function getPhotoList($html)\n {\n $matches = array();\n $photoList = array();\n $profileSharedData = array();\n\n if (preg_match(\"#_sharedData = (\\{.*});<\\/script>#\", $html, $matches)) {\n if ((isset($matches[1])) && (!empty($matches[1]))) {\n $profileSharedData = json_decode($matches[1], true);\n }\n }\n\n if (isset($profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'])) {\n $timeLineMedia = $profileSharedData['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media'];\n\n if (!isset($timeLineMedia['count']) || ($timeLineMedia['count'] == 0)) {\n throw new Exception(\"This profile doesn't have any photo.\", self::ERROR_PROFILE_NO_PHOTO);\n } elseif (isset($timeLineMedia['edges']) && (count($timeLineMedia['edges']) === 0)) {\n throw new Exception(\"This is a private account.\", self::ERROR_PROFILE_NO_PHOTO);\n }\n\n foreach ($timeLineMedia['edges'] as $photo) {\n if (true == $photo['node']['is_video']) {\n continue;\n }\n\n $photoList[] = array(\n 'shortcode' => $photo['node']['shortcode'],\n 'display_url' => $photo['node']['display_url'],\n 'thumbnail_src' => $photo['node']['thumbnail_src'],\n 'thumbnail_resources' => $photo['node']['thumbnail_resources'],\n 'dimensions' => $photo['node']['dimensions'],\n 'liked_by' => $photo['node']['edge_liked_by']['count'],\n 'comment_by' => $photo['node']['edge_media_to_comment']['count'],\n );\n }\n }\n\n return $photoList;\n }", "public function getImages() {\n\t\treturn($this->images);\n\t}", "public function getIDsforSet($set)\n\t{\n\t if ($set instanceof _set)\n\t {\n\t\t$ids = array();\n\t\t$query = false;\n\t\t$sname = $set->name;\n\t\t$split_spec = explode(':', $set->spec, 2);\n\t\tif (count($split_spec) < 2)\n\t\t{\n\t\t throw new Oai_BadArgument_Exceptions(\"malformed set spec '$set->spec'\");\n\t\t}\n\t\t$prefix = $split_spec[0];\n\t\t$spec = $split_spec[1];\n\t\tswitch($set->source)\n\t\t{\n\t\tcase 'datasource':\n\t\t\t$query = $this->db->distinct()->select(\"registry_objects.registry_object_id\")\n\t\t\t\t->join(\"data_sources\",\n\t\t\t\t \"data_sources.data_source_id = registry_objects.data_source_id\",\n\t\t\t\t \"inner\")\n\t\t\t\t->get_where(\"registry_objects\",\n\t\t\t\t\t array(\"data_sources.slug\" => $spec));\n\t\t\tbreak;\n\t\tcase 'group':\n $query = $this->db->distinct()->select(\"registry_objects.registry_object_id\")\n ->get_where(\"registry_objects\",\n array(\"group\" => str_replace(\"0x20\",\" \",$sname)));\n\t\t\tbreak;\n\t\tcase 'class':\n\t\t\t$query = $this->db->distinct()->select(\"registry_objects.registry_object_id\")\n\t\t\t\t->get_where(\"registry_objects\",\n\t\t\t\t\t array(\"class\" => $sname));\n\t\t break;\n\t\tdefault:\n\t\t //this should never really happen, but just in case\n\t\t return array();\n\t\t break;\n\t\t}\n\t\t$ids = array_map(create_function('$e', 'return $e[\"registry_object_id\"];'),\n\t\t\t\t\t\t $query->result_array());\n\t\t$query->free_result();\n\t\treturn $ids;\n\t }\n\t else\n\t {\n\t\treturn array();\n\t }\n\t}", "public function galleries(){\n\n $parameters = [\n 'sort' => 'position',\n 'sort_direction' => 'asc',\n 'page' => 1,\n 'cover_size' => 4,\n 'rpp' => 40\n ];\n\n $data = $this->api->get_galleries($parameters);\n\n return $data['galleries'];\n }", "public function getImages(){\n return $this->images;\n }", "function getPhotosetInfo ($set_id) {\n global $config;\n $json = cacheGet('photosetinfo-' . $set_id);\n if (!$json) {\n $json = file_get_contents('https://api.flickr.com/services/rest/?method=flickr.photosets.getInfo&user_id=' . $config['user_id'] . '&photoset_id=' . $set_id . '&format=json&api_key=' . $config['api_key']);\n cacheSet('photosetinfo-' . $set_id, $json);\n }\n return json_decode(substr($json, 14, -1), true);\n}", "public function getAllImages()\n {\n $sql = \"\n\t\t\tSELECT A.*, B.tag_id, C.name tagName FROM images A\n\t\t\tLEFT JOIN tag_relationships B\n\t\t\tON A.id = B.image_id\n\t\t\tLEFT JOIN tags C\n\t\t\tON B.tag_id = C.id\n\t\t\tORDER BY A.name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n // index the images by id then add their tags\n foreach ($result as $image => $data) {\n if (isset($this->images[$data['id']])) {\n $this->images[$data['id']]['tags'][$data['tag_id']] = $data['tagName'];\n } else {\n $this->images[$data['id']] = [\n 'name' => $data['name'],\n 'url' => $data['url'],\n 'tags' => [$data['tag_id'] => $data['tagName']],\n ];\n }\n }\n return $this->images;\n }", "public function photos()\n {\n return $this->hasMany(Photo::class, 'album_id', 'id');\n }", "public function photographCollections()\n {\n return $this->hasMany(PhotographCollection::class)->orderBy('title', 'asc');\n }", "public function getFileList()\n {\n if ($sessionKey = $this->getSessionKey()) {\n $list = $deferredQuery = $this->model\n ->{$this->attribute}()\n ->withDeferred($sessionKey)\n ->orderBy('id', 'desc')\n ->get();\n } else {\n $list = $this->model\n ->{$this->attribute}()\n ->orderBy('id', 'desc')\n ->get();\n }\n\n if (!$list) {\n $list = new Collection;\n }\n\n /*\n * Decorate each file with thumb\n */\n $list->each(function ($file) {\n $this->decorateFileAttributes($file);\n });\n\n return $list;\n }", "public function getImageSet()\n {\n if (!$this->imageSet instanceof ImageSetStorage) {\n $this->imageSet = new ImageSetStorage($this->repository);\n }\n return $this->imageSet;\n }", "public function photos(Builder $photos_sql)\n\t{\n\n\t\t$previousPhotoID = '';\n\t\t$return_photos = array();\n\t\t$photo_counter = 0;\n\t\t$photos = $photos_sql->get();\n\t\tforeach ($photos as $photo_model) {\n\n\t\t\t// Turn data from the database into a front-end friendly format\n\t\t\t$photo = $photo_model->prepareData();\n\n\t\t\t// Set previous and next photoID for navigation purposes\n\t\t\t$photo['previousPhoto'] = $previousPhotoID;\n\t\t\t$photo['nextPhoto'] = '';\n\n\t\t\t// Set current photoID as nextPhoto of previous photo\n\t\t\tif ($previousPhotoID !== '') {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $photo['id'];\n\t\t\t}\n\t\t\t$previousPhotoID = $photo['id'];\n\n\t\t\t// Add to return\n\t\t\t$return_photos[$photo_counter] = $photo;\n\n\t\t\t$photo_counter++;\n\t\t}\n\n\t\tif (count($return_photos) > 0) {\n\t\t\t// Enable next and previous for the first and last photo\n\t\t\t$lastElement = end($return_photos);\n\t\t\t$lastElementId = $lastElement['id'];\n\t\t\t$firstElement = reset($return_photos);\n\t\t\t$firstElementId = $firstElement['id'];\n\n\t\t\tif ($lastElementId !== $firstElementId) {\n\t\t\t\t$return_photos[$photo_counter - 1]['nextPhoto'] = $firstElementId;\n\t\t\t\t$return_photos[0]['previousPhoto'] = $lastElementId;\n\t\t\t}\n\t\t}\n\n\t\treturn $return_photos;\n\t}", "public function getImages() {\r\n\t\treturn $this->images === NULL ? array() : $this->images;\r\n\t}", "public function getImageList() {\n\t\t\treturn $this->imageList;\n\t\t}", "public function getImages()\n {\n\t\t//TODO Image 2. What should our query builder do?\n\t\t// $data = ImageModel::???();\n\t\t$data = [];\n\t\treturn $this->sendResponse($data);\n }", "function photos_getWithGeoData ($per_page = 25, $page = 1, $min_upload_date = NULL, $max_upload_date = NULL, $min_taken_date = NULL, $max_taken_date = NULL, $privacy_filter = 1, $media = all, $extras = NULL, $sort = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photos.getWithGeoData';\n\t\t$params['per_page'] = $per_page;\n\t\t$params['page'] = $page;\n\t\tif ($min_upload_date) $params['min_upload_date'] = $min_upload_date;\n\t\tif ($max_upload_date) $params['max_upload_date'] = $max_upload_date;\n\t\tif ($min_taken_date) $params['min_taken_date'] = $min_taken_date;\n\t\tif ($max_taken_date) $params['max_taken_date'] = $max_taken_date;\n\t\tif ($privacy_filter) $params['privacy_filter'] = $privacy_filter;\n\t\tif ($media) $params['media'] = $media;\n\t\tif ($extras) $params['extras'] = $extras;\n\t\tif ($sort) $params['sort'] = $sort;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photos'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function listsBySet($set_id = null)\n {\n $setProperties = Set::with('property')->find($set_id);\n return response()->json([\n 'setProperties' => $setProperties->property\n ]);\n }", "public function getTenLatestPhotos();", "public function getPictures() : ?array\n {\n return $this->get('pictures', 'products');\n }", "public function getImages() {\n\t\tif($this->images === null) {\n\t\t\t$this->images = $this->getObjectManager()->get('Qinx\\Qxgallery\\Domain\\Repository\\ImageRepository')->findAll(array(\n\t\t\t\t'category' => $this\n\t\t\t));\n\t\t}\n\n\t\treturn $this->images;\n\t}", "public function getImagesFromGET($getString) {\n\t\treturn $this->getListFromGET($getString);\n\t}", "function _find_list() {\n\t\treturn $this->Album->generatetreelist(null, null, null, '__');\n\t}", "public function getListItems()\n {\n return $this->getAlbums();\n }", "public function allImages()\n {\n $query = \"SELECT DISTINCT image from blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $images = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $images;\n\n }", "static function idsFromPhotos($photos) {\n $ids = array();\n foreach ($photos as $photo) {\n $ids[] = $photo->getId();\n }\n return $ids;\n }", "public function getAllPhotosMember($idMember){\n $sql = 'SELECT * FROM photos WHERE memberId=? AND status=0 ORDER BY likes DESC';\n $photos = $this->executeQuery($sql, array($idMember));\n return $photos;\n }", "public function getAvatarList(){\n return $this->_get(5);\n }", "protected function getPhotos(Item $album, $number)\n {\n return $album->photos()\n ->uploaded()\n ->orderBy('likes', 'desc')\n ->inRandomOrder()\n ->take($number)\n ->get()\n ->sortBy('number');\n }", "public function photos()\n {\n return $this->hasMany(Photo::class, 'photo_album_id');\n }", "public function photos() {\n\t\treturn $this->belongsToMany('\\App\\Models\\Photo', 'tagsphotos', 'id_tag', 'id_photo');\n\t}", "public function findAllPhoto(){\n $query= $this->getEntityManager()\n ->createQuery(\"Select p FROM PidevFrontOfficeBundle:Galerie p ORDER BY p.idEvennement ASC\");\n return $query->getResult();\n }", "function getPhotos($inputArr) {\n\n $ro = new GetPhotosRO();\n $album = $inputArr[\"name\"];\n $ro->albumName = $album;\n\n $picPath = \"Pics/$album/*.[jJ][pP][gG]\";\n $files = glob($picPath);\n $numfiles = count($files);\t\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $photoUrl = $files[$i];\n $info = basename($photoUrl);\n $onePhoto = new PhotoInfo($photoUrl, $info);\n array_push($ro->photos, $onePhoto);\n }\n\n error_log(print_r($ro, TRUE));\n\n return $ro;\n}", "function get_all_pics(){\n\t\t$all_pics = $this->db->get('pictures');\n\t\treturn $all_pics->result();\n\t}" ]
[ "0.6997282", "0.6981816", "0.68711984", "0.6827155", "0.6631159", "0.66159064", "0.6368315", "0.62825346", "0.6200157", "0.6183843", "0.6086158", "0.6067024", "0.6031689", "0.6024305", "0.5999499", "0.5995712", "0.5983647", "0.5953357", "0.5949816", "0.5937779", "0.59330195", "0.5928024", "0.5919159", "0.5884448", "0.58807665", "0.58753574", "0.58315206", "0.5815173", "0.57952684", "0.5778142", "0.5777281", "0.57663286", "0.57626045", "0.57394654", "0.5739132", "0.5733767", "0.57334006", "0.5725851", "0.57070017", "0.57023764", "0.5686404", "0.56679386", "0.56656337", "0.5642114", "0.5634351", "0.5634207", "0.5608009", "0.55959666", "0.55958325", "0.5595119", "0.55721664", "0.55718553", "0.55695206", "0.55491275", "0.5532506", "0.5531609", "0.55248326", "0.55231166", "0.55151635", "0.55151635", "0.55151635", "0.55151635", "0.55151635", "0.55151635", "0.5507917", "0.55074424", "0.5483967", "0.54823875", "0.5481509", "0.54774535", "0.54773223", "0.5476607", "0.5472933", "0.5470211", "0.54698616", "0.5467362", "0.5462038", "0.5461019", "0.5448848", "0.54433537", "0.54402363", "0.5432072", "0.5426357", "0.5424114", "0.54220235", "0.54208356", "0.5411511", "0.54086536", "0.54065275", "0.54056764", "0.5404876", "0.5401345", "0.5399204", "0.53967565", "0.5396155", "0.5394853", "0.5394569", "0.53917086", "0.5390794", "0.53873605" ]
0.745263
0
Set the order of photosets for the calling user.
function photosets_orderSets ($photoset_ids) { $params['method'] = 'flickr.photosets.orderSets'; $response = $this->execute(array('method' => 'flickr.photosets.orderSets', 'photoset_ids' => $photoset_ids), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sort() {\n\t\tif ($this->request->is('post')) {\n\t\t\t$order = explode(\",\", $_POST['order']);\n\t\t\t$i = 1;\n\t\t\tforeach ($order as $photo) {\n\t\t\t\t$this->Picture->read(null, $photo);\n\t\t\t\t$this->Picture->set('order', $i);\n\t\t\t\t$this->Picture->save();\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$this->render(false, false);\n\t}", "protected function prepareThreePhotosInPublicAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_SUNSET_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy($this->albumID1);\n\t\t$this->photos_tests->set_star([$this->photoID1], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "protected function preparePublicUnsortedPhotoAndPhotoInSharedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE))->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1], [$this->userID]);\n\t\t$this->photos_tests->set_public($this->photoID1, true);\n\t\t$this->photos_tests->set_star([$this->photoID1, $this->photoID2], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function setSorting(SetAlbumSortingRequest $request): void\n\t{\n\t\t$request->album()->sorting = $request->sortingCriterion();\n\t\t$request->album()->save();\n\t}", "function photosets_getList ($user_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.getList';\n\t\tif ($user_id) $params['user_id'] = $user_id;\n\t\t$response = $this->execute($params);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['photosets']['photoset'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function setPhotos($value)\n {\n $this->photos = $value;\n }", "protected function prepareUnsortedPublicAndPrivatePhoto(): void\n\t{\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE))->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE))->offsetGet('id');\n\t\t$this->photos_tests->set_public($this->photoID1, true);\n\t\t$this->photos_tests->set_star([$this->photoID1], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function prepareUnsortedPrivatePhoto(): void\n\t{\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE))->offsetGet('id');\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "function getSets($user){\n\n\t\t/* Get Sets */\n\t\t$sets = $this->askFlickr('photosets.getList','&user_id='.$user.'&extras=url_o,url_z,url_l,url_q,url_t,url_n,url_s');\n\n\t\t/* Return Sets */\n\t\treturn $sets;\n\t}", "public static function setSortOrder(int $userID) {\n $books = static::where('user_id', $userID)\n ->orderBy('sort_order', 'asc')\n ->get();\n\n $sortOrder = 0;\n\n foreach($books as $book) {\n $book->sort_order = $sortOrder;\n $book->save();\n $sortOrder += 10;\n }\n }", "function setOrder($order);", "public function action_block_content_photoset_randomphotos($block)\n\t{\n\t\t$assets = array();\n\t\t$posts = Posts::get(array('content_type' => Post::type('photoset'), 'status' => Post::status('published')));\n\t\tforeach($posts as $post) {\n\t\t\tforeach(explode(\"\\n\", $post->content_media) as $asset) {\n\t\t\t\t$assets[] = $asset;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$photos = array();\n\t\t$photocount = Options::get(__CLASS__ . '__randomphotosblock_count', 8);\n\t\tif(count($assets) >= $photocount) {\n\t\t\twhile(count($photos) < $photocount) {\n\t\t\t\t// By using the output as index duplicates are impossible\n\t\t\t\t$random = $assets[array_rand($assets)];\n\t\t\t\t$photos[$random] = $random;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$block->photos = $photos;\n\t}", "function albums_reorder_images($album) {\n\t$images = albums_get_images($album);\n\n\t//Only reorder if album contains images.\n\tif ($images != FALSE) {\n\t\t$number = 1;\n\t\tforeach ($images as $image) {\n\t\t\t$parts = explode('.', $image['filename']);\n\t\t\tif (isset($parts[3])) {\n\t\t\t\trename(ALBUMS_DIR.'/'.$album.'/'.$image['filename'], ALBUMS_DIR.'/'.$album.'/'.$number.'.'.$parts[1].'.'.$parts[2].'.'.$parts[3]);\n\t\t\t\t$number++;\n\t\t\t}\n\t\t}\n\t}\n}", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"uploads\";\n $destination_path = \"products\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public static function renumberPostionsToAccountForNewlyDeletedPhotos()\n {\n $position = 1;\n $photos = parent::whereUserId(auth()->id())->orderBy('position')->orderBy('updated_at')->get();\n foreach ($photos as $photo) {\n $photo->update(['position' => $position]);\n $position++;\n }\n }", "public function setPhotosAttribute($value)\n {\n $attribute_name = \"photos\";\n $disk = \"public_folder\";\n $destination_path = \"uploads/albums\";\n $album_originalName = $_POST['name'];\n // ******** Generate unique album name ********\n $album_name = md5( $album_originalName . time() );\n \n foreach ( $value as $file ) {\n // 0. Generate new size file\n $image = \\Image::make( $file );\n $image_350 = \\Image::make( $file ) -> widen( 350 );\n \n // 1. Generate new file names\n $new_file_name = md5( $file -> getClientOriginalName() . time() ).'.'.$file->getClientOriginalExtension();\n $new_file_name_350 = md5( $file -> getClientOriginalName() . time() ).'_350.'.$file->getClientOriginalExtension();\n \n // 2. Move new files to the correct path\n $file_path = $destination_path . '/' . $album_name . '/' . $new_file_name;\n $file_path_350 = $destination_path . '/' . $album_name . '/' . $new_file_name_350;\n \\Storage::disk( $disk )->put( $file_path, $image -> stream() );\n \\Storage::disk( $disk )->put( $file_path_350, $image_350 -> stream() );\n \n // 3. Add the public path to the database\n $attribute_value[] = [ $file_path, $file_path_350 ];\n }\n $this->attributes[$attribute_name] = str_replace( '\\\\', '', json_encode($attribute_value) );\n }", "function photos_setPerms ($photo_id, $is_public = 1, $is_friend = 0, $is_family = 0, $perm_comment = 3, $perm_addmeta = 3) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.setPerms', 'photo_id' => $photo_id, 'is_public' => $is_public, 'is_friend' => $is_friend, 'is_family' => $is_family, 'perm_comment' => $perm_comment, 'perm_addmeta' => $perm_addmeta));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setPhotoData($body) {\n\t\t$cnt = count($body['photos']['photo']);\n\t\t$num = rand(0, $cnt-1);\n\t\t$this->photo = $body['photos']['photo'][$num];\n\t}", "function SetUpSortOrder() {\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$this->UpdateSort($this->userlevelid); // userlevelid\n\t\t\t$this->UpdateSort($this->userlevelname); // userlevelname\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "public function actionOrder()\n {\n if (Yii::app()->getRequest()->getIsPostRequest()) {\n $gp = $_POST['order'];\n $orders = array();\n $i = 0;\n foreach ($gp as $k => $v) {\n if (!$v) $gp[$k] = $k;\n $orders[] = $gp[$k];\n $i++;\n }\n sort($orders);\n $i = 0;\n foreach ($gp as $k => $v) {\n /** @var $p GalleryPhoto */\n $p = GalleryPhoto::model()->findByPk($k);\n $p->rank = $orders[$i];\n $p->save(false);\n $i++;\n }\n if ($_POST['ajax'] == true) {\n echo CJSON::encode(array('result' => 'ok'));\n } else {\n $this->redirect($_POST['returnUrl']);\n }\n } else\n throw new CHttpException(403);\n }", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "public function setUp(): void\n {\n parent::setUp();\n $user = factory(User::class)->create();\n // Create album with 5 pictures in each.\n factory(Album::class)->create(['user_id' => $user->id])\n ->each(function ($album) use ($user) {\n $album->pictures()->attach(factory(Picture::class, 5)->create(['user_id' => $user->id]));\n });\n }", "public function save_items_order() {\n\t\n\t\t\tparse_str( $_REQUEST[ 'order' ], $order );\n\t\n\t\t\techo update_post_meta( intval( $_REQUEST[ 'gallery_id' ] ), 'items_order', $order );\n\t\n\t\t\texit;\n\t\t}", "function SetUpSortOrder() {\n\t\tglobal $tbl_slide;\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$tbl_slide->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\n\t\t\t$tbl_slide->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$tbl_slide->UpdateSort($tbl_slide->title); // title\n\t\t\t$tbl_slide->UpdateSort($tbl_slide->images); // images\n\t\t\t$tbl_slide->UpdateSort($tbl_slide->order_by); // order_by\n\t\t\t$tbl_slide->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "public function setUserSortOrder($userSortOrder)\n {\n $this->userSortOrder = $userSortOrder;\n return $this;\n }", "public function setIdentityCardPhotosAttribute($value)\n {\n $attribute_name = \"identity_card_photos\";\n $disk = 'contects';\n $destination_path = \"contects/images\";\n\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n }", "public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }", "function set_user_metaboxes( $user_id = NULL ) {\n\t\t$meta_key[ 'order' ] = 'meta-box-order_post';\n\t\t$meta_key[ 'hidden' ] = 'metaboxhidden_post';\n\t\t// So this can be used without hooking into user_register\n\t\tif ( !$user_id )\n\t\t\t$user_id = get_current_user_id();\n\t\t// Set the default order if it has not been set yet\n\t\tif ( !get_user_meta( $user_id, $meta_key[ 'order' ], true ) ) {\n\t\t\t//if ( current_user_can( 'limited_editor' ) ) {\n\t\t\t$meta_value = array(\n\t\t\t\t'side' => 'submitdiv,formatdiv,postimagediv',\n\t\t\t\t'normal' => 'postexcerpt,tagsdiv-post_tag,postcustom,commentstatusdiv,commentsdiv,trackbacksdiv,slugdiv,authordiv,revisionsdiv',\n\t\t\t\t'advanced' => '',\n\t\t\t);\n\t\t\tupdate_user_meta( $user_id, $meta_key[ 'order' ], $meta_value );\n\t\t}\n\t\t// Set the default hiddens if it has not been set yet\n\t\tif ( !get_user_meta( $user_id, $meta_key[ 'hidden' ], true ) ) {\n\t\t\t$meta_value = array( 'categorydiv', 'postcustom', 'trackbacksdiv', 'commentstatusdiv', 'commentsdiv', 'slugdiv', 'authordiv', 'revisionsdiv' );\n\t\t\tupdate_user_meta( $user_id, $meta_key[ 'hidden' ], $meta_value );\n\t\t}\n\t}", "public static function setImageOrder($db, $databaseColumn, $order, $image)\r\n\t\t\t{\r\n\t\t\t\tif(!is_array($order))\r\n\t\t\t\t{\r\n\t\t\t\t\t//echo \"your order is not an array\";\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$newOrder = array();\r\n\t\t\t\t\r\n\t\t\t\t//echo \"here at imageorder\";\r\n\t\t\t\tforeach($order as $image_id)\r\n\t\t\t\t{\r\n\t\t\t\t\t//echo \"image id is: \".$image_id;\r\n\t\t\t\t\tif(array_key_exists($image_id, $image))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//echo \"image id is: \".$image_id;\r\n\t\t\t\t\t\t$newOrder[]=$image_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$newOrder = array_unique($newOrder);\r\n\t\t\t\t//echo 'neworder is: ';\r\n\t\t\t\t//Zend_Debug::dump($newOrder);\r\n\t\t\t\t//echo 'images are: ';\r\n\t\t\t\t//Zend_Debug::dump($image);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(count($newOrder) != count($image))\r\n\t\t\t\t{\r\n\t\t\t\t\t//echo 'here at not equal';\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$rank =1;\r\n\t\t\t\t\r\n\t\t\t\t//echo count($newOrder);\r\n\t\t\t\t//echo \"<br/>at foreach\";\r\n\t\t\t\tforeach($newOrder as $image_id)\r\n\t\t\t\t{\r\n\t\t\t\t\t//echo \"<br/>before update\";\r\n\t\t\t\t\t//echo \"here at update image: $image_id, rank: $rank<br/>\";\r\n\t\t\t\t\t$db->update($databaseColumn, array('ranking'=>$rank), 'image_id='.$image_id);\r\n\t\t\t\t\t//echo \"at update\";\r\n\t\t\t\t\t$rank++;\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t}", "public function insertImageOrderAction()\n {\n $offers = $this->galleryTable->getOfferIds()->toArray();\n $ids = [];\n foreach ($offers as $key => $value) {\n array_push($ids, $value['offer_id']);\n }\n\n foreach ($ids as $key => $value) {\n $images = [];\n $images = $this->galleryTable->getImages($value)->toArray();\n\n foreach ($images as $key => $value) {\n $this->galleryTable->insertImageOrder($value['id'], $value['offer_id'], $key + 1);\n }\n }\n }", "public function setImagesets()\n {\n $this->_imagesets = [];\n try {\n $pnmain = $this->_qobject->getPNMainTable();\n $type = $this->_image->getImageParams('type');\n if ($type == 'rgb') {\n $model = $this->_image->getImageParams('R_model');\n } else {\n $model = $this->_image->getImageParams('in_model');\n }\n\n if (!$model || $model == null) {\n return $this->mylogger->logMessage(\"Model for the parameter 'run_id' is not defined.\", $this, 'warning',\n false);\n }\n $runs = $pnmain->{$model}()\n ->where('found', 'y')\n ->distinct('run_id')\n ->pluck('run_id')\n ->toArray();\n\n if (!$runs || $runs == null || empty($runs)) {\n return $this->mylogger->logMessage(\"No results.\", $this, 'warning', false);\n }\n\n// $old_base_file_names = array_column($this->_oldresults, 'OutImage');\n\n foreach ($runs as $run_id) {\n $run_id = ($run_id == null || !$run_id) ? \"-1\" : $run_id;\n\n $base_file_name = $this->pngName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'), $run_id);\n\n $full_file_name = MyFunctions::pathslash($this->_getOutDir()) . $base_file_name;\n\n $outimages = $this->_setOutimages($full_file_name);\n if (empty($outimages)) {\n continue;\n }\n\n $metadata = [\n 'type' => $type,\n 'run_id' => $run_id,\n 'OutImage' => $base_file_name,\n \"rgb_cube\" => ($type == 'rgb') ? $this->getRGBcubeName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'),\n $run_id) : null,\n \"out_images\" => $outimages,\n ];\n\n\n// if (in_array($base_file_name, $old_base_file_names)) {\n// continue;\n// }\n\n $rgb_components = $this->_getRGBComponents($pnmain, $run_id);\n\n if ($rgb_components) {\n $this->_imagesets[$run_id] = array_merge($metadata, $rgb_components);\n } else {\n $this->mylogger->logMessage(\"Missing fits image(s).\", $this, 'warning', false);\n }\n }\n } catch (\\Exception $e) {\n $this->_imagesets = [];\n return $this->mylogger->logMessage(\"Problem with setting imagesets: \" . $e . \".\", $this, 'warning', false);\n }\n if (empty($this->_imagesets)) {\n return false;\n }\n return true;\n\n }", "public function prepare_items( $orderby = null )\n\t{\n\t\t$items_count = $this->model->upload->get_items_count();\n\t\n\t\t$this->set_pagination_args( array(\n \t\t'total_items' => $items_count,\n \t\t'per_page' => $items_count\n \t\t) );\n \t\t\n \t\t$this->items = $this->model->upload->get_items( $orderby );\n\t}", "protected function preparePhotoInSharedPublicPasswordProtectedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->sharing_tests->add([$this->albumID1], [$this->userID]);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function addTreePathOwnerToParents(): void\n {\n foreach ($this->getTreePathParents() as $treePath) {\n $this->saveTreePathModel(\n $treePath->parent_id,\n $this->owner->id,\n $this->owner->getAttribute($this->ownerParentIdAttribute),\n $treePath->parent_level,\n $treePath->child_level + 1\n );\n }\n }", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }", "function SetOrdering()\n {\n GLOBAL $_REQUEST;\n\n $sfid = 'sf' . $this->GetID();\n $srid = 'sr' . $this->GetID();\n $this->sf = $_REQUEST[$sfid];\n $this->sr = $_REQUEST[$srid];\n\n if ($this->sf != '') {\n $this->selectSQL->orders[] = $this->sf . \" \" . $this->sr;\n\n if ($this->sr == \"desc\") {\n $this->sr = \"asc\";\n $this->az = \"za\";\n } else {\n $this->sr = \"desc\"; //!< this is for the future \n $this->az = \"az\";\n } \n } else {\n $this->az = '';\n $this->sr = '';\n } \n }", "private function set_files()\n\t\t{\n\t\t\t$this->files = Filesystem::ls(PATH_POSTS, '*', 'xml', false, false, true);\n\t\t\t$this->files_count = count( $this->files );\n\t\t}", "public function changeOwner($files, $user, $recursive = false);", "function _photo_gallery_imagecache_default_presets() {\n $items = array(\n 'full' => array(\n 'presetname' => 'full',\n 'actions' => array(),\n ),\n 'small_gallery' => array(\n 'presetname' => 'small_gallery',\n 'actions' => array(\n '0' => array(\n 'weight' => '0',\n 'module' => 'imagecache',\n 'action' => 'imagecache_scale_and_crop',\n 'data' => array(\n 'width' => '220',\n 'height' => '140',\n ),\n ),\n ),\n ),\n 'space_gallery' => array(\n 'presetname' => 'space_gallery',\n 'actions' => array(\n '0' => array(\n 'weight' => '0',\n 'module' => 'imagecache',\n 'action' => 'imagecache_scale_and_crop',\n 'data' => array(\n 'width' => '450',\n 'height' => '300',\n ),\n ),\n ),\n ),\n );\n return $items;\n}", "public function setPostPhotoAttribute($value)\n {\n $attribute_name = \"PostPhoto\";\n $disk = \"uploads\";\n $destination_path = \"uploads/post_photo\";\n $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\n\n }", "public static function setExistingPresetToUsers(int $presetId, array $userList, bool $force = false): void\n\t{\n\t\t//the priority of the group must be taken into account\n\t\tif (!$force)\n\t\t{\n\t\t\t$sort =\n\t\t\t\tOptionGroupTable::query()\n\t\t\t\t\t->addSelect('SORT')\n\t\t\t\t\t->where('ID', $presetId)\n\t\t\t\t\t->fetch()['SORT'];\n\n\t\t\t$query =\n\t\t\t\tOptionUserTable::query()\n\t\t\t\t\t->addSelect('USER_ID')\n\t\t\t\t\t->registerRuntimeField(\n\t\t\t\t\t\t'OPTION_GROUP',\n\t\t\t\t\t\tnew Reference(\n\t\t\t\t\t\t\t'OPTION_GROUP',\n\t\t\t\t\t\t\tOptionGroupTable::class,\n\t\t\t\t\t\t\tJoin::on('this.GROUP_ID', 'ref.ID'),\n\t\t\t\t\t\t\t['join_type' => Join::TYPE_INNER]\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t->whereIn('USER_ID', $userList)\n\t\t\t\t\t->where('OPTION_GROUP.SORT', '>=', (int)$sort)\n\t\t\t;\n\n\t\t\t$users = [];\n\t\t\tforeach ($query->exec() as $user)\n\t\t\t{\n\t\t\t\t$users = $user['USER_ID'];\n\t\t\t}\n\t\t\t$userList = $users;\n\t\t}\n\n\t\tOptionUserTable::updateMulti(\n\t\t\t$userList,\n\t\t\t[\n\t\t\t\t'NOTIFY_GROUP_ID' => $presetId,\n\t\t\t\t'GENERAL_GROUP_ID' => $presetId\n\t\t\t],\n\t\t\ttrue\n\t\t);\n\n\t\tself::cleanUsersCache($userList);\n\t}", "function SetUpSortOrder() {\r\n\t\tglobal $rekeningju;\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$rekeningju->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$rekeningju->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$rekeningju->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}", "function admin_gallery_set()\n {\n // Require admin login\n if(!(isset($_SESSION['active_user']) && $_SESSION['active_user']['type'] == 'admin'))\n redirect_to('/');\n\n $this->load_outer_template('admin');\n\n if(!isset($this->params[2]) || (!is_numeric($this->params[2])))\n throw new exception(\"No user specified\");\n\n $user = $this->params[2];\n\n $m_set = instance_model('gallery_set');\n $set = $m_set->get_by_user($user);\n\n $list = array();\n foreach($set as $row)\n {\n $list []= array(\n 'name' => $row['Title'],\n 'options' => array(\n 'Edit Gallery' => make_url('members', 'admin_gallery', $row['ID']),\n 'Edit' => make_url('members', 'admin_set_edit', $row['ID']),\n 'Delete' => make_url('members', 'admin_set_delete', $row['ID']))\n );\n }\n\n $view = instance_view('admin/index_generic');\n $view = $view->parse_to_variable(array(\n 'back_url' => make_url('members', 'admin_pages'),\n 'sortable' => false,\n 'title' => 'In Categories',\n 'new_url' => make_url('members', 'admin_set_create', $user),\n 'new_name' => 'Add to category',\n 'list' => $list,\n 'col_classes' => array('tbl_set_name', 'tbl_set_opt')\n ));\n\n\n $this->set_template_paramiters(array(\n 'content' => $view\n ));\n\n }", "function SetUpSortOrder() {\r\n\t\tglobal $fs_multijoin_v;\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$fs_multijoin_v->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$fs_multijoin_v->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->id); // id\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->mount); // mount\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->path); // path\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->parent); // parent\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->deprecated); // deprecated\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->name); // name\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->snapshot); // snapshot\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->tapebackup); // tapebackup\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->diskbackup); // diskbackup\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->type); // type\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->CONTACT); // CONTACT\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->CONTACT2); // CONTACT2\r\n\t\t\t$fs_multijoin_v->UpdateSort($fs_multijoin_v->RESCOMP); // RESCOMP\r\n\t\t\t$fs_multijoin_v->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}", "public function setPreFetchMedia(?array $value): void {\n $this->getBackingStore()->set('preFetchMedia', $value);\n }", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "function add_image_sizes() {\n\t\t$cover_width = 350;\n\t\t$cover_height = 250;\n\t\t$cover_size = UM()->options()->get( 'um_user_photos_cover_size' );\n\t\tif ( $cover_size && trim( $cover_size ) != '' ) {\n\t\t\t$cover_size = strtolower( $cover_size );\n\t\t\t$size = explode( 'x', $cover_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$cover_width = intval( $size[0] );\n\t\t\t\t$cover_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\t\tadd_image_size( 'album_cover', $cover_width, $cover_height, true );\n\n\t\t$photo_width = 250;\n\t\t$photo_height = 250;\n\t\t$photo_size = UM()->options()->get( 'um_user_photos_image_size' );\n\t\tif ( $photo_size && trim( $photo_size ) != '' ) {\n\t\t\t$photo_size = strtolower( $photo_size );\n\t\t\t$size = explode( 'x', $photo_size );\n\t\t\tif ( is_array( $size ) && count( $size ) == 2 ) {\n\t\t\t\t$photo_width = intval( $size[0] );\n\t\t\t\t$photo_height = intval( $size[1] );\n\t\t\t}\n\t\t}\n\n\t\tadd_image_size( 'gallery_image', $photo_width, $photo_height, true );\n\t}", "protected function setPreloads()\n {\n if (!$this->preloadList = \\Xoops_Cache::read('system_modules_preloads')) {\n // get active modules from the xoops instance\n $modules_list = \\Xoops::getInstance()->getActiveModules();\n if (empty($modules_list)) {\n // this should only happen if an exception was thrown in setActiveModules()\n $modules_list = array ('system');\n }\n $this->preloadList =array();\n $i = 0;\n foreach ($modules_list as $module) {\n if (is_dir($dir = XOOPS_ROOT_PATH . \"/modules/{$module}/preloads/\")) {\n $file_list = \\XoopsLists::getFileListAsArray($dir);\n foreach ($file_list as $file) {\n if (preg_match('/(\\.php)$/i', $file)) {\n $file = substr($file, 0, -4);\n $this->preloadList[$i]['module'] = $module;\n $this->preloadList[$i]['file'] = $file;\n $i++;\n }\n }\n }\n }\n \\Xoops_Cache::write('system_modules_preloads', $this->preloadList);\n }\n }", "function set_load_order()\n {\n $edges = [];\n\n foreach ($this->scripts as $script_id => $script_options) {\n if (isset($script_options['require'])) {\n\n // check if array\n if(is_array($script_options['require'])) {\n foreach ($script_options['require'] as $r_script_id)\n {\n $edges[] = [$r_script_id, $script_id];\n }\n } else {\n\n $edges[] = [$script_options['require'], $script_id];\n }\n\n\n }\n }\n $scripts = array_keys($this->scripts);\n $this->sorted_scripts = $this->topological_sort($scripts, $edges);\n\n $key_compare_func = function($a, $b) {\n $ia = array_search($a, $this->sorted_scripts);\n $ib = array_search($b, $this->sorted_scripts);\n\n if ($ia > $ib) {\n return TRUE;\n } else {\n return FALSE;\n }\n\n };\n\n uksort($this->scripts, $key_compare_func);\n }", "public function setPhotoAsPreview($photo_uid, $album_uid) {\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('UPDATE tx_cwtcommunity_albums SET preview_photo_uid = \"'.$photo_uid.'\" WHERE uid = \"'.$album_uid.'\";');\r\n\t}", "function save_order(){\n\tif( ! current_user_can( 'order_posts' ) ){\n\t\twp_send_json_error( 'Oooops, you haven\\'t got the permission to do that' );\n\n\t\treturn;\n\t}\n\t$ordered_ids = $_POST[ 'id_array' ];\n\t$position = 1;\n\tforeach( $ordered_ids as $id ){\n\t\tupdate_post_meta( (int) $id, 'post_order', $position );\n\t\t$position ++;\n\t}\n}", "function set_user_metaboxes($user_id=NULL) {\n\n\t/* Set Meta Boxes & Order For Horse Posts */\n\t// These are the metakeys we will need to update\n\t$meta_key['order'] = 'meta-box-order_horse_post';\n\t$meta_key['hidden'] = 'metaboxhidden_horse_post';\n\n\t// So this can be used without hooking into user_register\n\tif ( ! $user_id) $user_id = get_current_user_id();\n\n\t// Set the default order if it has not been set yet\n\tif ( ! get_user_meta( $user_id, $meta_key['order'], true) ) {\n\t\t$meta_value = array(\n\t\t 'side' => 'submitdiv,formatdiv,categorydiv,postimagediv,tagsdiv-post_tag',\n\t\t 'normal' => '',\n\t\t 'advanced' => 'postexcerpt,postcustom,commentstatusdiv,commentsdiv,trackbacksdiv,slugdiv,authordiv,revisionsdiv',\n\t\t);\n\t\tupdate_user_meta( $user_id, $meta_key['order'], $meta_value );\n\t}\n\n\t// Set the default hiddens if it has not been set yet\n\tif ( ! get_user_meta( $user_id, $meta_key['hidden'], true) ) {\n\t\t$meta_value = array('postexcerpt','postcustom','trackbacksdiv','commentstatusdiv','commentsdiv','slugdiv','authordiv','revisionsdiv');\n\t\tupdate_user_meta( $user_id, $meta_key['hidden'], $meta_value );\n\t}\n\n\t/* Set Meta Boxes & Order For Posts */\n\t// These are the metakeys we will need to update\n\t$meta_key['order'] = 'meta-box-order_post';\n\t$meta_key['hidden'] = 'metaboxhidden_post';\n\n\t// So this can be used without hooking into user_register\n\tif ( ! $user_id) $user_id = get_current_user_id();\n\n\t// Set the default order if it has not been set yet\n\tif ( ! get_user_meta( $user_id, $meta_key['order'], true) ) {\n\t\t$meta_value = array(\n\t\t 'side' => 'submitdiv,formatdiv,categorydiv,postimagediv,tagsdiv-post_tag',\n\t\t 'normal' => 'postexcerpt,postcustom,commentstatusdiv,commentsdiv,trackbacksdiv,slugdiv,authordiv,revisionsdiv',\n\t\t 'advanced' => '',\n\t\t);\n\t\tupdate_user_meta( $user_id, $meta_key['order'], $meta_value );\n\t}\n\n\t// Set the default hiddens if it has not been set yet\n\tif ( ! get_user_meta( $user_id, $meta_key['hidden'], true) ) {\n\t\t$meta_value = array('postexcerpt,postcustom','trackbacksdiv','commentstatusdiv','commentsdiv','slugdiv','authordiv','revisionsdiv');\n\t\tupdate_user_meta( $user_id, $meta_key['hidden'], $meta_value );\n\t}\n\n\t/* Set Meta Boxes & Order For Nav Menus Page */\n\t// These are the metakeys we will need to update\n\t$meta_key['order'] = 'meta-box-order_nav-menus';\n\t$meta_key['hidden'] = 'metaboxhidden_nav-menus';\n\n\t// So this can be used without hooking into user_register\n\tif ( ! $user_id) $user_id = get_current_user_id();\n\n\t// Set the default order if it has not been set yet\n\tif ( ! get_user_meta( $user_id, $meta_key['order'], true) ) {\n\t\t$meta_value = array(\n\t\t 'side' => 'nav-menu-theme-locations,add-custom-links,add-page,add-horse_taxonomy,add-horse_post,add-category,add-post,add-post_tag'\n\t\t);\n\t\tupdate_user_meta( $user_id, $meta_key['order'], $meta_value );\n\t}\n\n\t// Set the default hiddens if it has not been set yet\n\tif ( ! get_user_meta( $user_id, $meta_key['hidden'], true) ) {\n\t\t$meta_value = array('add-post','add-post_tag');\n\t\tupdate_user_meta( $user_id, $meta_key['hidden'], $meta_value );\n\t}\n}", "function local_ltiprovider_membership_service_update_userphotos( $userphotos ) {\n\n // Sync of user photos.\n mtrace( \"Sync user profile images\" );\n $counter = 0;\n if ( $userphotos ) {\n foreach ( $userphotos as $userid => $url ) {\n if ( $url ) {\n $result = local_ltiprovider_update_user_profile_image( $userid, $url );\n if ( $result === true ) {\n $counter ++;\n mtrace( \"Profile image succesfully downloaded and created from $url\" );\n } else {\n mtrace( $result );\n }\n }\n }\n }\n mtrace( \"$counter profile images updated\" );\n}", "protected function prepareThreeAlbumsWithMixedSharingAndPasswordProtection(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->albumID3 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_3)->offsetGet('id');\n\t\t// The mis-order of photos by there title (N, T, M) is on purpose such that\n\t\t// we first receive the result (N, T) as long as album 3 is locked and\n\t\t// then (M, N, T) after album 3 has been unlocked, with album 3\n\t\t// being in the front position.\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_NIGHT_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID3)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1, $this->albumID2], [$this->userID]);\n\t\t// Sic! We use the same password for both albums here, because we want\n\t\t// to ensure that incidentally \"unlocking\" an album which is also\n\t\t// shared has no negative side effect.\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2, is_nsfw: true, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID3, is_nsfw: true, password: TestConstants::ALBUM_PWD_1);\n\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "function SetUpSortOrder() {\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$this->UpdateSort($this->identries); // identries\r\n\t\t\t$this->UpdateSort($this->titulo); // titulo\r\n\t\t\t$this->UpdateSort($this->id); // id\r\n\t\t\t$this->UpdateSort($this->islive); // islive\r\n\t\t\t$this->UpdateSort($this->tool_id); // tool_id\r\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}", "protected function setAlbumUidRestrictions()\n {\n $mediaAlbumsUids = GeneralUtility::trimExplode(',', $this->settings['mediaAlbumsUids'], true);\n $this->mediaAlbumRepository->setAlbumUids($mediaAlbumsUids);\n $this->mediaAlbumRepository->setUseAlbumUidsAsExclude(!empty($this->settings['useAlbumFilterAsExclude']));\n }", "public function setPhotoSender($photoSender ){\n $this->photoSender = $photoSender;\n }", "function SetUpSortOrder() {\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$this->UpdateSort($this->RazonSocial); // RazonSocial\r\n\t\t\t$this->UpdateSort($this->NombreContacto); // NombreContacto\r\n\t\t\t$this->UpdateSort($this->Poblacion); // Poblacion\r\n\t\t\t$this->UpdateSort($this->Id_Estado); // Id_Estado\r\n\t\t\t$this->UpdateSort($this->Telefonos); // Telefonos\r\n\t\t\t$this->UpdateSort($this->Celular); // Celular\r\n\t\t\t$this->UpdateSort($this->Maneja_Papeleta); // Maneja_Papeleta\r\n\t\t\t$this->UpdateSort($this->Maneja_Activacion_Movi); // Maneja_Activacion_Movi\r\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "public function setLastModifiedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('lastModifiedBy', $value);\n }", "public function setSorted()\n {\n $this->isSorted = true;\n }", "public function storeOriginals()\n {\n $this->originals = $this->toArray();\n }", "public function action_block_form_photoset_randomphotos($form, $block)\n\t{\n\t\t$form->append('text', 'photocount', __CLASS__ . '__randomphotosblock_count', _t(\"Number of photos to display:\", __CLASS__));\n\t}", "public function setOrderBy(array $orderBy);", "function set_file_objs($file_objs) {\n $this->file_objs = $file_objs;\n $this->update_files = 1;\n }", "public function beforeCreate()\n {\n if($this->group_id == -1)\n {\n $this->sort_order = 1;\n $this->group_id = 0;\n }\n else\n $this->sort_order = RoleManager::for($this->group->code)->countRoles() + 1;\n }", "protected function preparePhotosInSharedAndPrivateAndRequireLinkAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->albumID3 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_3)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->photoID3 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_SUNSET_IMAGE), $this->albumID3)->offsetGet('id');\n\t\t$this->sharing_tests->add([$this->albumID1, $this->albumID3], [$this->userID]);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID3, is_link_required: true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "private function setMenuOrder() {\n $this->product->set_menu_order($this->wcData->getMenuOrder());\n }", "function photosets_editPhotos ($photoset_id, $photo_ids, $primary_photo_id = NULL) {\n\t\t$params = array();\n\t\t$params['method'] = 'flickr.photosets.editPhotos';\n\t\t$params['photoset_id'] = $photoset_id;\n\t\t$photo_ids = explode(',', $photo_ids);\n\t\tarray_map('trim', $photo_ids);\n\t\tif (!$primary_photo_id) {\n\t\t\t$params['primary_photo_id'] = $photo_ids[0];\n\t\t} else {\n\t\t\t$params['primary_photo_id'] = $primary_photo_id;\n\t\t}\n\t\t$photo_ids = implode(',', $photo_ids);\n\t\t$params['photo_ids'] = $photo_ids;\n\t\t$response = $this->execute($params, 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function getPhotoSet($photoset_id){\n\n\t\t/* Get Photoset */\n\t\t$photoset_object = $this->askFlickr('photosets.getPhotos','&photoset_id='.$photoset_id.'&extras=url_o,url_z,url_l,url_s,url_q,url_t,media');\n\n\t\t/* Return our Photoset Object */\n\t\treturn $photoset_object;\n\t}", "function LoadSortOrder() {\r\n\t\tglobal $fs_multijoin_v;\r\n\t\t$sOrderBy = $fs_multijoin_v->getSessionOrderBy(); // Get ORDER BY from Session\r\n\t\tif ($sOrderBy == \"\") {\r\n\t\t\tif ($fs_multijoin_v->SqlOrderBy() <> \"\") {\r\n\t\t\t\t$sOrderBy = $fs_multijoin_v->SqlOrderBy();\r\n\t\t\t\t$fs_multijoin_v->setSessionOrderBy($sOrderBy);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function setOrdering($ordering) {\n $this->ordering = $ordering;\n }", "protected function prepareGalleryData() {}", "function setOrder($order){\n\t\t$this->order=$order;\n\t}", "public function setPhoto($value)\n {\n $this->photo = $value;\n }", "function SetupSortOrder() {\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$this->CurrentOrder = @$_GET[\"order\"];\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$this->UpdateSort($this->nombre_contacto); // nombre_contacto\n\t\t\t$this->UpdateSort($this->name); // name\n\t\t\t$this->UpdateSort($this->lastname); // lastname\n\t\t\t$this->UpdateSort($this->_email); // email\n\t\t\t$this->UpdateSort($this->address); // address\n\t\t\t$this->UpdateSort($this->phone); // phone\n\t\t\t$this->UpdateSort($this->cell); // cell\n\t\t\t$this->UpdateSort($this->created_at); // created_at\n\t\t\t$this->UpdateSort($this->id_sucursal); // id_sucursal\n\t\t\t$this->UpdateSort($this->tipoinmueble); // tipoinmueble\n\t\t\t$this->UpdateSort($this->tipovehiculo); // tipovehiculo\n\t\t\t$this->UpdateSort($this->tipomaquinaria); // tipomaquinaria\n\t\t\t$this->UpdateSort($this->tipomercaderia); // tipomercaderia\n\t\t\t$this->UpdateSort($this->tipoespecial); // tipoespecial\n\t\t\t$this->UpdateSort($this->email_contacto); // email_contacto\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "protected function validateSortAndInitiateAvatarProviders() {}", "function SetUpSortOrder() {\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\r\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\r\n\t\t\t$this->UpdateSort($this->created_time); // created_time\r\n\t\t\t$this->UpdateSort($this->message); // message\r\n\t\t\t$this->UpdateSort($this->link); // link\r\n\t\t\t$this->UpdateSort($this->type); // type\r\n\t\t\t$this->UpdateSort($this->caption); // caption\r\n\t\t\t$this->UpdateSort($this->description); // description\r\n\t\t\t$this->UpdateSort($this->name); // name\r\n\t\t\t$this->UpdateSort($this->source); // source\r\n\t\t\t$this->UpdateSort($this->from); // from\r\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\r\n\t\t}\r\n\t}", "private function displayViewphotoset() {\n $this->addCSS(\"flickr_viewphotoset.css\");\n\n /* Display images */\n $photoset_id = null;\n if(isset($_GET['url_photoset'])) {\n $photoset_id = trim($_GET[\"url_photoset\"]);\n } elseif( isset($this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"])) {\n $photoset_id = $this->conf_ts[\"show.\"][\"params.\"][\"photoset_id\"];\n } elseif( isset($this->conf_ts[\"show.\"][\"vps_default\"]) ) {\n $photoset_id = $this->conf_ts[\"show.\"][\"vps_default\"];\n }\n\n $params = array(\"photoset_id\"=>$photoset_id);\n $params = array_merge($params,array(\"extras\"=>\"owner_name,icon_server,original_format,\n last_update,geo,tags,machine_tags,o_dims,views,media,path_aliasurl_sq,url_t,url_s,url_m,url_o\"));\n $photos = $this->flickr->restFlickr_Photosets_getPhotos($params);\n if(!$photos) $this->callFlickrError();\n\n $photosets = false;\n $photosets = $this->flickr->restFlickr_Photosets_getList(array(\"user_id\"=>$photos[\"photoset\"][\"owner\"]));\n if(!$photosets) $this->callFlickrError();\n\n $ps = array();\n foreach($photosets[\"photosets\"][\"photoset\"] as $key=>$val) {\n $val[\"typo3_uri\"] = $this->pi_getPageLink($GLOBALS['TSFE']->id,'',array(\"url_photoset\"=>$val[\"id\"]));\n $ps[$key] = $val;\n };\n $photosets[\"photosets\"][\"photoset\"] = $ps;\n unset($ps);\n\n $photoset = $this->flickr->restFlickr_Photosets_getInfo(array(\"photoset_id\"=>$photoset_id));\n if(!$photoset) $this->callFlickrError();\n\n $this->smarty->assign(\"vps_show_picker\",$this->conf_ts[\"show.\"][\"vps_show_picker\"]);\n $this->smarty->assign(\"vps_show_photoset_list\",$this->conf_ts[\"show.\"][\"vps_show_photoset_list\"]);\n $this->smarty->assign(\"vps_show_desc\",$this->conf_ts[\"show.\"][\"vps_show_desc\"]);\n $this->smarty->assign(\"photoset\",$photoset[\"photoset\"]);\n $this->smarty->assign(\"photos\",$photos[\"photoset\"][\"photo\"]);\n $this->smarty->assign(\"photosets\",$photosets[\"photosets\"][\"photoset\"]);\n $this->smarty->assign(\"photoset_id\",$photoset_id);\n\n if($photoset_id != null) return $this->smarty_display(\"flickr_viewphotoset.xhtml\");\n return \"\";\n }", "public function onUserProfilePhotoUpload($event)\n {\n\t\tif(Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album'))\n\t\t\treturn;\n $payload = $event->getPayload();\n if( empty($payload['user']) || !($payload['user'] instanceof Core_Model_Item_Abstract) ) {\n return;\n }\n if( empty($payload['file']) || !($payload['file'] instanceof Storage_Model_File) ) {\n return;\n }\n $viewer = $payload['user'];\n $file = $payload['file'];\n // Get album\n $table = Engine_Api::_()->getDbtable('albums', 'sesalbum');\n $album = $table->getSpecialAlbum($viewer, 'profile');\n $photoTable = Engine_Api::_()->getDbtable('photos', 'sesalbum');\n $photo = $photoTable->createRow();\n $photo->setFromArray(array(\n 'owner_type' => 'user',\n 'owner_id' => Engine_Api::_()->user()->getViewer()->getIdentity()\n ));\n $photo->save();\n $photo->setPhoto($file);\n $photo->album_id = $album->album_id;\n $photo->save();\n if( !$album->photo_id ) {\n $album->photo_id = $photo->getIdentity();\n $album->save();\n }\n $auth = Engine_Api::_()->authorization()->context;\n $auth->setAllowed($photo, 'everyone', 'view', true);\n $auth->setAllowed($photo, 'everyone', 'comment', true);\n $auth->setAllowed($album, 'everyone', 'view', true);\n $auth->setAllowed($album, 'everyone', 'comment', true);\n $event->addResponse($photo);\n }", "public function setSortOrder($sortOrder = false) {\n\t\t\tglobal $db;\n\t\t\tif ($sortOrder) {\n\t\t\t\t$this->sort_order = $sortOrder;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data = $db->get_var(\"SELECT sort_order FROM pages WHERE parent = '{$this->parent}' ORDER BY sort_order DESC LIMIT 1\");\n\t\t\t\t$this->sort_order = $data + 1;\n\t\t\t}\n\t\t}", "function _sf_set_sort_cookie() {\n\t\tif(!isset($_COOKIE['sort'])){\n\t\t\t\n\t\t\t// SETS COOKIE\n\t\t\tsetcookie('sort', 'relevant', 0, '/');\n\t\t\t\n\t\t}\n\t\t\t\n\t\t//// IF OUR PER PAGE IS SET WE SET THE COOKIE AS WELL\n\t\tif(isset($_GET['sort'])) {\n\t\t\t\n\t\t\t$options = array('relevant', 'oldest', 'newest', 'closest');\n\t\t\n\t\t\t///// IF WE HAVE RATING\n\t\t\tif(ddp('rating') == 'on' && ddp('rating_sortby') == 'on') { $options[] = 'ratingdesc'; $options[] = 'ratingasc'; }\n\t\t\t\n\t\t\t///// MAKES SURE ITS A VALID OPTION\n\t\t\tif(in_array($_GET['sort'], $options)) {\n\t\t\t\t\n\t\t\t\t//// SAVES IT\n\t\t\t\tsetcookie('sort', $_GET['sort'], 0, '/');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function uploadPhoto($currentAlbumId, $currentUserID, $photoName, $shortDescription, $placeTaken, $selectedCategories, $writtenTags, $photoFile, $titlePhoto,$users){\n\n $insertedPhotoId = 'nothing to upload';\n\n // upload photo to server\n if (!empty($photoFile)){\n\n foreach($photoFile as $file) {\n $destinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n if($fileSize <= 1024*1024*10){\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n //upload photo in database\n $insertedPhotoId = DB::table('photos')->insertGetId(\n array('photo_name' => $photoName,\n 'photo_short_description' => $shortDescription,\n 'photo_taken_at' => $placeTaken,\n 'album_id' => $currentAlbumId,\n 'user_id' => $currentUserID,\n 'photo_size' => $fileSize\n )\n );\n\n UserAction::add('Photo \"' . $photoName . '\" was uploaded');\n\n $explodedTags = preg_replace(\"/[^\\w\\ _]+/\", '', $writtenTags); // strip all punctuation characters, news lines, etc.\n $explodedTags = preg_split(\"/\\s+/\", $explodedTags); // split by left over spaces\n $tagLine = \"\";\n for($i=0; $i<sizeOf($explodedTags); $i++)\n $tagLine = $tagLine.$explodedTags[$i].\", \";\n $tagLine = substr($tagLine, 0, -2);\n\n DB::insert('insert into photo_tags (photo_id, tags) values (?,?)', array($insertedPhotoId, $tagLine));\n\n\n\n $upload_success = $file->move($destinationPath, $insertedPhotoId.\".\".$extension);\n if($upload_success){\n //makes photo thumb\n $fileForThumb = $destinationPath.\"/\".$insertedPhotoId.\".\".$extension;\n App::make('phpthumb')\n ->create('resize', array($fileForThumb, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", $insertedPhotoId.\"_thumb.\".$extension);\n\n DB::update('update photos set\n photo_destination_url = ?,\n photo_thumbnail_destination_url = ?\n where photo_id = ?',\n array(\n $destinationPath.\"/\".$insertedPhotoId.\".\".$extension,\n $destinationPath.\"/\".$insertedPhotoId.\"_thumb.\".$extension,\n $insertedPhotoId));\n }\n\n //add categories\n for($i = 0; $i < sizeOf($selectedCategories); $i++){\n $catId = DB::select('select * from categories where category_name = ?', array($selectedCategories[$i]));\n if($catId)\n DB::table('photo_categories')->insert(\n array(\n 'photo_id' => $insertedPhotoId,\n 'category_id' => $catId[0]->category_id,\n )\n );\n }\n //add users\n $ob = new User();\n foreach($users as $user){\n if($user != \"\"){\n $usId = $ob->getUserNameById($user);\n $photoP = DB::insert('insert into photo_people (photo_id, user_id) values (?,?)',array($insertedPhotoId,$usId));\n }\n }\n\n //-----------------Editing album title photo data---------------------//\n //if 'make uploaded photo to title album photo' property is selected\n if($titlePhoto){\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //gets current photo url\n $newTitlePhoto = DB::table('photos')->where('photo_id', $insertedPhotoId)->get();\n if($newTitlePhoto){\n\n //photo\n $photo = null;\n $photo = $newTitlePhoto[0]->photo_destination_url;\n if($photo != null ){\n if(is_file($photo)){\n $photoExtension = File::extension($photo);\n $newPhoto = $destinationPath.\"/title_\".$currentAlbumId.\".\".$photoExtension;\n File::copy($photo, $newPhoto);\n $photo = $newPhoto;\n }\n }\n\n //thumb\n $photoThumb = null;\n $photoThumb = $newTitlePhoto[0]->photo_thumbnail_destination_url;\n if($photoThumb != null){\n if(is_file($photoThumb)){\n $thumbExtension = File::extension($photoThumb);\n $newPhotoThumbUrl = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$thumbExtension;\n File::copy($photoThumb, $newPhotoThumbUrl);\n $photoThumb = $newPhotoThumbUrl;\n }\n }\n else if($photoThumb == null && is_file($photo) != null){\n App::make('phpthumb')\n ->create('resize', array($photo, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$photoExtension);\n $photoThumb = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$photoExtension;\n }\n\n //insert uploaded/unuploaded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $photo,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n }\n }\n return $insertedPhotoId;\n }", "function SetUpSortOrder() {\n\t\tglobal $patient_detail;\n\n\t\t// Check for an Order parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$patient_detail->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\n\t\t\t$patient_detail->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$patient_detail->UpdateSort($patient_detail->DetailNo); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->StudyID); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->PatientID); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->StudyDate); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->StudyTime); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->Modality); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->BodyPartExamined); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->ProtocolName); // Field \n\t\t\t$patient_detail->UpdateSort($patient_detail->Status); // Field \n\t\t\t$patient_detail->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "function LoadSortOrder() {\n\t\tglobal $patient_detail;\n\t\t$sOrderBy = $patient_detail->getSessionOrderBy(); // Get order by from Session\n\t\tif ($sOrderBy == \"\") {\n\t\t\tif ($patient_detail->SqlOrderBy() <> \"\") {\n\t\t\t\t$sOrderBy = $patient_detail->SqlOrderBy();\n\t\t\t\t$patient_detail->setSessionOrderBy($sOrderBy);\n\t\t\t}\n\t\t}\n\t}", "private function set_files_by_draft()\n\t\t{\n\t\t\t$this->files = Filesystem::ls(PATH_POSTS, '*.*.*.*.draft.*.*.*.*.*.*', 'xml', false, false, true);\n\t\t\t$this->files_count = count( $this->files );\n\t\t}", "protected function setTags()\n {\n /*todo check role and flush based on tags*/\n $this->authBasedTag();\n }", "function filesOrder( $uid, $inc, $option, $cat_id ) {\n\tglobal $mainframe;\n $database = &JFactory::getDBO();\n\n\t$row = new jlist_files( $database );\n\t$row->load( $uid );\n $row->move( $inc );\n\n\t$mainframe->redirect( 'index.php?option=com_jdownloads&task=files.list&cat_id='.$cat_id );\n}", "function SetupSortOrder() {\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$this->CurrentOrder = @$_GET[\"order\"];\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$this->UpdateSort($this->tanggal); // tanggal\n\t\t\t$this->UpdateSort($this->auc_number); // auc_number\n\t\t\t$this->UpdateSort($this->start_bid); // start_bid\n\t\t\t$this->UpdateSort($this->close_bid); // close_bid\n\t\t\t$this->UpdateSort($this->lot_number); // lot_number\n\t\t\t$this->UpdateSort($this->chop); // chop\n\t\t\t$this->UpdateSort($this->grade); // grade\n\t\t\t$this->UpdateSort($this->estate); // estate\n\t\t\t$this->UpdateSort($this->sack); // sack\n\t\t\t$this->UpdateSort($this->netto); // netto\n\t\t\t$this->UpdateSort($this->open_bid); // open_bid\n\t\t\t$this->UpdateSort($this->highest_bid); // highest_bid\n\t\t\t$this->UpdateSort($this->auction_status); // auction_status\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "public function testGetUserPhotosSuccess()\n {\n $user = factory(\\App\\User::class)->make();\n\n $user->photos()->createMany(\n factory(\\App\\Photo::class, 3)->make()->toArray()\n );\n\n $response = $this->get('/photos');\n\n $response->assertStatus(200);\n }", "public function setRowsOwnerView()\n {\n return 'files.rows.set_rows_owner';\n }", "function init_groups() {\r\n\tif (!HYPEGALLERY_GROUP_ALBUMS) {\r\n\t\treturn;\r\n\t}\r\n\tadd_group_tool_option('albums', elgg_echo('gallery:groupoption:enable'), true);\r\n\telgg_extend_view('groups/tool_latest', 'framework/gallery/group_module');\r\n}", "public function set_images($files){\n\t\t$image_dir = \"{$GLOBALS['core_path']}/user_content/item_images/{$this->id}\";\n\t\t\n\t\tif (!file_exists($image_dir)){\n\t\t\tmkdir($image_dir, 0750);\n\t\t}\n\t\t\n\t\tforeach (glob(\"{$image_dir}/*.png\") as $existing){\n\t\t\tunlink($existing);\n\t\t}\n\t\t\n\t\tforeach ($files as $key => $image_file){\n\t\t\t$image = imagecreatefromstring(file_get_contents($image_file));\n\t\t\t\t\n\t\t\t$preview = self::resize_image($image, item_image::PREVIEW_WIDTH, item_image::PREVIEW_HEIGHT);\n\t\t\t$cover = self::resize_image($image, item_image::COVER_WIDTH, item_image::COVER_HEIGHT);\n\t\t\t$thumb = self::resize_image($image, item_image::THUMB_WIDTH, item_image::THUMB_HEIGHT);\n\t\t\t\t\n\t\t\timagepng($preview, \"{$image_dir}/{$key}_preview.png\", 9);\n\t\t\timagepng($cover, \"{$image_dir}/{$key}_cover.png\", 9);\n\t\t\timagepng($thumb, \"{$image_dir}/{$key}_thumb.png\", 9);\n\t\t\timagepng($image, \"{$image_dir}/{$key}_full.png\", 9);\n\t\t\t\t\n\t\t\timagedestroy($preview);\n\t\t\timagedestroy($cover);\n\t\t\timagedestroy($image);\n\t\t\timagedestroy($thumb);\n\t\t\t\t\n\t\t\tunlink($image_file);\n\t\t}\n\t}", "protected function preparePublicAlbumAndPasswordProtectedAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1, password: TestConstants::ALBUM_PWD_1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "protected function preparePublicAlbumAndHiddenAlbum(): void\n\t{\n\t\t$this->albumID1 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_1)->offsetGet('id');\n\t\t$this->albumID2 = $this->albums_tests->add(null, TestConstants::ALBUM_TITLE_2)->offsetGet('id');\n\t\t$this->photoID1 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_MONGOLIA_IMAGE), $this->albumID1)->offsetGet('id');\n\t\t$this->photoID2 = $this->photos_tests->upload(static::createUploadedFile(TestConstants::SAMPLE_FILE_TRAIN_IMAGE), $this->albumID2)->offsetGet('id');\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID1);\n\t\t$this->albums_tests->set_protection_policy(id: $this->albumID2, is_link_required: true);\n\t\t$this->photos_tests->set_star([$this->photoID2], true);\n\t\tAuth::logout();\n\t\tSession::flush();\n\t\t$this->clearCachedSmartAlbums();\n\t\t$this->performPostPreparatorySteps();\n\t}", "public function setPhotoID($value)\n {\n return $this->set('PhotoID', $value);\n }", "public function setPhotoID($value)\n {\n return $this->set('PhotoID', $value);\n }" ]
[ "0.57265484", "0.5364102", "0.5222773", "0.5144624", "0.51373714", "0.50431395", "0.50330323", "0.503229", "0.5030027", "0.49997965", "0.49879122", "0.49300522", "0.4914934", "0.49133882", "0.49124557", "0.48993564", "0.48892644", "0.48674384", "0.48394945", "0.4815727", "0.48143703", "0.48044467", "0.48028195", "0.4779268", "0.47548217", "0.47370186", "0.47156388", "0.47105876", "0.46973118", "0.46964616", "0.4676693", "0.4671237", "0.46648237", "0.46593577", "0.46518564", "0.4650455", "0.46503645", "0.46503645", "0.46446452", "0.4635269", "0.4628365", "0.46218443", "0.46214053", "0.461482", "0.46146914", "0.46103856", "0.46091795", "0.4605743", "0.4584753", "0.45602992", "0.45203236", "0.4519747", "0.45174515", "0.45172387", "0.45166123", "0.45041198", "0.44952095", "0.44916043", "0.44896287", "0.44822583", "0.4471677", "0.44666785", "0.4463186", "0.44523287", "0.44520423", "0.44462284", "0.44460434", "0.44420654", "0.44399336", "0.44349316", "0.44235697", "0.44158357", "0.44148666", "0.44129926", "0.44002008", "0.4389774", "0.43855315", "0.43850374", "0.43750364", "0.4367553", "0.43647575", "0.4363439", "0.4363178", "0.4361844", "0.4360852", "0.43593952", "0.43567187", "0.4355904", "0.43551433", "0.43535152", "0.4349853", "0.43374947", "0.43363154", "0.43207514", "0.4316202", "0.43124425", "0.4310234", "0.430946", "0.43073827", "0.43071127" ]
0.60841894
0
Remove a photo from a photoset.
function photosets_removePhoto ($photoset_id, $photo_id) { $params['method'] = 'flickr.photosets.orderSets'; $response = $this->execute(array('method' => 'flickr.photosets.removePhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10); $object = unserialize($response); if ($object['stat'] == 'ok') { return TRUE; } else { $this->setError($object['message'], $object['code']); return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove()\n\t{\n\t\t$photosTable = PTA_DB_Table::get('Catalog_Product_Photo');\n\t\t$photos = (array)$photosTable->getPhotos($this->_id);\n\n\t\tif (parent::remove()) {\n\t\t\t$photoFileField = $photosTable->getFieldByAlias('photo');\n\t\t\tforeach ($photos as $photo) {\n\t\t\t\tPTA_Util::unlink(PTA_CONTENT_PATH . '/' . $photo[$photoFileField]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function removePhoto($value)\n {\n $key = array_search($value, $this->photos);\n if($key !== false) {\n unset($this->photos[$key]);\n }\n }", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function delete_photo(){\n $sql=\"DELETE FROM photos WHERE id=\".$this->id;\n self::$connect->query($sql);\n\n }", "function photo_remove() {\n if ( ! $this->input->is_ajax_request() || ! $this->auth->is_login()) {\n return redirect(config_item('site_url'));\n }\n \n $item = filter($this->uri->segment(3), 'str', 40);\n $photo = $this->media->get_by_id($item);\n \n if ( ! $photo || empty($photo)) {\n log_write(LOG_WARNING, 'Photo not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n \n if ($photo->item_author != $this->auth->get_user_id()) {\n log_write(LOG_ERR, 'User is not the author of the photo, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $image = explode('.', $photo->item_filename);\n\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '_thumb.' . $image[1]);\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '.' . $image[1]);\n\n $this->media->remove($item);\n \n return $this->output->set_output(json_encode(array(\n 'code' => 'luck'\n )));\n }", "public function DeletePhotos()\n\t{\tforeach ($this->imagesizes as $sizename=>$size)\n\t\t{\t@unlink($this->GetImageFile($sizename));\n\t\t}\n\t}", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "function photos_delete ($photo_id) {\n $response = $this->execute(array('method' => 'flickr.photos.delete', 'photo_id' => $photo_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function removePhotoAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id');\n\n //GET LISTING ITEM\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n //GET FILE ID\n $file_id = Engine_Api::_()->getDbtable('photos', 'sitereview')->getPhotoId($listing_id, $sitereview->photo_id);\n\n //DELETE PHOTO\n if (!empty($file_id)) {\n $photo = Engine_Api::_()->getItem('sitereview_photo', $file_id);\n $photo->delete();\n }\n\n //SET PHOTO ID TO ZERO\n $sitereview->photo_id = 0;\n $sitereview->save();\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'change-photo', 'listing_id' => $listing_id), \"sitereview_dashboard_listtype_$listingtype_id\", true);\n }", "function favorites_remove ($photo_id) {\n $response = $this->execute(array('method' => 'flickr.favorites.remove', 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "public function delete_photo ($photo_id){\n\t\t$q_extension = \"SELECT extension FROM photos WHERE photo_id =\".$photo_id;\t\n\t\t$q_photo = 'WHERE photo_id = '.$photo_id;\n\t\t#delete photo record from database\n\t\t\t\n\t\t$ext = DB::instance(DB_NAME)->select_field($q_extension);\n\t\tDB::instance(DB_NAME)->delete('photos', $q_photo);\t\t\n\t\t//delete photo from uploads images folder\n\t\tunlink(\"uploads/images/\".$photo_id.\".\".$ext);\n\t\t#send user back to message index\n\t\tRouter::redirect(\"/photos/gallery\");\n\t\n\t}", "public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete the image on the upadate\n $this->temp = $this->image;\n //delete the current image\n $this->setImage(NULL);\n }\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove(array $images) {\n foreach ($images as $id) {\n if (isset($this->_images[$id])) {\n unset($this->_images[$id]);\n }\n }\n }", "public function removePhoto($value)\n {\n if($value == 'photo0')\n return $this->photo0 = '';\n if($value == 'photo1')\n return $this->photo1='';\n if($value == 'photo2')\n return $this->photo2='';\n if($value == 'photo3')\n return $this->photo3 = '';\n if($value == 'photo4')\n return $this->photo4='';\n if($value == 'photo5')\n return $this->photo5='';\n\n }", "function imageDelete($property);", "public function destroy_photo($id)\n {\n //\n if(File::exists(public_path('files/products_img/'.Photo::find($id)->name)))\n {\n File::delete(public_path('files/products_img/'.Photo::find($id)->name));\n Photo::find($id)->delete();\n return redirect()->back();\n }\n }", "function photos_removeTag ($tag_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.removeTag', 'tag_id' => $tag_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function _delete()\n {\n $photoTable = Engine_Api::_()->getItemTable('socialstore_product_photo');\n $photoSelect = $photoTable->select()->where('album_id = ?', $this->getIdentity());\n foreach( $photoTable->fetchAll($photoSelect) as $productPhoto ) {\n $productPhoto->delete();\n }\n\n parent::_delete();\n }", "public function destroy(Photo $photo)\n {\n //\n }", "public function destroy(Photo $photo)\n {\n //\n }", "public function removeUpload()\n {\n $this->picture = null;\n }", "private function deletePhoto()\n {\n try \n {\n global $cbphoto;\n \n $request = $_REQUEST;\n \n if(!isset($request['photo_id']) || $request['photo_id']==\"\" )\n throw_error_msg(\"photo id not provided\");\n\n if( !is_numeric($request['photo_id']) )\n throw_error_msg(\"invalid photo id\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n\n $id = (int)$request['photo_id'];\n $photo = $cbphoto->get_photo($id);\n\n if(!$photo)\n {\n throw_error_msg(lang(\"photo_not_exists\"));\n }\n else\n {\n if($photo['userid']!=userid())\n throw_error_msg(\"You don't have enough permission to delete this photo\");\n } \n \n $cbphoto->delete_photo($id); \n \n if( error() )\n {\n if(error('single')!=\"Photo does not exist in this collection\")\n {\n throw_error_msg(error('single')); \n } \n else\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"photo deleted successfully\", \"data\" => array());\n $this->response($this->json($data)); \n } \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"photo deleted successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function actionRemoveFromBasket()\n\t{\n\t\t$removeThis = array($_GET['imageid']);\n\t\t$basket = Yii::app()->user->getState('basketContents');\n\t\t$newBasket = array_diff($basket,$removeThis);\n\t\t// reduces useless keys, blank keys, from the array\n\t\t$newBasket = array_values($newBasket);\n\t\tYii::app()->user->setState('basketContents',$newBasket);\n\t}", "function deletePicture() {\n\t\tglobal $DB_LINK, $db_table_recipes, $g_rb_database_type, $LangUI;\n\t\t$sql = \"UPDATE $db_table_recipes SET recipe_picture='', recipe_picture_type='' WHERE recipe_id=\" . $DB_LINK->addq($this->id, get_magic_quotes_gpc());\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error removing the picture'), $sql);\n\n\t\t// Do the postgres cleanup\n\t\tif ($this->picture_oid && $g_rb_database_type==\"postgres\") {\n\t\t\t$rc = $DB_LINK->BlobDelete($this->picture_oid);\n\t\t\t$this->picture_oid=NULL;\n\t\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error removing the picture'), $sql);\n\t\t}\n\t\treturn TRUE;\n\t}", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function delImg($item_id, $imgfile)\n {\n $this->db->update(array('id'=>$item_id), array('$pull'=>array('imgs'=>$imgfile)));\n \n // if this img is defimg, remove it, and replace with next img if still exists\n if ( $this->db->getOne(array('id'=>$item_id, 'defimg'=>$imgfile)) )\n {\n $defimg = ( $imgs = $this->db->getOne(array('id'=>$item_id, array('imgs'))) ) ? $imgs[0] : null;\n $this->db->update(array('id'=>$item_id), array('defimg'=>null));\n }\n }", "public function deletePhoto($photo)\n {\n if(!isset($photo['id']))\n return false;\n\n $res = $this->db->delete_attributes($this->domainPhoto, $photo['id']);\n $this->logErrors($res);\n return $res->isOK();\n }", "public function deletePhoto($id)\n {\n return DB::table('photos')->where(['photos_id' => $id])->delete();\n }", "public static function deleteImage(){}", "public function deleteAboutImgMultiLocation(){\n\t\t\n\t\t\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$photo = $_POST['photo'];\n\t\t\t//echo $_POST['image_path'];die;\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($photo == 'right_photo'){\n\t\t\t\t$query = $this->db->query(\"update tblaboutschoolheader set right_photo='' where location_id=\".$location_id.\"\");\n\t\t\t}else {\n\t\t\t\t$query = $this->db->query(\"update tblaboutschoolheader set left_photo='' where location_id=\".$location_id.\"\");\n\t\t\t}\n\t\t\tif($query)\n\t\t\t{\t\n\t\t\t\t$dir=pathinfo(BASEPATH);\n\t\t\t\t//print_r($dir) ; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img);\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "public function delete_all_photos() {\r\n return Foto::where('albums_id', '=', $this->id)->delete();\r\n }", "public function actionDelImg(){\n $img_id = Yii::$app->request->post('img_id');\n $model_id = Yii::$app->request->post('model_id');\n\n $docModel = Product::find()\n ->where([\n 'id' => $model_id\n ])\n ->limit(1)\n ->one();\n $img = $docModel->getImageById($img_id);\n $docModel->removeImageNoDel($img);\n }", "public static function delete($name)\r\n {\r\n foreach (self::getPhotos() as $photo) {\r\n if (self::getName($photo) == $name) {\r\n self::getSlider()->removeChild($photo);\r\n }\r\n }\r\n \r\n return self::save();\r\n }", "public function remove($id)\n {\n return $this->delete('/images/' . $this->encodePath($id));\n }", "public function remove() {}", "public function remove() {}", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function removeImages($object)\n {\n return $this->createQuery('i')\n ->delete()\n ->where('i.imaged_model_id = ?', $object['id'])\n ->andWhere('i.imaged_model = ?', get_class($object))\n ->execute();\n }", "function beforeDelete(){\r\n\t\t$photo = $this->findById($this->id);\r\n\t\tunlink($this->dir . $photo['Photo']['small']);\r\n\t\tunlink($this->dir . $photo['Photo']['large']);\r\n\t\treturn true;\r\n\t}", "function imageAllDelete();", "public function delete(){\n $record = $this->getImageWithId($this->id);\n if(!$record){\n return false;\n }\n $conn = static::connect();\n $stmt = $conn->prepare(\"DELETE FROM images WHERE id = :id\");\n $stmt->bindValue(\"id\", $record['id'], PDO::PARAM_INT);\n\n /* removes file from server */\n unlink($record['path']);\n return $stmt->execute();\n }", "public function supprimerImageMorphoAction()\n\t{\n\t\t$id_cons = $this->params()->fromPost('id_cons');\n\t\t$id = $this->params()->fromPost('id'); //numero de l'image dans le diapo\n\t\t$typeExamen = $this->params()->fromPost('typeExamen');\n\t\n\t\t/**\n\t\t * RECUPERATION DE TOUS LES RESULTATS DES EXAMENS MORPHOLOGIQUES\n\t\t*/\n\t\t $result = $this->demandeExamensTable()->recupererDonneesExamenMorpho($id_cons, $id, $typeExamen);\n\t\t/**\n\t\t * SUPPRESSION PHYSIQUE DE L'IMAGE\n\t\t*/\n\t\t unlink ( 'C:\\wamp\\www\\simens\\public\\images\\images\\\\' . $result['NomImage'] . '.jpg' );\n\t\t/**\n\t\t * SUPPRESSION DE L'IMAGE DANS LA BASE\n\t\t*/\n\t\t $this->demandeExamensTable()->supprimerImage($result['IdImage']);\n\t\n\t\t$this->getResponse()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html' );\n\t\treturn $this->getResponse ()->setContent(Json::encode ());\n\t}", "public function removeImage(Image $image){\n $this->images->removeElement($image);\n }", "function remove_portfolio_picture($portfolio_id, $picture_id) {\n\t\tglobal $con;\n\t\t\n\t\t$query = \"DELETE FROM portfolio_picture WHERE portfolio_id = $portfolio_id AND picture_id = $picture_id\";\n\t\t$result = mysqli_query($con, $query);\n\t\treturn $result;\n\t}", "public function deletephoto()\n\t\t\t{\n\t\t\t\t$photo_details = explode(',', $this->fields_arr['checkbox']);\n\t\t\t\tif($this->fields_arr['action']=='Delete')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$photo_id = $photo_arr[0];\n\t\t\t\t\t\t\t\t$user_id = $photo_arr[1];\n\t\t\t\t\t\t\t\t$photoHandler = new photoHandler();\n\t\t\t\t\t\t\t\t$photoHandler->deletePhotos(array($photo_id), $user_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='Flag')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->CFG['db']['tbl']['flagged_contents'].' WHERE'.\n\t\t\t\t\t\t\t\t' content_type=\\'photo\\' AND content_id IN('.$photo_list.')';\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET flagged_status=\\'Yes\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='UnFlag')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\t$sql = 'DELETE FROM '.$this->CFG['db']['tbl']['flagged_contents'].' WHERE'.\n\t\t\t\t\t\t\t\t' content_type=\\'photo\\' AND content_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET flagged_status=\\'No\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='Featured')\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET featured=\\'Yes\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='UnFeatured')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET featured=\\'No\\''.\n\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t}\n\t\t\t\telse if($this->fields_arr['action']=='Move')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($photo_details as $photo_key=>$photo_value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$photo_arr = explode('-',$photo_value);\n\t\t\t\t\t\t\t\t$flag[] = $photo_arr[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$photo_list = implode(',',$flag);\n\n\t\t\t\t\t\tif($parent_id=$this->isParentExists($this->fields_arr['photo_categories']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET '.\n\t\t\t\t\t\t\t\t\t\t' photo_category_id= \\''.$parent_id.'\\', '.\n\t\t\t\t\t\t\t\t\t\t' photo_sub_category_id = \\''.$this->fields_arr['photo_categories'].'\\' '.\n\t\t\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['photo'].' SET '.\n\t\t\t\t\t\t\t\t\t\t' photo_sub_category_id=0, photo_category_id='.$this->dbObj->Param('photo_categories').\n\t\t\t\t\t\t\t\t\t\t' WHERE photo_id IN('.$photo_list.')';\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($this->fields_arr['photo_categories']));\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public static function delete_photo($id){\n global $db;\n $row = static::find_photo($id);\n $k78sql = \"DELETE FROM photos WHERE photo_id = '\".$id.\"'\";\n try {\n //check if photo is present in database\n if($db->query($sql)){\n //$row = static::find_photo($id);\n //deletes file in image path\n unlink(IMG_PATH.DS.$row['file_name']);\n //deleting photo from database table\n $db->exec($sql);\n return 'Photo with ID '.$id.' deleted from DB';\n }else{\n throw new Exception(\"File could not be deleteed\");\n }\n } catch (Exception $e) {\n return $e;\n }\n }", "public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }", "public function deleteProfilePhoto(): void\n {\n if (! Features::managesProfilePhotos()) {\n return;\n }\n\n if (is_null($this->profile_photo_path)) {\n return;\n }\n\n Storage::disk($this->profilePhotoDisk())->delete($this->profile_photo_path);\n\n $this->forceFill([\n 'profile_photo_path' => null,\n ])->save();\n }", "function deleteImage($filename, $target_file)\n{\n // remove from list\n $list = read_file_list();\n $pivot = array_search($filename, $list);\n $left = array_slice($list, 0, $pivot);\n $right = array_slice($list, $pivot+1);\n $list = array_merge($left, $right);\n\n // remove file and output modified list\n unlink($target_file);\n write_file_list($list);\n\n echo $target_file . \" deleted successfully.<br>\";\n}", "public function destroy($id)\n {\n Gallery::RemoveUserPhoto( $id );\n }", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function deletePhoto($photo_uid, $conf) {\r\n\t\t$photo = tx_cwtcommunity_lib_common::dbQuery('SELECT album_uid, filename FROM tx_cwtcommunity_photos WHERE uid = \"'.intval($photo_uid).'\";');\r\n\t\t$album = tx_cwtcommunity_lib_common::dbQuery('SELECT preview_photo_uid FROM tx_cwtcommunity_albums WHERE uid = \"'.intval($photo[0]['album_uid']).'\";');\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_photos WHERE uid = \"'.intval($photo_uid).'\";');\r\n\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('DELETE FROM tx_cwtcommunity_photo_comments WHERE photo_uid = \"'.intval($photo_uid).'\";');\r\n\t\tif ($album[0]['preview_photo_uid'] == $photo_uid) {\r\n\t\t\t// Update preview photo\r\n\t\t\ttx_cwtcommunity_lib_common::dbUpdateQuery('UPDATE tx_cwtcommunity_albums SET preview_photo_uid = \"\" WHERE uid = \"'.intval($photo[0]['album_uid']).'\";');\r\n\t\t}\r\n\t\t\r\n\t\t// Delete photo from filesystem\r\n\t\t$storageFolder = $conf['album.']['photo.']['storageFolder'];\r\n\t\t$file = $storageFolder.$photo[0]['filename'];\r\n\t\tif (@file_exists($file)) {\r\n\t\t\tunlink($file);\r\n\t\t}\r\n\t}", "public function removeProductsImagesCollection($productsImagesCollection) {\n }", "public function del_pic($i_id)\r\n\t{\r\n\t\ttry\r\n {\r\n\t\t\treturn $this->db->update($this->tbl, array('s_photo'=>''), array('i_id'=>$i_id));\r\n\t\t}\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n\t}", "public static function removeInstanceFromPool($value)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled() && $value !== null) {\n\t\t\tif (is_object($value) && $value instanceof MissionPhoto) {\n\t\t\t\t$key = (string) $value->getId();\n\t\t\t} elseif (is_scalar($value)) {\n\t\t\t\t// assume we've been passed a primary key\n\t\t\t\t$key = (string) $value;\n\t\t\t} else {\n\t\t\t\t$e = new PropelException(\"Invalid value passed to removeInstanceFromPool(). Expected primary key or MissionPhoto object; got \" . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));\n\t\t\t\tthrow $e;\n\t\t\t}\n\n\t\t\tunset(self::$instances[$key]);\n\t\t}\n\t}", "function tfuse_delete_resized_images( $post_id ) {\r\n $metadata = wp_get_attachment_metadata( $post_id );\r\n if ( !$metadata )\r\n return;\r\n\r\n // Do some bailing if we cannot continue\r\n if ( !isset( $metadata['file'] ) || !isset( $metadata['image_meta']['resized_images'] ) )\r\n return;\r\n $pathinfo = pathinfo( $metadata['file'] );\r\n $resized_images = $metadata['image_meta']['resized_images'];\r\n\r\n // Get Wordpress uploads directory (and bail if it doesn't exist)\r\n $wp_upload_dir = wp_upload_dir();\r\n $upload_dir = $wp_upload_dir['basedir'];\r\n if ( !is_dir( $upload_dir ) )\r\n return;\r\n\r\n // Delete the resized images\r\n foreach ( $resized_images as $dims ) {\r\n\r\n // Get the resized images filename\r\n $file = $upload_dir .'/'. $pathinfo['dirname'] .'/'. $pathinfo['filename'] .'-'. $dims .'.'. $pathinfo['extension'];\r\n\r\n // Delete the resized image\r\n @unlink( $file );\r\n\r\n }\r\n\r\n $remote_uploaded_by_tfuse = get_option('tfuse_remote_images', array());\r\n $image_uri = wp_get_attachment_url($post_id);\r\n $key = array_search($image_uri, $remote_uploaded_by_tfuse);\r\n if($key)\r\n {\r\n unset($remote_uploaded_by_tfuse[$key]);\r\n update_option('tfuse_remote_images', $remote_uploaded_by_tfuse);\r\n }\r\n\r\n\r\n }", "function deleteImage($image = \"\")\n {\n if (!$image)\n $image = $this->image;\n unlink ($image);\n }", "public function removePhotoProfile(Request $request){\n\n return response( $this->profileRepository->RemovePhotoProfile($request,$this->user), 200);\n\n }", "public function deletePhotoVersions($photo)\n {\n if(!isset($photo['id']))\n return false;\n\n $photo = $this->getPhoto($photo['id']);\n $attrs = array();\n foreach($photo as $key => $val)\n {\n if(preg_match('/^path/', $key) === 1 && !in_array($key, array('pathOriginal', 'pathBase')))\n {\n $attrs[] = array('Name' => $key);\n }\n }\n\n $res = $this->db->delete_attributes($this->domainPhoto, $photo['id'], $attrs);\n return $res !== false;\n }", "public function delete($picture)\n\t{\n\t\t$picture = $this->findByName($picture);\n\t\t// exclui as fotos (pequena, media e grande)\n\t\tImageService::destroy($picture->name);\n\t\t// exclui no banco de dados\n\t\t$picture->delete();\n\n\t\treturn $picture->item;\n\t}", "function unsetImage($uid,$table,$data,$path) {\n\t\n\t $this->db->select($data);\n $this->db->from($table);\n\t\t$this->db->where('uid',$uid);\n $query=$this->db->get();\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t $query=$query->result();\n\t\t $img=$query[0]->$data;\n @unlink($path.$img);\n\t\t}\t\n return true;\t\t\n\t}", "public function removeImage($data)\n\t{\n\t\t$this->db->delete('tbl_gambar', $data);\n\t}", "public function deletePicture($id){\n $picName = null;\n $images = new Images();\n $dataPic = $images->get_image($id);\n foreach ($dataPic as $key => $value) {\n $picName = $value->img_url;\n }\n $checkFile = file_exists(public_path() . '/' . $picName);\n if ($checkFile){\n unlink(public_path() . '/' . $picName);\n }\n }", "public function deleteProfilePhoto()\n {\n Storage::disk($this->profilePhotoDisk())->delete($this->profile_photo_path);\n\n $this->forceFill([\n 'profile_photo_path' => null,\n ])->save();\n }", "public function deleteImage1()\n {\n Storage::delete($this->image1);\n }", "public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }", "public function deleteImage($event)\n {\n $this->unlinkFiles($event->sender->{$this->attribute});\n }", "public function remove(PersistentImageInterface $image): void\n\t{\n\t}", "function remove_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t// get the image's name to remove from file system\n\t\t$image = get_image($image_id);\n\n\t\t// construct query\n\t\t$query = \"DELETE FROM images WHERE images . id='$image_id'\";\n\n\t\t//send query\n\t\tif (send_query($query,$db_hostname,$db_user,$db_password,$idea_db))\n\t\t{\n\t\t\t// remove from file system\n\t\t\tunlink($image);\n\t\t} else {\n\t\t\t// TODO: Error occured with removing image. Redirect Appropriately.\n\t\t\t// debug\n\t\t\techo \"<h1> Image Not Deleted </h1>\";\n\t\t}\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function destroy($id)\n {\n $photo=Gallery::all()->where('id',$id)->pluck('photos')->first();\n Storage::disk('public')->delete($photo);\n $deletedPhoto=Gallery::all()->where('id',$id)->first();\n $deletedPhoto->delete();\n return redirect('admin/realestate/' . $realestate.'/photos');\n }", "public function deletePicture()\n {\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $tenant->profile_picture = NULL;\n $tenant->save();\n\n }", "public function imageUnlink($imgdata){\r\n $about_us_team_member_id = $imgdata['team_member_id'];\r\n $sql = \"SELECT member_image FROM tbl_aboutus_team WHERE team_member_id='$about_us_team_member_id'\";\r\n $query_result = mysqli_query($this->db_connect, $sql);\r\n $member_image = mysqli_fetch_assoc($query_result);\r\n return unlink($member_image['member_image']);\r\n }", "public function deleteImage($foto) {\n \t\n \tforeach($this->barcoFotos as $barcof) {\n \t\tif ($barcof->id === $foto) {\n \t\t\t$image = $barcof->foto_url;\n \t\t\tif (unlink($image)) {\n \t\t\t\t$barcof->delete();\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t}\n \treturn false;\n }", "public function deleteImage(string $type, $id);", "public function destroy(underwaterphoto $underwaterphoto)\n {\n //\n }", "public function removeImage($image)\n {\n if (file_exists('upload_image/' . $image)) {\n unlink('upload_image/' . $image);\n }\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function destroy(Photo $photo)\n {\n $photo->delete();\n return redirect('recitals/photos');\n }", "public function destroy($id)\n {\n $photo = Photo::where('user_id', '=', Auth()->user()->id)->findOrFail($id);\n\n File::delete(public_path(UPLOADS_PIC_FOLDER . $photo->file));\n File::delete(public_path(ORIGINAL_PICS_FOLDER . $photo->file));\n File::delete(public_path(UPLOADS_THUMB_FOLDER . $photo->file));\n\n $photo->delete();\n Session::flash('message', 'Photo supprimée avec succès.');\n\n return redirect()->route('user.event.show', $photo->event_id);\n }", "public function deleteImage($image){\n /** @var Image $image */\n $this->em->remove($image);\n $image->onPreRemove();\n $this->em->flush();\n }", "private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function destroy($id)\n {\n $find = Customer::find($id);\n $photo = $find->image;\n\n if($photo){\n unlink($photo);\n $delete = Customer::where('id',$id)->delete();\n }else{\n $delete = Customer::where('id',$id)->delete();\n }\n }", "public function destroy($id)\n {\n $album=Album::find($id);\n //finding the photos related to that model\n $photos=DB::table('photos')->where('album_id',$id)->get();\n //fetching each photos to the variable photo\n foreach($photos as $photo)\n {\n //finding the photo in photo model\n $p=Photo::find($photo->id);\n //deleting photo from the storage as well as form the database \n if(Storage::delete('public/photos/'.$photo->album_id.'/'.$photo->photo));\n $p->delete();\n }\n //deleting the album\n if(Storage::delete('public/photos/'.$album->album_id.'/'.$album->cover_image));\n $album->delete();\n return redirect('/')->with('success','Album Deleted Sucessfully'); \n }", "public function delete($id) \n\t{\n \t$tot = $this->Model_photo->photo_check($id);\n \tif(!$tot) {\n \t\tredirect(base_url().'admin/photo');\n \texit;\n \t}\n\n $data['photo'] = $this->Model_photo->getData($id);\n if($data['photo']) {\n unlink('./public/uploads/'.$data['photo']['photo_name']);\n }\n\n $this->Model_photo->delete($id);\n redirect(base_url().'admin/photo');\n }", "public function destroy(Fotos $fotos)\n {\n //\n }", "public function removeImg(Request $request, $id)\n {\n $this->validate($request, [\n 'urlImg' => 'required'\n ]);\n\n $spl = explode('/', $request->input('urlImg'));\n $namefile = $spl[(count($spl) - 1)];\n $path = $spl[(count($spl) - 4)].'/'.$spl[(count($spl) - 3)].'/'.$spl[(count($spl) - 2)].'/'.$spl[(count($spl) - 1)];\n $produk = Produk::select('multipath', 'path')->whereId($id)->first();\n $data = array();\n if ($produk->multipath) {\n $spl2 = explode(',', $produk->path);\n if (($key = array_search($path, $spl2)) !== false) {\n unset($spl2[$key]);\n }\n $data['multipath'] = count($spl2) > 1;\n $data['path'] = implode(\",\", $spl2);\n Produk::whereId($id)->update($data);\n } else {\n Produk::whereId($id)->update(['multipath' => false, 'path' => null]);\n }\n Storage::disk('public')->delete('images/produk' . $namefile);\n Alert::success('Succesfully Delete Photos', 'Update data has been saved !!!');\n return redirect()->back();\n }", "public function destroyPhoto($id) {\n\n // Find the ID of the photo and delete it.\n ProfilePhoto::findOrFail($id)->delete();\n\n return redirect()->back();\n\n }", "public function remove($property);", "function removeCollection()\n {\n $collection = eZProductCollection::fetch( $this->attribute( 'productcollection_id' ) );\n $collection->remove();\n }" ]
[ "0.70054024", "0.683811", "0.6623904", "0.66115767", "0.6547519", "0.6327626", "0.6278144", "0.6216093", "0.6189883", "0.6186994", "0.61034226", "0.5992519", "0.5980534", "0.5953017", "0.59094036", "0.58949935", "0.58870465", "0.58870465", "0.58870465", "0.58870465", "0.5885311", "0.58518106", "0.57646966", "0.5759809", "0.5752714", "0.57186276", "0.57141316", "0.57141316", "0.5695097", "0.56666", "0.5661309", "0.5644708", "0.56422025", "0.5630094", "0.56134945", "0.55943316", "0.55924743", "0.558631", "0.5575175", "0.5571292", "0.55379647", "0.5489935", "0.5488633", "0.54877317", "0.54705685", "0.54682964", "0.54587126", "0.5450031", "0.544065", "0.54371405", "0.5427649", "0.5421513", "0.54185915", "0.54181206", "0.5414616", "0.5411718", "0.54072446", "0.5379453", "0.53769445", "0.53769445", "0.53769445", "0.53660077", "0.5354712", "0.53465474", "0.53429806", "0.53421843", "0.53337914", "0.5326844", "0.5322422", "0.5307349", "0.5304365", "0.5298207", "0.5284889", "0.52820975", "0.52811074", "0.52705675", "0.52649105", "0.5243869", "0.52412105", "0.5240992", "0.52366817", "0.52356356", "0.52188045", "0.5214429", "0.52102923", "0.5198892", "0.5196869", "0.5193992", "0.519153", "0.51901335", "0.5187817", "0.5184875", "0.5183891", "0.51819354", "0.51764655", "0.517263", "0.5167654", "0.51609516", "0.515764", "0.515284" ]
0.8023547
0
Get direct photo url for all available sizes
public function getPhotoUrls () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImageURL($size = 'original') {\n\t\treturn $this->_config['images']['base_url'] . $size;\n\t}", "public function getThumbnailUrl();", "public function getFirstPhotoURL( $size = \"300\" ){\n $pics = $this->getPhotos();\n return $pics[0][\"Uri{$size}\"];\n }", "function imageUrl($property, $size = null);", "public function getProfileImage($size)\n {\n $socialAuths = $this->getSocialAuths();\n\n if (isset($socialAuths)) {\n foreach ($socialAuths as $socialAuth) {\n if ($socialAuth->getPlatform() == 'facebook') {\n switch ($size) {\n case 'small': // 50px x 50px\n return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture?type=square';\n break;\n case 'medium': // 200px x 200px\n return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture?type=large';\n break;\n case 'large': // 200px x 200px\n return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture?type=large';\n break;\n default:\n return '//graph.facebook.com/'.$socialAuth->getSocialId().'/picture';\n break;\n }\n } elseif ($socialAuth->getPlatform() == 'onebody') {\n $baseUrl = getConfig()['auth']['onebody']['url'];\n $photoFingerprint = $socialAuth->getMeta()['photo-fingerprint'];\n if (empty($photoFingerprint) || !is_string($photoFingerprint)) {\n // OneBody doesn't actually have a photo (or we don't know its URL)\n continue;\n }\n $extension = pathinfo($socialAuth->getMeta()['photo-file-name'], PATHINFO_EXTENSION);\n switch ($size) {\n case 'small': // 50px x 50px\n return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/tn/'.$photoFingerprint.'.'.$extension;\n break;\n case 'medium': // 150px x 150px\n return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/small/'.$photoFingerprint.'.'.$extension;\n break;\n case 'large': // 500px x 500px\n return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/medium/'.$photoFingerprint.'.'.$extension;\n break;\n default:\n return $baseUrl.'/system/production/people/photos/'.$socialAuth->getSocialId().'/tn/'.$photoFingerprint.'.'.$extension;\n break;\n }\n }\n }\n }\n\n switch ($size) {\n case 'small': // 50px x 50px\n return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=50&d=mm';\n break;\n case 'medium': // 200px x 200px\n return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=200&d=mm';\n break;\n case 'large': // 500px x 500px\n return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=500&d=mm';\n break;\n default:\n return '//www.gravatar.com/avatar/'.md5(strtolower(trim($this->email))).'?s=50&d=mm';\n break;\n }\n }", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "function cpo_image_url( $id, $size = 'full' ) {\n\t$url = '';\n\tif ( is_numeric( $id ) ) {\n\t\t$url = wp_get_attachment_image_src( $id, $size );\n\t\t$url = $url[0];\n\t} else {\n\t\t$url = $id;\n\t}\n\n\treturn $url;\n}", "private function get_image_size_links($post) {\r\n \t/* Set up an empty array for the links. */\r\n \t$links = array();\r\n \t/* Get the intermediate image sizes and add the full size to the array. */\r\n \t$sizes = get_intermediate_image_sizes();\r\n $sizes[] = 'full';\r\n\r\n \t/* Loop through each of the image sizes. */\r\n $i = 0;\r\n foreach ( $sizes as $size ) {\r\n /* Get the image source, width, height, and whether it's intermediate. */\r\n remove_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ) );\r\n if ($image = wp_get_attachment_image_src( $post->ID, $size )){\r\n\r\n $links[$i]['url'] = $image[0];\r\n $links[$i]['type'] = $size;\r\n $links[$i]['width'] = $image[1];\r\n $links[$i]['height'] = $image[2];\r\n\r\n $i++;\r\n }\r\n add_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ), 10, 3 );\r\n }\r\n\r\n return $links;\r\n }", "public function getPhotoLargeAttribute()\n {\n return Storage::url('large' . $this->photo_path);\n }", "public function buildPhotoUrl () {\n\t\t\n\t}", "public function getPhotoURL(){\r\n\t\t$photo = $this->getPhoto();\r\n\r\n\t\treturn $photo != null ? \"https://maps.googleapis.com/maps/api/place/photo?maxwidth=800&photoreference=\" . $photo . \"&key=\" . GOOGLE_MAPS_API_KEY_PRIVATE : null;\r\n\t}", "public function resolveThumbnailUrl();", "public function avatarUrl(): string\n {\n $sizes = ['xl', 'l', 'm', 's'];\n\n foreach ($sizes as $size) {\n if (array_key_exists($size, $this->avatarUrls())) {\n return $this->avatarUrls()[$size];\n }\n }\n\n // Could not find any of the sizes specified, just return the first one in the array.\n return current($this->avatarUrls());\n }", "public function avatarUrl(): string\n {\n $sizes = ['xl', 'l', 'm', 's'];\n\n foreach ($sizes as $size) {\n if (array_key_exists($size, $this->avatarUrls())) {\n return $this->avatarUrls()[$size];\n }\n }\n\n // Could not find any of the sizes specified, just return the first one in the array.\n return current($this->avatarUrls());\n }", "public function getPhotoUrl()\n {\n if (filter_var($this->photoUrl, FILTER_VALIDATE_URL)) {\n return $this->photoUrl;\n }\n\n if (null !== $this->photoUrl) {\n return \"/uploads/photos/$this->photoUrl\";\n }\n }", "function photonfill_get_url_image( $img_url, $img_size, $attr = array() ) {\n\treturn Photonfill()->get_url_image( $img_url, $img_size, $attr );\n}", "public function getUri($size){\n\t\tif($size=='full'){\n\t\t\treturn $this->getFileUri();\n\t\t}else {\n\t\t\tif(array_key_exists($size,Config::get('image.sizes'))){\n\t\t\t\t$parts = explode('.',$this->value);\n\t\t\t\tarray_pop($parts);\n\t\t\t\treturn static::getMediaUri() . '/' . implode('.',$parts) . '_' . $size . '.' . $this->getExtension();\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function getPhotoUrl()\n\t{\n\t\treturn $this->photo_url;\n\t}", "public function getImageUrl();", "function dahz_get_image_size_links() {\n\n\t/* If not viewing an image attachment page, return. */\n\tif ( !wp_attachment_is_image( get_the_ID() ) )\n\t\treturn;\n\n\t/* Set up an empty array for the links. */\n\t$links = array();\n\n\t/* Get the intermediate image sizes and add the full size to the array. */\n\t$sizes = get_intermediate_image_sizes();\n\t$sizes[] = 'full';\n\n\t/* Loop through each of the image sizes. */\n\tforeach ( $sizes as $size ) {\n\n\t\t/* Get the image source, width, height, and whether it's intermediate. */\n\t\t$image = wp_get_attachment_image_src( get_the_ID(), $size );\n\n\t\t/* Add the link to the array if there's an image and if $is_intermediate (4th array value) is true or full size. */\n\t\tif ( !empty( $image ) && ( true === $image[3] || 'full' == $size ) ) {\n\n\t\t\t/* Translators: Media dimensions - 1 is width and 2 is height. */\n\t\t\t$label = sprintf( __( '%1$s &#215; %2$s', 'dahz-core' ), number_format_i18n( absint( $image[1] ) ), number_format_i18n( absint( $image[2] ) ) );\n\n\t\t\t$links[] = sprintf( '<a class=\"image-size-link\">%s</a>', $label );\n\t\t}\n\t}\n\n\t/* Join the links in a string and return. */\n\treturn join( ' <span class=\"sep\">/</span> ', $links );\n}", "public function getMediaImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'catalog/product';\n }", "public function getResponsiveImagesDirectoryUrl(): string\n {\n return $this->config->get(\"filesystems.disks.{$this->media->disk}.url\").'/'\n .$this->pathGenerator->getPathForResponsiveImages($this->media);\n }", "public function get_image_url()\n {\n }", "public function getPhotoUrlAttribute()\n {\n return data_get($this, 'photo.s3url', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/parcels/medium.png');\n }", "public function getPictureUrl()\n {\n return $this->getImageurl();\n }", "public function getPhoto($userId, $size);", "public function get_image_link()\n {\n }", "public function getImage(){\n $images = $this->getImageUrls($this->image_size);\n return Utils::saveImage($images->attr('data-url'));\n }", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "public function getImageUrl2($size = '50x50', $options = array())\n {\n $attrname = $this->name;\n $params = array();\n $params['id'] = $this->id;\n if (!empty($attrname)) {\n if ($size !== false) {\n $params['size'] = $size;\n //if (isset($options['mod'])) {\n // $params['mod'] = $options['mod'];\n //}\n return Yii::app()->createUrl('/core/attachment', $params);\n\n //return CMS::assetImage($size, $attrname, 'attachments.' . $dir, 'attachments/' . $redir, $options);\n }\n } else {\n return false;\n }\n }", "public function getImageUrl()\n {\n $baseUrl = $this->getBaseImageUrl();\n if ($baseUrl) {\n $dimensions = $this->getImageDimensions();\n $imageData = $this->getImageData();\n $width = Kwf_Media_Image::getResponsiveWidthStep($dimensions['width'],\n Kwf_Media_Image::getResponsiveWidthSteps($dimensions, $imageData['file']));\n $ret = str_replace('{width}', $width, $baseUrl);\n $ev = new Kwf_Component_Event_CreateMediaUrl($this->getData()->componentClass, $this->getData(), $ret);\n Kwf_Events_Dispatcher::fireEvent($ev);\n return $ev->url;\n }\n return null;\n }", "function get_page_feature_image_url($postID, $size)\n{\n //get wp object of featured image\n $feature_image_id = get_post_thumbnail_id($postID);\n //get array of the featured image based on size\n $feature_image_meta = wp_get_attachment_image_src($feature_image_id, $size);\n //the 1st argument of the array is the url of the image 2nd is the width the 3ed is the height\n $link = $feature_image_meta[0];\n //return the first argument\n return $link;\n}", "public function APIGetThumbnailSrc($size='') {\n if(!empty($this->thumbnail)) {\n return URL::to('/').base64_decode($this->thumbnail);\n }\n }", "public function getImageUrl($size = self::SIZE_240PX) {\n\t\tif ($size == self::SIZE_500PX) {\n\t\t\treturn \"http://farm{$this->getFarm()}.static.flickr.com/{$this->getServer()}/{$this->getId()}_{$this->getSecret()}.jpg\";\n\t\t} else {\n\t\t\treturn \"http://farm{$this->getFarm()}.static.flickr.com/{$this->getServer()}/{$this->getId()}_{$this->getSecret()}_{$size}.jpg\";\n\t\t}\n\t}", "function superimg_url($location, $width = 'auto', $height = 'auto') {\n return base_url('img?path=' . $location . '&width=' . $width . '&height=' . $height);\n }", "public function getBigPicUrl()\n\t{\n\t\treturn $this->bigPicUrl;\n\t}", "public function getUrl($size = false, $method=3, $script=false){\n $path=$this->getPath($size, $method);\n if($script){\n $url = Url::toRoute([\n '/'.$this->getModule()->id.'/images/image-by-item',\n 'item' => $this->id,\n 'size' => $size,\n 'method' => $method\n ]);\n exit;\n return $url;\n }else{\n $url='';\n if(isset(Yii::$app->params['siteUrl'])) $url=Yii::$app->params['siteUrl'];\n return $url.str_replace([$_SERVER['DOCUMENT_ROOT'],'\\\\'], ['','/'], $path);\n }\n\n }", "public function getAbsoluteUrl($size = false, $method=3){\n $this->getPath($size, $method);\n $url = Yii::$app->getUrlManager()->createAbsoluteUrl([\n '/'.$this->getModule()->id.'/images/image-by-item',\n 'item' => $this->id,\n 'size' => $size,\n 'method' => $method\n ]);\n\n return $url;\n }", "public function picture_url() {\n return $this->_adaptee->user_photo(\"\", true);\n }", "public function getPhotoUrlAttribute()\n {\n return asset(env('FRONTEND_IMAGES_PATH') . $this->image);\n }", "protected function imageUrl($attribute, $size = null)\n {\n if (in_array($attribute, $this->owner->attributes()) && is_array($this->attributes[$attribute]))\n {\n if (empty($this->owner->$attribute)) {\n return null;\n }\n\n $size = $this->sizeIndex($attribute, $size);\n\n if (strpos($this->domain, '@') === 0) {\n $host = Yii::getAlias($this->domain);\n } else {\n if (preg_match('~^((?:https?\\:)?//)~', $this->domain, $m)) {\n $protocol = $m[1];\n } else {\n $protocol = preg_replace('~^((?:https?\\:)?//)(.*)$~', '\\\\1', Yii::$app->urlManager->hostInfo);\n }\n $host = $protocol. preg_replace('~^(?:https?\\:)?//(.*)$~',\n str_replace('{$domain}', '\\\\1', $this->domain), Yii::$app->urlManager->hostInfo);\n }\n\n $format = array_merge($this->defaultImagesSettings, $this->attributes[$attribute],\n $this->attributes[$attribute]['sizes'][$size])['format'];\n\n return $this->schemaTo($host, $attribute, \"$size/{$this->owner->$attribute}.$format\");\n }\n\n throw new UnknownMethodException(\n sprintf('Calling unknown method: %s::get%sUrl()', get_class($this), ucfirst($attribute)));\n }", "function odin_get_image_url( $id, $width, $height, $crop = true, $upscale = false ) {\n\t$resizer = Odin_Thumbnail_Resizer::get_instance();\n\t$origin_url = wp_get_attachment_url( $id );\n\t$url = $resizer->process( $origin_url, $width, $height, $crop, $upscale );\n\n\tif ( $url ) {\n\t\treturn $url;\n\t} else {\n\t\treturn $origin_url;\n\t}\n}", "public function image()\n {\n if (isset($this->object->entities->media) && ! empty($this->object->entities->media)) {\n return $this->object->entities->media[0]->media_url;\n }\n }", "public function nextGetUrlAttribute()\n {\n $photoUrl = explode('/', $this->file_name);\n $photoUrl[0] = '/storage';\n $photoUrl = implode('/', $photoUrl);\n\n return $photoUrl;\n }", "function wp_get_actual_attachment_image_src($image_id, $size = 'full') {\n return ($i = wp_get_attachment_image_src($image_id, $size)) ? $i[0] : '';\n}", "public function getProfilePhotoUrlAttribute()\n {\n return $this->profile_photo_path\n ? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)\n : $this->defaultProfilePhotoUrl();\n }", "public function getAbsolutePicture();", "public function getPhotoUrl($type = null)\r\n\t{\r\n\t\t$field = 'photo_id';\r\n\t\tif ($type == 'thumb.large')\r\n\t\t{\r\n\t\t\t$field = 'large_photo_id';\r\n\t\t}\r\n\t\tif (empty($this -> $field))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t$file = Engine_Api::_() -> getItemTable('storage_file') -> getFile($this -> $field, $type);\r\n\t\tif (!$file)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn $file -> map();\r\n\t}", "public static function generatePhotoApiUrl($photo, $sizeType = '') {\n $farmId = $photo->farm;\n $serverId = $photo->server;\n $photoId = $photo->id;\n $secretId = $photo->secret;\n\n if ($sizeType != 'o') {\n return \"https://farm\" . $farmId . \".staticflickr.com/\" . $serverId . \"/\" . $photoId . \"_\" . $secretId . \"_\". $sizeType .\".jpg\";\n }\n\n return \"https://farm\" . $farmId . \".staticflickr.com/\" . $serverId . \"/\" . $photoId . \"_\" . $secretId . \".jpg\";\n }", "function getThumbUrl($size,$post_id) {\n if (!isset($size)) {\n $size = 'full';\n }\n $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size);\n if($thumb[0] != \"\") {\n return $thumb[0];\n }\n}", "function featuredURL($size = 'full'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo $url;\n}", "function featuredURL($size = 'full'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo $url;\n}", "function wp_get_attachment_image_url($attachment_id, $size = 'thumbnail', $icon = \\false)\n {\n }", "function cah_news_get_thumbnail($post, $sizes=['medium_large', 'medium','large']) {\r\n if (isset($post->_embedded->{'wp:featuredmedia'}[0]->media_details->sizes->thumbnail->source_url))\r\n {\r\n $media_sizes = $post->_embedded->{'wp:featuredmedia'}[0]->media_details->sizes;\r\n foreach($sizes as $size) {\r\n if ( isset($media_sizes->{$size}->source_url) ) {\r\n return $media_sizes->{$size}->source_url; \r\n }\r\n }\r\n }\r\n return false; \r\n}", "public function getPictureUri()\n\t{\n\t\treturn '/uploads/postcards/' . $this->picture;\n\t}", "public function getImageUrl() \n {\n // return a default image placeholder if your source avatar is not found\n $imagen = isset($this->imagen) ? $this->imagen : 'default_product.jpg';\n return Url::to('@web/img/producto/'). $imagen;\n }", "public function getPhotoAttribute()\n {\n return $this->fetchFirstMedia()->file_url ?? \"\";\n }", "private function thumb()\n {\n $preview = array('png', 'jpg', 'gif', 'bmp');\n\n $publicBaseUrl = 'packages/spescina/mediabrowser/src/img/icons/';\n\n if ($this->folder)\n {\n if ($this->back)\n {\n $icon = 'back';\n }\n else\n {\n $icon = 'folder';\n }\n\n $url = $publicBaseUrl . $icon . '.png';\n }\n else\n {\n if (in_array($this->extension, $preview))\n {\n $url = $this->path;\n }\n else\n {\n $url = $publicBaseUrl . $this->extension . '.png';\n }\n }\n\n return $url;\n }", "public function getThumbUrl($size = null)\n\t{\n\t\treturn false;\n\t}", "public function getPictureUrl() {\n\t\treturn $this->picture ? Storage::url(self::IMAGE_DIRECTORY.'/'.$this->picture) : null;\n\t}", "public function catch_thumbnail_url_rewritted() {\n\n if( isset($_GET['name_image']) && !empty($_GET['name_image']) && preg_match('/^w(\\d+)-h(\\d+)-(\\d+)-(.*)$/', $_GET['name_image'], $matches) && is_array($matches) && count($matches) > 1 && is_numeric($matches[3]) ) {\n\n $size_image = 'large';\n\n $consider_width = ( isset($_GET['w']) && is_numeric($_GET['w']) );\n $consider_height = ( isset($_GET['h']) && is_numeric($_GET['h']) );\n \n if( $consider_width || $consider_height ) {\n \n $attachment_metadata = wp_get_attachment_metadata($matches[3]);\n $sizes_available = $attachment_metadata['sizes'];\n if( !isset($sizes_available['large']) ) {\n $sizes_available['large'] = [\n 'width' => $attachment_metadata['width'],\n 'height' => $attachment_metadata['height']\n ];\n }\n\n $nearby_size_w = null;\n $nearby_size_h = null;\n foreach( $sizes_available as $key_size => $size ) {\n if(\n $key_size != 'thumbnail' &&\n (\n (\n $consider_width && \n $size['width'] >= $_GET['w'] && (\n is_null($nearby_size_w) || $size['width'] < $nearby_size_w\n )\n ) || !$consider_width\n )\n &&\n (\n (\n $consider_height && \n $size['height'] >= $_GET['h'] && (\n is_null($nearby_size_h) || $size['height'] < $nearby_size_h\n )\n ) || !$consider_height\n )\n ){\n $nearby_size_w = $size['width'];\n $nearby_size_h = $size['height'];\n $size_image = $key_size;\n }\n }\n\n // If none size was selected, choose larger image\n if( is_null($nearby_size_w) && is_null($nearby_size_h) ) {\n foreach( $sizes_available as $key_size => $size ) {\n if(\n $key_size != 'thumbnail' &&\n (\n (\n is_null($nearby_size_w) && is_null($nearby_size_h)\n )\n ||\n (\n (\n ( $consider_width && $nearby_size_w < $size['width'] ) || !$consider_width\n )\n &&\n (\n ( $consider_height && $nearby_size_h < $size['height'] ) || !$consider_height\n )\n )\n )\n ){\n $nearby_size_w = $size['width'];\n $nearby_size_h = $size['height'];\n $size_image = $key_size;\n }\n }\n }\n }\n \n // Render image\n $data_image = wp_get_attachment_image_src($matches[3], $size_image);\n if( $data_image && is_array($data_image) && count($data_image) > 0 ) {\n\n // Get image PATH\n $wp_upload_dir = wp_upload_dir();\n $path_image = str_replace($wp_upload_dir['baseurl'], $wp_upload_dir['basedir'], $data_image[0]);\n if( file_exists($path_image) ) {\n\n // Copy image\n $name_directory_image_copy = dirname(ABSPATH) . '/' . $this->path_generated_images . '/';\n if( !file_exists($name_directory_image_copy) )\n mkdir($name_directory_image_copy);\n copy( $path_image, $name_directory_image_copy . $matches[0] );\n\n $last_modified_time = filemtime($path_image);\n $cache_duration = 3600 * 24 * 30; // 30 days...\n $etag = 'W/\"' . md5($last_modified_time) . '\"';\n\n // Define some header\n header('Content-Type: image/jpeg');\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified_time) . ' GMT');\n header(\"Cache-Control: public, max-age=\" . $cache_duration);\n header(\"Etag: $etag\");\n\n // Send 304 if no update\n if (\n (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) === $last_modified_time) ||\n (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $etag === trim($_SERVER['HTTP_IF_NONE_MATCH']))\n ) {\n header('HTTP/1.1 304 Not Modified');\n exit();\n }\n else {\n // Else generate PHP image and return\n readfile($path_image, false, stream_context_create([\n 'ssl' => [\n 'verify_peer' => false\n ]\n ]));\n }\n }\n }\n }\n }", "public function getPhotoAttribute()\n {\n if ($this->photo_file_id) {\n return Drive::previewUrl($this->photo_file_id);\n }\n return '';\n }", "public function getProfilePhotoUrlAttribute(): string\n {\n return $this->profile_photo_path && $this->photoExists()\n ? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)\n : $this->filamentDefaultAvatar();\n }", "public function getPictureURL() {\n return $this->picture_url;\n }", "function psa_get_post_images_src( $size = 'thumbnail' ) {\n\tglobal $post;\n\t\n\t$images = get_children( array('exclude' => get_post_thumbnail_id( $post->ID ), 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order') );\n\t\t\n\t$results = array();\n\n\tif ( $images ) {\n\t\tforeach ( $images as $image ) {\n\t\t\t// get the correct image html for the selected size\n\t\t\t$results[] = wp_get_attachment_image_src( $image->ID, $size );\n\t\t}\n\t}\n\t\n\treturn $results;\n}", "function get_image_url( $id, $width=false, $height=false ) {\n\t\t\n\t\t/**/\n\t\t// Get attachment and resize but return attachment path (needs to return url)\n\t\t$attachment = wp_get_attachment_metadata( $id );\n\t\t$attachment_url = wp_get_attachment_url( $id );\n\t\tif (isset($attachment_url)) {\n\t\t\tif ($width && $height) {\n\t\t\t\t$uploads = wp_upload_dir();\n\t\t\t\t$imgpath = $uploads['basedir'].'/'.$attachment['file'];\n\t\t\t\terror_log($imgpath);\n\t\t\t\t$image = image_resize( $imgpath, $width, $height );\n\t\t\t\tif ( $image && !is_wp_error( $image ) ) {\n\t\t\t\t\terror_log( is_wp_error($image) );\n\t\t\t\t\t$image = path_join( dirname($attachment_url), basename($image) );\n\t\t\t\t} else {\n\t\t\t\t\t$image = $attachment_url;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$image = $attachment_url;\n\t\t\t}\n\t\t\tif (isset($image)) {\n\t\t\t\treturn $image;\n\t\t\t}\n\t\t}\n\t}", "public function getHostImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'Airhotels/Customerprofileimage/Resized';\n }", "public function getImageUrl(bool $dummy = true)\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? ( $dummy ? $this->dummy_path : null ) : '/storage/' . $this->directory . '/' . $this->owner->$link;\n }", "public function getPhotoUrl()\n\t{\n if ($about = $this->getAbout()) {\n \t$ci =& get_instance();\n $ci->load->config('dir');\n $upload_path = $ci->config->item('upload_dir');\n\n\t\t\t$path = $upload_path . 'media/' . $about->photo; \n\n if (!file_exists($path) || $about->photo == '') {\n $url = base_url().BASE_IMG . 'user-photo.jpg';\n } else {\n $url = site_url($path);\n }\n }\t\n\n return $url;\t\n\t}", "public function getImage() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('image'));\n }", "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "static function image_src( $target, $size = null ) {\n\t\tif ( isset( $_GET[ $target ] ) && ! empty( $target ) ) {\n\t\t\treturn self::get_attachment_image( $_GET[ $target ], $size );\n\t\t} else { // empty target, or no query\n\t\t\t$image = self::option( $target );\n\t\t\tif ( is_numeric( $image ) ) {\n\t\t\t\treturn self::get_attachment_image( $image, $size );\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function getImageUploadUrl()\n {\n return $this->getUrl('marketplace/product_gallery/upload', ['_secure' => $this->getRequest()->isSecure()]);\n }", "public function getImageUrl()\n {\n return $this->info->thumbnail_url ? $this->info->thumbnail_url : null;\n }", "public function getWebPicture();", "public function getImageURL() {\n\n return $this->image_url;\n }", "function wpseed_the_post_thumbnail_url($size, $postid) {\n echo wp_get_attachment_image_src( get_post_thumbnail_id($postid), $size )['0'];\n }", "function createNavigationURLSize($galleryPID, $galleryCID, $imgID, $size) {\n $typolink_conf = array(\n 'no_cache' => $this->conf['showHits'],\n 'parameter' => $GLOBALS['TSFE']->id,\n 'additionalParams' => '&tx_hldamgallery_pi1[galleryPID]=' . $galleryPID .\n '&tx_hldamgallery_pi1[galleryCID]=' . $galleryCID . '&tx_hldamgallery_pi1[imgID]=' . $imgID .\n '&tx_hldamgallery_pi1[size]=' . $size,\n 'useCacheHash' => true\n );\n\n return $this->cObj->typolink_URL($typolink_conf);\n }", "public function getAllImagesUrls() {\n $matches = [];\n preg_match_all('@src=\"([^\"]+)\"@', $this->description, $matches);\n return $matches[1];\n }", "function getUrlImg(){\n\t\treturn $this->url_img;\n\t}", "public function getProfilePhotoUrlAttribute(): string\n {\n return $this->profile_photo_path ?: $this->defaultProfilePhotoUrl();\n }", "public function getRelativeLinkToThumbnailImg($size)\n {\n return ImgUpload::getRelativeLinkToThumbnailImg($this, $size);\n }", "public function imageUrl()\n\t{\n\t\treturn \"/storage/$this->image\";\n\t}", "public function getPicAttachUrl($filename = '', $picsize = 1) {\n $_baseurl = Yii::app()->createAbsoluteUrl('/');\n $_mediabaseurl = (empty(Yii::app()->params['upload_url']) ? ($_baseurl . '/uploads') : Yii::app()->params['upload_url']) . '/attach';\n $_mediaurl = $_mediabaseurl . '/picture/';\n\n $default_picture_setting = empty(Yii::app()->params['picture_default_setting']) ? array() : Yii::app()->params['picture_default_setting'];\n if (1 == $picsize) {\n $default_pic = (isset($default_picture_setting['bigpic']) && !empty($default_picture_setting['bigpic'])) ? ($_mediabaseurl . '/' . $default_picture_setting['bigpic']) : '';\n } else {\n $default_pic = (isset($default_picture_setting['smallpic']) && !empty($default_picture_setting['smallpic'])) ? ($_mediabaseurl . '/' . $default_picture_setting['smallpic']) : '';\n }\n $file_url = empty($filename) ? '' : str_replace('\\\\', '/', $filename);\n $_media_full_url = empty($file_url) ? $default_pic : ($_mediaurl . $file_url);\n return $_media_full_url;\n }", "function get_the_attachment_link($id = 0, $fullsize = \\false, $max_dims = \\false, $permalink = \\false)\n {\n }", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function getBaseUrl()\n {\n return $this->storeManager\n ->getStore()\n ->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . '/' . self::MEDIA_PATH;\n }", "public function getPictureUrl()\n\t{\n\t\treturn 'http://local.postcard.com' . $this->getPictureUri();\n\t}", "function getPicUrl()\n\t\t{\n\t\t\treturn $this->picurl;\n\t\t}", "public static function getDestination()\n {\n return public_path() . '/img/profile_photos/';\n }", "public function getMediaUrl() {\r\n\t\treturn $this->_storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\r\n\t}", "protected function getImageUrl() {\r\n\t\treturn $this->imageUrl;\r\n\t}", "public function getCoverAttribute(): string\n {\n if ($this->hasMedia('image') && $this->relationLoaded('media') && config('filesystems.default') !== 'public') {\n return $this->getFirstTemporaryUrl(Carbon::now()->addHour(), 'image', 'sm');\n }\n\n if ($this->getFirstMediaUrl('image', 'sm')) {\n return $this->getFirstMediaUrl('image', 'sm');\n }\n\n return \\Storage::url('images/not-found.jpg');\n }", "public function getImageUrl(): string\n {\n return $this->imageUrl;\n }", "public function getPictureURL()\n {\n return $this->pictureURL;\n }", "public function getImageUrl(){\n return $this->image_url;\n }", "public function getThumbnail() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('thumbnail'));\n }", "public function getImageUrl() {\n return $this->image_url;\n\n }", "public function getImageUrl()\n {\n return (string)$this->_getImageHelper()->init($this, 'image')->resize(265);\n }", "public function getImageUrl()\n {\n return $this->image_url;\n }" ]
[ "0.6900975", "0.6864399", "0.6854328", "0.6821344", "0.6792378", "0.6719705", "0.6677021", "0.66701275", "0.6655638", "0.6609071", "0.6567192", "0.6550256", "0.6543554", "0.6543554", "0.6515873", "0.65151435", "0.65028185", "0.6491071", "0.64888716", "0.64698875", "0.6420726", "0.64103055", "0.640164", "0.63546324", "0.6318138", "0.63179016", "0.62696934", "0.62683904", "0.62593436", "0.62553495", "0.62542766", "0.6246262", "0.6228819", "0.6216311", "0.6203181", "0.6195434", "0.6192539", "0.61763865", "0.6174543", "0.61372477", "0.6135032", "0.6125083", "0.6121771", "0.6103493", "0.6098181", "0.6094473", "0.6078584", "0.6070904", "0.6066134", "0.60642034", "0.60613436", "0.60613436", "0.60582155", "0.60551447", "0.60466594", "0.6015225", "0.6009009", "0.6004953", "0.6003512", "0.6003346", "0.5985506", "0.59848535", "0.5976003", "0.5965791", "0.5965557", "0.59572595", "0.5949967", "0.5949599", "0.59421444", "0.59336627", "0.5931964", "0.59245545", "0.59191495", "0.59172344", "0.5916203", "0.5911977", "0.5900199", "0.5886939", "0.5886586", "0.5880674", "0.58799607", "0.5879654", "0.5878914", "0.587767", "0.58776337", "0.5871182", "0.5868258", "0.58662045", "0.58620816", "0.58611655", "0.5856103", "0.58536243", "0.58530885", "0.5848707", "0.5847622", "0.5845247", "0.58446586", "0.5836695", "0.58351356", "0.5822738" ]
0.687726
1
Build direct photo url without flickr API calls
public function buildPhotoUrl () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "public function getPhotoURL(){\r\n\t\t$photo = $this->getPhoto();\r\n\r\n\t\treturn $photo != null ? \"https://maps.googleapis.com/maps/api/place/photo?maxwidth=800&photoreference=\" . $photo . \"&key=\" . GOOGLE_MAPS_API_KEY_PRIVATE : null;\r\n\t}", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }", "public static function generatePhotoApiUrl($photo, $sizeType = '') {\n $farmId = $photo->farm;\n $serverId = $photo->server;\n $photoId = $photo->id;\n $secretId = $photo->secret;\n\n if ($sizeType != 'o') {\n return \"https://farm\" . $farmId . \".staticflickr.com/\" . $serverId . \"/\" . $photoId . \"_\" . $secretId . \"_\". $sizeType .\".jpg\";\n }\n\n return \"https://farm\" . $farmId . \".staticflickr.com/\" . $serverId . \"/\" . $photoId . \"_\" . $secretId . \".jpg\";\n }", "public function getPhotoUrl()\n {\n if (filter_var($this->photoUrl, FILTER_VALIDATE_URL)) {\n return $this->photoUrl;\n }\n\n if (null !== $this->photoUrl) {\n return \"/uploads/photos/$this->photoUrl\";\n }\n }", "public function getDirectUrl(): string\n {\n return $this->directUrlBase . $this->templateId . '.png?' . http_build_query($this->buildQuery());\n }", "public function getPhotoUrl()\n\t{\n if ($about = $this->getAbout()) {\n \t$ci =& get_instance();\n $ci->load->config('dir');\n $upload_path = $ci->config->item('upload_dir');\n\n\t\t\t$path = $upload_path . 'media/' . $about->photo; \n\n if (!file_exists($path) || $about->photo == '') {\n $url = base_url().BASE_IMG . 'user-photo.jpg';\n } else {\n $url = site_url($path);\n }\n }\t\n\n return $url;\t\n\t}", "public function createImgUri() {\n\t\t$this->imgUri = FLICKR_FARM;\n\t\t$this->imgUri .= $this->photo['farm'];\n\t\t$this->imgUri .= '.';\n\t\t$this->imgUri .= STATICFLICKR;\n\t\t$this->imgUri .= $this->photo['server'];\n\t\t$this->imgUri .= '/';\n\t\t$this->imgUri .= $this->photo['id'];\n\t\t$this->imgUri .= '_';\n\t \t$this->imgUri .= $this->photo['secret'];\n\t\t$this->imgUri .= '.';\n\t \t$this->imgUri .= IMGEXT;\n\t}", "public function get_member_photo_url($member)\n {\n return '';\n }", "public function getUrl()\n {\n return $this->api\n . '?method='\n . $this->getMethod()\n . '&api_key='\n . $this->getApiKey()\n . '&tags='\n . $this->getTag()\n . '&per_page='\n . $this->getPerPage()\n . '&page='\n . $this->getPage()\n . '&format='\n . $this->getFormat()\n . '&photo_id='\n . $this->getPhotoId()\n . '&nojsoncallback=1';\n }", "function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'] );\n\t\tunset( $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) )\n\t\t\treturn '';\n\n\t\treturn Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );\n\t}", "public function url()\n\t{\n\t\t$this->buildImage();\n\t\treturn $this->buildCachedFileNameUrl;\n\t}", "public function getPhotoUrl()\n\t{\n\t\treturn $this->photo_url;\n\t}", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "function photo_localurl($thumb=true){\n if ($thumb) $ext = \"\"; else $ext = \"_big\";\n if (!is_dir($this->photodir)) {\n $this->debug_scalar(\"<BR>***ERROR*** The configured image directory does not exist!<BR>\");\n return false;\n }\n $path = $this->photodir.\"nm\".$this->imdbid().\"${ext}.jpg\";\n if ( @fopen($path,\"r\")) return $this->photoroot.\"nm\".$this->imdbid().\"${ext}.jpg\";\n if (!is_writable($this->photodir)) {\n $this->debug_scalar(\"<BR>***ERROR*** The configured image directory lacks write permission!<BR>\");\n return false;\n }\n if ($this->savephoto($path,$thumb)) return $this->photoroot.\"nm\".$this->imdbid().\"${ext}.jpg\";\n return false;\n }", "public function picture_url() {\n return $this->_adaptee->user_photo(\"\", true);\n }", "function buildAuthUrl($frob ='', $key = '', $secret = '', $perms = 'delete') {\n\t\t$params = array();\n if ($frob != '') {\n $params['frob'] = $frob;\n }\n\t\tif ($key == '') {\n\t\t\t$key = $this->modx->getOption('xflickr.api_key');\n\t\t}\n\t\tif ($secret == '') {\n\t\t\t$secret = $this->modx->getOption('xflickr.api_secret');\n\t\t}\n\t\t$params['api_key'] = $key;\n\t\t$params['perms'] = $perms;\n //return 'http://flickr.com/services/auth/?'.$this->signParams($params);\n $signing = '';\n $values = array();\n ksort($params);\n foreach($params as $key => $value) {\n\t\t\t$signing .= $key . $value;\n\t\t\t$values[] = $key . '=' . urlencode($value);\n }\n $values[] = 'api_sig=' . md5($secret . $signing);\n return 'http://flickr.com/services/auth/?'.implode('&', $values);\n }", "public function getFeed()\n\t{ \n // Set a default feed.\n $feed = 'http://api.flickr.com/services/feeds/photos_public.gne'; \n \n switch ($this->get('params')->get('source'))\n {\n case 'recent_photos':\n $feed = 'http://api.flickr.com/services/feeds/photos_public.gne';\n break;\n case 'user_photos':\n if ($this->get('params')->get('flickruser')) return 'http://api.flickr.com/services/feeds/photos_public.gne?id='.$this->nameToId($this->get('params')->get('flickruser'));\n break; \n case 'group_photos':\n if ($this->get('params')->get('flickrgroup')) return 'http://api.flickr.com/services/feeds/groups_pool.gne?id='.$this->nameToId($this->get('params')->get('flickrgroup'));\n break; \n case 'friends_photos':\n if ($this->get('params')->get('flickruser')) return 'http://api.flickr.com/services/feeds/photos_friends.gne?user_id='.$this->nameToId($this->get('params')->get('flickruser'));\n break; \n case 'keyword_photos':\n if ($this->get('params')->get('keywords')) return 'http://api.flickr.com/services/feeds/photos_public.gne?tags='.$this->get('params')->get('keywords');\n break;\n case 'set_photos':\n if ($this->get('params')->get('flickrset')) return 'http://api.flickr.com/services/feeds/photoset.gne?set='.$this->get('params')->get('flickrset').'&nsid='.$this->nameToId($this->get('params')->get('flickruser'));\n break; \n }\n \n return $feed;\n\t}", "public function getPhotoUrlAttribute()\n {\n return asset(env('FRONTEND_IMAGES_PATH') . $this->image);\n }", "public function build_pixel_url() {\n\t\tif ( $this->error ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$args = get_object_vars( $this );\n\n\t\t// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.\n\t\tunset( $args['_rt'], $args['_'] );\n\n\t\t$validated = self::validate_and_sanitize( $args );\n\n\t\tif ( is_wp_error( $validated ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn esc_url_raw( WC_Tracks_Client::PIXEL . '?' . http_build_query( $validated ) );\n\t}", "public function getPhotoLinkAttribute()\n {\n return $this->attributes['photo_link'] = ($this->photo)?Storage::disk('public')->url($this->photo):config('values.noPhoto');\n }", "public function buildFrontendUri() {}", "function _adRenderBuildImageUrlPrefix()\n{\n $conf = $GLOBALS['_MAX']['CONF'];\n return $GLOBALS['_MAX']['SSL_REQUEST'] ? 'https://' . $conf['webpath']['imagesSSL'] : 'http://' . $conf['webpath']['images'];\n}", "function cpo_image_url( $id, $size = 'full' ) {\n\t$url = '';\n\tif ( is_numeric( $id ) ) {\n\t\t$url = wp_get_attachment_image_src( $id, $size );\n\t\t$url = $url[0];\n\t} else {\n\t\t$url = $id;\n\t}\n\n\treturn $url;\n}", "public function getProfilePhotoUrlAttribute(): string\n {\n return $this->profile_photo_path && $this->photoExists()\n ? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)\n : $this->filamentDefaultAvatar();\n }", "public function getThumbnailUrl();", "function constructURL($object);", "public function resolveThumbnailUrl();", "public function getPictureUrl()\n\t{\n\t\treturn 'http://local.postcard.com' . $this->getPictureUri();\n\t}", "public function getPhotoUrlAttribute()\n {\n return 'https://www.gravatar.com/avatar/' . md5(strtolower($this->email)) . '.jpg?s=200&d=mm';\n }", "abstract public function getUri();", "public function getImageUrl() \n {\n // return a default image placeholder if your source avatar is not found\n $imagen = isset($this->imagen) ? $this->imagen : 'default_product.jpg';\n return Url::to('@web/img/producto/'). $imagen;\n }", "public function getPhotoUrlAttribute()\n {\n return data_get($this, 'photo.s3url', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/parcels/medium.png');\n }", "public function nextGetUrlAttribute()\n {\n $photoUrl = explode('/', $this->file_name);\n $photoUrl[0] = '/storage';\n $photoUrl = implode('/', $photoUrl);\n\n return $photoUrl;\n }", "function get_photo($filename, $path, $type = '') {\n if ($type != '') {\n $path .= $type . \"/\";\n }\n\n if (!empty($filename)) {\n if (!file_exists($path . $filename)) {\n return base_url($path . 'nophoto.jpg');\n } else {\n return base_url($path . $filename);\n }\n } else {\n return base_url($path . 'nophoto.jpg');\n }\n }", "public function getFullAvatarUrl() {\n return $this->imageUrl . '_full.jpg';\n }", "function elgg_http_build_url(array $parts) {\n\t// build only what's given to us.\n\t$scheme = isset($parts['scheme']) ? \"{$parts['scheme']}://\" : '';\n\t$host = isset($parts['host']) ? \"{$parts['host']}\" : '';\n\t$port = isset($parts['port']) ? \":{$parts['port']}\" : '';\n\t$path = isset($parts['path']) ? \"{$parts['path']}\" : '';\n\t$query = isset($parts['query']) ? \"?{$parts['query']}\" : '';\n\n\t$string = $scheme . $host . $port . $path . $query;\n\n\treturn $string;\n}", "private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }", "public function niceUrl()\n {\n return '/' . $this->recipe_id . '/' . $this->url;\n }", "public static function main() {\n\t\t$page = file_get_html('http://photography.nationalgeographic.com/photography/photo-of-the-day/nature-weather/');\n\t\t$link = $page->find('#search_results', 0)->find('a', 0)->href;\n\n\t\t$page = file_get_html('http://photography.nationalgeographic.com'.$link);\n\t\t$img = $page->find('meta[property=og:image]', 0)->content;\n\t\treturn $img;\n\t}", "private function _buildUrl() {\n $url = OPENDIGI_API_ENDPOINT;\n $url .= '?Vcollection=' . implode('+', $this->_collections);\n if ($this->_languages)\n $url .= '&Vlanguages=' . implode('+', $this->_languages);\n if ($this->_subjectIds)\n $url .= '&Vsubjectids=' . implode('+', $this->_subjectIds);\n\n return $url;\n }", "public function renderUri();", "public function getThumbnailUrl()\n\t{\n if ($about = $this->getAbout()) {\n \t$ci =& get_instance();\n $ci->load->config('dir');\n $upload_path = $ci->config->item('upload_dir');\n\n\t\t\t$path = $upload_path . 'media/thumbnails/' . $about->photo; \n\n if (!file_exists($path) || $about->photo == '') {\n $url = base_url().BASE_IMG . 'user-photo.jpg';\n } else {\n $url = site_url($path);\n }\n }\t\n\n return $url;\n\t}", "function imageUrl($property, $size = null);", "public function renderUri() {\n\t\tif ($this->isThumbnailPossible($this->getFile()->getExtension())) {\n\t\t\t$this->processedFile = $this->getFile()->process($this->getProcessingType(), $this->getConfiguration());\n\t\t\t$result = $this->processedFile->getPublicUrl(TRUE);\n\n\t\t\t// Update time stamp of processed image at this stage. This is needed for the browser to get new version of the thumbnail.\n\t\t\tif ($this->processedFile->getProperty('originalfilesha1') != $this->getFile()->getProperty('sha1')) {\n\t\t\t\t$this->processedFile->updateProperties(array('tstamp' => $this->getFile()->getProperty('tstamp')));\n\t\t\t}\n\t\t} else {\n\t\t\t$result = $this->getIcon($this->getFile()->getExtension());\n\t\t}\n\t\treturn $result;\n\t}", "public function Photo(){\n\t\t$photoId = \"491634914183411\";\n\t\t$imgInfo \t\t\t= 'https://graph.facebook.com/'.$photoId.'?access_token='.$this->session->userdata('oauth_token');\n\t\techo $imgInfo;\n\t}", "public function photoURL($ID) {\n\t\t\t\t$image = File::get_by_id($ID);\n\t\t\t\t$url = $image->getAbsoluteURL();\n\t\t\t\treturn $url;\n\t\t}", "abstract public function buildUri($options);", "public function getMirrorUrl() {}", "public function getProfilePhotoUrlAttribute(): string\n {\n return $this->profile_photo_path ?: $this->defaultProfilePhotoUrl();\n }", "function getProfileUrl($username, $full = false) {\n $url = \"https://my-secondlife.s3.amazonaws.com/users/\".strtolower($username).\"/\".($full ? \"\" : \"thumb_\").\"sl_image.png\";\n if(curl($url) !== false)\n {\n return $url;\n }\n else\n {\n return \"/static4/images/avatar.jpg\";\n }\n}", "public function getProfilePhotoUrlAttribute()\n {\n return $this->profile_photo_path\n ? Storage::disk($this->profilePhotoDisk())->url($this->profile_photo_path)\n : $this->defaultProfilePhotoUrl();\n }", "function photoURL() {\n \n\n $url = \"http://www3.nd.edu/~at/campus-map/objimgs/object-\" . select_value() . \".jpg\"; \n\n\n //need to turn off warnings temporialy (want to suppress url not found warning)\n $error_reporting = ini_get('error_reporting');\n error_reporting($error_reporting & ~E_WARNING);\n $result = file_get_contents($url, FILE_BINARY, NULL, 0, 100);\n error_reporting($error_reporting);\n \n \n if($result) {\n return $url;\n } else {\n return \"\";\n }\n}", "public function getPhotoUrls () {\n\t\t\n\t}", "protected function defaultProfilePhotoUrl(): string\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=7F9CF5&background=EBF4FF';\n }", "public function getImageUrl();", "function http_build_url($url = null, $parts = null, $flags = null, ?array &$new_url = null) {}", "public function getPhotoUrlAttribute($value)\n {\n return empty($value)\n ? 'https://www.gravatar.com/avatar/'.md5($this->name.'@spark.laravel.com').'.jpg?s=200&d=identicon'\n : url($value);\n }", "public function get_image_link()\n {\n }", "public function get_image_url()\n {\n }", "public abstract function getURL();", "public function getPhotoAttribute()\n {\n if ($this->photo_file_id) {\n return Drive::previewUrl($this->photo_file_id);\n }\n return '';\n }", "public function getUri() {}", "public function getUri() {}", "public function getUri();", "public function getUri();", "public function getUri();", "public function getUri();", "public function getSignedUrl(): string\n {\n $query = base64_encode(json_encode($this->buildQuery()));\n $signature = hash_hmac('sha256', $this->templateId . $query, $this->token);\n\n return $this->signedUrlBase . $this->templateId . '.png?' . http_build_query(['s' => $signature, 'v' => $query]);\n }", "public function getQueryUrl($incomingUri = null)\n {\n $uri = Zend_Gdata_Photos::PICASA_BASE_URI;\n\n if ($this->getType() !== null) {\n $uri .= '/' . $this->getType();\n } else {\n require_once 'Zend/Gdata/App/InvalidArgumentException.php';\n throw new Zend_Gdata_App_InvalidArgumentException(\n 'Type must be feed or entry, not null');\n }\n\n if ($this->getProjection() !== null) {\n $uri .= '/' . $this->getProjection();\n } else {\n require_once 'Zend/Gdata/App/InvalidArgumentException.php';\n throw new Zend_Gdata_App_InvalidArgumentException(\n 'Projection must not be null');\n }\n\n if ($this->getUser() !== null) {\n $uri .= '/user/' . $this->getUser();\n } else {\n // Should never occur due to setter behavior\n require_once 'Zend/Gdata/App/InvalidArgumentException.php';\n throw new Zend_Gdata_App_InvalidArgumentException(\n 'User must not be null');\n }\n\n $uri .= $incomingUri;\n $uri .= $this->getQueryString();\n return $uri;\n }", "public function getURL ();", "abstract public function getPublicUrl(): string;", "public function getPictureUri()\n\t{\n\t\treturn '/uploads/postcards/' . $this->picture;\n\t}", "public function getPhotoURI($photo_uid, $conf) {\r\n\t\t// Assemble URI\r\n\t\t$photo = tx_cwtcommunity_lib_common::dbQuery('SELECT filename FROM tx_cwtcommunity_photos WHERE uid = \"'.intval($photo_uid).'\" AND NOT deleted = \"1\" AND NOT hidden = 1;');\r\n\t\t$uri = $conf['album.']['photo.']['storageFolder'].$photo[0]['filename'];\r\n\t\treturn $uri;\r\n\t}", "function superimg_url($location, $width = 'auto', $height = 'auto') {\n return base_url('img?path=' . $location . '&width=' . $width . '&height=' . $height);\n }", "public function get_url();", "protected function defaultProfilePhotoUrl()\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=252f3f&background=EBF4FF';\n }", "public function getPictureUrl()\n {\n return $this->getImageurl();\n }", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "function get_display_photo(){\n\t$display_photo = get_profile( 'photo' );\n\tif ( empty($display_photo) || !file_exists(abspath('/contents/images/profile/'.$display_photo)) )\n\t\treturn false;\n\n\treturn get_image_link( \"/images/profile/$display_photo\", \"default\" );\n}", "abstract protected function buildSpecificRequestUri();", "public function getUrl()\n\t{\n\t\treturn '/images/blog/' . $this->name;\n\t}", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "public function uri();", "public function uri();", "public function uri();", "abstract protected function getUri(): string;", "function rip_flickr_data($record)\n{ \n $lics = flickr_get_licenses();\n // echo '<pre>'; print_r($lics); die();\n \n $title = $record['title'];\n $license = $lics[$record['license']];\n \n // echo '<pre>';print_r($license); die();\n \n $description = '';\n $sizes = flickr_request('flickr.photos.getSizes', array('photo_id' => $record['id']));\n $sizes = $sizes['sizes'];\n $thumbs = array(); // w:h => array( file, file, file)\n $largest = array(0,'', 0, 0); \n $smallest = array(3000*3000,'', 3000, 3000); // Ok, hacky, sosumi\n \n foreach($sizes['size'] as $thumb) \n {\n if($thumb['label'] == 'Square') continue; // These are a little smaller than default\n if(!isset($thumbs[\"{$thumb['width']}x{$thumb['height']}\"]))\n {\n $thumbs[\"{$thumb['width']}x{$thumb['height']}\"] = array();\n \n if(($thumb['width'] * $thumb['height']) > $largest[0])\n $largest = array($thumb['width'] * $thumb['height'], $thumb['width'] . 'x' . $thumb['height'], $thumb['width'] , $thumb['height']);\n \n if(($thumb['width'] * $thumb['height']) < $smallest[0])\n $smallest = array($thumb['width'] * $thumb['height'], $thumb['width'] . 'x' . $thumb['height'], $thumb['width'] , $thumb['height']);\n }\n $thumbs[\"{$thumb['width']}x{$thumb['height']}\"][] = $thumb;\n \n }\n\n // Find the main image link\n $mainImage = $thumbs[$largest[1]];\n $mainImage = array_pop($mainImage);\n \n // Find the thumb image link\n $thumbImage = $thumbs[$smallest[1]];\n $thumbImage = array_pop($thumbImage);\n \n // Final image to pass to manager (use query param to record the embed url)\n $combinedImage = $mainImage['source'] . \n '?x-flickr-photo='.rawurlencode($record['id']) .\n '&x-lic='.rawurlencode($license['x-id']) .\n '&x-uid='.rawurlencode($record['owner']) . \n '&x-by='.rawurlencode($record['ownername']) . \n '&x-tn='.rawurlencode($thumbImage['source']);\n \n \n return array\n (\n 'title' => $title,\n 'description' => $description,\n 'dimensions' => \"{$mainImage['width']}x{$mainImage['height']}\",\n 'license' => $license,\n 'mainImage' => $mainImage['source'],\n 'thumbImage' => $thumbImage['source'],\n 'combinedImage' => $combinedImage,\n \n 'smallest' => $smallest,\n 'largest' => $largest,\n 'thumbs' => $thumbs, \n );\n}", "function photonfill_get_url_image( $img_url, $img_size, $attr = array() ) {\n\treturn Photonfill()->get_url_image( $img_url, $img_size, $attr );\n}", "function getPicUrl()\n\t\t{\n\t\t\treturn $this->picurl;\n\t\t}", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "function buildPath($entity, $options = array()) {\n return file_create_url($entity->uri);\n }", "function getImageUrl($url)\r\n {\r\n if (substr_count($url, 'http://') or substr_count($url, 'https://')) {\r\n //\r\n } else {\r\n $page = $this->currentUrl;\r\n if ($this->baseHrefs[$page]) {\r\n $page = rtrim($this->baseHrefs[$page], '/');\r\n }\r\n else {\r\n $page = dirname($page);\r\n }\r\n if (!substr_count($url, '/')) return $page . '/' . $url;\r\n $page = 'http://' . parse_url($page, PHP_URL_HOST);\r\n $url = $page . '/' . ltrim($url, '/');\r\n }\r\n $url = html_entity_decode($url);\r\n $url = str_replace(' ', '%20', $url);\r\n return $url;\r\n }", "function _http_build_url($parts) { \n return implode(\"\", array(\n isset($parts['scheme']) ? $parts['scheme'] . '://' : '',\n isset($parts['user']) ? $parts['user'] : '',\n isset($parts['pass']) ? ':' . $parts['pass'] : '',\n (isset($parts['user']) || isset($parts['pass'])) ? \"@\" : '',\n isset($parts['host']) ? $parts['host'] : '',\n isset($parts['port']) ? ':' . intval($parts['port']) : '',\n isset($parts['path']) ? $parts['path'] : '',\n isset($parts['query']) ? '?' . $parts['query'] : '',\n isset($parts['fragment']) ? '#' . $parts['fragment'] : ''\n ));\n}", "public function to_url() {\n $post_data = $this->to_postdata();\n $out = $this->get_normalized_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n return $out;\n }", "public function getURL();", "public function getURL();", "protected function _getUrl()\n {\n $url = false;\n if ($this->getValue()) {\n $url = $this->_imageModel->getBaseUrl().$this->getValue();\n }\n return $url;\n }", "public function getUrlAttribute(){\n if(substr($this->image,0,4)=== \"http\"){\n return $this->image;\n }\n //o si viene de la carpeta public\n return '/images/products/' . $this->image;\n }" ]
[ "0.7149396", "0.6715539", "0.6649939", "0.6552892", "0.6546769", "0.6533244", "0.6471729", "0.6382621", "0.63429135", "0.61817056", "0.615139", "0.6149372", "0.61065555", "0.6072044", "0.59625787", "0.59556365", "0.588957", "0.58646643", "0.5818456", "0.5807909", "0.58042216", "0.57794523", "0.577118", "0.57632667", "0.5755448", "0.57500035", "0.57442373", "0.5721909", "0.5715467", "0.5714762", "0.5713997", "0.5713987", "0.57106715", "0.5705891", "0.57028466", "0.5694729", "0.56913954", "0.5688016", "0.5670064", "0.56634617", "0.5658709", "0.56469345", "0.5642817", "0.56415623", "0.5637085", "0.5634574", "0.5626506", "0.5619599", "0.56178385", "0.56104535", "0.55907404", "0.5587388", "0.55851763", "0.55839974", "0.557923", "0.5577488", "0.5575361", "0.5544713", "0.5543961", "0.55391145", "0.55388767", "0.55363894", "0.55183214", "0.5510007", "0.5510007", "0.5509124", "0.5509124", "0.5509124", "0.5509124", "0.55047256", "0.54998034", "0.5494007", "0.54852724", "0.5480068", "0.54783434", "0.5474198", "0.5468429", "0.54672354", "0.5465156", "0.54618853", "0.5456484", "0.5456404", "0.54545355", "0.54533464", "0.5453322", "0.5453322", "0.5453322", "0.5452395", "0.5449292", "0.5448838", "0.544717", "0.5431883", "0.5429001", "0.5427162", "0.542714", "0.54234815", "0.54225105", "0.54225105", "0.5421221", "0.5417018" ]
0.76183903
0
Returns the chunk content
public function getChunk($defaultName, $name = NULL) { if ($name) { $chunk = $this->modx->getObject('modChunk', array('name' => $name)); if ($chunk) { return $chunk; } } $f = file_get_contents($this->config['chunks_path'].$defaultName.'.chunk.tpl'); $chunk = $this->modx->newObject('modChunk'); $chunk->setContent($f); return $chunk; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function content() {\n try {\n $r= '';\n while ($this->stream->available()) {\n $r.= $this->stream->read();\n }\n return $r;\n } finally {\n $this->stream->close();\n }\n }", "public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}", "public function get_content() {\n $event = Event::factory('response.get_content', array('content' => $this->_content))->notify_all();\n $data = $event->get_data();\n return $data['content'];\n }", "protected function getContent() {\n return $this->content;\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function get_content()\n\t\t{\n\t\t\tif (!$this->is_cached()) {\n\t\t\t\t$this->load();\n\t\t\t}\n\n\t\t\treturn $this->content;\n\t\t}", "public function getContent () {\r\n\t\treturn $this->content;\r\n\t}", "public function content()\n {\n return $this->cache->get('content');\n }", "public function get_content() {\n // Check if no content is yet loaded\n if (empty($this->content)) {\n $this->content = @file_get_contents($this->name);\n }\n\n return $this->content;\n }", "public function getContent()\r\n {\r\n return $this->_content;\r\n }", "public static function getContent() {\n\t\treturn self::$_content;\n\t}", "public function getContent()\n {\n return $this->_content;\n }", "public function getContent() {\r\n\t\treturn $this->content;\r\n\t}", "public function contents() { return $this->_m_contents; }", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent()\n {\n \t$content = $this->content;\n return $content;\n }", "public function get_content() {\n return $this->content;\n }", "public function getContent()\n\t{\n\t\treturn $this->_content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->_content;\n\t}", "public function getContent()\n {\n return file_get_contents($this->fullPath);\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content_;\n\t}", "public function getContent() {\n return $this->content;\n }", "public function getContent()\r\n {\r\n return $this->content;\r\n }", "public function getContent(){\n\t\treturn $this->content;\n\t}", "public function getContent() { return $this->content; }", "public function getContent()\n {\n return $this->content;\n }", "public function content()\n {\n return base64_decode(chunk_split($this->content));\n }", "function get_content() {\r\n\t\treturn $this->content;\r\n\t}", "public function readerGetContent();", "public function content()\n {\n return $this->content;\n }", "public function content()\n {\n return $this->content;\n }", "public function content()\n {\n return $this->content;\n }", "public function getContents() : string {\n\n\t\t\tif (!$this->enabled) return '';\n\n\t\t\t# Lock the block\n\n\t\t\t$this->enabled = false;\n\n\t\t\t# Generate contents\n\n\t\t\t$contents = ((0 === $this->count) ? $this->buildContents() : parent::getContents());\n\n\t\t\t# Unlock the block\n\n\t\t\t$this->enabled = true;\n\n\t\t\t# ------------------------\n\n\t\t\treturn $contents;\n\t\t}", "function getContent()\n {\n return $this->content;\n }", "function getContent()\n {\n return $this->content;\n }", "public function getContent()\n\t{\n\t\treturn $this->output;\n\t}", "public function getContent()\n {\n return $this->data;\n }", "public function getContent(){\n\t\treturn $this->content? $this->content:$this->content = file_get_contents($this->getFullName());\n\t}", "public function getContent(): string\n {\n return $this->_content;\n }", "function getContent()\n {\n return $this->content;\n\n }", "public function getRawContent();", "public function getContent()\n\t\t\t{\n\t\t\t\tif($this->exist)\n\t\t\t\t\treturn file_get_contents($this->path);\n\t\t\t\telse\n\t\t\t\t\treturn '';\n\t\t\t}", "public function getContent() : string {\n return $this->content;\n }", "public function getContent() {\n if (empty($this->content)) {\n $this->refreshContent();\n }\n\n return $this->content;\n }", "protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }", "public function getContent() {\n $content = '';\n\n if (Crypter::isCrypted($this->content)) {\n $content = Crypter::decrypt($this->content);\n }\n\n return $this->getExtractedContent($content);\n }", "public function contents()\n\t{\n\t\treturn $this->contents;\n\t}", "public function getContent(): string\n {\n return $this->content;\n }", "public function getContent(): string\n {\n return $this->content;\n }", "public function getContent(): string\n {\n return $this->content;\n }", "public function getContent(): string\n {\n return $this->content->content();\n }", "public function getContent() : string\n {\n return $this->content;\n }", "public function getContent() : string\n {\n return $this->content;\n }", "public function getContents()\n {\n $this->load();\n\n return $this->_contents;\n }", "public function Content()\n {\n return $this->content;\n }", "public function getContents() \r\n { \r\n return $this->_contents; \r\n }", "function GetContent () {\n return unserialize(base64_decode($this->hunt_content));\n }", "private function getContent()\n {\n return file_get_contents($this->category_dir.'/'.$this->htmlfile);\n }", "public function get_content()\n {\n extract($this->_keystore);\n ob_start();\n include($this->_file);\n return ob_get_clean();\n }", "public function getContent() {\n\t\treturn $this->current_content;\n\t}", "public function getContents() {\n return substr($this->data, 0, $this->getPayloadStartingByte() + $this->getPayloadLength());\n }", "public function getContents()\n {\n return $this->contents;\n }", "public function getContents()\n {\n return $this->contents;\n }", "private function fetchContents()\n {\n return $this->response->getBody()->getContents();\n }", "public function getContents(): string\n {\n return $this->contents;\n }", "public function getContents(): string\n {\n return $this->contents;\n }", "public function getContent()\n {\n if (!$this->retrieved && !$this->new) {\n $this->retrieve();\n }\n\n return $this->content;\n }", "public function getPageContent(): string {\n\t\treturn $this->m_pageContent;\n\t}", "public function content(): string\n {\n return $this->content;\n }", "public function getParsedContent()\n {\n return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId() );\n }", "public function getContent()\r\n\t{\r\n\t\t$return = $this->response !== false ? preg_replace('#.+(\\r\\n){2}(.+)$#s', '$2', $this->response) : false;\r\n\t\treturn $return;\r\n\t}", "public function getContentStream();" ]
[ "0.77114546", "0.7452064", "0.7445931", "0.73306036", "0.7322471", "0.7322471", "0.7322471", "0.7321249", "0.72998476", "0.729178", "0.7278118", "0.7262273", "0.72586125", "0.7256545", "0.72562456", "0.7251071", "0.72353387", "0.72353387", "0.72353387", "0.7228052", "0.7222237", "0.7221937", "0.7221937", "0.72204506", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7188981", "0.7185091", "0.7185091", "0.7185091", "0.7179181", "0.71748406", "0.71683604", "0.71588653", "0.715714", "0.7156348", "0.71460384", "0.71396786", "0.7109358", "0.71083236", "0.71083236", "0.71083236", "0.7093629", "0.7092789", "0.7092789", "0.7075288", "0.7062976", "0.7034522", "0.7023479", "0.70233583", "0.69806796", "0.6978351", "0.6968965", "0.69684994", "0.6944452", "0.69413203", "0.69391924", "0.6925338", "0.6925338", "0.6925338", "0.6914533", "0.6909961", "0.6909961", "0.6909252", "0.690281", "0.6899039", "0.68933105", "0.68752724", "0.68643147", "0.6856282", "0.6856245", "0.6841657", "0.6841657", "0.68325496", "0.68259245", "0.68259245", "0.6804411", "0.67874414", "0.6783292", "0.67820334", "0.6781756", "0.67538476" ]
0.0
-1
Builds simple pagination markup. Not yet used. TODO: add tpl configurability to li/a tags.
public function buildPagination($count,$limit,$start,$url) { $pageCount = $count / $limit; $curPage = $start / $limit; $pages = ''; for ($i=0;$i<$pageCount;$i++) { $newStart = $i*$limit; $u = $url.'&start='.$newStart.'&limit='.$limit; if ($i != $curPage) { $pages .= '<li class="page-number"><a href="'.$u.'">'.($i+1).'</a></li>'; } else { $pages .= '<li class="page-number pgCurrent">'.($i+1).'</li>'; } } return $this->getChunk('xflickrPagination',array( 'xflickr.pages' => $pages, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildPagination() {}", "protected function buildPagination() {}", "function pagination($currentPage, $itemCount, $itemsPerPage, $adjacentCount, $pageLinkTemplate, $showPrevNext = true) {\n $firstPage = 1;\n $lastPage = ceil($itemCount / $itemsPerPage);\n if ($lastPage <= 1) {\n return;\n }\n if ($currentPage <= $adjacentCount + $adjacentCount) {\n $firstAdjacentPage = $firstPage;\n $lastAdjacentPage = min($firstPage + $adjacentCount + $adjacentCount, $lastPage);\n } elseif ($currentPage > $lastPage - $adjacentCount - $adjacentCount) {\n $lastAdjacentPage = $lastPage;\n $firstAdjacentPage = $lastPage - $adjacentCount - $adjacentCount;\n } else {\n $firstAdjacentPage = $currentPage - $adjacentCount;\n $lastAdjacentPage = $currentPage + $adjacentCount;\n }\n echo '<ul class = \"pagination\">';\n if ($showPrevNext) {\n echo '<li>';\n if ($currentPage == $firstPage) {\n echo '<a class=\"inactive_link\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>';\n } else {\n echo '<a href=\"' . (is_callable($pageLinkTemplate) ? $pageLinkTemplate($currentPage - 1) : sprintf($pageLinkTemplate, $currentPage - 1)) . '\"><span class=\"glyphicon glyphicon-chevron-left\"></span></a>';\n }\n echo '</li>';\n }\n if ($firstAdjacentPage > $firstPage) {\n echo '<li>';\n echo '<a href=\"' . (is_callable($pageLinkTemplate) ? $pageLinkTemplate($firstPage) : sprintf($pageLinkTemplate, $firstPage)) . '\">' . $firstPage . '</a>';\n if ($firstAdjacentPage > $firstPage + 1) {\n echo '<a class=\"inactive_link\" id=\"ellipsis1\">...</a>';\n }\n echo '</li>';\n }\n for ($i = $firstAdjacentPage; $i <= $lastAdjacentPage; $i++) {\n if ($currentPage == $i) {\n echo '<li class=\"chosen_link\"><a class=\"inactive_link\"><span>' . $i . '</span></a></li>';\n } else {\n echo '<li><a href=\"' . (is_callable($pageLinkTemplate) ? $pageLinkTemplate($i) : sprintf($pageLinkTemplate, $i)) . '\">' . $i . '</a></li>';\n }\n }\n if ($lastAdjacentPage < $lastPage) {\n echo '<li>';\n if ($lastAdjacentPage < $lastPage - 1) {\n echo '<a class=\"inactive_link\" id=\"ellipsis2\">...</a>';\n }\n echo '<a href=\"' . (is_callable($pageLinkTemplate) ? $pageLinkTemplate($lastPage) : sprintf($pageLinkTemplate, $lastPage)) . '\">' . $lastPage . '</a>';\n echo '</li>';\n }\n if ($showPrevNext) {\n echo '<li>';\n if ($currentPage == $lastPage) {\n echo '<a class=\"inactive_link\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>';\n } else {\n echo '<a href=\"' . (is_callable($pageLinkTemplate) ? $pageLinkTemplate($currentPage + 1) : sprintf($pageLinkTemplate, $currentPage + 1)) . '\"><span class=\"glyphicon glyphicon-chevron-right\"></span></a>';\n }\n echo '</li>';\n }\n echo '</ul>';\n}", "function create_links()\n\t{\n\t\t$totalItems = $this->total_records;\n\t\t$perPage = $this->size;\n\t\t$currentPage = $this->page;\n\t\t$link = $this->link;\n\t\t$totalPages = floor($totalItems / $perPage);\n\t\t$totalPages += ($totalItems % $perPage != 0) ? 1 : 0;\n\n\t\tif ($totalPages < 1 || $totalPages == 1){\n\t\t\treturn null;\n\t\t}\n\n\t\t$output = null;\t\t\t\t\n\t\t$loopStart = 1; \n\t\t$loopEnd = $totalPages;\n\n\t\tif ($totalPages > 5)\n\t\t{\n\t\t\tif ($currentPage <= 3)\n\t\t\t{\n\t\t\t\t$loopStart = 1;\n\t\t\t\t$loopEnd = 5;\n\t\t\t}\n\t\t\telse if ($currentPage >= $totalPages - 2)\n\t\t\t{\n\t\t\t\t$loopStart = $totalPages - 4;\n\t\t\t\t$loopEnd = $totalPages;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$loopStart = $currentPage - 2;\n\t\t\t\t$loopEnd = $currentPage + 2;\n\t\t\t}\n\t\t}\n\n\t\tif ($loopStart != 1){\n\t\t\t$output .= sprintf('<li class=\"disabledpage\"> <a href=\"' . $link . '\">&#171;</a> </li>', '1');\n\t\t}\n\t\t\n\t\tif ($currentPage > 1){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">'._previous_.'</a> </li>', $currentPage - 1);\n\t\t}\n\t\t\n\t\tfor ($i = $loopStart; $i <= $loopEnd; $i++)\n\t\t{\n\t\t\tif ($i == $currentPage){\n\t\t\t\t$output .= '<li class=\"currentpage\">' . $i . '</li> ';\n\t\t\t} else {\n\t\t\t\t$output .= sprintf('<li><a href=\"' . $link . '\">', $i) . $i . '</a> </li> ';\n\t\t\t}\n\t\t}\n\n\t\tif ($currentPage < $totalPages){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">'._next_.'</a> </li>', $currentPage + 1);\n\t\t}\n\t\t\n\t\tif ($loopEnd != $totalPages){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">&#187;</a> </li>', $totalPages);\n\t\t}\n\n\t\treturn '<div class=\"pagination\"><ul>' . $output . '</ul></div>';\n\t}", "private function compilePager() {\n \t\n \t\n \t$this->_tmp_page = '<p '.$this->_config['css_page'].'>';\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].'1\">'.$this->_config['first'].'</a>';\n \t}\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] - 1).'\">'.$this->_config['previous'].'</a>';\n \t}\n \t\n \tif ($this->_all_page <= $this->_config['scr_page']) {\n \tif($this->_config['all_recs'] <= $this->_config['per_page']) {\n \t$this->_start = 1;\n $this->_stop = $this->_all_page;\n } else {\n \t\t$this->_start = 1;\n $this->_stop = $this->_all_page;\n }\n } else {\n \tif($this->_config['cur_page'] < intval($this->_config['scr_page'] / 2) + 1) {\n\t $this->_start = 1; \n\t \t$this->_stop = $this->_config['scr_page'];\n } else {\n \t$this->_start = $this->_config['cur_page'] - intval($this->_config['scr_page'] / 2);\n $this->_stop = $this->_config['cur_page'] + intval($this->_config['scr_page'] / 2);\n if($this->_stop > $this->_all_page) $this->_stop = $this->_all_page;\n }\n }\n if ($this->_all_page > 1) {\n\t for ($i = $this->_start; $i <= $this->_stop; $i++) {\n\t \tif ($i == $this->_config['cur_page']) {\n\t \t$this->_tmp_page .= '<span '.$this->_config['act_page'].'>'.$i.'</span>';\n\t } else {\n\t $this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$i.'\">'.$i.'</a>';\n\t }\n\t }\n }\n \n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] + 1).'\">'.$this->_config['next'].'</a>';\n \t}\n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$this->_all_page.'\">'.$this->_config['last'].'</a>';\n \t}\n \treturn $this->_tmp_page.'</p>';\n }", "function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')\n{\n\tglobal $template, $user;\n\n\t// Make sure $per_page is a valid value\n\t$per_page = ($per_page <= 0) ? 1 : $per_page;\n\n\t$seperator = '<span class=\"page-sep\">' . $user->lang['COMMA_SEPARATOR'] . '</span>';\n\t$total_pages = ceil($num_items / $per_page);\n\n\tif ($total_pages == 1 || !$num_items)\n\t{\n\t\treturn false;\n\t}\n\n\t$on_page = floor($start_item / $per_page) + 1;\n\t$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');\n\n\t$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href=\"' . $base_url . '\">1</a>';\n\n\tif ($total_pages > 5)\n\t{\n\t\t$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);\n\t\t$end_cnt = max(min($total_pages, $on_page + 4), 6);\n\n\t\t$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;\n\n\t\tfor ($i = $start_cnt + 1; $i < $end_cnt; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $end_cnt - 1)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\n\t\t$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;\n\t}\n\telse\n\t{\n\t\t$page_string .= $seperator;\n\n\t\tfor ($i = 2; $i < $total_pages; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $total_pages)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\t}\n\n\t$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($total_pages - 1) * $per_page) . '\">' . $total_pages . '</a>';\n\n\tif ($add_prevnext_text)\n\t{\n\t\tif ($on_page != 1)\n\t\t{\n\t\t\t$page_string = '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page) . '\">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;\n\t\t}\n\n\t\tif ($on_page != $total_pages)\n\t\t{\n\t\t\t$page_string .= '&nbsp;&nbsp;<a href=\"' . $base_url . \"{$url_delim}start=\" . ($on_page * $per_page) . '\">' . $user->lang['NEXT'] . '</a>';\n\t\t}\n\t}\n\n\t$template->assign_vars(array(\n\t\t$tpl_prefix . 'BASE_URL'\t\t=> $base_url,\n\t\t'A_' . $tpl_prefix . 'BASE_URL'\t=> addslashes($base_url),\n\t\t$tpl_prefix . 'PER_PAGE'\t\t=> $per_page,\n\n\t\t$tpl_prefix . 'PREVIOUS_PAGE'\t=> ($on_page == 1) ? '' : $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page),\n\t\t$tpl_prefix . 'NEXT_PAGE'\t\t=> ($on_page == $total_pages) ? '' : $base_url . \"{$url_delim}start=\" . ($on_page * $per_page),\n\t\t$tpl_prefix . 'TOTAL_PAGES'\t\t=> $total_pages,\n\t));\n\n\treturn $page_string;\n}", "function generate_pagination($url, $items, $per_page, $start, $start_variable='start'){\r\n global $eqdkp_root_path, $user;\r\n\r\n $uri_symbol = ( strpos($url, '?') ) ? '&amp;' : '?';\r\n\t\t//On what page we are?\r\n\t\t$recent_page = (int)floor($start / $per_page) + 1;\r\n\t\t//Calculate total pages\r\n\t\t$total_pages = ceil($items / $per_page);\r\n\t\t//Return if we don't have at least 2 Pages\r\n\t\tif (!$items || $total_pages < 2){\r\n return '';\r\n }\r\n\r\n\t\t//First Page\r\n $pagination = '<div class=\"pagination\">';\r\n\t\tif ($recent_page == 1){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">1</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol . $start_variable.'='.( ($recent_page - 2) * $per_page).'\" title=\"'.$user->lang['previous_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/left_arrow.png\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"'.$url.'\" class=\"pagination\">1</a>';\r\n\t\t}\r\n\r\n\t\t//If total-pages < 4 show all page-links\r\n\t\tif ($total_pages < 4){\r\n\t\t\t\t$pagination .= ' ';\r\n\t\t\t\tfor ( $i = 2; $i < $total_pages; $i++ ){\r\n\t\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pagination .= ' ';\r\n\t\t\t\t}\r\n\t\t//Don't show all page-links\r\n\t\t} else {\r\n\t\t\t$start_count = min(max(1, $recent_page - 5), $total_pages - 4);\r\n\t\t\t$end_count = max(min($total_pages, $recent_page + 5), 4);\r\n\r\n\t\t\t$pagination .= ( $start_count > 1 ) ? ' ... ' : ' ';\r\n\r\n\t\t\tfor ( $i = $start_count + 1; $i < $end_count; $i++ ){\r\n\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$pagination .= ($end_count < $total_pages ) ? ' ... ' : ' ';\r\n\t\t} //close else\r\n\r\n\r\n\t\t//Last Page\r\n\t\tif ($recent_page == $total_pages){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$recent_page.'</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.(($total_pages - 1) * $per_page) . '\" class=\"pagination\" title=\"'.$user->lang['page'].' '.$total_pages.'\">'.$total_pages.'</a>&nbsp;&nbsp;<a href=\"'.$base. $uri_symbol .$start_variable.'='.($recent_page * $per_page).'\" title=\"'.$user->lang['next_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/right_arrow.png\" border=\"0\"></a>';\r\n\t\t}\r\n\r\n\t$pagination .= '</div>';\r\n\treturn $pagination;\r\n}", "function pagination(){}", "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "function Pagination($total, $perpage, $current, $link) {\n $result = '';\n $numpages = ceil($total / $perpage);\n $pages = AdvancedPagination($total, $current, $numpages);\n if ($numpages > 1) {\n $result .= '<div id=\"pagination\">\n <span class=\"pages\">'.__('Pages').': </span>';\n if ($pages['current'] != $pages['previous'])\n $result .= '<a href=\"'.$link.'&page=1\"> &lt;</a>';\n else $result .= '<span class=\"pages\"> &lt; </span>';\n $count = ($numpages > 5) ? 5 : $numpages;\n for ($i = 0; $i < $count; $i++) {\n if ($pages['pages'][$i] != $pages['current']) {\n $result .= '<a href=\"'.$link.'&page='.$pages['pages'][$i].'\">'.$pages['pages'][$i].'</a>';\n } else {\n $result .= '<span class=\"active\"> '.$pages['current'].'</span>';\n }\n }\n if ($pages['current'] != $pages['next']) {\n $result .= '<a href=\"'.$link.'&page='.$pages['last'].'\"> &gt; </a><span class=\"pages\">['.__('Total').': '.$pages['last'].']</span>';\n } else {\n $result .= '<span class=\"pages\"> &gt; ['.__('Total').': '.$pages['last'].']</span>';\n }\n $result .= '</div>\n <div class=\"clear\"></div>';\n }\n return $result;\n}", "public function page_links()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$pagination = '';\n\t\t\n\t\t// Let's get the starting page number, this is determined using num_links\n\t\t$start = (($this->current_page - $this->num_links) > 0) ? $this->current_page - ($this->num_links - 1) : 1;\n\n\t\t// Let's get the ending page number\n\t\t$end = (($this->current_page + $this->num_links) < $this->total_pages) ? $this->current_page + $this->num_links : $this->total_pages;\n\n\t\tfor ($i = $start; $i <= $end; $i++)\n\t\t{\n\t\t\t$text = $i;\n\t\t\t$url = '#';\n\t\t\t$state = $this->template['state']['current_page'];\n\n\t\t\tif ($this->current_page != $i)\n\t\t\t{\n\t\t\t\t// detect if anchor attribute is presented in the template \n\t\t\t\tif (stripos('<a ', $this->template['page_start']) < 0)\n\t\t\t\t{\n\t\t\t\t\t$text = '<a href=\":url\">'.$i.'</a>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$url = $this->build_url($i);\n\t\t\t\t$state = '';\n\t\t\t}\n\n\t\t\t$pagination .= Str::tr($this->template['page_start'].$text.$this->template['page_end'], array(\n\t\t\t\t'state' => $state,\n\t\t\t\t'url' => $url,\n\t\t\t));\n\t\t}\n\n\t\treturn $pagination;\n\t}", "static function init($data){\n \n $pages = ceil($data['count_all'] / $data['limit']);\n \n $res = \"\";\n \n for($i = 1; $i <= $pages; $i++){\n \n if($i == $data['current_page'] ){ \n $res .= \"<b>$i</b>\";\n }\n else{\n $res .= \"<a href='\".$data['url'].\"&page=$i'>$i</a>\";\n }\n \n }\n \n \n return $res;\n \n \n \n \n }", "function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)\n{\n// Begin PNphpBB2 Module\n/*\n\tglobal $lang;\n\n\t$total_pages = ceil($num_items/$per_page);\n\n\tif ( $total_pages == 1 )\n\t{\n\t\treturn '';\n\t}\n\n\t$on_page = floor($start_item / $per_page) + 1;\n\n\t$page_string = '';\n\tif ( $total_pages > 10 )\n\t{\n\t\t$init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages;\n\n\t\tfor($i = 1; $i < $init_page_max + 1; $i++)\n\t\t{\n\t\t\t$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . ( ( $i - 1 ) * $per_page ) ) . '\">' . $i . '</a>';\n\t\t\tif ( $i < $init_page_max )\n\t\t\t{\n\t\t\t\t$page_string .= \", \";\n\t\t\t}\n\t\t}\n\n\t\tif ( $total_pages > 3 )\n\t\t{\n\t\t\tif ( $on_page > 1 && $on_page < $total_pages )\n\t\t\t{\n\t\t\t\t$page_string .= ( $on_page > 5 ) ? ' ... ' : ', ';\n\n\t\t\t\t$init_page_min = ( $on_page > 4 ) ? $on_page : 5;\n\t\t\t\t$init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4;\n\n\t\t\t\tfor($i = $init_page_min - 1; $i < $init_page_max + 2; $i++)\n\t\t\t\t{\n\t\t\t\t\t$page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . ( ( $i - 1 ) * $per_page ) ) . '\">' . $i . '</a>';\n\t\t\t\t\tif ( $i < $init_page_max + 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$page_string .= ', ';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', ';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page_string .= ' ... ';\n\t\t\t}\n\n\t\t\tfor($i = $total_pages - 2; $i < $total_pages + 1; $i++)\n\t\t\t{\n\t\t\t\t$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . ( ( $i - 1 ) * $per_page ) ) . '\">' . $i . '</a>';\n\t\t\t\tif( $i < $total_pages )\n\t\t\t\t{\n\t\t\t\t\t$page_string .= \", \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor($i = 1; $i < $total_pages + 1; $i++)\n\t\t{\n\t\t\t$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . ( ( $i - 1 ) * $per_page ) ) . '\">' . $i . '</a>';\n\t\t\tif ( $i < $total_pages )\n\t\t\t{\n\t\t\t\t$page_string .= ', ';\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( $add_prevnext_text )\n\t{\n\t\tif ( $on_page > 1 )\n\t\t{\n\t\t\t$page_string = ' <a href=\"' . append_sid($base_url . \"&amp;start=\" . ( ( $on_page - 2 ) * $per_page ) ) . '\">' . $lang['Previous'] . '</a>&nbsp;&nbsp;' . $page_string;\n\t\t}\n\n\t\tif ( $on_page < $total_pages )\n\t\t{\n\t\t\t$page_string .= '&nbsp;&nbsp;<a href=\"' . append_sid($base_url . \"&amp;start=\" . ( $on_page * $per_page ) ) . '\">' . $lang['Next'] . '</a>';\n\t\t}\n\n\t}\n\n\t$page_string = $lang['Goto_page'] . ' ' . $page_string;\n*/\n\tglobal $template, $lang, $board_config;\n\n\t$total_pages = ceil($num_items/$per_page);\n\n\tif ($total_pages <= 1 || !$num_items)\n\t{\n\t\treturn false;\n\t}\n\n\t$on_page = floor($start_item / $per_page) + 1;\n\n\t$page_string_style .= ($on_page == 1) ? '<span class=\"pi_current\">1</span>' : '<span class=\"pi_firstlast\"><a href=\"' . append_sid($base_url . \"&amp;start=\" . (($on_page - 2) * $per_page)) . '\" title=\"' . $lang['Previous'] . '\"></a></span>&nbsp;<span class=\"pi_link\"><a href=\"' . append_sid($base_url) . '\">1</a></span>';\n\t$page_string .= ($on_page == 1) ? '<b>1</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . (($on_page - 2) * $per_page)) . '\">' . $lang['Previous'] . '</a>&nbsp;&nbsp;<a href=\"' . append_sid($base_url) . '\">1</a>';\n\n\tif ($total_pages > 5)\n\t{\n\t\t$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);\n\t\t$end_cnt = max(min($total_pages, $on_page + 4), 6);\n\n\t\t$page_string_style .= ($start_cnt > 1) ? '<span class=\"pi_plain\">...</span>' : '';\n\t\t$page_string .= ($start_cnt > 1) ? ' ... ' : ', ';\n\n\t\tfor($i = $start_cnt + 1; $i < $end_cnt; $i++)\n\t\t{\n\t\t\t$page_string_style .= ($i == $on_page) ? '<span class=\"pi_current\">' . $i . '</span>' : '<span class=\"pi_link\"><a href=\"' . append_sid($base_url . \"&amp;start=\" . (($i - 1) * $per_page)) . '\">' . $i . '</a></span>';\n\t\t\t$page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . (($i - 1) * $per_page)) . '\">' . $i . '</a>';\n\t\t\tif ($i < $end_cnt - 1)\n\t\t\t{\n\t\t\t\t$page_string .= ', ';\n\t\t\t}\n\t\t}\n\n\t\t$page_string_style .= ($end_cnt < $total_pages) ? '<span class=\"pi_plain\">...</span>' : '';\n\t\t$page_string .= ($end_cnt < $total_pages) ? ' ... ' : ', ';\n\n\t}\n\telse\n\t{\n\t\t$page_string .= ', ';\n\n\t\tfor($i = 2; $i < $total_pages; $i++)\n\t\t{\n\t\t\t$page_string_style .= ($i == $on_page) ? '<span class=\"pi_current\">' . $i . '</span>' : '<span class=\"pi_link\"><a href=\"' . append_sid($base_url . \"&amp;start=\" . (($i - 1) * $per_page)) . '\">' . $i . '</a></span>';\n\t\t\t$page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href=\"' . append_sid($base_url . \"&amp;start=\" . (($i - 1) * $per_page)) . '\">' . $i . '</a>';\n\n\t\t\tif ($i < $total_pages)\n\t\t\t{\n\t\t\t\t$page_string .= ', ';\n\t\t\t}\n\t\t}\n\t}\n \n\t$page_string_style .= ($on_page == $total_pages) ? '<span class=\"pi_current\">' . $total_pages . '</span>' : '<span class=\"pi_link\"><a href=\"' . append_sid($base_url . '&amp;start=' . (($total_pages - 1) * $per_page)) . '\">' . $total_pages . '</a></span>&nbsp;<span class=\"pi_firstlast\"><a href=\"' . append_sid($base_url . \"&amp;start=\" . ($on_page * $per_page)) . '\" title=\"' . $lang['Next'] . '\">></a></span>';\n\t$page_string .= ($on_page == $total_pages) ? '<b>' . $total_pages . '</b>' : '<a href=\"' . append_sid($base_url . '&amp;start=' . (($total_pages - 1) * $per_page)) . '\">' . $total_pages . '</a>&nbsp;&nbsp;<a href=\"' . append_sid($base_url . \"&amp;start=\" . ($on_page * $per_page)) . '\">' . $lang['Next'] . '</a>';\n\n\t$page_number = sprintf($lang['Page_of'], ( floor( $start_item / $per_page ) + 1 ), ceil( $num_items / $per_page ));\n\n\t$template->assign_vars(array(\n\t\t\t'BASE_URL'\t\t\t\t\t=> append_sid($base_url),\n\t\t\t'ON_PAGE'\t\t\t\t\t=> $on_page,\n\t\t\t'PER_PAGE'\t\t\t\t\t=> $per_page,\n\t\t\t'PAGINATION'\t\t\t\t=> $page_string,\n\t\t\t'PAGINATION_STYLE'\t\t\t=> $page_string_style,\n\t\t\t'PAGE_NUMBER'\t\t\t\t=> $page_number, \n\t\t\t'PAGE_NUMBER_STYLE'\t\t\t=> '<span class=\"pi_link\">' . $page_number . '</span>', \n\t\t\t'PAGE_NUMBER_JUMP'\t\t\t=> '<a href=\"javascript:jumpto();\">' . $page_number . '</a>', \n\t\t\t'PAGE_NUMBER_JUMP_STYLE'\t=> '<span class=\"pi_link\"><a href=\"javascript:jumpto();\">' . $page_number . '</a></span>', \n\t\t\t'L_GOTO_PAGE'\t\t\t\t=> $lang['Goto_page'],\n\t\t\t'L_GOTO_PAGE_STYLE'\t\t\t=> '<span class=\"pi_link\">' . $lang['Goto_page'] . '</span>',\n\t\t\t'L_GOTO_PAGE_JUMP'\t\t\t=> '<a href=\"javascript:jumpto();\">' . $lang['Goto_page'] . '</a>',\n\t\t\t'L_GOTO_PAGE_JUMP_STYLE'\t=> '<span class=\"pi_link\"><a href=\"javascript:jumpto();\">' . $lang['Goto_page'] . '</a></span>',\n\t\t\t'L_JUMP_PAGE'\t\t\t\t=> $lang['Jump_Page'])\n\t);\n\t// Turn on script on page\n\t$template->assign_block_vars('switch_enable_jump', array());\n\n\t// Turn on pagination\n\t$template->assign_block_vars('switch_pagination', array());\n// End PNphpBB2 Module\n\n\treturn $page_string;\n}", "public function create_links()\n {\n $totalPages = floor($this->total_records / $this->size);\n $totalPages += ($this->total_records % $this->size != 0) ? 1 : 0;\n if($totalPages < 1 || $totalPages == 1)\n return null;\n $output = null;\n $loopStart = 1;\n $loopEnd = $totalPages;\n if($totalPages > 5){\n if($this->page <= 3){\n $loopStart = 1;\n $loopEnd = 5;\n } else if($this->page >= $totalPages - 2){\n $loopStart = $totalPages - 4;\n $loopEnd = $totalPages;\n } else{\n $loopStart = $this->page - 2;\n $loopEnd = $this->page + 2;\n }\n }\n if($loopStart != 1){\n $output .= sprintf('<a id=\"back\" href=\"' . $this->link . '\">&#171;</a>', '1');\n }\n if($this->page > 1){\n $output .= sprintf('<a id=\"prev\" href=\"' . $this->link . '\">' . __('Previous') . '</a>', $this->page - 1);\n }\n for($i = $loopStart; $i <= $loopEnd; $i++){\n if($i == $this->page){\n $output .= '<a class=\"on\">' . $i . '</a>';\n } else{\n $output .= sprintf('<a href=\"' . $this->link . '\">', $i) . $i . '</a>';\n }\n }\n if($this->page < $totalPages){\n $output .= sprintf('<a id=\"next\" href=\"' . $this->link . '\">' . __('Next') . '</a>', $this->page + 1);\n }\n if($loopEnd != $totalPages){\n $output .= sprintf('<a id=\"forward\" href=\"' . $this->link . '\">&#187;</a>', $totalPages);\n }\n return '<div id=\"pagination\"><ul><li>' . $output . '</li></ul></div>';\n }", "public function generatePHPPaginator()\n {\n $sHTML = '';\n \n $iNumOfPages = ceil($this->iLength / $this->iNumOfPosAtPage);\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=1\">&lt;</a></li>';\n \n for($i = 0;$i < $iNumOfPages;$i++)\n {\n if(($i + 1) == $this->iActualPage)\n {\n $sHTML .= '<li class=\"active\"><a href=\"?' . $this->sActualParams . '&p=' . $this->iActualPage . '\">' . ($i + 1) . '</a></li>';\n }\n else\n {\n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . ($i + 1) . '\">' . ($i + 1) . '</a></li>';\n }\n }\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . $iNumOfPages . '\">&gt;</a></li>';\n \n $this->oTemplate->assign['paginator'] = $sHTML;\n $this->oTemplate->assign['scripts-path'] = SCRIPTS_PATH;\n \n return $this->oTemplate->parse(INCLUDES_PATH . 'paginator.html');\n }", "function buildPagination($pageData) {\r\n $currentPage = $pageData['current_page'];\r\n $total = $pageData['total'];\r\n $perPage = $pageData['showing'];\r\n $term = $pageData['term'];\r\n \r\n $previous = '<a class=\"previous\" href=\"/' . $term . '/page:' . ($currentPage - 1) . '\">Previous</a> ';\r\n $next = ' <a class=\"next\" href=\"/' . $term . '/page:' . ($currentPage + 1) . '\">Next</a>';\r\n\r\n\t\tif ($perPage == 0) {\r\n\t\t\t$perPage = Configure::read('Flickr.settings.photos_per_page') - 1;\r\n\t\t}\r\n\r\n $middle = '<span>Page <strong>' . $currentPage . '</strong> of ' . ceil($total / $perPage) . '</span>';\r\n if ($currentPage == 1) {\r\n return '<div class=\"page-list\">' . $middle . $next . '</div>'; \r\n } \r\n elseif ($currentPage == $total) {\r\n return '<div class=\"page-list\">' . $previous . $middle . '</div>';\r\n }\r\n\r\n return '<div class=\"page-list\">' . $previous . $middle . $next . '</div>'; \r\n }", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "public function view()\n {\n $pages = explode(' ', $this->list);\n\n if ($this->current_page < 1 || $this->current_page > $this->total_pages) {\n $this->current_page = 1;\n }\n $output = null;\n\n $output .= '<ul class=\"pagination\">';\n $output .= $this->beginning();\n $output .= $this->middle($pages);\n $output .= $this->ending();\n $output .= '</ul>';\n \n return $output;\n }", "public function getPaginationHtml();", "function create_links() {\n $total_rows = $this->total_rows;\n if ($total_rows == 0) {\n return '';\n }\n\n // Calculate the total number of pages\n $CI = & get_instance();\n $_quantity = $CI->_quantity;\n $per_page = $this->per_page;\n $num_pages = ceil($total_rows / $per_page);\n\n // Is there only one page? Hm... nothing more to do here then.\n if ($num_pages == 1) {\n return '';\n }\n\n // Determine the current page number.\n $_offset = $CI->_offset;\n $cur_page = $_quantity == -1 ? -1 : floor($CI->_offset / $per_page) + 1;\n\n // And here we go...\n $output = '';\n\n // Render the \"First\" link\n if ($cur_page != 1) {\n $i = 0;\n $output .= $this->first_tag_open . $i . $this->first_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Render the \"previous\" link\n if ($cur_page != 1 && $_quantity != -1) {\n $i = $_offset - $per_page;\n $output .= $this->prev_tag_open . $i . $this->prev_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Write the digit links\n $output .= \"<select tabindex='-1'>\";\n $start = 1;\n $end = $per_page;\n if ($_quantity == -1)\n $output .= '<option selected=\"selected\" > - </option>';\n for ($loop = 1; $loop <= $num_pages; $loop++) {\n if ($end > $total_rows)\n $end = $total_rows;\n $output .= '<option value=\"' . (($loop - 1) * $per_page) . '\" ' . ($loop == $cur_page ? \"selected='selected'\" : \"\") . ' >Trang ' . $loop . '/' . $num_pages . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $start . \"-\" . $end . '/' . $total_rows . '</option>';\n $start+=$per_page;\n $end+=$per_page;\n }\n $output .= \"</select>\";\n\n // Render the \"next\" link\n if ($cur_page != $num_pages && $_quantity != -1) {\n $i = $_offset + $per_page;\n $output .= $this->next_tag_open . $i . $this->next_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Render the \"Last\" link\n if ($cur_page != $num_pages) {\n $i = ($num_pages - 1) * $per_page;\n $output .= $this->last_tag_open . $i . $this->last_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Add the wrapper HTML if exists\n $output = $this->full_tag_open . $output . str_replace(array(\"{class}\", \"{style}\"), array(($_quantity == -1 ? \"ui-state-hover\" : \"icon\"), ($_quantity == -1 ? \"cursor:default\" : \"\")), $this->full_tag_close);\n\n return $output;\n }", "public function pageNav()\n {\n $pager = $this->getPublisher()->getPagination()['pager'];\n $html = \"\\n<nav>\\n <ul class=\\\"pagination\\\">\";\n\n if ($pager['pages']['prev']) {\n $html .= \"\\n <li><a href=\\\"\".$pager['pages']['prev'].\n \"\\\" aria-label=\\\"\".$this->getConfig()->ls('ui.nav.previous').\n \"\\\"><span aria-hidden=\\\"true\\\">&laquo;</span></a><li>\";\n } else\n $html .= \"\\n <li class=\\\"disabled\\\"><span><span aria-hidden=\\\"true\\\">&laquo;</span></span></li>\";\n\n $pages = $this->getPublisher()->getPagination()['page_menu']['pages'];\n foreach($pages as $page_num => $data) {\n if ($data['url']) // not the current page\n $html .= \"\\n <li><a href=\\\"\".$data['url'].\"\\\">\".$page_num.\"</a></li>\";\n else\n $html .= \"\\n <li class=\\\"active\\\"><span>\".$page_num.\"<span class=\\\"sr-only\\\">(current)</span></span></li>\";\n }\n\n if ($pager['pages']['next']) {\n $html .= \"\\n <li><a href=\\\"\".$pager['pages']['next'].\n \"\\\" aria-label=\\\"\".$this->getConfig()->ls('ui.nav.next').\n \"\\\"><span aria-hidden=\\\"true\\\">&raquo;</span></a><li>\";\n } else\n $html .= \"\\n <li class=\\\"disabled\\\"><span><span aria-hidden=\\\"true\\\">&raquo;</span></span></li>\";\n\n $html .= \"\\n </ul>\\n</nav>\\n\\n\";\n\n return $html;\n }", "function show_page_links($base_url, $num_items, $per_page, $page)\n{\n //$base_url contains the address of the page and the order it is called with\n //e.g., 'asc' or 'desc' - the page handles this so we have to worry about it.\n\n $total_pages = ceil($num_items/$per_page);\n\n if ($total_pages == 1)\n {\n return '';\n }\n\n //initialize our $page_string variable wich will hold the links\n $page_string = '<p><span class=\"page_numbers\">';\n\n //SHOW UP TO 4 LINKS ON EITHER SIDE OF THE CURRENT PAGE\n\n //get the number of page links are available after the current page\n $num_succeeding_links = $total_pages - $page;\n\n //get the number of preceding links available before the current page\n $num_preceding_links = $page -1;\n\n //calculate our start and end values\n $start = $page - 4;\n if ( $start < 1)\n {\n $start = 1;\n }\n //if we have less than 10 total_page, use the number we have ($total_pages)\n $end = $total_pages;\n //but if end is more than 9 higher than $start, make $end 9 higher than $start\n //we only want to show 10 records per page (e.g., 1..10)\n if ( ($end - $start) > 9 )\n {\n $end= $start + 9;\n }\n\n //if the total number of succeeding links exceeds 4 show 4 and a >> at the end\n //the >> at the end is just the 5th succeeding link\n //do the same for preceding links if they are more than 4\n if ($total_pages > 10 && $page > 1) //don't show first page link except when we're not the first page\n {\n //create a << which points to the first page\n $page_string .= '<a title=\"first page\" href=\"'.$base_url.'&page=1\">&lt;&lt;</a>&nbsp;&nbsp;';\n //create a < which points to the current page -1 (shifts us left one)\n $val = $page-1;\n $page_string .= '<a title=\"previous page\" href=\"'.$base_url.'&page='.$val.'\">&lt;</a>&nbsp;&nbsp;';\n }\n for ($i=$start; $i<=$end; $i++)\n {\n if ($i == $page)\n {\n $page_string .= \" <b>[$i]</b> \";\n }\n else\n {\n $page_string .= ' <a title=\"page ' . $i . '\" href=\"'.$base_url.'&page='.$i.'\">'.$i.'</a> ';\n }\n }\n if ($total_pages > 10 && $page < $total_pages) //don't show last page link except when we're not on the last page\n {\n //create a > which points to the current page +1 (shifts us right one)\n $val = $page + 1;\n $page_string .= '&nbsp;&nbsp;<a title=\"next page\" href=\"'.$base_url.'&page='.$val.'\">&gt</a>';\n\n //create a >> which point to the last page\n $page_string .= '&nbsp;&nbsp;<a title=\"last page\" href=\"'.$base_url.'&page='.$total_pages.'\">&gt;&gt</a> ';\n }\n\n $page_string .= '</span></p>';\n\n return $page_string;\n\n}", "public function pager()\n {\n $pager = $this->getPublisher()->getPagination()['pager'];\n $html = \"\\n<nav>\\n <ul class=\\\"pager\\\">\";\n\n $html .= \"\\n <li class=\\\"previous\".\n ($pager['pages']['prev'] !== null ? '' : ' disabled').\n \"\\\"><a href=\\\"\".($pager['pages']['prev'] ? : '#').\n \"\\\"><span aria-hidden=\\\"true\\\">&larr;</span> \".\n $this->getConfig()->ls('ui.nav.previous').\"</a></li>\";\n\n $html .= \"\\n <li class=\\\"next\".\n ($pager['pages']['next'] !== null ? '' : ' disabled').\n \"\\\"><a href=\\\"\".($pager['pages']['next'] ? : '#').\n \"\\\">\".$this->getConfig()->ls('ui.nav.next').\n \" <span aria-hidden=\\\"true\\\">&rarr;</span></a></li>\";\n\n $html .= \"\\n </ul>\\n</nav>\\n\\n\";\n\n return $html;\n }", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "function create_links()\n\t{\n\t\t// If our item count or per-page total is zero there is no need to continue.\n\t\tif ($this->total_rows == 0 OR $this->per_page == 0)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// Calculate the total number of pages\n\t\t$num_pages = ceil($this->total_rows / $this->per_page);\n\n\t\t// Is there only one page? Hm... nothing more to do here then.\n\t\tif ($num_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// Set the base page index for starting page number\n\t\tif ($this->use_page_numbers)\n\t\t{\n\t\t\t$base_page = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$base_page = 0;\n\t\t}\n\n\t\t// Determine the current page number.\n\t\t$CI =& get_instance();\n\n\t\tif ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)\n\t\t{\n\t\t\tif ($CI->input->get($this->query_string_segment) != $base_page)\n\t\t\t{\n\t\t\t\t$this->cur_page = $CI->input->get($this->query_string_segment);\n\n\t\t\t\t// Prep the current page - no funny business!\n\t\t\t\t$this->cur_page = (int) $this->cur_page;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($CI->uri->segment($this->uri_segment) != $base_page)\n\t\t\t{\n\t\t\t\t$this->cur_page = $CI->uri->segment($this->uri_segment);\n\n\t\t\t\t// Prep the current page - no funny business!\n\t\t\t\t$this->cur_page = (int) $this->cur_page;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Set current page to 1 if using page numbers instead of offset\n\t\tif ($this->use_page_numbers AND $this->cur_page == 0)\n\t\t{\n\t\t\t$this->cur_page = $base_page;\n\t\t}\n\n\t\t$this->num_links = (int)$this->num_links;\n\n\t\tif ($this->num_links < 1)\n\t\t{\n\t\t\tshow_error('Your number of links must be a positive number.');\n\t\t}\n\n\t\tif ( ! is_numeric($this->cur_page))\n\t\t{\n\t\t\t$this->cur_page = $base_page;\n\t\t}\n\n\t\t// Is the page number beyond the result range?\n\t\t// If so we show the last page\n\t\tif ($this->use_page_numbers)\n\t\t{\n\t\t\tif ($this->cur_page > $num_pages)\n\t\t\t{\n\t\t\t\t$this->cur_page = $num_pages;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->cur_page > $this->total_rows)\n\t\t\t{\n\t\t\t\t$this->cur_page = ($num_pages - 1) * $this->per_page;\n\t\t\t}\n\t\t}\n\n\t\t$uri_page_number = $this->cur_page;\n\t\t\n\t\tif ( ! $this->use_page_numbers)\n\t\t{\n\t\t\t$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);\n\t\t}\n\n\t\t// Calculate the start and end numbers. These determine\n\t\t// which number to start and end the digit links with\n\t\t$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;\n\t\t$end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;\n\n\t\t// Is pagination being used over GET or POST? If get, add a per_page query\n\t\t// string. If post, add a trailing slash to the base URL if needed\n\t\tif ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)\n\t\t{\n\t\t\t$this->base_url = rtrim($this->base_url).'&amp;'.$this->query_string_segment.'=';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->base_url = rtrim($this->base_url, '/') .'/';\n\t\t}\n\n\t\t// And here we go...\n\t\t$output = '';\n\n\t\t// Render the \"First\" link\n\t\tif ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1))\n\t\t{\n\t\t\t$first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;\n\t\t\t$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href=\"'.$first_url.'\">'.$this->first_link.'</a>'.$this->first_tag_close;\n\t\t}\n\n\t\t// Render the \"previous\" link\n\t\tif ($this->prev_link !== FALSE AND $this->cur_page != 1)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $uri_page_number - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = $uri_page_number - $this->per_page;\n\t\t\t}\n\n\t\t\tif ($i == 0 && $this->first_url != '')\n\t\t\t{\n\t\t\t\t$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->first_url.'\">'.$this->prev_link.'</a>'.$this->prev_tag_close;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;\n\t\t\t\t$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$i.'\">'.$this->prev_link.'</a>'.$this->prev_tag_close;\n\t\t\t}\n\n\t\t}\n\n\t\t// Render the pages\n\t\tif ($this->display_pages !== FALSE)\n\t\t{\n\t\t\t// Write the digit links\n\t\t\tfor ($loop = $start -1; $loop <= $end; $loop++)\n\t\t\t{\n\t\t\t\tif ($this->use_page_numbers)\n\t\t\t\t{\n\t\t\t\t\t$i = $loop;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$i = ($loop * $this->per_page) - $this->per_page;\n\t\t\t\t}\n\n\t\t\t\tif ($i >= $base_page)\n\t\t\t\t{\n\t\t\t\t\tif ($this->cur_page == $loop)\n\t\t\t\t\t{\n\t\t\t\t\t\t$output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$n = ($i == $base_page) ? '' : $i;\n\n\t\t\t\t\t\tif ($n == '' && $this->first_url != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->first_url.'\">'.$loop.'</a>'.$this->num_tag_close;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;\n\n\t\t\t\t\t\t\t$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$n.'\">'.$loop.'</a>'.$this->num_tag_close;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Render the \"next\" link\n\t\tif ($this->next_link !== FALSE AND $this->cur_page < $num_pages)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $this->cur_page + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = ($this->cur_page * $this->per_page);\n\t\t\t}\n\n\t\t\t$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$this->prefix.$i.$this->suffix.'\">'.$this->next_link.'</a>'.$this->next_tag_close;\n\t\t}\n\n\t\t// Render the \"Last\" link\n\t\tif ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $num_pages;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = (($num_pages * $this->per_page) - $this->per_page);\n\t\t\t}\n\t\t\t$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$this->prefix.$i.$this->suffix.'\">'.$this->last_link.'</a>'.$this->last_tag_close;\n\t\t}\n\n\t\t// Kill double slashes. Note: Sometimes we can end up with a double slash\n\t\t// in the penultimate link so we'll kill all double slashes.\n\t\t$output = preg_replace(\"#([^:])//+#\", \"\\\\1/\", $output);\n\n\t\t// Add the wrapper HTML if exists\n\t\t$output = $this->full_tag_open.$output.$this->full_tag_close;\n\n\t\treturn $output;\n\t}", "public static function links()\n\t{\n\t\t$all_pages = ceil(self::$total / self::$limit);\n\t\t$current_page = ceil(self::$offset / self::$limit);\n\n\t\t$string = '<nav class=\"paginator\"><ul>';\n\n\t\tif($current_page > 1)\n\t\t{\n\t\t\t$string .= '<li>' . self::link(\"Pr&eacute;c&eacute;dente\", ($current_page - 1) * self::$limit) . '</li>';\n\t\t}\n\n\t\t$from_page = max($current_page - 3, 0);\n\t\t$to_page = min($current_page + 3, $all_pages-1);\n\n\t\tfor($i = $from_page; $i < $to_page; $i++)\n\t\t{\n\t\t\t$string .= '<li ' . ($current_page == $i ? 'class=\"current\"' : '') . '>' . self::link($i + 1, $i * self::$limit) . '</li>';\n\t\t}\n\t\t\n\n\t\tif(($current_page + 1) !== $all_pages)\n\t\t{\n\t\t\t$string .=\"<li>...</li>\";\n\t\t\t$string .= '<li>' . self::link(round(self::$total/self::$limit)+1, round(self::$total/self::$limit)*self::$limit ) . '</li>';\n\t\t\t$string .= '<li>' . self::link(\"Suivante\", ($current_page + 1) * self::$limit) . '</li>';\n\t\t}\t\t\n\n\t\t//self::$url=preg_replace(\"/\\&offset=[0-9]*/\",\"\",self::$url);\n\t\t//$string .='<li><a href=\"' . self::$url . '?offset=' . round(self::$total/self::$limit)*self::$limit . '\"> Derni&egrave;re </a>';\n\t\t$string .= '</ul></nav>';\n\t\t//$string .= self::$total . \" \" .self::$offset . \" \" . self::$url . \" \" . self::$limit;\n\n\t\treturn $string;\n\t}", "function smarty_function_pager($params, &$smarty) {\n $result = '';\n \n if (!isset($params['delta'])) {\n $params['delta'] = 3;\n }\n \n if ($params && $params['pages'] > 1) {\n $result = '<div class=\"dg_pager_container\">';\n \n if ($params['current'] > 1) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"1\">First</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] - 1).'\">Prev</a> ';\n }\n \n $pager_start = $params['current'] <= $params['delta'] ? 1 : $params['current'] - $params['delta'];\n $pager_stop = $params['current'] > $params['pages'] - $params['delta'] ? $params['pages'] : $params['current'] + $params['delta'];\n \n if ($params['current'] > $params['delta'] + 1) {\n /*for ($i = 1; $i <= $params['delta'] + 1; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n $result .= ' ... ';\n }\n \n for ($i = $pager_start; $i <= $pager_stop; ++$i) {\n if ($i == $params['current']) {\n $result .= ' <span>['.$i.']</span> ';\n } else {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }\n }\n \n if ($params['current'] < $params['pages'] - $params['delta']) {\n $result .= ' ... ';\n /*for ($i = $params['pages'] - $params['delta']; $i <= $params['pages']; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n }\n\n if ($params['current'] < $params['pages']) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] + 1).'\">Next</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$params['pages'].'\">Last</a> ';\n }\n \n $result .= '</div>';\n }\n \n return $result;\n}", "public function render()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$pagination = $this->template['wrapper_start'];\n\t\t$pagination .= $this->prev_link(Lang::get('pagination.previous'));\n\t\t$pagination .= $this->page_links();\n\t\t$pagination .= $this->next_link(Lang::get('pagination.next'));\n\t\t$pagination .= $this->template['wrapper_end'];\n\n\t\treturn $pagination;\n\t}", "protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "public function make()\n {\n $data = [\n 'items' => $this->items,\n 'current' => $this->currentDate,\n 'format' => $this->format,\n 'urlFormat' => $this->urlFormat,\n 'url' => $this->url,\n ];\n return new HtmlString(view('pagination', $data)->render());\n }", "public function links()\n\t{\n\t\tif ($this->last <= 1) return '';\n\n\t\t// Each pagination element is created by an element method. This allows\n\t\t// us to keep this class clean and simple, because pagination code can\n\t\t// become a mess. We would rather keep it simple and beautiful.\n\t\tforeach ($this->elements as $element)\n\t\t{\n\t\t\t$elements[] = $this->$element(Lang::line(\"pagination.{$element}\")->get());\n\t\t}\n\n\t\treturn '<div class=\"pagination\">'.implode(' ', $elements).'</div>'.PHP_EOL;\n\t}", "function getPaginationString2($page = 1, $totalitems, $limit = 15, $adjacents = 1, $targetpage = \"/\", $pagestring = \"?page=\",$additional_param=\"\")\n\t{\t\t\n\t\t//defaults\n\t\tif(!$adjacents) $adjacents = 1;\n\t\tif(!$limit) $limit = 15;\n\t\tif(!$page) $page = 1;\n\t\tif(!$targetpage) $targetpage = \"/\";\n\t\t\n\t\t//other vars\n\t\t$prev = $page - 1;\t\t\t\t\t\t\t\t\t//previous page is page - 1\n\t\t$next = $page + 1;\t\t\t\t\t\t\t\t\t//next page is page + 1\n\t\t$lastpage = ceil($totalitems / $limit);\t\t\t\t//lastpage is = total items / items per page, rounded up.\n\t\t$lpm1 = $lastpage - 1;\t\t\t\t\t\t\t\t//last page minus 1\n\t\t\n\t\t/* \n\t\t\tNow we apply our rules and draw the pagination object. \n\t\t\tWe're actually saving the code to a variable in case we want to draw it more than once.\n\t\t*/\n\t\t$pagination = \"\";\n\t\tif($lastpage > 1)\n\t\t{\t\n\t\t\t$pagination .= \"<div class=\\\"pagination\\\"\";\n\t\t\tif($margin || $padding)\n\t\t\t{\n\t\t\t\t$pagination .= \" style=\\\"\";\n\t\t\t\tif($margin)\n\t\t\t\t\t$pagination .= \"margin: $margin;\";\n\t\t\t\tif($padding)\n\t\t\t\t\t$pagination .= \"padding: $padding;\";\n\t\t\t\t$pagination .= \"\\\"\";\n\t\t\t}\n\t\t\t$pagination .= \"><ul class='pagination pagination-sm no-margin pull-right'>\";\n\t\n\t\t\t//previous button\n\t\t\tif ($page > 1) \n\t\t\t\t$pagination .= \"<li><a href=\\\"$targetpage$pagestring$prev$additional_param\\\">&larr; Prev</a></li>\";\n\t\t\telse\n\t\t\t\t$pagination .= \"\";//\"<li class=\\\"disabled\\\"><span>&larr; Prev</span></li>\";\t\n\t\t\t\n\t\t\t//pages\t\n\t\t\tif ($lastpage < 7 + ($adjacents * 2))\t//not enough pages to bother breaking it up\n\t\t\t{\t\n\t\t\t\tfor ($counter = 1; $counter <= $lastpage; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t$pagination .= \"<li class=\\\"active\\\"><span>$counter</span></li>\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $counter . $additional_param . \"\\\">$counter</a></li>\";\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($lastpage >= 7 + ($adjacents * 2))\t//enough pages to hide some\n\t\t\t{\n\t\t\t\t//close to beginning; only hide later pages\n\t\t\t\tif($page < 1 + ($adjacents * 3))\t\t\n\t\t\t\t{\n\t\t\t\t\tfor ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t\t$pagination .= \"<li class=\\\"active\\\"><span>$counter</span></li>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $counter . $additional_param . \"\\\">$counter</a></li>\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$pagination .= \"<li><span class=\\\"elipses\\\">...</span></li>\";\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $lpm1 . $additional_param . \"\\\">$lpm1</a></li>\";\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $lastpage . $additional_param . \"\\\">$lastpage</a></li>\";\t\t\n\t\t\t\t}\n\t\t\t\t//in middle; hide some front and some back\n\t\t\t\telseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))\n\t\t\t\t{\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . \"1$additional_param\\\">1</a></li>\";\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . \"2$additional_param\\\">2</a></li>\";\n\t\t\t\t\t$pagination .= \"<li><span class=\\\"elipses\\\">...</span></li>\";\n\t\t\t\t\tfor ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t\t$pagination .= \"<li class=\\\"active\\\"><span>$counter</span></li>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $counter . $additional_param . \"\\\">$counter</a></li>\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$pagination .= \"<li>...</li>\";\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $lpm1 . $additional_param . \"\\\">$lpm1</a></li>\";\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $lastpage . $additional_param . \"\\\">$lastpage</a></li>\";\t\t\n\t\t\t\t}\n\t\t\t\t//close to end; only hide early pages\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . \"1$additional_param\\\">1</a></li>\";\n\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . \"2$additional_param\\\">2</a></li>\";\n\t\t\t\t\t$pagination .= \"<li><span class=\\\"elipses\\\">...</span></li>\";\n\t\t\t\t\tfor ($counter = $lastpage - (1 + ($adjacents * 3)); $counter <= $lastpage; $counter++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t\t$pagination .= \"<li class=\\\"active\\\"><span>$counter</span></li>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $counter . $additional_param . \"\\\">$counter</a></li>\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//next button\n\t\t\tif ($page < $counter - 1) \n\t\t\t\t$pagination .= \"<li><a href=\\\"\" . $targetpage . $pagestring . $next . $additional_param . \"\\\">Next &rarr;</a></li>\";\n\t\t\telse\n\t\t\t\t$pagination .= \"\";//\"<li class=\\\"disabled\\\"><a>Next &rarr;</a></li>\";\n\t\t\t$pagination .= \"</ul></div>\\n\";\n\t\t}\n\t\t\n\t\treturn $pagination;\n\t\n\t}", "public function GetHTML(){\n\t/*unset($this->url[0]);\n\t\t\t$cnt=1;\n\t\t\tforeach($this->url as $v){\n\t\t\t\tif(count($this->url)==$cnt && $v>0 && is_numeric($v)){\n\t\t\t\t//$this->out_url.=$v.'/';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$this->out_url.=$v.'/';\n\t\t\t$cnt++;\n\t\t\t}*/\n\t\n\t\t\n\t\n\t$next=$this->list['current']+1;\n\t$prev=$this->list['current']-1;\n\t$limit=($this->page-1)*$this->take+1;\n\t$limit2=$limit+$this->take-1;\n\t\n\tif ($this->page==$this->total_pages)\n\t$limit2=$this->total;\n\t$str='';\n\t$str .=\"\";\n\t\n\n\t$str .=<<<OUT\n\t\t\t<div class=\"pager\">\n\t\t \t<div class=\"hr\"><i></i></div>\n\t\t <ul>\nOUT;\n\tif($prev>0){\n\t$str .=<<<OUT\n\t\t\t<li class=\"prev\"><a href=\"{$this->out_url}{$prev}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n \n\tfor ($i=1; $i < $this->page ; $i++)\n\t\t{\n\t\t\tif ($i>((int)$this->page-(int)$this->half_block)){\n\t\t\t\tif($i==1){\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif($this->total_pages==$this->list['current'])\n\t$str .=\"<li class='last'>\".$this->list['current'].\"</li>\";\n\telse\n\t$str .=\"<li>\".$this->list['current'].\"</li>\";\n\t\n\t$cnt=1;\n\tfor ($i=$this->page+1; $i <= $this->total_pages ; $i++)\n\t\t{\n\t\t\tif($this->total_pages==$i || ($this->half_block-1)==$cnt)\n\t\t\t$classlast=' class=\"last\"';\n\t\t\telse\n\t\t\t$classlast='';\n\t\t\t\n\t\t\tif ($this->half_block==$cnt)\n\t\t\tbreak;\n\t\t\t$str .=<<<OUT\n\t\t\t<li{$classlast}><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t$cnt++;\n\t\t}\n\n\tif($this->list['current']<$this->total_pages){\n\t$str .=<<<OUT\n\t\t\t<li class=\"next\"><a href=\"{$this->out_url}{$next}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n\t\n\t$str .=<<<OUT\n \t\t </div>\nOUT;\n\tif ($this->total_pages>1)\n\treturn $str;\n\t\n\t}", "public function get()\n {\n // To write links\n $links = null;\n // We get restrictions for the cycle\n $limits = $this->limits();\n\n $html = '<ul class=\"pagination\">';\n // Generate links\n for ($page = $limits[0]; $page <= $limits[1]; $page++) {\n // If the current page is the current page, there is no link and the active class is added\n if ($page == $this->current_page) {\n $links .= '<li class=\"active\"><a href=\"//\">' . $page . '</a></li>';\n } else {\n // Else generate a link\n $links .= $this->generateHtml($page);\n }\n }\n\n // If the links were created\n if (!is_null($links)) {\n // If the current page is not the first one\n if ($this->current_page > 1)\n // Create a link to \"To first\"\n $links = $this->generateHtml(1, '&lt;') . $links;\n // If the current page is not the first one\n if ($this->current_page < $this->amount)\n // Create a link \"To the last\"\n $links .= $this->generateHtml($this->amount, '&gt;');\n }\n\n $html .= $links . '</ul>';\n\n // Return html\n return $html;\n }", "function renderPagination(PageArray $items) {\n\n\tif(!$items->getLimit() || $items->getTotal() <= $items->getLimit()) return '';\n\t$page = page();\n\tif(!$page->template->allowPageNum) {\n\t\treturn \"Pagination is not enabled for this template\";\n\t}\n\n\t// customize the MarkupPagerNav to output in Foundation-style pagination links\n\t$options = array(\n\t\t'numPageLinks' => 5, \n\t\t'nextItemLabel' => '<i class=\"uk-icon-angle-double-right\"></i>',\n\t\t'nextItemClass' => '',\n\t\t'previousItemLabel' => '<span><i class=\"uk-icon-angle-double-left\"></i></span>',\n\t\t'previousItemClass' => '',\n\t\t'lastItemClass' => '',\n\t\t'currentItemClass' => 'uk-active',\n\t\t'separatorItemLabel' => '<span>&hellip;</span>',\n\t\t'separatorItemClass' => 'uk-disabled',\n\t\t'listMarkup' => \"<ul class='uk-pagination uk-text-left'>{out}</ul>\",\n\t\t'itemMarkup' => \"<li class='{class}'>{out}</li>\",\n\t\t'linkMarkup' => \"<a href='{url}'>{out}</a>\",\n\t\t'currentLinkMarkup' => \"<span>{out}</span>\"\n\t);\n\n\t$pager = modules('MarkupPagerNav');\n\t$pager->setBaseUrl($page->url);\n\n\treturn $pager->render($items, $options);\n}", "function build_pagelinks($data)\n\t{\n\t\t$data['leave_out'] = isset($data['leave_out']) ? $data['leave_out'] : '';\n\t\t$data['no_dropdown'] = isset($data['no_dropdown']) ? intval( $data['no_dropdown'] ) : 0;\n\t\t$data['USE_ST']\t\t = isset($data['USE_ST'])\t? $data['USE_ST']\t : '';\n\t\t$work = array( 'pages' => 0, 'page_span' => '', 'st_dots' => '', 'end_dots' => '' );\n\t\t\n\t\t$section = !$data['leave_out'] ? 2 : $data['leave_out']; // Number of pages to show per section( either side of current), IE: 1 ... 4 5 [6] 7 8 ... 10\n\t\t\n\t\t$use_st = !$data['USE_ST'] ? 'st' : $data['USE_ST'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the number of pages\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $data['TOTAL_POSS'] > 0 )\n\t\t{\n\t\t\t$work['pages'] = ceil( $data['TOTAL_POSS'] / $data['PER_PAGE'] );\n\t\t}\n\t\t\n\t\t$work['pages'] = $work['pages'] ? $work['pages'] : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\t\t\n\t\t$work['total_page'] = $work['pages'];\n\t\t$work['current_page'] = $data['CUR_ST_VAL'] > 0 ? ($data['CUR_ST_VAL'] / $data['PER_PAGE']) + 1 : 1;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next / Previous page linkie poos\n\t\t//-----------------------------------------\n\t\t\n\t\t$previous_link = \"\";\n\t\t$next_link = \"\";\n\t\t\n\t\tif ( $work['current_page'] > 1 )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] - $data['PER_PAGE'];\n\t\t\t$previous_link = $this->compiled_templates['skin_global']->pagination_previous_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\tif ( $work['current_page'] < $work['pages'] )\n\t\t{\n\t\t\t$start = $data['CUR_ST_VAL'] + $data['PER_PAGE'];\n\t\t\t$next_link = $this->compiled_templates['skin_global']->pagination_next_link(\"{$data['BASE_URL']}&amp;$use_st=$start\");\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Loppy loo\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($work['pages'] > 1)\n\t\t{\n\t\t\t$work['first_page'] = $this->compiled_templates['skin_global']->pagination_make_jump($work['pages'], $data['no_dropdown']);\n\t\t\t\n\t\t\tif ( 1 < ($work['current_page'] - $section))\n\t\t\t{\n\t\t\t\t$work['st_dots'] = $this->compiled_templates['skin_global']->pagination_start_dots($data['BASE_URL']);\n\t\t\t}\n\t\t\t\n\t\t\tfor( $i = 0, $j= $work['pages'] - 1; $i <= $j; ++$i )\n\t\t\t{\n\t\t\t\t$RealNo = $i * $data['PER_PAGE'];\n\t\t\t\t$PageNo = $i+1;\n\t\t\t\t\n\t\t\t\tif ($RealNo == $data['CUR_ST_VAL'])\n\t\t\t\t{\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_current_page( ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($PageNo < ($work['current_page'] - $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Instead of just looping as many times as necessary doing nothing to get to the next appropriate number, let's just skip there now\n\t\t\t\t\t\t$i = $work['current_page'] - $section - 2;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If the next page is out of our section range, add some dotty dots!\n\t\t\t\t\t\n\t\t\t\t\tif ($PageNo > ($work['current_page'] + $section))\n\t\t\t\t\t{\n\t\t\t\t\t\t$work['end_dots'] = $this->compiled_templates['skin_global']->pagination_end_dots(\"{$data['BASE_URL']}&amp;$use_st=\".($work['pages']-1) * $data['PER_PAGE']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$work['page_span'] .= $this->compiled_templates['skin_global']->pagination_page_link(\"{$data['BASE_URL']}&amp;$use_st={$RealNo}\", ceil( $PageNo ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$work['return'] = $this->compiled_templates['skin_global']->pagination_compile($work['first_page'],$previous_link,$work['st_dots'],$work['page_span'],$work['end_dots'],$next_link,$data['TOTAL_POSS'],$data['PER_PAGE'], $data['BASE_URL'], $data['no_dropdown'], $use_st);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$work['return'] = $data['L_SINGLE'];\n\t\t}\n\t\n\t\treturn $work['return'];\n\t}", "protected function renderListNavigation()\n {\n $totalPages = ceil($this->totalItems / $this->iLimit);\n\n $content = '';\n\n // Show page selector if not all records fit into one page\n if ($totalPages > 1) {\n $first = $previous = $next = $last = '';\n $listURL = $this->listURL('', $this->table);\n\n // 1 = first page\n $currentPage = floor(($this->firstElementNumber + 1) / $this->iLimit) + 1;\n\n // Compile first, previous, next, last and refresh buttons\n if ($currentPage > 1) {\n $labelFirst = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:first');\n\n $first = '<a href=\"' . $listURL . '&pointer=0\"><img' . IconFactory::skinImg('control_first.gif')\n . 'alt=\"' . $labelFirst . '\" title=\"' . $labelFirst . '\" /></a>';\n } else {\n $first = '<img' . IconFactory::skinImg('control_first_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n if (($currentPage - 1) > 0) {\n $labelPrevious = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:previous');\n\n $previous = '<a href=\"' . $listURL . '&pointer=' . (($currentPage - 2) * $this->iLimit) . '\"><img' . IconFactory::skinImg('control_previous.gif')\n . 'alt=\"' . $labelPrevious . '\" title=\"' . $labelPrevious . '\" /></a>';\n } else {\n $previous = '<img' . IconFactory::skinImg('control_previous_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n if (($currentPage + 1) <= $totalPages) {\n $labelNext = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:next');\n\n $next = '<a href=\"' . $listURL . '&pointer=' . (($currentPage) * $this->iLimit) . '\"><img' . IconFactory::skinImg('control_next.gif')\n . 'alt=\"' . $labelNext . '\" title=\"' . $labelNext . '\" /></a>';\n } else {\n $next = '<img' . IconFactory::skinImg('control_next_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n if ($currentPage != $totalPages) {\n $labelLast = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:last');\n\n $last = '<a href=\"' . $listURL . '&pointer=' . (($totalPages - 1) * $this->iLimit) . '\"><img' . IconFactory::skinImg('control_last.gif')\n . 'alt=\"' . $labelLast . '\" title=\"' . $labelLast . '\" /></a>';\n } else {\n $last = '<img' . IconFactory::skinImg('control_last_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n $pageIndicator = sprintf($GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:pageIndicator'),\n $currentPage, $totalPages);\n\n if ($this->totalItems > ($this->firstElementNumber + $this->iLimit)) {\n $lastElementNumber = $this->firstElementNumber + $this->iLimit;\n } else {\n $lastElementNumber = $this->totalItems;\n }\n $rangeIndicator = '<span class=\"pageIndicator\">'\n . sprintf($GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:rangeIndicator'),\n $this->firstElementNumber + 1, $lastElementNumber, $this->totalItems)\n . '</span>';\n\n $content .= '<div class=\"ttnewsadmin-pagination\">'\n . $first . $previous\n . '&nbsp;'\n . $rangeIndicator . '&nbsp;('\n . $pageIndicator . ')&nbsp;'\n . $next . $last\n . '</div>';\n } // end of if pages > 1\n\n $data = Array();\n $titleColumn = $this->fieldArray[0];\n $data[$titleColumn] = $content;\n\n return ($this->addElement(1, '', $data));\n }", "public function page_numbers() {\n $pages = $this->total_pages();\n $query = htmlentities($this->term);\n $page = $this->pagenumber;\n $next = get_string('next', 'search');\n $back = get_string('back', 'search');\n\n $ret = \"<div align='center' id='search_page_links'>\";\n\n //Back is disabled if we're on page 1\n if ($page > 1) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page-1).\"'>&lt; {$back}</a>&nbsp;\";\n } else {\n $ret .= \"&lt; {$back}&nbsp;\";\n } \n\n //don't <a href> the current page\n for ($i = 1; $i <= $pages; $i++) {\n if ($page == $i) {\n $ret .= \"($i)&nbsp;\";\n } else {\n $ret .= \"<a href='query.php?query_string={$query}&page={$i}'>{$i}</a>&nbsp;\";\n } \n } \n\n //Next disabled if we're on the last page\n if ($page < $pages) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page+1).\"'>{$next} &gt;</a>&nbsp;\";\n } else {\n $ret .= \"{$next} &gt;&nbsp;\";\n } \n\n $ret .= \"</div>\";\n\n //shorten really long page lists, to stop table distorting width-ways\n if (strlen($ret) > 70) {\n $start = 4;\n $end = $page - 5;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n\n $start = $page + 5;\n $end = $pages - 3;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n }\n\n return $ret;\n }", "abstract public function preparePagination();", "function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}", "function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}", "protected function _renderPaginationStart()\n {\n return '<div id=\"ZVHPContainer\"><ul id=\"ZVHPList\">';\n }", "function horizon_theme_paging_nav() {\n\t\t$mid = 2; // Total of items that will show along with the current page.\n\t\t$end = 1; // Total of items displayed for the last few pages.\n\t\t$show = false; // Show all items.\n\n\t\techo horizon_theme_pagination( $mid, $end, false );\n\t}", "function bones_page_navi()\n{\n\tglobal $wp_query;\n\t$bignum = 999999999;\n\tif ($wp_query->max_num_pages <= 1)\n\t\treturn;\n\techo '<nav class=\"pagination\">';\n\techo paginate_links(array(\n\t\t'base' => str_replace($bignum, '%#%', esc_url(get_pagenum_link($bignum))),\n\t\t'format' => '',\n\t\t'current' => max(1, get_query_var('paged')),\n\t\t'total' => $wp_query->max_num_pages,\n\t\t'prev_text' => '&larr;',\n\t\t'next_text' => '&rarr;',\n\t\t'type' => 'list',\n\t\t'end_size' => 0,\n\t\t'mid_size' => 1\n\t));\n\techo '</nav>';\n}", "function getPagingSup($refUrl, $aryOpts, $pgCnt, $curPg) {\n if (in_array('[__atuvc]', $aryOpts)) {\n unset($aryOpts[array_search('[__atuvc]')]);\n array_values($aryOpts);\n }\n $return = '';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n //$return.='<li class=\"pre\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li ><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"pre\">Previous</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n if ($pgCnt == $i && $curPg >= $pgCnt)\n $class.=' bordernone';\n $return.='<li class=\"' . $class . '\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"last\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"nextal\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n //$return.='<li class=\"last\"><a href=\"'.$refUrl.getQueryString($aryOpts).'\" class=\"nextal\">Last</a></li>';\n }\n return $return;\n}", "private function prepareTemplate()\n {\n $template = new TwigFrontendTemplate('pagination');\n\n $template->hasFirst = $this->hasFirst();\n $template->hasPrevious = $this->hasPrevious();\n $template->hasNext = $this->hasNext();\n $template->hasLast = $this->hasLast();\n\n $template->items = $this->getItems();\n $template->page = $this->intPage;\n $template->total = $this->intTotalPages;\n\n $template->first = array\n (\n 'page' => 1,\n 'link' => $this->lblFirst,\n 'href' => $this->linkToPage(1),\n );\n\n $template->previous = array\n (\n 'page' => $this->intPage - 1,\n 'link' => $this->lblPrevious,\n 'href' => $this->linkToPage($this->intPage - 1),\n );\n\n $template->next = array\n (\n 'page' => $this->intPage + 1,\n 'link' => $this->lblNext,\n 'href' => $this->linkToPage($this->intPage + 1),\n );\n\n $template->last = array\n (\n 'page' => $this->intTotalPages,\n 'link' => $this->lblLast,\n 'href' => $this->linkToPage($this->intTotalPages),\n );\n\n return $template;\n }", "function ubc_collab_loop_pagination( $pagination ) {\n\treturn str_replace( \"<li><span class='page-numbers current'\", \"<li class='active'><span class='page-numbers current'\", $pagination );\n\n}", "function pagenationv2($offset) {\r\n $this->offset = NULL;\r\n $this->arrayText = NULL;\r\n $this->pages = NULL;\r\n $this->offset = $offset;\r\n \r\n $temp = $offset;\r\n if ($this->countRecord) {\r\n $this->pages = intval($this->countRecord / $this->limit);\r\n }\r\n if ($this->countRecord % $this->limit) {\r\n $this->pages++;\r\n }\r\n $countRecordArray = count($this->arrayVariable);\r\n $offsetloop = 0;\r\n for ($loop_page = 1; $loop_page <= $this->pages; $loop_page++) {\r\n \r\n if ($countRecordArray >= 1) {\r\n \r\n for ($k = 0; $k < $countRecordArray; $k++) {\r\n $string.=\"<li \";\r\n if($temp==$offsetloop) {\r\n $string.=\" class=active \";\r\n }\r\n $string.=\"><a href=\\\"javascript:void(0)\\\" \"; \r\n if ($this->arrayVariable[$k] == \"offset\") {\r\n $this->arrayVariableValue[$k] = $offsetloop;\r\n \r\n }\r\n $this->arrayText = $this->arrayVariable[$k] . \"=\" . $this->arrayVariableValue[$k] . \"&\" . $this->arrayText;\r\n $string.=\" onClick=\\\"ajaxQuery('\".basename($_SERVER['PHP_SELF']).\"','not',\".$offsetloop.\", '\".$this->arrayText.\"')\\\">\" . $loop_page . \"</a></li>\";\r\n\r\n \r\n }\r\n } else {\r\n $string.=\"Do play play la I know you want to hack it ?\";\r\n }\r\n \r\n $offsetloop = $offsetloop + $this->limit;\r\n \r\n }\r\n return $string;\r\n \r\n }", "function AdvancedPagination($total, $current, $last) {\n $pages = [];\n if ($current < 1) {\n $current = 1;\n } elseif ($current > $last) {\n $current = $last;\n }\n $pages['current'] = $current;\n $pages['previous'] = ($current == 1) ? $current : $current - 1;\n $pages['next'] = ($current == $last) ? $last : $current + 1;\n $pages['last'] = $last;\n $pages['pages'] = [];\n $show = 5; # Number of page links to show\n #\n # At the beginning\n #\n if ($current == 1) {\n if ($pages['next'] == $current) {\n return $pages; # if one page only\n }\n for ($i = 0; $i < $show; $i++) {\n if ($i == $last) {\n break;\n }\n array_push($pages['pages'], $i + 1);\n }\n return $pages;\n }\n #\n # At the end\n #\n if ($current == $last) {\n $start = $last - $show;\n if ($start < 1) {\n $start = 0;\n }\n for ($i = $start; $i < $last; $i++) {\n array_push($pages['pages'], $i + 1);\n }\n return $pages;\n }\n #\n # In the middle\n #\n $start = $current - $show;\n if (($total > 5) && ($current > 3)) $start = $current - 3;\n if (($last - $current) < 2) $start = $current - 4;\n if ($start < 1) $start = 0;\n for ($i = $start; $i < $current; $i++) {\n array_push($pages['pages'], $i + 1);\n }\n for ($i = ($current + 1); $i < ($current + $show); $i++) {\n if ($i == ($last + 1)) {\n break;\n }\n array_push($pages['pages'], $i);\n }\n return $pages;\n}", "public function generatePagination()\n {\n $this->buffer = [];\n\n if ($this->currentPage != 1) {\n $this->generateLeftButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n\n $this->generatePages();\n\n if ($this->currentPage != self::getPages($this->records, $this->recordsInPage)) {\n $this->generateRightButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n }", "private function print_pagination_links() {\n\n\t\tif ( 1 < $this->total_pages ) {\n\t\t\t?>\n\t\t\t<span class=\"pagination-links\">\n\t\t\t\t<?php\n\t\t\t\t$this->print_first_page_link();\n\t\t\t\t$this->print_previous_page_link();\n\t\t\t\t$this->print_current_page_display();\n\t\t\t\t$this->print_next_page_link();\n\t\t\t\t$this->print_last_page_link();\n\t\t\t\t?>\n\t\t\t</span>\n\t\t\t<?php\n\t\t}\n\t}", "public function createPagination($total_rows, $base_url, $cur_page, $per_page = '', $num_links = '') {\n if ($per_page == '') {\n $per_page = 10;\n }\n if ($num_links == '') {\n $num_links = 5;\n }\n /* Loading the pagination library */\n $this->load->library('pagination');\n\n /* Setting the config for pagination */\n $config['base_url'] = $base_url;\n $config['total_rows'] = $total_rows;\n $config['per_page'] = $per_page;\n $config['cur_page'] = $cur_page;\n $config['num_links'] = $num_links;\n $config['full_tag_open'] = '<ul style=\"display: inline-block;\">';\n $config['full_tag_close'] = '</ul>';\n\n $config['first_tag_open'] = '<li>';\n $config['first_link'] = '<< Start';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_link'] = 'End >> ';\n $config['last_tag_close'] = '</li></ul>';\n $config['next_tag_open'] = '<li>';\n $config['next_link'] = \"Next&gt;\";\n $config['next_tag_close'] = '</li>';\n $config['prev_tag_open'] = '<li>';\n $config['prev_link'] = \"&lt;Previous\";\n $config['prev_tag_close'] = '</li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"active\"><a href=\"javascript:void(0);\">';\n $config['cur_tag_close'] = '</a></li>';\n /* Initializing the library */\n $this->pagination->initialize($config);\n /* creating the links */\n $links = $this->pagination->create_links();\n\n /* returning the links */\n $error = $this->db->_error_message();\n $error_number = $this->db->_error_number();\n if ($error) {\n $controller = $this->router->fetch_class();\n $method = $this->router->fetch_method();\n $error_details = array(\n 'error_name' => $error,\n 'error_number' => $error_number,\n 'model_name' => 'Common_Model',\n 'model_method_name' => 'createPagination',\n 'controller_name' => $controller,\n 'controller_method_name' => $method\n );\n $this->common_model->errorSendEmail($error_details);\n redirect(base_url() . 'page-not-found'); //create this route\n }\n return $links;\n }", "function base_pagination() {\n\tglobal $wp_query;\n\n\t$big = 999999999; // This needs to be an unlikely integer\n\n\t// For more options and info view the docs for paginate_links()\n\t// http://codex.wordpress.org/Function_Reference/paginate_links\n\t$paginate_links = paginate_links( array(\n\t\t'base' => str_replace( $big, '%#%', get_pagenum_link($big) ),\n\t\t'current' => max( 1, get_query_var('paged') ),\n\t\t'total' => $wp_query->max_num_pages,\n\t\t'prev_text' => __('PREVIOUS'),\n\t\t'next_text' => __('NEXT'),\n\t\t'end_size' => 1,\n\t\t'mid_size' => 2,\n 'before_page_number' => '<span class=\"page-number\">',\n 'after_page_number' => '</span>',\n\t) );\n\n\t// Display the pagination if more than one page is found\n\tif ( $paginate_links ) {\n\t\techo '<div class=\"pagination-wrapper\"><div class=\"pagination\">';\n\t\techo $paginate_links;\n\t\techo '</div><!--// end .pagination --></div>';\n\t}\n}", "function page_links($url, $nitems, $items_per_page, $start){\n // How many pages to potentially show before and after this one:\n $preshow = 3;\n $postshow = 3;\n\n $x = \"\";\n \n if ($nitems <= $items_per_page) return \"\";\n $npages = ceil($nitems / $items_per_page);\n $curpage = ceil($start / $items_per_page);\n\n // If this is not the first page, display \"previous\"\n //\n if ($curpage > 0){\n $x .= page_link(\n $url, $curpage-1, $items_per_page,\n tra(\"Previous\").\" &middot; \"\n );\n }\n\n if ($curpage - $preshow > 0) {\n $x .= page_link($url, 0, $items_per_page, \"1\");\n if ($curpage - $preshow > 1) {\n $x .= \" . . . \";\n } else {\n $x .= \" &middot; \";\n }\n }\n // Display a list of pages surrounding this one\n //\n for ($i=$curpage-$preshow; $i<=$curpage+$postshow; $i++){\n $page_str = (string)($i+1);\n if ($i < 0) continue;\n if ($i >= $npages) break;\n\n if ($i == $curpage) {\n $x .= \"<b>$page_str</b>\";\n } else {\n $x .= page_link($url, $i, $items_per_page, $page_str);\n }\n if ($i == $npages-1) break;\n if ($i == $curpage+$postshow) break;\n $x .= \" &middot; \";\n }\n\n if ($curpage + $postshow < $npages-1) {\n $x .= \" . . . \";\n $x .= page_link($url, $npages-1, $items_per_page, $npages);\n }\n // If there is a next page\n //\n if ($curpage < $npages-1){\n $x .= page_link(\n $url, $curpage+1, $items_per_page,\n \" &middot; \".tra(\"Next\")\n );\n }\n $x .= \"\\n\";\n return $x;\n}", "function getPagingfront($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"pagination\"><ul>';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a></li>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a></li>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<li><a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"graybutton pagelink';\n if ($curPg == $i)\n $return.=' active';\n $return.='\" >' . $i . '</a></li>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a></li>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<li class=\"prev\"><a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a></li>';\n }\n $return.='</ul></div>';\n return $return;\n}", "function pagination($pages = '', $range = 1)\n{ \n\t$showitems = ($range * 2)+1; \n\n\tglobal $paged;\n\tif(empty($paged)) $paged = 1;\n\n\tif($pages == '')\n\t{\n\t\tglobal $wp_query;\n\t\t$pages = $wp_query->max_num_pages;\n\t\tif(!$pages)\n\t\t{\n\t\t\t$pages = 1;\n\t\t}\n\t} \n\n\tif(1 != $pages)\n\t{\n\t\techo '<div class=\"col-md-12 col-sm-12 text-center fund_pagination\">';\n\t\techo '<nav aria-label=\"Page navigation\">';\n\t\techo '<ul class=\"pagination\">';\n\n //if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<a href='\".get_pagenum_link(1).\"'>&laquo; First</a>\";\n\t\tif($paged > 1 && $showitems < $pages) \n\n\t\t\techo \"<li><a href='\".get_pagenum_link($paged - 1).\"' aria-label=\\\"Previous\\\"><span aria-hidden=\\\"true\\\">«</span></a>\";\n\n\t\tfor ($i=1; $i <= $pages; $i++)\n\t\t{\n\t\t\tif (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\n\t\t\t{\n\t\t\t\techo ($paged == $i)? \"<li class=\\\"active-2\\\"><a>\".$i.\"</a></li>\":\"<li><a href='\".get_pagenum_link($i).\"' class=\\\"inactive\\\">\".$i.\"</a></li>\";\n\t\t\t}\n\t\t}\n\n\t\tif ($paged < $pages && $showitems < $pages) echo \"<li><a aria-label=\\\"Next\\\" href=\\\"\".get_pagenum_link($paged + 1).\"\\\"> <span aria-hidden=\\\"true\\\">»</span></a>\"; \n\n\n\t\techo '</ul>';\n\t\techo '</nav>';\n\t\techo \"</div>\\n\";\n\t}\n}", "public function show()\n {\n $html = '<div class=\"page_selector\">';\n\n $startPage = $this->currentPage - 5;\n $startPage > 1 ? $html .= '<span><a href=\"' . $this->generateUrl(1) . '\">1</a></span><span class=\"more_page\">...</span>'\n : $startPage = 1;\n for ($i = $startPage; $i < $this->currentPage; $i++) {\n $html .= '<span><a href=\"' . $this->generateUrl($i) . '\">' . $i . '</a></span>';\n }\n\n $html .= '<span><div class=\"current_page\">' . $this->currentPage . '</div></span>';\n\n $endPage = $this->currentPage + 5;\n $endPage < $this->totalPage ? '' : $endPage = $this->totalPage;\n for ($i = $this->currentPage + 1; $i <= $endPage; $i++) {\n $html .= '<span><a href=\"' . $this->generateUrl($i) . '\">' . $i . '</a></span>';\n }\n $endPage != $this->totalPage ? $html .= '<span class=\"more_page\">...</span><span><a href=\"' . $this->generateUrl($this->totalPage)\n . '\">' . $this->totalPage . '</a></span>' : '';\n\n return $html . '<span><div class=\"total_page\">total ' . $this->totalPage . ' page</div></span></div>';\n }", "public function generatePagination($total_pages, $limit, $page, $baseUrl){ $adjacents = 3;\n if($page) \n $start = ($page - 1) * $limit; \t\t\t//first item to display on this page\n else\n $start = 0;\t\t\t\t\t\t\t\t//if no page var is given, set start to 0\n \n /* Setup page vars for display. */\n if ($page == 0) $page = 1;\t\t\t\t\t//if no page var is given, default to 1.\n $prev = $page - 1;\t\t\t\t\t\t\t//previous page is page - 1\n $next = $page + 1;\t\t\t\t\t\t\t//next page is page + 1\n $lastpage = ceil($total_pages/$limit);\t\t//lastpage is = total pages / items per page, rounded up.\n $lpm1 = $lastpage - 1;\t\t\t\t\t\t//last page minus 1\n \n /* \n Now we apply our rules and draw the pagination object. \n We're actually saving the code to a variable in case we want to draw it more than once.\n */\n $pagination = \"\";\n if($lastpage > 1)\n {\t\n $pagination .= \"<ul class=\\\"pagination pagination-sm\\\">\";\n //previous button\n if ($page > 1) \n $pagination.= \"<li class=\\\"page-item\\\">\n <a href=\\\"\" . $baseUrl . \"?page=$prev\\\" class=\\\"page-link\\\" aria-label=\\\"Previous\\\">\n <span aria-hidden=\\\"true\\\">&laquo;</span>\n </a>\n </li>\";\n // <a href=\\\"diggstyle.php?page=$prev\\\">« previous</a>\";\n else\n $pagination.= \"<li class=\\\"page-item\\\">\n <a href=\\\"#\\\" class=\\\"page-link\\\" aria-label=\\\"Previous\\\">\n <span aria-hidden=\\\"true\\\">&laquo;</span>\n </a>\n </li>\";\t\n \n //pages\t\n if ($lastpage < 7 + ($adjacents * 2))\t//not enough pages to bother breaking it up\n {\t\n for ($counter = 1; $counter <= $lastpage; $counter++)\n {\n if ($counter == $page)\n $pagination.= '<li class=\"page-item active\"><a class=\"page-link\" href=\"#\">' . $counter . '</a></li>';\n // $pagination.= \"<span class=\\\"current\\\">$counter</span>\";\n else\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $counter . '\">' . $counter . '</a></li>';\t\n // $pagination.= \"<a href=\\\"diggstyle.php?page=$counter\\\">$counter</a>\";\t\t\t\t\t\n }\n }\n elseif($lastpage > 5 + ($adjacents * 2))\t//enough pages to hide some\n {\n //close to beginning; only hide later pages\n if($page < 1 + ($adjacents * 2))\t\t\n {\n for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)\n {\n if ($counter == $page)\n $pagination.= '<li class=\"page-item active\"><a class=\"page-link\" href=\"#\">' . $counter . '</a></li>';\n else\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $counter . '\">' . $counter . '</a></li>';\t\t\t\n }\n $pagination.= \"...\";\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $lpm1 . '\">' . $lpm1 . '</a></li>';\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $lastpage . '\">' . $lastpage . '</a></li>';\n //\"<a href=\\\"diggstyle.php?page=$lpm1\\\">$lpm1</a>\";\n // $pagination.= \"<a href=\\\"diggstyle.php?page=$lastpage\\\">$lastpage</a>\";\t\t\n }\n //in middle; hide some front and some back\n elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))\n {\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=1\">1</a></li>';\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=2\">2</a></li>';\n // $pagination.= \"<a href=\\\"diggstyle.php?page=1\\\">1</a>\";\n // $pagination.= \"<a href=\\\"diggstyle.php?page=2\\\">2</a>\";\n $pagination.= \"...\";\n for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)\n {\n if ($counter == $page)\n $pagination.= '<li class=\"page-item active\"><a class=\"page-link\" href=\"#\">' . $counter . '</a></li>';\n // $pagination.= \"<span class=\\\"current\\\">$counter</span>\";\n else\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $counter . '\">' . $counter . '</a></li>';\t\t\n // $pagination.= \"<a href=\\\"diggstyle.php?page=$counter\\\">$counter</a>\";\t\t\t\t\t\n }\n $pagination.= \"...\";\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $lpm1 . '\">' . $lpm1 . '</a></li>';\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $lastpage . '\">' . $lastpage . '</a></li>';\n // $pagination.= \"<a href=\\\"diggstyle.php?page=$lpm1\\\">$lpm1</a>\";\n // $pagination.= \"<a href=\\\"diggstyle.php?page=$lastpage\\\">$lastpage</a>\";\t\t\n }\n //close to end; only hide early pages\n else\n {\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=1\">1</a></li>';\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=2\">2</a></li>';\n // $pagination.= \"<a href=\\\"diggstyle.php?page=1\\\">1</a>\";\n // $pagination.= \"<a href=\\\"diggstyle.php?page=2\\\">2</a>\";\n $pagination.= \"...\";\n for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)\n {\n if ($counter == $page)\n $pagination.= '<li class=\"page-item active\"><a class=\"page-link\" href=\"#\">' . $counter . '</a></li>';\n else\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $counter . '\">' . $counter . '</a></li>';\t\t\n }\n }\n }\n \n //next button\n if ($page < $counter - 1) \n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"' . $baseUrl . '?page=' . $next . '\"><span aria-hidden=\"true\">&raquo;</span></a></li>';\t\t\n // $pagination.= \"<a href=\\\"diggstyle.php?page=$next\\\">next »</a>\";\n else\n // $pagination.= \"<span class=\\\"disabled\\\">next »</span>\";\n $pagination.= '<li class=\"page-item\"><a class=\"page-link\" href=\"#\"><span aria-hidden=\"true\">&raquo;</span></a></li>';\n $pagination.= \"</ul>\\n\";\t\t\n }\n return $pagination;\n }", "function pager($page, $total, $pnumber, $page_link, $parameters)\n {\n $number = (int)($total/$pnumber);\n if((float)($total/$pnumber) - $number != 0) $number++;\n // Check on left links\n if($page - $page_link > 1)\n {\n echo \"<a href=$_SERVER[PHP_SELF]?page=1{$parameters}> <nobr>[1-$pnumber]</nobr></a>&nbsp;<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;\";\n // Have one\n for($i = $page - $page_link; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n else\n {\n // Have no\n for($i = 1; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n // Check on right links\n if($page + $page_link < $number)\n {\n // Have one\n for($i = $page; $i<=$page + $page_link; $i++)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n echo \"<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;<a href=$_SERVER[PHP_SELF]?page=$number{$parameters}> <nobr>[\".(($number - 1)*$pnumber + 1).\"-$total]</nobr></a>&nbsp;\";\n }\n else\n {\n // Have no\n for($i = $page; $i<=$number; $i++)\n {\n if($number == $i)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-$total]&nbsp;</nobr></em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}>[\".(($i - 1)*$pnumber + 1).\"-$total]</a>&nbsp;\";\n }\n else\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n }\n //echo \"<br><br>\";\n }", "function emm_paginate($args = null) {\n\t$defaults = array(\n\t\t'page' => null, 'pages' => null, \n\t\t'range' => 3, 'gap' => 3, 'anchor' => 1,\n\t\t'before' => '<ul class=\"pagination\">', 'after' => '</ul>',\n\t\t'title' => __('<li class=\"unavailable\"></li>'),\n\t\t'nextpage' => __('&raquo;'), 'previouspage' => __('&laquo'),\n\t\t'echo' => 1\n\t);\n\n\t$r = wp_parse_args($args, $defaults);\n\textract($r, EXTR_SKIP);\n\n\tif (!$page && !$pages) {\n\t\tglobal $wp_query;\n\n\t\t$page = get_query_var('paged');\n\t\t$page = !empty($page) ? intval($page) : 1;\n\n\t\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\t\t$pages = intval(ceil($wp_query->found_posts / $posts_per_page));\n\t}\n\t\n\t$output = \"\";\n\tif ($pages > 1) {\t\n\t\t$output .= \"$before<li>$title</li>\";\n\t\t$ellipsis = \"<li class='unavailable'>...</li>\";\n\n\t\tif ($page > 1 && !empty($previouspage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page - 1) . \"'>$previouspage</a></li>\";\n\t\t}\n\t\t\n\t\t$min_links = $range * 2 + 1;\n\t\t$block_min = min($page - $range, $pages - $min_links);\n\t\t$block_high = max($page + $range, $min_links);\n\t\t$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;\n\t\t$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;\n\n\t\tif ($left_gap && !$right_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $pages, $page)\n\t\t\t);\n\t\t}\n\t\telse if ($left_gap && $right_gap) {\n\t\t\t$output .= sprintf('%s%s%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $block_high, $page), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse if ($right_gap && !$left_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $block_high, $page),\n\t\t\t\t$ellipsis,\n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t$output .= emm_paginate_loop(1, $pages, $page);\n\t\t}\n\n\t\tif ($page < $pages && !empty($nextpage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page + 1) . \"'>$nextpage</a></li>\";\n\t\t}\n\n\t\t$output .= $after;\n\t}\n\n\tif ($echo) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}", "function emm_paginate($args = null) {\n\t$defaults = array(\n\t\t'page' => null, 'pages' => null, \n\t\t'range' => 3, 'gap' => 3, 'anchor' => 1,\n\t\t'before' => '<ul class=\"pagination\">', 'after' => '</ul>',\n\t\t'title' => __('<li class=\"unavailable\"></li>'),\n\t\t'nextpage' => __('&raquo;'), 'previouspage' => __('&laquo'),\n\t\t'echo' => 1\n\t);\n\n\t$r = wp_parse_args($args, $defaults);\n\textract($r, EXTR_SKIP);\n\n\tif (!$page && !$pages) {\n\t\tglobal $wp_query;\n\n\t\t$page = get_query_var('paged');\n\t\t$page = !empty($page) ? intval($page) : 1;\n\n\t\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\t\t$pages = intval(ceil($wp_query->found_posts / $posts_per_page));\n\t}\n\t\n\t$output = \"\";\n\tif ($pages > 1) {\t\n\t\t$output .= \"$before<li>$title</li>\";\n\t\t$ellipsis = \"<li class='unavailable'>...</li>\";\n\n\t\tif ($page > 1 && !empty($previouspage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page - 1) . \"'>$previouspage</a></li>\";\n\t\t}\n\t\t\n\t\t$min_links = $range * 2 + 1;\n\t\t$block_min = min($page - $range, $pages - $min_links);\n\t\t$block_high = max($page + $range, $min_links);\n\t\t$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;\n\t\t$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;\n\n\t\tif ($left_gap && !$right_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $pages, $page)\n\t\t\t);\n\t\t}\n\t\telse if ($left_gap && $right_gap) {\n\t\t\t$output .= sprintf('%s%s%s%s%s', \n\t\t\t\temm_paginate_loop(1, $anchor), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop($block_min, $block_high, $page), \n\t\t\t\t$ellipsis, \n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse if ($right_gap && !$left_gap) {\n\t\t\t$output .= sprintf('%s%s%s', \n\t\t\t\temm_paginate_loop(1, $block_high, $page),\n\t\t\t\t$ellipsis,\n\t\t\t\temm_paginate_loop(($pages - $anchor + 1), $pages)\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\t$output .= emm_paginate_loop(1, $pages, $page);\n\t\t}\n\n\t\tif ($page < $pages && !empty($nextpage)) {\n\t\t\t$output .= \"<li><a href='\" . get_pagenum_link($page + 1) . \"'>$nextpage</a></li>\";\n\t\t}\n\n\t\t$output .= $after;\n\t}\n\n\tif ($echo) {\n\t\techo $output;\n\t}\n\n\treturn $output;\n}", "public function getPagesLinks()\r\n\t{\r\n\t\t$app = JFactory::getApplication();\r\n\t\t// Yjsg instance\r\n\t\t$yjsg = Yjsg::getInstance(); \r\n\t\t\r\n\t\t// Build the page navigation list.\r\n\t\t$data = $this->_buildDataObject();\r\n\r\n\t\t$list = array();\r\n\t\t$list['prefix'] = $this->prefix;\r\n\r\n\t\t$itemOverride = false;\r\n\t\t$listOverride = false;\r\n\r\n\t\t$chromePath \t= JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';\r\n\t\t//yjsg start\r\n\t\tif (!file_exists($chromePath)){\r\n\t\t\tif($yjsg->preplugin()){\r\n\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . 'pagination.php';\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . 'pagination.php';\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//yjsg end\r\n\t\tif (file_exists($chromePath))\r\n\t\t{\r\n\t\t\tinclude_once $chromePath;\r\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive'))\r\n\t\t\t{\r\n\t\t\t\t$itemOverride = true;\r\n\t\t\t}\r\n\t\t\tif (function_exists('pagination_list_render'))\r\n\t\t\t{\r\n\t\t\t\t$listOverride = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Build the select list\r\n\t\tif ($data->all->base !== null)\r\n\t\t{\r\n\t\t\t$list['all']['active'] = true;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['all']['active'] = false;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\r\n\t\t}\r\n\r\n\t\tif ($data->start->base !== null)\r\n\t\t{\r\n\t\t\t$list['start']['active'] = true;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['start']['active'] = false;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\r\n\t\t}\r\n\t\tif ($data->previous->base !== null)\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = true;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = false;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\r\n\t\t}\r\n\r\n\t\t$list['pages'] = array(); //make sure it exists\r\n\t\tforeach ($data->pages as $i => $page)\r\n\t\t{\r\n\t\t\tif ($page->base !== null)\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = true;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = false;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($data->next->base !== null)\r\n\t\t{\r\n\t\t\t$list['next']['active'] = true;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['next']['active'] = false;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\r\n\t\t}\r\n\r\n\t\tif ($data->end->base !== null)\r\n\t\t{\r\n\t\t\t$list['end']['active'] = true;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['end']['active'] = false;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\r\n\t\t}\r\n\r\n\t\tif ($this->total > $this->limit)\r\n\t\t{\r\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "function redlisted_pagination($args = null)\r\n{\r\n\r\n $defaults = array(\r\n 'page' => null, 'pages' => null, \r\n 'range' => 3, 'gap' => 3, 'anchor' => 1,\r\n 'title' => __(''),\r\n 'nextpage' => __('&raquo;'), 'previouspage' => __('&laquo'),\r\n 'echo' => 1\r\n );\r\n\r\n //determine if any args were passed and default to those vals\r\n $r = wp_parse_args($args, $defaults);\r\n\r\n //Are we starting with a blank slate?\r\n if (! isset($r['page']) && ! isset($r['pages'])) {\r\n global $wp_query;\r\n\r\n $r['page'] = (get_query_var('paged')) ? $get_query_var('page') : 1;\r\n $posts_per_page = intval(get_query_var('posts_per_page'));\r\n $r['pages'] = intval(ceil($wp_query->found_posts / $posts_per_page));\r\n }\r\n\r\n //I'm not real sure how output could already be set to something at this point, but let's just assume stupid things happen sometimes\t\r\n $output = \"\";\r\n\r\n //Do we have more than one page? Because if not this has all been a little pointless.\r\n if ($r['pages'] > 1) {\t\r\n $output .= \"<div class='redlisted-pages'><span class='redlisted-pages-title'>\".$r['title'].\"</span>\";\r\n $ellipsis = \"<span class='ellipsis'>...</span>\";\r\n \r\n //Set the previous link\r\n if ($r['page'] > 1 && isset($r['previouspage'])) {\r\n $output .= \"<a href='\" . get_pagenum_link($r['page'] - 1) . \"' class='prev-page'>\".$r['previouspage'].\"</a>\";\r\n }\r\n\r\n \t\r\n $min_links = $r['range'] * 2 + 1;\r\n $block_min = min($r['page'] - $r['range'], $r['pages'] - $min_links);\r\n $block_max = max($r['page'] + $r['range'], $min_links);\r\n $left_gap = (($r['block_min'] - $r['anchor'] - $r['gap']) > 0) ? $r['ellipsis'] : '';\r\n $right_gap = (($block_max + $r['anchor'] + $r['gap']) < $r['pages']) ? $r['ellipsis'] : '';\r\n\r\n $first_stop = ($left_gap == $r['ellipsis']) ? $r['anchor'] : $block_max;\r\n $second_stop = (($left_gap == $r['ellipsis']) && ($right_gap == $r['ellipsis'])) ? $block_max : 0;\r\n\r\n for($i = 1; $i < $first_stop; $i++) {\r\n $output .= is_current_page($i);\r\n }\r\n\r\n $output .= $left_gap;\r\n\r\n for($i = $block_min; $i < $second_stop; $i++) {\r\n $output .= is_current_page($i);\r\n }\r\n\r\n $output .= $right_gap;\r\n\r\n for($i = ($r['pages'] - $r['anchor'] + 1); $i < $r['pages']; $i++) {\r\n $output .= is_current_page($i);\r\n }\r\n \r\n //Set the next link\r\n if ($r['page'] < $r['pages'] && isset($r['nextpage'])) {\r\n $output .= \"<a href='\" . get_pagenum_link($r['page'] + 1) . \"' class='next-page'>\".$r['nextpage'].\"</a>\";\r\n }\r\n \r\n $output .= $r['after'];\r\n }\r\n if ($r['echo']) {\r\n echo $output;\r\n } else {\r\n return $output;\r\n }\r\n}", "function displayPaging() \r\n {\r\n $self = $_SERVER['PHP_SELF'];\r\n if($this->openPage<=0) {\r\n $next = 2;\r\n }\r\n\r\n else {\r\n $next = $this->openPage+1;\r\n }\r\n $prev = $this->openPage-1;\r\n $last = $this->pages;\r\n\t\t$queryString = '';\r\n\t\t\r\n\t\tif ($_GET['keywords']!= '') {\r\n\t\t\t$queryString .= '&keywords='.$_GET['keywords'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['sort'] != '') {\r\n\t\t\t$queryString .= '&sort='.$_GET['sort'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['filters']!='') {\r\n\t\t\t$queryString .= '&filters='.$_GET['filters'];\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif ($_GET['cat']!='') {\r\n\t\t\t$queryString .= '&cat='.$_GET['cat'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['media']!='') {\r\n\t\t\t$queryString .= '&media='.$_GET['media'];\r\n\t\t}\r\n\t\tif ($_GET['content']!='') {\r\n\t\t\t$queryString .= '&content='.$_GET['content'];\r\n\t\t}\r\n\t\tif ($_GET['genre']!='') {\r\n\t\t\t$queryString .= '&genre='.$_GET['genre'];\r\n\t\t}\r\n\r\n if($this->openPage > 1) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=1\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\techo \"First</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n \techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$prev\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\techo \"Prev</a>]&nbsp;&nbsp;\";\r\n }\r\n else {\r\n echo \"[First<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Prev]&nbsp;&nbsp;\";\r\n }\r\n for($i=1;$i<=$this->pages;$i++) {\r\n if($i == $this->openPage) \r\n\t\t\t\tif ($i==1)\r\n \techo \"$i\";\r\n\t\t\t\telse \r\n\t\t\t\t\t echo \", $i\";\r\n else\r\n\t\t\tif ($i==1) {\r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n\t\t\t\t}else{ \r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n } }\r\n if($this->openPage < $this->pages) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$next\".$queryString.\"\\\">Next</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$last\".$queryString.\"\\\">Last</a>]\";\r\n }\r\n else {\r\n echo \"&nbsp;&nbsp;[Next<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Last]\";\r\n } \r\n }", "function magillDev_pagination()\n{\n\tglobal $wp_query;\n\t$big = 999999999;\n\techo paginate_links(array(\n\t\t'base' => str_replace($big, '%#%', get_pagenum_link($big)),\n\t\t'format' => '?paged=%#%',\n\t\t'current' => max(1, get_query_var('paged')),\n\t\t'total' => $wp_query->max_num_pages\n\t));\n}", "function base_pagination() {\n\tglobal $wp_query;\n \n\t$big = 999999999; // This needs to be an unlikely integer\n \n\t// For more options and info view the docs for paginate_links()\n\t// http://codex.wordpress.org/Function_Reference/paginate_links\n\t$paginate_links = paginate_links( array(\n\t\t'base' => str_replace( $big, '%#%', get_pagenum_link($big) ),\n\t\t'current' => max( 1, get_query_var('paged') ),\n\t\t'total' => $wp_query->max_num_pages,\n\t\t'prev_text' => __('Previous'),\n\t\t'next_text' => __('Next'),\n\t\t'end_size' => 4,\n\t\t'mid_size' => 2\n\t) );\n \n\t// Display the pagination if more than one page is found\n\tif ( $paginate_links ) {\n\t\techo '<div class=\"pagination\">';\n\t\techo $paginate_links;\n\t\techo '</div><!--// end .pagination -->';\n\t}\n}", "function pagination($title, $start, $start_name, $max, $max_name, $max_rows, $keep_post = false, $max_page_links = 5, $_selectors = null, $hash = '')\n{\n inform_non_canonical_parameter($max_name);\n inform_non_canonical_parameter($start_name);\n\n if (get_page_name() == 'members') {\n // Don't allow guest bots to probe too deep into the forum index, it gets very slow; the XML Sitemap is for guiding to topics like this\n if (($start > $max * 5) && (is_guest()) && (!is_null(get_bot_type()))) {\n access_denied('NOT_AS_GUEST');\n }\n }\n\n $post_array = array();\n if ($keep_post) {\n foreach ($_POST as $key => $val) {\n if (is_array($val)) {\n continue;\n }\n if (get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n $post_array[$key] = $val;\n }\n }\n\n $get_url = get_self_url(true);\n\n // How many to show per page\n if (is_null($_selectors)) {\n $_selectors = array(10, 25, 50, 80);\n }\n if (has_privilege(get_member(), 'remove_page_split')) {\n if (get_param_integer('keep_avoid_memory_limit', 0) == 1) {\n $_selectors[] = $max_rows;\n }\n }\n $_selectors[] = $max;\n sort($_selectors);\n $_selectors = array_unique($_selectors);\n $selectors = new Tempcode();\n foreach ($_selectors as $selector_value) {\n if ($selector_value > $max_rows) {\n $selector_value = $max_rows;\n }\n $selected = ($max == $selector_value);\n $selectors->attach(do_template('PAGINATION_PER_PAGE_OPTION', array('_GUID' => '1a0583bab42257c60289459ce1ac1e05', 'SELECTED' => $selected, 'VALUE' => strval($selector_value), 'NAME' => integer_format($selector_value))));\n\n if ($selector_value == $max_rows) {\n break;\n }\n }\n $hidden = build_keep_form_fields('_SELF', true, array($max_name, $start_name));\n $per_page = do_template('PAGINATION_PER_PAGE', array('_GUID' => '1993243727e58347d1544279c5eba496', 'HASH' => ($hash == '') ? null : $hash, 'HIDDEN' => $hidden, 'URL' => $get_url, 'MAX_NAME' => $max_name, 'SELECTORS' => $selectors));\n $GLOBALS['INCREMENTAL_ID_GENERATOR']++;\n\n if ($max < $max_rows) { // If they don't all fit on one page\n $parts = new Tempcode();\n $num_pages = ($max == 0) ? 1 : intval(ceil(floatval($max_rows) / floatval($max)));\n\n // Link to first\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => running_script('index') ? null : 0);\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $first = do_template('PAGINATION_CONTINUE_FIRST', array('_GUID' => 'f5e510da318af9b37c3a4b23face5ae3', 'TITLE' => $title, 'P' => strval(1), 'FIRST_URL' => $cat_url));\n } else {\n $first = new Tempcode();\n }\n\n // Link to previous\n if ($start > 0) {\n $url_array = array('page' => '_SELF', $start_name => strval(max($start - $max, 0)));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $previous = do_template('PAGINATION_PREVIOUS_LINK', array('_GUID' => 'ec4d4da9677b5b9c8cea08676337c6eb', 'TITLE' => $title, 'P' => integer_format(intval($start / $max)), 'URL' => $cat_url));\n } else {\n $previous = do_template('PAGINATION_PREVIOUS');\n }\n\n // CALCULATIONS FOR CROPPING OF SEQUENCE\n // $from is the index number (one less than written page number) we start showing page-links from\n // $to is the index number (one less than written page number) we stop showing page-links from\n if ($max != 0) {\n $max_dispersal = $max_page_links / 2;\n $from = max(0, intval(floatval($start) / floatval($max) - $max_dispersal));\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal)));\n $dif = (floatval($start) / floatval($max) - $max_dispersal);\n if ($dif < 0.0) { // We have more forward range than max dispersal as we're near the start\n $to = intval(ceil(min(floatval($max_rows) / floatval($max), floatval($start) / floatval($max) + $max_dispersal - $dif)));\n }\n } else {\n $from = 0;\n $to = 0;\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($from > 0) {\n $continues_left = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_left = new Tempcode();\n }\n\n $bot = (is_guest()) && (!is_null(get_bot_type()));\n\n // Show the page number jump links\n for ($x = $from; $x < $to; $x++) {\n $url_array = array('page' => '_SELF', $start_name => ($x == 0) ? null : strval($x * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n if ($x * $max == $start) {\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER', array('_GUID' => '13cdaf548d5486fb8d8ae0d23b6a08ec', 'P' => strval($x + 1))));\n } else {\n $rel = null;\n if ($x == 0) {\n $rel = 'first';\n }\n $parts->attach(do_template('PAGINATION_PAGE_NUMBER_LINK', array('_GUID' => 'a6d1a0ba93e3b7deb6fe6f8f1c117c0f', 'NOFOLLOW' => ($x * $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'URL' => $cat_url, 'P' => strval($x + 1))));\n }\n }\n\n // Indicate that the sequence is incomplete with an ellipsis\n if ($to < $num_pages) {\n $continues_right = do_template('PAGINATION_CONTINUE');\n } else {\n $continues_right = new Tempcode();\n }\n\n // Link to next\n if (($start + $max) < $max_rows) {\n $url_array = array('page' => '_SELF', $start_name => strval($start + $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $p = ($max == 0) ? 1.0 : ($start / $max + 2);\n $rel = null;\n if (($start + $max * 2) > $max_rows) {\n $rel = 'last';\n }\n $next = do_template('PAGINATION_NEXT_LINK', array('_GUID' => '6da9b396bdd46b7ee18c05b5a7eb4d10', 'NOFOLLOW' => ($start + $max > $max * 5) && ($bot), 'REL' => $rel, 'TITLE' => $title, 'NUM_PAGES' => integer_format($num_pages), 'P' => integer_format(intval($p)), 'URL' => $cat_url));\n } else {\n $next = do_template('PAGINATION_NEXT');\n }\n\n // Link to last\n if ($start + $max < $max_rows) {\n $url_array = array('page' => '_SELF', ($num_pages - 1 == 0) ? null : $start_name => strval(($num_pages - 1) * $max));\n $cat_url = _build_pagination_cat_url($url_array, $post_array, $hash);\n $last = do_template('PAGINATION_CONTINUE_LAST', array('_GUID' => '2934936df4ba90989e949a8ebe905522', 'TITLE' => $title, 'P' => strval($num_pages), 'LAST_URL' => $cat_url));\n } else {\n $last = new Tempcode();\n }\n\n // Page jump dropdown, if we had to crop\n if ($num_pages > $max_page_links) {\n $list = new Tempcode();\n $pg_start = 0;\n $pg_to = $num_pages;\n $pg_at = intval(floatval($start) / floatval($max));\n if ($pg_to > 100) {\n $pg_start = max($pg_at - 50, 0);\n $pg_to = $pg_start + 100;\n }\n if ($pg_start != 0) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n for ($i = $pg_start; $i < $pg_to; $i++) {\n $list->attach(form_input_list_entry(strval($i * $max), ($i * $max == $start), strval($i + 1)));\n }\n if ($pg_to != $num_pages) {\n $list->attach(form_input_list_entry('', false, '...', false, true));\n }\n $dont_auto_keep = array();\n $hidden = build_keep_form_fields('_SELF', true, $dont_auto_keep);\n $pages_list = do_template('PAGINATION_LIST_PAGES', array('_GUID' => '9e1b394763619433f23b8ed95f5ac134', 'URL' => $get_url, 'HIDDEN' => $hidden, 'START_NAME' => $start_name, 'LIST' => $list));\n } else {\n $pages_list = new Tempcode();\n }\n\n // Put it all together\n return do_template('PAGINATION_WRAP', array(\n '_GUID' => '2c3fc957d4d8ab9103ef26458e18aed1',\n 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => $first,\n 'PREVIOUS' => $previous,\n 'CONTINUES_LEFT' => $continues_left,\n 'PARTS' => $parts,\n 'CONTINUES_RIGHT' => $continues_right,\n 'NEXT' => $next,\n 'LAST' => $last,\n 'PAGES_LIST' => $pages_list,\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval($num_pages),\n ));\n }\n\n if (get_value('pagination_when_not_needed') === '1') {\n return do_template('PAGINATION_WRAP', array('_GUID' => '451167645e67c7beabcafe11c78680db', 'TEXT_ID' => $title,\n 'PER_PAGE' => $per_page,\n 'FIRST' => '',\n 'PREVIOUS' => '',\n 'CONTINUES_LEFT' => '',\n 'PARTS' => '',\n 'CONTINUES_RIGHT' => '',\n 'NEXT' => '',\n 'LAST' => '',\n 'PAGES_LIST' => '',\n\n 'START' => strval($start),\n 'MAX' => strval($max),\n 'MAX_ROWS' => strval($max_rows),\n 'NUM_PAGES' => strval(1),\n ));\n }\n\n return new Tempcode();\n}", "function ss_pagination( $pages = '', $align = 'center', $range = 2 ) {\r\n\t$showitems = ( $range * 2 )+1;\r\n\r\n\tglobal $paged;\r\n\tif ( empty( $paged ) ) $paged = 1;\r\n\r\n\tif ( $pages == '' ) {\r\n\t\tglobal $wp_query;\r\n\t\t$pages = $wp_query->max_num_pages;\r\n\t\tif ( !$pages ) {\r\n\t\t\t$pages = 1;\r\n\t\t}\r\n\t}\r\n\r\n\tif ( 1 != $pages ) {\r\n\t\techo \"<div class='ss-pagination' style='text-align:\" . $align . \";' >\";\r\n\t\tif ( $paged > 2 && $paged > $range+1 && $showitems < $pages ) echo \"<a href='\".get_pagenum_link( 1 ).\"'>&laquo;</a>\";\r\n\t\tif ( $paged > 1 && $showitems < $pages ) echo \"<a href='\".get_pagenum_link( $paged - 1 ).\"'>&lsaquo;</a>\";\r\n\r\n\t\tfor ( $i=1; $i <= $pages; $i++ ) {\r\n\t\t\tif ( 1 != $pages &&( !( $i >= $paged+$range+1 || $i <= $paged-$range-1 ) || $pages <= $showitems ) ) {\r\n\t\t\t\techo ( $paged == $i )? \"<span class='current'>\".$i.\"</span>\":\"<a href='\".get_pagenum_link( $i ).\"' class='inactive' >\".$i.\"</a>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( $paged < $pages && $showitems < $pages ) echo \"<a href='\".get_pagenum_link( $paged + 1 ).\"'>&rsaquo;</a>\";\r\n\t\tif ( $paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages ) echo \"<a href='\".get_pagenum_link( $pages ).\"'>&raquo;</a>\";\r\n\t\techo \"</div>\\n\";\r\n\t}\r\n}", "function ks_pagination() {\n\tglobal $wp_query;\n\t$big = 999999999;\n\techo paginate_links( array(\n\t\t'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),\n\t\t'format' => '?paged=%#%',\n\t\t'current' => max( 1, get_query_var( 'paged' ) ),\n\t\t'total' => $wp_query->max_num_pages\n\t) );\n}", "function smart_pagination($pages = '', $range = 2)\n{ \n $showitems = ($range * 2)+1; \n \n global $paged;\n if(empty($paged)) $paged = 1;\n \n if($pages == ''){\n global $wp_query;\n $pages = $wp_query->max_num_pages;\n if(!$pages){\n $pages = 1;\n }\n } \n \n if(1 != $pages){\n echo '<ul class=\"pagination\">';\n if($paged > 2 && $paged > $range+1){\n echo '<li class=\"arrow\"><a href=\"'.get_pagenum_link(1).'\">&laquo;</a></li>'; \n }elseif($showitems < $pages){\n echo '<li class=\"arrow unavailable\"><a href=\"\">&laquo;</a></li>';\n }\n if($paged > 1){\n echo '<li class=\"arrow\"><a href=\"'.get_pagenum_link($paged - 1).'\">&lsaquo;</a></li>';\n }elseif($showitems < $pages){\n echo '<li class=\"arrow unavailable\"><a href=\"\">&lsaquo;</a></li>'; \n }\n \n for ($i=1; $i <= $pages; $i++){\n if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )){\n echo ($paged == $i)? '<li class=\"current\"><a href=\"\">'.$i.'</a></li>':'<li><a href=\"'.get_pagenum_link($i).'\">'.$i.'</a></li>';\n }\n }\n \n if ($paged < $pages){\n echo '<li class=\"arrow\"><a href=\"'.get_pagenum_link($paged + 1).'\">&rsaquo;</a>';\n }elseif($showitems < $pages){\n echo '<li class=\"arrow unavailable\"><a href=\"\">&rsaquo;</a>';\n }\n if ($paged < $pages-1 && $paged+$range-1 < $pages){\n echo '<li class=\"arrow\"><a href=\"'.get_pagenum_link($pages).'\">&raquo;</a></li>';\n }elseif($showitems < $pages){\n echo '<li class=\"arrow unavailable\"><a href=\"\">&raquo;</a></li>';\n }\n echo \"</ul>\\n\";\n }\n}", "function alaya_pagenavi(){\n global $wp_query;\n\n\t$big = 999999999; // need an unlikely integer\n\t$return_html='';\n\t$return_html.='<div class=\"alaya_pagenavi\">';\n\t$return_html.= paginate_links( array(\n\t\t'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),\n\t\t'format' => '?paged=%#%',\n\t\t'current' => max( 1, get_query_var('paged') ),\n\t\t'total' => $wp_query->max_num_pages,\n\t\t'prev_text' => '&lt;',\n\t 'next_text' => '&gt;'\n\t) );\n\t$return_html.='</div>';\n\t\n\treturn $return_html;\n}", "public function GetAdminHTML(){\n\t/*unset($this->url[0]);\n\t\t\t$cnt=1;\n\t\t\tforeach($this->url as $v){\n\t\t\t\tif(count($this->url)==$cnt && $v>0 && is_numeric($v)){\n\t\t\t\t//$this->out_url.=$v.'/';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$this->out_url.=$v.'/';\n\t\t\t$cnt++;\n\t\t\t}*/\n\t\n\t\t\n\t\n\t$next=$this->list['current']+1;\n\t$prev=$this->list['current']-1;\n\t$limit=($this->page-1)*$this->take+1;\n\t$limit2=$limit+$this->take-1;\n\t\n\tif ($this->page==$this->total_pages)\n\t$limit2=$this->total;\n\t$str='';\n\t$str .=\"\";\n\t\n\n\t$str .=<<<OUT\n\t\t\t<div class=\"pagination\">\n\t\t \t<ul class=\"pag_list\">\nOUT;\n\tif($prev>0){\n\t$str .=<<<OUT\n\t\t\t<li class=\"prev\"><a href=\"{$this->out_url}{$prev}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n \n\tfor ($i=1; $i < $this->page ; $i++)\n\t\t{\n\t\t\tif ($i>((int)$this->page-(int)$this->half_block)){\n\t\t\t\tif($i==1){\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif($this->total_pages==$this->list['current'])\n\t$str .=\"<li class='last'>\".$this->list['current'].\"</li>\";\n\telse\n\t$str .=\"<li>\".$this->list['current'].\"</li>\";\n\t\n\t$cnt=1;\n\tfor ($i=$this->page+1; $i <= $this->total_pages ; $i++)\n\t\t{\n\t\t\tif($this->total_pages==$i || ($this->half_block-1)==$cnt)\n\t\t\t$classlast=' class=\"last\"';\n\t\t\telse\n\t\t\t$classlast='';\n\t\t\t\n\t\t\tif ($this->half_block==$cnt)\n\t\t\tbreak;\n\t\t\t$str .=<<<OUT\n\t\t\t<li{$classlast}><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t$cnt++;\n\t\t}\n\n\tif($this->list['current']<$this->total_pages){\n\t$str .=<<<OUT\n\t\t\t<li class=\"next\"><a href=\"{$this->out_url}{$next}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n\t\n\t$str .=<<<OUT\n \t\t </div>\nOUT;\n\tif ($this->total_pages>1)\n\treturn $str;\n\t\n\t}", "public function page_list() {\n\n\t\t\t$output = \"\";\n\t\t\t$cur_page = $this->current_page;\n\t\t\t$tot_page = $this->total_pages();\n\n\t\t\tif( $cur_page <= $tot_page ) {\n\t\t\t\t$output .= \"<h3 class=\\\"pagelist\\\">Page {$cur_page} of \" ;\n\t\t\t\t$output .= \"{$tot_page}</h3>\";\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\n\t\t}", "function displayPaging()\r\n {\r\n\t $InfoArray = $this->InfoArray();\r\n \r\n\t /* Everything below here are just examples! */\r\n\t\r\n\t /* Print our some info like \"Displaying page 1 of 49\" */\r\n\t echo \"Displaying page \" . $InfoArray[\"CURRENT_PAGE\"] . \" of \" . $InfoArray[\"TOTAL_PAGES\"] . \"<BR>\";\r\n\t echo \"Displaying results \" . $InfoArray[\"START_OFFSET\"] . \" - \" . $InfoArray[\"END_OFFSET\"] . \" of \" . $InfoArray[\"TOTAL_RESULTS\"] . \"<BR>\";\r\n\t\r\n\t /* Print our first link */\r\n\t if($InfoArray[\"CURRENT_PAGE\"]!= 1) {\r\n\t\t echo \"<a href='?page=1'>&lt;&lt;</a> \";\r\n\t } else {\r\n\t\t echo \"&lt;&lt; \";\r\n\t }\r\n\t\r\n\t /* Print out our prev link */\r\n\t if($InfoArray[\"PREV_PAGE\"]) {\r\n\t\t echo \"<a href='?page=\" . $InfoArray[\"PREV_PAGE\"] . \"'>Previous</a> | \";\r\n\t } else {\r\n\t\t echo \"Previous | \";\r\n\t }\r\n\t\r\n\t /* Example of how to print our number links! */\r\n\t for($i=0; $i<count($InfoArray[\"PAGE_NUMBERS\"]); $i++) {\r\n\t\t if($InfoArray[\"CURRENT_PAGE\"] == $InfoArray[\"PAGE_NUMBERS\"][$i]) {\r\n\t\t\t echo $InfoArray[\"PAGE_NUMBERS\"][$i] . \" | \";\r\n\t\t } else {\r\n\t\t\t echo \"<a href='?page=\" . $InfoArray[\"PAGE_NUMBERS\"][$i] . \"'>\" . $InfoArray[\"PAGE_NUMBERS\"][$i] . \"</a> | \";\r\n\t\t }\r\n\t }\r\n\t\r\n\t /* Print out our next link */\r\n\t if($InfoArray[\"NEXT_PAGE\"]) {\r\n\t\t echo \" <a href='?page=\" . $InfoArray[\"NEXT_PAGE\"] . \"'>Next</a>\";\r\n\t } else {\r\n\t\t echo \" Next\";\r\n\t }\r\n\t\r\n\t /* Print our last link */\r\n\t if($InfoArray[\"CURRENT_PAGE\"]!= $InfoArray[\"TOTAL_PAGES\"]) {\r\n\t\t echo \" <a href='?page=\" . $InfoArray[\"TOTAL_PAGES\"] . \"'>>></a>\";\r\n\t } else {\r\n\t\t echo \" &gt;&gt;\";\r\n\t }\r\n\t}", "function html5wp_pagination()\n{\n global $wp_query;\n $big = 999999999;\n echo paginate_links(\n array(\n 'base' => str_replace($big, '%#%', get_pagenum_link($big)),\n 'format' => '?paged=%#%',\n 'current' => max(1, get_query_var('paged')),\n 'prev_text' => __('Previous'),\n 'next_text' => __('Next'),\n 'total' => $wp_query->max_num_pages\n )\n );\n}", "function pagination() {\n echo '<div class=\"pagination\">';\n posts_nav_link(' ', '<< ', ' >>'); \n echo '</div>';\n}", "public function filter_add_amp_live_list_pagination_attribute( string $markup ) : string {\n\t\treturn preg_replace( '/(\\s*<[a-z0-9_-]+)/i', '$1 pagination ', $markup, 1 );\n\t}", "function getPaginationString($page = 1, $totalitems, $limit = 15, $adjacents = 1, $targetpage = \"/\", $pagestring = \"?page=\")\n\t{\t\t\n\t\t//defaults\n\t\tif(!$adjacents) $adjacents = 1;\n\t\tif(!$limit) $limit = 15;\n\t\tif(!$page) $page = 1;\n\t\tif(!$targetpage) $targetpage = \"/\";\n\t\t\n\t\t//other vars\n\t\t$prev = $page - 1;\t\t\t\t\t\t\t\t\t//previous page is page - 1\n\t\t$next = $page + 1;\t\t\t\t\t\t\t\t\t//next page is page + 1\n\t\t$lastpage = ceil($totalitems / $limit);\t\t\t\t//lastpage is = total items / items per page, rounded up.\n\t\t$lpm1 = $lastpage - 1;\t\t\t\t\t\t\t\t//last page minus 1\n\t\t\n\t\t/* \n\t\t\tNow we apply our rules and draw the pagination object. \n\t\t\tWe're actually saving the code to a variable in case we want to draw it more than once.\n\t\t*/\n\t\t$pagination = \"\";\n\t\tif($lastpage > 1)\n\t\t{\t\n\t\t\t$pagination .= \"<div class=\\\"pagination\\\"\";\n\t\t\tif($margin || $padding)\n\t\t\t{\n\t\t\t\t$pagination .= \" style=\\\"\";\n\t\t\t\tif($margin)\n\t\t\t\t\t$pagination .= \"margin: $margin;\";\n\t\t\t\tif($padding)\n\t\t\t\t\t$pagination .= \"padding: $padding;\";\n\t\t\t\t$pagination .= \"\\\"\";\n\t\t\t}\n\t\t\t$pagination .= \">\";\n\t\n\t\t\t//previous button\n\t\t\tif ($page > 1) \n\t\t\t\t$pagination .= \"<a href=\\\"$targetpage$pagestring$prev\\\">&laquo; prev</a>\";\n\t\t\telse\n\t\t\t\t$pagination .= \"<span class=\\\"disabled\\\">&laquo; prev</span>\";\t\n\t\t\t\n\t\t\t//pages\t\n\t\t\tif ($lastpage < 7 + ($adjacents * 2))\t//not enough pages to bother breaking it up\n\t\t\t{\t\n\t\t\t\tfor ($counter = 1; $counter <= $lastpage; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $counter . \"\\\">$counter</a>\";\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($lastpage >= 7 + ($adjacents * 2))\t//enough pages to hide some\n\t\t\t{\n\t\t\t\t//close to beginning; only hide later pages\n\t\t\t\tif($page < 1 + ($adjacents * 3))\t\t\n\t\t\t\t{\n\t\t\t\t\tfor ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $counter . \"\\\">$counter</a>\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$pagination .= \"<span class=\\\"elipses\\\">...</span>\";\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $lpm1 . \"\\\">$lpm1</a>\";\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $lastpage . \"\\\">$lastpage</a>\";\t\t\n\t\t\t\t}\n\t\t\t\t//in middle; hide some front and some back\n\t\t\t\telseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))\n\t\t\t\t{\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . \"1\\\">1</a>\";\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . \"2\\\">2</a>\";\n\t\t\t\t\t$pagination .= \"<span class=\\\"elipses\\\">...</span>\";\n\t\t\t\t\tfor ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $counter . \"\\\">$counter</a>\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$pagination .= \"...\";\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $lpm1 . \"\\\">$lpm1</a>\";\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $lastpage . \"\\\">$lastpage</a>\";\t\t\n\t\t\t\t}\n\t\t\t\t//close to end; only hide early pages\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . \"1\\\">1</a>\";\n\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . \"2\\\">2</a>\";\n\t\t\t\t\t$pagination .= \"<span class=\\\"elipses\\\">...</span>\";\n\t\t\t\t\tfor ($counter = $lastpage - (1 + ($adjacents * 3)); $counter <= $lastpage; $counter++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $counter . \"\\\">$counter</a>\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//next button\n\t\t\tif ($page < $counter - 1) \n\t\t\t\t$pagination .= \"<a href=\\\"\" . $targetpage . $pagestring . $next . \"\\\">next &raquo;</a>\";\n\t\t\telse\n\t\t\t\t$pagination .= \"<span class=\\\"disabled\\\">next &raquo;</span>\";\n\t\t\t$pagination .= \"</div>\\n\";\n\t\t}\n\t\t\n\t\treturn $pagination;\n\t\n\t}", "function honeycomb_paging_nav() {\n\t\tglobal $wp_query;\n\n\t\t$args = array(\n\t\t\t'type' \t => 'list',\n\t\t\t'next_text' => _x( 'Next', 'Next post', 'honeycomb' ),\n\t\t\t'prev_text' => _x( 'Previous', 'Previous post', 'honeycomb' ),\n\t\t\t);\n\n\t\tthe_posts_pagination( $args );\n\t}", "function adt_paging_nav() {\n\t// Don't print empty markup if there's only one page.\n\tif ( $GLOBALS['wp_query']->max_num_pages < 2 ) {\n\t\treturn;\n\t}\n\n\t$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;\n\t$pagenum_link = html_entity_decode( get_pagenum_link() );\n\t$query_args = array();\n\t$url_parts = explode( '?', $pagenum_link );\n\n\tif ( isset( $url_parts[1] ) ) {\n\t\twp_parse_str( $url_parts[1], $query_args );\n\t}\n\n\t$pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );\n\t$pagenum_link = trailingslashit( $pagenum_link ) . '%_%';\n\n\t$format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';\n\t$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';\n\n\t// Set up paginated links.\n\t$links = paginate_links( array(\n\t\t'base' => $pagenum_link,\n\t\t'format' => $format,\n\t\t'total' => $GLOBALS['wp_query']->max_num_pages,\n\t\t'current' => $paged,\n\t\t'mid_size' => 1,\n\t\t'add_args' => array_map( 'urlencode', $query_args ),\n\t\t'prev_text' => '&larr;',\n\t\t'next_text' => '&rarr;',\n\t) );\n\n\tif ( $links ) :\n\n\t?>\n\t<nav class=\"paginacion\" role=\"navigation\">\n\t\t<?php echo $links; ?>\n\t</nav><!-- .navigation -->\n\t<?php\n\tendif;\n}", "function html5wp_pagination()\n{\n if( is_singular() )\n return;\n \n global $wp_query;\n if( $wp_query->max_num_pages <= 1 )\n return;\n $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;\n $max = intval( $wp_query->max_num_pages );\n if ( $paged >= 1 )\n $links[] = $paged;\n if ( $paged >= 3 ) {\n $links[] = $paged - 1;\n $links[] = $paged - 2;\n }\n if ( ( $paged + 2 ) <= $max ) {\n $links[] = $paged + 2;\n $links[] = $paged + 1;\n }\n echo '<div class=\"navigation\"><ul>' . \"\\n\";\n if ( get_previous_posts_link() )\n printf( '<li>%s</li>' . \"\\n\", get_previous_posts_link() );\n if ( ! in_array( 1, $links ) ) {\n $class = 1 == $paged ? ' class=\"active\"' : '';\n printf( '<li%s><a href=\"%s\">%s</a></li>' . \"\\n\", $class, esc_url( get_pagenum_link( 1 ) ), '1' );\n if ( ! in_array( 2, $links ) )\n echo '<li>…</li>';\n }\n \n sort( $links );\n foreach ( (array) $links as $link ) {\n $class = $paged == $link ? ' class=\"active\"' : '';\n printf( '<li%s><a href=\"%s\">%s</a></li>' . \"\\n\", $class, esc_url( get_pagenum_link( $link ) ), $link );\n }\n if ( ! in_array( $max, $links ) ) {\n if ( ! in_array( $max - 1, $links ) )\n echo '<li>…</li>' . \"\\n\";\n $class = $paged == $max ? ' class=\"active\"' : '';\n printf( '<li%s><a href=\"%s\">%s</a></li>' . \"\\n\", $class, esc_url( get_pagenum_link( $max ) ), $max );\n }\n if ( get_next_posts_link() )\n printf( '<li>%s</li>' . \"\\n\", get_next_posts_link() );\n echo '</ul></div>' . \"\\n\";\n}", "function custom_pagination($max_num_pages = '', $range = 1) {\n $showitems = ($range * 2)+1;\n\n global $paged;\n if(empty($paged)) $paged = 1;\n\n if($max_num_pages == '') {\n global $wp_query;\n // 最後のページ\n $max_num_pages = $wp_query->max_num_pages;\n if(!$max_num_pages) {\n $max_num_pages = 1;\n }\n }\n\n if(1 != $max_num_pages) {\n echo '<div class=\"paging\">'.\"\\n\";\n\n // Prevリンク\n // 現在のページが2ページ目以降の場合\n if ($paged > 1) echo '<a class=\"prev_link\" href=\"'.get_pagenum_link($paged - 1).'\">&laquo;</a>'.\"\\n\";\n\n // 今のページからレンジを引いて2以上ある場合 && 最大表示アイテム数より最第ページ数が大きい場合\n // (レンジ数のすぐ次の場合は表示する)\n // 1...345\n if ( $paged-$range >= 2 && $max_num_pages > $showitems ) echo '<a href=\"'.get_pagenum_link(1).'\">1</a>'.\"\\n\";\n // 今のページからレンジを引いて3以上ある場合 && 最大表示アイテム数より最第ページ数が大きい場合\n if ( $paged-$range >= 3 && $max_num_pages > $showitems ) echo '<span class=\"txt_hellip\">&hellip;</span>'.\"\\n\";\n\n // レンジより前に追加する数\n $addPrevCount = $paged+$range-$max_num_pages;\n // レンジより後に追加する数\n $addNextCount = -($paged-1-$range); // 今のページ数を遡ってカウントするために-1\n // アイテムループ\n for ($i=1; $i <= $max_num_pages; $i++) {\n // 表示するアイテム\n if ($paged == $i) {\n $pageItem = '<span class=\"current\">'.$i.'</span>'.\"\\n\";\n } else {\n $pageItem = '<a href=\"'.get_pagenum_link($i).'\" class=\"inactive\">'.$i.'</a>'.\"\\n\";\n }\n\n // 今のページからレンジを引いた数~今のページからレンジを足した数まで || 最大ページ数が最大表示アイテム数以下の場合\n if ( ( $paged-$range <= $i && $i<= $paged+$range ) || $max_num_pages <= $showitems ) {\n echo $pageItem;\n // 今のページからレンジを引くと負数になる場合 && 今のページ+レンジ+負数をレンジに加算した数まで\n } else if ( $paged-1-$range < 0 && $paged+$range+$addNextCount >= $i ) {\n echo $pageItem;\n // 今のページからレンジを足すと 最後のページよりも大きくなる場合 && 今のページ+レンジ+負数をレンジに加算した数まで\n } else if ( $paged+$range > $max_num_pages && $paged-$range-$addPrevCount <= $i ) {\n echo $pageItem;\n }\n }\n\n // 現在のページにレンジを足しても最後のページ数より2以上小さい時 && 最大表示アイテム数より最第ページ数が大きい場合\n if ( $paged+$range <= $max_num_pages-2 && $max_num_pages > $showitems ) echo '<span class=\"txt_hellip\">&hellip;</span>'.\"\\n\";\n if ( $paged+$range <= $max_num_pages-1 && $max_num_pages > $showitems ) echo '<a href=\"'.get_pagenum_link($max_num_pages).'\">'.$max_num_pages.'</a>'.\"\\n\";\n // Nextリンク\n if ($paged < $max_num_pages) echo '<a class=\"next_link\" href=\"'.get_pagenum_link($paged + 1).'\">&raquo;</a>'.\"\\n\";\n echo \"</div>\\n\";\n }\n }", "function html5wp_pagination()\n{\n global $wp_query;\n $big = 999999999;\n echo paginate_links(array(\n 'base' => str_replace($big, '%#%', get_pagenum_link($big)),\n 'format' => '?paged=%#%',\n 'current' => max(1, get_query_var('paged')),\n 'total' => $wp_query->max_num_pages\n ));\n}", "function __paging($number, $first) {\n\n if ($number == 0) {\n return '';\n } else {\n return '<paging>\n <startIndex>'.$this->__xml($first).'</startIndex>\n <numberResults>'.\n $this->__xml($number)\n .'</numberResults>\n </paging>';\n }\n\n}", "function getPaginationString($page = 1, $totalitems, $limit = 15, $adjacents = 1, $targetpage = \"/\", $pagestring = \"?page=\")\r\n\t{\r\n\t\t//defaults\r\n\t\tif(!$adjacents) $adjacents = 1;\r\n\t\tif(!$limit) $limit = 15;\r\n\t\tif(!$page) $page = 1;\r\n\t\tif(!$targetpage) $targetpage = \"/\";\r\n\r\n\t\t//other vars\r\n\t\t$prev = $page - 1;\t\t\t\t\t\t\t\t\t//previous page is page - 1\r\n\t\t$next = $page + 1;\t\t\t\t\t\t\t\t\t//next page is page + 1\r\n\t\t$lastpage = ceil($totalitems / $limit);\t\t\t\t//lastpage is = total items / items per page, rounded up.\r\n\t\t$lpm1 = $lastpage - 1;\t\t\t\t\t\t\t\t//last page minus 1\r\n\r\n\t\t/*\r\n\t\t\tNow we apply our rules and draw the pagination object.\r\n\t\t\tWe're actually saving the code to a variable in case we want to draw it more than once.\r\n\t\t*/\r\n\t\t$pagination = \"\";\r\n\t\tif($lastpage > 1)\r\n\t\t{\r\n\t\t\t//previous button\r\n\t\t\tif ($page > 1)\r\n\t\t\t\t$pagination .= \"<a title=\\\"Go to Previous Page\\\" href=\\\"$targetpage$pagestring$prev\\\">« prev</a>\";\r\n\t\t\telse\r\n\t\t\t\t$pagination .= \"<span class=\\\"disabled\\\">« prev</span>\";\r\n\r\n\t\t\t//pages\r\n\t\t\tif ($lastpage < 7 + ($adjacents * 2))\t//not enough pages to bother breaking it up\r\n\t\t\t{\r\n\t\t\t\tfor ($counter = 1; $counter <= $lastpage; $counter++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($counter == $page)\r\n\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $counter\\\" href=\\\"$targetpage$pagestring$counter\\\">$counter</a>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif($lastpage >= 7 + ($adjacents * 2))\t//enough pages to hide some\r\n\t\t\t{\r\n\t\t\t\t//close to beginning; only hide later pages\r\n\t\t\t\tif($page < 1 + ($adjacents * 3))\r\n\t\t\t\t{\r\n\t\t\t\t\tfor ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($counter == $page)\r\n\t\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $counter\\\" href=\\\"$targetpage$pagestring$counter\\\">$counter</a>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pagination .= \"...\";\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $lpm1\\\" href=\\\"$targetpage$pagestring$lpm1\\\">$lpm1</a>\";\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $lastpage\\\" href=\\\"$targetpage$pagestring$lastpage\\\">$lastpage</a>\";\r\n\t\t\t\t}\r\n\t\t\t\t//in middle; hide some front and some back\r\n\t\t\t\telseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page 1\\\" href=\\\"$targetpage${pagestring}1\\\">1</a>\";\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page 2\\\" href=\\\"$targetpage${pagestring}2\\\">2</a>\";\r\n\t\t\t\t\t$pagination .= \"...\";\r\n\t\t\t\t\tfor ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($counter == $page)\r\n\t\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $counter\\\" href=\\\"$targetpage$pagestring$counter\\\">$counter</a>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pagination .= \"...\";\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $lpm1\\\" href=\\\"$targetpage$pagestring$lpm1\\\">$lpm1</a>\";\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $lastpage\\\" href=\\\"$targetpage$pagestring$lastpage\\\">$lastpage</a>\";\r\n\t\t\t\t}\r\n\t\t\t\t//close to end; only hide early pages\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page 1\\\" href=\\\"$targetpage${pagestring}1\\\">1</a>\";\r\n\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page 2\\\" href=\\\"$targetpage${pagestring}2\\\">2</a>\";\r\n\t\t\t\t\t$pagination .= \"...\";\r\n\t\t\t\t\tfor ($counter = $lastpage - (1 + ($adjacents * 3)); $counter <= $lastpage; $counter++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($counter == $page)\r\n\t\t\t\t\t\t\t$pagination .= \"<span class=\\\"current\\\">$counter</span>\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$pagination .= \"<a title=\\\"Go to Page $counter\\\" href=\\\"$targetpage$pagestring$counter\\\">$counter</a>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//next button\r\n\t\t\tif ($page < $counter - 1)\r\n\t\t\t\t$pagination .= \"<a title=\\\"Go to Next Page\\\" href=\\\"$targetpage$pagestring$next\\\">next »</a>\";\r\n\t\t\telse\r\n\t\t\t\t$pagination .= \"<span class=\\\"disabled\\\">next »</span>\";\r\n\t\t}\r\n\r\n\t\treturn $pagination;\r\n\r\n\t}", "public function wrapper() \n {\n \n ee()->load->library('pagination');\n \n $total_items = ee()->TMPL->fetch_param('total_items');\n $per_page = ee()->TMPL->fetch_param('per_page');\n $current_page = ee()->TMPL->fetch_param('current_page',0);\n $prefix = ee()->TMPL->fetch_param('prefix','P');\n $base_path =ee()->TMPL->fetch_param('base_path');\n \n $pagination = ee()->pagination->create();\n $pagination->prefix = $prefix;\n $pagination->basepath = '/' . trim($base_path,'/');\n\n ee()->TMPL->tagdata = $pagination->prepare(ee()->TMPL->tagdata);\n \n $pagination->build($total_items, $per_page);\n $this->return_data = $pagination->render($this->return_data);\n \n return $this->return_data;\n }", "function ti_pagination(){\n\tglobal $wp_query;\n\t$total_pages = $wp_query->max_num_pages; \n\tif ( $total_pages > 1 ){\n\t\t$current_page = max( 1, get_query_var('paged') ); \n\t\techo '<div class=\"pagination\">';\n\t\techo paginate_links(array( \n\t\t\t'base' => get_pagenum_link(1) . '%_%', \n\t\t\t'format' => 'page/%#%',\n\t\t\t'current' => max( 1, get_query_var('paged') ),\n\t\t\t'total' => $wp_query->max_num_pages,\n\t\t\t'show_all' => false,\n\t\t\t'end_size' => 1,\n\t\t\t'mid_size' => 3,\n\t\t\t'prev_next' => true,\n\t\t\t'prev_text' => '<i class=\"icon-chevron-left\"></i>',\n\t\t\t'next_text' => '<i class=\"icon-chevron-right\"></i>',\n\t\t\t'type' => 'list'\n\t\t)); \n\t\techo '</div>';\n\t}\t\n}", "function html5wp_pagination() {\n global $wp_query;\n $big = 999999999;\n echo paginate_links( array(\n 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),\n 'format' => '?paged=%#%',\n 'current' => max( 1, get_query_var( 'paged' ) ),\n 'total' => $wp_query->max_num_pages,\n ) );\n}", "function renderNav(PageArray $items, array $options = array()) {\n\n\tif(!count($items)) return '';\n\n\t$defaults = array(\n\t\t'fields' => array(), // array of other fields you want to display (title is assumed)\n\t\t'class' => '', // class for the <ul>\n\t\t'active' => 'active', // class for active item\n\t\t'dividers' => false, // add an <li class='divider'> between each item?\n\t\t'tree' => false, // render tree to reach current $page?\n\t\t);\n\n\t$options = array_merge($defaults, $options); \n\t$page = wire('page');\n\t$out = \"<ul class='$options[class]'>\";\n\t$divider = $options['dividers'] ? \"<li class='divider'></li>\" : \"\";\n\n\tforeach($items as $item) {\n\n\t\t// if this item is the current page, give it an 'active' class\n\t\t$class = $item->id == $page->id ? \" class='$options[active]'\" : \"\";\n\t\tif(($item->id > 1 && $page->parents->has($item)) || $page->id == $item->id) $class = \" class='active' \";\n\t\t// render linked item title\n\t\t$out .= \"$divider<li$class><a href='$item->url'>$item->title</a> \"; \n\n\t\t// render optional extra fields wrapped in named spans\n\t\tif(count($options['fields'])) foreach($options['fields'] as $name) {\n\t\t\t$out .= \"<span class='$name'>\" . $item->get($name) . \"</span> \";\n\t\t}\n\n\t\t// optionally render a tree recursively to current $page \n\t\tif($options['tree']) {\n\t\t\tif($page->parents->has($item) || $item->id == $page->id) {\n\t\t\t\t$out .= renderNav($item->children(\"limit=50\"), array(\n\t\t\t\t\t'fields' => $options['fields'],\n\t\t\t\t\t'tree' => true,\n\t\t\t\t\t)); \n\t\t\t}\n\t\t}\n\n\t\t$out .= \"</li>\";\n\t}\n\n\t$out .= \"</ul>\";\n\treturn $out; \t\n}", "function bootstrap_link_pages($args = '') {\r\n\t$defaults = array(\r\n\t\t'before' => '', 'after' => '',\r\n\t\t'link_before' => '', 'link_after' => '',\r\n\t\t'next_or_number' => 'number', 'nextpagelink' => __('Next page'),\r\n\t\t'previouspagelink' => __('Previous page'), 'pagelink' => '%',\r\n\t\t'echo' => 1\r\n\t);\r\n\r\n\t$r = wp_parse_args( $args, $defaults );\r\n\t$r = apply_filters( 'wp_link_pages_args', $r );\r\n\textract( $r, EXTR_SKIP );\r\n\r\n\tglobal $page, $numpages, $multipage, $more, $pagenow;\r\n\r\n\t$output = '';\r\n\tif ( $multipage ) {\r\n\t\tif ( 'number' == $next_or_number ) {\r\n\t\t\t$output .= $before;\r\n\t\t\t$output .= '<div class=\"pagination\"><ul>';\r\n\t\t\tfor ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {\r\n\t\t\t\t$j = str_replace('%',$i,$pagelink);\r\n\t\t\t\tif ( ($i != $page) || ((!$more) && ($page==1)) ) {\r\n\t\t\t\t\t$output .= '<li>' . _wp_link_page($i);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$output .= '<li class=\"active\"><span>';\r\n\t\t\t\t$output .= $link_before . $j . $link_after;\r\n\t\t\t\tif ( ($i != $page) || ((!$more) && ($page==1)) )\r\n\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\telse {\r\n\t\t\t\t\t$output .= '</span>';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= '</li>';\r\n\t\t\t}\r\n\t\t\t$output .= '</ul></div>';\r\n\t\t\t$output .= $after;\r\n\t\t} else {\r\n\t\t\tif ( $more ) {\r\n\t\t\t\t$output .= $before;\r\n\t\t\t\t$i = $page - 1;\r\n\t\t\t\tif ( $i && $more ) {\r\n\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t$output .= $link_before. $previouspagelink . $link_after . '</a>';\r\n\t\t\t\t}\r\n\t\t\t\t$i = $page + 1;\r\n\t\t\t\tif ( $i <= $numpages && $more ) {\r\n\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t$output .= $link_before. $nextpagelink . $link_after . '</a>';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= $after;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif ( $echo )\r\n\t\techo $output;\r\n\r\n\treturn $output;\r\n}", "function ci_pagination($args=array())\n{ \n\t$defaults = array(\n\t\t'container_id' => 'paging',\n\t\t'container_class' => 'navigation group',\n\t\t'prev_link_class' => 'nav-prev alignleft shadow',\n\t\t'next_link_class' => 'nav-next alignright shadow',\n\t\t'prev_text' => __('Older posts', 'ci_theme'),\n\t\t'next_text' => __('Newer posts', 'ci_theme'),\n\t\t'wp_pagenavi_params' => array()\n\t);\n\t$args = wp_parse_args( $args, $defaults );\n\t\n\tglobal $wp_query;\n\tif ($wp_query->max_num_pages > 1): ?>\n\t\t<div \n\t\t\t<?php echo (empty($args['container_id']) ? '' : 'id=\"'.$args['container_id'].'\"'); ?> \n\t\t\t<?php echo (empty($args['container_class']) ? '' : 'class=\"'.$args['container_class'].'\"'); ?>\n\t\t>\n\t\t\t<?php if (function_exists('wp_pagenavi')): ?>\n\t\t\t\t<?php wp_pagenavi($args['wp_pagenavi_params']); ?>\n\t\t\t<?php else: ?>\n\t\t\t\t<div <?php echo (empty($args['prev_link_class']) ? '' : 'class=\"'.$args['prev_link_class'].'\"'); ?>><?php next_posts_link( '<span class=\"nav-prev-symbol nav-symbol\">&laquo;</span> ' . $args['prev_text'] ); ?></div>\n\t\t\t\t<div <?php echo (empty($args['next_link_class']) ? '' : 'class=\"'.$args['next_link_class'].'\"'); ?>><?php previous_posts_link( $args['next_text'] . ' <span class=\"nav-next-symbol nav-symbol\">&raquo;</span>' ); ?></div>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t<?php endif;\n}", "function spec_pagination($query,$start_end_links = 3, $middle_links = 3)\n{\n\tif(!is_single())\t\n\t{\t\t\t\n\t\t$current = get_query_var('paged') == 0 ? 1 : get_query_var('paged');\t// This Page\n\t\t$total = $query->max_num_pages;\t\t\t\t\t\t\t\t\t\t\t// All Pages\n\t\t$links_left = floor(($middle_links - 1) / 2);\t\t\t\t\t\t\t// Left Links\n\t\t$links_right = ceil(($middle_links - 1) / 2);\t\t\t\t\t\t\t// Right Links\n\t\t\n\t\tif($total > 1)\t\n\t\t{\t\t\t\t\n\t\t\techo '<div class=\"page-navi\"><ul>';\n\t\t\t// Run through all Pages\n\t\t\t\tfor($i=1; $i<=$total; $i++)\t\n\t\t\t\t{\n\t\t\t\t\t// Current Page\n\t\t\t\t\tif($i == $current)\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<li>\n\t\t\t\t\t\t<a href=\"#\" class=\"current\"><span>'.($current).'</span></a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t\t// The Others\n\t\t\t\t\telseif($i >= ($current - $links_left) && $i <= ($current + $links_right) || $i <= $start_end_links || $i > ($total - $start_end_links))\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<li>\n\t\t\t\t\t\t\t<a href=\"'.get_pagenum_link($i).'\">'.$i.'</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t\t// auszulassene Seiten\n\t\t\t\t\telseif($i == ($start_end_links + 1) && $i < ($current - $links_left + 1) || $i == ($total - $start_end_links) && $i > ($current + $links_right))\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<li>\n\t\t\t\t\t\t<a href=\"#\">...</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t//Next/Prev Links\n\t\t\t\tif($current<$total){\n\t\t\t\t\techo '<li>\n\t\t\t\t\t<a href=\"'.get_pagenum_link($current+1).'\">'.__(\"next\",\"tb_longwave\").'</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t';\n\t\t\t\t\techo '<li>\n\t\t\t\t\t<a href=\"'.get_pagenum_link($total).'\">'.__(\"last\",\"tb_longwave\").'</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<li>\n\t\t\t\t\t<a href=\"'.get_pagenum_link(1).'\">'.__(\"first\",\"tb_longwave\").'</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t';\n\t\t\t\t\techo '<li>\n\t\t\t\t\t<a href=\"#\" class=\"current\">'.__(\"last\",\"tb_longwave\").'</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t// The End\n\t\t\techo '</ul></div>';\n\t\t}\n\t}\n}", "function blog_pagination($pages = '', $range = 5)\n{ \n $showitems = ($range * 2)+1; \n\n global $paged;\n if(empty($paged)) $paged = 1;\n\n if($pages == '')\n {\n global $wp_query;\n $pages = $wp_query->max_num_pages;\n if(!$pages)\n {\n $pages = 1;\n }\n } \n\n if(1 != $pages)\n {\n echo \"<nav id='pagination' class='clearfix'><ul>\";\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<li><a href='\".get_pagenum_link(1).\"'>&laquo;</a></li>\";\n if($paged > 1 && $showitems < $pages) echo \"<li><a href='\".get_pagenum_link($paged - 1).\"'>&lsaquo;</a></li>\";\n\n for ($i=1; $i <= $pages; $i++)\n {\n if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\n {\n echo ($paged == $i)? \"<li class='active-number'><a href='\".get_pagenum_link($i).\"' class='inactive' >\".$i.\"</a></li>\":\"<li><a href='\".get_pagenum_link($i).\"' class='inactive' >\".$i.\"</a></li>\";\n }\n }\n\n if ($paged < $pages && $showitems < $pages) echo \"<li><a href='\".get_pagenum_link($paged + 1).\"'> &rsaquo; </a></li>\"; \n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<li><a href='\".get_pagenum_link($pages).\"'> &raquo; </a></li>\";\n echo \"</ul></nav>\\n\";\n }\n}", "function ming_paging_nav() {\n\t// Don't print empty markup if there's only one page.\n\tif ( $GLOBALS['wp_query']->max_num_pages < 2 ) {\n\t\treturn;\n\t}\n\n\t$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;\n\t$pagenum_link = html_entity_decode( get_pagenum_link() );\n\t$query_args = array();\n\t$url_parts = explode( '?', $pagenum_link );\n\n\tif ( isset( $url_parts[1] ) ) {\n\t\twp_parse_str( $url_parts[1], $query_args );\n\t}\n\n\t$pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );\n\t$pagenum_link = trailingslashit( $pagenum_link ) . '%_%';\n\n\t$format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';\n\t$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';\n\n\t// Set up paginated links.\n\t$links = paginate_links( array(\n\t\t'base' => $pagenum_link,\n\t\t'format' => $format,\n\t\t'total' => $GLOBALS['wp_query']->max_num_pages,\n\t\t'current' => $paged,\n\t\t'mid_size' => 1,\n\t\t'add_args' => array_map( 'urlencode', $query_args ),\n\t\t'prev_text' => __( '&larr; Previous', 'ming' ),\n\t\t'next_text' => __( 'Next &rarr;', 'ming' ),\n\t) );\n\n\tif ( $links ) :\n\n\t?>\n\t\t<div class=\"pagination loop-pagination\">\n\t\t\t<?php echo $links; ?>\n\t\t</div><!-- .pagination -->\n\t<?php\n\tendif;\n}", "function aquamin_pagination( $class = 'pagination', $prev_text = '', $next_text = '', $show_disabled = false ) {\n\tglobal $wp_query;\n\t$big = 999999999;\n\t$prev_text = ( '' !== $prev_text ? $prev_text : __( 'Previous', 'aquamin' ) );\n\t$next_text = ( '' !== $next_text ? $next_text : __( 'Next', 'aquamin' ) );\n\t$nav = paginate_links( array(\n\t 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),\n\t 'format' => '?paged=%#%',\n\t 'prev_text' => $prev_text,\n\t 'current' => max( 1, get_query_var( 'paged' ) ),\n\t 'total' => $wp_query->max_num_pages,\n\t 'next_text' => $next_text,\n\t) );\n\tif ( $nav ) {\n\t\t$html = $nav;\n\t\tif ( $show_disabled ) {\n\t\t\tif ( stripos( $html, 'prev page-numbers' ) === false ) {\n\t\t\t\t$html = ' <a href=\"javascript:void(0)\" aria-disabled=\"true\" class=\"prev page-numbers\">' . $prev_text . '</a> ' . $html;\n\t\t\t}\n\t\t\tif ( stripos( $html, 'next page-numbers' ) === false ) {\n\t\t\t\t$html = $html . ' <a href=\"javascript:void(0)\" aria-disabled=\"true\" class=\"next page-numbers\">' . $next_text . '</a> ';\n\t\t\t}\n\t\t}\n\t\techo '<div class=\"' . $class . '\">' . $html . '</div>';\n\t}\n}", "public function genFirstLink()\n\t{\n\t\t$this->pagination['firstLink'] = \"\";\n\t\tif($this->page >= 10)\n\t\t{\n\t\t\t$page = 1;\t\t\t\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_first',$this->prepend.$page.$this->append, '&lt;&lt;'),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\t\t\n\t\t\t$this->pagination['firstLink'] = $item;\t\t\t\t\n\t\t}\n\t}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function printPagination($p_current_page, $p_total_count, $p_extra_parameters = '')\n\t{\n\t\tglobal $section;\n\n\t\t// If pagination needed print page selection\n\t\tif( BACKEND_RESULTS_PER_PAGE < $p_total_count )\n\t\t{\n\t\t\t$page_count = ceil($p_total_count / BACKEND_RESULTS_PER_PAGE);\n\t\t\techo \"<div class=\\\"page-navigation\\\">\";\n\t\t\tfor( $page_iterator = 1 ; $page_iterator <= $page_count ; $page_iterator++)\n\t\t\t{\n\t\t\t\t$selected = ($page_iterator === $p_current_page) ? ' selected' : '';\n\t\t\t\techo '<a class=\"button' . $selected . '\" href=\"?section=' , $section , '&amp;page=' , $page_iterator, $p_extra_parameters , '\">' , $page_iterator , \"</a>\";\n\t\t\t}\n\t\t\techo \"</div>\\n\";\n\t\t}\n\t}" ]
[ "0.7367386", "0.7367386", "0.70363015", "0.7036053", "0.69913244", "0.69782275", "0.67936444", "0.67499095", "0.6735606", "0.6732545", "0.67000854", "0.66176623", "0.6599001", "0.65671545", "0.6566332", "0.6562978", "0.65594476", "0.65522885", "0.65449905", "0.6537575", "0.6526194", "0.64980805", "0.6486568", "0.646363", "0.6456618", "0.64564925", "0.6443537", "0.6435122", "0.64310515", "0.642175", "0.6418291", "0.64118975", "0.64018345", "0.6394399", "0.63860977", "0.6383524", "0.6369194", "0.6368989", "0.6365941", "0.63623315", "0.6350234", "0.63492954", "0.63458335", "0.6343462", "0.63432693", "0.63357043", "0.63311565", "0.6316333", "0.63063407", "0.6297964", "0.62940353", "0.6288095", "0.62833565", "0.6258678", "0.62534916", "0.62391335", "0.62204045", "0.62085414", "0.62043744", "0.6202258", "0.61951566", "0.61951566", "0.6192626", "0.61790025", "0.61752397", "0.6174183", "0.6173349", "0.61688787", "0.6159145", "0.61436015", "0.6138168", "0.6136481", "0.612083", "0.6118688", "0.611332", "0.6092462", "0.6087482", "0.60813886", "0.60738146", "0.60615474", "0.604629", "0.6043353", "0.6042788", "0.6039938", "0.6033504", "0.6032657", "0.60320663", "0.60217863", "0.6013552", "0.60089594", "0.6008806", "0.5993003", "0.5988482", "0.5986954", "0.5984322", "0.5981324", "0.5980542", "0.5978944", "0.5978944", "0.59722763" ]
0.6141194
70
Register any events for your application.
public function boot() { parent::boot(); // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "protected static function events()\n {\n foreach (self::fetch('app/events', false) as $file) {\n Bus::need($file);\n }\n //\n Event::register();\n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "protected function registerEvents(): void\n {\n Event::listen(MessageLogged::class, function (MessageLogged $e) {\n if( app()->bound('current-context') )\n app('current-context')->log((array)$e);\n });\n }", "public function registerEvents()\n {\n $this->subscribeEvent(\n 'Shopware_Controllers_Widgets_Emotion_AddElement',\n 'onEmotionAddElement'\n );\n\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Widgets_Campaign',\n 'extendsEmotionTemplates'\n );\n\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n\n /**\n * Subscribe to the post dispatch event of the emotion backend module to extend the components.\n */\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Emotion',\n 'onPostDispatchBackendEmotion'\n );\n }", "public static function __events () {\n \n }", "public static function events();", "public function boot(Dispatcher $events)\n {\n parent::boot($events);\n\n //\n require app_path('Events.php');\n }", "public function register(): void\n {\n $eventManager = EventManager::getInstance();\n\n $this->discoverEvents();\n\n foreach ($this->getListeners() as $moduleName => $moduleEvents) {\n foreach ($moduleEvents as $eventName => $eventListeners) {\n foreach (array_unique($eventListeners) as $listener) {\n $eventManager->addEventHandler(\n $moduleName,\n $eventName,\n [$listener, 'handle']\n );\n }\n }\n }\n }", "public function registerEvents() {\n $this->registerEvent(Api_TraderApiEvents::AJAX_PLUGIN, \"ajaxPlugin\");\n $this->registerEvent(Api_TraderApiEvents::USER_REGISTER_CHECK, \"userRegisterCheck\");\n $this->registerEvent(Api_TraderApiEvents::USER_NEW, \"userNew\");\n $this->registerEvent(Api_TraderApiEvents::USER_DELETE, \"userDelete\");\n $this->registerEvent(Api_TraderApiEvents::USER_PROFILE_CHECK, \"userProfileCheck\");\n $this->registerEvent(Api_TraderApiEvents::USER_PROFILE_CHANGE, \"userProfileChange\");\n $this->registerEvent(Api_TraderApiEvents::ADMIN_WELCOME_TODO, \"adminWelcomeTodo\");\n $this->registerEvent(Api_TraderApiEvents::TEMPLATE_PLUGIN_FUNCTION, \"templateFunction\");\n return true;\n }", "public function __initEvents($app)\n {\n }", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function setDispatcherEvents()\n\t{\n\t\t$this->dispatcher = (new Dispatcher())->register($this->routes);\n\t}", "public function registerAppEvents()\n {\n return [\n 'beforeBootingApplication' => '\\Apps\\Resources\\Extensions\\Api@payment',\n 'afterBootingApplication' => '\\Apps\\Resources\\Extensions\\Api@paymentSuccess'\n ];\n }", "public function register() : void\n {\n $this->registerDefaultEventSourcingBindings();\n $this->registerEventStore();\n }", "public function boot()\n {\n// Event::listen('*', function ($event){\n// var_dump($event);\n// });\n }", "public function boot()\n {\n BelongsTo::setEventDispatcher($this->app['events']);\n HasMany::setEventDispatcher($this->app['events']);\n HasOne::setEventDispatcher($this->app['events']);\n MorphMany::setEventDispatcher($this->app['events']);\n MorphOne::setEventDispatcher($this->app['events']);\n MorphTo::setEventDispatcher($this->app['events']);\n }", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function attachEvents();", "public function attachEvents();", "public function registerConfiguredEvents()\n {\n // Clean previously registered events\n foreach ($this->registeredEvents as $event) {\n $this->events->forget('rocketeer.'.$event);\n }\n\n // Clean previously registered plugins\n $plugins = $this->registeredPlugins;\n $this->registeredPlugins = [];\n\n // Register plugins again\n foreach ($plugins as $plugin) {\n $this->plugin($plugin['plugin'], $plugin['configuration']);\n }\n\n // Get the registered events\n $hooks = (array) $this->rocketeer->getOption('hooks');\n unset($hooks['custom']);\n\n // Bind events\n foreach ($hooks as $event => $tasks) {\n foreach ($tasks as $task => $listeners) {\n $this->addTaskListeners($task, $event, $listeners, 0, true);\n }\n }\n }", "public function boot()\n {\n Event::listen(\n AppointmentConfirmed::class,\n [SendConfirmMail::class, 'handle']\n );\n\n Event::listen(\n DoctorAccepted::class,\n [SendDoctorAcceptanceMail::class, 'handle']\n );\n\n Event::listen(\n ClinicAccepted::class,\n [SendClinicAcceptanceMail::class, 'handle']\n );\n \n Event::listen(\n NewRegistered::class,\n [SendCodeMail::class, 'handle']\n );\n }", "private function registerEventHandlers()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentProcessorCsrf',\n 'onGetControllerPathFrontend'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentProcessor',\n 'onGetControllerPathFrontend'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_PaymentInformation',\n 'onGetControllerPathFrontendInformation'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Backend_Order_Save',\n 'onOrderSaveAction'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_VrpayecommerceClient',\n 'onInitResourceVrpayecommerceClient'\n );\n $this->subscribeEvent(\n 'Shopware_Modules_Admin_GetPaymentMeans_DataFilter',\n 'onGetPaymentMeans'\n );\n $this->subscribeEvent(\n 'Shopware_Modules_Admin_GetPaymentMeanById_DataFilter',\n 'onGetPaymentMeanById'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch',\n 'onPostDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchTemplate'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Checkout',\n 'onPostDispatchFinish'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Checkout',\n 'onFrontendCheckoutPostDispatch'\n );\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function registerEvents()\n {\n if (!empty($this->clientEvents)) {\n $js = [];\n foreach ($this->clientEvents as $event => $handle) {\n $handle = new JsExpression($handle);\n $js[] = \"$({$this->var}).on('{$event}', {$handle});\";\n }\n $this->getView()->registerJs(implode(PHP_EOL, $js));\n }\n }", "private function subscribeEvents()\n {\n // Subscribe the needed event for less merge and compression\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n\n $this->subscribeEvent(\n 'Shopware_Controllers_Widgets_Emotion_AddElement',\n 'onEmotionAddElement'\n );\n\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend',\n 'onPostDispatchFrontend'\n );\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "private function installEvents()\n {\n $this->load->model('setting/event');\n\n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/customer/editCustomer/after',\n 'extension/payment/mundipagg_events/onCustomerEdit'\n );\n \n $this->model_setting_event->addEvent(\n 'payment_mundipagg',\n 'catalog/model/account/address/addAddress/after',\n 'extension/payment/mundipagg_events/onAddressAdd'\n );\n }", "public function subscribe(Dispatcher $events): void\n {\n $events->listen('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n $events->listen('wp_enqueue_scripts', [$this, 'enqueueAppAssets']);\n $events->listen('login_enqueue_scripts', [$this, 'enqueueAppAssets']);\n $events->listen('admin_init', [$this, 'enqueueEditorAssets']);\n }", "public function subscribe(Dispatcher $events): void\n {\n $events->listen('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n $events->listen('wp_enqueue_scripts', [$this, 'enqueueAppAssets']);\n $events->listen('login_enqueue_scripts', [$this, 'enqueueAppAssets']);\n $events->listen('admin_init', [$this, 'enqueueEditorAssets']);\n }", "public function boot()\n {\n Event::listen('eloquent.created: *', function($data,$data2) {\n $this->save_event('crear',$data2);\n });\n\n Event::listen('eloquent.updated: *', function($data,$data2) {\n $this->save_event('actualizar',$data2);\n });\n\n Event::listen('eloquent.deleting: *', function($data,$data2) {\n $this->save_event('borrar',$data2);\n });\n }", "private function registerEventStore() : void\n {\n $this->app->bind(IlluminateEventStore::class, function ($app) {\n $connection = $app->make(Connection::class);\n $serializer = $app->make(Serializer::class);\n $eventStoreTable = $app->config->get('event_sourcing.event_store_table');\n\n return new IlluminateEventStore(\n $connection,\n $serializer,\n $eventStoreTable\n // decorators (we could decorate the stream with account_id)\n );\n });\n\n $this->app->bind(\n EventStore::class,\n IlluminateEventStore::class\n );\n }", "public function listenToEvents()\n\t{\n\t\tif ($scope = $this->getModelResolvingScope()) {\n\t\t\t$this->eventDispatcher->listen('eloquent.booted: *', function ($model, $data = null) use ($scope) {\n\t\t\t\tif (is_string($model) && is_array($data)) { // Laravel 5.4 wildcard event\n\t\t\t\t\t$model = reset($data);\n\t\t\t\t}\n\n\t\t\t\t$model->addGlobalScope($scope);\n\t\t\t});\n\t\t}\n\n\t\tif (class_exists(\\Illuminate\\Database\\Events\\QueryExecuted::class)) {\n\t\t\t// Laravel 5.2 and up\n\t\t\t$this->eventDispatcher->listen(\\Illuminate\\Database\\Events\\QueryExecuted::class, function ($event) {\n\t\t\t\t$this->registerQuery($event);\n\t\t\t});\n\t\t} else {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\t$this->eventDispatcher->listen('illuminate.query', function ($event) {\n\t\t\t\t$this->registerLegacyQuery($event);\n\t\t\t});\n\t\t}\n\n\t\t// register all event listeners individually so we don't have to regex the event type and support Laravel <5.4\n\t\t$this->listenToModelEvent('retrieved');\n\t\t$this->listenToModelEvent('created');\n\t\t$this->listenToModelEvent('updated');\n\t\t$this->listenToModelEvent('deleted');\n\t}", "public function boot(DispatcherContract $events)\n\t{\n\t\t\n\t\tparent::boot($events);\n\t\t\n\t\t\\Event::listen('Rapidweb\\Admin\\Events\\PodcastWasPurchased', function($event)\n\t\t{\n\t\t\t// Handle the event...\n\t\t\treturn 'hello world';\n\t\t\t\t\n\t\t});\n\t\t\n\n\t\t//\n\t}", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "protected static function boot()\n {\n static::addGlobalScope(new EventScope);\n static::addGlobalScope(new ApprovedEventScope);\n parent::boot();\n }", "public function boot()\n {\n // When a Signup's why_participated, quantity, quantity_pending, or deleted_at are changed, create an event.\n // @TODO: when we move quantity on the post, we'll want to remove this check below.\n Signup::saved(function ($signup) {\n if ($signup->isDirty('why_participated') || $signup->isDirty('quantity') || $signup->isDirty('quantity_pending') || $signup->isDirty('deleted_at') || $signup->isDirty('source')) {\n $signup->events()->create([\n 'content' => $signup->toJson(),\n // Use the authenticated user if coming from the web,\n // otherwise use the id of the user in the request.\n 'user' => auth()->id() ? auth()->id() : $signup->northstar_id,\n ]);\n }\n });\n\n // When Posts are saved create an event for them.\n Post::saved(function ($post) {\n $post->events()->create([\n // @TODO: this should include the tags with the post\n 'content' => $post->toJson(),\n // Use the authenticated user if coming from the web,\n // otherwise use the id of the user in the request.\n 'user' => auth()->id() ? auth()->id() : $post->northstar_id,\n ]);\n });\n\n // When Reviews are saved create an event for them.\n Review::saved(function ($review) {\n $review->events()->create([\n 'content' => $review->toJson(),\n 'user' => $review->admin_northstar_id,\n ]);\n });\n }", "public function subscribeEvents()\n {\n $this->subscribeEvent('Enlight_Controller_Front_StartDispatch', 'onStartDispatch');\n }", "function defineHandlers(&$events) {\n /*\n * example handlers see: handlers/on_admin_sections.php and handlers/on_build_menu.php\n * \n */\n\n //$events->listen('on_build_menu', 'on_build_menu');\n //$events->listen('on_admin_sections', 'on_admin_sections');\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n \n // 添加用户观察者\n User::observe(new UserObserver);\n \n // 添加分享观察者\n Stuff::observe(new StuffObserver);\n \n // 添加评论观察者\n Comment::observe(new CommentObserver);\n \n // 添加意见反馈观察者\n Feedback::observe(new FeedbackObserver);\n \n // 添加关注观察者\n Follow::observe(new FollowObserver);\n \n // 添加点赞观察者\n Like::observe(new LikeObserver);\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public static function getSubscribedEvents(): array\n {\n return [KernelEvents::EXCEPTION => ['onException', 20]];\n }", "protected function initializeEvents()\n\t{\n\t\tparent::initializeEvents();\n\t\t$this->events->add('beforeRender');\n\t\t$this->events->add('render');\n\t}", "public function boot()\n {\n $this->registerObservers();\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n\n //\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n\n //\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n\n //\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n\n //\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n\n //\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n\n //\n }", "public function boot(): void\n {\n foreach ($this->observers as $model => $observer) {\n foreach ($observer as $item) {\n $model::observe($item);\n }\n }\n\n foreach ($this->listen as $event => $listeners) {\n foreach (array_unique($listeners, SORT_REGULAR) as $listener) {\n Event::listen($event, $listener);\n }\n }\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n }", "public function boot(DispatcherContract $events)\n {\n parent::boot($events);\n }", "private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }", "public function subscribe(): void\n {\n foreach (static::$eventHandlerMap as $eventName => $handler) {\n $this->events->listen($eventName, [$this, $handler]);\n }\n }", "public function boot(DispatcherContract $events)\n\t{\n\t\tparent::boot($events);\n\n\t\t//\n\t}", "public function boot()\n {\n parent::boot();\n\n ///Переобернули события старого типа в более удобный тип\n\n Event::listen('cron.collectJobs', function () {\n Event::fire(new CronCollectJobs());\n });\n Event::listen('cron.beforeRun', function ($RunDate) {\n Event::fire(new CronBeforeRun($RunDate));\n });\n Event::listen('cron.jobError', function ($name, $return, $runtime, $rundate) {\n Event::fire(new CronJobError($name, $return, $runtime, $rundate));\n });\n Event::listen('cron.jobSuccess', function ($name, $runtime, $rundate) {\n Event::fire(new CronJobSuccess($name, $runtime, $rundate));\n });\n Event::listen('cron.afterRun', function ($name, $return, $runtime, $rundate) {\n Event::fire(new CronAfterRun($name, $return, $runtime, $rundate));\n });\n Event::listen('cron.locked', function ($lockfile) {\n Event::fire(new CronLocked($lockfile));\n });\n }", "public function send_events()\n {\n }", "public function boot()\n {\n $this->registerPublishing();\n\n Telescope::start($this->app);\n Telescope::listenForStorageOpportunities($this->app);\n }", "function register_events() {\n\n\t\t// Labels for the backend Event publisher\n\t\t$event_labels = array(\n\t\t\t'name'\t\t\t\t\t=> 'Events',\n\t\t\t'singular_name'\t\t\t=> 'Event',\n\t\t\t'add_new'\t\t\t\t=> 'New Event',\n\t\t\t'add_new_item'\t\t\t=> 'Schedule Event',\n\t\t\t'edit_item'\t\t\t\t=> 'Edit Event',\n\t\t\t'new_item'\t\t\t\t=> 'New Event',\n\t\t\t'view_item'\t\t\t\t=> 'View Event',\n\t\t\t'search_items'\t\t\t=> 'Search Events',\n\t\t\t'not_found'\t\t\t\t=> 'No events found',\n\t\t\t'not_found_in_trash'\t=> 'No events found in Trash', \n\t\t\t'parent_item_colon'\t\t=> '',\n\t\t\t'menu_name'\t\t\t\t=> 'Events',\n\t\t);\n\t\t\n\t\t$event_capabilities = array(\n\t\t\t'edit_post'\t\t\t\t=> 'edit_post',\n\t\t\t'edit_posts'\t\t\t=> 'edit_posts',\n\t\t\t'edit_others_posts'\t\t=> 'edit_others_posts',\n\t\t\t'publish_posts'\t\t\t=> 'publish_posts',\n\t\t\t'read_post'\t\t\t\t=> 'read_post',\n\t\t\t'read_private_posts'\t=> 'read_private_posts',\n\t\t\t'delete_post'\t\t\t=> 'delete_post'\n\t\t);\t\t\t\n\t\t\t\n\t\t// Construct the arguments for our custom slide post type\n\t\t$event_args = array(\n\t\t\t'labels'\t\t\t\t=> $event_labels,\n\t\t\t'description'\t\t\t=> 'Scheduled calendar events',\n\t\t\t'public'\t\t\t\t=> true,\n\t\t\t'publicly_queryable'\t=> true,\n\t\t\t'exclude_from_search'\t=> true,\n\t\t\t'show_ui'\t\t\t\t=> true,\n\t\t\t'show_in_menu'\t\t\t=> true,\n\t\t\t'show_in_nav_menus'\t\t=> false,\n\t\t\t'menu_icon'\t\t\t\t=> THEME_URI . '/images/icons/calendar-icon-20.png',\n\t\t\t'capabilities'\t\t\t=> $event_capabilities,\n\t\t\t'map_meta_cap'\t\t\t=> true,\n\t\t\t'hierarchical'\t\t\t=> false,\n\t\t\t'supports'\t\t\t\t=> array( 'title', 'editor', 'thumbnail' ),\n\t\t\t'taxonomies'\t\t\t=> array( 'calendar' , 'occurence' ),\n\t\t\t'has_archive'\t\t\t=> false,\n\t\t\t'rewrite'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t'slug' \t=> 'event',\n\t\t\t\t\t\t\t\t\t\t'feeds'\t=> false,\n\t\t\t\t\t\t\t\t\t\t'pages'\t=> false,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t'query_var'\t\t\t\t=> true,\n\t\t\t'can_export'\t\t\t=> true,\n\t\t);\n\n\t\t\n\t\t// Register the Event post type!\n\t\tregister_post_type( 'event', $event_args );\n\t}", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'condition' => array('type' => 'Event')\n ));\n \n $this->set('events', $eventdata);\n \n $this->assignUserToView($this->Auth->user('id'));\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Info');\n }", "protected function _subscribeToEngineEvents()\n {\n $controller = $this->getController();\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array(\n 'callback' => array( $this, 'onEndOfFax' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "public function boot()\n {\n if (!chdir($this->path)) {\n return;\n }\n\n $directories = array_filter(glob('*'), 'is_dir');\n\n foreach ($directories as $directory) {\n if ($this->hasListenFile($directory)) {\n $this->registerListeners($directory);\n }\n }\n\n foreach ($this->subscribe as $subscriber) {\n Event::subscribe($subscriber);\n }\n }", "public function boot()\n {\n parent::boot();\n\n User::observe($this->app->make(UserObserver::class));\n AnalyticsEvent::observe($this->app->make(AnalyticsEventObserver::class));\n }", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function boot()\n {\n if ($this->app->isLocal()) {\n Redis::enableEvents();\n }\n\n Image::observe(ImageObserver::class);\n Domain::observe(DomainObserver::class);\n }", "public function boot()\n {\n Dictionary::observe(DictionaryObserver::class);\n HouseLevy::observe(HouseLevyObserver::class);\n LandLevy::observe(LandLevyObserver::class);\n Period::observe(PeriodObserver::class);\n }", "protected function setEvents()\n {\n foreach ($this->preloadList as $preload) {\n include_once XOOPS_ROOT_PATH . '/modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php';\n $class_name = ucfirst($preload['module'])\n . ($preload['file'] == 'preload' ? '' : ucfirst($preload['file']) )\n . 'Preload';\n if (!class_exists($class_name)) {\n continue;\n }\n $class_methods = get_class_methods($class_name);\n foreach ($class_methods as $method) {\n if (strpos($method, 'event') === 0) {\n $event_name = strtolower(str_replace('event', '', $method));\n $event= array($class_name, $method);\n $this->eventListeners[$event_name][] = $event;\n }\n }\n }\n }", "public function boot()\n {\n Artist::observe(ArtistObserver::class);\n Album::observe(AlbumObserver::class);\n Genre::observe(GenreObserver::class);\n Label::observe(LabelObserver::class);\n User::observe(UserObserver::class);\n }", "public function registerEvents(Container $container)\n {\n $container->singleton('events', function ($container) {\n return (new Dispatcher($container))->setQueueResolver(function () use ($container) {\n return $container->make(QueueFactoryContract::class);\n });\n });\n }", "function Doku_Event_Handler() {\n\n // load action plugins\n $plugin = NULL;\n $pluginlist = plugin_list('action');\n\n foreach ($pluginlist as $plugin_name) {\n $plugin =& plugin_load('action',$plugin_name);\n\n if ($plugin !== NULL) $plugin->register($this);\n }\n }", "public function boot() : void\n {\n $eventBus = $this->app->make(EventBus::class);\n\n // The projections config contains a list of class names or projectors.\n // Each of these projectors will be subscribed to the given event bus.\n $projectors = $this->app->config->get('event_sourcing.projectors');\n\n foreach ($projectors as $projector) {\n $eventBus->subscribe(\n $this->app->make($projector)\n );\n }\n\n Reconstitution::reconstituteUsing(\n new ReconstituteUsingInstantiatorAndHydrator(\n new Instantiator(),\n new HydrateUsingReflection()\n )\n );\n }", "public function boot()\n {\n Image::observe(ImageObserver::class);\n Section::observe(SectionObserver::class);\n Post::observe(PostObserver::class);\n Virtual_Book::observe(VirtualBookObserver::class);\n Book::observe(BookObserver::class);\n }", "public function boot()\n {\n // Event Listeners\n $this->eventListeners($this->events);\n\n // Event Subscriptions\n $this->eventSubscriptions($this->eventSubscribers);\n\n // Observers\n $this->addObservers($this->observers);\n\n // Extensions\n $this->registerExtensions($this->extensions);\n\n // Features\n $this->registerFeatures($this->features);\n\n // Permissions\n $this->registerPermissions($this->permissions);\n }", "protected function registerListeners()\n {\n }", "public static function registerListeners()\n {\n static::creating('Wildside\\Userstamps\\Listeners\\Creating@handle');\n static::updating('Wildside\\Userstamps\\Listeners\\Updating@handle');\n\n if( method_exists(get_called_class(), 'deleting') )\n {\n static::deleting('Wildside\\Userstamps\\Listeners\\Deleting@handle');\n }\n\n if( method_exists(get_called_class(), 'restoring') )\n {\n static::restoring('Wildside\\Userstamps\\Listeners\\Restoring@handle');\n }\n }", "public function boot(Dispatcher $events)\n {\n Schema::defaultStringLength(191);\n setlocale(LC_TIME, \"{$this->app->getLocale()}.UTF8\");\n\n $events->listen(BuildingMenu::class, function (BuildingMenu $event) {\n $this->loadMenu($event->menu);\n });\n }", "public function boot()\n {\n // Observe event\n // For example:\n // User::observe( new UserObserver );\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function boot(DispatcherContract $events)\r\n {\r\n parent::boot($events);\r\n //Event::listen('GetUploadsDir', 'FileUploadEventListener');\r\n //\r\n }", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "private function registerAll()\n {\n $this->registerApp();\n $this->registerPsr();\n $this->registerRequests();\n $this->registerResponses();\n $this->registerPlugins();\n $this->registerCallables();\n $this->registerViews();\n $this->registerUtils();\n }", "public function init()\n\t{\n\t\tEvents::register('user_insert', array($this, 'user_insert'));\n\t\tEvents::register('user_insert_ldap', array($this, 'user_insert_ldap'));\n\t\tEvents::register('user_update', array($this, 'user_update'));\n\t\tEvents::register('user_delete', array($this, 'user_delete'));\n\t\tEvents::register('users_import', array($this, 'users_import'));\n\t}", "public function boot(): void\n {\n $this->registerEvents();\n $this->registerQueueConnectors();\n }", "public function boot()\n {\n $this->app->make(RouteEventRegister::class)->resolve();\n }", "public function getSubscribedEvents()\n {\n return [Events::loadClassMetadata];\n }", "public function mount()\n {\n $this->events = Event::all();\n }", "public function boot()\n {\n Exchange::observe(ExchangeObserver::class);\n Withdrawal::observe(WithdrawalObserver::class);\n Topup::observe(TopupObserver::class);\n }", "protected static function boot()\r\n {\r\n parent::boot();\r\n\r\n foreach (static::$handleableEvents as $event) {\r\n static::$event(function($model) use ($event) {\r\n /** @var Model $model */\r\n return $model->handleEvent($event);\r\n });\r\n }\r\n }", "public function HookEvents() {\n\t\tadd_action( 'add_attachment', array( $this, 'EventFileUploaded' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'EventFileUploadedDeleted' ) );\n\t\tadd_action( 'admin_init', array( $this, 'EventAdminInit' ) );\n\t}", "protected function registerSubscribers(EventDispatcher $eventDispatcher): void\n {\n parent::registerSubscribers($eventDispatcher);\n\n // Register additional event subscribers that are only meant to be notified in a development environment:\n }", "public static function getSubscribedEvents()\n {\n return array(KernelEvents::REQUEST => 'onKernelRequestEvent');\n }", "public function boot(Dispatcher $events)\n {\n Carbon::setUtf8(true);\n Carbon::setLocale(config('app.locale'));\n setlocale(LC_TIME, config('app.locale'));\n $events->listen(BuildingMenu::class, function (BuildingMenu $event) {\n $event->menu->add([\n 'text' => 'Categories',\n 'route' => 'categories.index',\n 'label' => Category::all()->count(),\n 'icon' => 'fas fa-fw fa-list',\n ]);\n $event->menu->add([\n 'text' => 'Products',\n 'route' => 'products.index',\n 'label' => Product::all()->count(),\n 'label_color' => 'success',\n 'icon' => 'fas fa-fw fa-fan',\n ]);\n $event->menu->add([\n 'text' => 'Posts',\n 'route' => 'posts.index',\n 'label' => Post::all()->count(),\n 'label_color' => 'info',\n 'icon' => 'fas fa-fw fa-blog',\n ]);\n });\n\n\n View::composer('*', function ($view) {\n $view->with('categories', Category::all())\n ->with('product_count', Product::count())\n ->with('latest_posts', Post::orderBy('updated_at', 'desc')->take(config('app.latest_posts_count'))->get()) ;\n });\n }", "protected function scanEvents()\n {\n $scans = $this->eventScans();\n\n if (empty($scans)) {\n return;\n }\n\n $scanner = $this->app->make('annotations.event.scanner');\n\n $scanner->setClassesToScan($scans);\n\n file_put_contents(\n $this->finder->getScannedEventsPath(), '<?php '.$scanner->getEventDefinitions()\n );\n }", "public function boot()\n {\n //Register Observers\n Employee::observe(EmployeeObserver::class);\n Lead::observe(LeadObserver::class);\n }", "abstract function HookEvents();", "public function register()\n\t{\n\t\t$this->runListeners();\n\t}", "public function boot()\n {\n parent::boot();\n // 如果变量$events不存在,你也可以通过Facade调用\\Event::listen()。\n \\Event::listen('laravels.received_request', function (\\Illuminate\\Http\\Request $req, $app) {\n $req->query->set('get_key', 'hhxsv5');// 修改querystring\n $req->request->set('post_key', 'hhxsv5'); // 修改post body\n });\n \\Event::listen('laravels.generated_response', function (\\Illuminate\\Http\\Request $req, \\Symfony\\Component\\HttpFoundation\\Response $rsp, $app) {\n $rsp->headers->set('header-key', 'hhxsv5');// 修改header\n });\n }", "public function initEvents()\n\t{\n\t\t$this->collEvents = new PropelObjectCollection();\n\t\t$this->collEvents->setModel('Event');\n\t}" ]
[ "0.8219639", "0.81953627", "0.76963043", "0.75230837", "0.7309002", "0.71383685", "0.69938403", "0.6951242", "0.6819252", "0.6813204", "0.67984855", "0.6773068", "0.6728253", "0.66973037", "0.6689797", "0.66618806", "0.66205025", "0.6603508", "0.65726024", "0.65529466", "0.65529466", "0.6551165", "0.6541198", "0.65393674", "0.6539025", "0.65271455", "0.64854586", "0.6472285", "0.6457004", "0.6454581", "0.6431992", "0.6431992", "0.6421873", "0.6400581", "0.6386949", "0.637676", "0.63347054", "0.63199973", "0.6309207", "0.62596494", "0.6252525", "0.62378365", "0.62271065", "0.622293", "0.62154645", "0.62140024", "0.6172353", "0.6172353", "0.6172353", "0.6172353", "0.6172353", "0.6172353", "0.61609256", "0.61577797", "0.61577797", "0.61537397", "0.61407864", "0.6124164", "0.61238194", "0.61237156", "0.61202776", "0.6119748", "0.6118773", "0.6115148", "0.6114077", "0.61026996", "0.6087647", "0.60867155", "0.6086401", "0.608334", "0.6078536", "0.607543", "0.60684067", "0.6060704", "0.60550594", "0.6048081", "0.60435665", "0.6043274", "0.60400784", "0.60399663", "0.60377747", "0.6035209", "0.6030753", "0.6025361", "0.6019464", "0.6015652", "0.60049325", "0.6001309", "0.5999466", "0.5989658", "0.596149", "0.59549737", "0.594191", "0.59398085", "0.59384114", "0.5931888", "0.59295243", "0.59271306", "0.59153867", "0.59088975", "0.59029335" ]
0.0
-1
This method returns js code
public function returnFieldJS() { return " console.log(this); console.log(jQuery('[name$=\"[copyright]\"')); "; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJavascriptCode() {}", "public function getJavaScript() {}", "public function js();", "protected function generateJavascript() {}", "protected function generateJavascript() {}", "public static function js();", "public function js()\n {\n }", "public function getJs();", "protected function renderAsJavascript() {}", "protected function generateJavascript()\n\t{\n\t}", "public function getCompressJavascript() {}", "public function getCode()\n {\n parent::getCode();\n $js = sprintf('var %s = new GPoint(%s, %s);',\n $this->getVarName(),\n $this->x,\n $this->y);\n return $js;\n }", "protected function initJavascriptCode() {}", "public function getJs()\n {\n return $this->data(self::JS);\n }", "protected function renderJavascript(){\n \n return sprintf(\n '<script type=\"text/javascript\" src=\"%s\"></script>',\n $this->getField('url')\n );\n \n }", "protected function _getInlineJavaScript()\n {\n return '';\n }", "public function getJs()\n\t{\n $ret = '<script>\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/'.$this->lang.'/all.js#xfbml=1\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, \"script\", \"facebook-jssdk\"));\n </script>';\n \n return $ret;\n\t}", "public function __get_js() { return $this->_js; }", "public function getPrintJavaScriptHTML() {\r\n\t\t$javaScript = LF . '<script type=\"text/javascript\">' . LF . '/*<![CDATA[*/' . LF . '<!--';\r\n\t\t$javaScript .= $this->getPrintJavaScript();\r\n\t\t$javaScript .= LF . '//-->' . LF . '/*]]>*/' . LF . '</script>' . LF;\r\n\t\treturn $javaScript;\r\n\t\t\t\r\n\t}", "static public function getJavaScript() {\n\t\treturn self::$js;\n\t}", "public function __toString() \r\n\t{\r\n\t\t$sHtml = \"<script type=\\\"text/javascript\\\">\\n\";\r\n\t\t$sHtml .= $this->gerarJavascript();\r\n\t\t$sHtml .= \"</script>\\n\";\r\n\t\t$sHtml .= $this->gerarHtml();\r\n\t\t\r\n\t\treturn $sHtml;\r\n\t}", "protected function doCompressJavaScript() {}", "public function getConcatenateJavascript() {}", "public function elementor_js() {\n }", "private function renderJs(): string {\n\t\t$result = '';\n\t\tif (!empty($this->_configBundles)) {\n\t\t\t$result .= $this->getView()->element('DataTables.script', ['configBundles' => $this->_configBundles]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function js_value()\n {\n }", "protected function getRteInitJsCode() {}", "private function getMainJS() {\n\t\t$encodedData = json_encode($this->Data);\n\n\t\tif (false === $encodedData) {\n\t\t\t$this->ErrorString = sprintf('%s (%s: %u)',\n\t\t\t\t__('There is an unknown problem with this plot.'),\n\t\t\t\t__('Error code'),\n\t\t\t\tjson_last_error()\n\t\t\t);\n\n\t\t\treturn $this->getJSForError();\n\t\t}\n\n\t\treturn 'RunalyzePlot.addPlot(\"'.$this->cssID.'\", '.\n\t\t\t\t$encodedData.', '.\n\t\t\t\tAjax::json_encode_jsfunc($this->Options).', '.\n\t\t\t\tjson_encode($this->PlotOptions).', '.\n\t\t\t\tjson_encode($this->Annotations).');';\n\t}", "function script()\n {\n return '<script type=\"text/javascript\" src=\"' . $this->URL . '\"></script>';\n }", "public static function getJS()\n {\n $js =\n\"<script>\n\t// Hide or show detail fields of languages\n\tfunction toggleClangDetailsView(clang_id) {\n\t\tif ($(\\\"select[name='form[lang][\\\" + clang_id + \\\"][translation_needs_update]']\\\").val() === 'delete') {\n\t\t\t$('#details_clang_' + clang_id).slideUp();\n\t\t}\n\t\telse {\n\t\t\t$('#details_clang_' + clang_id).slideDown();\n\t\t};\n\t}\n\n\t// slide fieldsets\n\tjQuery(document).ready(function($) {\n\t\t$('legend').click(function(e) {\n\t\t\t$(this).toggleClass('open');\n\t\t\t$(this).next('.panel-body-wrapper.slide').slideToggle();\n\t\t});\n\t});\n\t// Open all fieldsets when save was clicked for being able to focus required fields\n\t$('button[type=submit]').click(function() {\n\t\t$('legend').each(function() {\n\t\t\tif(!$(this).hasClass('open')) {\n\t\t\t\t$(this).addClass('open');\n\t\t\t\t$(this).next('.panel-body-wrapper.slide').slideToggle();\n\t\t\t}\n\t\t});\n\t\treturn true;\n\t});\n</script>\";\n return $js;\n }", "function generateJS(){\n\t\t\t\t\n\t\t\t\t$strJS = \"\";\n\t\t\t\t\n\t\t\t\t$strJS .= \"var intIdProject = \";\n\t\t\t\t\n\t\t\t\tif($this->getJSSelectedProject() != 0){\n\t\t\t\t\t$strJS .= $this->getJSSelectedProject().\"\\n\";\n\t\t\t\t}else{\n\t\t\t\t\t$strJS .= \"'';\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$strJS .= $this->_JSgenerateArrayProjects();\n\t\t\t\t$strJS .= $this->_JSgenerateFunctions();\n\t\t\t\t\n\t\t\t\treturn $strJS;\n\t\t\t}", "public function INTincScript_loadJSCode() {}", "public function getJsRenderer() {\t\n\t\t$html = $this->html;\t\n\t\tpreg_match_all('/{\\w*}/', $html, $res);\t\t\n\t\tif (!empty($res)) {\n\t\t\t$matches = $res[0];\n\t\t\t$replaceStr = \"\";\n\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t$replaceStr .= '.replace(\"'.$value.'\", row.'.str_replace(array('{','}'), array('',''), $value).')';\n\t\t\t}\n\t\t} \t\t\n\t\treturn 'function(row) { return '.json_encode($html).$replaceStr.' }';\t\n\t\t\n\t}", "public function getMainJs()\n {\n $this->data = \"/* --- Retargeting Tracker Functions --- */\\n\\n\";\n\n $this->data .= $this->setEmail();\n\n $this->data .= $this->getPageJS($this->currentPage, $this->currentCategory, $this->manufacturerId, $this->productId);\n\n return $this->data;\n }", "public function createJS(){\n $clickFunction = '\n function (){\n jQuery.gridButtonAjaxConfirm({\n idGrid: \"' . $this->getIdGrid() . '\",\n url: \"' . $this->getUrl() . '\",\n method: \"' . $this->getMethod() . '\",\n param: \"' . $this->getParam() . '\",\n onConfirm: ' . $this->getOnConfirm() . ',\n onAfterLoad: ' . $this->getOnAfterLoad() . ',\n message:\\'' . str_replace(array(\"'\",chr(10),chr(13)),array(\"\\'\",'',''),$this->getMessage()) . '\\'\n });\n }\n ';\n return $clickFunction;\n }", "public function getJavaScripts();", "public function js_1()\n {\n }", "function javascript_html() {\n\t\t$javascript_url = esc_url( $this->javascript_url() );\n\t\t$script =<<<HTML\n<script async src=\"{$javascript_url}\"></script>\nHTML;\n\t\treturn $script;\n\t}", "public function getCustomJsContent()\n {\n return $this->getGravityHelper()->getCustomJs();\n }", "public function getJS()\n\t{\n\t\t$piwikJs = PiwikTracker::js();\n\n\t\tif (false === $piwikJs) {\n\t\t\t// We failed to get the javascript code\n\t\t\treturn App::abort(500);\n\t\t}\n\n\t\treturn Response::make($piwikJs, 200, ['Content-Type' => 'application/javascript']);\n\t}", "public function get_output_script() {\n $output = '<script>';\n $output .= 'var Aw = ' . $this->prepare_json();\n $output .= '</script>';\n \n return $output;\n }", "protected function getJavascript()\n {\n $allowed_types = Config::inst()->get(GoogleAddressField::class, 'allowed_types');\n\n if ($allowed_types) {\n return '\n if(typeof GoogleAddressFieldStatics === \"undefined\") {\n var GoogleAddressFieldStatics = {};\n }\n GoogleAddressFieldStatics.allowedTypes = ' . json_encode($allowed_types) . ';\n ';\n }\n\n return '';\n }", "public function returnFieldJS() {}", "public function getJavaScript()\n {\n ob_start();\n ?>\n webFormChangesMade = false;\n\n <?php\n foreach($this->_fields as $field)\n {\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n echo sprintf(\" var wf%sMonthError = false;\\n var wf%sYearError = false;\",\n $field['id'], $field['id']\n );\n }\n else\n {\n echo sprintf(\" var wf%sError = false;\\n\",\n $field['id']\n );\n }\n }\n ?>\n\n function webFormSubmit(form)\n {\n var errors = '';\n var tmperrors = '';\n <?php\n foreach($this->_fields as $field)\n {\n if ($field['type'] == WFT_CC_EXPIRATION)\n {\n ?>\n var <?php echo $field['id'] ?>Month = document.getElementById('<?php echo $field['id'] ?>Month');\n var <?php echo $field['id'] ?>Year = document.getElementById('<?php echo $field['id'] ?>Year');\n if (<?php echo $field['id'] ?>Month.value == 'nosel' || <?php echo $field['id'] ?>Year.value == 'nosel')\n errors += \":You must select an expiration date and year for your credit card\";\n <?php\n }\n else if($field['type'] == WFT_SELECT || $field['type'] == WFT_CC_TYPE || $field['type'] == WFT_BOOLEAN)\n {\n ?>\n var <?php echo $field['id'] ?> = document.getElementById('<?php echo $field['id'] ?>');\n if (<?php echo $field['id'] ?>.value == 'nosel')\n errors += \":You must select a value for <?php echo addslashes($field['caption']) ?>\";\n <?php\n }\n else\n {\n ?>\n errors += webFormValidateField('<?php echo $field['id']; ?>', <?php echo ($field['required'] ? 'true' : 'false'); ?>);\n <?php\n }\n }\n ?>\n\n if (errors != '')\n {\n alert(\"Please correct the following problems with your entries:\\n\" + errors.replace(/:/g,\"\\n- \"));\n }\n else\n {\n eval('document.' + form + '.submit();');\n }\n }\n function webFormValidateField(id, required)\n {\n var obj = document.getElementById(id);\n var objCaption = document.getElementById(id + 'Caption');\n var retVal;\n\n if(obj)\n {\n if (obj.value == '' && required == false) return '';\n var str = obj.value;\n str = str.replace(/'/g,\"\\\\'\");\n str = str.replace(/\\r/g,\"\");\n str = str.replace(/\\n/g,\"\");\n eval( 'retVal = webFormValidate' + id + '(\\'' + str + '\\');' );\n\n if (retVal != '')\n {\n obj.style.backgroundColor = '#FFE8E8';\n if (objCaption) objCaption.innerHTML = retVal.substr(1);\n <?php\n if ($this->_verifyForm)\n {\n echo sprintf(\"webFormEditField('%s', true, %s);\", $field['id'], ($field['required'] ? 'true' : 'false'));\n }\n ?>\n }\n else\n {\n obj.style.backgroundColor= '#FFFFFF';\n if (objCaption) objCaption.innerHTML = '';\n }\n return retVal;\n }\n return '';\n }\n\n <?php\n if ($this->_verifyForm)\n {\n ?>\n function webFormFormatEditFields()\n {\n <?php\n // get the formatting right for display\n foreach ($this->_fields as $field)\n {\n switch ($field['type'])\n {\n case WFT_PHONE:\n ?>programs:/Utilities/\n var obj = document.getElementById('<?php echo $field['id'] ?>EditText');\n if (obj)\n {\n var str = obj.innerHTML;\n if (str.length == 10)\n obj.innerHTML = str.substring(0, 3) + '-' + str.substring(3, 6) + '-' + str.substring(6, 10);\n }\n <?php\n break;\n }\n }\n ?>\n }\n\n function webFormFieldHover(id, tf)\n {\n var editButton = document.getElementById(id + 'Edit');\n var editContainer = document.getElementById(id + 'Container');\n if (tf == true && editButton)\n {\n editButton.style.visibility = 'visible';\n editContainer.style.border = '1px dotted #333333';\n editContainer.style.backgroundColor = '#e0e0e0';\n }\n else if(editButton)\n {\n editButton.style.visibility = 'hidden';\n editContainer.style.border = '1px solid #c0c0c0';\n editContainer.style.backgroundColor = '#f0f0f0';\n }\n }\n\n function webFormCancelEditField(id, required)\n {\n var inputBox = document.getElementById(id);\n var inputBoxMonth = document.getElementById(id+'Month');\n var inputBoxYear = document.getElementById(id+'Year');\n var editText = document.getElementById(id + 'EditText');\n\n if (inputBox)\n {\n var oldText = editText.innerHTML;\n if (oldText.indexOf('(Empty)') != -1)\n inputBox.value = '';\n else\n inputBox.value = oldText;\n }\n else if(inputBoxMonth && inputBoxYear)\n {\n var expire = editText.innerHTML;\n var parts = expire.split('/');\n inputBoxMonth.value = parts[0];\n inputBoxYear.value = parts[1];\n }\n webFormEditField(id, false, false);\n }\n\n function webFormEditField(id, tf, required)\n {\n var editButton = document.getElementById(id + 'Edit');\n var editContainer = document.getElementById(id + 'Container');\n var editText = document.getElementById(id + 'EditText');\n var inputBox = document.getElementById(id);\n var saveButton = document.getElementById(id + 'Save');\n var cancelButton = document.getElementById(id + 'Cancel');\n\n var inputBoxMonth = document.getElementById(id+'Month');\n var inputBoxYear = document.getElementById(id+'Year');\n\n // for verify images\n if (!saveButton) return;\n\n if (tf == true)\n {\n showVal = \"\";\n hideVal = \"none\";\n saveButton.style.display = \"\";\n cancelButton.style.display = \"\";\n editButton.style.display = \"none\";\n editContainer.style.display = \"none\";\n editText.style.display = \"none\";\n if (inputBox)\n {\n inputBox.style.display = \"\";\n inputBox.focus();\n if (inputBox.type != 'select-one')\n inputBox.select();\n }\n if (inputBoxMonth && inputBoxYear)\n {\n inputBoxMonth.style.display = \"\";\n inputBoxMonth.focus();\n inputBoxYear.style.display = \"\";\n }\n }\n else\n {\n errors = webFormValidateField(id, required);\n if (errors == '')\n {\n saveButton.style.display = \"none\";\n cancelButton.style.display = \"none\";\n editButton.style.display = \"\";\n editContainer.style.display = \"\";\n editText.style.display = \"\";\n if (inputBox) inputBox.style.display = \"none\";\n if (inputBoxMonth && inputBoxYear)\n {\n inputBoxMonth.style.display = \"none\";\n inputBoxYear.style.display = \"none\";\n if (inputBoxMonth.value != '' && inputBoxYear.value != '')\n editText.innerHTML = inputBoxMonth.value + \"/\" + inputBoxYear.value;\n else\n editText.innerHTML = \"<span style=\\\"color: #999999;\\\">(Empty)</span>\";\n }\n else\n {\n var str;\n\n if (inputBox.type == 'select-one')\n {\n // <select> element\n str = inputBox.options[inputBox.selectedIndex].text;\n }\n else\n {\n str = inputBox.value;\n }\n\n if (str.length == 0)\n editText.innerHTML = \"<span style=\\\"color: #999999;\\\">(Empty)</span>\";\n else\n editText.innerHTML = str;\n }\n webFormChangesMade = true;\n }\n webFormFormatEditFields();\n }\n }\n <?php\n }\n ?>\n\n <?php\n foreach($this->_fields as $field)\n {\n ?>\n function webFormValidate<?php echo $field['id'] ?>(data)\n {\n <?php\n if ($field['required'])\n {\n ?>\n if (data == '')\n {\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo (strlen($field['caption']) > 0 ? $field['caption'] : 'This field'); ?> is a required field';\n }\n <?php\n }\n if (!$field['required']) echo \"if (data.length > 0)\\n{\\n\";\n ?>\n if (data.length < <?php echo $field['length'][0]; ?> || data.length > <?php echo $field['length'][1]; ?>)\n {\n <?php\n if ($field['length'][0] == $field['length'][1])\n {\n ?>\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo (strlen($field['caption']) > 0 ? $field['caption'] : 'This field'); ?> must be <?php echo $field['length'][0] ?> characters in length';\n <?php\n }\n else\n {\n ?>\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo $field['caption']; ?> must be between <?php echo implode(' and ', $field['length']) ?> characters in length';\n <?php\n }\n ?>\n }\n <?php\n if (!$field['required'])\n {\n echo \"}\\n\";\n }\n if (strlen($field['regex_test']) > 0)\n {\n ?>\n var re = <?php echo $field['regex_test']; ?>;\n if (!data.match(re))\n {\n wf<?php echo $field['id']; ?>Error = true;\n return ':<?php echo $field['regex_fail']; ?>';\n }\n <?php\n }\n if ($field['type'] == WFT_SELECT)\n {\n ?>\n if (data == 'nosel')\n {\n wf<?php echo $field['id']; ?>Error = true;\n return ':Please select a value for <?php echo $field['caption']; ?>';\n }\n <?php\n }\n ?>\n wf<?php echo $field['id']; ?>Error = false;\n return '';\n }\n <?php\n }\n\n ?>\n function webFormShowErrorBox(obj)\n {\n var xy = webFormFindPos(obj);\n var error = false;\n var errorMessage = '';\n var errorBox = document.getElementById('webFormErrorBox');\n\n if (document.getElementById(obj.name))\n {\n eval('error = wf' + obj.name + 'Error;');\n }\n\n if (error)\n {\n errorMessage = '<table><tr><td align=\"left\" valign=\"center\"><img src=\"<?php echo $this->_relPath; ?>images/wf_error.gif\" border=\"0\" align=\"left\" style=\"padding-right: 5px;\"/></td><td align=\"left\" valign=\"center\" class=\"wfErrorText\">' + document.getElementById(obj.name + 'Caption').innerHTML + \"</td></tr></table>\";\n errorBox.style.left = '' + (xy[0] + 140) + 'px';\n errorBox.style.top = '' + (xy[1] - 10) + 'px';\n errorBox.style.visibility = 'visible';\n errorBox.innerHTML = errorMessage;\n }\n }\n\n function webFormHideErrorBox()\n {\n var errorBox = document.getElementById('webFormErrorBox');\n if (errorBox)\n errorBox.style.visibility = 'hidden';\n }\n\n function webFormShowHelpBox(obj, title, desc, rules)\n {\n var xy = webFormFindPos(obj);\n var helpBox = document.getElementById('webFormHelpBox');\n var error = false;\n\n if (document.getElementById(obj.name))\n {\n eval('error = wf' + obj.name + 'Error;');\n }\n\n if (helpBox && obj && !error)\n {\n helpBox.style.left = '' + (xy[0] + 140) + 'px';\n helpBox.style.top = '' + (xy[1] - 30) + 'px';\n helpBox.style.visibility = 'visible';\n helpBox.innerHTML = '<b>' + title + '</b><br />' + desc + '<p><b>Rules:</b><br />' + rules;\n }\n }\n\n function webFormHideHelpBox()\n {\n var helpBox = document.getElementById('webFormHelpBox');\n if (helpBox)\n helpBox.style.visibility = 'hidden';\n }\n\n function webFormFindPos(obj)\n {\n \tvar curleft = curtop = 0;\n \tif (obj.offsetParent)\n \t{\n \t\tcurleft = obj.offsetLeft\n \t\tcurtop = obj.offsetTop\n \t\twhile (obj = obj.offsetParent)\n \t\t{\n \t\t\tcurleft += obj.offsetLeft\n \t\t\tcurtop += obj.offsetTop\n \t\t}\n \t}\n \treturn [curleft,curtop];\n }\n <?php\n\n $js = ob_get_contents();\n ob_end_clean();\n return $js;\n }", "public function js_2()\n {\n }", "public function js(){\n if (func_num_args() > 0){\n for ($i = 0; $i < func_num_args(); $i++){\n $filename = func_get_arg($i); // Fatal error: func_get_arg(): Can't be used as a function parameter\n array_push($this->js, $this->javascript_tag($filename));\n }\n }\n \n return join($this->js, \"\\n\");\n }", "private function javascripter()\n {\n //@return : $stri_js => retourne le code javascript (return javascript)\n \n $stri_js=\"<script>\n function verif_form_page()\n {\n //vérification du formulaire (verify form)\n //@return : false => formulaire erroné (error)\n // void => valide le formulaire (submit form)\n \n // vérifie que le numéro de la page soit bien un chiffre (verify the n° of page is integer)\n if(isNaN(document.form_page.start.value))\n { \n alert('\"._ERROR_FIELD.\"'); //envoi du message d'erreur (send error message)\n document.form_page.start.focus(); //met le focus sur le textbox\n return false;\n }\n document.form_page.submit(); //valide le formulaire (submit form)\n }\n </script>\n \";\n \n return $stri_js; \n }", "protected function _getEndJs()\n\t{\n\t\t$js = parent::_getEndJs();\n\t\t$js .= \"pageJs._containerIds=\" . json_encode(array(\n\t\t\t\t'sku' => 'sku_div'\n\t\t\t\t,'description' => 'description_div'\n\t\t\t\t,'vendor' => 'vendor_div'\n\t\t\t\t,'prices' => 'prices_div'\n\t\t\t\t,'comments' => 'comments_div'\n\t\t\t\t,'saveBtn' => 'save_btn'\n\t\t)) . \";\";\n\t\t$js .= \"pageJs.load();\";\n\t\t$js .= \"pageJs.bindAllEventNObjects();\";\n\t\treturn $js;\n\t}", "public function get_js()\n {\n if (empty($this->js)) {\n $this->generate_js();\n }\n return $this->js;\n }", "abstract public function js_call();", "public function get_js($path='')\n\t{\n if ( $r = $this->get_view($path, 'js') ){\n return '\n<script>\n(function($){\n'.$r.'\n})(jQuery);\n</script>';\n }\n\t\treturn false;\n }", "public function toJavascript()\n {\n ob_start();\n ?>\n <script type=\"text/javascript\">\n jQuery( function ( $ )\n {\n \"use strict\";\n\n Morris.<?php echo $this->__chart_type ?>(\n <?php echo $this->toJSON() ?>\n );\n });\n </script>\n <?php\n $buffer = ob_get_contents();\n ob_end_clean();\n\n return $buffer;\n }", "public function getJSHandlerScript() {\n $CI = & get_instance();\n $scripturl = str_replace(\"http:\", \"\", $CI->config->item('base_url')) . \"js/bt_event_tracker.js\";\n $code = sprintf(\"$.ajaxSetup({cache:true});$.getScript('%s');\",$scripturl);\n return $code;\n }", "public static function js() {\r\n\t\t\t$s = '';\r\n\t\t\tforeach(func_get_args() as $js) {\r\n\t\t\t\t$file = WEB_ROOT . '/' . $js;\r\n\t\t\t\tif(!file_exists($file)) {\r\n\t\t\t\t\tABPF::logger()->error(\"JS file $file doesn't exist!\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$v = filemtime($file);\r\n\t\t\t\t$s .= sprintf('<script type=\"text/javascript\" src=\"%s/%s?v=%d\"></script>', BASE_URL, $js, $v);\r\n\t\t\t}\r\n\t\t\treturn $s;\r\n\t\t}", "protected function _getEndJs()\r\n\t{\r\n\t\t$js = parent::_getEndJs();\r\n\t\t\r\n\t\t$paymentMethods = array_map(create_function('$a', 'return $a->getJson();'), PaymentMethod::getAll());\r\n\t\t$shippingMethods = array_map(create_function('$a', 'return $a->getJson();'), Courier::getAll());\r\n\t\t$customer = (isset($_REQUEST['customerid']) && ($customer = Customer::get(trim($_REQUEST['customerid']))) instanceof Customer) ? $customer->getJson() : null;\r\n\t\t$js .= \"pageJs\";\r\n\t\t\t$js .= \".setHTMLIDs('detailswrapper')\";\r\n\t\t\t$js .= \".setCallbackId('searchCustomer', '\" . $this->searchCustomerBtn->getUniqueID() . \"')\";\r\n\t\t\t$js .= \".setCallbackId('searchProduct', '\" . $this->searchProductBtn->getUniqueID() . \"')\";\r\n\t\t\t$js .= \".setCallbackId('saveOrder', '\" . $this->saveOrderBtn->getUniqueID() . \"')\";\r\n\t\t\t$js .= \".setPaymentMethods(\" . json_encode($paymentMethods) . \")\";\r\n\t\t\t$js .= \".setShippingMethods(\" . json_encode($shippingMethods) . \")\";\r\n\t\t\t$js .= \".setOrderTypes(\" . json_encode(array_filter(Order::getAllTypes(), create_function('$a', 'return $a !== \"INVOICE\";'))) . \")\";\r\n\t\t\t$js .= \".init(\" . json_encode($customer) . \");\";\r\n\t\treturn $js;\r\n\t}", "function javascripts() {\n return $this->context->javascript_tags(func_get_args(), $this->base_url().\"/javascripts\");\n }", "public function getJsSnippet() {\n $sResult = '';\n ksort($this->_aJs);\n\n foreach ($this->_aJs as $aPriorGroup) {\n foreach ($aPriorGroup as $sSrc) {\n $sResult .= '<script type=\"text/javascript\" src=\"' . $sSrc . '\"></script>' . PHP_EOL;\n }\n }\n\n ksort($this->_aRawJs);\n\n foreach ($this->_aRawJs as $aPriorGroup) {\n foreach ($aPriorGroup as $sScript) {\n $sResult .= $sScript;\n }\n }\n\n return $sResult;\n }", "protected function _getEndJs()\n\t{\n\t\t$js = parent::_getEndJs();\n\t\t$js .= \"pageJs.setPreData(\" . json_encode(array()) . \");\";\n\t\t$js .= \"pageJs._containerIds=\" . json_encode(array(\n\t\t\t\t'title' => 'title_div'\n\t\t\t\t,'authorName' => 'authorName_div'\n\t\t\t\t,'author' => 'author_div'\n\t\t\t\t,'content' => 'content_div'\n\t\t\t\t,'topicsUnits' => 'topics_units_div'\n\t\t\t\t,'comments' => 'comments_div'\n\t\t\t\t,'newAnswer' => 'new_answers_btn_div'\n\t\t\t\t,'answers' => 'answers_div'\n\t\t\t\t,'saveBtn' => 'save_btn'\n\t\t)) . \";\";\n\t\t$js .= \"pageJs.load();\";\n\t\t$js .= \"pageJs.bindAllEventNObjects();\";\n\t\tif(!AccessControl::canEditQuestionDetailsPage(Core::getRole()))\n\t\t\t$js .= \"pageJs.readOnlyMode();\";\n\t\treturn $js;\n\t}", "protected function _getPreviewPersistenceJavascript()\n {\n $javascript = \"\";\n\n if ($rule = $this->getRequest()->getParam('rule', false)) {\n $jsonRule = Mage::helper(\"core\")->jsonEncode($rule);\n $javascript = <<<JAVASCRIPT\n if ({$this->getJsObjectName()}.reloadParams == false) {\n {$this->getJsObjectName()}.reloadParams = { rule : Object.toJSON({$jsonRule}) };\n } else {\n {$this->getJsObjectName()}.reloadParams.rule = Object.toJSON({$jsonRule});\n }\nJAVASCRIPT;\n }\n\n return $javascript;\n }", "protected function doConcatenateJavaScript() {}", "public function insert_js_code() {\n echo \"\\n<script>\\n\" . $this->getJsCodeToEcho($this->pluginCommon->optGid(), array(\n 'log' => $this->pluginCommon->optUseLogging(),\n 'localserver' => $this->isIgnoredServer(),\n )) . '</script>' . \"\\n\";\n }", "public function generateI18nJsContent() {\n $data = array();\n\n foreach ($this->_i18n as $k => $v)\n $data[] = strtolower($k) .':\\''. str_replace('\\'', '\\\\\\'', $v) .'\\'';\n\n return 'var language = \\''. $this->_language .'\\', i18n = {'. implode(', ', $data) .'};';\n }", "public function renderParamJs() {\n $script = '<script type=\"text/javascript\"> if(typeof TAMI.pagedata ==\"undefined\"){TAMI.pagedata={}; } ';\n\n foreach ($this->paramjs as $key => $val) {\n $script = $script . ' TAMI.pagedata.' . $key . '=' . json_encode($val) . '; ';\n }\n\n $script = $script . ' </script>';\n\n return $script;\n }", "public static function editor_js()\n {\n }", "private function getCAPTCHAAsJavascript()\n {\n $data = $this->getCAPTCHAAsHTML();\n if (PEAR::isError($data)) {\n return PEAR::raiseError($data->getMessage());\n }\n \n $obfus_data = rawurlencode($data);\n \n $javascript = \"<script type=\\\"text/javascript\\\">\n document.write(unescape(\\\"${obfus_data}\\\"));\n </script>\";\n \n return $javascript;\n }", "private function js($content)\n\t{\n\t\trequire_once __DIR__ . '/thirdparty/jshrink.php';\n\t\treturn \\JShrink\\Minifier::minify($content);\n\t}", "protected function _getEndJs()\r\n\t{\r\n\t\t$js = parent::_getEndJs ();\r\n\t\t$js .= 'pageJs';\r\n\t\t$js .= '.setCallbackId(\"getLatestTrans\", \"' . $this->getLatestTransBtn->getUniqueID () . '\")';\r\n\t\t$js .= '.setCallbackId(\"getSummary\", \"' . $this->getSummaryBtn->getUniqueID () . '\")';\r\n\t\t$js .= '.init(\"page-wrapper\", \"#' . $this->getForm ()->getClientID () . '\");';\r\n\t\treturn $js;\r\n\t}", "protected function addOnSubmitJavaScriptCode() {}", "public function getJavascript()\n {\n\t$script = \"\n\t\t\t\t\t\n google.load(\\\"visualization\\\", \\\"1\\\", {packages:[\\\"corechart\\\"]});\n google.setOnLoadCallback(drawChart\".$this->getId().\");\n function drawChart\".$this->getId().\"() {\n var data = google.visualization.arrayToDataTable([\".$this->getEncodedData().\"]);\n\t\n var options = {\n title: '\".$this->title.\"'\n };\n var chart = new google.visualization.PieChart(document.getElementById('\".$this->getWidgetElementId().\"'));\n chart.draw(data, options);\n }\t\t\t\t\t\";\n\t\n\t return $script;\t\n\t}", "public function javascript() {\r\n\t\tif ($this->scriptable === true || $this->scriptable === 'true') {\r\n\t\t\t\r\n\t\t\tif(@$this->scriptTo) {\r\n\t\t\t\t$element = pzk_element($this->scriptTo);\r\n\t\t\t\tif($element) {\r\n\t\t\t\t\t$element->append(pzk_parse('<html.js src=\"'.BASE_URL.'/js/'.implode('/', $this->fullNames).'.js\" />'));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$page =pzk_page();\r\n\t\t\t\tif ($page) {\r\n\t\t\t\t\t$page->addObjJs($this->tagName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->jsLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.js src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/js/'.$this->jsLink.'.js\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif ($this->jsExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.js src=\"'.$this->jsExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->jsExternalLink);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "public static function getScript($js) {\r\n $line = \"<script type=\\\"text/javascript\\\">\";\r\n $line.=$js;\r\n $line.=\"</script>\\n\";\r\n\r\n return $line;\r\n }", "protected function _runJs($js_code, $backoffice = 0)\n {\n if (Configuration::get('NEWSMAN_ACCOUNT_ID')) {\n $runjs_code = '';\n if (!empty($js_code)) {\n $runjs_code .= '\n \n <script type=\"text/javascript\">\n \n document.addEventListener(\"DOMContentLoaded\", function(event) {\n \n function cJ()\n {\n if (jLoadedNewsman) {\n \n var NMBG = NewsmanAnalyticEnhancedECommerce;\n \n ' . $js_code . '\n \n }\n else{\n setTimeout(function(){\n cJ();\n }, 1000);\n }\n }\n \n //jQuery(document).ready(function(){\n \n cJ();\n \n //});\n \n });\n \n </script>';\n }\n\n if ($this->js_state != 1 && ($backoffice == 0)) {\n $controller_name = Tools::getValue('controller');\n\n if (strpos($controller_name, 'Admin') !== false) {\n return $runjs_code;\n }\n\n if ($controller_name != 'order' && $controller_name != 'product') {\n $runjs_code .= '\n <script type=\"text/javascript\">\n //_nzm.run(\\'send\\', \\'pageview\\');\n </script>';\n }\n }\n\n return $runjs_code;\n }\n }", "function dumpJavascript()\r\n {\r\n //Do nothing yet\r\n }", "protected function loadJavascript() {}", "public function getPrintJavaScript() {\r\n\t\t$javaScript .= LF . $this->getPrintOptionsObjectIdentifier() . ' = ' . $this->getPrintOptions() . ';';\r\n\t\t$javaScript .= LF . $this->getPrintInitializeFunction();\r\n\t\treturn $javaScript;\r\n\t\t\t\r\n\t}", "public function startJs(){\r\n\r\n \r\n\t\t$vs_Js = \"\r\n\t\t\r\n\t\t\tvar interaktingslider = new InteraktingSlider(); \r\n\t\t\t\r\n\t\t\tinteraktingslider.setDelay(\".$this->getModel()->getDelay().\");\r\n\t\t\tinteraktingslider.setTransition('\".$this->getModel()->getTransition().\"');\r\n\t\t\tinteraktingslider.setSpeed(\".$this->getModel()->getSpeed().\");\t\t\r\n\t\t\tinteraktingslider.setMode('\".$this->getModel()->getMode().\"');\r\n\t\t\t\r\n\t\t\";\r\n\r\n\t\t$va_Slides = $this->getSlides();\r\n\r\n\t\tif($va_Slides){\r\n\t\t\tforeach ($va_Slides as $vo_Slide){\r\n\t\t\t\t$vs_Js .= 'interaktingslider.addSlide(\"'.$vo_Slide->getFormatedContent().'\"); ';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$vs_Js .= \"\r\n\t\t\tinteraktingslider.show(); \t\t\r\n\t\t\";\r\n\r\n\r\n\t\treturn $vs_Js;\r\n\r\n\t}", "public function GrJsShortcodes()\n\t{\n\t\t$GrOptionDbPrefix = 'GrIntegrationOptions_';\n\t\t$api_key = get_option($GrOptionDbPrefix . 'api_key');\n\t\t$api_url = get_option($GrOptionDbPrefix . 'api_url');\n\t\t$api_domain = get_option($GrOptionDbPrefix . 'api_domain');\n\n\t\t$webforms = null;\n\t\t$forms = null;\n\t\t$campaingns = null;\n\t\tif ( !empty($api_key))\n\t\t{\n\t\t\t$api = new GetResponseIntegration($api_key, $api_url, $api_domain, is_ssl());\n\t\t\t$webforms = $api->getWebforms(array('sort' => array('name' => 'asc')));\n\t\t\t$forms = $api->getForms(array('sort' => array('name' => 'asc')));\n\t\t\t$api_key = 'true';\n\t\t\t$campaingns = $api->getCampaigns(); // for 3.8 version\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$api_key = 'false';\n\t\t}\n\n\t\tif (strlen($api_domain) > 0)\n\t\t{\n\t\t\t$webforms = $this->setGetResponse360domainToWebFormUrl($webforms, $api_domain);\n\t\t\t$forms = $this->setGetResponse360domainToWebFormUrl($forms, $api_domain);\n\t\t}\n\n\t\t$webforms = json_encode($webforms);\n\t\t$forms = json_encode($forms);\n\t\t$campaingns = json_encode($campaingns); // for 3.8 version\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar my_webforms = <?php echo $webforms; ?>;\n\t\t\tvar my_forms = <?php echo $forms; ?>;\n\t\t\tvar my_campaigns = <?php echo $campaingns; // for 3.8 version ?>;\n\t\t\tvar text_forms = '<?php echo __('New Forms', 'Gr_Integration'); ?>';\n\t\t\tvar text_webforms = '<?php echo __('Old Web Forms', 'Gr_Integration'); ?>';\n\t\t\tvar text_no_forms = '<?php echo __('No Forms', 'Gr_Integration'); ?>';\n\t\t\tvar text_no_webforms = '<?php echo __('No Web Forms', 'Gr_Integration'); ?>';\n\t\t\tvar api_key = <?php echo $api_key; ?>;\n\t\t</script>\n\t\t<?php\n\t}", "public static function get_script(){\r\n\t\t\treturn '<script src=\"https://www.google.com/jsapi\"></script>';\r\n\t\t}", "public static function getJs() {\n return self::get('_js', array());\n }", "function the_javascript_html() {\n\t\techo wp_kses(\n\t\t\t$this->javascript_html(),\n\t\t\t$this->javascript_allowed_html()\n\t\t);\n\t}", "private function renderJS()\n {\n return '<script>var host = \\'' . config('notifier.host') . '\\';' .\n 'var port = \\'' . config('notifier.port') . '\\';' .\n 'var socket = new WebSocket(\\'' . config('notifier.connection') . '://\\' + host + \\':\\' + port);' .\n 'socket.onopen = function(e) {' .\n 'socket.send(location.pathname);' .\n 'console.log(\"Connection established!\");' .\n '};' .\n '</script>' . PHP_EOL;\n }", "public function customJS() {\n\n\t if ( isset( $this->options['customJS'] ) ){\n\n\t \t$content = \"<script type='text/javascript'>\\n\";\n\t \t$content .= $this->options['customJS'].\"\\n\";\n\t \t$content .= \"</script>\";\n\n\t \techo $content;\n\t }\n\t}", "protected function _getEndJs()\r\n\t{\r\n\t\tif(!isset($this->Request['id']))\r\n\t\t\tdie('System ERR: no param passed in!');\r\n\t\tif(!($word = Word::get($this->Request['id'])) instanceof Word)\r\n\t\t\tdie('Invalid Word passed in!');\r\n\t\t\r\n\t\t$js = parent::_getEndJs();\r\n\t\t\r\n\t\t$videos = array_map(create_function('$a', 'return $a->getVideo();'), WordVideo::getAllByCriteria('wordId = ?', array($word->getId())));\r\n\t\t$json = array();\r\n\t\tforeach ($videos as $video)\r\n\t\t{\r\n\t\t\t$array = array('url'=> $video->getAsset()->getUrl(), 'definitions'=> array());\r\n\t\t\t\r\n\t\t\tforeach(Definition::getAllByCriteria('videoId = ?', array($video->getId())) as $definition)\r\n\t\t\t{\r\n\t\t\t\t$type = $definition->getDefinitionType()->getName();\r\n\t\t\t\tif(empty($array['definitions'][$type]))\r\n\t\t\t\t\t$array['definitions'][$type] = array();\r\n\t\t\t\t$array['definitions'][$type][] = array('content'=> $definition->getContent(), 'order'=> $definition->getSequence());\r\n\t\t\t}\r\n\t\t\t$json[] = $array;\r\n\t\t}\r\n\t\t$js .= \"pageJs._word=\" . json_encode($word->getJson(array('category'=> $word->getCategory()->getJson()))) . \";\";\r\n\t\t$js .= \"pageJs._videos=\" . json_encode($json) . \";\";\r\n\t\t$js .= \"pageJs\";\r\n\t\t\t$js .= \".setHTMLIDs('detailswrapper')\";\r\n\t\t\t$js .= \".init();\";\r\n\t\treturn $js;\r\n\t}", "function getElementJS()\n\t{\n\t\t$js = '';\n\t\tif(!defined('DATEPICKER_JAVASCRIPT_INCLUDED'))\n\t\t{\n\t\t\tdefine('DATEPICKER_JAVASCRIPT_INCLUDED',1);\n\t\t\t$js = \"\\n\";\n\t\t\t$js .= '<script src=\"';\n\t\t\t$js .= api_get_path(WEB_CODE_PATH).'inc/lib/formvalidator/Element/';\n\t\t\t$js .= 'tbl_change.js.php\" type=\"text/javascript\"></script>';\n\t\t\t$js .= \"\\n\";\n\t\t}\n\t\treturn $js;\n\t}", "public function indikatorjsAction(){\n\t\theader('content-type : text/javascript');\n\t\t$this->render('indikatorjs');\n }", "public function getJs()\n {\n if (!$this->getLayout()) {\n return '';\n }\n $js = '';\n foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $block) {\n $js .= $block->getJs();\n }\n return $js;\n }", "private function coreJs() {\n $corejs = '';\n $corejs .= '\n <script src=\"' . $this->baseUrl(\"assets/js/jquery.min.js\") . '\" type=\"text/javascript\"></script>\n <script src=\"' . $this->baseUrl(\"assets/js/bootstrap.min.js\") . '\" type=\"text/javascript\"></script>\n <script src=\"' . $this->baseUrl(\"assets/js/bootstrap-hover-dropdown.min.js\") . '\" type=\"text/javascript\"></script>\n <script src=\"' . $this->baseUrl(\"assets/js/material.min.js\") . '\"></script>\n <script src=\"' . $this->baseUrl(\"assets/js/nouislider.min\") . '\"></script>\n <script src=\"' . $this->baseUrl(\"plugins/mdb/js/mdb.min.js\") . '\"></script>\n <script src=\"' . $this->baseUrl(\"plugins/mdb/js/tether.min.js\") . '\"></script>\n <script src=\"' . $this->baseUrl(\"plugins/x_lbd_free_v1.3/assets/js/pro/bootstrap-selectpicker.js\") . '\"></script>';\n\n return $corejs;\n }", "private static function getJs($res)\n {\n $data = '<script';\n\n if ($res['is_link']) {\n $data .= ' src=\"' . $res['data'] . '\">';\n } else {\n $data .= \">\" . \"\\n\" . $res['data'] . \"\\n\";\n }\n\n $data .= \"</script>\" . \"\\n\";\n\n return $data;\n }", "protected function setJavaScriptCodeArray() {}", "public function loadJavascriptClass_result()\n\t{\n\t\t$this->onGetFilterKey();\n\t\t$p = $this->onGetFilterKey_result();\n\t\treturn 'plugins/fabrik_list/' . $p . '/' . $p . '.js';\n\t}", "public final function __toString()\n {\n $render = $this->getHTML();\n $script = $this->getScript();\n if (!empty($script)) {\n $render .= '<script type=\"text/javascript\">';\n $render .= '$(document).ready(function(){'.$script. '});';\n $render .= '</script>';\n }\n return $render;\n }", "function ajouter_liens_javascript($java)\n{\n\tif ($java == \"2\")\n\t{\n\t\t$javascript = ecrire_js();\n\t\t$javascript .= bbcode_js();\n\t}\n\telse\n\t{\n\t\t$javascript = \"\";\n\t}\n\treturn $javascript;\n}", "public function generateJavaScript($mapName) { \n $code = \"new google.maps.Marker ({\\n\";\n $code .= \"\\t position: \".$this->_position->getJavaScript().\",\\n\";\n $code .= \"\\t map: {$mapName},\\n\";\n if (!empty($this->_icon)) {\n $code .= \"\\t icon: \\\"{$this->_icon}\\\",\\n\";\n }\n $code .= \"\\t title: \\\"{$this->_title}\\\", \\n\";\n $code .= $this->_generateExtraData();\n $code .= \"});\\n\\n\"; \n return $code;\n }", "function getjsOnInput () { return $this->readjsOnInput(); }", "function getjsOnInput () { return $this->readjsOnInput(); }", "public function generatePage_whichScript() {}", "function getJavascriptConfig()\n\t{\n\t\t$html = \"\\t<script type=\\\"text/javascript\\\">\\n\";\n\t\t$html .= \"var xajaxRequestUri=\\\"\".$this->sRequestURI.\"\\\";\\n\";\n\t\t$html .= \"var xajaxDebug=\".($this->bDebug?\"true\":\"false\").\";\\n\";\n\t\t$html .= \"var xajaxStatusMessages=\".($this->bStatusMessages?\"true\":\"false\").\";\\n\";\n\t\t$html .= \"var xajaxWaitCursor=\".($this->bWaitCursor?\"true\":\"false\").\";\\n\";\n\t\t$html .= \"var xajaxDefinedGet=\".XAJAX_GET.\";\\n\";\n\t\t$html .= \"var xajaxDefinedPost=\".XAJAX_POST.\";\\n\";\n\t\t$html .= \"var xajaxLoaded=false;\\n\";\n\n\t\tforeach($this->aFunctions as $sFunction => $bExists) {\n\t\t\t$html .= $this->_wrap($sFunction,$this->aFunctionRequestTypes[$sFunction]);\n\t\t}\n\n\t\t$html .= \"\\t</script>\\n\";\n\t\treturn $html;\n\t}", "public function output()\n {\n return sprintf('<script type=\"text/javascript\" src=\"/%s/%s\"></script>', $this->getProjectType(), $this->getOutputFilename());\n }", "public function __toString()\n {\n return json_encode( $this->js_vars );\n }", "public function getElementJs()\n {\n $jsString = \"\n var formElement = new OwFormElement(\" . json_encode($this->getId()) . \", \" . json_encode($this->getName()) . \");\n formElement.resetValue = function(){};\n \";\n\n return $jsString . $this->generateValidatorAndFilterJsCode(\"formElement\");\n }" ]
[ "0.90988934", "0.83969253", "0.80505556", "0.80175936", "0.80156076", "0.789639", "0.7873421", "0.7842477", "0.77542984", "0.74757546", "0.7404972", "0.7365616", "0.73396397", "0.7313067", "0.7302248", "0.727944", "0.7215828", "0.71865994", "0.71757513", "0.71437335", "0.7108875", "0.71037906", "0.70444095", "0.7006883", "0.69925624", "0.6978458", "0.6971202", "0.6968834", "0.69672734", "0.6967059", "0.6948917", "0.69409996", "0.69298345", "0.69278216", "0.6927525", "0.69264334", "0.6917889", "0.6913398", "0.68598413", "0.68379056", "0.6826805", "0.6816422", "0.68075013", "0.6790468", "0.67811435", "0.6775625", "0.67616814", "0.67461133", "0.6717226", "0.6706129", "0.6702751", "0.669936", "0.66910636", "0.6679614", "0.66539705", "0.6615356", "0.6615355", "0.6600316", "0.658537", "0.65852433", "0.6576355", "0.6571026", "0.6564892", "0.65646565", "0.6551911", "0.65472126", "0.65415424", "0.6530292", "0.6516222", "0.6515238", "0.6508521", "0.6507637", "0.65053934", "0.6498799", "0.64970064", "0.646983", "0.6466182", "0.6457876", "0.64537126", "0.6441241", "0.6440152", "0.6439132", "0.6438832", "0.6438787", "0.6432546", "0.64292854", "0.64231384", "0.64148414", "0.64026105", "0.6398499", "0.6397593", "0.63955104", "0.63750756", "0.6368654", "0.6368654", "0.6360602", "0.63605434", "0.6359392", "0.63533455", "0.6338482" ]
0.64709735
75
This method converts the value into dataType float
public function evaluateFieldValue($value, $is_in, &$set) { $floatValue = number_format((float)$value, 3); return $floatValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o_castFloat($value) {\n\t\t\treturn Obj::singleton()->castFloat($value);\n\t\t}", "public function toFloat(): float\n {\n return (float) $this->getValue();\n }", "private static function toFloat($value)\n {\n return (float) $value;\n }", "public function & toFloat()\n\t{\n\t\t$x = float((int)$this->data);\n\t\treturn $x;\n\t}", "public function getFloat() :float\n {\n return $this->value;\n }", "public function toFloat()\n {\n eval('$var = ' . $this->value . ';');\n\n return $var;\n }", "public function float()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_NUMBER_FLOAT);\n\t}", "public function castType($value=null)\n {\n if (!is_null($value)) return (float)$value;\n return 0;\n }", "public function getValue()\n {\n return (float) $this->value;\n }", "public static function ensureFloat($value)\n\t{\n\t\treturn (float)$value;\n\t}", "private function toFloat($value)\n {\n return (float) str_replace(',', '.', $value);\n }", "function validate_float() {\n # Check if the value is a foat\n if (is_float($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error( \"Validation for float ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Float Value\n return floatval($this->cur_val);\n }\n }", "public function checkFloat(): float\n {\n if (!is_float($this->getValue())) {\n throw new TypeInvalidException('float', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "public function float($value) : float|array\n\t{\n\t\treturn $this->handlers->map($value, function ($value) {\n\t\t\treturn (float)$value;\n\t\t});\n\t}", "public static function float() {}", "public function getFloatField()\n {\n $value = $this->get(self::FLOAT_FIELD);\n return $value === null ? (double)$value : $value;\n }", "public function scrubFloat(float $data) : float;", "public function getValueTo():float {\n return $this->valueTo;\n }", "public function fromFloat($value)\n {\n switch ((string) $value) {\n case 'Infinity':\n return INF;\n case '-Infinity':\n return -INF;\n case 'NaN':\n return NAN;\n default:\n return (float) $value;\n }\n }", "public function float($value)\n {\n $bytes = pack('f*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n $this->write($bytes, 4);\n }", "public function getDataType()\n {\n return DField::DATA_TYPE_FLOAT;\n }", "function floatval($var)\n{\n}", "private static function renderFloat($value)\n {\n return Yii::$app->formatter->asDecimal($value);\n }", "function toFloat ($value) {\n assert(count(func_get_args()) == 1);\n if (is_scalar($value)) {\n $convertedValue = filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_NULL_ON_FAILURE);\n if ($convertedValue !== null)\n return $convertedValue;\n }\n if (is_object($value) && hasMember($value, 'toFloat'))\n return toFloat($value->toFloat());\n throw new RuntimeException('Unable to convert to float.');\n}", "public static function aFloat($value)\n {\n return (is_float($value))?:false;\n }", "function o_isFloat($value) {\n\t\t\treturn Obj::singleton()->isFloat($value);\n\t\t}", "function readFloat();", "public static function parseFloat($value)\n {\n // convert \",\" to \".\"\n $s = str_replace(',', '.', $value);\n\n // remove everything except numbers and dot \".\"\n $s = preg_replace(\"/[^0-9\\.]/\", '', $s);\n\n // remove all seperators from first part and keep the end\n $s = str_replace('.', '', substr($s, 0, -3)).substr($s, -3);\n\n // return float\n return (float) $s;\n }", "public static function float(?string $valueType = null);", "public function parse($value) {\n\t\t$json = $this->decode($value);\n\t\tif (JSON_ERROR_NONE == json_last_error()) {\n\t\t\treturn $json;\n\t\t}\n\t\t$float = filter_var($value, FILTER_VALIDATE_FLOAT);\n\t\treturn $float !== false ? $float : $value;\n\t}", "public function getFNumber(): ?float {\n $val = $this->getBackingStore()->get('fNumber');\n if (is_null($val) || is_float($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'fNumber'\");\n }", "public function getFFloat()\n {\n return $this->f_float;\n }", "private function mapStringToFloat($results)\n {\n return floatval($results);\n }", "public static function GetFloat($key)\n {\n return (float)self::Get($key);\n }", "public function convertValue($value) {\n $floatValue = floatval($value);\n if ($floatValue === 0.0 && $value !== '0' && $value !== '0.0') {\n throw new InvalidParameterValueException();\n }\n return $floatValue;\n }", "public function toFloat()\n {\n if (is_array($this->value)) {\n throw new InvalidNotArrayException($this->name);\n } elseif (!empty($this->value) && !is_numeric($this->value)) {\n throw new InvalidNumericException($this->name, $this->value);\n }\n\n $this->value = (float) $this->value;\n\n return $this;\n }", "function sanitize_float( $value, $key, array $data ) {\n\treturn (float) $value;\n}", "public static function readFloat()\n {\n $res = filter_var(self::readLine(), FILTER_VALIDATE_FLOAT);\n \n if($res === false)\n throw new Exception(\"valor invalido\");\n \n return $res;\n }", "public static function NASAtoFloat($val )\n {\n $a = unpack(\"N\",$val);\n $b = unpack(\"f\",pack( \"I\",$a[1]));\n return $b[1];\n }", "function _v( $str ) { return (float) substr($str,1); }", "public function getValueFrom():float {\n return $this->valueFrom;\n }", "public function getValeur() {\n return floatval($this->valeur);\n }", "protected function filterUfloat($value) {\n return abs($this->filterFloat($value));\n }", "public static function sanitize_float( $value ) {\n\t\tif ( empty( $value ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );\n\t}", "public static function filterFloat($attrValue)\n\t{\n\t\treturn filter_var($attrValue, FILTER_VALIDATE_FLOAT);\n\t}", "function validFloat($value)\n {\n return filter_var($value, FILTER_VALIDATE_FLOAT);\n }", "public function testCastToFloat($data) {\n\t\t$this->assertTrue(is_float(Convertor::cast($data)), \"[{$data}] is not Float\");\n\t\t$this->assertGreaterThan(0, Convertor::cast($data), \"[{$data}] is not greater than 0\");\n\t}", "private function coord2float($val) {\n if(strlen($val) === 1 && strpos($val, '/') !== false)\n return 0;\n\n\n $parts = explode('/', $val);\n\n\t\tif (count($parts) == 0 || count($parts) == 1)\n \treturn (float) $val;\n\n return (float) $parts[0] / (float) $parts[1];\n\t}", "private function float ($param)\n {\n $this->type = 'float';\n $this->value = (float)$this->value;\n return true;\n }", "public function consumeFloat()\n {\n $s = $this->consume(4);\n list(, $ret) = unpack(\"f\", self::$isLittleEndian ? self::swapEndian32($s) : $s);\n return $ret;\n }", "function floatNum($value)\n{\n return floatval(str_replace(',', '.', $value));\n}", "public function setFloatField($value)\n {\n return $this->set(self::FLOAT_FIELD, $value);\n }", "function readFloat(): float {\n return \\unpack('g', $this->read(4))[1];\n }", "protected function getValCast()\n {\n if (is_null($this->value)) {\n return null;\n }\n if (mb_strpos($this->value, '.') !== false) {\n $temp = rtrim($this->value, '0');\n return ((mb_substr($temp, -1) == '.') ? (int) $this->value : (float) $this->value);\n }\n return (int) $this->value;\n }", "static public function Float($var, $flags = null) {\r\n\r\n\t\t$cleaned = filter_var($var, FILTER_SANITIZE_NUMBER_FLOAT, $flags);\r\n\t\treturn $cleaned == \"\" ? false : (float)$cleaned;\r\n\r\n\t}", "public function getFloat(string $key): float\n {\n return floatval($this->get($key));\n }", "public function parseFloat()\n {\n if (is_string($this->value)) {\n $this->value = preg_replace('/\\s|`|\\'|,/', \"\", preg_replace('/,{1}/', '.', $this->value));\n }\n $this->value = (float)$this->value;\n return $this;\n }", "public function floatValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function getFloat($name);", "public static function asFloat($value)\n {\n $v = round($value, 2);\n\n return (strpos($v, '.') and self::$formats[self::P_DECIMAL_CHAR] != '.')\n ? str_replace('.', self::$formats[self::P_DECIMAL_CHAR], $v)\n : $v;\n }", "function &float(float $value, string $namespace = 'default'): float\n{\n $var = new Variable\\FloatVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getType()\n {\n return 'float';\n }", "public function set($value = null)\r\n {\r\n return parent::set((float)$value);\r\n }", "public function formatFloat($value)\n {\n $return = \"null\";\n\n if ($value) {\n $return = floatval($value);\n }\n\n return $return;\n }", "public static function converterMoedaParaFloat(string $valor){\n $val = str_replace(\",\",\".\",$valor);\n $val = preg_replace('/\\.(?=.*\\.)/', '', $val);\n return floatval($val);\n }", "#[@test]\n public function floatType() {\n $this->testType(new Float(0), 0, 0.0);\n }", "function cleanFloat($name) {\n\t\tif (isset($this->getvars[$name])){\n\t\t\tif (is_array($this->getvars[$name])){\n\t\t\t\treturn Cgn::cleanFloatArray($this->getvars[$name]);\n\t\t\t}\n\t\t\treturn floatval($this->getvars[$name]);\n\t\t} else {\n\t\t\tif (@is_array($this->postvars[$name])){\n\t\t\t\treturn Cgn::cleanFloatArray($this->postvars[$name]);\n\t\t\t}\n\t\t\treturn floatval(@$this->postvars[$name]);\n\t\t}\n\t}", "function to_float($string_number){\n $number = floatval(str_replace('.', ',', str_replace(',', '', $string_number)));\n\n // At this point, $number is a \"natural\" float.\n return $number;\n }", "private function readfloat()\n {\n $bin = fread($this->f, 4);\n if ((ord($bin[0]) >> 7) == 0) $sign = 1;\n else $sign = -1;\n if ((ord($bin[0]) >> 6) % 2 == 1) $exponent = 1;\n else $exponent = -127;\n $exponent += (ord($bin[0]) % 64) * 2;\n $exponent += ord($bin[1]) >> 7;\n\n $base = 1.0;\n for ($k = 1; $k < 8; $k++) {\n $base += ((ord($bin[1]) >> (7 - $k)) % 2) * pow(0.5, $k);\n }\n for ($k = 0; $k < 8; $k++) {\n $base += ((ord($bin[2]) >> (7 - $k)) % 2) * pow(0.5, $k + 8);\n }\n for ($k = 0; $k < 8; $k++) {\n $base += ((ord($bin[3]) >> (7 - $k)) % 2) * pow(0.5, $k + 16);\n }\n\n $float = (float)$sign * pow(2, $exponent) * $base;\n return $float;\n }", "public function validFloats() {}", "protected function _getFloat($input)\n {\n $f1 = str_pad(ord($input[0]), 2, '0', STR_PAD_LEFT);\n $f1 .= str_pad(ord($input[1]), 2, '0', STR_PAD_LEFT);\n $f1 .= str_pad(ord($input[2]), 2, '0', STR_PAD_LEFT);\n $f1 .= str_pad(ord($input[3]), 2, '0', STR_PAD_LEFT);\n $f2 = $f1 >> 17;\n $f3 = ($f1 & 0x0001FFFF);\n $f1 = $f2 . '.' . $f3;\n return (float) $f1;\n }", "function getFloat()\r\n\t{\r\n\t\treturn array('lat' => $this->nLat, 'lon' => $this->nLon);\r\n\t}", "public function float()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertSame($floatFilter, $floatFilter->setDecimals(2));\n $this->assertEquals(156, $floatFilter->execute('1.564'));\n }", "function num($value)\n{\n $num = str_replace('.', '', $value);\n return floatval(str_replace(',', '', $num));\n}", "public static function toFloat(IInt32\\Type $x) : IFloat\\Type {\n\t\t\treturn IFloat\\Type::make($x->unbox());\n\t\t}", "public function getFloat($index)\r\n\t{\r\n\t $this->_checkIndex($index);\r\n\t \r\n\t if(isset($this->row[$index]))\r\n {\r\n\t return floatval($this->row[$index]);\r\n\t }\r\n\t\r\n\t throw($this->_throwInvalidIndex($index));\r\n\t}", "function value_numeric($value){\r\n\t$value = trim($value);\r\n\t$v = strpos($value, \",\");\r\n\t$p = strpos($value, \".\");\r\n\tif($v === FALSE && $p === FALSE){ // Valor inteiro sem separador de decimal e milhar (nao precisa de tratamento)\r\n\t}elseif($v !== FALSE && $p === FALSE){ // Virgula no separador decimal e sem separador de milhar\r\n\t\t$value = str_replace(\",\", \".\", $value);\r\n\t}elseif($v === FALSE && $p !== FALSE){ // Ponto no separador de decimal e sem separador de milhar (nao precisa de tratamento)\r\n\t}elseif($v > $p){ // Virgula no separador de decimal e ponto no separador de milhar\r\n\t\t$value = str_replace(\".\", \"\", $value);\r\n\t\t$value = str_replace(\",\", \".\", $value);\r\n\t}elseif($p > $v){ // Ponto no separador de decimal e virgula no separador de milhar\r\n\t\t$value = str_replace(\",\", \"\", $value);\r\n\t}\r\n//\tif((string)(float) $value == $value){\r\n\tif(is_numeric($value)){\r\n\t\tif(strcmp($value, round($value)) == 0 && $value < 2147483647){\r\n\t\t\t$value = (int) $value;\r\n\t\t}else{\r\n\t\t\t$value = (float) $value;\r\n\t\t}\r\n\t\treturn $value;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}", "private function validateFloat($value)\n {\n return $this->validateDecimal($value, ValidatorHandler::VALUE_TYPE_IS_NOT_FLOAT);\n }", "protected function castify($value)\n {\n if (preg_match('/^\\-?([0-9]+)$/', $value)) {\n return intval($value);\n }\n\n if (preg_match('/^\\-?\\d+(\\.\\d+)?$/', $value)) {\n // @todo fix json returning float values.\n // return floatval($value);\n\n return $value;\n }\n\n return $value;\n }", "public function testFloat()\n {\n $float = (float) 13.54;\n $this->assertSame($float, $this->_filter->filter($float));\n }", "public function getFloat($i);", "public function putFloat(string $name, ?float $value): string;", "final protected function getColumnFloat($key, $allowNull = false)\n\t\t{\n\t\t\t$value = $this->getColumnValue($key, $allowNull);\n\t\t\tif(!is_null($value) && !is_float($value))\n\t\t\t\tthrow new CDFColumnDataException($key, 'Column is not a float');\n\t\t\treturn $value;\n\t\t}", "protected function _getValueForFloat($data = null, $returnTableRow = true) {\n\t\treturn $this->_getValueForNumberBase($data, $returnTableRow, 2);\n\t}", "public function process($data)\n {\n $fmt = App::make(NumberFormatter::class, ['style' => NumberFormatter::DECIMAL, 'iso' => $this->getIso()]);\n $fmt->setTextAttribute(NumberFormatter::CURRENCY_CODE, $this->getIso());\n $float = $fmt->parse($data);\n\n return $float === false ? null : $float;\n }", "public function getUnitValue(): float\n\t{\n\t\treturn $this->unitValue;\n\t}", "function float_or_null($f) {\n return $f === null ? null : (float) $f;\n}", "public function testFloat() {\n $this->assertEquals(100.25, Sanitize::float('1array(0)0.25'));\n $this->assertEquals(-125.55, Sanitize::float('-abc125.55'));\n $this->assertEquals(1203.11, Sanitize::float('+1203.11'));\n }", "private function float(float $value): string\n {\n return (string) $value;\n }", "public function checkFloat($value)\n {\n return $this->checkHasType($value, 'double');\n }", "public function getNumber1():float{\n return $this->number1;\n }", "public function getFloat(string $field): float\n {\n return floatval($this->get($field));\n }", "public function getFloat(string $key): ?float;", "protected function validateUfloat($value) {\n if (preg_match(\"/^[0-9]+\\.?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid positive decimal number\"));\n return false;\n }", "public function getFee(): float;", "function MoneyToFloat($zMoney) {\n\n /*--- Local Variables ---*/\n\n $laundermoney = null;\n $dollars = null;\n $cents = null;\n\n /*--- Start of Processing ---*/\n\n $zMoney = str_replace(\"$\",\"\",$zMoney);\n\n if(strrchr($zMoney,\",\") )\n {\n $gMoney = str_replace(\",\",\"\",$zMoney); \n if( strrchr($gMoney,\".\") )\n {\n $dollars = strtok($gMoney,\".\");\n $cents= strtok(\".\");\n }\n else\n $dollars = $gMoney;\n }\n else if( strrchr($zMoney,\".\") )\n {\n $dollars = strtok($zMoney,\".\");\n $cents= strtok(\".\");\n }\n else\n {\n $dollars = $zMoney;\n $cents = 0;\n } \n\n $laundermoney = $dollars.\".\".$cents;\n\n (float)$laundermoney = $laundermoney;\n \n return($laundermoney);\n}", "public function setValue($var)\n {\n GPBUtil::checkFloat($var);\n $this->value = $var;\n\n return $this;\n }", "public function value()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertSame($floatFilter, $floatFilter->setDecimals(3));\n $this->assertEquals(8453, $floatFilter->execute('8.4533'));\n $this->assertEquals(8453, $floatFilter->execute('8.4538'));\n $this->assertEquals(8450, $floatFilter->execute('8.45'));\n $this->assertEquals(8000, $floatFilter->execute('8'));\n $this->assertEquals(8453, $floatFilter->execute(8.4533));\n $this->assertEquals(8453, $floatFilter->execute(8.4538));\n $this->assertEquals(8450, $floatFilter->execute(8.45));\n $this->assertEquals(8000, $floatFilter->execute(8));\n }", "public function testFloat()\n {\n set_error_handler([$this->instance, 'handleError'], E_NOTICE);\n $float = $this->instance+.0;\n restore_error_handler();\n\n self::assertTrue(\n is_float($float),\n 'Instance cannot be typecast to a float'\n );\n }", "public function readFloat64();", "public function invalidFloats() {}" ]
[ "0.8317768", "0.80067825", "0.7993397", "0.77178735", "0.7643994", "0.7583464", "0.7467525", "0.7440894", "0.7369646", "0.7327004", "0.72653854", "0.7224926", "0.7176007", "0.71039057", "0.7061392", "0.7055384", "0.7032907", "0.6994754", "0.69736534", "0.6967052", "0.6939833", "0.6904542", "0.69034004", "0.6877098", "0.6852728", "0.68444633", "0.6829948", "0.68172514", "0.67695016", "0.6759362", "0.6744226", "0.6736543", "0.6723727", "0.67121845", "0.6684563", "0.66814214", "0.666524", "0.6647405", "0.66406524", "0.6633538", "0.6615233", "0.6613912", "0.6601168", "0.6586185", "0.6582534", "0.65821016", "0.65820163", "0.65682554", "0.6565558", "0.6557802", "0.65539896", "0.6475253", "0.64656264", "0.6460273", "0.642471", "0.64233893", "0.64048886", "0.6394839", "0.63890046", "0.6380877", "0.6373282", "0.63729036", "0.63687974", "0.6350979", "0.6342548", "0.6313336", "0.6296741", "0.629565", "0.6288714", "0.62829655", "0.626691", "0.6260922", "0.6211391", "0.61882067", "0.6186542", "0.61472005", "0.6145923", "0.61344516", "0.613098", "0.6128224", "0.61237985", "0.6108127", "0.6105614", "0.609354", "0.6068844", "0.6065256", "0.6061897", "0.6059845", "0.6057756", "0.6054986", "0.60547316", "0.6044952", "0.60433465", "0.6037302", "0.60363954", "0.602777", "0.60156363", "0.60155565", "0.6001059", "0.5982284", "0.5977501" ]
0.0
-1
Comprueba que el saldo de una tarjeta nueva sea cero.
public function testSaldoCero() { $tarjeta = new Tarjeta; $this->assertEquals( $tarjeta->saldo(), 0 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saldo_tarjeta();", "public function Actualiza_saldo($codigo_tar,$montoTotalCompra,$saldoTarjeta){\n require_once('../conexion_bd/conexion.php');\n $this->usuario='[email protected]';\n $conectado = new conexion();\n $con_res = $conectado->conectar();\n if (strcmp($con_res, \"ok\") == 0) {\n echo 'Conexion exitosa todo bien ';\n $saldo_reemplazar= $montoTotalCompra-$saldoTarjeta;\n \n $varActualiza = \" Update tarjetas_recibidas SET saldo=\".$saldo_reemplazar.\" where codigo_targeta \".$codigo_tar .\" registrada_sistema =TRUE\";\n \n $result = mysql_query( $varActualiza );\n if ($row = mysql_fetch_array($result)) {\n $retornar= 'Listo';\n } else {\n $retornar=''; \n }\n\n mysql_free_result($result);\n $conectado->desconectar();\n return $retornar;\n \n } else {\n echo 'Algo anda mal';\n } \n }", "public function testSaldoCero() {\n\t\t$valor = 14.80;\n\t\t$colectivo = new Colectivo(NULL, NULL, NULL);\n\t\t$tiempoReal = new Tiempo;\n\t\t$tarjeta = new Tarjeta($tiempoReal);\n\t\t$tarjeta->recargar(20);\n\t\t$boleto = new Boleto($colectivo, $tarjeta);\n\t\t$this->assertEquals($boleto->abono(), 0);\n }", "function restar_dinero_socio($socio_id, $importe){\n\tglobal $link;\n\n\t$socio_id = (int) $socio_id;\n\t$importe = (float) $importe;\n\n\t$sql = \"SELECT saldo FROM socios\n\t\t\tWHERE socio_id = '$socio_id'\";\n\t$query = mysqli_query($link,$sql);\n\t$ahorro = mysqli_fetch_assoc($query);\n\t\n\t$ahorro_final = $ahorro['saldo'];\n\t\n\n\t$saldo_restante = $ahorro_final - $importe;\n\tif ($saldo_restante < 0) {\n\t\t$ba_query['message_code'] = 'c107';\n\t\treturn false;\n\t}\n\t\n\t$sql2 = \"UPDATE socios SET saldo = '$saldo_restante'\n\t\t\t WHERE socio_id = '$socio_id'\";\n\t$query2 = mysqli_query($link,$sql2);\n\tif(!mysqli_affected_rows($link)){\n\t\t$ba_query['message_code'] = 'c108';\n\t\treturn false;\n\t}\n\treturn true;\n}", "public function salvarDepreciacao() {\n\n $oDaoBensDepreciacao = new cl_bensdepreciacao();\n $oDaoBensDepreciacao->t44_benstipoaquisicao = $this->getTipoAquisicao()->getCodigo();\n $oDaoBensDepreciacao->t44_benstipodepreciacao = $this->getTipoDepreciacao()->getCodigo();\n $oDaoBensDepreciacao->t44_valoratual = \"{$this->getValorDepreciavel()}\";\n $oDaoBensDepreciacao->t44_valorresidual = \"{$this->getValorResidual()}\";\n $oDaoBensDepreciacao->t44_vidautil = \"{$this->getVidaUtil()}\";\n\n if (!empty($this->iCodigoBemDepreciacao)) {\n\n $oDaoBensDepreciacao->t44_sequencial = $this->iCodigoBemDepreciacao;\n $oDaoBensDepreciacao->alterar($this->iCodigoBemDepreciacao);\n\n } else {\n\n $oDaoBensDepreciacao->t44_ultimaavaliacao = date(\"Y-m-d\", db_getsession(\"DB_datausu\"));\n $oDaoBensDepreciacao->t44_bens = $this->iCodigoBem;\n $oDaoBensDepreciacao->incluir(null);\n $this->iCodigoBemDepreciacao = $oDaoBensDepreciacao->t44_sequencial;\n }\n\n if ($oDaoBensDepreciacao->erro_status == \"0\") {\n $sMsg = _M('patrimonial.patrimonio.Bem.erro_salvar_calculo', (object)array(\"erro_msg\" => $oDaoBensDepreciacao->erro_msg));\n throw new Exception($sMsg);\n }\n return true;\n }", "public function testSaldoCero() {\n $valor = 14.80;\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $boleto = new Boleto($valor, NULL, $tarjeta, NULL, NULL, NULL, NULL, NULL, NULL);\n\n $this->assertEquals($boleto->obtenerValor(), $valor);\n }", "public function comprobarSaldo($cantidad){ //en cantidad le pasaremos lo que se le va a cobrar\n if($this->time - $cantidad < -300){\n return false;\n }else{\n return true;\n }\n\n }", "function actualizarDinero($operacion, $cantidadDeposito, $cantidadRetirada){\n include (__ROOT__.'/backend/comprobaciones.php');\n global $db;\n $id = $_SESSION['loggedIn'];\n\n if($operacion === \"depositarDinero\"){\n //compruebo que las cantidades son un entero positivo\n if($cantidadDeposito >= 0){\n //comprobar que la cantidad que quiero retirar no supera la cantidad que tengo ingresada enBanco\n $miDinero = comprobarDinero();\n if($miDinero[0]['cash'] >= $cantidadDeposito){\n $sql = \"UPDATE personajes SET enBanco=enBanco + $cantidadDeposito, cash=cash-$cantidadDeposito WHERE id='$id'\";\n $stmt = $db->query($sql);\n header(\"location: ?page=zona&message=Exito\");\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n elseif ($operacion === \"retirarDinero\") {\n //compruebo que las cantidades son un entero positivo\n if($cantidadRetirada >= 0){\n //comprobar que la cantidad que quiero retirar no supera la cantidad que tengo ingresada enBanco\n $miDinero = comprobarDinero();\n if($miDinero[0]['enBanco'] >= $cantidadRetirada){\n $sql = \"UPDATE personajes SET cash=cash+$cantidadRetirada*0.95, enBanco=enBanco-$cantidadRetirada WHERE id='$id'\";\n $stmt = $db->query($sql);\n header(\"location: ?page=zona&message=Exito\");\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n else{\n header(\"location: ?page=zona&message=Fallo\");\n }\n }\n \n}", "public function darCostos(){\n\t\t/*variables: int $valor, float $costo*/\n\t\t$valor = parent::darCostos();\n\t\t$costo = $valor + ($valor * $this->getPorcentajeIncremento()); //45% incremento \n\t\treturn $costo;\n\t}", "public function testSaldo() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $tarjeta->recargar(100.0);\n $saldo=100.0;\n $boleto = new Boleto(NULL, NULL, $tarjeta, NULL, NULL, NULL, NULL, NULL, NULL);\n\n $this->assertEquals($boleto->obtenersaldo(), $saldo);\n }", "public function cortesia()\n {\n $this->costo = 0;\n }", "public function testValoresTransferidosPorContratoDeRateioUpaSantaRosa() {\n $filter = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '8.5.3.1.0.01') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorControle = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filter);\n $saldoCredorControle = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filter);\n\n $filter = function (array $line): bool {\n if (\n $line['projativ'] == 2063\n ) {\n return true;\n }\n return false;\n };\n $pago = $this->somaColuna($this->getDataFrame('BAL_DESP'), 'valor_pago', $filter);\n\n $this->comparar(\n ($saldoCredorControle - $saldoDevedorControle),\n $pago\n );\n\n $this->saldoVerificado(__METHOD__, '8.5.3.1.0.01');\n }", "function actualiza_nro_cargo($id_desig,$nro_cargo){\n if(is_null($nro_cargo)){\n $sql=\"update designacion set nro_cargo=null\"\n . \" where id_designacion=$id_desig\";\n toba::db('designa')->consultar($sql); \n return true;\n \n }else{\n if($id_desig<>-1 and $nro_cargo<>-1){\n $sql=\"select * from designacion where nro_cargo=$nro_cargo and id_designacion<>$id_desig\";\n $res=toba::db('designa')->consultar($sql); \n if(count($res)>0){//ya hay otra designacion con ese numero de cargo\n return false;\n }else{\n $sql=\"update designacion set nro_cargo=$nro_cargo\"\n . \" where id_designacion=$id_desig\";\n toba::db('designa')->consultar($sql); \n return true;\n }\n \n }else{\n return false;\n }\n } \n }", "static public function addNotasCreditoModel(\n $descripcionCredito,\n $cantidadCredito,\n $importeCredito,\n $idCliente,\n $fechaCredito,\n $tabla){\n\n $sql13 = Conexion::conectar()->prepare(\"SELECT saldoActual AS saldo FROM saldos\n WHERE idCliente = :idCliente\");\n $sql13->bindParam(':idCliente', $idCliente);\n $sql13->execute();\n $resu= $sql13->fetch();\n $saldo = $resu['saldo'];\n\n if($saldo <=0){\n return 'noSaldo';\n }else{\n\n\n $totalCredito = $cantidadCredito * $importeCredito;\n $sql = Conexion::conectar()->prepare(\"INSERT INTO $tabla( descripcionCredito, cantidadCredito, importeCredito, totalCredito , idCliente, fechaCredito)\n VALUES(:descripcionCredito, :cantidadCredito , :importeCredito,:totalCredito, :idCliente, :fechaCredito)\");\n $sql->bindParam(':descripcionCredito', $descripcionCredito);\n $sql->bindParam(':cantidadCredito', $cantidadCredito);\n $sql->bindParam(':importeCredito', $importeCredito);\n $sql->bindParam(':totalCredito', $totalCredito);\n $sql->bindParam(':idCliente', $idCliente);\n $sql->bindParam(':fechaCredito', $fechaCredito);\n\n if ($sql->execute()) {\n\n $sql3 = Conexion::conectar()->prepare(\"UPDATE saldos SET saldoActual= saldoActual- $totalCredito, saldoFinal= saldoFinal- $totalCredito WHERE idCliente = :idCliente\");\n $sql3->bindParam(':idCliente', $idCliente);\n $sql3->execute();\n\n\n\n\n $sql41 = Conexion::conectar()->prepare(\"INSERT INTO cuentacorriente(comprobante,\n pagos, idCliente, fecha)\n VALUES(:comprobante, :pagos , :idCliente,:fecha)\");\n $hoy = $fechaCredito;\n $comprobante = 1;\n $sql41->bindParam(':comprobante', $comprobante );\n $sql41->bindParam(':pagos', $totalCredito);\n $sql41->bindParam(':idCliente', $idCliente);\n $sql41->bindParam(':fecha', $hoy);\n $sql41->execute();\n\n\n $sql13 = Conexion::conectar()->prepare(\"SELECT MAX(idCuentaCorriente)AS id FROM cuentacorriente\n WHERE idCliente = :idCliente\");\n $sql13->bindParam(':idCliente', $idCliente);\n $sql13->execute();\n $resu= $sql13->fetch();\n $id = $resu['id'];\n\n\n $sql11 = Conexion::conectar()->prepare(\"UPDATE cuentacorriente\n SET saldo= (SELECT saldoFinal FROM saldos WHERE idCliente=$idCliente)\n WHERE idCliente=:idCliente AND idCuentaCorriente = :id\" );\n $sql11->bindParam(':idCliente', $idCliente);\n $sql11->bindParam(':id', $id);\n $sql11->execute();\n\n $sql131 = Conexion::conectar()->prepare(\"SELECT MAX(idNotaCredito)AS idNotaCredito FROM notacredito\n WHERE idCliente = :idCliente\");\n $sql131->bindParam(':idCliente', $idCliente);\n $sql131->execute();\n $resu1= $sql131->fetch();\n $idNotaCredito = 'Nota de Crédito' . ' ' . $resu1['idNotaCredito'];\n $nroNotaCredito=$resu1['idNotaCredito'];\n $sql111 = Conexion::conectar()->prepare(\"UPDATE cuentacorriente\n SET comprobante= :idNotaCredito , nroNotaCredito=:nroNotaCredito\n WHERE idCliente=:idCliente AND idCuentaCorriente = :id\");\n $sql111->bindParam(':idCliente', $idCliente);\n $sql111->bindParam(':idNotaCredito', $idNotaCredito);\n $sql111->bindParam(':nroNotaCredito', $nroNotaCredito);\n $sql111->bindParam(':id', $id);\n $sql111->execute();\n\n return 'success';\n }else{\n return 'errorers';\n }\n $sql->close();\n\n }\n\n }", "function venta($mysqli,$fecha,$ref,$monto16,$monto0,$iva,$tipo,$factu,$cte){\n\t\t//en todos los casos\n\t\t$table='diario';\n\t\t$tmonto=$monto16+$monto0;\n\t\t$montof=$tmonto+$iva;\n\t\t//inicializa variable resultados\n\t\t\t//calculo del costo de ventas\n\t\t $costoc=$mysqli->query(\"SELECT SUM(haber)FROM inventario WHERE tipomov = 2 AND idoc= $ref\");\n\t\t\t$row=mysqli_fetch_row($costoc);\n\t\t\t$costo=$row[0];\n\t\t\t$costoc->close();\t\n\t\t\t//si existe el costo de ventas?\n\t\t\tif($costo!=''){\n\t\t\t\ttry {\n\t\t\t\t\t$mysqli->autocommit(false);\n\t\t\t\t\t//abono a inventario 115.01\n\t\t\t\t\t$abono=\"115.01\";\n\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$costo,$fecha,$factu);\n\t\t\t\t\t//cargo a costo de ventas 501.01\n\t\t\t\t\t$cargo=\"501.01\";\n\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$costo,$fecha,$factu);\n\t\t\t\t\t//abono a ventas segun tasa\n\t\t\t\t\t//ventas tasa general \n\t\t\t\t\t\t$abono=\"401.01\";\n\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$monto16,$fecha,$factu,$cte);\n\t\t\t\t\t//ventas tasa 0 \n\t\t\t\t\t\t$abono=\"401.04\";\n\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$monto0,$fecha,$factu,$cte);\n\t\t\t\t\t//movimientos por tipo de venta\n\t\t\t\t\t\tswitch($tipo){\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t//mostrador- cargo a caja y efectivo 101.01\n\t\t\t\t\t\t\t\t$cargo=\"101.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu);\n\t\t\t\t\t\t\t\t//iva trasladado cobrado 208.01\n\t\t\t\t\t\t\t\t$abono=\"208.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t//contado x ahora igual a anterior, luego se manda al cobro\n\t\t\t\t\t\t\t\t//mostrador- cargo a caja y efectivo 101.01\n\t\t\t\t\t\t\t\t$cargo=\"101.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu);\n\t\t\t\t\t\t\t\t//iva trasladado cobrado 208.01\n\t\t\t\t\t\t\t\t$abono=\"208.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t//credito cargo a clientes\n\t\t\t\t\t\t\t\t$cargo=\"105.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu,$cte);\n\t\t\t\t\t\t\t\t//iva trasladado no cobrado 209.01\n\t\t\t\t\t\t\t\t$abono=\"209.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//efectuar la operacion\n\t\t\t\t\t$mysqli->commit();\n\t\t\t\t $resul=0;\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//error en las operaciones de bd\n\t\t\t\t $mysqli->rollback();\n\t\t\t\t \t$resul=-2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//no hay costo de ventas\n\t\t\t\t$resul=-1;\n\t\t\t}\n\t\t\n\t\t return $resul;\n}", "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "function alta_transferencia(){\n\t\t$u= new Cl_pedido();\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$u->cclientes_id=$GLOBALS['empresa_id'];\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t//Sincronizar con fecha de salida&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->ccl_estatus_pedido_id=2;\n\t\t$u->corigen_pedido_id=3;\n\t\t$u->ccl_tipo_pedido_id=2;\n\t\t// save with the related objects\n\t\tif($_POST['id']>0){\n\t\t\t$u->get_by_id($_POST['id']);\n\t\t\t$insert_traspaso_salida=0;\n\t\t} else {\n\t\t\t$insert_traspaso_salida=1;\n\t\t}\n\t\t$u->trans_begin();\n\t\tif($u->save()) {\n\t\t\t$cl_pedido_id=$u->id;\n\t\t\tif($insert_traspaso_salida==1) {\n\t\t\t\t//Dar de alta el traspaso\n\t\t\t\t$t= new Traspaso();\n\t\t\t\t$t->cl_pedido_id=$cl_pedido_id;\n\t\t\t\t$t->traspaso_estatus=1;\n\t\t\t\t$t->ubicacion_entrada_id=$_POST['ubicacion_entrada_id'];\n\t\t\t\t$t->ubicacion_salida_id=$_POST['ubicacion_salida_id'];\n\t\t\t\t$t->trans_begin();\n\t\t\t\t$t->save();\n\t\t\t\tif ($t->trans_status() === FALSE) {\n\t\t\t\t\t// Transaction failed, rollback\n\t\t\t\t\t$t->trans_rollback();\n\t\t\t\t\t$u->trans_rollback();\n\t\t\t\t\t// Add error message\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<button type=\"submit\" style=\"display:none;\" id=\"boton1\">Intentar de nuevo</button><br/>';\n\t\t\t\t\techo \"El alta del traspaso no pudo registrarse, intente de nuevo\";\n\t\t\t\t} else {\n\t\t\t\t\t// Transaction successful, commit\n\t\t\t\t\t$u->trans_commit();\n\t\t\t\t\t$t->trans_commit();\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//Actualisar unicamente la tabla de los detalles\n\t\t\t\t$u->trans_commit();\n\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t}\n\t\t} else {\n\t\t\t$u->trans_rollback();\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "private function updateSaldo(){\n try{\n\n $conn = db();\n $consulta = \"UPDATE cliente SET saldo = :saldo WHERE id = :id\";\n $stmt = $conn->prepare($consulta);\n $stmt->bindParam(':saldo', $this->saldo, PDO::PARAM_STR, 45);\n $stmt->bindParam(':id', $this->id, PDO::PARAM_STR, 45);\n $stmt->execute(); \n\n }catch(PDOException $e){\n echo $e->getMessage();\n return false;\n }\n return true;\n }", "function atuOrcreceitaval($codrec,$mes,$valor){\n $msg = \"0|Registro Atualizado !\";\n $clorcreceitaval = new cl_orcreceitaval;\t\t\n $clorcreceita = new cl_orcreceita;\t\t\n if ($mes == 0 || $mes =='0' || $mes === 0){\n // ajusta o saldo previsto\n\t$clorcreceita->o70_valor = $valor;\n\t$clorcreceita->o70_codrec= $codrec;\n\t$clorcreceita->o70_anousu= db_getsession(\"DB_anousu\");\n $rr= $clorcreceita->alterar(db_getsession(\"DB_anousu\"),$codrec);\n\tif ($clorcreceita->erro_status==='0'){\n\t $msg = \"1|\".$clorcreceita->erro_msg;\n\t}else {\n\t $msg = \"0|\".$clorcreceita->erro_msg; \n\t} \n return $msg;\n } \n if ($valor > 0){\n $clorcreceitaval->o71_coddoc = 100; \n }else{\n $clorcreceitaval->o71_coddoc = 101; \n }\n $clorcreceitaval->o71_anousu = db_getsession(\"DB_anousu\"); \n $clorcreceitaval->o71_mes = $mes; \n $clorcreceitaval->o71_codrec = $codrec;\n $clorcreceitaval->o71_valor = $valor; \n\n\n $rr = $clorcreceitaval->sql_record($clorcreceitaval->sql_query_file(db_getsession(\"DB_anousu\"),$codrec,$clorcreceitaval->o71_coddoc,$mes));\n if ($clorcreceitaval->numrows >0){\n $clorcreceitaval->alterar($clorcreceitaval->o71_anousu,$clorcreceitaval->o71_codrec,$clorcreceitaval->o71_coddoc,$clorcreceitaval->o71_mes);\n\n } else { \n $clorcreceitaval->incluir($clorcreceitaval->o71_anousu,$clorcreceitaval->o71_codrec,$clorcreceitaval->o71_coddoc,$clorcreceitaval->o71_mes);\n }\t \n \n $erro = $clorcreceitaval->erro_msg;\n if ($clorcreceitaval->erro_status===0){\n $msg= \"1|\".$erro;\n\treturn $msg;\n } else {\n $msg = \"0|\".$clorcreceitaval->erro_msg;\n return $msg;\n }\n}", "function valorDoBtcComEncargosSaque($param_valor)\n{\n\n//pega o btc e soma valor final do btc com todos encargos\n\n\t$percentual = 0.70 / 100.0; // 15%\n\t$valor_final = $param_valor - ($percentual * $param_valor);\n\t//comissoes 1,99 + 2,90\n\t$percentual2 = 2.0 / 100.0;\n\t$valorTotal = $percentual2 * $param_valor;\n\t\n\t\n\t\n\t$finalTodos = $valor_final - $valorTotal - 3;\n\n\t\treturn $finalTodos;\n}", "public function finalSanear($id_usuario){\r\n\t\t$sql = \"UPDATE tbl_usuarios SET valorPre='0' WHERE id_usuario='$id_usuario'\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "public static function newCoinPOST() {\n\n try {\n $conexion = ConexionDB::conectar(\"cryptoMonedas\");\n\n //Primero sacamos el máximo id\n $monedas = $conexion->monedas->findOne(\n [],\n [\n 'sort' => ['id' => -1],\n ]);\n if (isset($monedas['id']))\n $max = $monedas['id'] + 1;\n else \n $max = 1;\n\n $result = $conexion->monedas->insertOne([\n 'nombre' => $_POST[\"nombre\"],\n 'simbolo' => $_POST[\"simbolo\"],\n 'descripcion' => $_POST[\"descripcion\"],\n 'precio' => $_POST[\"precio\"],\n 'valor_24h' => $_POST[\"valor_24h\"],\n 'id' => $max\n ]);\n\n } catch(Exception $e) {\n }\n $conexion = null;\n return $result;\n}", "function Cuerpo($acceso,$id_contrato)\n\t{\n\t\t//echo \"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"SELECT tarifa_ser FROM vista_tarifa where id_serv='BM00001'\");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$costo_inst=utf8_decode(trim($row['tarifa_ser']));\n\t\t}\n\t\t//echo \"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\");\n\t\t$acceso->objeto->ejecutarSql(\"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\");\n\t\tif($row=row($acceso)){\n\t\t\n\t\t\t$observacion=utf8_decode(trim($row['observacion']));\n\t\t\t$costo_contrato=utf8_decode(trim($row['costo_contrato']));\n\t\t\t$tipo_cliente=utf8_decode(trim($row['tipo_cliente']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombrecli']));\n\t\t\t$apellidocli=utf8_decode(trim($row['apellido']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombre']));\n\t\t\t$etiqueta=utf8_decode(trim($row['etiqueta']));\n\t\t\t$cedulacli=utf8_decode(trim($row['cedula']));\n\t\t\t\n\t\t\t$fecha=formatofecha(trim($row[\"fecha_contrato\"]));\n\t\t\t$fecha_nac=formatofecha(trim($row[\"fecha_nac\"]));\n\t\t\t\n\t\t\t\n\t\t\t$nro_contrato=trim($row['nro_contrato']);\n\t\t\t$id_contrato=trim($row['id_contrato']);\n\t\t\n\t\t\n\t\t\t$puntos=utf8_decode(trim($row['puntos']));\n\t\t\t$deuda=utf8_decode(trim($row['deuda']));\n\t\t\tif($deuda==\"\"){\n\t\t\t\t$deuda=0;\n\t\t\t}\n\t\t\t\n\t\t\t$deuda=number_format($deuda, 2, ',', '.');\n\t\t\t$nombre_zona=utf8_decode(trim($row['nombre_zona']));\n\t\t\t$nombre_sector=utf8_decode(trim($row['nombre_sector']));\n\t\t\t$nombre_calle=utf8_decode(trim($row['nombre_calle']));\n\t\t\t$numero_casa=utf8_decode(trim($row['numero_casa']));\n\t\t\t$telefono=utf8_decode(trim($row['telefono']));\n\t\t\t$telf_casa=utf8_decode(trim($row['telf_casa']));\n\t\t\t$telf_adic=utf8_decode(trim($row['telf_adic']));\n\t\t\t$email=utf8_decode(trim($row['email']));\n\t\t\t$direc_adicional=utf8_decode(trim($row['direc_adicional']));\n\t\t\t$id_persona=utf8_decode(trim($row['id_persona']));\n\t\t\t$postel=utf8_decode(trim($row['postel']));\n\t\t\t$taps=utf8_decode(trim($row['taps']));\n\t\t\t$pto=utf8_decode(trim($row['pto']));\n\t\t\t$edificio=utf8_decode(trim($row['edificio']));\n\t\t\t$numero_piso=utf8_decode(trim($row['numero_piso']));\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"SELECT nombre,apellido FROM persona where id_persona='$id_persona' LIMIT 1 offset 0 \");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$vendedor=utf8_decode(trim($row['nombre'])).\" \".utf8_decode(trim($row['apellido']));\n\t\t\t\n\t\t}\n\n\t\tif($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}\n\t\t\n\t\t\n\t\t$this->Ln();\t\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetXY(10,35);\t\t\n\t\t$this->Cell(195,10,\"Abonado: $nro_contrato\",\"0\",0,\"R\");\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t$this->SetXY(40,50);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA JURIDICA.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Razón Social.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Actividad.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Telef.\",\"1\",0,\"J\");\n\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Representante Legal\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cargo en la Empresa.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA NATURAL.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: $nombrecli $apellidocli\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: $fecha_nac\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ingreso Mensual: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Deposito en Garantia: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Tipo Vivienda: Propia ___ Alquilado ___ Canon Mensual: ____\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(65,6,\"Vencimiento del Contrato: / / \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DATOS DEL CONYUGUE.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Ingreso Mensual.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DOMICILIO DEL SERVICIO\",\"1\",0,\"C\");\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Apellidos: $apellidocli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Vendedor: $vendedor\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Suscriptor Nº: $nro_contrato\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha: $fecha\",\"1\",0,\"J\");*/\n\t\t\t\t\n\t\n\t\t/*if($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}*/\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I. $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Ocupación: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Grupo Familiar Nº:\",\"1\",0,\"J\");\n\t\tif($fecha_nac=='11/11/1111'){\n\t\t\t$fecha_nac='';\n\t\t}\n\t\t$this->Cell(65,6,\"Fecha de Nacimiento : $fecha_nac\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"DOMICILIO DE SERVICIO\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb o Sector: $nombre_sector\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Calle n°: \",\"1\",0,\"J\");\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Avenida o Calle: $nombre_calle\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Vereda : \",\"1\",0,\"J\");\t\t\n\t\t\n\t\tif($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Piso:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"N° de Casa o Apto: $numero_casa $apto\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Referencia o Zona: $nombre_zona N°Poste:$postel\",\"1\",0,\"J\");\n\t\t//$this->Cell(65,6,\"N° de Poste: $postel\",\"0\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ruta Cuenta: \",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Zona: $nombre_zona\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Manzana: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb.: $nombre_sector\",\"1\",0,\"J\");*/\n\t\t\n\t\t/*if($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Cell(97,6,\"Apto.: $apto\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cod. Postal: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t//Rect( float x, float y, float w, float h [, string style])\n\t\t$this->Cell(98,6,\"Vivienda Alquilada: SI ____ NO ____\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha de Vencimineto de Alquiler: \",\"1\",0,\"J\");\n\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Proveedor de Internet: \",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\");\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"SERVICIOS \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,6,\"CANT.\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"P. UNITARIO \",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"P. TOTAL \",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Instalación Principal\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"1\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Tomas Adicionales\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Cable Coaxial\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Conectores\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Espliter\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\" \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(60,5,\"TOTAL A PAGAR BS\",\"1\",0,\"R\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"FECHA ESTIMADA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"HORA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"TOTAL A\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"$costo_contrato\",\"LRT\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"DE INSTALACION\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"SUGERIDA\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"PAGAR Bs.\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"\",\"LRB\",0,\"C\");*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PROGRAMACIÓN\",\"1\",0,\"C\");\t\t\t\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Descripción.\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Descripción\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Familiar Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Extendido Bs \",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Adulto Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Comercial I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Monto de Contrato: Bs. $costo_inst\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Firma del Abonado:_________________________ \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Puntos Adicionales:_________________________\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Costo Punto Adicional:_______________________\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Tiempo de Instalación:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Total a Cancelar Mensual:\",\"1\",0,\"J\");\n\t\t$this->Cell(30,6,\"Total:\",\"1\",0,\"J\");\n\t\t$this->Cell(35,6,\"Contrato:\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Observaciones.\",\"1\",0,\"J\");\n\t\t\t\t\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"$observacion\",\"1\",0,\"J\");*/\n\t\t\n\t/*\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"RECIBO DE PAGO\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"*EL PRECIO INCLUYE EL IMPUESTO DE LEY\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Efectivo\",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"Cheque\",\"1\",0,\"C\");\n\t\t$this->Cell(65,6,\"Cargo Cta. Cte.\",\"1\",0,\"C\");\n\t\t$this->Cell(60,6,\"Tarjeta de Credito:\",\"1\",0,\"C\");\n\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Bs. $costo_contrato\",\"1\",0,\"L\");\n\t\t$this->Cell(35,6,\"Nº.\",\"1\",0,\"L\");\n\t\t$this->Cell(65,6,\"Cta. Nº Bco.\",\"1\",0,\"L\");\n\t\t$this->Cell(60,6,\"Nombre:\",\"1\",0,\"L\");\n\t\t\n\t\n\t\t\n\t\t\n\t\t$this->Ln(15);\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Nota:\",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"En caso de que el televisor no acepte la señal de todos los canales del cable, es posible que amerite la instalación de un amplificador de sintonia, el cual deberá ser adquirido por el SUSCRIPTOR\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Atención: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"La Empresa. No autoriza el retiro de televisores y/o VHS por el personal de la empresa. El SUSCRIPTOR conoce y acepta las condiciones del contrato del servicio que apacen al dorso del presente\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Aviso: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"Se le informa a todos los suscriptores y publico en general de acuerdo a la Ley Orgánica de Telecomunicaciones, en el Artículo 189, Literal 2: será penado con prisión de uno (1) a cuatro (4) años, el que utilizando equipos o tecnologías de cualquier tipo, proporciones a un tercero el acceso o disfrute en forma fraudulenta o indebida de un serbicio o facilidad de telecomunicaciones \",\"0\",\"J\");\n\t\t\n\t\t\n\t\t\n\t\t$this->Ln(10);\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,5,\"________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"_________________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"__________________________\",\"0\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Firma del Vendedor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Nombre y Apellido del Suscriptor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Firma del Suscriptor\",\"0\",0,\"C\");*/\n\t\t\n\t\t/*$this->Ln(4);\n\t\t\n\t\t$this->SetDrawColor(76,136,206);\n\t\t$this->SetLineWidth(.4);\n\t\t$this->SetFont('times','I',12);\n\t\t$this->SetX(10);\n\t\t$this->MultiCell(195,5,'Av. Perimetral, Centro Comercial Residencial Central. P.B. Local Nº 07. Cúa, Edo. Miranda.\[email protected] / [email protected]',\"TB\",\"C\");*/\n\t\t\n\t\t//$this->clausulas();\n\t\t\n\t\treturn $cad;\n\t}", "function verificarComprobante($fecha)\n {\n global $db;\n $sql = \" select count(dateReception) as total from almacen_reception\n where tipoTrans = 'A' and tipoComprobante = 'A';\n and dateReception >= '$fecha' \";\n echo $sql;\n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n \t$info = $db->execute($sql);\n if ($info->fields(\"total\") == 0)\n {\n return 1; // positivo, puede registrar\n }\n else if ($info->fields(\"total\") > 0)\n {\n return 0; // existe ajustes, no puede registrar\n }\n }", "function getMaximoRetirable($fecha = false){\n\t\tif ( $fecha == false ){\n\t\t\t$fecha = fechasys();\n\t\t}\n\t\tif ( $this->mCuentaIniciada == false ) {\n\t\t $this->init();\n\t\t}\n\t\t//Obtener la Captacion Total\n\t\t$xSoc\t\t\t\t\t= new cSocio($this->mSocioTitular);\n\t\t$DTCap\t\t\t\t\t= $xSoc->getTotalCaptacionActual();\n\t\t$this->mMessages \t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El Saldo Total de Captacion es \" . $DTCap[\"saldo\"] . \" \\r\\n\";\n\t\t$this->mMessages \t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El saldo por Esta Cuenta es \" . $this->mNuevoSaldo . \" \\r\\n\";\n\t\t$saldo\t\t\t\t\t= $this->mSaldoAnterior;\n\t\t$saldo\t\t\t\t\t= ( $DTCap[\"saldo\"] - $saldo ) + $this->mNuevoSaldo ;\n\t\t$maximo_retirable\t\t= 0;\n\t\t//obtener los maximos retirables por credito\n\t\t//2011-1-30 cambio de monto_autorizado a saldo_actual\n\t\t$sqlCompCreditos = \"SELECT\n\t\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_actual`) AS `monto`\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t`creditos_solicitud` `creditos_solicitud`\n\t\t\t\t\t\t\t\t\tINNER JOIN `eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`\n\t\t\t\t\t\t\t\t\tON `creditos_solicitud`.`tipo_convenio` =\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`miembro`\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t(`creditos_solicitud`.`numero_socio` = \" . $this->mSocioTitular . \")\n\t\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t(`eacp_config_bases_de_integracion_miembros`.`codigo_de_base` = 1110)\n\t\t\t\t\t\t\t\t\tAND\n \t\t\t\t\t(`creditos_solicitud`.`saldo_actual` > \" . TOLERANCIA_SALDOS . \")\n\t\t\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio`,\n\t\t\t\t\t\t\t\t\t`eacp_config_bases_de_integracion_miembros`.`codigo_de_base`\n \";\n\t\t$d\t\t\t\t\t\t\t= obten_filas($sqlCompCreditos);\n\t\t//Obtener el Maximo Comprometidos por Garantia Liquida\n\t\t$sqlCC = \"SELECT\n\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio`,\n\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_actual`) AS 'monto_creditos',\n\t\t\t\t\t\t\tSUM(`creditos_solicitud`.`saldo_Actual` *\n\t\t\t\t\t\t\t`creditos_tipoconvenio`.`porciento_garantia_liquida`) AS 'monto_garantia'\n\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`creditos_solicitud` `creditos_solicitud`\n\t\t\t\t\t\t\t\tINNER JOIN `creditos_tipoconvenio` `creditos_tipoconvenio`\n\t\t\t\t\t\t\t\tON `creditos_solicitud`.`tipo_convenio` = `creditos_tipoconvenio`.\n\t\t\t\t\t\t\t\t`idcreditos_tipoconvenio`\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t(`creditos_solicitud`.`numero_socio` =\" . $this->mSocioTitular . \")\n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t(`creditos_solicitud`.`saldo_actual` > \" . TOLERANCIA_SALDOS . \")\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\t`creditos_solicitud`.`numero_socio` \";\n\t\t$comprometido_por_garantia\t= 0;\n\n\t\t$comprometido_por_creditos\t= (isset($d[\"monto\"])) ? csetNoMenorQueCero( $d[\"monto\"] ) : 0;\n\t\t$comprometido_por_ide\t\t= 0;\t\t\t//Terminar el saldo de IDE retirable\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por Creditos es de $comprometido_por_creditos \\r\\n\";\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por IDE es de $comprometido_por_ide\\r\\n\";\n\n\t\t//\n\t\tif ( $this->mSubProducto == CAPTACION_PRODUCTO_GARANTIALIQ){\n\t\t\t$c\t\t\t\t\t\t\t= obten_filas($sqlCC);\n\t\t\t$comprometido_por_garantia\t= setNoMenorQueCero( $c[\"monto_garantia\"] );\n\t\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, Lo Comprometido por GARANTIA LIQUIDA ES $comprometido_por_garantia \\r\\n\";\n\t\t\t$saldo\t\t\t\t\t\t= $this->mNuevoSaldo;\t//correccion por garantia liquida\n\t\t\t$comprometido_por_creditos\t= 0;\t\t\t\t\t//La ganartia liquida solo es presionado por lo comprometido por garantia\n\t\t}\n\t\t//\n\n\n\t\t$maximo_retirable\t\t\t= $saldo - ($comprometido_por_creditos + $comprometido_por_ide + $comprometido_por_garantia);\n\t\t$maximo_retirable\t\t\t= setNoMenorQueCero($maximo_retirable);\n\t\t$this->mMessages \t\t\t.= \"MAX_RETIRABLE\\tA la fecha $fecha, El Maximo Retirable es de $maximo_retirable de un Monto de $saldo\\r\\n\";\n\t\t//Componer el Saldo, no puede ser mayor al nuevo saldo\n\t\treturn ($maximo_retirable <= $this->mNuevoSaldo ) ? round($maximo_retirable, 2) : round($this->mNuevoSaldo, 2);\n\t}", "function Recalcular_Saldo_Venta_AddCobro($idventa){\n\t$datosventa\t\t=\tregistro( runsql(\"select fecha, monto,saldo from ventas where id_venta='$idventa'\") ); \n\t$datoscobros\t=\trunsql(\"select id_cobro,fecha,monto,saldo,moneda from cobros where id_venta='$idventa' order by id_cobro desc LIMIT 1 OFFSET 0 ;\"); // AGARRA EL ULTIMO\n\t$tcUSD\t=\tTipoCambio('USD',$datosventa[fecha]);\n\t$tcEUR\t=\tTipoCambio('EUR',$datosventa[fecha]);\n\t$tcQUE\t=\t1;\n\t$Monto_Pagado\t=\t0;\n\t$SubMonto\t\t=\t0;\n\t$Saldo_Anterior\t=\t$datosventa[saldo];\n\twhile($i=registro($datoscobros)){\n\t\tswitch($i[moneda]){\n\t\t\tcase \"USD\":\n\t\t\t\t$Monto_Pagado\t=\t$i[monto]*$tcUSD;\n\t\t\t\techo $Monto_Pagado;\n\t\t\tbreak;\n\t\t\tcase \"EUR\":\n\t\t\t\t$Monto_Pagado\t=\t$i[monto]*$tcEUR;\n\t\t\t\techo $Monto_Pagado;\t\t\t\t\n\t\t\tbreak;\t\n\t\t\tcase \"QUE\":\n\t\t\t\t$Monto_Pagado\t=\t$i[monto]*$tcQUE;\n\t\t\t\techo $Monto_Pagado;\t\t\t\t\n\t\t\tbreak;\t\t\t\t\t\n\t\t}\n\t}\n\t$Saldo_Actual\t=\t$Saldo_Anterior\t - $Monto_Pagado;\n//\techo \"<br>**************\". $Saldo_Actual\t.\"=\".\t$Saldo_Anterior\t .\"-\". $Monto_Pagado.\" ****<br>\";exit();\n\t$campos=Array();\n $campos[saldo]\t=\t$Saldo_Actual;\n\t$ins=actualizar(\"ventas\",$campos,\"id_venta = '$idventa'\");\n\t//recalcular_saldo_venta($idventa);\n\t//echo \"<br>actualizar(ventas,\".$Saldo_Actual.\",id_venta = $idventa\"; \texit();\n\treturn $Saldo_Actual;\n}", "public function Salvar_Novo_Plano()\r\n {\r\n if (Controller_Header_Usuario::Verificar_Autenticacao()) {\r\n $status = Controller_Header_Usuario::Verificar_Status_Usuario();\r\n if ($status != 0) {\r\n if (empty($this->erros)) {\r\n Conexao::$conection->beginTransaction();\r\n \r\n if (GerenciarFaturas::Criar_Fatura(Login_Session::get_entidade_id(), $this->plano_id, GerenciarFaturas::IMEDIATA)) {\r\n $obj_entidade = new OBJ_Entidade();\r\n $obj_entidade->set_id(Login_Session::get_entidade_id());\r\n $obj_entidade->set_plano_id($this->plano_id);\r\n $obj_entidade->set_intervalo_pagamento_id(1);\r\n $obj_entidade->set_data_contratacao_plano(date('Y-m-d H:i:s'));\r\n \r\n if (DAO_Entidade::Atualizar_Financeiro($obj_entidade)) {\r\n if (Conexao::$conection->commit()) {\r\n Login_Session::set_entidade_plano($this->plano_id);\r\n } else {\r\n Conexao::$conection->rollBack();\r\n $this->erros[] = 'Erro Fatal ao tentar salvar modificações';\r\n }\r\n } else {\r\n if (Conexao::$conection->rollBack()) {\r\n $this->erros[] = 'Erro ao tentar Ativar novo plano';\r\n } else {\r\n $this->erros[] = 'Erro Fatal ao tentar salvar modificações';\r\n }\r\n }\r\n } else {\r\n if (Conexao::$conection->rollBack()) {\r\n $this->erros[] = 'Erro ao tentar gerar nova fatura';\r\n } else {\r\n $this->erros[] = 'Erro Fatal ao tentar salvar modificações';\r\n }\r\n }\r\n }\r\n \r\n $retorno['erros'] = [];\r\n $retorno['status'] = 'certo';\r\n \r\n if (!empty($this->erros)) {\r\n $retorno['erros'] = $this->erros;\r\n $retorno['status'] = 'erro';\r\n }\r\n \r\n echo json_encode($retorno);\r\n }\r\n }\r\n }", "private function update($usuario, $carga_saldo, $numero_tran)\n {\n $resultado = $this->con->query(\"SELECT saldo_real, saldo_contable FROM `carga` WHERE id_conductor = '\".$usuario.\"'\");\n $row = $resultado->fetch_array(MYSQLI_ASSOC);\n $saldonuevo = $row[\"saldo_real\"] + $carga_saldo;\n date_default_timezone_set(\"Chile/Continental\");\n $fecha = date(\"Y-m-d H:i:s\");\n if($stmt = $this->con->query(\"UPDATE `carga` SET saldo_real = '\".$saldonuevo.\"', saldo_contable = '\".$carga_saldo.\"', fecha_carga = '\".$fecha.\"', transaccion = '\".$numero_tran.\"' WHERE id_conductor = '\".$usuario.\"'\") and $this->updatefirebase($usuario, $saldonuevo , $numero_tran, $carga_saldo, $fecha)){\n $this->con->close();\n return true;\n \n }\n else{\n return false;\n echo \"Un error a ocurrido.\";\n }\n }", "public function encuentra_saldo($codigo_tar){\n require_once('../procesos/auditoria.php');\n $auditar = new auditoria();\n require_once('../conexion_bd/conexion.php');\n $this->usuario=$_SESSION['usuarios'];//'[email protected]';\n $conectado = new conexion();\n $con_res = $conectado->conectar();\n if (strcmp($con_res, \"ok\") == 0) {\n echo 'Conexion exitosa todo bien ';\n \n $var = \"select a.saldo from tarjetas_recibidas a, tarjetas_por_usuarios b\n where b.codigo_targeta=a.codigo_targeta and a.codigo_targeta=\".$codigo_tar . \"and a.registrada_sistema=TRUE\";\n \n $result = mysql_query( $var );\n $auditar->insertar_auditoria($_SESSION['usuarios'], \n \"Consulta\", \"tarjetas_por_usuarios\", \"Consultando saldo de la tarjeta\");\n if ($row = mysql_fetch_array($result)) {\n $retornasaldo= $row['saldo'];\n } else {\n $retornasaldo=''; \n }\n\n mysql_free_result($result);\n $conectado->desconectar();\n return $retornasaldo;\n \n } else {\n $auditar->insertar_auditoria($_SESSION['usuarios'], \n \"Conexion\", \"Base de datos\", \"Problemas de conexion\");\n echo 'Algo anda mal';\n } \n }", "private function modificarCita(){\n $query = \"UPDATE \" . $this->table . \" SET PacienteId ='\" . $this->idpaciente . \"',Fecha = '\" . $this->fecha . \"', HoraInicio = '\" . $this->horarioIn . \"', HoraFin = '\" .\n $this->horarioFn . \"', Motivo = '\" . $this->motivo . \"' WHERE CitaId = '\" . $this->idcita . \"'\"; \n $resp = parent::nonQuery($query);\n if($resp >= 1){\n return $resp;\n }else{\n return 0;\n }\n }", "public static function descontarProductoVenta($id, $cantidad, $venta){\n try{\n\n $conexion = new Conexion();\n $con = $conexion->getConexion();\n\n $cantidadBackups = $cantidad;\n\n $producto = Producto_model::selectId($id);\n \n // Seleccionamo el cns minimo\n $query = $con->prepare(\"SELECT MIN(cns) as cns FROM detalle_productos WHERE id_producto_dp = ? and stock > 0\");\n $query->execute([$id]);\n $cns_min = $query->fetch();\n\n $ban = true;\n $cns = $cns_min['cns'];\n \n $total_venta = $producto['precio_venta'] * $cantidad;\n $total_costo = 0;\n\n while($ban){\n\n $query = $con->prepare(\"SELECT * FROM detalle_productos WHERE cns = ?\");\n $query->execute([$cns]);\n $producto = $query->fetch();\n\n if($producto['stock'] >= $cantidad){\n $disponible = $producto['stock'] - $cantidad;\n $total_costo = $total_costo + ($cantidad * $producto['precio_compra']);\n $query = $con->prepare(\"UPDATE detalle_productos set stock = ? WHERE cns = ?\");\n $query->execute([$disponible,$producto['cns']]);\n $ban = false;\n }else{\n $cantidad = $cantidad - $producto['stock'];\n $total_costo = $total_costo + ($producto['stock'] * $producto['precio_compra']);\n $query = $con->prepare(\"UPDATE detalle_productos set stock = 0 WHERE cns = ?\");\n $query->execute([$producto['cns']]);\n $cns++;\n }\n\n }\n\n /* Insertamos el tabla ventas_producto */\n $query = $con->prepare(\"INSERT INTO ventas_producto (id_venta,id_producto,total_venta,total_costo,ganancia) VALUES (?,?,?,?,?)\");\n $query->execute([$venta,$id,$total_venta,$total_costo,($total_venta-$total_costo)]);\n \n\n // Actualizamos el stock\n $producto = Producto_model::selectId($id);\n $stock = $producto['stock'] - $cantidadBackups;\n $query = $con->prepare(\"UPDATE productos set stock = ? WHERE id_producto = ?\");\n $query->execute([$stock,$id]);\n\n // Insertamos en la tabla producto_descuentos\n $query = $con->prepare(\"INSERT INTO producto_descuentos (id_producto_pd,cantidad,razon) VALUES (?,?,?)\");\n $query->execute([$id,$cantidadBackups,'Venta']);\n\n $conexion->closeConexion();\n $con = null;\n\n return true;\n\n }catch(PDOException $e){\n return $e->getMessage();\n }\n }", "function getMerezcoTarjeta(){\n\t\tif($this->numero_cambio >= 3)\n\t\t\t$necesito=2;\n\t\telse\n\t\t\t$necesito=1;\n\t\t\n\t\tif($necesito <= $this->sacar_tarjeta){\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 0;\n\t\t}\n\t}", "function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }", "public function salvar() {\n\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.nao_existe_transacao'));\n }\n if (count($this->getCalculos()) == 0) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.planilha_sem_calculos'));\n }\n\n if (empty($this->iMes)) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.planilha_sem_mes_de_processamento'));\n }\n\n if (empty($this->iAno)) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.planilha_sem_ano_de_processamento'));\n }\n $oDaoBensHistoricoCalculo = db_utils::getDao(\"benshistoricocalculo\");\n $oDaoBensHistoricoCalculo->t57_ano = $this->getAno();\n $oDaoBensHistoricoCalculo->t57_mes = $this->getMes();\n $oDaoBensHistoricoCalculo->t57_ativo = $this->isAtiva()?\"true\":\"false\";\n $oDaoBensHistoricoCalculo->t57_datacalculo = date(\"Y-m-d\", db_getsession(\"DB_datausu\"));\n $oDaoBensHistoricoCalculo->t57_instituicao = db_getsession(\"DB_instit\");\n $oDaoBensHistoricoCalculo->t57_processado = $this->isProcessado()?\"true\":\"false\";\n $oDaoBensHistoricoCalculo->t57_tipocalculo = $this->getTipoCalculo();\n $oDaoBensHistoricoCalculo->t57_tipoprocessamento = $this->getTipoProcessamento();\n $oDaoBensHistoricoCalculo->t57_usuario = db_getsession(\"DB_id_usuario\");\n if (empty($this->iPlanilha)) {\n\n $oDaoBensHistoricoCalculo->incluir(null);\n $this->iPlanilha = $oDaoBensHistoricoCalculo->t57_sequencial;\n\n /**\n * Salvamos os dados dos calculos na planilha\n */\n $aCalculos = $this->getCalculos();\n foreach ($aCalculos as $oCalculo) {\n $oCalculo->salvar($this->iPlanilha);\n }\n } else {\n\n $oDaoBensHistoricoCalculo->t57_sequencial = $this->iPlanilha;\n $oDaoBensHistoricoCalculo->alterar($this->iPlanilha);\n }\n\n if ($oDaoBensHistoricoCalculo->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.PlanilhaCalculo.planilha_sem_ano_de_processamento',$oDaoBensHistoricoCalculo));\n }\n }", "public function salvar()\n\t{\n\t $mysqli = new mysqli(\"localhost\",\"root\",\"\",\"hogar_db\");\n\t\n\t #verifico que ho haya ocurrido un error en la conexion\n\t #esto normalmente muestra un error de php si no funciona\n\t if($mysqli->connect_errno)\n\t {\n\t\tthrow new Exception(\"Fallo al conectar a MYSQL: \". $mysqli->connect_error);\n\t\texit();\n\t }\n\t\n\t #construyo mi consulta\n\t $fechaString = $this->fecha->format('Y-m-d');\n\t $consulta = \"INSERT INTO transaccion_tb(nombre, fecha, saldo, descr) VALUES('$this->nombre', '$fechaString','$this->saldoTotal', '$this->descr')\";\n\t \t\t\n #ejecuto consulta\n\t $resultado = $mysqli->query($consulta);\n\t\n\t #verifico k no haya algun error en la ejecucion\n\t if(!($resultado))\n\t {\n\t\t throw new Exception(\"Fallo al ejecutar la inserción de la transacción\");\n\t }\n\t else\n\t {\n\t\t$consultaId = \"SELECT max(transaccion_tb.idTransaccion) as idMax from transaccion_tb\"; \n\t\t$resultadoId = $mysqli->query($consultaId);\n\t\t \n\t\t if(!($resultadoId))\n\t\t {\n\t\t\t throw new Exception(\"Fallo al ejecutar la selección del id\"); \n\t\t }\n\t\t else\n\t\t {\n\t\t\t $row = $resultadoId->fetch_assoc(); \n\t\t\t $id = $this->tipoIngreso->obtenerId();\n\t\t\t $consultaIngreso = \"INSERT INTO ingreso_tb(transaccion, tipoIngreso) VALUES('$row[idMax]', '$id')\";\n\t\t\t $resultadoIngreso = $mysqli->query($consultaIngreso);\n\t\t\t \n\t\t\t if(!($resultadoIngreso))\n\t\t {\n\t\t\t throw new Exception(\"Fallo al ejecutar la inserción del ingreso\"); \n\t\t }\n\t\t }\n\t\t\n\t }\n\t #cierro conexion\n\t $mysqli->close();\t\n\t}", "public function MantenimientoCobro($idcobro,$idreserva,$idempleado,$acuenta,$saldo,$consulta){\n\tif($consulta==\"I\"){\n\t\t $sql=\" INSERT INTO TCOBRO VALUES ( NULL, '\".$idreserva.\"','\".$idempleado.\"','\".$acuenta.\"','\".$saldo.\"','\".date(\"d/m/Y\").\"')\";\n\t\t echo \" <script language='JavaScript'> \n alert('Sus Datos Fueron Almacenador Correctamente'); \n </script>\";\n\t}else\n\tif($consulta==\"R\"){\n\t\t$sql=\"SELECT acuenta, saldo, cfecha FROM treserva, tcobro\n\t\t\t\tWHERE treserva.idreserva = tcobro.idreserva\n\t\t\t\t AND treserva.idreserva = \".$idreserva;\n\t\t\t\t \n\t }\n $resultado=mysql_query($sql);\n\t\t \n\t\t return $resultado;\n\t\t}", "public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "public function testTarjetita() {\n\t\tprint (\"--Cargando 100:\\n\");\n\t\t$saldoInicial = $this->tarjeta->getSaldo();\n\t\t$this->tarjeta->recargar(100);\n\t\t$this->assertEquals(100, $this->tarjeta->getSaldo() - $saldoInicial);\n\n\t\t// probando cargar la tarjeta con un monto especial\n\t\tprint (\"--Cargando 290:\\n\");\n\t\t$saldoInicial = $this->tarjeta->getSaldo();\n\t\t$this->tarjeta->recargar(290);\n\t\t$this->assertEquals(340, $this->tarjeta->getSaldo() - $saldoInicial);\n\n\t\t// probando cargar la tarjeta con otro monto especial\n\t\tprint (\"--Cargando 544:\\n\");\n\t\t$saldoInicial = $this->tarjeta->getSaldo();\n\t\t$this->tarjeta->recargar(544);\n\t\t$this->assertEquals(680, $this->tarjeta->getSaldo() - $saldoInicial);\n\n\t\t// probando un boleto comun\n\t\tprint (\"--Normal:\\n\");\n\t\t$saldoInicial = $this->tarjeta->getSaldo();\n\t\t$this->tarjeta->pagar($this->colectivo, \"21-09-2016 16:00\");\n\t\t$this->assertEquals($saldoInicial-8.5, $this->tarjeta->getSaldo());\n\n\t\t// probando un trasbordo\n\t\tprint (\"--Trasbordo:\\n\");\n\t\t$this->colectivo = new Colectivo(\"129 Rojo\", \"Rosario Bus\");\n\t\t$saldoInicial = $this->tarjeta->getSaldo();\n\t\t$this->tarjeta->pagar($this->colectivo, \"21-09-2016 16:21\");\n\t\t$this->assertEquals($saldoInicial-2.81, $this->tarjeta->getSaldo());\n\n\t\t// probando una bicicleta\n\t\tprint (\"--Bicicleta:\\n\");\n\t\t$saldoInicial = $this->tarjeta->getSaldo();\n\t\t$this->tarjeta->pagar($this->bicicleta, \"21-09-2016 16:50\");\n\t\t$this->assertEquals($saldoInicial-12, $this->tarjeta->getSaldo());\n\n\t\t// probando el pase libre\n\t\tprint (\"--Libre:\\n\");\n\t\t$this->tarjetaAlternativa = new PaseLibre();\n\t\t$this->tarjetaAlternativa->recargar(50);\n\t\t$saldoInicial = $this->tarjetaAlternativa->getSaldo();\n\t\t$this->tarjetaAlternativa->pagar($this->colectivo, \"12-03-2016 18:32\");\n\t\t$this->assertEquals($saldoInicial, $this->tarjetaAlternativa->getSaldo());\n\n\t\t// probando el medio\n\t\tprint (\"--Medio:\\n\");\n\t\t$this->tarjetaAlternativa = new MedioBoleto();\n\t\t$this->tarjetaAlternativa->recargar(50);\n\t\t$saldoInicial = $this->tarjetaAlternativa->getSaldo();\n\t\t$this->tarjetaAlternativa->pagar($this->colectivo, \"12-03-2016 18:32\");\n\t\t$this->assertEquals($saldoInicial-4.25, $this->tarjetaAlternativa->getSaldo());\n\n\t\t// probando los plus\n\t\tprint (\"--Viaje PLUS 2:\\n\");\n\t\t$this->tarjetaAlternativa = new Tarjetita();\n\t\tprint ($this->tarjetaAlternativa->getPlus() . \" PLUS RESTANTES\\n\");\n\t\t$this->tarjetaAlternativa->recargar(4);\n\t\t$saldoInicial = $this->tarjetaAlternativa->getSaldo();\n\t\t$this->tarjetaAlternativa->pagar($this->colectivo, \"12-03-2016 18:12\");\n\t\t$this->assertEquals($saldoInicial, $this->tarjetaAlternativa->getSaldo());\n\t\t$this->assertEquals(1, $this->tarjetaAlternativa->getPlus());\n\n\t\t// probando que la bici no funcione sin saldo suficiente\n\t\tprint ($this->tarjetaAlternativa->getPlus() . \" PLUS RESTANTES\\n\");\n\t\tprint (\"--Pagando bici sin saldo:\\n\");\n\t\t$viajesIniciales = $this->tarjetaAlternativa->getViajesRealizados();\n\t\t$this->tarjetaAlternativa->pagar($this->bicicleta, \"12-03-2016 20:22\");\n\t\t$this->assertEquals($viajesIniciales, $this->tarjetaAlternativa->getViajesRealizados());\n\n\t\t// probando que no se pueda seguir pagando colectivo luego de 2 plus\n\t\tprint ($this->tarjetaAlternativa->getPlus() . \" PLUS RESTANTES\\n\");\n\t\tprint (\"--Viaje PLUS #1:\\n\");\n\t\t$this->tarjetaAlternativa->pagar($this->colectivo, \"12-03-2016 22:39\");\n\t\t$this->assertEquals(0, $this->tarjetaAlternativa->getPlus());\n\t\tprint (\"--Viaje Negado:\\n\");\n\t\t$viajesIniciales = $this->tarjetaAlternativa->getViajesRealizados();\n\t\t$this->tarjetaAlternativa->pagar($this->colectivo, \"12-04-2016 12:18\");\n\t\t$this->assertEquals($viajesIniciales, $this->tarjetaAlternativa->getViajesRealizados());\n\t}", "public function concretarAutoAction($codigo){\n\t\t$user = $this->getUser(); if ($user == '' || !$this->es_admin()) { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$session = $this->get('session');\n\t\tif($em->getRepository('LIHotelBundle:Reserva')->reservas_existe_codigo($codigo))\n\t\t{\n\t\t\t$reservas = $em->getRepository('LIHotelBundle:Reserva')->reservas_obtener_codigo($codigo);\n\t\t\tif($reservas[0]->getEstadoReserva() == 'Concretada')\n\t\t\t{\n\t\t\t\t$session->getFlashBag()->add('reserva_info', 'Esta reserva ya ha sido concretada.');\n\t\t\t}else{\n\t\t\t\tif ($reservas[0]->getEstadoReserva() == 'Cancelada') {\n\t\t\t\t\t$session->getFlashBag()->add('reserva_info', 'Esta reserva ha sido cancelada, ergo no se puede concretar.');\n\t\t\t\t}else{\n\t\t\t\t\t/** OBTENIENDO LAS RESERVAS QUE NO SE CONCRETARON EN LA FECHA PREVISTA **/\n\t\t\t\t\t$hoy = new \\DateTime('today');\n\t\t\t\t\t$fecha2 = $reservas[0]->getFechadesde();\n\t\t\t\t\t$interval = $hoy->diff($fecha2);\n\t\t\t\t\t$off = $interval->format('%R%a');\n\n\t\t\t\t\tif ($off == 0) {\n\t\t\t\t\t\tforeach ($reservas as $reserva) {\n\t\t\t\t\t\t\t$reserva->setEstadoReserva('Concretada');\n\t\t\t\t\t\t\t$reserva->getHabitacion()->setEstado('Ocupada');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$em->persist($reserva);\n\t\t\t\t\t\t$em->flush();\n\n\t\t\t\t\t\t$session->getFlashBag()->add('reserva_buenos', 'Se ha concretado tu reservación, haz hecho check in con nosotros! Yay... ya puede dirigirse a su habitación.');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$session->getFlashBag()->add('reserva_malos', 'Esta reserva debio ser concretada el '.$fecha2->format('D, d M Y').'. Las reservas deben ser concretadas el día para el cual fueron reservadas y no antes o despues.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$session->getFlashBag()->add('reserva_malos', 'Tal vez estás en drogas! Ese código no existe.');\t\n\t\t}\n\t\treturn $this->showAction($reservas[0]->getId());\n\t}", "public function saldo($link, $id_usuario){\n $bd13 = new bancoDeDados();\n $retorno = $bd13->saldo($link, $id_usuario);\n return $retorno;\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function salva()\n {\n $errori = $this->convalida();\n //se sono presenti errori di convalida\n if (count($errori) > 0) {\n //esco dalla funzione\n return false;\n }\n\n global $dbconn;\n\n $id_comune = addslashes($this->id_comune);\n $denominazione = addslashes($this->denominazione);\n $provincia = addslashes($this->provincia);\n $id_area = $this->id_area;\n $lat = $this->latitudine;\n $lng = $this->longitudine;\n\n $query = \"REPLACE INTO comuni(id_comune, denominazione, provincia, id_area, latitudine, longitudine)\n VALUES ('$id_comune', '$denominazione', '$provincia', $id_area, $lat, $lng)\";\n $comando = $dbconn->prepare($query);\n $esegui = $comando->execute();\n if ($esegui == true && $comando->rowCount() == 1) {\n return true;\n } else {\n return false;\n }\n }", "public function primerPago($nonce,$valor)\n {\n \n $status = $this->pasarela->transaction()->sale([\n 'amount' => $valor,\n 'paymentMethodNonce' => $nonce,\n 'customerId' => $this->cliente,\n 'options' => [\n 'submitForSettlement' => true,\n 'storeInVaultOnSuccess' => true,\n ]\n ]);\n return $status;\n }", "function balanceoCanales($canales){\n $id_carga=id_carga::where('estado',1)->where('estado_aprobado',1)->where('ejecucion',1)->get();\n if ($id_carga->count() > 1) {\n $total_canales = 0;\n foreach ($id_carga as $k) {\n echo \"\\nid_carga \" . $k->id_carga;\n $total_canales = $total_canales + $k->canales;\n if ($total_canales > $canales->canales) {\n $k->canales = 0;\n $k->save();\n }\n }\n\n echo \"\\ntotal canales de los id_carga: \" . $total_canales;\n echo \"\\ntotal canales disponibles para ivrs: \" . $canales->canales;\n echo \"\\ntotal id_carga: \" . $id_carga->count();\n\n\n //comentar solo para peru desde ecuador\n foreach ($id_carga as $k) {\n if (intval($k->canales) > 0 && intval($k->canales) < 10) {\n $k->canales = 0;\n $k->save();\n }\n }\n //comentar solo para peru desde ecuador\n\n if ($total_canales == $canales->canales) {\n $total_canales = $total_canales - 1;\n }\n\n if ($total_canales < $canales->canales) {\n echo \"\\nentro al if total canales <= canales\";\n $total_canales = intval($canales->canales);\n\n //sirve para dividir los canales para todas las campañas activas -> sirve para Perú desde ecuador\n //$acanales=intval(floor($canales->canales/$id_carga->count()));\n\n //comentar solo para peru desde ecuador\n //valida que el total de canales a distribuir sea igual o mayor a 10 canales por campaña\n $total_campanias = $id_carga->count();\n do {\n $acanales = intval(floor($canales->canales / $total_campanias));\n $total_campanias = $total_campanias - 1;\n echo \"\\nacanales: \" . $acanales;\n } while ($acanales < 10);\n //comentar solo para peru desde ecuador\n\n foreach ($id_carga as $k) {\n if ($acanales <= $total_canales) {\n echo \"\\nid carga por recibir canales: \" . $k->id_carga;\n echo \" - canales a recibir : \" . $acanales;\n $k->canales = $acanales;\n $k->save();\n }\n $total_canales = $total_canales - $acanales;\n echo \"\\ntotal_canales: \" . $total_canales;\n }\n\n //Si sobran canales le sumo a la primera campaña de la lista\n if ($total_canales > 0) {\n $id_final = $id_carga->first();\n $id_final->canales = $id_final->canales + $total_canales;\n $id_final->save();\n }\n }\n\n } elseif ($id_carga->count() == 1) {\n echo \"\\nentro al else\";\n $icarga = id_carga::where('estado', 1)->where('estado_aprobado', 1)->where('ejecucion', 1)->first();\n $icarga->canales = $canales->canales;\n $icarga->save();\n }\n //Fin balanceo de canales\n}", "public function testSaldoFinalDeSuprimentosDeFundosDoAtivoIgualAosControlesAComprovarEAAprovar() {\n $filterAtivo = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '1.1.3.1.1.02') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorAtivo = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filterAtivo);\n $saldoCredorAtivo = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filterAtivo);\n\n $filterAComprovar = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '8.9.1.2.1.01') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorAComprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filterAComprovar);\n $saldoCredorAComprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filterAComprovar);\n\n $filterAAprovar = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '8.9.1.2.1.02') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorAAprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filterAAprovar);\n $saldoCredorAAprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filterAAprovar);\n\n $this->comparar(($saldoDevedorAtivo - $saldoCredorAtivo), (($saldoCredorAComprovar - $saldoDevedorAComprovar) + ($saldoCredorAAprovar - $saldoDevedorAAprovar)));\n\n $this->saldoVerificado(__METHOD__, '1.1.3.1.1.02', '8.9.1.2.1.01', '8.9.1.2.1.02');\n }", "public function obtenerCant() {\n return ($this->cantcartas + 1);\n }", "public function movimienCompra($id_producto, $cantidad)\n {\n $mensaje = \" \";\n \n try {\n \n \n /* Primero hacemos una consulta SQL para sacar un array asosiativo y guardar lso datos que necesitamos */\n $conexion = conexion::conectar();\n $statement = $conexion->prepare('SELECT * FROM producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto));\n \n $resultado = $statement->fetch(PDO::FETCH_ASSOC);/* Se verifica si la consulta fue false/true, encontro algo o no */\n \n \n \n /* Aquí tomamos la cantidad del producto que hay antes de ser modificado */\n $_SESSION['cantidad'] = $resultado['cant_producto'];/* Array asociativo */\n \n \n /* Este solo es de prueba */\n $_SESSION['nom_producto'] = $resultado['nom_producto'];/* Array asociativo */\n \n \n \n \n /* -----DESCONTANDO PRODUTOS DE STOCK */\n \n /* Retamos la cantidad en stock - la que vamos a verder */\n $descuento = $_SESSION['cantidad'] + $cantidad;\n \n \n /* Y luego ya le pasamos ese resultado a una sentencia SQL para que lo modifique */\n $statement = $conexion->prepare('UPDATE producto SET cant_producto=:cant_producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto, ':cant_producto' => $descuento));\n \n \n $mensaje = \"La cantidad de \" . $_SESSION['nom_producto'] . \" es de: \" . $_SESSION['cantidad'] . \" con aumento queda en: \" . $descuento;\n } catch (PDOException $e) {\n \n echo \" el error es\" . $e->getMessage();\n }\n \n //$statement = null;\n return $mensaje;\n }", "public function ActualizarCantidadCajaTmp(){\n\t\tif(isset($_POST['ActualizarCantidadCajaTmp'])):\n\t\t\t$IdCajaTmp\t\t\t\t\t= filter_var($_POST['IdCajaTmp'], FILTER_VALIDATE_INT);\n\t\t\t$IdProducto\t\t\t\t\t= filter_var($_POST['IdProducto'], FILTER_VALIDATE_INT);\n\t\t\t$Cantidad\t\t\t\t\t= filter_var($_POST['Cantidad'], FILTER_VALIDATE_INT);\n\t\t\t$Precio\t\t\t\t\t\t= filter_var($_POST['Precio'], FILTER_SANITIZE_STRING);\n\t\t\t$AntiguaCantidad\t\t\t= filter_var($_POST['CantidadAnterior'], FILTER_VALIDATE_INT);\n\t\t\t\n\t\t\t$PrecioTotal\t\t\t\t= $Precio*$Cantidad;\n\t\t\t\n\t\t\t$ActualizarProductoQuery\t= $this->Conectar()->query(\"UPDATE `producto` SET `stock` = `stock`+{$AntiguaCantidad} WHERE `id`='{$IdProducto}'\");\n\t\t\t$ActulizarStockSql\t\t\t= $this->Conectar()->query(\"UPDATE `producto` SET `stock` = `stock`-{$Cantidad} WHERE `id`='{$IdProducto}'\");\n\t\t\t\n\t\t\t$StockProductoSql\t\t\t= $this->Conectar()->query(\"SELECT stock FROM `producto` WHERE id='{$IdProducto}'\");\n\t\t\t$StockProducto\t\t\t\t= $StockProductoSql->fetch_array();\n\t\t\t\n\t\t\t$StockTmp\t\t\t\t\t= $StockProducto['stock'];\n\t\t\t$ActualizarProductoTmpQuery\t= $this->Conectar()->query(\"UPDATE `cajatmp` SET `cantidad` = '{$Cantidad}' , `totalprecio` = '{$PrecioTotal}' , `stockTmp` = '{$StockTmp}', `stock` = '{$StockTmp}' WHERE `id` = '{$IdCajaTmp}'\");\n\n\t\t\tif($ActualizarProductoQuery && $ActulizarStockSql && $ActualizarProductoTmpQuery == true):\n\t\t\t\techo'\n\t\t\t\t<div class=\"alert alert-dismissible alert-success\">\n\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n\t\t\t\t\t<strong>&iexcl;Bien hecho!</strong> Se ha eliminado la venta actual con exito.\n\t\t\t\t</div>\n\t\t\t\t<meta http-equiv=\"refresh\" content=\"0;url='.URLBASE.'\"/>';\n\t\t\telse:\n\t\t\t\techo'\n\t\t\t\t<div class=\"alert alert-dismissible alert-danger\">\n\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n\t\t\t\t\t<strong>&iexcl;Lo Sentimos!</strong> A ocurrido un error al eliminar la venta actual, intentalo de nuevo.\n\t\t\t\t</div>\n\t\t\t\t<meta http-equiv=\"refresh\" content=\"0;url='.URLBASE.'\"/>';\n\t\t\tendif;\n\t\tendif;\n\t}", "public function updateCuenta($id_empresa, $saldo_carga, $saldo_mail, $saldo_sms ){\n $cuenta_corriente = $this->getCuentaEmpresa($id_empresa);\n\n $sql=\"INSERT INTO compra SET cantidad_sms =\" . $saldo_sms .\", cantidad_mail = \" . $saldo_mail . \", fecha = NOW(), valor = \" . $saldo_carga .\", id_cuenta_corriente =\" . $cuenta_corriente['id_cuenta_corriente'] . \", cantidad_creditos=\". ($saldo_sms + $saldo_mail);\n $this->admDB->query($sql);\n\n $mail_nuevo_total = ( $this->getSaldoEnviosMailHistorico($id_empresa) - $this->creditosConsumidosMail($id_empresa) );\n $sms_nuevo_total = ( $this->getSaldoEnviosSmsHistorico($id_empresa) - $this->creditosConsumidosSms($id_empresa) ) ;\n\n $saldo = $mail_nuevo_total + $sms_nuevo_total; \n $consulta = \"UPDATE cuenta_corriente SET saldo_credito = \" . $saldo . \",saldo_mail=\" . $mail_nuevo_total . \", saldo_sms=\" . $sms_nuevo_total . \" WHERE id_empresa = \" . $id_empresa;\n\n\n $result = $this->admDB->query($consulta);\n $aux = $result->num_rows;\n\n if ($aux > 0) {\n if ($saldo_sms > 0) {\n $this->restablecerSMS($id_empresa);\n }\n\n if ($saldo_mail > 0) {\n $this->restablecerMail($id_empresa);\n }\n\n return true;\n }else{\n return false;\n }\n \n }", "function recalcularIvaTot($idOrdenTot,$porcentajeIva, $porcentajeRetencion, $idIva = 2){//239 ejem 12.00 $porcentajeRetencion = 0, 75, 100 si es 0 NO hacer nada\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$idIva = 2 es 12:00 puede haber mas registrados pero ese es por defecto\n\tmysql_query(\"START TRANSACTION\");\n\t//tomo informacion para calcular, tot, y factura si la posee, sino solo calcula tot\n\t$queryFactura = \"SELECT id_factura, monto_subtotal, ROUND((monto_subtotal * (\".$porcentajeIva.\"/100)), 2) as sub_total_iva\n\t\t\t\t\t FROM sa_orden_tot WHERE id_orden_tot = \".$idOrdenTot.\" LIMIT 1\";\n\t$rsFactura = mysql_query($queryFactura);\n\tif(!$rsFactura) { return \"Error query id factura en orden: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t$rowFacatura = mysql_fetch_assoc($rsFactura);\n\t$idFactura = $rowFacatura[\"id_factura\"];\n\t$subtotalTot = $rowFacatura[\"monto_subtotal\"];//el subtotal debe estar ya en cp factura y en totiva\n\t$subtotalIva = $rowFacatura[\"sub_total_iva\"];// se inserta en totiva\n\t\n\t//actualizo el tot con el nuevo iva\n\t$queryActualizarTot = \"UPDATE sa_orden_tot SET monto_exento = 0.00, monto_total = ROUND((monto_subtotal * (\".$porcentajeIva.\")/100) + monto_subtotal, 2) \n\t\t\t\t\t\tWHERE id_orden_tot = \".$idOrdenTot.\"\";\n\t$actualizarTot = mysql_query($queryActualizarTot);\n\tif(!$actualizarTot) { return \"Error query id factura en orden: <br>\".__LINE__.\"<br> Error: \".mysql_error(); } //importante sino afected rows devolvera -1\n\t$actualizoTot = mysql_affected_rows(); //OJO MYSQL COMPRUEBA SI SON IGUALES ANTES DE ACTUALIZAR, SI SON IGUALES NO ACTUALIZA Y MANDA 0\n\t\n\t//compruebo si el tot tiene detalles con monto individual, sino tiene es un monto total\n\t$queryDetalleTot = \"SELECT * FROM sa_orden_tot_detalle WHERE id_orden_tot = \".$idOrdenTot.\" AND monto IS NOT NULL\";\n\t$detalleTot = mysql_query($queryDetalleTot);\n\tif(!$detalleTot) { return \"Error query seleccion tot detalle: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\tif(mysql_num_rows($detalleTot)){ return \"El tot posee detalles con monto, varificar y buscar otra forma de proceder\"; }\n\t\n\t//para comprobar si tiene iva el tot\n\t$queryTotIva = \"SELECT * FROM sa_orden_tot_iva WHERE id_orden_tot = \".$idOrdenTot.\"\";\n\t$itemsTotIva = mysql_query($queryTotIva);\n\tif(!$itemsTotIva) { return \"Error query seleccion iva de tot: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t$tieneIvaTot = mysql_num_rows($itemsTotIva);\n\t\n\tif($tieneIvaTot){ //si tiene iva no se puede recalcular, modificar o eliminar para luego calcular\n\t\treturn \"El tot ya tiene iva registrado en detalle\"; \n\t}else{//agrego el iva al tot 1 solo iva\n\t\t$queryIvaTot = \"INSERT INTO sa_orden_tot_iva (id_orden_tot, base_imponible, subtotal_iva, id_iva, iva) \n\t\t\t\t\t\tVALUES (\".$idOrdenTot.\", \".$subtotalTot.\", \".$subtotalIva.\", \".$idIva.\", \".$porcentajeIva.\")\";\n\t\t$agregarIvaTot = mysql_query($queryIvaTot);\n\t\tif(!$agregarIvaTot) { return \"Error query ins iva de tot: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t$insertoIvaTot = mysql_affected_rows();\n\t}\n\t\n\t//si posee factura, calcular ivas en factura y en retencion\n\tif($idFactura && $porcentajeRetencion){\n\t\t\n\t\t//compruebo si la factura tiene iva\n\t\t$queryIvaFacturaDetalle = \"SELECT * FROM cp_factura_iva WHERE id_factura = \".$idFactura.\"\";\n\t\t$ivaFacturaDetalle = mysql_query($queryIvaFacturaDetalle);\n\t\tif(!$ivaFacturaDetalle) { return \"Error query selec iva de factura: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t$tieneIvaFactura = mysql_num_rows($ivaFacturaDetalle);\n\t\t\n\t\tif($tieneIvaFactura){ //si tiene iva no se puede recalcular, hacerlo manual o eliminar para generarlo\n\t\t\treturn \"La factura ya tiene iva\"; \n\t\t}else{//sino posee genera el iva\n\t\t\t$queryIvaFactura = \"INSERT INTO cp_factura_iva (id_factura, base_imponible, subtotal_iva, id_iva, iva) \n\t\t\t\t\t\t\t\t\t\t\tVALUES (\".$idFactura.\", \".$subtotalTot.\", \".$subtotalIva.\", \".$idIva.\", \".$porcentajeIva.\")\";\n\t\t\t$agregarIvaFactura = mysql_query($queryIvaFactura);\n\t\t\tif(!$agregarIvaFactura) { return \"Error query ins iva de factura: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t\t$insertoIvaFactura = mysql_affected_rows();\n\t\t}\n\t\t\n\t\t//compruebo el detalle de la retencion\n\t\t$queryRetencionDetalle = \"SELECT * FROM cp_retenciondetalle WHERE idFactura = \".$idFactura.\"\";\n\t\t$retencionDetalle = mysql_query($queryRetencionDetalle);\n\t\tif(!$retencionDetalle) { return \"Error query select retencion detalle: <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t$cantidadRetencionDetalle = mysql_num_rows($retencionDetalle);\n\t\t\n\t\tif($cantidadRetencionDetalle == 1){//si solo es uno lo actualizo los montos\n\t\t\t$rowRetencionDetalle = mysql_fetch_assoc($retencionDetalle);\n\t\t\t$queryActualizarRetencionDetalle = \"UPDATE cp_retenciondetalle SET\n\t\t\t\t\t\t\t\t\t\t\t\ttotalCompraIncluyendoIva = ROUND(baseImponible + (baseImponible * (\".$porcentajeIva.\"/100)),2),\n\t\t\t\t\t\t\t\t\t\t\t\timpuestoIva = ROUND(baseImponible * (\".$porcentajeIva.\"/100),2),\n\t\t\t\t\t\t\t\t\t\t\t\tIvaRetenido = ROUND((baseImponible * (\".$porcentajeIva.\"/100)) * (porcentajeRetencion / 100),2),\n\t\t\t\t\t\t\t\t\t\t\t\tporcentajeAlicuota = \".$porcentajeIva.\"\n\t\t\t \t\t\t\t\t\t\t\t\tWHERE idFactura = \".$idFactura.\"\";\n\t\t\t$actualizarRetencionDetalle = mysql_query($queryActualizarRetencionDetalle);\n\t\t\tif(!$actualizarRetencionDetalle) { return \"Error query update retencion detalle : <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t\t$actualizoRetencion = mysql_affected_rows();\n\t\t\t\n\t\t\t//despues de actualizar tomo el monto del iva retenido\n\t\t\t$queryBuscarRetencion = \"SELECT IvaRetenido FROM cp_retenciondetalle WHERE idFactura = \".$idFactura.\"\";\n\t\t\t$buscarRetencion = mysql_query($queryBuscarRetencion);\n\t\t\tif(!$buscarRetencion) { return \"Error query select buscar retencion detalle : <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t\t$rowBuscarRetencion = mysql_fetch_assoc($buscarRetencion);\n\t\t\t$ivaRetenido = $rowBuscarRetencion[\"IvaRetenido\"];\n\t\t\t\n\t\t\t//reviso los pagos si tiene 1 lo actualizo, sino proceder manual\n\t\t\t$queryDocumentoPago = \"SELECT * FROM cp_pagos_documentos WHERE id_documento_pago = \".$idFactura.\" AND tipo_documento_pago = 'FA' AND tipo_pago = 'RETENCION'\";\n\t\t\t$documentoPago = mysql_query($queryDocumentoPago);\n\t\t\tif(!$documentoPago) { return \"Error query select documento pago : <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t\t$cantidadDocumentoPago = mysql_num_rows($documentoPago);\n\t\t\t\n\t\t\tif($cantidadDocumentoPago == 1){//si tiene solo 1 lo actualizo\n\t\t\t\t$queryActualizarDocumentoPago = \"UPDATE cp_pagos_documentos SET monto_cancelado = \".$ivaRetenido.\" WHERE id_documento_pago = \".$idFactura.\" AND tipo_documento_pago = 'FA' AND tipo_pago = 'RETENCION'\";\n\t\t\t\t$actualizarDocumentoPago = mysql_query($queryActualizarDocumentoPago);\n\t\t\t\tif(!$actualizarDocumentoPago) { return \"Error query select documento pago : <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t\t\t$actualizoDocumentoPago = mysql_affected_rows();\n\t\t\t\t\n\t\t\t\t//actualizo los montos en factura\n\t\t\t\t$queryActualizaFactura = \"UPDATE cp_factura SET estatus_factura = 2, monto_exento = 0.00, saldo_factura = ROUND(subtotal_factura - \".$ivaRetenido.\",2) \n\t\t\t\t\t\t\t\tWHERE id_factura = \".$idFactura.\"\"; //0 = No Cancelado, 1 = Cancelado, 2 = Parcialmente Cancelado\n\t\t\t\t$actualizaFactura = mysql_query($queryActualizaFactura);\n\t\t\t\tif(!$actualizaFactura) { return \"Error query update factura : <br>\".__LINE__.\"<br> Error: \".mysql_error(); }\n\t\t\t\t$actualizoFactura = mysql_affected_rows();\n\t\t\t\t\n\t\t\t\t\t//FINAL compruebo que todo se ejecuto correctamente\n\t\t\t\t\tif($actualizoTot && $insertoIvaTot && $insertoIvaFactura && $actualizoRetencion && $actualizoDocumentoPago && $actualizoFactura){\n\t\t\t\t\t\tmysql_query(\"COMMIT\");\n\t\t\t\t\t\treturn \"Actualizado Correctamente\";\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmysql_query(\"ROLLBACK\");\n\t\t\t\t\t\treturn \"Hubo un error, no se pudo actualizar\";\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}elseif($cantidadDocumentoPago > 1){//si tiene mas se debe actualizar manualmente\n\t\t\t\treturn \"La factura tiene mas de un documento de pago\";\n\t\t\t}else{//sino posee no se puede actualizar\n\t\t\t\treturn \"La factura no posee documento de pago\";\n\t\t\t}\n\t\t\t\n\t\t}elseif($cantidadRetencionDetalle > 1){//si tiene mas de una retencion hacerla manual\n\t\t\treturn \"La factura tiene mas de una retencion\";\t\n\t\t}else{//sino posee retencion no se puede actualizar montos\n\t\t\treturn \"La factura no posee retencion\";\n\t\t}\n\t\t\n\t}else{//sino posee factura solo actualizo el tot y el iva tot\n\t\tif($actualizoTot && $insertoIvaTot){ mysql_query(\"COMMIT\"); return \"Se actualizo el tot y el iva tot, no posee factura\"; }\n\t}\n\t\n}", "function no_bankrupt($cash, $cost) {\n\tif ($cash - $cost < 0) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function _validarHelado()\n {\n $listaHelados = Helado::_traerHelados();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n if($this->_precio < 0 || $this->_tipo != \"agua\" && $this->_tipo != \"crema\" || $this->_cantidad < 0)\n {\n return 1;\n }\n foreach($listaHelados as $helado)\n { \n if($this->_sabor == $helado->_sabor && $this->_tipo == $helado->_tipo)\n {\n $helado->_cantidad = $this->_cantidad;\n $helado->_precio = $this->_precio;\n Helado::_actualizarHelado($listaHelados);\n $retorno = 0;\n break;\n }\n }\n return $retorno;\n }", "static public function ctrCrearCcuerpo(){\n\n if(isset($_POST[\"nuevoCcuerpo\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\- ]+$/', $_POST[\"nuevoCcuerpo\"])){\n\n\t\t\t\t$tabla = \"cuartel_cuerpos\";\n\n\t\t\t\t$datos = array(\"tipo_sep\"=> $_POST[\"nuevoTproducto\"],\n \"nombre\"=> $_POST[\"nuevoCcuerpo\"],\n \"id_sociedad\" => '0',\n \"id_cementerio\"=> $_POST[\"nuevoCementerio\"]);\n\n\t\t\t\t$respuesta = ModeloCcuerpo::mdlIngresarCcuerpo($tabla, $datos);\n print_r($respuesta);\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El Cuartel-Cuerpo ha sido guardado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El Cuartel-Cuerpo no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "private function eliminarCita(){\n $query = \"UPDATE \" . $this->table . \" SET estado = 'Inactivo' WHERE CitaId = '\" . $this->idcita . \"'\";\n $resp = parent::nonQuery($query);\n if($resp >= 1 ){\n return $resp;\n }else{\n return 0;\n }\n }", "public function testSePuedeCrearyObtenerElSalario(){\n\t\t\t$emp = $this->crear();\n\t\t\t$this->assertEquals(3500,$emp->getSalario());\n\t\t}", "function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }", "public function testSaldoFinalDeParceriasAApropriarDoAtivoIgualAosControlesAComprovarEAAprovar() {\n $filterAtivo = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '1.1.9.8.1.01') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorAtivo = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filterAtivo);\n $saldoCredorAtivo = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filterAtivo);\n\n $filterAComprovar = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '8.1.2.2.1.01.02') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorAComprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filterAComprovar);\n $saldoCredorAComprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filterAComprovar);\n\n $filterAAprovar = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '8.1.2.2.1.01.03') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorAAprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filterAAprovar);\n $saldoCredorAAprovar = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filterAAprovar);\n\n $this->comparar(($saldoDevedorAtivo - $saldoCredorAtivo), (($saldoCredorAComprovar - $saldoDevedorAComprovar) + ($saldoCredorAAprovar - $saldoDevedorAAprovar)));\n\n $this->saldoVerificado(__METHOD__, '1.1.9.8.1.01', '8.1.22.1.01.02', '8.1.2.2.1.01.03');\n }", "public function sacar() {\n if ($this->cantcartas == -1)\n return FALSE;\n $this->cantcartas--;\n return $this->cajita[($this->cantcartas + 1)];\n }", "static function esCedulaValida($numero) {\r\n if (strlen($numero) == 0) {\r\n return FALSE;\r\n }\r\n $resultado = \"\";\r\n $suma = 0;\r\n $residuo = 0;\r\n $pri = false;\r\n $pub = false;\r\n $nat = false;\r\n $numeroProvincias = 22;\r\n $modulo = 11;\r\n\r\n /* Aqui almacenamos los digitos de la cedula en variables. */\r\n $d1 = substr($numero, 0, 1);\r\n $d2 = substr($numero, 1, 1);\r\n $d3 = substr($numero, 2, 1);\r\n $d4 = substr($numero, 3, 1);\r\n $d5 = substr($numero, 4, 1);\r\n $d6 = substr($numero, 5, 1);\r\n $d7 = substr($numero, 6, 1);\r\n $d8 = substr($numero, 7, 1);\r\n $d9 = substr($numero, 8, 1);\r\n $d10 = substr($numero, 9, 1);\r\n\r\n $p1 = 0;\r\n $p2 = 0;\r\n $p3 = 0;\r\n $p4 = 0;\r\n $p5 = 0;\r\n $p6 = 0;\r\n $p7 = 0;\r\n $p8 = 0;\r\n $p9 = 0;\r\n\r\n /* El tercer digito es: */\r\n /* 9 para sociedades privadas y extranjeros */\r\n /* 6 para sociedades publicas */\r\n /* menor que 6 (0,1,2,3,4,5) para personas naturales */\r\n\r\n if ($d3 == 7 || $d3 == 8) {\r\n $resultado = '0';\r\n }\r\n\r\n /* Solo para personas naturales (modulo 10) */\r\n if ($d3 < 6) {\r\n $nat = true;\r\n $p1 = $d1 * 2;\r\n if ($p1 >= 10)\r\n $p1 -= 9;\r\n $p2 = $d2 * 1;\r\n if ($p2 >= 10)\r\n $p2 -= 9;\r\n $p3 = $d3 * 2;\r\n if ($p3 >= 10)\r\n $p3 -= 9;\r\n $p4 = $d4 * 1;\r\n if ($p4 >= 10)\r\n $p4 -= 9;\r\n $p5 = $d5 * 2;\r\n if ($p5 >= 10)\r\n $p5 -= 9;\r\n $p6 = $d6 * 1;\r\n if ($p6 >= 10)\r\n $p6 -= 9;\r\n $p7 = $d7 * 2;\r\n if ($p7 >= 10)\r\n $p7 -= 9;\r\n $p8 = $d8 * 1;\r\n if ($p8 >= 10)\r\n $p8 -= 9;\r\n $p9 = $d9 * 2;\r\n if ($p9 >= 10)\r\n $p9 -= 9;\r\n $modulo = 10;\r\n }\r\n\r\n /* Solo para sociedades publicas (modulo 11) */\r\n /* Aqui el digito verficador esta en la posicion 9, en las otras 2 en la pos. 10 */\r\n else {\r\n if ($d3 == 6) {\r\n $pub = true;\r\n $p1 = $d1 * 3;\r\n $p2 = $d2 * 2;\r\n $p3 = $d3 * 7;\r\n $p4 = $d4 * 6;\r\n $p5 = $d5 * 5;\r\n $p6 = $d6 * 4;\r\n $p7 = $d7 * 3;\r\n $p8 = $d8 * 2;\r\n $p9 = 0;\r\n } else {\r\n /* Solo para entidades privadas (modulo 11) */\r\n if ($d3 == 9) {\r\n $pri = true;\r\n $p1 = $d1 * 4;\r\n $p2 = $d2 * 3;\r\n $p3 = $d3 * 2;\r\n $p4 = $d4 * 7;\r\n $p5 = $d5 * 6;\r\n $p6 = $d6 * 5;\r\n $p7 = $d7 * 4;\r\n $p8 = $d8 * 3;\r\n $p9 = $d9 * 2;\r\n }\r\n }\r\n }\r\n $suma = $p1 + $p2 + $p3 + $p4 + $p5 + $p6 + $p7 + $p8 + $p9;\r\n $residuo = $suma % $modulo;\r\n\r\n /* Si residuo=0, dig.ver.=0, caso contrario 10 - residuo */\r\n if ($residuo == 0)\r\n $digitoVerificador = 0;\r\n else\r\n $digitoVerificador = $modulo - $residuo;\r\n\r\n /* ahora comparamos el elemento de la posicion 10 con el dig. ver. */\r\n if ($pub == true) {\r\n if ($digitoVerificador != $d9) {\r\n $resultado = '0';\r\n }\r\n /* El ruc de las empresas del sector publico terminan con 0001 */\r\n if (substr($numero, 9, 4) != '0001') {\r\n $resultado = '0';\r\n }\r\n } else {\r\n if ($pri == true) {\r\n if ($digitoVerificador != $d10) {\r\n $resultado = '0';\r\n }\r\n if (substr($numero, 10, 3) != '001') {\r\n $resultado = '0';\r\n }\r\n } else {\r\n if ($nat == true) {\r\n if ($digitoVerificador != $d10) {\r\n $resultado = '0';\r\n }\r\n if (strlen($numero) > 10 && substr($numero, 10, 3) != '001') {\r\n $resultado = '0';\r\n }\r\n }\r\n }\r\n }\r\n if ($resultado == \"\") {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function userCadConfirm($codConfirmacao=''){\n \n\n \n if($codConfirmacao==''){//se em branco retorna NULL (erro)\n \n \n return null;\n \n }else{//caso codigo informado procede com a conferencia e a ativacao\n \n \n \n $sql = new Sql();\n $ativacao = $sql->select('SELECT * FROM usuarios \n WHERE cod_ativacao_usuario = :cod_ativacao_usuario',\n array(':cod_ativacao_usuario'=>$codConfirmacao)); \n \n if(count($ativacao)==0){\n \n \n return null;//caso nada encontrado retorna NULL (deve pode ser um codigo invalido)\n \n }elseif(count($ativacao)>0){//caso codigo de confirmacao for OK entao ativa o cadastro\n \n \n //obtem o id do usuario\n $id_usuario = $ativacao[0]['id_usuario'];\n \n \n //verifica se existe a necessidade de ativacao\n if($ativacao[0]['status_usuario']==1){//cadastro JA ATIVO basta notificar\n \n return true;//retorna true confirmando que o cadastro esta atualizado \n \n }elseif($ativacao[0]['status_usuario']==0){//CASO INATIVO ENTÃO PROCEDE COM A ATIVACAO\n \n //atualiza o cadastro do usuario ativando ele\n $res = $sql->query('UPDATE usuarios SET status_usuario = 1\n WHERE id_usuario = :id_usuario',\n array(':id_usuario'=>$id_usuario));\n \n if($res>0){//se o numero de linhas afetadas for maior que ZERO\n \n return true;//retorna true confirmando que o cadastro esta atualizado\n \n }else{\n return false;//caso nada encontrado retorna FALSE (pode ter ocorrido erro na atualizacao)\n\n }\n }\n } \n }\n }", "function valorDoBtcComEncargos($param_valor)\n{\n\n//pega o btc e soma valor final do btc com todos encargos\n\n\t$percentual = 0.70 / 100.0; // 15%\n\t$valor_final = $param_valor + ($percentual * $param_valor);\n\t//comissoes 1,99 + 2,90\n\t$percentual2 = 2.0 / 100.0;\n\t$valorTotal = $percentual2 * $param_valor;\n\t\n\t\n\t\n\t$finalTodos = $valor_final + $valorTotal + 3;\n\n\t\treturn $finalTodos;\n}", "static public function mdlActualizarTotalesPedido($datos){\n\n\t\t$sql=\"UPDATE\n\t\t\t\t\ting_sal\n\t\t\t\tSET\n\t\t\t\t\tcliente = :cliente,\n\t\t\t\t\top_gravada = :op_gravada,\n\t\t\t\t\tdescuento_total = :descuento_total,\n\t\t\t\t\tsub_total = :sub_total,\n\t\t\t\t\tigv = :impuesto,\n\t\t\t\t\ttotal = :total,\n\t\t\t\t\tcondicion_venta = :condicion_venta,\n\t\t\t\t\tagencia = :agencia,\n\t\t\t\t\testado = 'GENERADO',\n\t\t\t\t\tusuario = :usuario\n\t\t\t\tWHERE codigo = :codigo\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n\t\t$stmt->bindParam(\":cliente\", $datos[\"cliente\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":op_gravada\", $datos[\"op_gravada\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":descuento_total\", $datos[\"descuento_total\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":sub_total\", $datos[\"sub_total\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":impuesto\", $datos[\"impuesto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":total\", $datos[\"total\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":condicion_venta\", $datos[\"condicion_venta\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":agencia\", $datos[\"agencia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":usuario\", $datos[\"usuario\"], PDO::PARAM_STR);\n\n if($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\n\t\t}\n\n\t\t$stmt=null;\n\n\t}", "public function salvar() {\n \t\n \tif (!db_utils::inTransaction()) {\n \t\tthrow new DBException('Não existe Transação Ativa');\n \t}\n \t\n \t$oDaoNotaIss = db_utils::getDao('notasiss');\n \t$oDaoNotaIss->q09_codigo = $this->iCodigo;\n \t$oDaoNotaIss->q09_nota = $this->sTipo;\n \t$oDaoNotaIss->q09_descr = $this->sDescricao;\n \t$oDaoNotaIss->q09_gruponotaiss = $this->iGrupo;\n \t\n \t/**\n \t * Verifica se já foi indormado algum codigo. Se já foi informada \n \t * realiza update caso contrário realiza insert\n \t */\n if (empty($this->iCodigo)) {\n\n \t\t$oDaoNotaIss->incluir(null);\n $this->iCodigo = $oDaoNotaIss->q09_codigo;\n\n \t} else {\n \t\t$oDaoNotaIss->alterar($this->iCodigo);\n \t}\n \t\n \tif ($oDaoNotaIss->erro_status == '0') {\n \t\tthrow new DBException($oDaoNotaIss->erro_msg);\n \t}\n \t\n \treturn true;\n }", "function generar_estado_codigo()\n\t{\n\t\t$this->manejador_interface->mensaje(\"Calculando revisiones {$this->identificador} \" , false);\n\t\t$this->generar_checksum();\n\n\t\t//Esto simplemente se calcula para darle una idea al pobre chango de cual\n\t\t//fue la ultima revision que cargo en la base,util para el revert\n\t\t$svn = new toba_svn();\n\t\tif ($svn->hay_cliente_svn()) {\n\t\t\t$max_rev = 0;\n\t\t\t$revisiones = $svn->get_revisiones_dir_recursivos($this->get_dir_dump());\n\t\t\t$max_rev = 0;\n\t\t\tif (! empty($revisiones)) {\n\t\t\t\tforeach($revisiones as $revision) {\n\t\t\t\t\tif (isset($revision['error'])) {\n\t\t\t\t\t\tthrow new toba_error_def($revision['error']);\n\t\t\t\t\t}\n\t\t\t\t\tif ($max_rev < intval($revision['revision'])) {\n\t\t\t\t\t\t$max_rev = intval($revision['revision']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->manejador_interface->progreso_avanzar();\n\t\t\t$this->instancia->set_revision_proyecto($this->identificador, $max_rev);\n\t\t}\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "public static function calcular_costo_promedio($id_bodega,$id_producto,$valor_default, $fecha_transaccion, $cantidad)\n {\n\n // NOTA: Ya el registro del item está agregado en el movimiento\n\n $array_wheres = [\n ['inv_movimientos.inv_producto_id','=',$id_producto],\n ['inv_movimientos.fecha', '<=', $fecha_transaccion]\n ];\n\n if ( (int)config('inventarios.maneja_costo_promedio_por_bodegas') == 1 ) {\n $array_wheres = array_merge( $array_wheres, [ ['inv_movimientos.inv_bodega_id','=',$id_bodega] ] );\n }\n\n // COSTO PROMEDIO PONDERADO\n\n // NOTA: EL COSTO SE CALCULA TENIENDO EN CUENTA LA FECHA DE INGRESO DE LA TRANSACCION, SOLO SE TIENE EN CUENTA LA SUMATORIA DESDE LA FECHA DE LA TRANSACCIÓN HACIA ATRÁS\n $costo_prom = InvMovimiento::where( $array_wheres )\n ->select(DB::raw('(sum(inv_movimientos.costo_total)/sum(inv_movimientos.cantidad)) AS Costo'))\n ->get()\n ->toArray();\n\n $cant = InvMovimiento::where( $array_wheres )\n ->select(DB::raw('sum(inv_movimientos.cantidad) AS cantidad_total'))\n ->get()\n ->toArray();\n\n if ($cant[0]['cantidad_total'] <= 0 ) {\n $costo_prom = $valor_default;\n }else{\n $costo_prom = $costo_prom[0]['Costo'];\n }\n \n return $costo_prom;\n }", "private function checkSalary() \r\n\t{\r\n\t\t$query = \"SELECT sledeca_plata \r\n\t\tFROM \" . $this->table . \" \r\n\t\tWHERE id_radnik = ?\";\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\r\n\t\t$stmt->bindParam(1, $this->id_radnik);\r\n\r\n\t\t$stmt->execute();\r\n\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t$this->sledeca_plata = $row['sledeca_plata'];\r\n\r\n\t\t$today_time = new DateTime(date(\"Y/m/d\"));\r\n\t\t$expire_time = new DateTime($this->sledeca_plata);\r\n\r\n\t\tif ($today_time > $expire_time) {\r\n\t\t\t$this->id_plata = self::UNPAID;\r\n\t\t\t$update_query = \"UPDATE \" . $this->table . \" SET id_plata = ? \r\n\t\t\tWHERE id_radnik = ?\";\r\n\t\t\t$stmt_up = $this->conn->prepare($update_query);\r\n\r\n\t\t\t$stmt_up->bindParam(1,$this->id_plata);\r\n\r\n\t\t\t$stmt_up->bindParam(2,$this->id_radnik);\r\n\r\n\t\t\t\t$stmt_up->execute();\r\n\t\t} else {\r\n\t\t\t$this->id_plata = self::PAID; \r\n\t\t\t$update_query = \"UPDATE \" . $this->table . \" SET id_plata = ? \r\n\t\t\tWHERE id_radnik = ?\";\r\n\t\t\t$stmt_up = $this->conn->prepare($update_query);\r\n\r\n\t\t\t$stmt_up->bindParam(1,$this->id_plata);\r\n\r\n\t\t\t$stmt_up->bindParam(2,$this->id_radnik);\r\n\r\n\t\t\t$stmt_up->execute();\r\n\t\t}\r\n\t\treturn $this->id_plata;\r\n\t}", "public function atualizar($cliente){\r\n\t\tinclude(\"../config/conexao.php\");\r\n\t\t$sql = 'UPDATE cliente SET n_casa = :n_casa, rua = :rua, bairro = :bairro, cidade = :cidade, estado = :estado, pais = :pais, cep = :cep, data_nasc = :data_nasc, nome = :nome, tel_celular = :tel_celular, tel_fixo = :tel_fixo, email = :email WHERE cod = :cod';\r\n\t\t$consulta = $pdo->prepare($sql);\r\n\t\t$consulta->bindValue(':cod',$cliente->getCod()); \r\n\t\t$consulta->bindValue(':n_casa',$cliente->getN_casa()); \r\n\t\t$consulta->bindValue(':rua',$cliente->getRua()); \r\n\t\t$consulta->bindValue(':bairro',$cliente->getBairro()); \r\n\t\t$consulta->bindValue(':cidade',$cliente->getCidade()); \r\n\t\t$consulta->bindValue(':estado',$cliente->getEstado()); \r\n\t\t$consulta->bindValue(':pais',$cliente->getPais()); \r\n\t\t$consulta->bindValue(':cep',$cliente->getCep()); \r\n\t\t$consulta->bindValue(':data_nasc',$cliente->getData_nasc()); \r\n\t\t$consulta->bindValue(':nome',$cliente->getNome()); \r\n\t\t$consulta->bindValue(':tel_celular',$cliente->getTel_celular()); \r\n\t\t$consulta->bindValue(':tel_fixo',$cliente->getTel_fixo()); \r\n\t\t$consulta->bindValue(':email',$cliente->getEmail()); \r\n\t\tif($consulta->execute())\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function descontar_insumo($objeto) {\n\t\tsession_start();\n\t// Obtiene el almacen\n\t\t$almacen = \"SELECT\n\t\t\t\t\t\ta.id\n\t\t\t\t\tFROM\n\t\t\t\t\t\tadministracion_usuarios au\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\tapp_almacenes a\n\t\t\t\t\t\tON\n\t\t\t\t\t\t\ta.id_sucursal = au.idSuc\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tau.idempleado = \" . $_SESSION['accelog_idempleado'] . \"\n\t\t\t\t\tLIMIT 1\";\n\t\t$almacen = $this -> queryArray($almacen);\n\t\t$almacen = $almacen['rows'][0]['id'];\n\n\t// Valida que exista el almacen\n\t\t$almacen = (empty($almacen)) ? 1 : $almacen;\n\n\t\t$sql = \"INSERT INTO\n\t\t\t\t\tapp_inventario_movimientos\n\t\t\t\t\t\t(id_producto, cantidad, importe, id_almacen_origen, fecha, id_empleado,\n\t\t\t\t\t\ttipo_traspaso, costo, referencia)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t('\" . $objeto['idProducto'] . \"', '\" . $objeto['cantidad'] . \"', '\" . $objeto['importe'] . \"',\n\t\t\t\t\t\t'\" . $almacen . \"', '\" . $objeto['fecha'] . \"', '\" . $_SESSION['accelog_idempleado'] . \"', 0,\n\t\t\t\t\t\t'\" . $objeto['costo'] . \"', 'Preparacion \" . $objeto['id_preparacion'] . \"')\";\n\t\t$result = $this -> query($sql);\n\n\t\treturn $result;\n\t}", "public function testCashOutLegalCommissionMin(): void\n {\n $user = new User(2, 'legal');\n $transaction = new Transaction();\n\n $transaction->date = '2019-02-25';\n $transaction->type = 'cash_out';\n $transaction->amount = 100;\n $transaction->currency = 'EUR';\n $transaction->user = $user;\n\n $this->assertSame($this->app['managers']['commission']->calculateCommission($transaction), '0.50');\n }", "public function crear(array &$datos): bool\n\t{\n\t\t$datos['CPRODUCTOFS'] = $this->obtenerNuevoID();\n\t\t$datos['CUSUARIOMODIFICA'] = null;\n\t\t$datos['TMODIFICACION'] = null;\n\t\t$res = $this->db->insert('MPRODUCTOCLIENTE', $datos);\n\t\tif (!$res) {\n\t\t\tthrow new Exception('El Producto no pudo ser creado correctamente.');\n\t\t}\n\t\treturn $res;\n\t}", "function cf_cashbank_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\t// debug($params);\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\t$str = \"SELECT (net_amount - (select coalesce(sum(amount),0) from cf_cashbank_line t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "static Public function MdlActualizaAlmacen($tabla, $campo, $valor1, $valor2, $idUsuario){\n\n $stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET cant=cant+(:cant), ultusuario=:ultusuario WHERE id_producto = :id_producto\");\n $stmt->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n $stmt->bindParam(\":cant\", $valor2, PDO::PARAM_INT);\n $stmt->bindParam(\":ultusuario\", $idUsuario, PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt = null;\n\n}", "function ventaClienteDAO($idUltimo, $cliente, $estado){\n $conexion = Conexion::crearConexion();\n $exito = false;\n try {\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stm = $conexion->prepare(\"INSERT INTO cliente_salida(id_venta, id_persona, estado) VALUES (?,?,?)\");\n $stm->bindParam(1, $idUltimo, PDO::PARAM_STR);\n $stm->bindParam(2, $cliente, PDO::PARAM_STR);\n $stm->bindParam(3, $estado, PDO::PARAM_STR);\n $exito = $stm->execute();\n } catch (Exception $ex) {\n throw new Exception(\"Error al registrar la salida en tabla cliente_salida\");\n }\n return $exito;\n }", "function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }", "public function Registrar_Licencia_noRemunerada3(HojaVida $data) {\n $modelo = new HojaVida();\n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n \n if($data->lic_id_tipo == 5) \n { // Licencia 3 meses\n $tiporegistro = \"Solicitud Licencia no Remunerada (3 Meses)\";\n }\n else\n {\n $tiporegistro = \"Solicitud Licencia no Remunerada hasta por 2 años\";\n }\n\n $accion = \"Registra una Nueva \".$tiporegistro.\" En el Sistema TALENTO HUMANO\";\n $detalle = $_SESSION['nombre'].\" \".$accion.\" \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n $idusuario = $_SESSION['idUsuario']; // idusuario que registra la solicitud de licencia\n \n $per_DI_other = $_POST['cedula_other'];\n $per_name_other = $_POST['nombre_other'];\n if($per_DI_other != \"\" && $per_name_other != \"\")\n {\n $id_usuario_soli = $_POST['id_servidor']; // id del usuario que solicita la licencia\n $cedula_solicitante = $_POST['cedula_other'];\n $nombre_solicitante = $_POST['nombre_other'];\n $cargo_solicitante = $_POST['cargo_servidor'];\n }\n else\n {\n $id_usuario_soli = $_SESSION['idUsuario']; // id del usuario que solicita la licencia\n $cedula_solicitante = $_SESSION['nomusu'];\n $nombre_solicitante = $_SESSION['nombre'];\n $cargo_solicitante = $_SESSION['cargo'];\n }\n try {\n\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\t\t\n //EMPIEZA LA TRANSACCION\n $this->pdo->beginTransaction();\n \n $sql = \"INSERT INTO `th_licencias_no_remunerada`(\n `lic_no_rem_id_tipo_resolucion`, \n `lic_no_rem_fecha_solicitud`, \n `lic_no_rem_fecha_escrito`, \n `lic_no_rem_cedula_servidor`, \n `lic_no_rem_nombre_servidor`, \n `lic_no_rem_fecha_inicio`, \n `lic_no_rem_fecha_fin`, \n `lic_no_rem_motivo`, \n `lic_no_rem_id_user`, \n `lic_no_rem_estado`,\n `lic_no_rem_ruta_doc_escrito`, \n `lic_no_rem_id_user_registra`, \n `lic_no_rem_cargo_cs`) \n VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n $this->pdo->prepare($sql)\n ->execute(\n array(\n $data->lic_id_tipo,\n $fechalog,\n $data->fecha_escrito,\n $cedula_solicitante,\n $nombre_solicitante,\n $data->fechaInicio,\n $data->fechaFin,\n $data->comentario,\n $id_usuario_soli,\n 0,\n $data->ruta_doc_adjunto, \n $idusuario, \n $cargo_solicitante\n )\n );\n $this->pdo->exec(\"INSERT INTO log (fecha, accion, detalle, idusuario, idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n\n //SE TERMINA LA TRANSACCION \n $this->pdo->commit();\n } catch (Exception $e) {\n $this->pdo->rollBack();\n die($e->getMessage());\n }\n }", "public static function confirmPayment() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if(!is_callable(self::$get_order_id)) {\n throw new Exception('Property self::$get_order_id must be callable');\n }\n $account = self::$account_prefix.'_'.call_user_func(self::$get_order_id);\n \n if(!is_callable(self::$get_order_ammount)) {\n throw new Exception('Property self::$get_order_ammount must be callable');\n }\n $order_ammount = call_user_func(self::$get_order_ammount);\n \n \n\t\ttry {\n $received_amount = self::$rpcClient->getreceivedbyaccount($account,0);\n\t\t} catch (Exception $e) {\n\t\t\techo false;\n\t\t}\n \n\t\t//if((float)$received_amount >= (float)$order_ammount) {\n \n //Comparing two floats with epsilon (http://php.net/manual/en/language.types.float.php)\n $epsilon = 0.0000001; // 1 Satoshi\n if((float)$order_ammount - (float)$received_amount < $epsilon) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n }", "public function nuevaCuenta($tipo) {\n $tipoCuenta = TipoCuenta::firstOrNew(['tip_cue_nombre' => $tipo]);\n $password = '';\n if ($tipoCuenta->id != '') {\n $cuenta = new Cuenta;\n $password = $this->generarPassword();\n $cuenta->cue_password = md5($password);\n $cuenta->persona_id = $this->id;\n $cuenta->save();\n\n $cuentaTipoCuenta = new CuentaTipoCuenta;\n $cuentaTipoCuenta->cue_tip_estado = 'activo';\n $cuentaTipoCuenta->cuenta_id = $cuenta->id;\n $cuentaTipoCuenta->tipocuenta_id = $tipoCuenta->id;\n $cuentaTipoCuenta->save();\n return $password;\n }\n\n return false;\n }", "private function updateCommesse()\n {\n //Rielabora\n $preventivatore = $this->getPreventivatore();\n $result = $preventivatore->elabora();\n $imponibile = $result['prezzo_cliente_senza_iva'];\n $iva = $result['prezzo_cliente_con_iva'] - $result['prezzo_cliente_senza_iva'];\n $importo_trasportatore = $result['costo_trazione'];\n $importo_depositario = $result['deposito'];\n $importo_traslocatore_partenza = $result['costo_servizio_smontaggio_imballo_carico'] + $result['costo_servizio_imballo_carico'];\n $importo_traslocatore_destinazione = $result['costo_servizio_scarico'] + $result['costo_servizio_salita'] + $result['costo_servizio_montaggio'];\n\n $totali = array();\n $totali[$this->id_trasportatore] = 0;\n $totali[$this->id_depositario] = 0;\n $totali[$this->id_traslocatore_destinazione] = 0;\n $totali[$this->id_traslocatore_partenza] = 0;\n\n $totaliMC = array();\n $totaliMC[$this->id_trasportatore] = 0;\n $totaliMC[$this->id_depositario] = 0;\n $totaliMC[$this->id_traslocatore_destinazione] = 0;\n $totaliMC[$this->id_traslocatore_partenza] = 0;\n\n\n $totali[$this->id_trasportatore] = $totali[$this->id_trasportatore] + $importo_trasportatore;\n $totali[$this->id_depositario] = $totali[$this->id_depositario] + $importo_depositario;\n $totali[$this->id_traslocatore_partenza] = $totali[$this->id_traslocatore_partenza] + $importo_traslocatore_partenza;\n $totali[$this->id_traslocatore_destinazione] = $totali[$this->id_traslocatore_destinazione] + $importo_traslocatore_destinazione;\n\n\n $mc = $preventivatore->getMC();\n\n $totaliMC[$this->id_trasportatore] = $totaliMC[$this->id_trasportatore] + $mc['mc_da_trasportare'];\n $totaliMC[$this->id_depositario] = $totaliMC[$this->id_depositario] + $mc['mc_da_trasportare'];\n $totaliMC[$this->id_traslocatore_destinazione] = $totaliMC[$this->id_traslocatore_destinazione] + $mc['mc_smontaggio'] + $mc['mc_no_smontaggio'];\n $totaliMC[$this->id_traslocatore_partenza] = $totaliMC[$this->id_traslocatore_partenza] + $mc['mc_da_rimontare'] + $mc['mc_scarico_salita_piano'];\n\n\n $imponibile = round($totali[$this->id_trasportatore]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_trasportatore] - $imponibile,2);\n\n $ordine_trasportatore = new OrdineFornitore($this->id_preventivo, $this->id_trasportatore, $totali[$this->id_trasportatore], $imponibile, $iva, $totaliMC[$this->id_trasportatore], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASPORTO);\n $ordine_trasportatore->save();\n\n $imponibile = round($totali[$this->id_traslocatore_partenza]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_partenza] - $imponibile,2);\n $ordine_traslocatore_partenza = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_partenza, $totali[$this->id_traslocatore_partenza], $imponibile, $iva, $totaliMC[$this->id_traslocatore_destinazione], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_PARTENZA);\n $ordine_traslocatore_partenza->save();\n\n $imponibile = round($totali[$this->id_traslocatore_destinazione]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_destinazione] - $imponibile,2);\n $ordine_traslocatore_destinazione = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_destinazione, $totali[$this->id_traslocatore_destinazione], $imponibile, $iva, $totaliMC[$this->id_traslocatore_partenza], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_DESTINAZIONE);\n $ordine_traslocatore_destinazione->save();\n\n if ($this->giorni_deposito> 10)\n {\n $imponibile = round($totali[$this->id_depositario]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_depositario] - $imponibile,2);\n\n $ordine_depositario = new OrdineFornitore($this->id_preventivo, $this->id_depositario, $totali[$this->id_depositario], $imponibile, $iva, $totaliMC[$this->id_depositario], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_DEPOSITO);\n $ordine_depositario->save();\n\n }\n\n $con = DBUtils::getConnection();\n $sql =\"UPDATE preventivi SET\n importo_commessa_trasportatore ='\".$totali[$this->id_trasportatore].\"',\n importo_commessa_traslocatore_partenza ='\".$totali[$this->id_traslocatore_partenza].\"',\n importo_commessa_traslocatore_destinazione ='\".$totali[$this->id_traslocatore_destinazione].\"',\n importo_commessa_depositario ='\".$totali[$this->id_depositario].\"',\n imponibile ='\".$imponibile.\"',\n iva ='\".$iva.\"'\n WHERE id_preventivo=\".$this->id_preventivo;\n\n $res = mysql_query($sql);\n\n\n DBUtils::closeConnection($con);\n\n }", "function Comprobar_codcentro()\n{\n\t$correcto = true;\n\n\t//si se cumple la condicion\n\tif (strlen($this->CODCENTRO)<3)\n\t{\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"CODCENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00003\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Valor de atributo no numérico demasiado corto\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t//si se cumple la condicion\n\tif (strlen($this->CODCENTRO)>10)\n\t{\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"CODCENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00002\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Valor de atributo demasiado largo\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t//si se cumple la condicion\n\tif (!preg_match(\"/^[A-Za-zñáéíóúÑÁÉÍÓÚüÜ\\-0-9]+$/\",$this->CODCENTRO)){\n\t\t$error = array();\n\t\t\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"CODCENTRO\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"00040\");\n\t\t//guarda un mensaje de error\n\t\tarray_push($error, \"Solo están permitidas alfabéticos, números y el “-”\");\n\n\t\t//guarda un mensaje de error\n\t\tarray_push($this->erroresdatos, $error);\n\t\t$correcto = false;\n\t}\n\t\n\treturn $correcto;//se devuelve el resultado\n}", "public function testValoresTransferidosPorContratoDeRateioSamuSantaRosa() {\n $filter = function (array $line): bool {\n if (str_starts_with($line['conta_contabil'], '8.5.3.1.0.02') && $line['escrituracao'] === 'S') {\n return true;\n }\n return false;\n };\n $saldoDevedorControle = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_debito', $filter);\n $saldoCredorControle = $this->somaColuna($this->getDataFrame('BAL_VER'), 'saldo_atual_credito', $filter);\n\n $filter = function (array $line): bool {\n if (\n $line['projativ'] == 2067\n ) {\n return true;\n }\n return false;\n };\n $pago = $this->somaColuna($this->getDataFrame('BAL_DESP'), 'valor_pago', $filter);\n\n $this->comparar(\n ($saldoCredorControle - $saldoDevedorControle),\n $pago\n );\n\n $this->saldoVerificado(__METHOD__, '8.5.3.1.0.02');\n }", "public function checkout($row) {\n \n $dataVencimento = Date::add(5, Date::timestampToBr($row['data_vencimento']));\n $dataVencimento = str_replace('/', '', $dataVencimento);\n \n $cripto = new Itaucripto();\n\n $codEmp = \"J1234567890123456789012345\";\n $chave = \"ABCD123456ABCD12\";\n \n $pedido = $row['num_pedido'];\n $valor = number_format($row['valor'], 2, ',', '');\n $observacao = \"Essa é uma observação\";\n $nomeSacado = $row['nome'];\n $codigoInscricao = \"01\";\n $numeroInscricao = \"82938674341\";\n $enderecoSacado = $row['endereco'];\n $bairroSacado = $row['bairro'];\n $cepSacado = str_replace('-', '', $row['cep']);\n $cidadeSacado = $row['cidade'];\n $estadoSacado = $row['estado'];\n $urlRetorna = \"http://interacao.gani.org.br/site/itau-retorno.php\";\n $obsAd1 = \"Aqui vai a observação 1\";\n $obsAd2 = \"Aqui vai a observação 2\";\n $obsAd3 = \"Aqui vai a observação 3\";\n \n $dados = $cripto->geraDados($codEmp, $pedido, $valor, $observacao, $chave, $nomeSacado, $codigoInscricao, $numeroInscricao,\n $enderecoSacado, $bairroSacado, $cepSacado, $cidadeSacado, $estadoSacado, $dataVencimento,\n $urlRetorna, $obsAd1, $obsAd2, $obsAd3);\n \n $n = \"\\n\";\n \n $html = '<form name=\"frm_pagamento\" id=\"frm_pagamento\" method=\"post\" action=\"'. $this->url .'\">'.$n;\n $html .= '<input name=\"DC\" type=\"hidden\" value=\"'. $dados .'\">'.$n;\n $html .= '<input type=\"submit\" name=\"Shopline\" value=\"Itaú Shopline\">'.$n;\n $html .= '</form>';\n \n return $html;\n \n }", "static public function mdlProdEliminar($tabla, $numsalida, $valor1, $valor2){\n\t//OBTIENE EL NOMBRE DEL MES ACTUAL \t\t\n\t$nombremes_actual = strtolower(date('F'));\n\t// NOMBRE DEL KARDEX DEL ALMACEN\n\t$tablakardex=\"kardex\";\n\n\t$stmt=Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE num_salida=:num_salida AND id_producto=:id_producto\");\n\n\t$stmt->bindParam(\":num_salida\", $numsalida, PDO::PARAM_STR);\n\t$stmt->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n\t\n\tif($stmt -> execute()){\n\t\t//GUARDA EN KARDEX DEL ALMACEN ELEGIDO\n\t\t$query = Conexion::conectar()->prepare(\"UPDATE $tablakardex SET $nombremes_actual=:$nombremes_actual+$nombremes_actual WHERE id_producto = :id_producto\");\n\t\t$query->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n\t\t$query->bindParam(\":\".$nombremes_actual, $valor2, PDO::PARAM_STR);\n\t\t$query->execute();\n\n\t\treturn true;\n\t}else{\n\t\treturn \"error\";\t\n\t}\t\t\n\t\n\n\t$stmt = null;\n\n}", "function actualizar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t\t$tipo = ($datos['tipo'] == 1) ? 5 : 4 ;\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql = \"UPDATE app_productos SET codigo = '\" . $datos['codigo'] . \"', nombre = '\" . $datos['nombre'] . \"', minimos = \" . $datos['cant_min'] . \", factor= '\".$datos['factor'].\"' WHERE id=\".$datos['id_receta'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "function actualizarDeuda($acceso,$id_contrato){\n\treturn;\n\t/*\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"select sum(cant_serv * costo_cobro) as deuda from contrato_servicio_deuda where id_contrato='$id_contrato' and status_con_ser='DEUDA'\");\n\t\t\t\t\tif($fila=row($acceso)){\n\t\t\t\t\t\t$deuda = trim($fila['deuda']);\n\t\t\t\t\t\t//echo \"<br>Update contrato Set deuda='$deuda' Where id_contrato='$id_contrato'\";\n\t\t\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato Set deuda='$deuda' Where id_contrato='$id_contrato'\");\n\t\t\t\t\t}\n\t\t\t\t\t*/\n}", "public static function NoRecuperado($id){\r\n\t\t$db=DataBase::getConnect();\r\t\t//Cuando haces una cotizacion esta tabla es el carrito y si se realiza la orden, debe salir del inventario por lo tanto se resta del stock\r\n#\t\t$select=$db->prepare('SELECT COUNT(IdInventarioUnidadesRenta) As total_no_disponible FROM _cotizaciones_cart WHERE recuperado = 0 AND IdInventarioUnidadesRenta=:id');\r\t\t$select=$db->prepare('SELECT SUM(cantidad) As total_no_disponible FROM _cotizaciones_cart_rentas WHERE recuperado = 0 AND IdInventarioUnidadesRenta=:id');\r\t\t$select->bindValue('id',$id);\r\n\t\t$select->execute();\r\n\t\t$result=$select->fetch();\r\n\t\t$recuperado = $result['total_no_disponible'];\r\t\tif(empty($recuperado)){ $recuperado = 0; }\r\n\t\treturn $recuperado;\r\t}", "function insertar($usuario, $carga_saldo, $numero_tran)\n {\n if($this->existeusuario($usuario))\n {\n //cambiar esto por una funcion update !!!\n if($this->update($usuario,$carga_saldo,$numero_tran))\n {\n return false;\n }\n }\n else\n {\n return $this->agregar($usuario,$carga_saldo,$numero_tran);\n }\n }", "public function salvar() {\n\n $oDaoGrupoOrcamento = db_utils::getDao('congrupo');\n $oDaoGrupoOrcamento->c20_sequencial = $this->getCodigo();\n $oDaoGrupoOrcamento->c20_descr = $this->getDescricao();\n $oDaoGrupoOrcamento->c20_tipo = $this->getTipoGrupo();\n\n if ($this->getCodigo() == \"\") {\n\n $oDaoGrupoOrcamento->incluir(null);\n $this->setCodigo($oDaoGrupoOrcamento->c20_sequencial);\n } else {\n $oDaoGrupoOrcamento->alterar($this->getCodigo());\n }\n return true;\n }", "public function renew() {\n if(!isset($this->params['post']['confirm']) || $this->params['post']['confirm'] != 1) {\n $this->content['html'] = '';\n }\n\n if(empty($this->customer['id'])) {\n $this->response['error'][] = $this->locale['ERR_4002'];\n $this->response['logout'] = 1;\n return false;\n }\n\n if(empty($this->params['object']) || !$this->validator->isPositiveInteger($this->params['object'])) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n\n $item = $this->orderModel->getOne($this->params['object'], $this->language['id']);\n \n if(!$item || empty($item['id']) || $item['status_id'] == $this->statusTerminated || $item['status_id'] == $this->statusClosed) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n\n $cars = $this->orderModel->getCars($item['id']);\n if(!$cars || count($cars) < 1) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n\n $euro = $this->getCurrency($this->defaults['currencyEuroId']);\n\n if(isset($this->params['post']['confirm']) && $this->params['post']['confirm'] == 1) {\n //renew confirmation\n $count = count($cars);\n\n $carsRenew = [];\n $now = time();\n\n $orderPrices = [\n 'price' => 0, \n 'renewal_fee' => 0, \n 'holidays_fee' => 0, \n 'final_price' => 0\n ];\n\n $orderStartDate = '';\n $orderEndDate = '';\n\n for($i = 0; $i < $count; $i++) {\n $startTime = strtotime($this->params['post']['from_' . $cars[$i]['car_id']]);\n $endTime = strtotime($this->params['post']['till_' . $cars[$i]['car_id']]);\n\n if(empty($this->params['post']['from_' . $cars[$i]['car_id']]) || !$startTime \n || empty($this->params['post']['till_' . $cars[$i]['car_id']]) || !$endTime\n ) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n\n $car = $this->carModel->getOne($cars[$i]['car_id'], $this->language['id']);\n $car['start_date'] = $this->params['post']['from_' . $cars[$i]['car_id']];\n $car['end_date'] = $this->params['post']['till_' . $cars[$i]['car_id']];\n\n $disabledDates = $this->orderModel->getRentedDates($car['id']);\n if(!$this->orderModel->isFreePeriod($disabledDates, $car['start_date'], $car['end_date'])) {\n $this->response['error'][] = $this->locale['ERR_1013'];\n return false;\n }\n\n if($i == 0 || $orderStartDate > $car['start_date']) {\n $orderStartDate = $car['start_date'];\n }\n \n if($i == 0 || $orderEndDate < $car['end_date']) {\n $orderEndDate = $car['end_date'];\n }\n\n $prices = $this->carModel->calculateRenewPrice($car);\n\n $cars[$i]['final_price'] = $prices['final'];\n $cars[$i]['price'] = $prices['total'];\n $cars[$i]['renewal_fee'] = $prices['renewal_fee'];\n $cars[$i]['holidays_fee'] = $prices['holidays_fee'];\n $cars[$i]['holidays'] = $prices['holidays'];\n \n $carsRenew[] = [\n 'car_id' => $cars[$i]['car_id'], \n 'start_date' => date('Y-m-d', strtotime($car['start_date'])), \n 'end_date' => date('Y-m-d', strtotime($car['end_date'])), \n 'price' => $cars[$i]['price'], \n 'renewal_fee' => $cars[$i]['renewal_fee'], \n 'holidays' => $cars[$i]['holidays'], \n 'holidays_fee' => $cars[$i]['holidays_fee'], \n 'final_price' => $cars[$i]['final_price']\n ];\n \n $orderPrices['price'] += $cars[$i]['price'];\n $orderPrices['renewal_fee'] += $cars[$i]['renewal_fee'];\n $orderPrices['holidays_fee'] += $cars[$i]['holidays_fee'];\n $orderPrices['final_price'] += $cars[$i]['final_price'];\n }\n\n $orderNumber = $this->customer['orders'] + 1;\n $invoice = date('Ymd') . '-' . $this->customer['id'] . '-' . $orderNumber;\n\n $arr = [\n 'customer_id' => $this->customer['id'], \n 'parent_id' => $item['id'], \n 'invoice' => $invoice, \n 'start_date' => date('Y-m-d', strtotime($orderStartDate)), \n 'end_date' => date('Y-m-d', strtotime($orderEndDate)), \n 'price' => $orderPrices['price'], \n 'renewal_fee' => $orderPrices['renewal_fee'], \n 'holidays_fee' => $orderPrices['holidays_fee'], \n 'final_price' => $orderPrices['final_price'], \n 'creation_time' => $now, \n 'update_time' => $now\n ];\n\n $orderId = $this->orderModel->insert($arr);\n\n if ($orderId) {\n $this->orderModel->addCars($carsRenew, $orderId);\n\n $arr = ['orders' => $orderNumber, 'update_time' => $now];\n $this->customerModel->update($arr, $this->customer['id']);\n\n $this->response['status'] = $this->statusSuccess;\n $this->response['msg'] = $this->locale['SUCCESS_9000'];\n $this->response['link'] = $this->links['orders'];\n } else {\n $this->response['error'][] = $this->locale['ERR_1008'];\n }\n } else {\n //show\n $htmlCars = $this->htmlCarsRenew($cars, $item);\n\n if($this->currency['id'] != $euro['id']) {\n $item['final_price'] /= $this->currency['in_euro'];\n $item['price'] /= $this->currency['in_euro'];\n }\n\n $this->template->set( $this->tplPath . 'renew.html');\n\n $tplVars = [\n 'STR_RENEW_ORDER' => $this->locale['STR_RENEW_ORDER'], \n 'TXT_RENEW_ORDER' => $this->locale['TXT_RENEW_ORDER'], \n 'STR_BACK_ORDERS' => $this->locale['STR_BACK_ORDERS'], \n 'STR_CAR' => $this->locale['STR_CAR'], \n 'STR_RENT_DATE' => $this->locale['STR_RENT_DATE'], \n 'STR_PRICE' => $this->locale['STR_PRICE'], \n 'STR_TOTAL' => $this->locale['STR_TOTAL'], \n 'STR_RENEW' => $this->locale['STR_RENEW'], \n 'INVOICE' => $item['invoice'],\n 'LINK_ORDERS' => $this->links['orders'],\n 'ITEMS' => $htmlCars, \n 'HIDDEN' => $htmlCars == '' ? ' hidden' : '', \n 'ID' => $item['id'], \n 'TOTAL_PRICE' => $this->getFormatMoney($item['final_price']), \n 'CURRENCY_SIGN' => $this->currency['sign']\n ];\n\n $this->template->setVars( $tplVars );\n\n $this->content['html'] = $this->template->parse();\n $this->response['status'] = $this->statusSuccess;\n }\n }", "public function VerificaArqueoCreditos()\n{\n\tself::SetNames();\n\t\n $sql = \"SELECT * FROM arqueocaja WHERE codigo = ? and statusarqueo = 1\";\n $stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_SESSION[\"codigo\"]));\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n echo \"<div class='alert alert-danger'>\";\n echo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n echo \"<center><span class='fa fa-info-circle'></span> DISCULPE, NO EXISTE UN ARQUEO DE CAJA PARA PROCESAR COBROS DE CREDITOS, DEBERA DE INICIARLA PARA CONTINUAR.<br> SI DESEA REALIZAR UN ARQUEO DE CAJA HAZ CLIC <a href='forarqueo'>AQUI</a></center>\";\n echo \"</div>\";\n\n\t\t} else { \n\n\t$sql = \"SELECT * FROM arqueocaja WHERE codigo = ? and statusarqueo = 1\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_SESSION[\"codigo\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$pae[] = $row;\n\t\t}\n\t$codcaja = $pae[0]['codcaja'];\n\t\t?>\n\n\t<div class=\"row\"> \n\t\t\t\t\t\t\t<div class=\"col-md-12\"> \n <div class=\"form-group has-feedback\"> \n <label class=\"control-label\">B&uacute;squeda de Clientes: <span class=\"symbol required\"></span></label>\n<input type=\"hidden\" name=\"codcaja\" id=\"codcaja\" value=\"<?php echo $codcaja; ?>\" readonly=\"readonly\">\n<input type=\"hidden\" class=\"form-control\" name=\"codcliente\" id=\"codcliente\"><input class=\"form-control\" type=\"text\" name=\"busquedacliente\" id=\"busquedacliente\" onKeyUp=\"this.value=this.value.toUpperCase();\" autocomplete=\"off\" placeholder=\"Ingrese Datos del Cliente para tu b&uacute;squeda\" required=\"required\">\n <i class=\"fa fa-search form-control-feedback\"></i> \n </div> \n </div> \t\n </div><br>\n\t\t\t\t\t\n <div class=\"modal-footer\"> \n<button type=\"button\" onClick=\"BuscaClientesAbonos()\" class=\"btn btn-primary\"><span class=\"fa fa-search\"></span> Realizar B&uacute;squeda</button>\t\t\t\n </div>\n\n\t<?php\n\t}\n}", "public function actualizarCita(){\n $sql =\"update cita set id_paciente=$this->id_paciente, id_medico = $this->id_medico,fecha_cita = '$this->fecha_cita', hora_cita='$this->hora_cita', tipo_servicio='$this->tipo_servicio', motivo ='$this->motivo', estado = '$this->estado' where id =$this->id\";\n if($this->conn->executeQuery($sql)){\n $this->conn->close();\n return true;\n }\n }", "public function store(Request $request)\n {\n //COMPRAR JOCS\n\n //obtenim id usuari login\n $usuarilogin = User::where('id', $request->usuari)->first();\n\n //obtenim id del joc que vol comprar\n $joc = joc::where('id', $request->joc)->first();\n //comprovem si te suficient saldo, sino retorna boolea error\n if ($usuarilogin->saldo < $joc->preu) {\n return -1;\n } else {\n //posem el joc a la biblioteca\n $biblioteca = new biblioteca;\n $biblioteca->id_usuari = $usuarilogin->id;\n $biblioteca->id_joc = $joc->id;\n $biblioteca->save();\n //restem saldo de l'usuari i el guardem a la BBDD\n $usuarilogin->saldo = $usuarilogin->saldo - $joc->preu;\n $usuarilogin->save();\n //retornem el saldo per que el vue el posi canvii en pantalla \n return $usuarilogin->saldo;\n }\n }", "static public function mdlSumTotVtasCred($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\n if($fechacutvta!=null){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(IF(h.es_promo = 0, h.cantidad*h.precio_venta,0)) AS sinpromo, \n\t\tSUM(IF(h.es_promo = 1, h.precio_venta,0)) AS promo FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item='\".$fechacutvta.\"' and h.id_caja='\".$valor.\"' and h.cerrado='\".$cerrado.\"' AND h.id_tipomov=3\");\n }else{\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT h.fecha_salida, SUM(IF(h.es_promo = 0, h.cantidad*h.precio_venta,0)) AS sinpromo, \n\t\tSUM(IF(h.es_promo = 1, h.precio_venta,0)) AS promo FROM $tabla h INNER JOIN productos p ON h.id_producto=p.id \n\t\tWHERE h.$item=curdate() and h.id_caja='\".$valor.\"' and h.cerrado='\".$cerrado.\"' AND h.id_tipomov=3\");\n }\n //$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n \n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\n}", "function salida_por_traspaso(){\n\t\t$e= new Salida();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cclientes_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "function removeRegistro($id) {\n GLOBAL $con;\n\n //busca info\n $querybusca = \"select * from kardexs where id='\" . $id . \"'\";\n $qry = mysql_query($querybusca);\n $linha = mysql_fetch_assoc($qry);\n\n //Apagua\n $query = \"delete from kardexs where id='\" . $id . \"'\";\n mysql_query($query, $con) or die(mysql_error());\n\n if (saldoExiste($linha['produto_id'], $linha['estoque_id'])) {\n //atualiza retirando saldo\n $saldoAtual = saldoByEstoque($linha['produto_id'], $linha['estoque_id']);\n if ($linha['sinal'] == '+') {\n $saldoAtual_acerto = $saldoAtual - $linha['qtd'];\n } else {\n $saldoAtual_acerto = $saldoAtual + $linha['qtd'];\n }\n\n\n saldo_atualiza($linha['produto_id'], $linha['estoque_id'], $saldoAtual_acerto);\n }\n}", "function registroVentaEmpleadoDAO($salida){\n $conexion = Conexion::crearConexion();\n $exito = false;\n try {\n $valor = $salida->getValor();\n $iva = $salida->getIva();\n $total = $salida->getTotal();\n $fecha = $salida->getFecha_sal();\n \n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $stm = $conexion->prepare(\"INSERT INTO salidas(valor,iva,total,fecha_sal) VALUES (?,?,?,?)\");\n $stm->bindParam(1, $valor, PDO::PARAM_STR);\n $stm->bindParam(2, $iva, PDO::PARAM_STR);\n $stm->bindParam(3, $total, PDO::PARAM_STR);\n $stm->bindParam(4, $fecha, PDO::PARAM_STR);\n $exito = $stm->execute();\n } catch (Exception $ex) {\n throw new Exception(\"Error al registrar la salida en bd\");\n }\n return $exito;\n }", "public function testCashInCommissionMax(): void\n {\n $user = new User(2, 'legal');\n $transaction = new Transaction();\n\n $transaction->date = '2019-02-24';\n $transaction->type = 'cash_in';\n $transaction->amount = 1000000;\n $transaction->currency = 'EUR';\n $transaction->user = $user;\n\n $this->assertSame($this->app['managers']['commission']->calculateCommission($transaction), '5.00');\n }", "public function crearTransferencia(Request $request)\n {\n if (!$request->ajax()) return redirect('/'); //seguridad http si es diferente a peticion ajax\n try {\n //usaremos transacciones\n DB::beginTransaction();\n //para validar los formularios\n // 'empleado_id' valida que el usuario al que se va asoriar la caja, lo siguiente:\n // -que no tenga caja activa, - que el rol sea diferente a administrador\n\n $cajaOrigen = Caja::find($request->caja_origen);\n $cajaDestino = Caja::find($request->caja_destino);\n $cajaOrigenNeto = $cajaOrigen->valor_inicial + $cajaOrigen->valor_producido;\n\n if ($request->valor <= $cajaOrigenNeto) {\n $request->validate([\n 'caja_origen' => 'required',\n 'caja_destino' => 'required',\n 'valor' => 'max:10|regex:/^\\d+(\\.\\d{1,2})?$/'\n ]);\n } else {\n $request->validate([\n 'caja_origen' => 'required',\n 'caja_destino' => 'required',\n 'valor' => [\n 'max:10|regex:/^\\d+(\\.\\d{1,2})?$/',\n function ($attribute, $value, $fail) {\n if (1 > 0) {\n $fail('El valor a Transferir supera al Existente');\n }\n }\n ]\n ]);\n }\n\n\n\n $Transferencia = new Transferencia();\n $Transferencia->caja_origen = $request->caja_origen;\n $Transferencia->caja_destino = $request->caja_destino;\n $Transferencia->valor = $request->valor;\n $Transferencia->notas = 'NINGUNA';\n $Transferencia->save();\n\n\n DB::commit();\n } catch (Exception $e) {\n DB::rollBack(); //si hay error no ejecute la transaccion\n }\n }", "function assignCashier($connection,$accno){\r\n $sql = \"UPDATE _userdetails SET iscashier = 1,isuser= 0 WHERE accno = :accno\";\r\n $statement = $connection->prepare($sql);\r\n $statement->execute(array(':accno'=>$accno));\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n return true;\r\n // $row = $statement->fetchall();\r\n // if(sizeof($row)>0){\r\n // return true;\r\n // }else {\r\n // return false;\r\n // }\r\n }", "public static function deletaProdutoCarrinho(){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n unset($expPro[self::$posicao]);\n unset($expQuant[self::$posicao]);\n\n //VERIFICA SE TEM PRODUTOS NO CARRINHO\n if($expPro and $expQuant !== ''){\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $query = 'UPDATE carrinhos SET produto_id=:pro, quantidade=:qnt, idCliente=:idC WHERE id=:id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,self::$carrinho->idCliente);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n return true;\n }throw new \\Exception(\"Erro ao Deletar Produto\");\n\n //SE O CARRINHO ESTIVER VAZIO SERA DELETADO\n }else{\n $query = 'DELETE FROM carrinhos WHERE carrinhos.id LIKE :id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n $_SESSION['user']['carrinhoId'] = NULL;\n\n return true;\n }throw new \\Exception(\"Erro ao Deletar Carrinho\");\n }\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }" ]
[ "0.7382537", "0.65729934", "0.64711034", "0.60900825", "0.6026074", "0.58807355", "0.58307165", "0.5779255", "0.5713792", "0.5634756", "0.5628402", "0.5541359", "0.55215466", "0.5506638", "0.54929215", "0.5486958", "0.5476865", "0.547195", "0.54629475", "0.5459325", "0.5455026", "0.5451233", "0.5450733", "0.5437551", "0.5434369", "0.5434224", "0.5433389", "0.5419446", "0.53735733", "0.53550225", "0.5341042", "0.53360444", "0.5331262", "0.5325427", "0.5318491", "0.53107625", "0.5308157", "0.5302089", "0.5297312", "0.52971095", "0.52925795", "0.5291097", "0.5286905", "0.52851963", "0.5283235", "0.52654636", "0.5254198", "0.52531374", "0.5246954", "0.52439374", "0.52324003", "0.52080107", "0.52046573", "0.51985633", "0.5197922", "0.5193345", "0.5187535", "0.51764864", "0.5173754", "0.5167364", "0.51667124", "0.515134", "0.51425225", "0.5129675", "0.5128949", "0.51278317", "0.5127212", "0.51269543", "0.5123182", "0.51208097", "0.5118118", "0.51153505", "0.5114884", "0.5114363", "0.51138884", "0.51137495", "0.5112032", "0.5111489", "0.5107686", "0.51039433", "0.50991195", "0.5095275", "0.50940555", "0.5090595", "0.5086996", "0.50821203", "0.50781006", "0.50778145", "0.50740206", "0.5073923", "0.50718784", "0.5064994", "0.5057823", "0.50563717", "0.50562185", "0.50551665", "0.5051108", "0.504552", "0.5043768", "0.50378895" ]
0.635146
3
Show Avatar image (public)
public function image() { $user_id = $this->request->getIntegerParam('user_id'); $size = $this->request->getStringParam('size', 48); $hash = $this->request->getStringParam('hash'); if ($size > 100) { $this->response->status(400); return; } $filename = $this->avatarFileModel->getFilename($user_id); $etag = md5($filename.$size); if ($hash !== $etag) { $this->response->status(404); return; } $this->response->withCache(365 * 86400, $etag); $this->response->withContentType('image/png'); if ($this->request->getHeader('If-None-Match') !== '"'.$etag.'"') { $this->response->send(); $this->render($filename, $size); } else { $this->response->status(304); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAvatar()\n {\n $avatar_size = $this->avatarSize();\n\n $avatar = $this->profile->getAvatar($avatar_size);\n\n $this->out->element('img', array('src' => ($avatar) ?\n $avatar->displayUrl() :\n Avatar::defaultImage($avatar_size),\n 'class' => 'avatar photo',\n 'width' => $avatar_size,\n 'height' => $avatar_size,\n 'alt' =>\n ($this->profile->fullname) ?\n $this->profile->fullname :\n $this->profile->nickname));\n }", "public function outputAvatarImage()\n\t{\n\t\techo $this->app->html->img($this->avatar_url, $this->avatar_width, $this->avatar_height, $this->username);\n\t}", "public function showProfilePic()\n {\n \n \n }", "public function getProfileAvatar()\n {\n return view('profilePicture');\n }", "function showAvatar($size=AVATAR_STREAM_SIZE)\n {\n $avatar = $this->profile->getAvatar($size);\n\n $this->out->element('img', array('src' => ($avatar) ?\n $avatar->displayUrl() :\n Avatar::defaultImage($size),\n 'class' => 'avatar photo',\n 'width' => $size,\n 'height' => $size,\n 'alt' =>\n ($this->profile->fullname) ?\n $this->profile->fullname :\n $this->profile->nickname));\n }", "public function outputAvatar(bool $show_link = false)\n\t{\n\t\tif ($show_link) {\n\t\t\t$this->outputLink(true, false);\n\t\t} else {\n\t\t\t$this->outputAvatarImage();\n\t\t}\n\t}", "public function actionAvatar()\n {\n $players=Player::find()->active()->all();\n foreach($players as $player)\n {\n $robohash=new \\app\\models\\Robohash($player->profile->id,'set1');\n $image=$robohash->generate_image();\n if(get_resource_type($image)=== 'gd')\n {\n $dst_img=\\Yii::getAlias('@app/web/images/avatars/'.$player->profile->id.'.png');\n imagepng($image,$dst_img);\n imagedestroy($image);\n $player->profile->avatar=$player->profile->id.'.png';\n $player->profile->save(false);\n }\n }\n }", "static function showAvatar($userId=-1,$linkTo='finfo'){\r\n\t\t\t\r\n\t\t$avatarUserId = $userId;\r\n\t\tif( $avatarUserId == -1) {\r\n\t\t\t$user = FUser::getInstance();\r\n\t\t\t$avatarUserId = $user->userVO->userId;\r\n\t\t}\r\n\t\t$cacheId = $avatarUserId;\r\n\t\t$cacheGrp = 'avatar';\r\n\t\t\r\n\t\t$cache = FCache::getInstance('l');\r\n\t\t$ret = $cache->getData($cacheId,$cacheGrp);\r\n\t\tif(false !== $ret) return $ret;\r\n\r\n\t\t//set cache\r\n\t\tif(!isset($user)) $user = FUser::getInstance();\r\n\r\n\t\tif($userId == -1 ) $avatarUserName = $user->userVO->name;\r\n\t\telseif($userId > 0) $avatarUserName = FUser::getgidname($avatarUserId);\r\n\t\telse $avatarUserName = '';\r\n\t\t\r\n\t\t$ret = '<img src=\"'.FAvatar::getAvatarUrl(($userId==-1)?(-1):($avatarUserId)).'\" alt=\"'.$avatarUserName.'\" class=\"userAvatar\" />';\r\n\t\tif($userId > 0) {\r\n\t\t\t$ret = '<a href=\"'.FSystem::getUri('who='.$userId.'#tabs-profil',$linkTo).'\">'.$ret.'</a>';\r\n\t\t}\r\n\t\t$cache->setData($ret, $cacheId, $cacheGrp);\r\n\t\treturn $ret;\r\n\t}", "public function showImage()\n {\n }", "function UserPicture(){\r\n echo \"<img class='user_image' id='user_image' src='../RSAS.net/profile_pictures/$this->picture' onclick='my_account()' />\";\r\n }", "public function show(){\n locateAndInclude('bForm_Avatar_vm');\n parent::show();\n }", "public function getAvatar(): string;", "public function avatar(){\n if($this->avatar){\n return asset('/avatars/patients/'.$this->avatar);\n }else{\n return \"https://www.gravatar.com/avatar/{{md5(trim($this->fname))}}?d=mm&s=150\" ;\n }\n }", "public function show()\n {\n $path = Storage::url('public/IMG-20180930-WA0004.jpg.jpg');\n\n return '<img src=\"' .$path. '\" alt=\"\">';\n }", "public function avatarUser()\n {\n return asset(\"storage/images/$this->avatar\");\n }", "public function image()\n {\n return view('panel.user.form-image', [\n 'id' => $this->getId(),\n 'breadcrumbs' => $this->getBreadcrumb('Imagem')\n ]);\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "public function getAvatarUrl()\n {\n return Url::to(\"/img/avatars/{$this->avatar}\");\n }", "function floated_admin_avatar($name)\n {\n }", "public function avatar()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n $this->load->helper('directory');\n\n $files = directory_map(APPPATH .'../public_html/images/avatar');\n\n foreach ($files AS $key => $file) {\n\n $file_part = explode('.', $file);\n\n if (!is_numeric($file_part[0])) {\n unset($files[$key]);\n }\n }\n\n $view_data['number_avatar'] = count($files);\n \n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->update([\n 'id' => $this->current_user->id,\n 'avatar_id' => $this->input->post('avatar')\n ]);\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n }\n\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n\n $res = $this->get_current_user_detail();\n\n $view_data['current_avatar'] = $res['result']['avatar'];\n\n $this->_render($view_data);\n }", "public function getProfileImage(){\n\t\t// To hook into this function we could use a an event:\n\t\t// $event = new CEvent();\n\t\t// $this->onGetProfileImage($event)\n\t\t// // then if the event has been handled \n\t\t// if($event->handled)\n\t\t// // we know another function has handled the event and found us an image url for this user\n\t\t// // it could store this in the event object\n\t\t// return $event->params->imageUrl \n\t\t\n\t\t// Display guest photo\n\t\treturn Yii::app()->controller->createWidget('nii.widgets.Gravatar',array('email'=>$this->email))->getUrl();\n\t}", "function fc_get_easySocial_avatar(){\r\n\t$user = Foundry::user();\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getAvatar());\r\n}", "function imageUser($name) {\n\tif (File::exists(base_path() . '/public/avatar/' . $name)) {\n\t\treturn Asset('avatar/'.$name);\n\t} else {\n\t\treturn Asset('images/default-avatar.png');\n\t}\n}", "public function picture_url() {\n return $this->_adaptee->user_photo(\"\", true);\n }", "public function getAvatar()\n {\n return $this->getImageurl();\n }", "public function vl_avatar_function(){\r\n\t\t\tglobal $current_user;\r\n\t\t\t$user_id = $current_user->ID;\r\n\t\t\t?>\r\n\t\t\t<div class=\"vl_profile_avatar_container\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$size= get_option('fancy-style-size');\r\n\t\t\t\tif ( is_user_logged_in() ) {\r\n\t\t\t\t\techo 'Welcome : ' . esc_html( $current_user->display_name );\r\n\t\t\t\t\techo \"<br>\";\r\n\t\t\t\t\techo $this->vl_get_avatars( $user_id,$user_id, $size ,'avatar','avatar'); ?>\r\n\t\t\t\t\t<br class=\"small-grid\">\r\n\t\t\t\t\t<div class=\"vl_upload_container profile_avatar_upload_container hidden\">\r\n\t\t\t\t\t\t<div class=\"vl_upload_area\">Upload</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"upload-button\">\r\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-block vl_profile_upload_btn\">UPLOAD</button>\r\n\t\t\t\t\t\t<br class=\"tiny-grid\">\r\n\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t\t<?php\r\n\t\t\t}else{\r\n\t\t\t\techo \"Sorry! you are not logged in\";\r\n\t\t\t\techo \"<br>\";\r\n\t\t\t\t echo get_avatar($current_user->ID);\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}", "public function profilePicture()\n {\n if ($this->picture) {\n return \"/storage/{$this->picture}\";\n }\n\n return 'http://i.pravatar.cc/200';\n }", "public function show($id)\n {\n $avatar = Avatar::query()->findOrFail($id);\n\n return view('admin.avatar.show', compact('avatar'));\n }", "public function getAvatar($identity);", "public function picture() {\n $picture = $this->_model->getPicture(explode(\"/\", $this->_url)[1]);\n if ($picture === null) {\n $this->redirect(\"/index\");\n }\n $this->render(\"General.Picture\", compact('picture'));\n }", "public function profileimageAction() {\n\t\ttry{\t\t\t\n\t\t\t$this->view->UserProfileImage = $this->session->UserProfileImage; //$UserProfileImage['0']['image_path'];\n\t\t}catch (Exception $e){\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "function displayProfilePic()\n {\n global $db;\n $image = $db->query(\"SELECT userProfilePic FROM users WHERE id= '{$_SESSION['id']}' \") ;\n return $image;\n }", "public function getAvatar()\n {\n return $this->getProfilePicture();\n }", "public function getAvatarImage() : string\n {\n $imagePlaceholder = asset('storage/images/profiles') . '/' . Auth::user()->avatar;\n\n if(empty(Auth::user()->avatar)) {\n $imagePlaceholder = asset('img/user-image-placeholder.png');\n }\n\n return $imagePlaceholder;\n }", "public function getProfilePicture();", "public function getUserAvatar(){\n return($this->userAvatar);\n }", "public function get_user_image() {\n\t\tloggedOnly();\n\n\t\t// Pega o usuario logado\n\t\t$user = auth();\n\n\t\t// Busca a imagem\n\t\tif( $user->midia_id ) {\n\t\t\tif( $image = $user->belongsTo( 'midia' ) ) {\n\t\t\t\treturn resolve( $image->path() );\n\t\t\t} return resolve( base_url( 'public/images/empty.jpg' ) );\n\t\t} return resolve( base_url( 'public/images/empty.jpg' ) );\n\t}", "public function getProfileImage() {\r\n $profileImage = SystemSetting::getByKey(\"ARC_USER_IMAGE\", $this->id);\r\n if (!empty($profileImage->value)) {\r\n return system\\Helper::arcGetPath() . \"assets/profile/\" . $profileImage->value;\r\n }\r\n return system\\Helper::arcGetPath() . \"assets/profile/placeholder.png\";\r\n }", "public function getFullAvatarUrl() {\n return $this->imageUrl . '_full.jpg';\n }", "public function AvatarURL() {\n\t\t\n\t\tif (!empty($this->profil)) {\n\t\t\t\n\t\t\treturn $this->profil['user']['avatar150'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function getIconAvatarUrl() {\n return $this->imageUrl . '.jpg';\n }", "public function edit() {\n $user = \\Auth::user();\n return view('avatar.edit')->with('user', $user);\n }", "public function getImageAvatarUrl() {\n return CommonProcess::getHostUrl() . $this->getImageAvatarPath();\n }", "function get_display_photo(){\n\t$display_photo = get_profile( 'photo' );\n\tif ( empty($display_photo) || !file_exists(abspath('/contents/images/profile/'.$display_photo)) )\n\t\treturn false;\n\n\treturn get_image_link( \"/images/profile/$display_photo\", \"default\" );\n}", "public function index()\n {\n\n $user = auth()->user();\n if(Storage::disk('local_public')->exists(\"users/{$user->id}/avatar.jpg\")){\n $setavatar = true;\n return view('home',compact('setavatar'));\n }\n else {\n $setavatar = false;\n return view('home',compact('setavatar'));\n }\n\n\n }", "public function getImg_avatar()\r\n {\r\n return $this->img_avatar;\r\n }", "function fc_get_jomSocial_avatar(){\r\n\t$user =& CFactory::getUser($userid);\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getThumbAvatar());\r\n}", "public function picture()\n {\n if ($this->image->exists()) {\n return resource_url('images/users/' .basename($this->image->path));\n }\n\n // Fallback to AdminLTE's default image.\n return vendor_url('dist/img/avatar5.png', 'almasaeed2010/adminlte');\n }", "function showUserImage($nameOfOtherTableThatIsNowBeingCalled=false, $userId=false) {\r\n\r\n\tglobal $controller; \r\n\t$path = $controller->command(\"showPersonalUserImage\", $nameOfOtherTableThatIsNowBeingCalled, $userId); \r\n\treturn $path;\r\n}", "public function getProfileImageURL()\n {\n return 'https://avatars3.githubusercontent.com/u/4479918?v=4&s=460';\n }", "public function getImageProfile() {\n\t\t$basePath = Yii::getAlias ( '@web' );\n\t\t\n\t\t$usuarioFacebook = $this->entUsuariosFacebook;\n\t\t\n\t\tif(empty($usuarioFacebook)){\n\t\t\tif ($this->txt_imagen) {\n\t\t\t\treturn $basePath . '/profiles/' . $this->txt_token.\"/\". $this->txt_imagen;\n\t\t\t}\n\t\t\t\n\t\t\treturn $basePath . '/webAssets/images/site/user.png';\n\t\t}\n\t\t\n\t\treturn 'http://graph.facebook.com/'.$usuarioFacebook->id_facebook.'/picture';\n\t\t\n\t}", "function getUserImageInitial($userId, $name)\n{\n return getAvatarUrl().\"?name=$name&size=30&rounded=true&color=fff&background=\".getRandomColor($userId);\n}", "public function avatar() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n\n $this->load->helper('form');\n $this->load->library('form_validation');\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n $hidden_fields = array(\n 'user_id' => $this->user->getMyId(),\n 'set_avatar' => 'set_avatar',\n );\n $data['hidden'] = $hidden_fields;\n $data['avatars'] = $this->user->get_all_avatars();\n if ($this->input->post('set_avatar') == 'set_avatar') {\n if ($this->form_validation->run('account/avatar') === FALSE) {\n $this->load->view('account/avatar', $data);\n\n }\n else {\n $id = $this->user->update_avatar();\n redirect('account/profile_complete');\n }\n }\n else {\n $this->load->view('account/avatar', $data);\n }\n }", "public function getAvatarURL(){\r\n\t\treturn $this->buildCharacterAvatarURL($this->armoryAdapter->getWowArmoryUrl(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->characterObject->getLevel(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->characterObject->getGenderId(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->characterObject->getRaceId(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->characterObject->getWowClassId());\r\n }", "public function getAvatarUrl() {\n return \"http://www.gravatar.com/avatar/{{ md5($this->email) }}\n ?d=mm&s=40\";\n }", "function getEditAvatarUrl() {\n return assemble_url('people_company_user_edit_avatar', array(\n 'company_id' => $this->getCompanyId(),\n 'user_id' => $this->getId(),\n ));\n }", "public function avatar() {\n return $this->avatar_path ? Storage::url($this->avatar_path) : '/images/svg/avatar_default.svg';\n }", "public static function xms_id_display() { \r\n\t $customer_id = new Customer_ID_Model();\r\n\t $results = $customer_id->getUserProfile();\r\n\t \r\n\t foreach($results as $result){\r\n\t \t$user_image = $result->profile;\r\n\t }\r\n\t $user_img = $user_image;\r\n\t \r\n\t?>\r\n\t <span style=\"margin:20px 0 20px 0\" class=\"image mr-half inline-block\">\r\n\t <a href=\"/my-account/edit-account\"><img alt=\"\" src=\"<?php echo $user_img;?>\" class=\"avatar-photo\" width=\"170\" height=\"120\"></a>\r\n\t </span>\r\n\t<?php \r\n }", "public function show()\n {\n header('Content-Type: image/' . $this->config->mimeType);\n echo $this;\n }", "function show( $img )\n {\n\t\theader( \"Content-type: image/\" . substr( $img, strlen( $img ) - 4, 4 ) == \"jpeg\" ? \"jpeg\" : substr( $img, strlen( $img ) - 3, 3 ) );\n \treadfile( $img );\n }", "function imagen(){\n if (file_exists($avatar))\n {\n echo \"<img src='$avatar' alt='Logo' />\";\n }\n else\n {\n echo \"<p>La imagen no existe</p>\";\n }\n}", "protected function defaultProfilePhotoUrl()\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=252f3f&background=EBF4FF';\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function index () {\n return view('pages.clientarea.changeAvatar', [\n 'user' => Auth::user(),\n 'breadcrumb' => [\n 'Home' => route('dashboard.index'),\n 'Update Avatar' => ''\n ]\n ]);\n }", "public function getAvatar()\n {\n return $this->user['avatar'];\n }", "public function getAvatar()\n {\n return $this->profile->getAvatar();\n }", "public function avatar()\n {\n if (setting('enable_external_dependencies')) {\n return sprintf('https://www.gravatar.com/avatar/%s?size=%d', md5(strtolower($this->email)), 200);\n }\n\n return Avatar::create($this->username)->toBase64();\n }", "public function getAvatarAttribute()\n {\n return 'https://i.pravatar.cc/50?u='.$this->email;\n }", "protected function handleAvatar() : void // image\n {\n // something happened in the last years: those textures do not include tiny icons\n $sizes = [/* 'tiny' => 15, */'small' => 18, 'medium' => 36, 'large' => 56];\n $aPath = 'uploads/avatars/%d.jpg';\n $s = $this->_get['size'] ?: 'medium';\n\n if (!$this->_get['id'] || !preg_match('/^([0-9]+)\\.(jpg|gif)$/', $this->_get['id'][0], $matches) || !in_array($s, array_keys($sizes)))\n {\n trigger_error('AjaxProfile::handleAvatar - malformed request received', E_USER_ERROR);\n return;\n }\n\n $this->contentType = $matches[2] == 'png' ? MIME_TYPE_PNG : MIME_TYPE_JPEG;\n\n $id = $matches[1];\n $dest = imageCreateTruecolor($sizes[$s], $sizes[$s]);\n\n if (file_exists(sprintf($aPath, $id)))\n {\n $offsetX = $offsetY = 0;\n\n switch ($s)\n {\n case 'tiny':\n $offsetX += $sizes['small'];\n case 'small':\n $offsetY += $sizes['medium'];\n case 'medium':\n $offsetX += $sizes['large'];\n }\n\n $src = imageCreateFromJpeg(printf($aPath, $id));\n imagecopymerge($dest, $src, 0, 0, $offsetX, $offsetY, $sizes[$s], $sizes[$s], 100);\n }\n else\n trigger_error('AjaxProfile::handleAvatar - avatar file #'.$id.' not found', E_USER_ERROR);\n\n if ($matches[2] == 'gif')\n imageGif($dest);\n else\n imageJpeg($dest);\n }", "function scribbles_add_author_avatar() {\n\n\t?>\n\t<div class=\"avatar-container\">\n\n\t\t<?php echo get_avatar( get_the_author_meta( 'user_email' ), '128' ); ?>\n\n\t</div>\n\t<?php\n\n}", "abstract public function show($img);", "function show_avatar($comment)\n {\n $size = 40;\n $default = get_bloginfo('stylesheet_directory') . '/images/gravatar.jpg';\n $email = strtolower(trim($comment->comment_author_email));\n // [G | PG | R | X]\n $rating = \"G\";\n if (function_exists('get_avatar')) {\n echo get_avatar($email, $size, $default);\n } else {\n $grav_url = \"http://www.gravatar.com/avatar.php?gravatar_id=\n \" . md5($emaill) . \"&default=\" . urlencode($default) . \"&size=\" . $size . \"&rating=\" . $rating;\n echo \"<img src='$grav_url'/>\";\n }\n }", "function showImage()\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\timagegif($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\timagejpeg($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\timagepng($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}", "protected function defaultProfilePhotoUrl(): string\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=7F9CF5&background=EBF4FF';\n }", "public function view(User $user, Image $image)\n {\n //\n }", "public function setAvatar(string $avatar);", "function form_upload_picture() {\n $user = $this->ion_auth->user()->row();\n $this->load->view('portofolio/form_update_foto', $user);\n }", "public function show($data,Fileupload $fileupload)\n {\n \n $contents = Storage::url('images/sunil.jpg');\n\n echo \"<img src='\".$contents.\"' height='400px' width='200px'/>\";\n }", "function show($filename)\n {\n $this->log(\"show: $filename\");\n if (!file_exists($filename)) {\n header('X-Avatar: No-Image');\n return false;\n } else {\n header('X-Avatar: Found');\n }\n $mime_type = null;\n if (isset($this->avatarConfiguration['mime-type'])) {\n $mime_type = $this->avatarConfiguration['mime-type'];\n }\n if (!isset($mime_type)) {\n $size = @getimagesize($filename);\n $mime_type = $size['mime'];\n $this->avatarConfiguration['mime-type'] = $mime_type;\n }\n\n // test wether this really is (at least declared as) an image!\n // else deny it.\n $mime_parts = explode('/', $mime_type);\n if (count($mime_parts)!=2 || $mime_parts[0]!='image') {\n return false;\n }\n\n $fp = @fopen($filename, \"rb\");\n if ($fp) {\n if (isset($this->avatarConfiguration['fetch_date'])) {\n $filemtime = $this->avatarConfiguration['fetch_date'];\n $this->log(\"Fetch date found: \" . date(\"D, d M Y H:i:s T\", $filemtime));\n } else {\n $filemtime = filemtime($filename);\n }\n header(\"Content-type: $mime_type\");\n header(\"Content-Length: \". filesize($filename));\n header(\"Date: \" . date(\"D, d M Y H:i:s T\"));\n header(\"Last-Modified: \" . date(\"D, d M Y H:i:s T\", $filemtime), true);\n if ($this->cache_seconds>0) {\n $expires = $filemtime + $this->cache_seconds;\n $expires_txt = date(\"D, d M Y H:i:s T\",$expires);\n header(\"Expires: $expires_txt\". true);\n // HTTP 1.1\n $max_age_seconds = $filemtime + $this->cache_seconds - time();\n header(\"Cache-Control: public, max-age=\" . $max_age_seconds, true); // delta seconds\n header(\"Pragma:\", true);\n }\n fpassthru($fp);\n fclose($fp);\n }\n return true;\n }", "protected function getAvatar()\n\t{\n\t\treturn $this->avatar();\n\t}", "public function defaultAvatarUrl()\n {\n $providerURL = 'https://ui-avatars.com/api/';\n $url = $providerURL . '?' . http_build_query([\n 'name' => urlencode($this->name),\n 'size' => $this->getAvatarSize(),\n 'color' => $this->getAvatarTextColor(),\n 'background' => $this->getAvatarBackgroundColor(),\n ]);\n \n return $url;\n }", "function showImage($user_id){\r\n $query=\"SELECT * FROM users WHERE id=$user_id\";\r\n $sql= mysqli_query($_SESSION['connection'], $query);\r\n $images= mysqli_fetch_assoc($sql);\r\n $image= $images['imagenes'];\r\n return '<img src=\"data:image/jpeg;base64,'.base64_encode($image).'\" style=\"width:200px;height:200px\"/>';\r\n }", "public function show() {\n\t\t$this->create();\n\t\theader(\"Content-Type: image/png\");\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\theader(\"Content-Length: \" . filesize($this->fileName));\n\t\theader(\"ETag: \" . md5($this->fileName)); // note we calculate md5 from filename, not from the file content\n\t\theader(\"Cache-Control: max-age=3600\");\n\t\theader(\"Expires: \" . gmdate('D, j M Y H:i:s', time() + 3600) . ' GMT');\n\t\tob_clean();\n\t\tflush();\n\t\treadfile($this->fileName);\n\t}", "public function getAvatarUrlAttribute()\n {\n if (\\Storage::disk('local')->exists($this->avatar)) {\n return url(\\Storage::disk('local')->url($this->avatar));\n }\n \n return asset('images/no-image.png');\n }", "public function testUpdateAvatarImage()\n {\n }", "function netfunktheme_author_img_shortcode( $atts ){\n\t\n\textract( shortcode_atts( array(\n\t\t'user_id' => '0',\n\t\t'size' => '96',\n\t), $atts ) );\n\t\n\t$author_avatar = get_avatar($atts['user_id'], $atts['size']);\n\t\n\treturn $author_avatar;\n\t\n}", "public function show(HomeMemberImage $homeMemberImage)\n {\n //\n }", "function upm_get_avatar($avatar = '') {\r\n global $current_user;\r\n wp_get_current_user();\r\n\r\n if( $current_user && is_object($current_user) && is_a($current_user, 'WP_User')) {\r\n if ($current_user->has_cap('partner') && !empty($current_user->user_image)) {\r\n $avatar = wp_get_attachment_image_url($current_user->user_image,'thumbnail', false);\r\n } else {\r\n $avatar = get_avatar_url($current_user->ID);\r\n }\r\n }\r\n return \"<img class='avatar avatar-64 photo' src='\" . $avatar . \"'>\";\r\n}", "public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }" ]
[ "0.84803444", "0.81307083", "0.7886324", "0.7458423", "0.73834485", "0.7261296", "0.7227949", "0.7222626", "0.71745193", "0.7141436", "0.71247643", "0.7082773", "0.7069294", "0.70181876", "0.6975751", "0.6953318", "0.6916827", "0.6906564", "0.68827397", "0.68679774", "0.6856614", "0.6823282", "0.6782174", "0.6767285", "0.6742262", "0.6736052", "0.6735263", "0.6728607", "0.671442", "0.6684287", "0.66734964", "0.6665427", "0.6659887", "0.66478866", "0.66467357", "0.66412294", "0.6636015", "0.66349685", "0.66337144", "0.6632403", "0.6595295", "0.6591993", "0.65892303", "0.658364", "0.65794706", "0.6578935", "0.65710574", "0.65701604", "0.6544417", "0.6537235", "0.6523899", "0.6515672", "0.65134454", "0.6513092", "0.6511995", "0.65031093", "0.6501908", "0.6491382", "0.64865035", "0.6479136", "0.64750075", "0.64684385", "0.64661235", "0.64661235", "0.64659286", "0.64637285", "0.6461684", "0.6448964", "0.6446601", "0.64441234", "0.64433205", "0.64372265", "0.64298934", "0.6426758", "0.6413531", "0.64080113", "0.6406361", "0.6402136", "0.6399703", "0.63954115", "0.6390204", "0.63880193", "0.638694", "0.63836056", "0.63810384", "0.63779044", "0.63755006", "0.63744336", "0.63688266", "0.63643825", "0.635324", "0.6343142", "0.6343142", "0.6343142", "0.6343142", "0.6343053", "0.6341563", "0.6341563", "0.6341563", "0.6341563" ]
0.6748894
24
Render thumbnail from object storage
private function render($filename, $size) { try { $blob = $this->objectStorage->get($filename); Thumbnail::createFromString($blob) ->resize($size, $size) ->toOutput(); } catch (ObjectStorageException $e) { $this->logger->error($e->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gen_thumbnail()\n {\n }", "public function gen_thumbnail()\n {\n }", "private function generateThumbnailImagick(){\n\t}", "public function get_thumbnail()\n {\n }", "public function getThumbnail() {\r return $this->Image()->CMSThumbnail();\r }", "public static function thumbnail(){\n\n}", "public function getThumbnail()\n {\n return $this->formattedData['thumbnail'];\n }", "private function generateThumbnailGD(){\n\t\t\n\t}", "public function thumbnail()\n {\n if (null !== $this->_image) {\n return $this->_createImgTag($this->_image->thumbnail);\n }\n }", "function emvideo_dotsub_thumbnail($field, $item, $formatter, $node, $width, $height) {\n // In this demonstration, we previously retrieved a thumbnail using oEmbed\n // during the data hook.\n return $data['thumbnail'];\n}", "public function makeThumbnail() {\n Image::make($this->filePath())->fit(200)->save($this->thumbnailPath());\n }", "public function getSummaryThumbnail() {\n $data = [];\n if ($this->Image() && $this->Image()->exists()) {\n // Stretch to maximum of 36px either way then trim the extra off\n if ($this->Image()->getOrientation() === Image_Backend::ORIENTATION_PORTRAIT) {\n $data['Image'] = $this->Image()->ScaleWidth(36)->CropHeight(36);\n } else {\n $data['Image'] = $this->Image()->ScaleHeight(36)->CropWidth(36);\n }\n }\n return $this->customise($data)->renderWith(__CLASS__ . '/SummaryThumbnail')->forTemplate();\n }", "public function getThumbnail() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('thumbnail'));\n }", "public function getThumbnailUrl();", "public function thumbnail($id) {\n if($id == 0){\n redirect(base_url('assets/img/no_image_thumbnail.jpg'));\n }\n // load the thumbnail indexed by id\n $this->load->model('photos_model');\n $photo_data = $this->photos_model->get_thumbnail($id);\n\n // make sure it exists - otherwise terminate with 404 message\n if (!isset($photo_data))\n show_404();\n\n // returned data was good, load data for the view handler\n $data['header'] = \"Content-type: image/$photo_data->content_type\";\n $data['photo'] = $photo_data->photo;\n\n // let the view do what it does - send an image to the client\n $this->load->view('templates/photo', $data);\n }", "public function getThumbnailAttribute()\n {\n return asset(sprintf('storage/albums/%s.jpg', $this->slug));\n }", "protected function renderResource()\n {\n $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());\n $this->resource = $processedImageInfo['resource'];\n $this->width = $processedImageInfo['width'];\n $this->height = $processedImageInfo['height'];\n $this->persistenceManager->whiteListObject($this->resource);\n }", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n ?>\n\t\t<div class=\"happyden-feature-image\">\n\t\t\t\t<?php the_post_thumbnail( get_the_Id(), 'full' ); ?>\n\t\t</div>\n\t\t<?php\n\t}", "function video_cck_tudou_thumbnail($field, $item, $formatter, $node, $width, $height) {\n}", "function thumbnail($id)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($id)) {\n $app->getLog()->warn('thumbnail: invalid title id ' . $id);\n $app->halt(400, \"Bad parameter\");\n }\n\n $app->getLog()->debug('thumbnail: ' . $id);\n $has_cover = false;\n $rot = $app->request()->getRootUri();\n $book = $app->calibre->title($id);\n if (is_null($book)) {\n $app->getLog()->error(\"thumbnail: book not found: \" + $id);\n $app->response()->status(404);\n return;\n }\n\n if ($book->has_cover) {\n $cover = $app->calibre->titleCover($id);\n $thumb = $app->bbs->titleThumbnail($id, $cover, $globalSettings[THUMB_GEN_CLIPPED]);\n $app->getLog()->debug('thumbnail: thumb found ' . $thumb);\n $has_cover = true;\n }\n if ($has_cover) {\n $app->response()->status(200);\n $app->response()->header('Content-type', 'image/png;base64');\n $app->response()->header('Content-Length', filesize($thumb));\n readfile($thumb);\n } else {\n $app->response()->status(404);\n }\n}", "public function thumbnail()\n {\n return $this->media->where('id', $this->thumbnail_id)->first();\n }", "abstract public function get_custom_thumbnail( $size = 'thumb' );", "public function thumbnail()\n\t{\n\t\treturn $this->media()->where('id', $this->thumbnail_id)->first();\n\t}", "protected function createThumbnails() {\n\t\tglobal $prindot;\n\t\t$success = true;\n\n\t\t$fileName = $this->uploadName;\n\t\t$targetDir = $prindot['paths']['storage_root_js'];\n\n$filePath = $targetDir . $fileName;\nerror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . 'filepath:\"' . $filePath . '\"');\n\n$filePath_thumbnail = $targetDir . $prindot['paths']['thumbnails'] . DIRECTORY_SEPARATOR . $fileName;\nerror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . 'filePath_thumb:\"' . $filePath_thumbnail . '\"');\n\n$filePath_preview = $targetDir . $prindot['paths']['previews'] . DIRECTORY_SEPARATOR . $fileName;\nerror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . 'filePath_preview:\"' . $filePath_preview . '\"');\n\n\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"written file '\" . $filePath . \"'\");\n\t\t// TODO: hier thumbnail und preview generieren (und ggf. info.datei mit wichtigen daten, damit nicht immer wieder aufgefragt werden muss )\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : preview : '\" . $filePath_preview . \"'\");\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : thumbnail : '\" . $filePath_thumbnail . \"'\");\n\n\n\t\t// thumbs and previews\n\n\t\t// TODO: make preview and thumbnail with dedicated php file (same logic as with logs.php etc)\n\t\t// ... so previews may be rendered if deleted before\n\n\t\t$filename = $filePath;\n\n\t\t$dir = $_SERVER[\"SCRIPT_FILENAME\"];\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"dir '\" . $dir . \"'\");\n\n\t\t$dir = dirname($dir) . '/';\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"dir '\" . $dir . \"'\");\n\n\t\t//$dir = $dir . $prindot['paths']['storage_root_js'];\n\t\t//error_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"dir '\" . $dir . \"'\");\n\n\t\t/* Create new object */\n\t\t//$im = new Imagick( 'D:\\xampp\\htdocs\\prindot\\plupload2\\examples\\uploads\\cylinder.jpg' );\t// OK\n\t\t//$im = new Imagick( __DIR__ . '/' . $filename );\n\t\t$im = new Imagick($dir . $filename);\n\n\t\t$i = $im->getImageProperties(\"*\", true);\n\t\t//error_log(my_print_r($i));\n\t\t$r = $im->getImageResolution();\n\t\t//error_log(my_print_r($r));\n\t\t$g = $im->getImageGeometry();\n\t\t//error_log(my_print_r($g));\n\t\t//die();\n\t\t// PREVIEW\n\t\t/* Scale down */\n\t\t$im->thumbnailImage($prindot['dimensions']['previews']['width'], $prindot['dimensions']['previews']['height'], true);\n\t\t$im->setImageFormat('jpeg');\n\n\t\t/* save */\n\t\t$outpath = $dir . $filePath_preview . \".jpg\";\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"outpath '\" . $outpath . \"'\");\n\t\t@unlink($outpath);\n\t\t$im->writeImage($outpath);\n\n\t\t//echo \"preview FERTIG (\" . $outpath . \")<br>\";\n\t\t// THUMBNAIL\n\t\t/* Scale down */\n\t\t$im->thumbnailImage($prindot['dimensions']['thumbnails']['width'], $prindot['dimensions']['thumbnails']['height'], true);\n\t\t$im->setImageFormat('jpeg');\n\n\t\t/* save */\n\t\t$outpath = $dir . $filePath_thumbnail . \".jpg\";\n\t\terror_log($_SERVER[\"SCRIPT_NAME\"] . \" : \" . \"outpath '\" . $outpath . \"'\");\n\t\t@unlink($outpath);\n\t\t$im->writeImage($outpath);\n\n\t\t//echo \"thumbnail FERTIG (\" . $outpath . \")<br>\";\n\t\treturn $success;\n\t}", "abstract public function get_thumbnail( $variant = '', $size = 'thumb' );", "function getThumbnail()\n\t{\n\t\t$id= FormUtil :: getPassedValue('id', isset ($args['id']) ? $args['id'] : null, 'GET');\n\t\t$width= FormUtil :: getPassedValue('width', isset ($args['width']) ? $args['width'] : null, 'GET');\n\t\tif (!SecurityUtil :: checkPermission('crpLicense::License', '::', ACCESS_READ))\n\t\t\tpnShutDown();\n\n\t\t$file= $this->dao->getFile($id, 'image', true);\n\t\t$modifiedDate= $this->dao->getLicenseDate($id, 'lu_date');\n\n\t\tif (!(is_numeric($width) && $width > 0))\n\t\t\t$width= pnModGetVar('crpLicense', 'image_width');\n\t\t$params['width']= $width; //\t$params['append_ghosted']=1;\n\t\t$params['modifiedDate']= $modifiedDate;\n\n\t\tcrpLicense :: imageGetThumbnail($file['binary_data'], $file['name'], $file['content_type'], $params);\n\t}", "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "public function reflectionAction()\n {\n $image = __DIR__ . '/../../../data/media/test.jpg';\n $reflection = $this->thumbnailer->createReflection(40, 40, 80, true, '#a4a4a4');\n $thumb = $this->thumbnailer->create($image, [], [$reflection]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/resized_test.jpg');\n\n return false;\n }", "public function thumbnail()\n {\n return optional($this->thumb);\n }", "public function renderUri() {\n\t\tif ($this->isThumbnailPossible($this->getFile()->getExtension())) {\n\t\t\t$this->processedFile = $this->getFile()->process($this->getProcessingType(), $this->getConfiguration());\n\t\t\t$result = $this->processedFile->getPublicUrl(TRUE);\n\n\t\t\t// Update time stamp of processed image at this stage. This is needed for the browser to get new version of the thumbnail.\n\t\t\tif ($this->processedFile->getProperty('originalfilesha1') != $this->getFile()->getProperty('sha1')) {\n\t\t\t\t$this->processedFile->updateProperties(array('tstamp' => $this->getFile()->getProperty('tstamp')));\n\t\t\t}\n\t\t} else {\n\t\t\t$result = $this->getIcon($this->getFile()->getExtension());\n\t\t}\n\t\treturn $result;\n\t}", "public function thumb(){\n\treturn '/images/products/thumbs/'.$this->path;\n}", "private function thumb()\n {\n $preview = array('png', 'jpg', 'gif', 'bmp');\n\n $publicBaseUrl = 'packages/spescina/mediabrowser/src/img/icons/';\n\n if ($this->folder)\n {\n if ($this->back)\n {\n $icon = 'back';\n }\n else\n {\n $icon = 'folder';\n }\n\n $url = $publicBaseUrl . $icon . '.png';\n }\n else\n {\n if (in_array($this->extension, $preview))\n {\n $url = $this->path;\n }\n else\n {\n $url = $publicBaseUrl . $this->extension . '.png';\n }\n }\n\n return $url;\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "function islandora_oh_create_thumbnail(AbstractObject $object, $force = FALSE) {\n if (!isset($object['TN']) || $force === TRUE) {\n return islandora_oh_add_datastream($object, 'TN', drupal_get_path('module', 'islandora_oh') . '/images/audio-TN.jpg');\n }\n}", "function render($values) {\n $image = $this->get_value($values);\n if (isset($image)) {\n return theme_image(array(\n 'path' => $image->src, \n 'width' => 350,\n 'height' => 200,\n 'alt' => $image->alt, \n 'attributes' => array()\n ));\n }\n }", "public function rebuildThumb()\r\n {\r\n switch ($this->storage)\r\n {\r\n \tcase \"s3\":\r\n \r\n \t $request = \\Web::instance()->request( $this->url );\r\n \t if (empty($request['body'])) {\r\n \t throw new \\Exception('Invalid Item URL');\r\n \t }\r\n \r\n \t $buffer = $request['body'];\r\n \r\n \t break;\r\n \r\n \tcase \"gridfs\":\r\n \r\n \t $db = $this->getDb();\r\n \t $gridfs = $db->getGridFS( $this->collectionNameGridFS() );\r\n \t $length = $this->{\"length\"};\r\n \t $chunkSize = $this->{\"chunkSize\"};\r\n \t $chunks = ceil( $length / $chunkSize );\r\n \t $collChunkName = $this->collectionNameGridFS() . \".chunks\";\r\n \t $collChunks = $this->getDb()->{$collChunkName};\r\n \t \t\r\n \t $buffer = null;\r\n \t for( $i=0; $i<$chunks; $i++ )\r\n \t {\r\n \t $chunk = $collChunks->findOne( array( \"files_id\" => $this->id, \"n\" => $i ) );\r\n \t $buffer .= (string) $chunk[\"data\"]->bin;\r\n \t }\r\n \r\n \t break;\r\n \r\n \tdefault:\r\n\r\n \t throw new \\Exception('Invalid Item Storage');\r\n \t \r\n \t break;\r\n }\r\n\r\n if ( $thumb_binary_data = $this->getThumb( $buffer )) {\r\n $thumb = new \\MongoBinData( $thumb_binary_data, 2 );\r\n }\r\n \r\n $app = \\Base::instance();\r\n $files_path = $app->get('TEMP') . \"assets_thumbs\";\r\n if (!file_exists($files_path)) {\r\n mkdir( $files_path, \\Base::MODE, true );\r\n }\r\n $file_path = $files_path . '/' . $this->slug;\r\n file_put_contents( $file_path, $thumb_binary_data );\r\n \r\n return $this->set( 'thumb', $thumb )->save();\r\n }", "public function resolveThumbnailUrl();", "function _ou_df_preprocess_thumbnail(&$variables) {\n $element = $variables['element'];\n $href = '#';\n if (isset($element['#object']->field_entity_items)) {\n $ref = entity_metadata_wrapper($element['#entity_type'], $element['#object'])->field_entity_items;\n if ($ref->value()) {\n $uri = entity_uri($ref->type(), $ref->value());\n $href = url($uri['path'], $uri['options']);\n }\n }\n\n $is_video = entity_metadata_wrapper($element['#entity_type'], $element['#object'])->field_image_is_video->value();\n if ($is_video) {\n $variables['items'][0]['#prefix'] = \"<div class=\\\"int-video-link\\\"><a href=\\\"$href\\\"><div><div class=\\\"int-icon int-icon-3x int-icon-youtube-play\\\"></div></div>\";\n $variables['items'][0]['#suffix'] = '</a></div>';\n }\n elseif ($href !== '#') {\n $variables['items'][0]['#prefix'] = \"<a href=\\\"$href\\\">\";\n $variables['items'][0]['#suffix'] = '</a>';\n }\n}", "function video_cck_dailymotion_thumbnail($field, $item, $formatter, $node, $width, $height) {\n return 'http://www.dailymotion.com/thumbnail/160x120/video/'. $item['value'];\n}", "public function displayThumbnail($thumbnail_width=200) {\n\t\t// get the resized thumbnail image\n\t\t$thumbnail_image = $this->resize($thumbnail_width);\n\t\t// serve the resized thumbnail image\n\t\tImageLib::serve($thumbnail_image);\n\t}", "public function display() { ImageLib::serve($this->source_image, $this->source_image_mimetype); }", "private function generateThumbnailCmd(){\n\t}", "public function url(ObjectInterface $object) : ThumbnailInterface\n {\n return (new Url($this->imageManager))->setObject($object);\n }", "public function image()\n {\n $user_id = $this->request->getIntegerParam('user_id');\n $size = $this->request->getStringParam('size', 48);\n $hash = $this->request->getStringParam('hash');\n\n if ($size > 100) {\n $this->response->status(400);\n return;\n }\n\n $filename = $this->avatarFileModel->getFilename($user_id);\n $etag = md5($filename.$size);\n\n if ($hash !== $etag) {\n $this->response->status(404);\n return;\n }\n\n $this->response->withCache(365 * 86400, $etag);\n $this->response->withContentType('image/png');\n\n if ($this->request->getHeader('If-None-Match') !== '\"'.$etag.'\"') {\n $this->response->send();\n $this->render($filename, $size);\n } else {\n $this->response->status(304);\n }\n }", "function _createThumbnail()\r\n\t{\r\n\t\t$user=$this->auth(PNH_EMPLOYEE);\r\n\t\t$config['image_library']= 'gd';\r\n\t\t$config['source_image']= './resources/employee_assets/image/';\r\n\t\t$config['create_thumb']= TRUE;\r\n\t\t$config['maintain_ratio']= TRUE;\r\n\t\t$config['width']= 75;\r\n\t\t$config['height']=75;\r\n\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t$this->image_lib->resize();\r\n\r\n\t\tif(!$this->image_lib->resize())\r\n\t\t\techo $this->image_lib->display_errors();\r\n\t}", "protected function _generateThumbnail() {\n if ( $this->attributes['width'] == $this->_original_image_info[0] && $this->attributes['height'] == $this->_original_image_info[1] ) {\n $this->_calculated_width = $this->attributes['width'];\n return $this->_calculated_height = $this->attributes['height'];\n }\n if ( $this->attributes['width'] == 0 || $this->attributes['height'] == 0 ) {\n $this->_calculated_width = $this->_original_image_info[0];\n return $this->_calculated_height = $this->_original_image_info[1]; \n }\n //make sure the thumbnail directory exists. \n if ( !is_writable ( $this->thumbs_dir_path ) ) { \n trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE );\n }\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = (int)$this->attributes['width'];\n $this->_calculated_height = (int)$this->attributes['height'];\n return $this->src = $this->_thumb_src; \n }\n // resize image\n $image = new Image();\n $image->open( $this->src, $this->thumb_background_rgb )\n ->resize( (int)$this->attributes['width'], (int)$this->attributes['height'] )\n ->save( $this->_thumb_src, (int)$this->thumb_quality );\n $this->_thumbnail = $image;\n $this->_calculated_width = $this->_thumbnail->getWidth();\n $this->_calculated_height = $this->_thumbnail->getHeight();\n $this->src = $this->_thumb_src;\n }", "public function showThumbnails() {\n $this->generateHead();\n $thumbnailsArray = $this->getThumbnailsArray();\n for($i = 0; $i < $this->rowsCount * 2; $i ++){\n echo '<div class=\"col-xs-6\">';\n echo '<a href=\"big_img.php?img_id=' . $thumbnailsArray[$i]['id'] . '\" class=\"thumbnail\">';\n echo '<img src=\"images/thumbnails/' . $thumbnailsArray[$i]['filename'] . '\" alt=\"\">';\n echo '</a>';\n echo '</div>';\n }\n $this->generateFoot();\n }", "public function getThumbnailUrlAttribute()\n {\n return Storage::url($this->getThumbnailPath());\n }", "public function render(){\n\t\t$out = \"<img\".($this->getID() ? \" id=\\\"\".$this->getID().\"\\\"\" : \"\");\n\t\t\n\t\t$out .= \" src=\\\"\".$this->link.\"\\\"\";\n\t\t\n\t\tforeach( $this->getProperties() as $key => $value ) {\n\t\t\t$out .= \" \".$key.\"=\\\"\".$value.\"\\\"\"; //example: _width=\"100px\"\n\t\t}\n\t\t$out .= \" />\"; //end of opening html tag and html properties\n\t\t\n\t\treturn $out;\n\t}", "public function getThumbnail($instance=false){\n if ($instance && !is_object($this->_data['thumbnail'])){\n $this->setThumbnail('',array('required'=>false));\n }\n return $this->_data['thumbnail'];\n }", "protected function _generateThumbnail() {\n if ( $this->attributes['width'] == $this->_original_image_info[0] && $this->attributes['height'] == $this->_original_image_info[1] ) {\n $this->_calculated_width = $this->attributes['width'];\n return $this->_calculated_height = $this->attributes['height'];\n }\n if ( $this->attributes['width'] == 0 || $this->attributes['height'] == 0 ) {\n $this->_calculated_width = $this->_original_image_info[0];\n return $this->_calculated_height = $this->_original_image_info[1]; \n }\n //make sure the thumbnail directory exists. \n if ( !is_writable ( $this->thumbs_dir_path ) ) { \n trigger_error ( 'Cannot detect a writable thumbs directory!', E_USER_NOTICE );\n }\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = (int)$this->attributes['width'];\n $this->_calculated_height = (int)$this->attributes['height'];\n return $this->src = $this->_thumb_src; \n }\n // resize image\n $image = new Image();\n $image->open( $this->src, $this->thumb_background_rgb )\n ->resize( (int)$this->attributes['width'], (int)$this->attributes['height'] )\n ->save( $this->_thumb_src, (int)$this->thumb_quality );\n $this->_thumbnail = $image;\n $this->_calculated_width = $this->_thumbnail->getWidth();\n $this->_calculated_height = $this->_thumbnail->getHeight();\n $this->src = $this->_thumb_src;\n }", "function objectAttributeContent( $contentObjectAttribute )\n {\n $pngFilePath = '';\n $show_png = false;\n $alt = '';\n $contentObject = eZContentObject::fetch( $contentObjectAttribute->attribute( 'contentobject_id' ) );\n if( $contentObject instanceof eZContentObject )\n {\n $image = $contentObjectAttribute->storedFileInformation( $contentObject, $contentObject->attribute( 'current_version' ), $contentObjectAttribute->attribute( 'language_code' ), $contentObjectAttribute );\n if( is_array( $image ) && array_key_exists( 'url', $image ) )\n {\n $embedImagePath = $image['url'];\n $imagePathArray = explode( DIRECTORY_SEPARATOR, $embedImagePath );\n $imageFile = array_pop( $imagePathArray );\n $imageFile = preg_replace( '/(.jpg|.gif)/', '_' . $contentObject->attribute( 'current_version' ) . '.png', $imageFile );\n $pngFolder = implode( DIRECTORY_SEPARATOR, $imagePathArray ) . DIRECTORY_SEPARATOR . 'png';\n if ( !file_exists( $pngFolder ) )\n {\n eZDir::mkdir( $pngFolder, false, true );\n }\n // copy embeded image to local\n $file = eZClusterFileHandler::instance( $pngFolder . DIRECTORY_SEPARATOR . $imageFile );\n if ( is_object( $file ) && $file->exists() )\n {\n $pngFilePath = $pngFolder . DIRECTORY_SEPARATOR . $imageFile;\n #eZDebug::writeNotice( $pngFilePath, 'Fallback PNG' );\n $xml = new SimpleXMLElement( $contentObjectAttribute->attribute( \"data_text\" ) );\n $texts = $xml->{'g'}->{'text'};\n if( $texts != null )\n {\n foreach( $texts as $text )\n {\n $altArray[] = (string)$text->{0};\n }\n }\n $alt = implode( ', ', $altArray );\n #eZDebug::writeNotice( $alt, 'PNG Alt-Text' );\n }\n else\n {\n $pngFilePath = $embedImagePath;\n }\n }\n }\n $attributeContent = array( \"data_text\" => $contentObjectAttribute->attribute( \"data_text\" ),\n \"data_int\" => $contentObjectAttribute->attribute( \"data_int\" ),\n \"data_png\" => array( 'src' => $pngFilePath,\n 'alt' => $alt ) );\n\n return $attributeContent;\n }", "public abstract function render_media($instance);", "public function show(){\n\t\t // Default size is preview\n if(!empty($_GET['size'])) $size = $_GET['size'];\n else $size = 'preview';\n\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n if($pobj !== false && !$pobj->temporary && $pobj->data->status == 'saved') $pobj->show($size);\n else $this->zajlib->reroute('__error', ['system_api_photo_show', []]);\n\t\t}", "function thumbnail($file,$width='120'){\n $name=$this->_dir.DS.$file.'[0]';\n $im = new imagick($name);\n $im->setImageFormat('jpg');\n $im->scaleImage($width,0);\n header('Content-Type: image/jpeg');\n echo $im;\n }", "public function getThumbnail(){\n\t\tif($this->imagickSupport){\n\t\t\t//Generate thumbnail as Imagick library\n\t\t\t$this->generateThumbnailImagick(/* ARGS */);\n\t\t}else if($this->imagickCmdSupport){\n\t\t\t//Generate thumbnail as ImageMagick program\n\t\t\t$this->generateThumbnailCmd(/* ARGS */);\n\t\t}else if($this->gdSupport){\n\t\t\t//Generate thumbnail as GD library\n\t\t\t$this->generateThumbnailGD();\n\t\t}else{\n\t\t\t/* Fail! */\n\t\t\treturn false;\n\t\t}\n\t}", "public function render()\n {\n header('Content-Type: image/png');\n\n imagepng($this->imageResource);\n imagedestroy($this->imageResource);\n }", "public function show() {\n\t\t$this->create();\n\t\theader(\"Content-Type: image/png\");\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\theader(\"Content-Length: \" . filesize($this->fileName));\n\t\theader(\"ETag: \" . md5($this->fileName)); // note we calculate md5 from filename, not from the file content\n\t\theader(\"Cache-Control: max-age=3600\");\n\t\theader(\"Expires: \" . gmdate('D, j M Y H:i:s', time() + 3600) . ' GMT');\n\t\tob_clean();\n\t\tflush();\n\t\treadfile($this->fileName);\n\t}", "function preview()\n\t{\n\t\theader(\"Content-type: {$this->mimetype}\");\n\t\t$this->showImage();\n\t}", "public function getThumbnail()\n {\n return Kuler_Api::getThemeThumbnail((int) $this->ID);\n }", "public function file(ObjectInterface $object) : ThumbnailInterface\n {\n return (new File($this->imageManager))->setObject($object);\n }", "public function show()\n {\n $path = Storage::url('public/IMG-20180930-WA0004.jpg.jpg');\n\n return '<img src=\"' .$path. '\" alt=\"\">';\n }", "public function thumbnail(MultibannerInterface $multibanner);", "public function getThumbnailResource() {\n\t\treturn $this->thumbnailResource;\n\t}", "function print_blog_thumbnail( $post_id, $item_size ){\r\r\n\t\r\r\n\t\t$thumbnail_types = get_post_meta( $post_id, 'post-option-thumbnail-types', true);\r\r\n\t\t\r\r\n\t\tif( $thumbnail_types == \"Image\" || empty($thumbnail_types) ){\r\r\n\t\t\r\r\n\t\t\t$thumbnail_id = get_post_thumbnail_id( $post_id );\r\r\n\t\t\t$thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );\r\r\n\t\t\t$alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);\r\r\n\t\t\tif( !empty($thumbnail) ){\r\r\n\t\t\t\techo '<div class=\"blog-thumbnail-image\">';\r\r\n\t\t\t\techo '<a href=\"' . get_permalink() . '\"><img src=\"' . $thumbnail[0] .'\" alt=\"'. $alt_text .'\"/></a></div>';\r\r\n\t\t\t}\r\r\n\t\t\r\r\n\t\t}else if( $thumbnail_types == \"Video\" ){\r\r\n\t\t\t\r\r\n\t\t\t$video_link = get_post_meta( $post_id, 'post-option-thumbnail-video', true); \r\r\n\t\t\techo '<div class=\"blog-thumbnail-video\">';\r\r\n\t\t\techo get_video($video_link, gdl_get_width($item_size), gdl_get_height($item_size));\r\r\n\t\t\techo '</div>';\r\r\n\t\t\r\r\n\t\t}else if ( $thumbnail_types == \"Slider\" ){\r\r\n\r\r\n\t\t\t$slider_xml = get_post_meta( $post_id, 'post-option-thumbnail-xml', true); \r\r\n\t\t\t$slider_xml_dom = new DOMDocument();\r\r\n\t\t\t$slider_xml_dom->loadXML($slider_xml);\r\r\n\t\t\t\r\r\n\t\t\techo '<div class=\"blog-thumbnail-slider\">';\r\r\n\t\t\techo print_flex_slider($slider_xml_dom->documentElement, $item_size);\r\r\n\t\t\techo '</div>';\t\t\t\r\r\n\t\t\r\r\n\t\t}\t\r\r\n\t\t\r\r\n\t}", "function get_thumb()\n\t{\n\t\tif (!is_file($this->get_thumbfile()))\n\t\t{\n\t\t\t$this->generate_thumb();\n\t\t}\n\t\t\n\t\t$array['content_id'] = $this->id;\n\t\t@$size=getimagesize($this->get_thumbfile());\n\t\t$array['thumb_width'] = $this->$size[1];\n\t\t$array['thumb_height'] = $this->$size[2];\n\t\t$array['html'] = \"<img src=\".linkencode($this->get_thumbfile()).\" $size[3]>\";\n\t\t$array['width'] = $this->width;\n\t\t$array['height'] = $this->height;\n\t\t$array['name'] = $this->get_name();\n\t\t$array['current_rating'] = $this->get_current_rating();\n\t\t$array['views'] = $this->get_views();\n\t\t$array['comments_amount'] = $this->get_comments_amount();\n\t\treturn $array;\n\t}", "public function preview(){\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n // @todo Preview should only be visible to the user who uploaded (if user exists) and should only be saved by user who uploaded\n // @todo We can achieve this with form verification id's (which we should have anyway)\n if($pobj !== false && $pobj->temporary) $pobj->show('preview');\n else $this->zajlib->reroute('__error', ['system_api_photo_preview', []]);\n\t\t}", "abstract public function get_thumbnail_source_path();", "function show_thumb($w,$h,$zc,$cropfrom) {\n\tglobal $post;\n\t$img_customfield = get_post_meta($post->ID, 'thumb', true);\n\t$img_attachment_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );\n\t$img_uploads = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', 'numberposts' => 1) );\n\t$img_post = preg_match_all('/\\< *[img][^\\>]*src *= *[\\\"\\']{0,1}([^\\\"\\'\\ >]*)/',get_the_content(),$matches);\n\t$img_default = get_bloginfo('template_directory').'/images/no-thumb.png';\n\n\t$thumbnail = 'thumbnail.php';\n\t\n\t// get thumbnail\n\tif ($img_customfield) {\n\t\tprint '<img src=\"'.get_bloginfo('template_directory').'/'.$thumbnail.'?src='.urlencode($img_customfield).'&amp;w='.$w.'&amp;h='.$h.'&amp;zc='.$zc.'&amp;a='.$cropfrom.'\" alt=\"'.get_the_title($post).'\" title=\"'.get_the_title($post).'\"/>';\n\t} elseif ($img_attachment_image) {\n\t\tprint '<img src=\"'.get_bloginfo('template_directory').'/'.$thumbnail.'?src='.urlencode($img_attachment_image[0]).'&amp;w='.$w.'&amp;h='.$h.'&amp;zc='.$zc.'&amp;a='.$cropfrom.'\" alt=\"'.get_the_title($post).'\" title=\"'.get_the_title($post).'\"/>';\n\t} elseif ($img_uploads == true) {\n\t\tforeach($img_uploads as $id => $attachment) {\n\t\t\t$img = wp_get_attachment_image_src($id, 'full');\n\t\t\tprint '<img src=\"'.get_bloginfo('template_directory').'/'.$thumbnail.'?src='.urlencode($img[0]).'&amp;w='.$w.'&amp;h='.$h.'&amp;zc='.$zc.'&amp;a='.$cropfrom.'\" alt=\"'.get_the_title($post).'\" title=\"'.get_the_title($post).'\" />';\n\t\t}\n\t} elseif (count($matches[1]) > 0) {\n\t\tprint '<img src=\"'.get_bloginfo('template_directory').'/'.$thumbnail.'?src='.urlencode($matches[1][0]).'&amp;w='.$w.'&amp;h='.$h.'&amp;zc='.$zc.'&amp;a='.$cropfrom.'\" alt=\"'.get_the_title($post).'\" title=\"'.get_the_title($post).'\" />';\n\t} else {\n\t\tprint '<img src=\"'.get_bloginfo('template_directory').'/'.$thumbnail.'?src='.urlencode($img_default).'&amp;w='.$w.'&amp;h='.$h.'&amp;zc='.$zc.'&amp;a='.$cropfrom.'\" alt=\"'.get_the_title($post).'\" title=\"'.get_the_title($post).'\" />';\n\t}\n}", "public function getThumbnailUrl($publicPath) {\n /* $thumb = Yii::app()->thumb;\n $thumb->image = \"/var/www/escolar/web\" . $publicPath . $this->filename;\n $thumb->directory = \"/var/www/escolar/web/uploads/thumbs/\";\n //$thumb->square = true;\n $thumb->createThumb();\n $thumb->save($this->filename);\n * \n */\n Yii::app()->setComponents(array('ThumbsGen' => array(\n 'class' => 'ext.ThumbsGen.ThumbsGen',\n 'scaleResize' => null, //if it is not null $thumbWidth and $thumbHeight will be ommited. for example 'scaleResize'=>0.5 generate image with half dimension\n//one of $thumbWidth or $thumbHeight is optional but not both!\n 'thumbWidth' => 140, //the width of created thumbnail on pixel. if height is null the aspect ratio will be reserved\n 'thumbHeight' => 140, //the height of created thumbnail on pixel. if width is null the aspect ratio will be reserved\n 'baseSourceDir' => 'uploads', //the main direcory of source images. if set to null the destination dir is the <webroot>/images\n 'baseDestDir' => 'uploads/thumbs', //the main direcory of thumbnails. if set to null the destination dir is the <webroot>/images/thumbs\n //'postFixThumbName' => '_thumb', //the postfix name of thumbnail for example if it set = '_thumb' then image1.jpg become image1_thumb.jpg\n 'nameImages' => array($this->filename), //the names of images into $baseSourceDir, for example ('01.jpg','03.jpg'). the asterisk means all files jpg/jpeg, png or gif\n 'recreate' => true, //force to create each thumbnail either exist or not, when is set to false the tumbnails created only in the first time\n )));\n Yii::app()->ThumbsGen->createThumbnails();\n Yii::app()->ThumbsGen->getThumbsUrl();\n\n return \"/uploads/thumbs/\" . $this->filename;\n }", "protected function render()\n {\n $uid = 'tilt_' . uniqid();\n $settings = $this->get_settings_for_display();\n if (empty($settings['image']['url'])) {\n return;\n }\n $has_caption = $this->has_caption($settings);\n $this->add_render_attribute('container', 'class', 'designsivu-elementor-tilt-image-container');\n $this->add_render_attribute(\n 'wrapper',\n [\n 'id' => $uid,\n 'class' => ['elementor-image', 'designsivu-elementor-tilt-image'],\n ]\n );\n\n if (!empty($settings['shape'])) {\n $this->add_render_attribute('wrapper', 'class', 'elementor-image-shape-' . $settings['shape']);\n }\n $link = $this->get_link_url($settings);\n if ($link) {\n $this->add_render_attribute('link', [\n 'href' => $link['url'],\n 'data-elementor-open-lightbox' => $settings['open_lightbox'],\n ]);\n if (Plugin::$instance->editor->is_edit_mode()) {\n $this->add_render_attribute('link', [\n 'class' => 'elementor-clickable',\n ]);\n }\n if (!empty($link['is_external'])) {\n $this->add_render_attribute('link', 'target', '_blank');\n }\n if (!empty($link['nofollow'])) {\n $this->add_render_attribute('link', 'rel', 'nofollow');\n }\n } ?>\n <div <?php echo $this->get_render_attribute_string('wrapper'); ?>>\n <?php if ($has_caption) : ?>\n <figure class=\"wp-caption\">\n <?php endif; ?>\n <?php if ($link) : ?>\n <a <?php echo $this->get_render_attribute_string('link'); ?>>\n <?php endif; ?>\n <?php echo Group_Control_Image_Size::get_attachment_image_html($settings); ?>\n <?php if ($link) : ?>\n </a>\n <?php endif; ?>\n <?php if ($has_caption) : ?>\n <figcaption\n class=\"widget-image-caption wp-caption-text\"><?php echo $this->get_caption($settings); ?></figcaption>\n <?php endif; ?>\n <?php if ($has_caption) : ?>\n </figure>\n <?php endif; ?>\n </div>\n <script>\n jQuery('#<?php echo($uid); ?>').tilt({\n maxTilt: 12,\n speed: 100\n })\n </script>\n <?php\n }", "function make_thumb($image_id, $mode, $admin = false)\n{\n global $config, $tpl_section, $in_admin_cp;\n $thumb_size = $config['thumb_size'];\n $quality = $config['thumb_quality'];\n if ($in_admin_cp) {\n $admin = true;\n } else {\n $admin = false;\n }\n\n $img_fn = \"$image_id.jpg\";\n ;\n $folder = $config['abs_path'].'/public/products'; // : './public/products';\n $tolder = $config['abs_path'].'/public/products_thumbs'; // : './public/products_thumbs';\n $img_src_url = $config['site_url'].\"/public/products/$img_fn\";\n $img_th_url = $config['site_url'].\"/public/products_thumbs/$img_fn\";\n $img_sm_url = $config['site_url'].\"/public/products_thumbs/small_$img_fn\";\n $img_src = \"$folder/$img_fn\";\n $img_th = \"$tolder/$img_fn\";\n $img_sm = \"$tolder/small_$img_fn\";\n\n if (!file_exists($img_src)) { // if file not found\n if (($mode == 'feature') || ($mode == 'gallery')) {\n $mode = 'detail';\n }\n if ($mode == 'raw') {\n return false;\n }\n\n if ($mode == 'newsletter') {\n return '';\n } else {\n return \"<img border=\\\"0\\\" src=\\\"$config[site_url]/$config[skin]/images/nothumb_$mode.png\\\" title=\\\"No thumbnail\\\" alt=\\\"No thumbnail\\\" />\";\n }\n } else {\n // if thumbnail image not exists -> create it\n if ($mode == 'small') {\n $img_th = $img_sm;\n $size = 50;\n } else {\n $size = 'thumb';\n }\n if (!file_exists($img_th)) {\n image_optimizer($img_src, $img_th, $quality, $size);\n }\n }\n\n // display it ...\n if (($mode == 'list') || ($mode == 'feature')) {\n $img_txt = \"<img border=\\\"0\\\" src=\\\"$img_th_url\\\" alt=\\\"image\\\" />\";\n } elseif ($mode == 'small') {\n $img_txt = \"<img border=\\\"0\\\" src=\\\"$img_sm_url\\\" alt=\\\"image\\\" />\";\n } elseif ($mode == 'newsletter') {\t// for newsletter (need absolute url)\n $img_th = substr($img_th, 5);\n $img_txt = \"<img border=\\\"0\\\" src=\\\"$img_th_url\\\" alt=\\\"image\\\" />\";\n } elseif ($mode == 'detail') {\t// for detail.\n $item_id = substr($image_id, 0, (strpos($image_id, '_')));\n $j = strpos($image_id, '_');\n $x = substr($image_id, $j+1);\n $row = array();\n $row['img_txt'] = \"<img border=\\\"0\\\" src=\\\"$img_th_url\\\" alt=\\\"image\\\" />\";\n $row['img_fn'] = $img_src_url;\n if (!$admin) {\n $img_txt = quick_tpl($tpl_section['detail_gallery'], $row);\n } else {\n $img_txt = \"<a href=\\\"$row[img_fn]\\\">$row[img_txt]</a>\";\n }\n } else {\n $img_txt = $img_src_url;\n }\n\n return $img_txt;\n}", "public function show($data,Fileupload $fileupload)\n {\n \n $contents = Storage::url('images/sunil.jpg');\n\n echo \"<img src='\".$contents.\"' height='400px' width='200px'/>\";\n }", "function foool_partner_custom_columns_render($column_name, $post_id){\n\n switch ($column_name) {\n case 'thumb' : \n // Display Thumbnail\n $partner_thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post_id),'large');\n if (!empty($partner_thumbnail))\n echo '<img src=\"'.$partner_thumbnail[0].'\" alt=\"\" style=\"max-width:100%;\"/>';\n break;\n }\n}", "public function getDefaultThumbnail();", "public function getThumbView($idx,$conf,$rslt,$r,$id,$highlight){\n global $elastic_config;\n $ec = $elastic_config[$idx]['result'];\n $thumbnail = $conf['thumb'];\n if(isset($rslt['preview']) && $rslt['preview']!= false){\n $thumbnail = $this->getPreview($rslt);\n }else if($thumbnail != \"\" && $thumbnail != false){\n $thumbnail = \"<img src='\".$conf['thumb'].\"'/>\";\n }\n if($thumbnail != \"\"){\n $thumbnail = \"<div class='thumbnail'>\".$thumbnail.\"</div>\";\n }\n/* if(isset($rslt[$ec['title']])){\n $title = $rslt[$ec['title']];\n }else{\n $title = \"No Title\";\n }*/\n $view = $this->createThumbViewFields($ec['view'],$rslt,$highlight);\n return \"<li class='result'>\".\n \"<h2>\".\n \"<a href='#md\".$r.\"' class='fv-title' id='fv-title-\".$r.\"'>\".$this->title.\"</a>\".\n \"</h2>\".\n \"<h3 style='color:\".$conf['color'].\"'><span>\".$conf['source'].\"</span></h3>\".\n $thumbnail.$view.\n \"<div class='thumb-actions'><a href='#md\".htmlentities($r).\"' class='fv' id='\".htmlentities($r).\"'>Full View</a>\".\n \"<a href='#' id='\".$id.\"' class='save-search' title='\".html_entity_decode($this->title).\"'> + </a></div>\".\n \"</li>\";\n }", "public function render(Varien_Object $row) {\n $id = $row->getProductId();\n if (!$id) return '';\n $url = $this->getUrl('adminhtml/catalog_product/edit/', array('id' => $id));\n $str = '<a target=\"_blank\" href=\"'.$url.'\">'.$id .'</a>';\n $product = Mage::getModel('catalog/product')->load($id);\n $img = '';\n try {\n $img = $this->helper('catalog/image')->init($product, 'small_image')->resize(80);\n $str.='<div><a target=\"_blank\" href=\"'.$url.'\"><img border=0 src=\"'.$img.'\" /></a></div>';\n } catch (Exception $e) {\n // do nothing\n $str.='<div style=\"clear:both\"><div style=\"height:80px; width:80px; background-color:#fff; text-align:center; float:right;\">[no image]</div></div>';\n }\n //$img = $product->getImage();\n //$str = '<pre>'.var_export($row->getData(),true).'</pre>';\n return $str; \n }", "function display_image($entity)\n{\n\tglobal $config;\n\t\n\techo '\n\t\t\t<div class=\"heading-block clearfix\">\n\t\t\t\t<div class=\"heading-thumbnail\">';\n\t\t\t\t\n\t\n\tif (isset($entity->thumbnailUrl))\n\t{\n\t\techo '<img src=\"' . $config['thumbnail_cdn'] . get_thumbnail_url($entity->thumbnailUrl) . '\" />';\t\t\n\t}\t\n\telse\n\t{\n\t\techo '<img src=\"images/no-icon.svg\" />';\n\t}\n\t\t\n\techo '\n\t\t\t\t</div>\n\t\t\t\t<div class=\"heading-body\">\n\t\t\t\t\t<div class=\"heading-title\">';\n\t\t\t\t\t\n\techo get_literal_display($entity->name);\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"heading-description\">';\n\t\t\t\t\t\n\tif (isset($entity->description))\n\t{\n\t\techo '<div class=\"caption\">' . get_literal_display($entity->description) . '</div>';\n\t}\t\t\t\n\t\n\techo '<div id=\"identifiers\">';\n\techo '<ul class=\"identifier-list\">';\n\techo '<li><a class=\"external\" href=\"' . $entity->{'@id'} . '\" target=\"_new\">' . $entity->{'@id'} . '</a></li>';\n\techo '</ul>';\n\techo '</div>';\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\techo '\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t\t\n\t// Display image\n\techo '<div>';\t\n\techo '<img class=\"image\" src=\"' .$entity->contentUrl->{'@id'} . '\" />';\t\n\techo '</div>';\n\n\n\n\techo '\n\t\t<script>figure_is_part_of(\"' . $entity->{'@id'} . '\", \"cited_by\");</script> \n\t';\n}", "function _wp_post_thumbnail_html($thumbnail_id = \\null, $post = \\null)\n {\n }", "public function getImage() {}", "public function render(DataObject $row)\n {\n $file = $row->getFile();\n $fileExt = pathinfo($file, PATHINFO_EXTENSION);\n if ($fileExt) {\n $iconImage = $this->assetRepo->getUrl('Ecomteck_ProductAttachment::images/'.$fileExt.'.png');\n $fileIcon = \"<a href=\".$this->dataHelper->getBaseUrl().'/'.$file.\" target='_blank'>\n <img src='\".$iconImage.\"' /></a>\";\n } else {\n $iconImage = $this->assetRepo->getUrl('Ecomteck_ProductAttachment::images/unknown.png');\n $fileIcon = \"<img src='\".$iconImage.\"' />\";\n }\n \n return $fileIcon;\n }", "public function get_thumb($size) {\n\t\t$sizetext = $size['width'] . 'x' . $size['height'];\n\t\t$sizetext = Dba::escape($sizetext);\n\t\t$type = Dba::escape($this->type);\n\t\t$uid = Dba::escape($this->uid);\n\n\t\t$sql = \"SELECT `image`, `mime` FROM `image` WHERE `size`='$sizetext' AND `object_type`='$type' AND `object_id`='$uid'\";\n\t\t$db_results = Dba::read($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\t\tif (count($results)) {\n\t\t\treturn array('thumb' => $results['image'],\n\t\t\t\t'thumb_mime' => $results['mime']);\n\t\t}\n\n\t\t// If we didn't get a result\n\t\t$results = $this->generate_thumb($this->raw, $size, $this->raw_mime);\n\t\tif ($results) {\n\t\t\t$this->save_thumb($results['thumb'], $results['thumb_mime'], $sizetext);\n\t\t}\n\n\t\treturn $results;\n\t}", "public function getThumbnail() {\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n $thumbnail = sprintf(\"%s.thumbnail.jpg\", $this->filepath);\r\n \r\n if (file_exists(RP_DOWNLOAD_DIR . $thumbnail)) {\r\n $info = getimagesize(RP_DOWNLOAD_DIR . $thumbnail);\r\n \r\n return array(\r\n \"file\" => $thumbnail,\r\n \"width\" => $info[0],\r\n \"height\" => $info[1],\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $thumbnail)\r\n );\r\n }\r\n \r\n switch ($mime[0]) {\r\n case \"video\" : \r\n $avlib = self::getAVLib();\r\n \r\n exec(sprintf(\"%s -i %s%s -vsync 1 -r 1 -an -y -vframes 1 '%s%s'\", $avlib, RP_DOWNLOAD_DIR, $this->filepath, RP_DOWNLOAD_DIR, $thumbnail), $return);\r\n \r\n $info = getimagesize(RP_DOWNLOAD_DIR . $thumbnail);\r\n \r\n return array(\r\n \"file\" => $thumbnail,\r\n \"width\" => $info[0],\r\n \"height\" => $info[1],\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $thumbnail)\r\n );\r\n \r\n case \"image\" :\r\n $info = getimagesize(RP_DOWNLOAD_DIR . $this->filepath);\r\n \r\n return array(\r\n \"file\" => $this->filepath,\r\n \"width\" => $info[0],\r\n \"height\" => $info[1],\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $this->filepath)\r\n );\r\n }\r\n \r\n switch ($this->mime) {\r\n \r\n case \"application/pdf\" :\r\n case \"application/x-pdf\" : \r\n exec(\r\n sprintf(\r\n \"convert -thumbnail 800 -background white -alpha remove '%s%s'[0] %s%s\", \r\n RP_DOWNLOAD_DIR, \r\n $this->filepath, \r\n RP_DOWNLOAD_DIR, \r\n $thumbnail\r\n ), \r\n $return\r\n ); \r\n \r\n $info = getimagesize(RP_DOWNLOAD_DIR . $thumbnail);\r\n \r\n return array(\r\n \"file\" => $thumbnail,\r\n \"width\" => $info[0],\r\n \"height\" => $info[1],\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $thumbnail)\r\n );\r\n \r\n }\r\n \r\n return false;\r\n }", "function get_posts_show_thumbnail( $post_id, $thumbnail_size = 'thumbnail-square' ) {\n global $taxonomy_images_plugin;\n\n if( !isset( $post_id ) ) {\n return '';\n }\n\n $terms = wp_get_object_terms($post_id, 'shows');\n\n if( !isset($terms[0]) ) {\n return '';\n }\n\n $term = $terms[0];\n\n return $taxonomy_images_plugin->get_image_html( $thumbnail_size, $term->term_taxonomy_id );\n}", "protected function _getPreview(): ?Entity\n {\n $path = $this->_getPath();\n [$width, $height] = getimagesize($path);\n $thumber = new ThumbCreator($path);\n $thumber->resize(1200, 1200)->save(['format' => 'jpg']);\n\n return new Entity(['url' => $thumber->getUrl()] + compact('width', 'height'));\n }", "public function APIGetThumbnailSrc($size='') {\n if(!empty($this->thumbnail)) {\n return URL::to('/').base64_decode($this->thumbnail);\n }\n }", "function emc_the_term_thumbnail( $term = false ) {\r\n\r\n\tif ( ! $term ) return false;\r\n\r\n\t$term_id = $term->taxonomy . '_' . $term->term_id;\r\n\t$image_id = get_field( 'project_image', $term_id );\r\n\t$html = wp_get_attachment_image( $image_id, 'thumbnail' );\r\n\r\n\techo $html;\r\n\r\n}", "public function render()\n {\n $style = $this->getStyle();\n $text = $this->getText();\n $id = $this->objectName;\n $func = $this->getFunction();\n\n switch ($this->getValue()) {\n case \"0\":\n $image_url = $this->myPrivateImg;\n break;\n case \"1\":\n $image_url = $this->mySharedImg;\n break;\n case \"2\":\n $image_url = $this->groupSharedImg;\n break;\n case \"3\":\n $image_url = $this->otherSharedImg;\n break;\n case \"4\":\n $image_url = $this->myAssignedImg;\n break;\n case \"5\":\n $image_url = $this->myDistributedImg;\n break;\n default:\n if ($this->defaultImg == '{OPENBIZ_RESOURCE_URL}/common/images/icon_data_shared_other.gif') {\n $this->defaultImg = $this->otherSharedImg;\n }\n $image_url = $this->defaultImg;\n break;\n }\n\n if (preg_match(\"/\\{.*\\}/si\", $image_url)) {\n $formobj = $this->getFormObj();\n $image_url = Expression::evaluateExpression($image_url, $formobj);\n } else {\n $image_url = Openbizx::$app->getImageUrl() . \"/\" . $image_url;\n }\n if ($this->width) {\n $width = \"width=\\\"$this->width\\\"\";\n }\n if ($this->link) {\n $link = $this->getLink();\n $target = $this->getTarget();\n $sHTML = \"<a id=\\\"$id\\\" href=\\\"$link\\\" $target $func $style><img $width src='$image_url' /></a>\";\n } else {\n $sHTML = \"<img id=\\\"$id\\\" alt=\\\"\" . $text . \"\\\" title=\\\"\" . $text . \"\\\" $width src='$image_url' />\";\n }\n return $sHTML;\n }", "public function thumbnail($id)\n {\n return $this->getThumbnailPath($this->load($id));\n }", "public function withThumbnail($imagePath);", "public function getThumbnail() {\n\n if (file_exists($this->getUploadDir() . '/min_' . $this->path)){\n return $this->getUploadDir() . '/min_' . $this->path;\n }else{\n return $this->getWebPath();\n }\n }", "function outputImages($collectionObject) {\r\n\t$results = $collectionObject->getArray();\r\n\r\n\tfor($i=0;$i<$collectionObject->getCount();$i++){\r\n\t\techo '<div class=\"col-md-3\">';\r\n\t\techo '<a href=\"single-image.php?id=' . $results[$i]->getImageID() . '\">';\r\n\t\techo '<img src=\"travel-images/square-medium/'. $results[$i]->getPath() . '\" title=\"\" class=\"thumbnail\" />';\r\n\t\techo '</a>';\r\n\t\techo \"</div>\";\r\n\t}\r\n}", "function get_category_thumbnail_object( $cat = '' ) {\n\treturn Category_Thumbnail::get_category_thumbnail_object( $cat );\n\t\n}", "function stream_preview_image($post_id)\n {\n }", "public function getThumb(MediaInterface $media);", "protected function image_render()\r\n {\r\n // Send the correct HTTP header\r\n \\header(\"Cache-Control:no-cache,must-revalidate\");\r\n \\header(\"Pragma:no-cache\");\r\n \\header('Content-Type: image/'.static::$image_type);\r\n \\header(\"Connection:close\");\r\n\r\n // Pick the correct output function\r\n $function = '\\\\image'.static::$image_type;\r\n $function(static::$image);\r\n\r\n // Free up resources\r\n \\imagedestroy(static::$image);\r\n }", "function get_thumbnail_url($value)\n{\n\t$thumbnailUrl = '';\n\t\n\tif (is_object($value)) {\n\t\t$thumbnailUrl = $value->{'@id'};\t\t\n\t}\n\telse\n\t{\n\t\t$thumbnailUrl = $value;\t\n\t}\n\t\n\t// hack to handle CDN issues\n\t$thumbnailUrl = preg_replace('/https:\\/\\/cdn.rawgit.com\\//', 'https://raw.githubusercontent.com/', $thumbnailUrl);\n\t\n\treturn $thumbnailUrl;\n}", "static public function getThumb($obj,$smallthumb=false)\n\t{ \n\t\t$image = $obj->codeFile;\n\n\t\t$thumb = new AMAlbumThumb;\n\t\ttry {\n\t\t\t$thumb->codeFile = $image;\n\t\t\ttry {\n\t\t\t\t$thumb->load();\n\t\t\t} catch(CMDBException $e) {\n\t\t\t\tThrow $e;\n\t\t\t}\n\t\t} catch(CMObjEPropertieValueNotValid $e) {\n\t\t\tThrow $e;\n\t\t}\n\n\t\treturn $thumb;\n\t}", "function get_templ_image($post_id,$size='thumbnail') {\r\n\r\n\tglobal $post;\r\n\t/*get the thumb image*/\t\r\n\t$thumbnail = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ), $size ) ;\t\r\n\tif($thumbnail[0]!='')\r\n\t{\r\n\t\t$image_src=$thumbnail[0];\t\t\r\n\t}else\r\n\t{\r\n\t\t$post_img_thumb = bdw_get_images_plugin($post_id,$size); \r\n\t\t$image_src = $post_img_thumb[0]['file'];\r\n\t}\t\r\n\treturn $image_src;\r\n}", "public function make()\n {\n return $this->newTable()\n ->editColumn('thumbnail', function ($post) {\n $path = optional($post->base_image)->path;\n\n return view('post::admin.posts.partials.table.thumbnail', compact('path'));\n });\n }" ]
[ "0.6758778", "0.6758778", "0.67097664", "0.66169727", "0.65062666", "0.6468222", "0.63659376", "0.63577676", "0.63103616", "0.6289699", "0.6271972", "0.62567717", "0.62255365", "0.6221017", "0.6218405", "0.61952436", "0.61945945", "0.61753243", "0.611533", "0.61040545", "0.60823536", "0.6060052", "0.6050672", "0.60379034", "0.6032523", "0.60150194", "0.6013273", "0.60047793", "0.60000294", "0.5994839", "0.59899503", "0.5970031", "0.5939683", "0.59347874", "0.5920549", "0.5912379", "0.5911006", "0.59084475", "0.58710366", "0.5865118", "0.5860255", "0.58530366", "0.5849216", "0.5836163", "0.58356494", "0.583066", "0.58075166", "0.5807384", "0.5800967", "0.57958937", "0.57890874", "0.5784945", "0.57801616", "0.5772182", "0.576421", "0.5763157", "0.5756853", "0.57484215", "0.57437354", "0.5742503", "0.57377505", "0.573458", "0.5731039", "0.57290983", "0.57270664", "0.57253325", "0.57228804", "0.57169855", "0.5704791", "0.57018965", "0.5700322", "0.5683276", "0.56825334", "0.56707144", "0.56602484", "0.5652368", "0.56456304", "0.5645544", "0.5645187", "0.5642768", "0.56416506", "0.5638495", "0.5636976", "0.5634204", "0.56322783", "0.5624336", "0.56226426", "0.5621813", "0.5621666", "0.5607759", "0.55974257", "0.55936503", "0.55826896", "0.5578589", "0.5574733", "0.55666566", "0.55662835", "0.556127", "0.5558968", "0.55528754" ]
0.65742755
4
Returns a list of filters.
public function getFilters() { $filters = array( new Twig_SimpleFilter('age', 'twig_age_filter'), ); return $filters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilters();", "public function getFilters ()\n {\n $filters = [];\n\n return $filters;\n }", "public function getFilters()\n {\n $filters = [];\n\n return $filters;\n }", "protected function filters(): array\n {\n return $this->filters;\n }", "public function getAllFilters();", "public function getFilters()\n {\n return array();\n }", "public function getFilters(): array\n {\n return $this->filters;\n }", "public function getFilters()\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n return $this->filters;\n }", "public function getAllFilters()\n {\n $filters = [];\n\n foreach ($this->filters as $filter) {\n $filters = array_merge($filters, $filter->getAllFilters());\n }\n\n return $filters;\n }", "public function getFilters() : array\n {\n return $this->getLoader()->getFilters();\n }", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\LicenceType(),\n new Filter\\LicenceStatus(),\n new Filter\\LicenceTrafficArea(),\n new Filter\\EntityType(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "public function getFilters()\n {\n $filters = [];\n\n $filters[] = new \\Twig_Filter('date_format', [$this, 'filterDateFormat']);\n $filters[] = new \\Twig_Filter('truncate', 'b_truncate');\n $filters[] = new \\Twig_Filter('nl2p', 'b_nl2p', ['is_safe' => ['html']]);\n $filters[] = new \\Twig_Filter('human_file_size', 'b_human_file_size');\n $filters[] = new \\Twig_Filter('json_decode', 'json_decode');\n\n return $filters;\n }", "public function getFilters()\n {\n $filters = array();\n foreach ($this->_filters as $key => $filter) {\n if (!$filter instanceof Zend_Filter_Interface) {\n $filter = $this->_filters[$key] = $this->_loadFilter($filter);\n }\n $filters[] = $filter;\n }\n return $filters;\n }", "public function getFilters()\n {\n return [\n new TwigFilter('dump', 'dump'),\n new TwigFilter('dd', 'dd'),\n ];\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters() {\n\t\treturn array(\n\t\t\tnew Twig_SimpleFilter('trans', '__'),\n\t\t\tnew Twig_SimpleFilter('c', '__c'),\n\t\t\tnew Twig_SimpleFilter('d', '__d'),\n\t\t\tnew Twig_SimpleFilter('dc', '__dc'),\n\t\t\tnew Twig_SimpleFilter('n', '__n')\n\t\t);\n\t}", "public function getFilters()\n {\n if (null === $this->filters) {\n $this->filters = array();\n foreach ($this->getExtensions() as $extension) {\n $this->filters = array_merge($this->filters, $extension->getFilters());\n }\n }\n\n return $this->filters;\n }", "public function getFilters() \r\n\t{\r\n\t\treturn $this->_filters;\r\n\t}", "public function getFilters()\r\n {\r\n return $this->filters;\r\n }", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\AddressType(),\n new Filter\\AddressComplaint(),\n new Filter\\AddressOpposition(),\n new Filter\\LicenceStatus(),\n new Filter\\ApplicationStatus(),\n new Filter\\AddressConditionUndertaking(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "abstract protected function getFilters();", "public static function GET_FILTER(): array\n\t{\n\t\treturn self::$filters;\n\t}", "public function getFilters(): array;", "public function getFilters()\n {\n return [\n new \\Twig_SimpleFilter('getBarMsgs', [$this, 'getRedisMsgs']),\n new \\Twig_SimpleFilter('json_decode', [$this, 'jsonDecode']),\n new \\Twig_SimpleFilter('routeExists', [$this, 'routeExists'])\n ];\n }", "public function getFilters()\n {\n return array_filter($this->request->only($this->filters));\n }", "public function getFilters()\n\t{\n\t\treturn [\n\t\t\tnew \\Twig_SimpleFilter('basename', 'basename'),\n\t\t\tnew \\Twig_SimpleFilter('get_class', 'get_class'),\n\t\t\tnew \\Twig_SimpleFilter('json_decode', 'json_decode'),\n\t\t\tnew \\Twig_SimpleFilter('_', 'echo'),\n\t\t];\n\t}", "public function getAllFilters()\n {\n $endpoint = \"/v1/filter/all\";\n $response = $this->client->request(\"get\", $endpoint);\n\n return $this->responseToJson($response);\n }", "public function getFilters(): array\n {\n return $this->request->only($this->filters);\n }", "public function getFilters(): FilterCollection;", "public function getFilters() \n {\n return $this->filters;\n }", "public function getFilters()\n {\n return [\n new \\Twig_SimpleFilter('country', [$this, 'getCountry']),\n new \\Twig_SimpleFilter('language', [$this, 'getLanguage']),\n new \\Twig_SimpleFilter('locale_date', [$this, 'getLocaleDate']),\n ];\n }", "public function getFilters()\n {\n if (null === $this->filters) {\n $this->filters = new Collection();\n }\n return $this->filters;\n }", "public function & GetFilters () {\n\t\t$filters = [];\n\t\tforeach ($this->filters as $direction => $handler) \n\t\t\t$filters[$direction] = $handler[1];\n\t\treturn $filters;\n\t}", "public function getFilters(): array\n {\n return [];\n }", "public function filters()\n {\n return [\n \n ];\n }", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function getFilters()\n {\n $filters = array(\n // formatting filters\n new Twig_SimpleFilter('date', 'twig_date_format_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('date_modify', 'twig_date_modify_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('format', 'sprintf'),\n new Twig_SimpleFilter('replace', 'strtr'),\n new Twig_SimpleFilter('number_format', 'twig_number_format_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('abs', 'abs'),\n // encoding\n new Twig_SimpleFilter('url_encode', 'twig_urlencode_filter'),\n new Twig_SimpleFilter('json_encode', 'twig_jsonencode_filter'),\n new Twig_SimpleFilter('convert_encoding', 'twig_convert_encoding'),\n // string filters\n new Twig_SimpleFilter('title', 'twig_title_string_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('capitalize', 'twig_capitalize_string_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('upper', 'strtoupper'),\n new Twig_SimpleFilter('lower', 'strtolower'),\n new Twig_SimpleFilter('striptags', 'strip_tags'),\n new Twig_SimpleFilter('trim', 'trim'),\n new Twig_SimpleFilter('nl2br', 'nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))),\n // array helpers\n new Twig_SimpleFilter('join', 'twig_join_filter'),\n new Twig_SimpleFilter('split', 'twig_split_filter'),\n new Twig_SimpleFilter('sort', 'twig_sort_filter'),\n new Twig_SimpleFilter('merge', 'twig_array_merge'),\n new Twig_SimpleFilter('batch', 'twig_array_batch'),\n // string/array filters\n new Twig_SimpleFilter('reverse', 'twig_reverse_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('length', 'twig_length_filter', array('needs_environment' => true)),\n new Twig_SimpleFilter('slice', 'twig_slice', array('needs_environment' => true)),\n new Twig_SimpleFilter('first', 'twig_first', array('needs_environment' => true)),\n new Twig_SimpleFilter('last', 'twig_last', array('needs_environment' => true)),\n // iteration and runtime\n new Twig_SimpleFilter('default', '_twig_default_filter', array('node_class' => 'Twig_Node_Expression_Filter_Default')),\n new Twig_SimpleFilter('keys', 'twig_get_array_keys_filter'),\n // escaping\n new Twig_SimpleFilter('escape', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')),\n new Twig_SimpleFilter('e', 'twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')),\n );\n if (function_exists('mb_get_info')) {\n $filters[] = new Twig_SimpleFilter('upper', 'twig_upper_filter', array('needs_environment' => true));\n $filters[] = new Twig_SimpleFilter('lower', 'twig_lower_filter', array('needs_environment' => true));\n }\n return $filters;\n }", "public function filters(): array\n {\n return [\n WhereIdIn::make($this),\n WhereIn::make('namespace')->delimiter(','),\n WhereIn::make('slug'),\n ];\n }", "public function getFilters(): array\n {\n return [\n new \\Twig_SimpleFilter('extract', [$this, 'extract']),\n ];\n }", "public static function getFilterList()\n {\n return ['onePageFilter'];\n }", "public function filters()\n {\n $filters = [];\n $filters['name'] = ['trim', 'empty_string_to_null', 'capitalize'];\n $filters['email'] = ['trim', 'empty_string_to_null', 'lowercase'];\n return $filters;\n }", "public function getFilters(): array;", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "public static function alm_get_all_filters(){\n global $wpdb;\n \t$prefix = esc_sql( ALM_FILTERS_PREFIX );\n \t$options = $wpdb->options;\n \t$t = esc_sql( \"$prefix%\" );\n \t$sql = $wpdb -> prepare ( \"SELECT option_name FROM $options WHERE option_name LIKE '%s'\", $t );\n \t$filters = $wpdb -> get_col( $sql );\n\n \t$filters = ALMFilters::alm_remove_filter_license_options($filters);\n\n \treturn $filters;\n }", "public function getFilters()\n {\n return array_merge(parent::getFilters(), array(\n 'date' => new \\Twig_Filter_Function('ionic_date'),\n 'relativedate' => new \\Twig_Filter_Function('ionic_date_rel'),\n 'specialdate' => new \\Twig_Filter_Function('ionic_date_special'),\n 'url' => new \\Twig_Filter_Function('url'),\n 'nl2br_noescape' => new \\Twig_Filter_Function('nl2br'),\n 'limit' => new \\Twig_Filter_Function('Str::limit'),\n 'md5' => new \\Twig_Filter_Function('md5'),\n 'addslashes' => new \\Twig_Filter_Function('addslashes')\n ));\n }", "public function getFilters()\n {\n return array(\n new Twig_SimpleFilter('raw', 'twig_raw_filter', array('is_safe' => array('all'))),\n );\n }", "function xh_listFilters()\r\n\t{\r\n\t}", "public function getFilters () {\n $filters = array( 'word_limiter' => new Twig_Filter_Function( 'twig_word_limiter_filter', array( 'needs_environment' => true ) ) );\n\n return $filters;\n }", "public function getFilters()\n\t{\n\t\treturn array(\n\t\t\tnew \\Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),\n\t\t\t// @deprecated 3.2.0 Uses twig's JS escape method instead of addslashes\n\t\t\tnew \\Twig_SimpleFilter('addslashes', 'addslashes'),\n\t\t);\n\t}", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "public function getFilters(): array\n {\n return [\n new TwigFilter('sonata_urlsafeid', [$this, 'getUrlsafeIdentifier']),\n ];\n }", "public function getFilters() {\n\n return [\n new TwigFilter('trans_items', [$this, 'translationItems']),\n ];\n }", "public function GetFilters ();", "public function getFilters(): array {\n\n return [\n new TwigFilter(\"adminBSBButtonLink\", [$this, \"bootstrapButtonLinkFilter\"], [\"is_safe\" => [\"html\"]]),\n new TwigFilter(\"adminBSBButtonSubmit\", [$this, \"bootstrapButtonSubmitFilter\"], [\"is_safe\" => [\"html\"]]),\n ];\n }", "public function provideFilters() {\n return [\n 'filter ID mapped to plugin that exists' => [\n 'foo',\n 'filter_html',\n ],\n 'filter ID not mapped but unchanged from the source and the plugin exists' => [\n 'filter_html',\n 'filter_html',\n ],\n 'filter ID mapped to plugin that does not exist' => [\n 'baz',\n 'filter_null',\n 'php_code',\n ],\n 'filter ID not mapped but unchanged from the source and the plugin does not exist' => [\n 'php_code',\n 'filter_null',\n 'php_code',\n ],\n 'filter ID set and the plugin does not exist' => [\n ['filter', 1],\n 'filter_null',\n 'filter:1',\n ],\n 'transformation-only D7 contrib filter' => [\n 'editor_align',\n '',\n NULL,\n TRUE,\n ],\n 'non-transformation-only D7 contrib filter' => [\n 'bbcode',\n 'filter_null',\n ],\n ];\n }", "public function getFilters() {\n\t\treturn array(\n\t\t\t'size' => new Twig_Filter_Function('Cake_Number_Filters::size'),\n\t\t\t'pct' => new Twig_Filter_Function('Cake_Number_Filters::percentage'),\n\t\t\t'curr' => new Twig_Filter_Function('Cake_Number_Filters::currency'),\n\t\t\t'p' => new Twig_Filter_Function('Cake_Number_Filters::precision'),\n\t\t);\n\t}", "public function getFilters()\n {\n return [\n 'setting' => new TwigFilter(\n 'setting',\n [$this, 'settingFilter'],\n []\n ),\n ];\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function getFilterables()\n {\n return $this->filterables;\n }", "protected function get_filters() {\n $langautoass = get_string('auto_assign', 'local_elisprogram');\n $filters = array(\n new deepsight_filter_usersetuser_autoassigned($this->DB, 'autoass', $langautoass, array(), $this->endpoint)\n );\n $filters = array_merge(parent::get_filters(), $filters);\n return $filters;\n }", "public function getFilters() {\n $filters = [];\n\n // Add a default filter on the publishing status field, if available.\n if ($this->entityType && is_subclass_of($this->entityType->getClass(), EntityPublishedInterface::class)) {\n $field_name = $this->entityType->getKey('published');\n $this->filters = [\n $field_name => [\n 'value' => TRUE,\n 'table' => $this->base_table,\n 'field' => $field_name,\n 'plugin_id' => 'boolean',\n 'entity_type' => $this->entityTypeId,\n 'entity_field' => $field_name,\n ],\n ] + $this->filters;\n }\n\n $default = $this->filter_defaults;\n\n foreach ($this->filters as $name => $info) {\n $default['id'] = $name;\n $filters[$name] = $info + $default;\n }\n\n return $filters;\n }", "public function getFilters()\n {\n return array(\n new Twig_SimpleFilter('formatDate', array($this, 'formatDate'), array('rawDate', 'format')),\n new Twig_SimpleFilter('russianPluralForm', array($this, 'russianPluralForm'), array('string', 'count', 'delimiter')),\n );\n }", "public function filters(): array\n {\n return [\n new DefaultSorted('created_at', 'desc')\n ];\n }", "public function getFilters()\n {\n return $this->getOptions()\n ->joinWith('taxGroup.lang')\n ->joinWith('lang');\n }", "public function getFilter(): array\n {\n return $this->model->getFilter();\n }", "public function getFilters() {\n\t\tif (!$this->filter) {\n\t\t\t$f = $this->db->getAndFilter();\n\t\t} else {\n\t\t\t$f = $this->filter;\n\t\t}\n\t\tforeach ($this->join as $j) {\n\t\t\t$f->subEq($j[2]->getFilters());\n\t\t}\n\t\treturn $f;\n\t}", "public function getFilter();", "public function getFilter();", "public function getFilters()\n {\n return array(\n 'sortable' => new \\Twig_Filter_Method($this, 'sortable', array('is_safe' => array('html'))),\n 'paginate' => new \\Twig_Filter_Method($this, 'paginate', array('is_safe' => array('html')))\n );\n }", "public function getActiveFilters()\n {\n \t$ret = $this->getSettingValue('filters', []);\n \treturn (is_array($ret)) ? $ret : [];\n }", "public function getFilters()\n\t{\n\t\t$columnFilters = array();\n\t\t$globalFilters = array();\n\n\t\tforeach ($this->request->getFilters() as $filter)\n\t\t{\n\t\t\t// If the filter is an array where the key matches one of our\n\t\t\t// columns, we're filtering that column.\n\t\t\tif (is_array($filter))\n\t\t\t{\n\t\t\t\t$filterValue = reset($filter);\n\t\t\t\t$filterColumn = key($filter);\n\n\t\t\t\tif (($index = array_search($filterColumn, $this->dataGrid->getColumns())) !== false)\n\t\t\t\t{\n\t\t\t\t\tif ( ! is_numeric($index))\n\t\t\t\t\t{\n\t\t\t\t\t\t$filterColumn = $index;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->extractFilterFeatures($filterValue) as $feature)\n\t\t\t\t{\n\t\t\t\t\tlist($featureOperator, $featureValue) = $feature;\n\t\t\t\t\t$columnFilters[] = array($filterColumn, $featureOperator, $featureValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise if a string was provided, the\n\t\t\t// filter is an \"or where\" filter across all\n\t\t\t// columns.\n\t\t\telseif (is_string($filter))\n\t\t\t{\n\t\t\t\tforeach ($this->extractFilterFeatures($filter) as $feature)\n\t\t\t\t{\n\t\t\t\t\tlist($featureOperator, $featureValue) = $feature;\n\t\t\t\t\t$globalFilters[] = array($featureOperator, $featureValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn array($columnFilters, $globalFilters);\n\t}", "public function getFilters()\r\n {\r\n\r\n return array(new \\Twig_SimpleFilter('montantTva', array($this, 'montantTva')));\r\n }", "protected function getFilter() {\n\t\t$conditions = $this->getConditions();\n\t\treturn $conditions;\n\t}", "public function getFilter(): array\n {\n return $this->filter;\n }", "public function getFilter(): array\n {\n return $this->filter;\n }", "public function get_filters_list($with_choices = false) {\n\t\tif (empty(self::$sl_filter_options)) {\n\t\t\tself::$sl_filter_options = PL_Shortcode_CPT::get_listing_filters(false, $with_choices);\n\t\t}\n\t\treturn self::$sl_filter_options;\n\t}", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "public function getFilters()\r\n {\r\n return array(\r\n new \\Twig_SimpleFilter('sha1', array($this, 'sha1Filter')),\r\n );\r\n }", "public function getFilters()\r\n {\r\n return array(\r\n 'localizeddate' => new Twig_Filter_Function('twig_localized_date_filter', array('needs_environment' => true)),\r\n );\r\n }", "public function getFilters() {\n\t\treturn $this->getWorksheet()->getFilters();\n\t}", "public static function getFilters() {\n\t\t$filters = new stdClass();\n\n\t\t$filters->offset = array_key_exists('offset', $_GET) ? intval($_GET['offset']) : 0;\n\t\t$filters->count = array_key_exists('count', $_GET) ? intval($_GET['count']) : 100;\n\n\t\treturn $filters;\n\t}", "private function getFilterList(): array\n {\n if ($this->filterList === null) {\n $filterListList = [];\n foreach (glob(__DIR__ . '/../../_files/state-filter-list*.php') as $filterListFile) {\n $filterListList[] = include($filterListFile);\n }\n $this->filterList = array_merge_recursive(...$filterListList);\n }\n return $this->filterList;\n }", "abstract public function filters();", "public function getFilters (): array\n\t{\n\t\treturn [\n\t\t\t\"itemName\" => \"itemName\"\n\t\t];\n\t}", "public function getSelectedFilters()\n {\n $filters = $this->form->getData();\n $filters = array_filter((array) $filters, [$this, 'filterValues']);\n $filters = $this->filterCollection->convertValuesToLabels($filters);\n\n return $filters;\n }", "public function getFilters()\n {\n return array(\n 'safe' => new Twig_Filter_Function('twig_safe_filter', array('is_escaper' => true)),\n );\n }", "public function filters(Request $request)\n {\n return [\n Filters\\Complex::make(),\n\n Filters\\Building::make(),\n ];\n }", "public function filters()\n\t{\n\t\t// return the filter configuration for this controller, e.g.:\n\t\treturn array(\n\t\t\t// 'inlineFilterName',\n\t\t\t// array(\n\t\t\t// \t'class'=>'path.to.FilterClass',\n\t\t\t// \t'propertyName'=>'propertyValue',\n\t\t\t// ),\n // 'accessControl', // perform access control for CRUD operations\n // 'postOnly + delete', // we only allow deletion via POST request\n\t\t);\n\t}", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function getApplicableFilters()\n\t{\n\t\t$filters = App::getEntityRepository('DeskPRO:TicketFilter')->getAll();\n\t\t$filters_apply = array();\n\n\t\t$this->logMessage(\"Filters to check: \" . count($filters));\n\n\t\t$changed_fields = $this->getChangedFields();\n\t\t$new_messages = $this->tracker->getChangedProperty('messages') ? true : false;\n\n\t\t$hidden_changed = false;\n\t\tif (in_array('ticket.hidden_status', $changed_fields)) {\n\t\t\t$hidden_changed = true;\n\t\t}\n\n\t\tforeach ($filters as $filter) {\n\t\t\tif ($new_messages || $hidden_changed || $filter->getSearcher()->hasAnyAffectedFields($changed_fields)) {\n\t\t\t\t$filters_apply[] = $filter;\n\t\t\t}\n\t\t}\n\n\t\t$this->logMessage(\"Passed filters: \" . count($filters_apply));\n\n\t\treturn $filters_apply;\n\t}", "public function getFilters()\n {\n return array(\n new \\Twig_SimpleFilter('ellipse', array($this, 'getEllipse')),\n );\n }" ]
[ "0.8373732", "0.8306297", "0.8274772", "0.81312406", "0.8093324", "0.80923104", "0.804397", "0.8036365", "0.7975012", "0.7962499", "0.79219514", "0.78743917", "0.7870811", "0.7866746", "0.7831113", "0.7831113", "0.7831113", "0.7831113", "0.7831113", "0.7831113", "0.7831113", "0.7831113", "0.7831113", "0.7820745", "0.78095484", "0.7790984", "0.7790812", "0.7789586", "0.77519804", "0.7726593", "0.77098393", "0.7677735", "0.766606", "0.76441693", "0.76186746", "0.7615692", "0.76082873", "0.760049", "0.7599027", "0.75534725", "0.7542594", "0.7530353", "0.7470143", "0.7424771", "0.74228686", "0.73935115", "0.73856986", "0.7363532", "0.734124", "0.7317592", "0.7268469", "0.7259009", "0.7255343", "0.7255186", "0.72516155", "0.72455704", "0.72434515", "0.72423446", "0.72270626", "0.72168547", "0.7190543", "0.7181312", "0.71810293", "0.7171287", "0.7168004", "0.71445715", "0.71445715", "0.7104304", "0.71005404", "0.70958036", "0.7043987", "0.7040838", "0.7037993", "0.7008633", "0.7001145", "0.6995989", "0.6995989", "0.6985765", "0.69622064", "0.69579184", "0.6956631", "0.6942597", "0.6941583", "0.6941583", "0.69155174", "0.6913331", "0.68585086", "0.6850587", "0.6849636", "0.684268", "0.68409413", "0.68184745", "0.68154263", "0.67592114", "0.6749795", "0.67424333", "0.67119616", "0.67086047", "0.670834", "0.6687738" ]
0.7763301
28
Name of this extension
public function getName() { return 'date'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName(): string\n {\n return 'Extension';\n }", "public function getExtensionName() {}", "public function getName()\n {\n return self::EXTENSION_NAME;\n }", "public function getExtensionName() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "abstract public function getExtensionName();", "public function getName()\n\t{\n\t\treturn str_replace(\".{$this->getExtension()}\", '', $this->path);\n\t}", "public function getName()\n {\n return 'metainfos_extension';\n }", "public function getName()\n {\n // TODO: Implement getName() method.\n return 'MyTwExtension';\n }", "public function getName()\r\n {\r\n\r\n // TODO: Implement getName() method.\r\n return 'montant_tva_extention';\r\n }", "public function getName()\n {\n // TODO: Implement getName() method.\n return \"troiswa_back.twig_extension\";\n }", "public function getExtensionName()\n {\n return FluentDriver::EXTENSION_NAME;\n }", "public function getName()\n {\n return 'user_extension';\n }", "public function getName()\n {\n return 'note_extension';\n }", "public function getName()\n {\n return 'tyhand_docdownloader_extension';\n }", "public function getName()\n {\n return 'bvw_upload_extension';\n }", "public function getName()\n {\n return 'siciarek_js_trans_twig_extension';\n }", "public function getName()\n {\n return 'AssetExtension';\n }", "public function getName()\n {\n return 'HiQDev General Use Yii 2 Extension Generator';\n }", "public function getName()\n {\n return 'fitbase_questionnaire_extension';\n }", "public function getName()\n {\n return 'h5p_extension';\n }", "public function getName()\n {\n return 'bundle_extension';\n }", "public function getName()\n {\n return 'bundle_extension';\n }", "function getNameWithoutExtension() ;", "public static function getName()\n {\n }", "public function get_name() {\n return get_string('pluginname', 'local_assessmentextensions');\n }", "public function getName()\n {\n return 'szg_feed_twig_extension';\n }", "public function getName()\n {\n return 'app_setting_extension';\n }", "protected function getName() {}", "public function getName ();", "public function getName() {\n\t}", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "protected function name()\n {\n }", "public function getName()\n {\n return 'jwkh_extension';\n }", "public function getNameWithoutExtension() {}", "public function getNameWithoutExtension() {}", "public function getName()\n {\n return $this->_path['filename'];\n }", "public static function getName()\n\t{\n\t\treturn self::$filename;\n\t}", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public function name() {\n\t\treturn \"Беремена\";\n\t}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getName() {}", "public function getExtensionName()\n\t{\n\t\treturn false;\n\t}", "public function getExtensionName()\n\t{\n\t\treturn false;\n\t}", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();", "public function getName();" ]
[ "0.84646", "0.8322696", "0.82690585", "0.819326", "0.8116347", "0.8007436", "0.7975366", "0.79311234", "0.7764726", "0.7695189", "0.76817185", "0.76363313", "0.76333725", "0.7598651", "0.7592394", "0.7560336", "0.7557778", "0.75449234", "0.7540668", "0.74871445", "0.74728084", "0.74728084", "0.7472192", "0.7466494", "0.74600315", "0.7454227", "0.74499965", "0.7425329", "0.7390803", "0.73906416", "0.7386046", "0.7386046", "0.7386046", "0.7386046", "0.7370673", "0.7367771", "0.73539776", "0.73534995", "0.73510295", "0.7348753", "0.7346296", "0.7344021", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7342529", "0.7341667", "0.7341667", "0.7341594", "0.7341594", "0.7341594", "0.73287433", "0.73287433", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753", "0.7326753" ]
0.0
-1
Returns age depending on birthdate.
function twig_age_filter($birthdate) { if (!$birthdate instanceof \DateTime) $birthdate = new \DateTime($birthdate); $age = $birthdate->diff(new \DateTime())->y; return $age; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAge()\n\t{\n\t\t$date_birthday = $this->getAnswer('birthday');\n\t\t$date_birthday = convert_date_to_age($date_birthday);\n\t\treturn $date_birthday;\n\n\t}", "function get_age($date_of_birth) //day-month-year\n\t\t{\n\t\t\t$bdate = explode(\"-\", $date_of_birth);\n\t\t\t$day\t= isset($bdate[0]) ? (int)$bdate[0] : 0;\n\t\t\t$month\t= isset($bdate[1]) ? (int)$bdate[1] : 0;\n\t\t\t$year\t= isset($bdate[2]) ? (int)$bdate[2] : 0;\n\t\t\tif ($year)\n\t\t\t{\n\t\t\t\t$age = date(\"Y\") - $year;\n\t\t\t\tif (($month > date(\"m\")) || ($month == date(\"m\") && date(\"d\") < $day))\n\t\t\t\t{\n\t\t\t\t\t$age -= 1;\n\t\t\t\t}\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function get_age($dob){\n\t\treturn floor((time() - strtotime($dob))/31556926);\n\t}", "private function getAge()\n {\n return $this->getAge($this->dob);\n }", "public function getAge() {\n date_default_timezone_set('America/New_York');\n list($year,$month,$day) = explode(\"-\",$this->birthDate);\n $year_diff = date(\"Y\") - $year;\n $month_diff = date(\"m\") - $month;\n $day_diff = date(\"d\") - $day;\n if ($month_diff < 0 || ($month_diff == 0 && $day_diff < 0)) {\n $year_diff--;\n }\n return $year_diff;\n }", "public function getAge() {\n\t\tif ($this->birthday) {\n\t\t\t// split date\n\t\t\t$year = $month = $day = 0;\n\t\t\t$optionValue = explode('-', $this->birthday);\n\t\t\tif (isset($optionValue[0])) $year = intval($optionValue[0]);\n\t\t\tif (isset($optionValue[1])) $month = intval($optionValue[1]);\n\t\t\tif (isset($optionValue[2])) $day = intval($optionValue[2]);\n\t\t\t\n\t\t\t// calc\n\t\t\tif ($year) {\n\t\t\t\t$age = DateUtil::formatDate('%Y', null, false, true) - $year;\n\t\t\t\tif (intval(DateUtil::formatDate('%m', null, false, true)) < intval($month)) $age--;\n\t\t\t\telse if (intval(DateUtil::formatDate('%m', null, false, true)) == intval($month) && DateUtil::formatDate('%e', null, false, true) < intval($day)) $age--;\n\t\t\t\treturn $age;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public function birthday(bool $age = false)\n {\n // If age is requested calculate it\n if ($age) {\n // Create dates\n $birthday = date_create($this->birthday);\n $now = date_create(date('Y-m-d'));\n\n // Get the difference\n $diff = date_diff($birthday, $now);\n\n // Return the difference in years\n return (int) $diff->format('%Y');\n }\n\n // Otherwise just return the birthday value\n return $this->birthday;\n }", "public function age(){\n return $this->dob->age;\n }", "function GetAge($dob) \r\n\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t$dob=explode(\"/\",$dob); \r\n\t\t\t\t\t\t\t\t\t\t$curMonth = date(\"m\");\r\n\t\t\t\t\t\t\t\t\t\t$curDay = date(\"j\");\r\n\t\t\t\t\t\t\t\t\t\t$curYear = date(\"Y\");\r\n\t\t\t\t\t\t\t\t\t\t$age = $curYear - $dob[2]; \r\n\t\t\t\t\t\t\t\t\t\tif($curMonth<$dob[1] || ($curMonth==$dob[1] && $curDay<$dob[0])) \r\n\t\t\t\t\t\t\t\t\t\t\t$age--; \r\n\t\t\t\t\t\t\t\t\t\treturn $age; \r\n\t\t\t\t\t\t\t\t\t}", "public function age()\r\n {\r\n\r\n // Note that A DOB object is based on a date-range and the exact date is\r\n // usually unknown so for age calculation the the middle of the range is\r\n // assumed to be the real date-of-birth.\r\n\r\n if (!empty($this->date_range))\r\n {\r\n $dob = $this->date_range->middle();\r\n $today = new DateTime('now', new DateTimeZone('GMT'));\r\n\r\n $diff = $today->format('Y') - $dob->format('Y');\r\n\r\n if ($dob->format('z') > $today->format('z'))\r\n {\r\n $diff -= 1;\r\n }\r\n\r\n return $diff;\r\n }\r\n return;\r\n }", "public function dateOfBirthToAge($birthdate) {\n // $birthdate = \"2016-08-01\";\n //explode the date to get month, day and year\n $birthdate = explode(\"-\", $birthdate);\n //get age from date or birthdate\n $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $birthdate[1], $birthdate[2], $birthdate[0]))) > date(\"md\")\n ? ((date(\"Y\") - $birthdate[0]) - 1)\n : (date(\"Y\") - $birthdate[0]));\n return $age;\n }", "public function getAgeAttribute ()\n\t{\n\t\treturn \\Carbon\\Carbon::parse($this->birthdate)->age;\n\t}", "public function getAge()\n {\n $this->checkJMBG();\n\n $timestamp = $this->getBirthdayTimeStamp();\n $now = time();\n $diff = $now - $timestamp;\n return date('Y', $diff) - 1970;\n }", "function getAge($birthDate){\n $birthDate = explode('/', $birthDate);\n $birthYear = $birthDate[2];\n $date = date('Y');\n $age = date_diff(date_create($birthYear), date_create($date));\n \n return $age->format('%Y');\n}", "static function calculateAge($birthDate) {\n if (empty($birthDate)) {\n return 0;\n }\n $birthDay = new DateTime($birthDate);\n $toDay = new DateTime(date('Y-m-d'));\n $dateDiff = $toDay->diff($birthDay);\n $age = $dateDiff->y;\n return $age;\n }", "function ageCalculator($dob)\n{\n\tif(!empty($dob))\n\t{\n\t\t$birthdate = new DateTime($dob);\n\t\t$today = new DateTime('today');\n\t\t$age = $birthdate->diff($today)->y;\n\t\treturn $age;\n\t}\n\telse\n\t{\n\t\treturn 0;\n\t}\n}", "public function getAge()\n {\n if ($this->age) {\n return $this->age;\n }\n\n $this->age = $this->getBirthDate()->diff(new \\DateTime())->y;\n\n return $this->age;\n }", "public function getAge()\n {\n if ($dob = $this->getDob()) {\n $now = new \\Datetime('now');\n $today['month'] = $now->format('m');\n $today['day'] = $now->format('d');\n $today['year'] = $now->format('Y');\n\n $years = $today['year'] - $dob->format('Y');\n\n if ($today['month'] <= $dob->format('m')) {\n if ($dob->format('m') == $today['month']) {\n if ($dob->format('d') > $today['day'])\n $years--;\n } else\n $years--;\n }\n\n return $years;\n }\n\n return null;\n }", "function DetermineAgeFromDOB ($YYYYMMDD_In)\n{\n $yIn=substr($YYYYMMDD_In, 0, 4);\n $mIn=substr($YYYYMMDD_In, 4, 2);\n $dIn=substr($YYYYMMDD_In, 6, 2);\n\n $ddiff = date(\"d\") - $dIn;\n $mdiff = date(\"m\") - $mIn;\n $ydiff = date(\"Y\") - $yIn;\n\n // Check If Birthday Month Has Been Reached\n if ($mdiff < 0)\n {\n // Birthday Month Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n } elseif ($mdiff==0)\n {\n // Birthday Month Currently\n // Check If BirthdayDay Passed\n if ($ddiff < 0)\n {\n //Birthday Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n }\n }\n return $ydiff;\n}", "public static function calculateAge( $birthDate = false )\n\t{\n\t\tif( !$birthDate )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t//explode the date to get month, day and year\n\t\t$birthDate = explode( \"-\", $birthDate );\n\n\t\tif( count( $birthDate ) != 3 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t//get age from date or birthDate\n\t\t$age = ( date( \"md\", date( \"U\", mktime( 0, 0, 0, $birthDate[ 0 ], $birthDate[ 1 ], $birthDate[ 2 ] ) ) ) > date( \"md\" ) ? ( ( date( \"Y\" ) - $birthDate[ 0 ] ) - 1 ) : ( date( \"Y\" ) - $birthDate[ 0 ] ) );\n\n\t\treturn (int)$age;\n\t}", "function getAge($birthday)\n{\n if (strtotime($birthday)) {\n $date = new DateTime($birthday);\n $now = new DateTime();\n $interval = $now->diff($date);\n return $interval;\n }\n}", "function getAge($dob) { \n $dob = explode(\"/\", $dob); \n $curMonth = date(\"m\");\n $curDay = date(\"j\");\n $curYear = date(\"Y\");\n // echo \"curYear: $curYear\";\n $age = $curYear - $dob[2]; \n if($curMonth<$dob[0] || ($curMonth==$dob[0] && $curDay<$dob[1])) \n $age--; \n return $age; \n}", "public function getAgeAttribute() {\n return Carbon::createFromDate($this->attributes['DOB'])->age;\n }", "function getAge($DOB) \n{\n $birth = explode(\"-\", $DOB);\n $age = date(\"Y\") - $birth[0];\n if(($birth[1] > date(\"m\")) || ($birth[1] == date(\"m\") && date(\"d\") < $birth[2]))\n {\n $age -= 1;\n }\n return $age;\n}", "function DetermineAgeGET_DOB_Prod ($YYYYMMDD_In) {\n $yIn=substr($YYYYMMDD_In, 0, 4);\n $mIn=substr($YYYYMMDD_In, 4, 2);\n $dIn=substr($YYYYMMDD_In, 6, 2);\n\n $ddiff = date(\"d\") - $dIn;\n $mdiff = date(\"m\") - $mIn;\n $ydiff = date(\"Y\") - $yIn;\n\n // Check If Birthday Month Has Been Reached\n if ($mdiff < 0)\n {\n // Birthday Month Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n } elseif ($mdiff==0)\n {\n // Birthday Month Currently\n // Check If BirthdayDay Passed\n if ($ddiff < 0)\n {\n //Birthday Not Reached\n // Subtract 1 Year From Age\n $ydiff--;\n }\n }\n return $ydiff;\n }", "function calcAge($birthday)\n{\n\n \n if (strtotime($birthday)) {\n\n $birthday = date_parse($birthday);\n $currentDate = date_parse(date(\"Y-m-d\", time()));\n\n $year = $currentDate['year'] - $birthday['year'];\n $month = $currentDate['month'] - $birthday['month'];\n $day = $currentDate['day'] - $birthday['day'];\n\n if ($day < 0) {\n $day = 30 + $day;\n $month--;\n }\n\n if ($month < 0) {\n $month = 12 + $month;\n $year--;\n }\n\n return [\n 'year' => $year,\n 'month' => $month,\n 'day' => $day,\n ];\n\n }\n\n\n}", "public function isValidAge($dob)\n {\n $customerDob = new Zend_Date($dob); // Zend_Date::ISO_8601\n if (!Zend_Date::isDate($customerDob)) {\n return 'wrongdate';\n }\n $currentDate = new Zend_Date(Mage::getModel('core/date')->timestamp(time()), Zend_Date::TIMESTAMP);\n $minDob = clone $currentDate;\n $minDob->subYear(18);\n $maxDob = clone $currentDate;\n $maxDob->subYear(125);\n\n if(!$customerDob->isEarlier($minDob)) {\n return 'young';\n } else if(!$customerDob->isLater($maxDob)) {\n return 'old';\n } else {\n return 'success';\n }\n }", "public function isValidAge($dob)\n {\n $customerDob = new Zend_Date($dob); // Zend_Date::ISO_8601\n if (!Zend_Date::isDate($customerDob)) {\n return 'wrongdate';\n }\n $currentDate = new Zend_Date(Mage::getModel('core/date')->timestamp(time()), Zend_Date::TIMESTAMP);\n $minDob = clone $currentDate;\n $minDob->subYear(18);\n $maxDob = clone $currentDate;\n $maxDob->subYear(125);\n\n if(!$customerDob->isEarlier($minDob)) {\n return 'young';\n } else if(!$customerDob->isLater($maxDob)) {\n return 'old';\n } else {\n return 'success';\n }\n }", "function Age ($date, $year = true, $month = false, $day = false)\r{\r\t$byear = substr ($date, 0, 4);\r\t$bmonth = substr ($date, 5, 2);\r\t$bday = substr ($date, 7, 2);\r\r\t$today = getdate();\r\t$tyear = $today['year'];\r\t$tmonth = $today['mon'];\r\t$tday = $today['mday'];\r\r\t$years = $tyear - $byear + ($bmonth > $tmonth ? -1 : 0);\r\t$months = $tmonth - $bmonth;\r\tif ($months < 0) $months += 12;\r\t$days = $tday - $bday;\r\tif ($days < 0) $months += 31;\r\r\tif ($year) $result = $years . ' years';\r\telse $months += 12 * $years;\r\r\tif ($month) $result .= ' ' . $months . ' months';\r\telse $days += $months * 31;\r\r\tif ($day) $result .= ' ' . $days . ' days';\r\r\treturn $result;\r}", "function calcularIdade($birthDate){\n\n\t\t\t\t//explode the date to get month, day and year\n\t\t\t\t$birthDate = explode(\"/\", $birthDate);\n\n\t\t\t\t//get age from date or birthdate\n\t\t\t\t$age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date(\"md\") ? ((date(\"Y\") - $birthDate[2]) - 1) : (date(\"Y\") - $birthDate[2]));\n\t\t\t\treturn $age;\n\t\t}", "function ageCalculator($dob){\n if(!empty($dob)){\n $birthdate = new DateTime($dob);\n $today = new DateTime('today');\n $age = $birthdate->diff($today)->y;\n return $age;\n }else{\n return 0;\n }\n}", "public function getAge()\n {\n // future dates have no age\n return max(0, $this->difference(self::now())->getYears());\n }", "public function getAgeAttribute()\n\t{\n\t\treturn now()->diffInYears($this->birthdate);\n\t}", "public function getAgeAttribute($value)\n {\n return Carbon::parse($this->birthdate)->age;\n }", "public function getAge()\n {\n //function qui calcule l'age de leleve \n $now = new \\DateTime('now');\n $age = $this->getDateNaissance();\n $difference = $now->diff($age);\n\n return $difference->format('%y Ans');\n }", "public function age() {\n $years = ((integer) date('Y')) - $this->year;\n\n if (((integer) date('n')) < $this->month) {\n $years -= 1;\n }\n else if (((integer) date('n')) == $this->month) {\n if (((integer) date('j')) < $this->day) {\n $years -= 1;\n }\n }\n\n return $years;\n }", "function dob2age($myTimestamp) {\n // Separate parts of DOB timestamp\n $matches = array();\n preg_match('/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)/',\n $myTimestamp, $matches\n );\n //var_dump($matches);\n $dobYear = (int)$matches[1];\n $dobMonth = (int)$matches[2];\n $dobDay = (int)$matches[3];\n //echo \"DOB year=$dobYear month=$dobMonth day=$dobDay<br>\";\n\n $nowYear = (int)strftime('%Y');\n $nowMonth = (int)strftime('%m');\n $nowDay = (int)strftime('%d');\n //echo \"Now year=$nowYear month=$nowMonth day=$nowDay<br>\";\n // Calculate age\n if ($dobMonth < $nowMonth) {\n\n // Born in a month before this month\n $age = $nowYear - $dobYear;\n }\n elseif ($dobMonth == $nowMonth) {\n // Born in this month\n if ($dobDay <= $nowDay) {\n // Born before or on this day\n $age = $nowYear - $dobYear;\n }\n else {\n // Born after today in this month\n $age = $nowYear - $dobYear - 1;\n }\n }\n else {\n // Born in a month after this month\n $age = $nowYear - $dobYear - 1;\n }\n //echo \"age=$age years<br>\";\n return $age;\n }", "public function determineAge() {\n $timeInOneYear = 365.256 * 24 * 60 * 60;\n $yearsofAge = floor((strtotime(date('Y')) - strtotime($this->year.'-12-31'))/ $timeInOneYear);\n\n $this->age = $yearsofAge;\n\n return (int) $yearsofAge;\n }", "public function getAge() {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public function getAge()\n {\n return $this->age;\n }", "public static function calAge($bdate, $year = true, $month = true, $day = true, $label = true)\n {\n //$age = date_diff(date('Y-m-d'), $bdate);\n// \\appxq\\sdii\\utils\\VarDumper::dump($bdate);\n $age = '';\n if ($bdate != null || $bdate != '') {\n $diff = abs(strtotime(date('Y-m-d')) - strtotime($bdate));\n if ($year) {\n $years = floor($diff / (365 * 60 * 60 * 24));\n $label ? $age .= $years . ' ปี ' : $age .= $years;\n }\n if ($month) {\n $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));\n $label ? $age .= $months . ' เดือน ' : $age .= $months;\n }\n if ($day) {\n $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));\n $label ? $age .= $days . ' วัน ' : $age .= $days . ' วัน ';\n }\n }\n return $age;\n }", "public function getAge()\n {\n\n return $this->age;\n \n }", "function get_specified_age($age_str, $dob)\n {\n $today = new DateTime();\n $age = $dob->diff($today);\n\n $age_d = $dob->diffInDays();\n $age_y = $dob->age;\n $age_m = ($age->format('%y') * 12) + $age->format('%m');\n\n $patient_age = null;\n if (substr($age_str, -1) == 'd') {\n $patient_age = $age_d;\n } elseif (substr($age_str, -1) == 'm') {\n $patient_age = $age_m;\n } elseif (substr($age_str, -1) == 'y') {\n $patient_age = $age_y;\n }\n return $patient_age;\n }", "function findAge(\\DateTimeInterface $birthDate)\n {\n return $birthDate->diff(new DateTime())->y;\n }", "function getYearOfBirth() {\n global $USER;\n\t$yearOfBirth = date(\"Y\", $USER['dob']);\n\treturn $yearOfBirth;\n}", "function age_to_birthdate($age)\n{\n $age_int = intval(trim((string)$age));\n $now = new \\DateTime();\n $bday = $now->sub(new \\DateInterval(\"P\" . $age_int . \"Y6M\"));\n return $bday->format(\\DateTime::ATOM);\n}", "private function calculateBirthDateAndGender()\n {\n $year = $this->subject->getBirthDate()->format('y');\n $month = $this->months[$this->subject->getBirthDate()->format('n')];\n $day = $this->subject->getBirthDate()->format('d');\n if (strtoupper($this->subject->getGender()) == self::CHR_WOMEN) {\n $day += 40;\n }\n\n return $year . $month . $day;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "function age($date)\n{\n\t// PHP décompose la date saisie dans l'ordre défini\n list($annee, $mois, $jour) = explode ('/', $date);\n $TSN = strtotime($annee.\"/\".$mois.\"/\".$jour);\n $TS = strtotime(date(\"Y/m/d\"));\n\n $Age = ($TS-$TSN)/(365*3600*24);\n return round($Age);\n}", "public function getage()\n {\n return $this->age;\n }", "public function getBirthDate()\n {\n return $this->birth_date;\n }", "public function getAge();", "public function getAge();", "public static function getAge($date) {\r\n $d = new DateTime($date);\r\n $t = new DateTime(self::currentDateTime(self::datePattern));\r\n $interval = $t->diff($d);\r\n \r\n $years = $interval->format(\"%Y\");\r\n if($years == date(self::dateYear,time()))\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return $years;\r\n } \r\n }", "function getAge() {\n return $this->age;\n }", "function getAge($iBirthdayTimestamp, $iCurrentTimestamp = false, $padZeros = 2) {\t//\tby default, it pads it left to a length of 2 (zerofill)\r\n\t$iBirthdayTimestamp = preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $iBirthdayTimestamp) ? strtotime($iBirthdayTimestamp) : $iBirthdayTimestamp;\r\n\t$iCurrentTimestamp = $iCurrentTimestamp ? $iCurrentTimestamp : time();\t//\tdefault is today\r\n\t\r\n\t$iDiffYear = date('Y', $iCurrentTimestamp) - date('Y', $iBirthdayTimestamp);\r\n\t$iDiffMonth = date('n', $iCurrentTimestamp) - date('n', $iBirthdayTimestamp);\r\n\t$iDiffDay = date('j', $iCurrentTimestamp) - date('j', $iBirthdayTimestamp);\r\n\t\r\n\t// If birthday has not happen yet for this year, subtract 1.\r\n\tif ($iDiffMonth < 0 || ($iDiffMonth == 0 && $iDiffDay < 0)) {\r\n\t\t$iDiffYear--;\r\n\t}\r\n\t\r\n\t$iDiffYear = str_pad($iDiffYear, $padZeros, '0', STR_PAD_LEFT);\t//\tpad the age\r\n\treturn $iDiffYear;\r\n}", "function age($d, $m, $y){\n //get age from date or birthdate\n $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $m, $d, $y))) > date(\"md\")\n ? ((date(\"Y\") - $y) - 1)\n : (date(\"Y\") - $y));\n return $age;\n}", "public function getDateofBirth() {\n return $this->dateOfBirth;\n }", "public function getAge() { return $this->age; }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "function setAge($dob){ #calculate current age\n/**\n * Simple PHP age Calculator\n *\n * Calculate and returns age based on the date provided by the user.\n * @param date of birth('Format:yyyy-mm-dd').\n * @return age based on date of birth\n */\n\n\t#dumpDie($dob);\n\tif((!empty($dob)) || ($dob != '--') ){\n\t\t$birthdate = new DateTime($dob);\n\t\t#$today = new DateTime('today');\n\t\t$today = new DateTime(DATE_CURRENT);\n\t\t$age = $birthdate->diff($today)->y;\n\t\treturn $age;\n\t}else{\n\t\treturn 0;\n\t}\n}", "public function getBirthDate()\n {\n if ($this->birthDate) {\n return $this->birthDate;\n }\n\n $centuryCode = substr($this->personal_code, 0, 1);\n if ($centuryCode < 3) {\n $century = 19;\n } elseif ($centuryCode < 5) {\n $century = 20;\n } else {\n $century = 21;\n }\n\n $this->birthDate = new \\DateTime(($century - 1) . substr($this->personal_code, 1, 6));\n\n return $this->birthDate;\n }", "public function cheffism_age_function($atts) {\n extract(shortcode_atts(array(\n 'date' => '11/04/1985',\n 'format' => 'dd/MM/YYYY'\n ), $atts));\n\n //explode the date to get month, day and year\n $date = explode(\"/\", $date);\n //get age from date or birthdate\n $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $date[1], $date[0], $date[2]))) > date(\"md\")\n ? ((date(\"Y\") - $date[2]) - 1)\n : (date(\"Y\") - $date[2]));\n\n return $age;\n }", "public function getBirthDate()\n\t{\n\t\treturn $this->birthDate;\n\t}", "public function getBirthdate()\r\n {\r\n return $this->birthdate;\r\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "public function getBirthdate()\n\t{\n\t\treturn $this->birthdate;\n\t}", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getUserAge();", "public function getAge()\n {\n return 14;\n }", "public function getAge()\n {\n return 14;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthDate()\n\t{\n\t\treturn $this->getIfSetDate('birthDate');\n\t}", "function getDayOfBirth() {\n global $USER;\n\t$dayOfBirth = date(\"d\", $USER['dob']);\n\treturn $dayOfBirth;\n}", "function calculate_age( $y, $m, $d, $death_y = NULL, $death_m = NULL, $death_d = NULL )\n\t{\n\t\tif (is_null($death_y) || is_null($death_m) || is_null($death_d)) {\n\n\t\t\t$death_y = date( 'Y' );\n\t\t\t$death_m = date( 'm' );\n\t\t\t$death_d = date( 'd' );\n\t\t}\n\n\t\t// --------------------------------------------------------------------------\n\n\t\t$_birth_time = mktime( 0, 0, 0, $m, $d, $y );\n\t\t$_death_time = mktime( 0, 0, 0, $death_m, $death_d, $death_y );\n\n\t\t// --------------------------------------------------------------------------\n\n\t\t//\tIf $_death_time is smaller than $_birth_time then something's wrong\n\t\tif ( $_death_time < $_birth_time )\n\t\t\treturn FALSE;\n\n\t\t// --------------------------------------------------------------------------\n\n\t\t//\tCalculate age\n\t\t$_age\t\t= ( $_birth_time < 0 ) ? ( $_death_time + ( $_birth_time * -1 ) ) : $_death_time - $_birth_time;\n\t\t$_age_years\t= floor( $_age / ( 31536000 ) );\t//\tDivide by number of seconds in a year\n\n\t\t// --------------------------------------------------------------------------\n\n\t\treturn $_age_years;\n\t}", "public function getBirth()\n {\n return $this->birth;\n }", "public function getBirthdayDate()\n {\n return $this->birthdayDate;\n }", "function date_to_age($day, $month, $year) {\n\t$offset = -5;\n\n\t$now = gmdate(\"Y m d\", time() + (60*60*$offset));\n\n\t$now_year = intval(substr($now,0,4));\n\t$now_month = intval(substr($now,5,2));\n\t$now_day = intval(substr($now,8,2));\n\n\t$age = $now_year - $year;\n\tif($now_month == $month && $now_day >= $day) $age++;\n\n\treturn $age;\n}", "public function getUserDateOfBirth () {\n\t\treturn ($this->userDateOfBirth);\n\t}", "public function getAgeFrom() {\n return $this->ageFrom;\n }", "public function getAge()\n {\n return 20;\n }", "public function getDateOfBirth() {\n\t\treturn empty( $this->container['dates_of_birth'] ) ? null : $this->container['dates_of_birth'][0];\n\t}", "public function getUserBirthday()\n {\n $result = $this->getUserAttribute(static::ATTRIBUTE_BIRTHDAY);\n\n if (!empty($result)) {\n return date('d.m.Y', strtotime($result));\n }\n\n return $result;\n }", "public function getBirthDate()\n {\n return $this->getProfile() ? $this->getProfile()->getBirthDate() : null;\n }", "public function checkAge()\n {\n Validator::extend('check_age', function ($attribute, $value, $parameters, $validator) {\n $request = app(\\Illuminate\\Http\\Request::class);\n $dob = $request->date_of_birth;\n $dobValue = explode('-', $dob);\n if ($dobValue[0] && $dobValue[1] && $dobValue[2]) {\n $today = new DateTime();\n $birthdate = new DateTime($dob);\n $interval = $today->diff($birthdate);\n $age = (int)$interval->format('%y');\n if ($age>=18) {\n return true;\n } else {\n return false;\n }\n }\n });\n }", "function born() {\n if (empty($this->birthday)) {\n if ($this->page[\"Name\"] == \"\") $this->openpage (\"Name\",\"person\");\n if (preg_match(\"/Date of Birth:<\\/h5>\\s*<a href=\\\"\\/OnThisDay\\?day\\=(\\d{1,2})&month\\=(.*?)\\\">.*?<a href\\=\\\"\\/BornInYear\\?(\\d{4}).*?href\\=\\\"\\/BornWhere\\?.*?\\\">(.*?)<\\/a>/ms\",$this->page[\"Name\"],$match))\n $this->birthday = array(\"day\"=>$match[1],\"month\"=>$match[2],\"year\"=>$match[3],\"place\"=>$match[4]);\n }\n return $this->birthday;\n }", "protected function getDateOfBirthAttribute()\n {\n if (isset($this->attributes['date_of_birth'])) {\n $value = $this->attributes['date_of_birth'] ?? null;\n } else {\n $value = null;\n }\n\n if ($value !== null) {\n return date('d.m.Y', strtotime($value));\n } else {\n return null;\n }\n }", "public static function from_age($age)\r\n {\r\n # suitable for him.\r\n return (PiplApi_DOB::from_age_range($age, $age));\r\n }", "public function calculateAge($student_id){\n\t\t\t$table='student';\n\t\t\t$student=$this->findById($student_id, $table);\n\t\t\t$birth_date=$student['birth_date'];\n\t\t\t$get_birth_year=explode('/', $birth_date);\n\t\t\t$birth_year=$get_birth_year['2'];\n\t\t\t$current_year=date('Y');\n\t\t\t$age=$current_year - $birth_year;\n\t\t\treturn $age;\n\t\t}" ]
[ "0.85895747", "0.8481457", "0.82973903", "0.82349837", "0.8220785", "0.81499", "0.8075451", "0.80091715", "0.79159486", "0.7887723", "0.78806996", "0.78337294", "0.78275657", "0.7825302", "0.78161514", "0.77976966", "0.7795655", "0.76894635", "0.76792324", "0.760469", "0.7600817", "0.7595523", "0.75862205", "0.7553794", "0.7536282", "0.7458909", "0.74582964", "0.74582964", "0.7434904", "0.7417133", "0.74055976", "0.7401429", "0.73894703", "0.73708004", "0.7368592", "0.73639166", "0.73572147", "0.7352188", "0.7262256", "0.7262224", "0.7262224", "0.7262224", "0.7262224", "0.7262224", "0.7262224", "0.7226096", "0.7217965", "0.7215805", "0.7205898", "0.72028214", "0.7164322", "0.7155126", "0.7104277", "0.7104277", "0.70958215", "0.70859474", "0.70819", "0.70693684", "0.70693684", "0.70583916", "0.70467305", "0.7043545", "0.70385176", "0.7037054", "0.7013685", "0.70112354", "0.7010833", "0.70062554", "0.70059884", "0.69987345", "0.6982324", "0.6978414", "0.69771105", "0.69766897", "0.69630677", "0.6948033", "0.6948033", "0.6942801", "0.69414365", "0.69414365", "0.69414365", "0.69414365", "0.69414365", "0.6927444", "0.69241863", "0.6915861", "0.67699856", "0.67495143", "0.671242", "0.66935694", "0.6690445", "0.6671681", "0.6669642", "0.664607", "0.6615325", "0.6581879", "0.65620154", "0.65553004", "0.6551825", "0.6543704" ]
0.6642543
94
Pages of this module
function shoutbox_pages() { global $lang; $pages[] = array( 'func' => 'posts', 'title' => $lang['shoutbox']['page posts'] ); $pages[] = array( 'func' => 'clean', 'title' => $lang['shoutbox']['clean shoutbox'] ); $pages[] = array( 'func' => 'settings', 'title' => $lang['shoutbox']['page settings'] ); $pages[] = array( 'func' => 'check_updates', 'title' => $lang['shoutbox']['updates'] ); return $pages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPages() {}", "public function getPages();", "public function pagesOnly() {}", "protected function getPage() {}", "protected function getPage() {}", "function index() {\r\n $this->page();\r\n }", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'Open Badge',\n 'menu_title' => 'Open Badge',\n 'capability' => 'manage_options',\n 'menu_slug' => self::SLUG_PLUGIN,\n 'callback' => array(DashboardTemp::class, 'main'),\n 'icon_url' => 'dashicons-awards',\n 'position' => '110'\n )\n );\n }", "public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "public function getPage() {}", "public function getPage() {}", "protected function _getPages(){\n $pages = array(\n array(\n 'main' => array(\n 'label' => 'Dashboard',\n 'controller' => 'dashboard',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Summary',\n 'controller' => 'dashboard',\n 'action' => 'index',\n ),\n array(\n 'label' => 'Profile',\n 'controller' => 'profile',\n 'action' => 'index',\n ),\n \tarray(\n \t\t'label' => 'Phpinfo',\n \t\t'controller' => 'system',\n \t\t'action' => 'phpinfo',\n \t),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'System',\n 'controller' => 'system',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Groups',\n 'controller' => 'groups',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Users',\n 'controller' => 'users',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Privileges',\n 'controller' => 'privileges',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Flags',\n 'controller' => 'flags',\n 'action' => 'index',\n 'scope' => '*'\n ),\n ),\n\n ),\n array(\n 'main' => array(\n 'label' => 'Parameters',\n 'controller' => 'portails',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Portails',\n 'controller' => 'portails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'PortailUrl',\n 'controller' => 'portailurl',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Paramètres',\n 'controller' => 'params',\n 'action' => 'index',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Mails',\n 'controller' => 'mails',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Exporter',\n 'controller' => 'params',\n 'action' => 'exportparam',\n //'scope' => 'export'\n ),\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Tools',\n 'controller' => 'tools',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Generate Models',\n 'controller' => 'generate',\n 'action' => 'index',\n 'scope' => '*'\n ),\n array(\n 'label' => 'Clear Cache',\n 'controller' => 'tools',\n 'action' => 'cleancache',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Bdd',\n 'controller' => 'tools',\n 'action' => 'adminer',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Backups',\n 'controller' => 'backup',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Backup Bdd',\n 'controller' => 'backup',\n 'action' => 'bdd',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Backup Files',\n 'controller' => 'backup',\n 'action' => 'files',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Benchmark',\n 'controller' => 'benchmark',\n 'action' => 'index'\n ),\n 'pages' => array(\n array(\n 'label' => 'Benchmark 1',\n 'controller' => 'benchmark',\n 'action' => 'benchmark1',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Benchmark 2',\n 'controller' => 'benchmark',\n 'action' => 'benchmark2',\n //'scope' => '*'\n ),\n\n ),\n ),\n array(\n 'main' => array(\n 'label' => 'Examples',\n 'controller' => 'system',\n 'action' => 'example'\n ),\n 'pages' => array(\n array(\n 'label' => 'Theme',\n 'controller' => 'system',\n 'action' => 'example',\n //'scope' => '*'\n ),\n array(\n 'label' => 'Errors',\n 'controller' => 'system',\n 'action' => 'example-errors',\n //'scope' => '*'\n ),\n\n ),\n\n ),\n );\n\n return $pages;\n }", "public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function getPageHandler();", "public function getPage();", "public function list_pages() {\n\t\t$this->print_prev();\n\n\t\tif ($this->current_page+2 >= $this->total_pages-1) {\n\t\t\t$this->pages_right();\n\t\t} else {\n\t\t\t$this->pages_left();\n\t\t}\n\n\t\t$this->print_next();\n\t}", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'PM Plugin',\n 'menu_title' => 'PM',\n 'capability' => 'manage_options',\n 'menu_slug' => 'pm_plugin',\n 'callback' => array($this->callbacks, 'adminDashboard'),\n 'icon_url' => 'dashicons-store',\n 'position' => 110,\n ),\n );\n\n }", "public function indexTypo3PageContent() {}", "protected function setupPage() {}", "public function get_page_info()\n {\n }", "public function index()\n {\n $pages = Posts::where('type', '=', 'page')->get();\n $this->layout->title = 'Page - NCCMS';\n $this->layout->with('script', 'nccms::admin.pages.scripts.index')\n ->with('style', 'nccms::admin.pages.styles.index');\n $this->layout->content = \\View::make('nccms::admin.pages.index')\n ->with('pages', $pages)\n ->with('title', 'Page');\n }", "public function index(){\t\n\t\t// var_dump('vchxhh');\n\n\t\t$page_model = new \\Models\\Page;\n\t\t$page_model->cmsPage();\n\t\t$this->data['page_title'] = \\Models\\Page::$pageName;\n\n\t\t$this->data['pagename'] = \\Models\\Page::$pageName;\n\t\t$this->data['subname'] = \\Models\\Page::$subName;\n\t\t$this->data['pagedetails'] = \\Models\\Page::$pagedetails;\n\n\t\tswitch (\\Models\\Page::$controller) {\n\t\t\tcase 'contact-us':\n\t\t\t\tUrl::redirect('page/contact');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\t\tView::renderTemplate('header',$this->data);\n\t\tView::render('page/page.index',$this->data);\n\t\tView::renderTemplate('footer',$this->data);\n\t}", "abstract protected function getPage() ;", "public function myPagesAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //CHECK CLAIM IS ENABLED OR NOT\n $claimEnabled = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claimlink', 1);\n if (empty($claimEnabled)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET LOGGED IN USER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $this->view->viewer_id = $viewer_id = $viewer->getIdentity();\n\n //CHECK THAT MEMBER HAS ALLOED FOR CLAIM OR NOT\n $canClaim = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitepage_page', 'claim');\n if (empty($canClaim)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitepage_main', array(), 'sitepage_main_manage');\n\n //MAKE PAGINATOR\n $this->view->paginator = $paginator = Engine_Api::_()->getDbtable('claims', 'sitepage')->getMyClaimPages($viewer_id);\n\n //GET PAGINATOR\n $items_count = (int) Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.page', 10);\n $paginator->setItemCountPerPage($items_count);\n $this->view->paginator = $paginator->setCurrentPageNumber(10);\n }", "public function get_instance_pages() {\n\n\t\t\t$base_path = $this->component_path( 'pages/' );\n\n\t\t\treturn array(\n\t\t\t\t'Jet_Engine_Relations_Page_List' => $base_path . 'list.php',\n\t\t\t\t'Jet_Engine_Relations_Page_Edit' => $base_path . 'edit.php',\n\t\t\t);\n\t\t}", "function display_pages()\n {\n $this->Admin_model->procedure = 'GET_POST_PAGES';\n $rs = $this->Admin_model->get_post();\n $data['rows'] = $rs;\n $this->load->view('display_posts', $data);\n }", "public function index() \n {\n $conditions = [\n 'page_type' => 'module',\n 'module' => $this->class_path_name\n ];\n $page_info = $this->Pages_model->GetPageInfo($conditions);\n if ( ! $page_info) {\n show_404();\n exit();\n }\n $params = [];\n $this->data['page_info'] = $page_info;\n $this->data['page_title'] = $page_info['page_name'];\n if ($page_info['thumbnail_image'] != '' || $page_info['primary_image'] != '') {\n $this->data['head_image'] = ($page_info['thumbnail_image'] != '') ? base_url('uploads/pages/'. $page_info['thumbnail_image']) : base_url('uploads/pages/'. $page_info['primary_image']);\n }\n\n $total_records = $this->Article_model->CountArticles($params);\n\n if ($this->input->get_post('perpage')) {\n $params['limit']['from'] = (int)$this->input->get_post('perpage');\n $paging['base_url'] = current_url();\n }\n\n $this->data['records'] = $this->Article_model->GetArticles($params);\n\n $paging['per_page'] = SHOW_RECORDS_DEFAULT;\n $paging['total_rows'] = $total_records;\n $paging['is_ajax'] = false;\n\n $this->data['pagination'] = custom_pagination($paging);\n\n // article categories\n $this->data['categories'] = $this->Article_model->GetCategories();\n }", "public function pages()\n {\n if ($_SESSION['role'] == 1)\n { \n $this->view('AdminDashboard/pages', ['viewName' => 'Dashboard - Pages']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n }", "public function getPages()\n\t{\n\t\treturn $this->dashletdefs['pages'];\n\t}", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "abstract protected function view_generatePageContent();", "public function initPage() {}", "public function initPage() {}", "public function get_page();", "public function startNewPage()\n {\n }", "function registerPages() {\n\t \\Idno\\Core\\site()->addPageHandler('\\_known/callback', '\\IdnoPlugins\\Known\\Pages\\Callback');\n\t // Register admin settings\n\t \\Idno\\Core\\site()->addPageHandler('admin/known', '\\IdnoPlugins\\Known\\Pages\\Admin');\n\t // Register settings page\n\t \\Idno\\Core\\site()->addPageHandler('account/known', '\\IdnoPlugins\\Known\\Pages\\Account');\n\n\t /** Template extensions */\n\t // Add menu items to account & administration screens\n\t \\Idno\\Core\\site()->template()->extendTemplate('admin/menu/items', 'admin/known/menu');\n\t \\Idno\\Core\\site()->template()->extendTemplate('account/menu/items', 'account/known/menu');\n\t}", "function callback_pages(array $args)\n {\n }", "public function actionPages()\n {\n $searchModel = new PostSearchPages();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n\n return $this->render('pages/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "static public function createPages() {\n\t\treturn false;\n\t}", "public function index()\n\t\t{\n\t\t\t$pageHeader = \tarray( 'pagetitle' => 'Page Listing',\n\t\t\t'slug'=>'pages',\n\t\t\t'font_icon'=>'book',\n\t\t\t);\n\t\t\t\n\t\t\t//Get All pages data\n\t\t\t$data['pagesdata'] = $this->AdminPageModel->GetAllPages();\n\t\t\t\n\t\t\t$this->load->view('admin/share-template/header', $pageHeader);\n\t\t\t$this->load->view('admin/admin_pages_listing_view', $data);\n\t\t\t$this->load->view('admin/share-template/footer');\n\t\t\t\n\t\t}", "public function index()\r\n {\r\n $this->page_list_grid();\r\n }", "public function page_init() {\n }", "function allPagesObject()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\t$this->checkPermission(\"read\");\n\t\t\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php\");\n\t\t\n\t\t$this->addPagesSubTabs();\n\t\t\n\t\t$table_gui = new ilWikiPagesTableGUI($this, \"allPages\",\n\t\t\t$this->object->getId(), IL_WIKI_ALL_PAGES);\n\t\t\t\n\t\t$this->setSideBlock();\n\t\t$tpl->setContent($table_gui->getHTML());\n\t}", "public function actionList()\n {\n $this->adminOnly();\n\n $pages = $this->findAll();\n return $this->render('@custom_pages/views/common/list', [\n 'pages' => $pages,\n 'label' => Yii::createObject($this->getPageClassName())->getLabel(),\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()\n ]);\n }", "public function pageAction()\n {\n return $this->indexAction();\n }", "protected function init_pages() {\r\n\t\t\t$include_array = [];\r\n\r\n\t\t\t$files = glob( $this->include_path . '/Page/*.php' );\r\n\t\t\t$obj = new ReflectionClass( $this );\r\n\r\n\t\t\tforeach ( $files as $file ) {\r\n\t\t\t\t$name = basename( $file );\r\n\t\t\t\t$not_included = array();\r\n\t\t\t\tif ( ! in_array( $name, $not_included ) ) {\r\n\t\t\t\t\t$name = str_replace( '.php', '', $name );\r\n\t\t\t\t\t$namespace = $obj->getNamespaceName();\r\n\t\t\t\t\tarray_push( $include_array, $namespace . '\\\\Page\\\\' . $name );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach ( $include_array as $page ) {\r\n\t\t\t\tnew $page( $this->include_path );\r\n\t\t\t}\r\n\r\n\t\t}", "public function getAllPages()\n {\n // Get a list of all viewable pages\n $home = Page::getByID(1);\n $homeStr = $home->getCollectionPath();\n\n $pl = new PageList();\n $pl->filterByPath($homeStr, TRUE);\n $pl->ignoreAliases();\n\n $allowedPages = (array) $pl->get();\n $perm = new Permissions($home);\n\n if($perm->canRead()) array_unshift($allowedPages, $home);\n\n $this->set('allowedPages', $allowedPages);\n }", "public function index()\n {\n $data=SetInformationLang(auth()->user(),$this->defaultPosition,$this->defaultCode);\n\n $trans=$data['trans'];\n $code=$data['code'];\n $position=$data['position'];\n $pages=Page::latest()->paginate(5);\n\n return view(\"admin.page.pages\",compact(\"pages\",\"position\",\"trans\",\"code\"));\n }", "public function page_uri_index()\n {\n }", "public function index()\n {\n $this->data['list'] = $this->cms_page_model->get_all();\n \n $this->template->load_asset(array('datatable', 'dialog', 'bootstrap_switch'));\n \n $this->template->build('admin/cms/page/index', $this->data);\n }", "function renderPage() {\n $parameters = explode(\"/\", $this->getCurrentPage());\n $folder = $parameters[1];\n if (!in_array($folder, $this->folders) && $folder !== \"api\") {\n $name = $this->getCurrentPage();\n require_once $this->getBlueprintPath();\n }\n }", "public function pageAction(){\n $this->_request->setParam('table', 'Page'); \n \t$this->view->gridIndexRoute = Rhema_Constant::ROUTE_GRID_INDEX ; \t \n \t$this->_helper->displayGrid(); \t \n }", "public function page_content() {\n\t\t$tab = empty( $_REQUEST['tab'] ) ? 'new' : wp_strip_all_tags( wp_unslash( $_REQUEST['tab'] ) ); // Input var okay.\n\t\t$paged = ! empty( $_REQUEST['paged'] ) ? (int) $_REQUEST['paged'] : 1; // Input var okay.\n\n\t\t$tab = esc_attr( $tab );\n\t\t$paged = esc_attr( $paged );\n\n\t\t$filters = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'filters' );\n\t\t$defaults = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'defaults' );\n\n\t\t$args = array(\n\t\t\t'tab' => $tab,\n\t\t\t'page' => $paged,\n\t\t\t'filters' => $filters,\n\t\t\t'defaults' => $defaults,\n\t\t);\n\n\t\t$table = $this->create_list_table( $this->args['page_slug'], $this->args['parent'], $args );\n\n\t\t// Outputs the tabs, filters and search bar.\n\t\t$table->views();\n\n\t\t/**\n\t\t * Fires on the Add-ons browser tab after the top navigation bar.\n\t\t *\n\t\t * The dynamic part of the hook name refers to the tab slug (i.e. new or popular)\n\t\t *\n\t\t * @param APP_Addons_List_Table $table The content generator instance.\n\t\t */\n\t\tdo_action( \"appthemes_addons_mp_{$tab}\", $table );\n\t}", "public function getPageItems()\n {\n }", "public function allpagesActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla pages i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n CASE \n WHEN (deleted <= NOW()) THEN \"isDeleted\"\n WHEN (published <= NOW()) THEN \"isPublished\"\n ELSE \"notPublished\"\n END AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"page\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allpages\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "protected function getUpdatablePages() {}", "public function prePageContent();", "function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }", "public function allPostsPage(){\n require_once \"controller/Post.php\";\n $post = new Post();\n $content = $post->getAllPosts();\n $html = \"<div class=\\\"page_all_chapters\\\"><h1>Tous les chapitres:</h1>\";\n $html .= View::makeLoopHtml($content, \"all_posts_template\");\n $html .= \"</div>\";\n return [\n \"{{ pageTitle }}\" => \"Tous les chapitres\",\n \"{{ content }}\" => $html,\n \"{{ path }}\" => $GLOBALS[\"path\"]\n ] ;\n }", "public function index($page)\r\n\t{\r\n \r\n\t}", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public function affichePiedPage()\r\n\t\t{\r\n\t\t//appel de la vue du pied de page\r\n\t\trequire 'Vues/piedPage.php';\r\n\t\t}", "public function index()\n {\n if(Auth::user()->role_id != 3) {\n abort(404);\n }\n return view('admin.pages.index',[\n 'pages' => Page::orderBy('title', 'asc')->paginate(25)\n ]);\n }", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function index()\n {\n return view('admin.pagelist');\n }", "public function pages() {\n\t\t// Build the MindTouch API URL to fetch the pages.\n\t\t$url = \"pages\";\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "public function getNextPage();", "function processPageInfo( $moduleID ) \n {\n \n // open include file\n $key = ModuleCreator::KEY_PATH_INCLUDE_NAME;\n $includeFileName = $this->values[ $key ];\n $includeFileContents = file_get_contents( $includeFileName );\n \n // open app file\n $appFileName = $this->values[ ModuleCreator::KEY_PATH_APP_NAME ];\n $appFileContents = file_get_contents( $appFileName );\n \n $pageList = new PageList( $moduleID );\n \n // for each page\n $pageList->setFirst();\n while ( $page = $pageList->getNext() ) {\n \n // if page not already created\n if (!$page->isCreated() ) {\n \n // open page template based on page type\n $templateContents = $this->getTemplate( $page );\n \n // replace TAGS\n $this->replaceTemplateTags( $page, $templateContents);\n \n // store data as new object bl file\n $blPath = $this->values[ ModuleCreator::KEY_PATH_MODULE_PAGES ];\n $name = 'page_'.$page->getPageName().'.php';\n file_put_contents( $blPath.$name, $templateContents);\n \n // include new file in include file\n $tag = ModuleCreator::TAG_INCLUDE_PAGES;\n $data = \"require_once( '\".ModuleCreator::PATH_OBJECT_PAGES.$name.\"' );\\n\";\n $data .= $tag;\n $includeFileContents = str_replace($tag, $data, $includeFileContents );\n \n \n // update page info in app file\n $this->updatePageAppInfo( $page, $appFileContents );\n \n // prepare the tool setup file to receive labels for this page.\n $this->preparePageLabels( $page );\n \n // if page is a custom template then\n if ($page->isCustom() ) {\n \n $this->transferCustomTemplate( $page );\n \n } // end if\n \n // Mark this page as having been created\n $page->setCreated();\n \n } // end if\n \n \n // NOTE: we update a page labels even if a page has already been\n // created. If there are new labels, they will be added to the\n // list.\n // update page labels\n $this->updatePageLabels( $page );\n \n } // next page\n \n // save include file\n file_put_contents( $includeFileName, $includeFileContents);\n \n // save app file\n file_put_contents( $appFileName, $appFileContents);\n \n }", "public function admin_index() {\n\n\t\t\t/*get all data from table \"modules\"*/\n\t\t\t$modules=$this->Module->find(\"all\");\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(\"title\", \"Gestion\");\n\t\t\t$this->set(\"legend\", \"Modules manager\");\n\t\t\t$this->set(\"modules\", $modules);\n\t\t\t}", "public function index()\n {\n return view('author.pages.index')->with('pages', Page::all());\n }", "public function hasPages();", "public function hasPages();", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "function getPage()\n {\n global $_ARRAYLANG, $objTemplate; \n\n if(!isset($_GET['act'])){\n $_GET['act']='';\n }\n\n $boolShowStatus = true;\n\n switch ($_GET['act']) {\n case 'Ftp':\n $this->showFtp();\n break;\n \n case 'cache':\n if (in_array('CacheManager', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->showSettings();\n } else {\n \\Permission::noAccess();\n }\n \n break;\n\n case 'Wysiwyg':\n if (in_array('Wysiwyg', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n $boolShowStatus = false;\n $this->showWysiwyg();\n } else {\n \\Permission::noAccess();\n }\n \n break;\n \n case 'cache_update':\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->updateSettings();\n $objCache->showSettings();\n break;\n\n case 'cache_empty':\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->forceClearCache(isset($_GET['cache']) ? contrexx_input2raw($_GET['cache']) : null);\n $objCache->showSettings();\n break;\n\n case 'smtp':\n $this->smtp();\n break;\n \n case 'image':\n try {\n $this->image($_POST);\n } catch (Exception $e) {\n \\DBG::msg('Image settings: '.$e->getMessage);\n }\n break;\n case 'thumbnail':\n $this->editThumbnails($_POST);\n break;\n\n case 'generateThumbnail':\n $this->generateThumbnail($_POST);\n break;\n\n case 'getThumbProgress':\n $this->getThumbProgress();\n break;\n\n default:\n $this->showSettings();\n }\n\n if ($boolShowStatus) {\n $objTemplate->setVariable(array(\n 'CONTENT_TITLE' => $this->strPageTitle,\n 'CONTENT_OK_MESSAGE' => $this->strOkMessage,\n 'CONTENT_STATUS_MESSAGE' => implode(\"<br />\\n\", $this->strErrMessage)\n ));\n }\n\n $this->act = isset($_REQUEST['act']) ? $_REQUEST['act'] : '';\n $this->setNavigation();\n }", "public function getSysPage() {}", "public function action() {\n // $this->view->page();\n }", "public function getStartPage();", "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "function pagination(){}", "public function index()\n {\n $pages = Page::all();\n\t\treturn View::make('admin.pages.pages',['pages' => $pages]);\n }", "public function run()\n {\n //\n $page = \\CDeep\\Models\\Page::find(1);\n if (!$page) {\n $pages = [\n ['id' => 1, 'owner_user_id' => 1, 'owner_group_id' => 1, 'uri' => 'index', 'title' => 'cDeep Site', 'topic' => 'cDeep Site', 'menu' => 'Home', 'keywords' => '', 'description' => '', 'template_resource' => 'site', 'template_env' => '_env/index', 'template_view' => 'main/index', 'show_in_menu' => 1, 'menu_sort_order' => 100, 'is_published' => 1, 'is_enabled' => 1,],\n\n ['id' => 2, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 1, 'uri' => 'sadm',\n 'title' => 'Администрирование', 'topic' => 'Администрирование', 'menu' => 'Администрирование', 'keywords' => '', 'description' => '',\n 'template_resource' => 'sadm', 'template_env' => '_env/index', 'template_view' => 'main/index',\n 'show_in_menu' => 0, 'menu_sort_order' => 100, 'is_published' => 1, 'is_enabled' => 1,],\n ['id' => 9999, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 2, 'uri' => 'logout',\n 'title' => 'Выход', 'topic' => 'Выход', 'menu' => 'Выход', 'keywords' => '', 'description' => '',\n 'template_view' => 'errors/404',\n 'show_in_menu' => 0, 'menu_sort_order' => 100, 'is_published' => 1, 'is_enabled' => 1,],\n\n ['id' => 3, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 1, 'uri' => 'errors', 'title' => 'Ошибка', 'topic' => 'Ошибка', 'template_view' => 'errors/index',\n 'show_in_menu' => 0,\n 'is_published' => 1,\n 'is_enabled' => 1\n ],\n ['id' => 401, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 3, 'uri' => '401', 'title' => 'Доступ ограничен', 'topic' => 'Доступ ограничен', 'template_view' => 'errors/401', 'is_published' => 1, 'is_enabled' => 1,],\n ['id' => 402, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 3, 'uri' => '403', 'title' => 'Доступ запрещен', 'topic' => 'Доступ запрещен', 'template_view' => 'errors/403', 'is_published' => 1, 'is_enabled' => 1,],\n ['id' => 404, 'owner_user_id' => 1, 'owner_group_id' => 1, 'page_id' => 3, 'uri' => '404', 'title' => 'Не найдено', 'topic' => 'Не найдено', 'template_view' => 'errors/404', 'is_published' => 1, 'is_enabled' => 1,],\n\n ['id' => 10001, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'signin',\n 'title' => 'Вход',\n 'topic' => 'Вход',\n 'menu' => 'Вход',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'signin/index',\n 'show_in_menu' => 0,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10010, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'about',\n 'title' => 'О сервисе',\n 'topic' => 'Что это такое?',\n 'menu' => 'О сервисе',\n 'keywords' => '',\n 'description' => '', \n 'template_view' => 'about/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10015, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 10010, 'uri' => 'start',\n 'title' => 'С чего начать?',\n 'topic' => 'Инструкция для старта',\n 'menu' => 'С чего начать?',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'about/start',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10040, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'prices',\n 'title' => 'Тарифы',\n 'topic' => 'Стоимость',\n 'menu' => 'Тарифы',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'prices/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10050, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'signup',\n 'title' => 'Регистрация',\n 'topic' => 'Регистрация',\n 'menu' => 'Зерегистрироваться',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'signup/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n\n ['id' => 10500, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'help',\n 'title' => 'Поддержка',\n 'topic' => 'Поддержка',\n 'menu' => 'Поддержка',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'help/index',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n ['id' => 10501, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'terms',\n 'title' => 'Условия использования',\n 'topic' => 'Условия использования',\n 'menu' => 'Условия использования',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'help/terms',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n ['id' => 10502, 'owner_user_id' => 1, 'owner_group_id' => 1,\n 'page_id' => 1, 'uri' => 'feedback',\n 'title' => 'Связь',\n 'topic' => 'Связь',\n 'menu' => 'Связь',\n 'keywords' => '',\n 'description' => '',\n 'template_view' => 'help/feedback',\n 'show_in_menu' => 1,\n 'menu_sort_order' => 100,\n 'is_published' => 1,\n 'is_enabled' => 1,\n ],\n ];\n\n foreach ($pages as $p) {\n $page = new \\CDeep\\Models\\Page($p);\n $page->save();\n }\n }\n }", "public function getPages()\n {\n $pages = array();\n $reader = new AnnotationReader();\n\n foreach($this->compositionBundles as $compositionBundle) {\n $dir = $this->kernel->locateResource($compositionBundle, null, true) . 'Controller/';\n\n $finder = new Finder();\n $finder->files()->in($dir)->depth('== 0')->name('*Controller.php');\n\n foreach ($finder as $file) {\n $className = str_replace('.php', '', $file->getFilename());\n $path = str_replace(str_replace('app', '', str_replace('\\\\', '/', $this->kernel->getRootDir())), '', str_replace('\\\\', '/', $file->getPathname()));\n $path = str_replace('src', '', $path);\n $path = str_replace('/', '\\\\', $path);\n $path = str_replace('.php', '', $path);\n $c = new \\ReflectionClass($path);\n\n $methods = $c->getMethods();\n\n foreach($methods as $method) {\n // check whether the method is an action and therefore a page\n if (strpos($method->getName(), 'Action') !== false) {\n // setup a fresh page object\n $page = new Page();\n $page->setController(substr($className, 0, -10));\n $action = substr($method->getShortName(), 0, -6);\n $page->setAction($action);\n\n // create name from composer annotation\n $composerAnnotation = $reader->getMethodAnnotation($method, 'Terrific\\ComposerBundle\\Annotation\\Composer');\n if($composerAnnotation == null) {\n $name = $action;\n }\n else {\n $name = $composerAnnotation->getName();\n }\n\n $page->setName($name);\n\n // create url from route annotation\n $routeAnnotation = $reader->getMethodAnnotation($method, 'Symfony\\Component\\Routing\\Annotation\\Route');\n\n $page->setUrl($this->router->generate($routeAnnotation->getName()));\n\n $pages[] = $page;\n }\n }\n }\n }\n\n return $pages;\n }", "public function index()\n {\n\t\t$totalComments = count($this->model->findAllWithTheirAuthor(\"p_datetime DESC\"));\n\t\t$itemPerpage = 5;\n\t\t$totalPages = ceil($totalComments/$itemPerpage); //ceil around superior number\n\t\t\n\t\tif(isset($_GET['page']) AND !empty($_GET['page']) AND $_GET['page'] > 0)\n {\n $_GET['page'] = intval($_GET['page']); //return an entier value\n $currentPage = $_GET['page'];\n }\n else\n {\n $currentPage = 1;\n\t\t}\n\t\t$start = ($currentPage - 1)*$itemPerpage;\n $posts = $this->model->countItems($start, $itemPerpage, \"p_datetime\");\n\t\t\n\t\t$pageTitle = \"Articles\";\n\t\t\n\t\t$description = \"Liste des articles\";\n\n\t\t$author = \"Invest People\";\n\n \\Renderer::render('post/index', compact('pageTitle', 'posts', 'description', 'author', 'totalPages')); \n\t}", "protected function _Load_Pages() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/pages');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_pages_init',$this);\r\n }", "public function action_index () {\r\n\t\t$page_category\t= $this->page_category->load_by_name($this->_class_name);\r\n\t\t$category_files\t= $this->category_files->find(array('category_id'=>$page_category->id),'',1);\r\n\t\t\r\n\t\t$buffers = array();\r\n\t\tforeach ($category_files as $cfile){\r\n\t\t\t$buffers[$cfile->category_id] = $cfile;\r\n\t\t}\r\n\t\t$category_files = $buffers;\r\n\t\t\r\n\t\t$order_by\t\t= array('order'=>'desc');\r\n\t\t$links\t\t\t= $this->links->find(array('status'=>'publish'),$order_by);\r\n\t\t$linkstype\t\t= $this->linkstype->find(array('status'=>'publish'));\r\n\t\t\r\n\t\t$content_vars\t= array(\r\n\t\t\t\t\t\t\t\t\t'category_upload_path' => $this->category_upload_path,\r\n\t\t\t\t\t\t\t\t\t'category_upload_url' => $this->category_upload_url,\r\n\t\t\t\t\t\t\t\t\t'page_category' => $page_category,\r\n\t\t\t\t\t\t\t\t\t'category_files' => $category_files,\r\n\t\t\t\t\t\t\t\t\t'links' => $links,\r\n\t\t\t\t\t\t\t\t\t'linkstype' => $linkstype\r\n\t\t\t\t\t\t\t\t);\r\n\r\n\t\t$content\t\t\t= View::factory('site/links_page');\r\n\r\n\t\tforeach ($content_vars as $var => $val) {\r\n\t\t\t$content->$var\t= $val;\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$this->template->meta_keywords\t\t= Lib::_explode_keywords('Links for information');\r\n\t\t\r\n\t\t$this->template->meta_description\t= 'Links Page ' . strip_tags('Links for information');\t\r\n\t\t\r\n\t\t$this->template->page_title\t\t= 'Links - '. Lib::config('site.title');\r\n\t\t\r\n\t\t$this->template->content\t\t= $content; \r\n\t}", "public function canManagePages();", "function Page() {\n \n // only administrators can edit it\n \n // fields\n \n $this->char_field( 'title' );\n \n $this->text_field( 'body' );\n \n $this->text_field( 'summary' );\n \n $this->text_field( 'contributor' );\n $this->text_field( 'rights' );\n $this->text_field( 'source' );\n \n $this->char_field( 'uri' );\n $this->char_field( 'url' );\n \n $this->file_field( 'attachment' );\n \n $this->int_field( 'parent_id' );\n $this->int_field( 'profile_id' );\n $this->int_field( 'recipient_id' );\n \n $this->bool_field( 'local' );\n \n $this->time_field( 'created' );\n $this->time_field( 'modified' );\n \n $this->int_field( 'entry_id' );\n \n $this->auto_field( 'id' );\n \n // relationships\n \n // each record in posts HAS ONE record in entries\n \n $this->has_one( 'entry' );\n\n //$this->has_many( 'comments' );\n\n //$this->has_many( 'reviews' );\n \n $this->set_limit(10);\n \n // permissions\n \n $this->let_read( 'all:everyone' );\n \n $this->let_access( 'all:administrators' );\n \n $this->use_templates_from( 'posts' );\n \n }", "public function get_pages()\n\t{\n\t\treturn $this->_EE->db->select(array('heading', 'short_name'))\n\t\t\t ->get('exp_dd_doc_sections')\n\t\t\t ->result_array();\n\t}", "public function GetPages(){\n\t\t$this->MediaType = 'application/xhtml+xml';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\t\n\t}", "public function index()\n {\n \n // TODO: would be nice to have an Expand All/ Collapse All (like the Call Codes page in eesfm)\n\n ehLayout::initLayout();\n\n ehLayout::setDynamic(false);\n ehLayout::setOptionBlock(false);\n ehLayout::setAttention(false);\n\n\n $linkbar = new ehLinkbar();\n ehLayout::setLinkbar($linkbar->getLinkbar());\n\n\n $form['layout'] = ehLayout::getLayout();\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // The normal layout['menus'] returned is only going to be active menu items\n // So we're going to have to get one that has all entries in it.\n $menu = new ehMenus(false);\n\n // Pull the menus collection from the new $menus object.\n $pages_all = $menu->getPages();\n\n // Pull the menus \"Legend\" from the eco-menus config file.\n $pages_legend = $menu->getLegend();\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // The Legend and Page Tree display explanation (set at top of this controller).\n $form['tree_layout_explanation'] = $this->tree_layout_explanation;\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // Add the menu list \"display classes\" to the returned menu collection\n // Note: this is only used for the menu/pages index and for the menu/pages detail.\n\n // Note: the display_class is already added in the ehMenus class. No need to call it again here.\n //$form['layout']['pages_all'] = ehMenus::addDisplayClass($pages_all);\n //$form['layout']['pages_legend'] = ehMenus::addDisplayClass($pages_legend);\n $form['layout']['pages_all'] = $pages_all;\n $form['layout']['pages_legend'] = $pages_legend;\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n return view('ecoHelpers::pages.page-list',[\n 'form' => $form\n ]);\n\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function display($pageName);", "public function addPages()\r\n {\r\n $settings = add_options_page(\r\n 'OHS Newsletter',\r\n 'OHS Newsletter',\r\n 'manage_options',\r\n 'ohs-newsletter',\r\n array($this, 'optionsPage')\r\n );\r\n }", "public function getPageOpen() {}", "function page()\n {\n $urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n # print_r($data);\n # exit();\n\n #Get the paginated list of the news items\n $data = add_msg_if_any($this, $data);\n\n //if user has permission\n if (check_user_access($this, 'view_procurement_plans')) \n {\n $search_str = '';\n if($this->session->userdata('isadmin') == 'N')\n {\n $userdata = $this->db->get_where('users', array('userid'=>$this->session->userdata('userid')))->result_array();\n $search_str = ' AND PP.pde_id=\"'. $userdata[0]['pde'] .'\"';\n }\n \n \n #Get the paginated list of plans\n $data['procurement'] = paginate_list($this, $data, 'procurement_plans', array('orderby'=>'PP.financial_year DESC', 'searchstring'=>$search_str));\n #exit($this->db->last_query());\n $data['page_title'] = 'Manage procurement plans';\n $data['current_menu'] = 'view_procurement_plans';\n $data['view_to_load'] = 'procurement/admin/all_procurement_plans_v';\n $data['view_data']['form_title'] = $data['page_title'];\n $this->load->view('dashboard_v', $data);\n \n } else {\n //load access denied page\n load_restriction_page();\n\n }\n\n\n }", "public function index()\n {\n $pages = Page::get();\n return view(\"admin.pages.index\")\n ->with(compact('pages',$pages));\n }", "public function do_paging()\n {\n }" ]
[ "0.7721725", "0.75934494", "0.75645435", "0.7460441", "0.74602985", "0.73866814", "0.7178544", "0.7150249", "0.71424705", "0.71424705", "0.7141787", "0.7139619", "0.7118441", "0.70703626", "0.70392185", "0.702104", "0.7007604", "0.698144", "0.69424915", "0.6904348", "0.686538", "0.68581563", "0.68509126", "0.68406594", "0.68342036", "0.6824859", "0.6812723", "0.68057525", "0.6787236", "0.67842054", "0.6779683", "0.67698365", "0.6762111", "0.6762111", "0.6732548", "0.667455", "0.66719735", "0.6666541", "0.66427416", "0.662639", "0.6600406", "0.6596769", "0.6596488", "0.6591866", "0.6577473", "0.65751976", "0.6574789", "0.6573756", "0.6572263", "0.65650374", "0.6538541", "0.65326107", "0.6529777", "0.6529591", "0.6527353", "0.6520105", "0.65179443", "0.65175545", "0.65152586", "0.6510783", "0.6498772", "0.64843196", "0.6473185", "0.64600927", "0.6450538", "0.64477205", "0.64368933", "0.64300203", "0.64247453", "0.642315", "0.6421594", "0.64178556", "0.64146227", "0.64146227", "0.6408527", "0.64074516", "0.63948244", "0.63947237", "0.6393599", "0.6393583", "0.6393583", "0.63870454", "0.63846666", "0.63764393", "0.63759935", "0.63709885", "0.6370289", "0.636699", "0.6354645", "0.63464296", "0.6341221", "0.6339992", "0.6335399", "0.63329726", "0.63246465", "0.6322435", "0.63186395", "0.63101584", "0.6308289", "0.63039637" ]
0.6733834
34
/ Main function: settings_general()
function settings() { global $core, $db, $lang; $result = NULL; if(isset($_POST['save'])) { $error = 0; foreach($_POST as $key => $value) { if($key != 'save') { $query = $db->select('shoutbox_settings', array('field'=>$key)); $record = $query[0]; if(!$db->update('shoutbox_settings', array('field'=>$key), array($record['id'],$key,stripslashes($value)))) $error++; } } if($error) $core->notify($lang['shoutbox']['update fail'],2); else $core->notify($lang['shoutbox']['update success'],1); } //Get settings from DB if($query = $db->select('shoutbox_settings')) { foreach((array)$query as $record) $settings[$record['field']] = $record['value']; //Define all inputs $form['top'] = '<form name="settings" method="post" action="'.$_SERVER['REQUEST_URI'].'">'; $form['nick_min_chars'] = '<label>'.$lang['shoutbox']['nick min chars'].' </label> <input type="text" name="nick_min_chars" value="'.$settings['nick_min_chars'].'" />'; $form['nick_max_chars'] = '<label>'.$lang['shoutbox']['nick max chars'].' </label> <input type="text" name="nick_max_chars" value="'.$settings['nick_max_chars'].'" />'; $form['post_max_chars'] = '<label>'.$lang['shoutbox']['post max chars'].' </label> <input type="text" name="post_max_chars" value="'.$settings['post_max_chars'].'" />'; $form['posts_refresh_time'] = '<label>'.$lang['shoutbox']['posts reflash time'].' </label> <input type="text" name="posts_refresh_time" value="'.$settings['posts_refresh_time'].'" />'; $form['posts_limit'] = '<label>'.$lang['shoutbox']['posts limit'].' </label> <input type="text" name="posts_limit" value="'.$settings['posts_limit'].'" />'; $form['time_anti_flood'] = '<label>'.$lang['shoutbox']['time_anti_flood'].' </label> <input type="text" name="time_anti_flood" value="'.$settings['time_anti_flood'].'" />'; $form['save'] = '<button type="submit" name="save" value="save">'.$lang['shoutbox']['save'].'</button>'; $form['bottom'] = '</form>'; //Return form foreach($form as $input) $result .= $input."\n"; return $result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function general_settings() {\n\t\t$msg = '';\n\t\tif (!empty($_POST) && isset($_POST['save-settings'])) {\n\t\t\t$msg = self::save();\n\t\t}\n\t\t$page_id = get_option('dod_page_id');\n\t\t$args['page_id'] = $page_id;\n\t\t$query = new WP_Query($args);\n\t\t$page = $query->posts[0];\n\t\t$custom_css = array_shift(get_post_meta($page_id, 'dod_custom_css'));\n\t\t$selected_template = array_shift(get_post_meta($page_id, '_wp_page_template'));\n\t\t$templates = get_page_templates();\n\t\tinclude 'views/_geneal_settings.php';\n\t}", "abstract protected function define_my_settings();", "abstract public function get_settings();", "public function action_general_settings()\n\t{\n\t\tglobal $context, $scripturl, $txt;\n\n\t\t$context['SPortal']['themes'] = sp_general_load_themes();\n\n\t\t// These are very likely to come in handy! (i.e. without them we're doomed!)\n\t\trequire_once(ADMINDIR . '/ManagePermissions.controller.php');\n\t\trequire_once(ADMINDIR . '/ManageServer.controller.php');\n\t\trequire_once(SUBSDIR . '/SettingsForm.class.php');\n\n\t\t// Initialize the form\n\t\t$this->_initGeneralSettingsForm();\n\n\t\tif (isset($_GET['save']))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\tif (!empty($_POST['sp_portal_mode']))\n\t\t\t{\n\t\t\t\tupdateSettings(array('front_page' => 'PortalMain_Controller'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupdateSettings(array('front_page' => 'MessageIndex_Controller'));\n\t\t\t}\n\n\t\t\t$this->_generalSettingsForm->setConfigValues($_POST);\n\t\t\t$this->_generalSettingsForm->save();\n\t\t\tredirectexit('action=admin;area=portalconfig;sa=generalsettings');\n\t\t}\n\n\t\t$context['post_url'] = $scripturl . '?action=admin;area=portalconfig;sa=generalsettings;save';\n\t\t$context['settings_title'] = $txt['sp-adminGeneralSettingsName'];\n\t\t$context['page_title'] = $txt['sp-adminGeneralSettingsName'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t$this->_generalSettingsForm->prepare();\n\t}", "function webnotik_register_general_settings() {\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_name' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_phone' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_email' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_address1' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_address2' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_privacy' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_tos' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_sma_linkedin' );\n}", "function settings_section() {\n\t\t}", "function achilles_settings_init() {\n\t\n\t//create one option to store all of our values. \n register_setting( 'achilles-settings-group', 'achilles-settings' );\n add_settings_section( 'achilles-general-settings', 'General Settings', 'achilles_general_settings_callback', 'achilles' );\n add_settings_field('resident-portal', 'Resident Portal URL', 'resident_portal_url_callback', 'achilles', 'achilles-general-settings');\n add_settings_field('facebook-url', 'Facebook URL', 'facebook_url_callback', 'achilles', 'achilles-general-settings' );\n add_settings_field('google-analytics-id', 'Google Analytics ID', 'google_analytics_id_callback', 'achilles', 'achilles-general-settings');\n\t\n}", "private function load_settings() {\n\t\t\n\t}", "abstract public function getSettings();", "private function init_general_settings() {\n\t\t\tregister_setting(\n\t\t\t\tself::LINKID_SETTINGS_PAGE_ID, //Needs to be the page itself, otherwise the variables do not get white-listed on post...\n\t\t\t\tLink_WP_LinkID::LINKID_SETTINGS_VARIABLE,\n\t\t\t\tarray( $this, 'validate_settings' )\n\t\t\t);\n\n\t\t\t//\n\t\t\t// Initialize the section\n\t\t\t//\n\t\t\tadd_settings_section(\n\t\t\t\tself::GENERAL_SETTINGS_SECTION_ID,\n\t\t\t\t__( \"General Settings\", \"link-linkid\" ),\n\t\t\t\tarray( $this, 'render_general_settings_info' ),\n\t\t\t\tself::LINKID_SETTINGS_PAGE_ID );\n\n\t\t\t//\n\t\t\t// Add fields\n\t\t\t//\n\t\t\t$this->add_field(\n\t\t\t\tLink_WP_LinkID::SETTINGS_APPLICATION_NAME,\n\t\t\t\t__( \"linkID Application Name\", \"link-linkid\" ),\n\t\t\t\t__( \"The name of your linkID application.\", \"link-linkid\" ),\n\t\t\t\tself::INPUT_TYPE_TEXT_INPUT,\n\t\t\t\tself::GENERAL_SETTINGS_SECTION_ID\n\t\t\t);\n\t\t\t$this->add_field(\n\t\t\t\tLink_WP_LinkID::SETTINGS_LINKID_HOSTNAME,\n\t\t\t\t__( \"linkID Hostname\", \"link-linkid\" ),\n\t\t\t\t__( \"The url of the linkID server with which the store will communicate. Use service.linkid.be \"\n\t\t\t\t . \"for production and demo.linkid.be for testing.\", \"link-linkid\" ),\n\t\t\t\tself::INPUT_TYPE_TEXT_INPUT,\n\t\t\t\tself::GENERAL_SETTINGS_SECTION_ID\n\t\t\t);\n\t\t\t$this->add_field(\n\t\t\t\tLink_WP_LinkID::SETTINGS_APPLICATION_USERNAME,\n\t\t\t\t__( \"linkID Application Username\", \"link-linkid\" ),\n\t\t\t\t__( \"The username of your linkID application.\", \"link-linkid\" ),\n\t\t\t\tself::INPUT_TYPE_TEXT_INPUT,\n\t\t\t\tself::GENERAL_SETTINGS_SECTION_ID\n\t\t\t);\n\t\t\t$this->add_field(\n\t\t\t\tLink_WP_LinkID::SETTINGS_APPLICATION_PASSWORD,\n\t\t\t\t__( \"linkID Application Password\", \"link-linkid\" ),\n\t\t\t\t__( \"The password of your linkID application.\", \"link-linkid\" ),\n\t\t\t\tself::INPUT_TYPE_TEXT_INPUT,\n\t\t\t\tself::GENERAL_SETTINGS_SECTION_ID\n\t\t\t);\n\t\t\t$this->add_field(\n\t\t\t\tLink_WP_LinkID::SETTINGS_LINKID_PROFILE,\n\t\t\t\t__( \"linkID Profile\", \"link-linkid\" ),\n\t\t\t\t__( \"The linkID profile used during login and/or payment. The profile may ask for e-mail, First Name, \"\n\t\t\t\t . \"Family Name, Street Name, Street Number, Street Bus, City, Postal/Zip Code and Country from the user.\",\n\t\t\t\t\t\"link-linkid\" ),\n\t\t\t\tself::INPUT_TYPE_TEXT_INPUT,\n\t\t\t\tself::GENERAL_SETTINGS_SECTION_ID\n\t\t\t);\n\n\n\t\t}", "public function general_settings_page() {\n include __DIR__ . \"/views/general_settings.php\";\n }", "function settings_page() { include($this->plugin_basename . '/core/admin/settings.php'); }", "abstract public function settings(): array;", "public function get_settings() {\n\t\t\n\t\t/* General Settings ------------------------------ */\n\t\t/* =============================================== */\n\n\t\t// Logo Image Link\n\t\t$this->settings['logo_link'] = array(\n\t\t\t'title'\t\t=> __('Logo Image Link'),\n\t\t\t'desc'\t\t=> __('Logo Image Link. Ex: http://example.com/wp-content/uploads/2013/03/example.png'),\n\t\t\t'std'\t\t\t=> '',\n\t\t\t'type'\t\t=> 'type',\n\t\t\t'section'\t=> 'general'\n\t\t);\n\n\t\t// Hero Unit\n\t\t$this->settings['hero_unit'] = array(\n\t\t\t'section'\t=> 'general',\n\t\t\t'title'\t\t=> __('Hero Unit'),\n\t\t\t'desc'\t\t=> __('Bootstrap Hero Unit on Home Page'),\n\t\t\t'type'\t\t=> 'checkbox',\n\t\t\t'std'\t\t\t=> 1 // checked, 0 is\n\t\t);\n\n\t\t//\n\t\t$this->settings['hero_header'] = array(\n\t\t\t'section'\t=> 'general',\n\t\t\t'title'\t\t=> __('Hero Header'),\n\t\t\t'desc'\t\t=> __('Bootstrap Hero Header on Home Page'),\n\t\t\t'type'\t\t=> 'text',\n\t\t\t'std'\t\t\t=> 'Hero Header'\n\t\t);\n\n\t\t$this->settings['hero_text'] = array( \n\t\t\t'section'\t=> 'general',\n\t\t\t'title'\t\t=> __('Hero Text'),\n\t\t\t'desc'\t\t=> __('Bootstrap Hero Text on Home Page'),\n\t\t\t'type'\t\t=> 'textarea',\n\t\t\t'std'\t\t\t=> 'Hero Text'\n\t\t);\n\t\t\n\t\t/* Navigation Settings --------------------------- */\n\t\t/* =============================================== */\n\t\t\n\t\t// Navbar?\n\t\t$this->settings['navbar_on'] = array(\n\t\t 'section' => 'navigation',\n\t\t 'title' => __('Use Navbar?'),\n\t\t 'desc' => __('Do you want to use the navbar element'),\n\t\t 'type' => 'checkbox',\n\t\t 'std' => 1\n\t\t);\n\t\t\n\t\t// Navbar Location Options\n\t\t$this->settings['navbar_location'] = array(\n\t\t 'section' => 'navigation',\n\t\t 'title' => __('Navbar Location'),\n\t\t 'desc' => __('Choose the location of the navbar'),\n\t\t 'type' => 'select',\n\t\t 'std' => '',\n\t\t 'choices' => array(\n\t\t 'choice1' => 'Fixed To Top',\n\t\t 'choice2' => 'Static Top',\n\t\t 'choice3' => 'Fixed To Bottom',\n\t\t 'choice4' => 'Static Bottom'\n\t\t )\n\t\t);\n\t\t\n\t\t// Search in Navbar\n\t\t$this->settings['search_navbar'] = array(\n\t\t 'section' => 'navigation',\n\t\t 'title' => __('Search in Navbar'),\n\t\t 'desc' => __('Put the Search in the Navbar'),\n\t\t 'type' => 'checkbox',\n\t\t 'std' => 1\n\t\t);\n\t\t\n\t\t// Invert Navbar Color\n\t\t$this->settings['inverse_navbar'] = array(\n\t\t 'section' => 'navigation',\n\t\t 'title' => __('Inverse Navbar Color'),\n\t\t 'desc' => __('Change the navbar color to black'),\n\t\t 'type' => 'checkbox',\n\t\t 'std' => 1\n\t\t);\n\t\t\n\t\t// Navbar below header?\n\t\t$this->settings['header_navbar'] = array(\n\t\t 'section' => 'navigation',\n\t\t 'title' => __('Navbar in Header?'),\n\t\t 'desc' => __('Add a navbar menu inbetween the header and content'),\n\t\t 'type' => 'checkbox',\n\t\t 'std' => 1\n\t\t);\n\t\t\n\t\t// Brand in navbar below header?\n\t\t$this->settings['brand_header_nav'] = array(\n\t\t 'section' => 'navigation',\n\t\t 'title' => __('Brand in Header Navbar'),\n\t\t 'desc' => __('Add or Remove the brand tag in the header navbar'),\n\t\t 'type' => 'checkbox',\n\t\t 'std' => 1\n\t\t);\n\t\t\n\t\t/* Header and Footer ----------------------------- */\n\t\t/* =============================================== */\n\t\t\n\t\t// Turn top widget area on\n\t\t$this->settings['top_widgets'] = array(\n\t\t 'section' => 'header_footer',\n\t\t 'title' => __('Top Widget Area'),\n\t\t 'desc' => __('Turn the top widget area on and off'),\n\t\t 'type' => 'checkbox',\n\t\t 'std' => 1\n\t\t);\n\t\t\n\t\t// Number of Footer Widgets\n\t\t$this->settings['footer_widgets'] = array(\n\t\t 'section' => 'header_footer',\n\t\t 'title' => __('Number of Footer Areas'),\n\t\t 'desc' => __('Number of widget areas displayed in the footer'),\n\t\t 'type' => 'select',\n\t\t 'std' => '',\n\t\t 'choices' => array(\n\t\t 'choice1' => '0',\n\t\t 'choice2' => '1',\n\t\t 'choice3' => '2',\n\t\t 'choice4' => '3'\n\t\t )\n\t\t);\n\t\t\n\t\t/* Project Settings ---------------------------- */\n\t\t/* ============================================= */\n\t\t\n\t\t// Project Layout\n\t\t$this->settings['project_layout'] = array(\n\t\t\t'section'\t\t=> 'projects',\n\t\t\t'title'\t\t\t=> __('Project Page Layout'),\n\t\t\t'desc'\t\t\t=> __('Pick a layout'),\n\t\t\t'std'\t\t\t\t=> '',\n\t\t\t'type'\t\t\t=> 'select',\n\t\t\t'choices'\t\t=> array(\n\t\t\t\t'choice1'\t=> 'Blog Posts',\n\t\t\t\t'choice2'\t=> 'List',\n\t\t\t\t'choice3' => 'Boxes'\n\t\t\t)\n\t\t);\n\n\t\t/* Social Media ---------------------------------- */\n\t\t/* =============================================== */\n\n\t\t// Facebook Link\n\t\t$this->settings['facebook_link'] = array(\n\t\t\t'section'\t=> 'socialmedia',\n\t\t\t'title'\t\t=> __('Facebook Profile Link'),\n\t\t\t'desc'\t\t=> __('Enter the URL to your Facebook Profile.'),\n\t\t\t'type'\t\t=> 'text',\n\t\t\t'std'\t\t\t=> 'http://facebook.com//ellsam'\n\t\t);\n\t\t\n\t\t// Twitter Link\n\t\t$this->settings['twitter_link'] = array(\n\t\t 'section' => 'socialmedia',\n\t\t 'title' => __('Twitter Profile Link'),\n\t\t 'desc' => __('Enter the URL to your Twitter Profile.'),\n\t\t 'type' => 'text',\n\t\t 'std' => ''\n\t\t);\n\n\t\t/* Reset ----------------------------------------- */\n\t\t/* =============================================== */\n\n\t\t// Reset\n\t\t$this->settings['reset'] = array(\n\t\t\t'section'\t=> 'reset',\n\t\t\t'title'\t\t=> __('Reset Theme'),\n\t\t\t'type'\t\t=> 'checkbox',\n\t\t\t'std'\t\t\t=> 0,\n\t\t\t'class'\t\t=> 'warning',\n\t\t\t'desc'\t\t=> __('Check this box and click \"Save Changes\" below to reset theme options to their defaults.')\n\t\t);\n\t}", "function get_settings($option)\n {\n }", "function Settings_API($load_settings=true)\n\t{\n\t\t$this->ConfigFile = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.php';\n\t\t$this->WhiteLabelCache = IEM_InterspireStash::getInstance();\n\n\t\tif ($load_settings) {\n\t\t\t$db = $this->GetDb();\n\t\t\t$this->LoadSettings();\n\t\t}\n\t}", "public function settings()\n {\n }", "public function get_settings()\n {\n }", "protected function _setting_handle() {}", "function get_registered_settings()\n {\n }", "function settings() {\n // ADD SETTINGS SECTION\n // Args: name of section, subtitle of section (can be null), html content if needed e.g. description text, page slug to add section to\n add_settings_section('wcp_first_section', null, null, 'word-count-settings-page');\n\n // LOCATION SETTING\n // Args: name of setting to tie to, html label text i.e. name users will see, function to build html, page slug for settings page we're using, which section to add option in\n add_settings_field('wcp_location', 'Display Location', array($this, 'locationHTML'),'word-count-settings-page', 'wcp_first_section');\n // Args: group settings belong to, name of setting, array with sanitise callback and default value\n register_setting('wordcountplugin', 'wcp_location', array('sanitize_callback' => array($this, 'sanitizeLocation'), 'default' => '0'));\n\n // HEADLINE TEXT SETTING\n add_settings_field('wcp_headline', 'Headline Text', array($this, 'headlineHTML'),'word-count-settings-page', 'wcp_first_section');\n register_setting('wordcountplugin', 'wcp_headline', array('sanitize_callback' => 'sanitize_text_field', 'default' => 'Post Statistics'));\n\n // WORD COUNT DISPLAY SETTING\n // Extra param to pass name to HTML display function\n add_settings_field('wcp_wordcount', 'Word Count', array($this, 'checkboxHTML'),'word-count-settings-page', 'wcp_first_section', array('boxName' => 'wcp_wordcount'));\n register_setting('wordcountplugin', 'wcp_wordcount', array('sanitize_callback' => 'sanitize_text_field', 'default' => '1'));\n\n // CHARACTER COUNT DISPLAY SETTING\n add_settings_field('wcp_charcount', 'Character Count', array($this, 'checkboxHTML'),'word-count-settings-page', 'wcp_first_section', array('boxName' => 'wcp_charcount'));\n register_setting('wordcountplugin', 'wcp_charcount', array('sanitize_callback' => 'sanitize_text_field', 'default' => '1'));\n\n // READ TIME DISPLAY SETTING\n add_settings_field('wcp_readtime', 'Read Time', array($this, 'checkboxHTML'),'word-count-settings-page', 'wcp_first_section', array('boxName' => 'wcp_readtime'));\n register_setting('wordcountplugin', 'wcp_readtime', array('sanitize_callback' => 'sanitize_text_field', 'default' => '1'));\n }", "public function getBasicSettingsValues()\n\t{\n\t\t$values = array();\n\n\t\t$values[\"webspace_dir\"] = getcwd().\"/data\";\n\t\t$values[\"data_dir\"] = $this->setup->ini->readVariable(\"clients\",\"datadir\");\n\t\t$values[\"convert_path\"] = $this->setup->ini->readVariable(\"tools\",\"convert\");\n\t\t$values[\"zip_path\"] = $this->setup->ini->readVariable(\"tools\",\"zip\");\n\t\t$values[\"unzip_path\"] = $this->setup->ini->readVariable(\"tools\",\"unzip\");\n\t\t$values[\"ghostscript_path\"] = $this->setup->ini->readVariable(\"tools\",\"ghostscript\");\n\t\t$values[\"java_path\"] = $this->setup->ini->readVariable(\"tools\",\"java\");\n\t\t$values[\"htmldoc_path\"] = $this->setup->ini->readVariable(\"tools\",\"htmldoc\");\n\t\t//$values[\"mkisofs_path\"] = $this->setup->ini->readVariable(\"tools\",\"mkisofs\");\n\t\t$values[\"ffmpeg_path\"] = $this->setup->ini->readVariable(\"tools\",\"ffmpeg\");\n\t\t$values[\"latex_url\"] = $this->setup->ini->readVariable(\"tools\",\"latex\");\n\t\t$values[\"fop_path\"] = $this->setup->ini->readVariable(\"tools\",\"fop\");\n\t\t$values[\"vscanner_type\"] = $this->setup->ini->readVariable(\"tools\", \"vscantype\");\n\t\t$values[\"scan_command\"] = $this->setup->ini->readVariable(\"tools\", \"scancommand\");\n\t\t$values[\"clean_command\"] = $this->setup->ini->readVariable(\"tools\", \"cleancommand\");\n\t\t$values[\"log_path\"] = $this->setup->ini->readVariable(\"log\",\"path\").\"/\".\n\t\t\t$this->setup->ini->readVariable(\"log\",\"file\");\n\t\t$values[\"chk_log_status\"] = !$this->setup->ini->readVariable(\"log\",\"enabled\");\n\t\t$values[\"time_zone\"] = $this->setup->ini->readVariable(\"server\", \"timezone\");\n\t\t\n\t\t// https settings\n\t\t$values[\"auto_https_detect_enabled\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_enabled\");\n\t\t$values[\"auto_https_detect_header_name\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_name\");\n\t\t$values[\"auto_https_detect_header_value\"] = $this->setup->ini->readVariable(\"https\", \"auto_https_detect_header_value\");\n\n\t\t$this->form->setValuesByArray($values);\n\t}", "function dblions_settings() {\n\tregister_setting( 'dblions-settings-group', 'footer_text' );\n\tregister_setting( 'dblions-settings-group', 'desc_img' );\n\n\tregister_setting( 'dblions-sidebar-group', 'sidebar_embed' );\n\n\tregister_setting( 'dblions-social-group', 'facebook_link' );\n\tregister_setting( 'dblions-social-group', 'twitter_link' );\n\tregister_setting( 'dblions-social-group', 'instagram_link' );\n\tregister_setting( 'dblions-social-group', 'tumblr_link' );\n\tregister_setting( 'dblions-social-group', 'gplus_link' );\n\n\tadd_settings_section( 'dblions-general-options', 'General Options', \n\t\t'dblions_general_options', 'dblions' );\n\tadd_settings_section( 'dblions-img-options', 'Image Options', \n\t\t'dblions_img_options', 'dblions' );\n\tadd_settings_section( 'dblions-sidebar-options', 'Sidebar Options', \n\t\t'dblions_sidebar_options', 'dblions_sidebar' );\n\tadd_settings_section( 'dblions-social-options', 'Social Media Options', \n\t\t'dblions_social_options', 'dblions_social' );\n\n\tadd_settings_field( 'footer-text', 'Footer Text', 'dblions_footer_text', 'dblions', 'dblions-general-options' );\n\tadd_settings_field( 'desc-img', 'Description Background Image', 'dblions_desc_img', 'dblions', 'dblions-img-options' );\n\n\tadd_settings_field( 'sidebar-embed', 'Sidebar Embed', 'dblions_sidebar_embed', 'dblions_sidebar', 'dblions-sidebar-options' );\n\n\tadd_settings_field( 'facebook-link', 'Facebook Link', 'dblions_fb_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'twitter-link', 'Twitter Link', 'dblions_tw_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'instagram-link', 'Instagram Link', 'dblions_ig_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'tumblr-link', 'Tumblr Link', 'dblions_tumblr_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'gplus-link', 'Google+ Link', 'dblions_gplus_link', 'dblions_social', 'dblions-social-options' );\n}", "function thirty8_simple_map_settings_page()\n\t\t\t{\n\t\t\t\t//include('admin/settings.php');\n\t\t\t}", "function register_settings() {\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'endpoint'); // Sanitize\n\t\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'check_interval'); // Sanitize\n\t\n\tregister_setting('StandardsReader_settings_group', 'mapPage');\n\tregister_setting('StandardsReader_settings_group', 'mapListing');\n\t\t \n}", "public function settings_page() { ?>\n\n <div class=\"wrap\">\n <?php $this->settings_api->settings_html(); ?>\n </div><?php\n }", "function settings_init()\n\t{\n\t\t//-----------------------------------------\n\t\t// Load the settings lib\n\t\t//-----------------------------------------\n\t\t\n\t\t$settings = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/settings.php', 'ad_settings' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Have we created this setting group yet?\n\t\t//-----------------------------------------\n\t\t\n\t\t$group = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'conf_title_id', 'from' => 'conf_settings_titles', 'where' => \"conf_title_keyword='umi'\" ) );\n\t\t\n\t\tif ( !$group['conf_title_id'] )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_insert( 'conf_settings_titles', array( 'conf_title_title' => 'Universal Mod Installer',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_desc' => 'Install and manage all compatible mods',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_count' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_noshow' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conf_title_keyword' => 'umi',\n\t\t\t\t\t\t\t\t\t\t )\t\t\t\t\t\t\t\t );\n\t\t\t\n\t\t\t$group['conf_title_id'] = $this->ipsclass->DB->get_insert_id();\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Define our settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$umi_settings = array( 'umi_mods_perpage' => array( 'conf_title' => 'Number of mods to display per page',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_description' => 'How many mods do you want to display per page on the mods list?',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_type' => 'input',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_default' => 10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_extra' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_evalphp' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_position' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_start_group' => 'Universal Mod Installer settings',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_end_group' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_help_key' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'umi_do_callbacks' => array( 'conf_title' => 'Use the \\'callback\\' functions?',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_description' => 'These functions can help ensure your mods are up to date, but not all hosts allow them to work.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_type' => 'yes_no',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_default' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_extra' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_evalphp' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_position' => 2,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_start_group' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_end_group' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_help_key' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 'umi_skin_recache' => array( 'conf_title' => 'Recache skins automatically?',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_description' => 'If any templates are added, should the skin be automatically recached? Turn this off if installing a mod exhausts your memory at this point.',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_type' => 'yes_no',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_default' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_extra' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_evalphp' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_position' => 3,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_start_group' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_end_group' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conf_help_key' => '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Ensure the settings have been created\n\t\t//-----------------------------------------\n\t\t\n\t\t$cnt = 0;\n\t\t\n\t\tforeach ( $umi_settings as $key => $value )\n\t\t{\n\t\t\tif ( !isset( $this->ipsclass->vars[ $key ] ) )\n\t\t\t{\n\t\t\t\t$cnt++;\n\t\t\t\t\n\t\t\t\t$insert = array( 'conf_title' => $value['conf_title'],\n\t\t\t\t\t\t\t\t 'conf_description' => $value['conf_description'],\n\t\t\t\t\t\t\t\t 'conf_group' => $group['conf_title_id'],\n\t\t\t\t\t\t\t\t 'conf_type' => $value['conf_type'],\n\t\t\t\t\t\t\t\t 'conf_key' => $key,\n\t\t\t\t\t\t\t\t 'conf_default' => $value['conf_default'],\n\t\t\t\t\t\t\t\t 'conf_extra' => $value['conf_extra'],\n\t\t\t\t\t\t\t\t 'conf_evalphp' => $value['conf_evalphp'],\n\t\t\t\t\t\t\t\t 'conf_protected' => 1,\n\t\t\t\t\t\t\t\t 'conf_position' => $value['conf_position'],\n\t\t\t\t\t\t\t\t 'conf_start_group' => $value['conf_start_group'],\n\t\t\t\t\t\t\t\t 'conf_end_group' => $value['conf_end_group'],\n\t\t\t\t\t\t\t\t 'conf_help_key' => $value['conf_help_key'],\n\t\t\t\t\t\t\t\t 'conf_add_cache' => 1,\n\t\t\t\t\t\t\t );\n\t\t\t\t\n\t\t\t\tif ( !$this->ipsclass->DB->field_exists( 'conf_help_key', 'conf_settings' ) )\n\t\t\t\t{\n\t\t\t\t\tunset( $insert['conf_help_key'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->do_insert( 'conf_settings', $insert );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Recache, if needed\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $cnt )\n\t\t{\n\t\t\t$settings->setting_rebuildcache();\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "function myprefix_init_settings() {\t\n\t\n\t// Settings section:\n\t// Multiple settings can go into this section after we set it up.\n\t// We are going to add three settings into this one section.\n\t\tadd_settings_section(settingsSectionOneSlug, settingsSectionOneTitle, \n\t\t\tsettingsSectionOneCallbackFunction, settingsPageID);\n\t\n\t// Settings field:\n\t// We add settings fields to our settings section:\n\t\tadd_settings_field(settingOneSlug, settingOneTitle, settingOneCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingOneSlug ));\n\t\tadd_settings_field(settingTwoSlug, settingTwoTitle, settingTwoCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingTwoSlug ));\n\t\tadd_settings_field(settingThreeSlug, settingThreeTitle, settingThreeCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingThreeSlug ));\n\t\n\t// Setting:\n\t// Now we register our settings:\n\t\tregister_setting(settingsPageID, settingOneSlug, settingOneValidationFunction);\n\t\tregister_setting(settingsPageID, settingTwoSlug, settingTwoValidationFunction);\n\t\tregister_setting(settingsPageID, settingThreeSlug, settingThreeValidationFunction);\n}", "function achilles_theme_settings_page(){ ?>\n <div class=\"wrap\">\n <h2><?php printf(__('%s Settings', 'achilles'), wp_get_theme()); ?></h2>\n <div class=\"updated\">\n <p><?php _e('Enter in your property settings below.', 'achilles'); ?></p>\n </div>\n <?php settings_errors(); ?> \n \n <form action=\"options.php\" method=\"POST\">\n <?php settings_fields( 'achilles-settings-group' ); ?>\n <?php do_settings_sections( 'achilles' ); ?>\n <?php submit_button(); ?>\n </form>\n \n </div> <!-- end settings wrap -->\n \n\t\n<?php }", "public function settings(){\n\t\t$this->verify();\n\t\t$data['title']=\"Settings\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('settings', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "function get_settings() {\n\n $defaults = [\n 'general' => [\n 'label' => __( 'General', 'fwp' ),\n 'fields' => [\n 'license_key' => [\n 'label' => __( 'License Key', 'fwp' ),\n 'html' => $this->get_field_html( 'license_key' )\n ],\n 'gmaps_api_key' => [\n 'label' => __( 'Google Maps API Key', 'fwp' ),\n 'html' => $this->get_field_html( 'gmaps_api_key' )\n ],\n 'separators' => [\n 'label' => __( 'Separators', 'fwp' ),\n 'html' => $this->get_field_html( 'separators' )\n ],\n 'loading_animation' => [\n 'label' => __( 'Loading Animation', 'fwp' ),\n 'html' => $this->get_field_html( 'loading_animation', 'dropdown', [\n 'choices' => [ 'fade' => __( 'Fade', 'fwp' ), '' => __( 'Spin', 'fwp' ), 'none' => __( 'None', 'fwp' ) ]\n ] )\n ],\n 'prefix' => [\n 'label' => __( 'URL Prefix', 'fwp' ),\n 'html' => $this->get_field_html( 'prefix', 'dropdown', [\n 'choices' => [ 'fwp_' => 'fwp_', '_' => '_' ]\n ] )\n ],\n 'debug_mode' => [\n 'label' => __( 'Debug Mode', 'fwp' ),\n 'html' => $this->get_field_html( 'debug_mode', 'toggle', [\n 'true_value' => 'on',\n 'false_value' => 'off'\n ] )\n ]\n ]\n ],\n 'woocommerce' => [\n 'label' => __( 'WooCommerce', 'fwp' ),\n 'fields' => [\n 'wc_enable_variations' => [\n 'label' => __( 'Support product variations?', 'fwp' ),\n 'notes' => __( 'Enable if your store uses variable products.', 'fwp' ),\n 'html' => $this->get_field_html( 'wc_enable_variations', 'toggle' )\n ],\n 'wc_index_all' => [\n 'label' => __( 'Include all products?', 'fwp' ),\n 'notes' => __( 'Show facet choices for out-of-stock products?', 'fwp' ),\n 'html' => $this->get_field_html( 'wc_index_all', 'toggle' )\n ]\n ]\n ],\n 'backup' => [\n 'label' => __( 'Backup', 'fwp' ),\n 'fields' => [\n 'export' => [\n 'label' => __( 'Export', 'fwp' ),\n 'html' => $this->get_field_html( 'export' )\n ],\n 'import' => [\n 'label' => __( 'Import', 'fwp' ),\n 'html' => $this->get_field_html( 'import' )\n ]\n ]\n ]\n ];\n\n if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {\n unset( $defaults['woocommerce'] );\n }\n\n return apply_filters( 'facetwp_settings_admin', $defaults, $this );\n }", "public function settings()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['save']) && $_POST['save'] == 'Save Settings')\n\t\t\t{\n\t\t\t\tPlugin::setAllSettings($_POST['setting'], 'mbblog');\n\t\t\t\tFlash::setNow('success', __('Settings have been saved!'));\t\t \t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$this->display('mbblog/views/admin/settings', array('settings' => Plugin::getAllSettings('mbblog')));\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}", "function showSettings() {\n global $objTemplate,$_ARRAYLANG;\n $template = new \\Cx\\Core\\Html\\Sigma();\n $objTemplate->addBlockfile('ADMIN_CONTENT', 'settings_system', 'settings.html');\n $templateObj = new \\Cx\\Core\\Html\\Sigma(ASCMS_CORE_PATH . '/Config/View/Template/Backend');\n $templateObj->loadTemplateFile('development_tools.html');\n $templateObj->setVariable(array(\n 'TXT_TITLE_SET5' => $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'],\n 'TXT_DEBUGGING_STATUS' => $_ARRAYLANG['TXT_DEBUGGING_STATUS'],\n 'TXT_DEBUGGING_FLAGS' => $_ARRAYLANG['TXT_DEBUGGING_FLAGS'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_PHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_PHP'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP'],\n 'TXT_DEBUGGING_EXPLANATION' => $_ARRAYLANG['TXT_DEBUGGING_EXPLANATION'],\n 'TXT_SAVE_CHANGES' => $_ARRAYLANG['TXT_SAVE'],\n 'TXT_RADIO_ON' => $_ARRAYLANG['TXT_ACTIVATED'],\n 'TXT_RADIO_OFF' => $_ARRAYLANG['TXT_DEACTIVATED']\n ));\n if (in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n if (isset($_POST['debugging'])) {\n $this->updateDebugSettings($_POST['debugging']);\n }\n $this->setDebuggingVariables($templateObj);\n }\n \\Cx\\Core\\Setting\\Controller\\Setting::init('Config', null, 'Yaml', null, \\Cx\\Core\\Setting\\Controller\\Setting::REPOPULATE);\n \\Cx\\Core\\Setting\\Controller\\Setting::storeFromPost();\n \n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'site');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_SITE'],\n $_ARRAYLANG['TXT_CORE_CONFIG_SITE'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'contactInformation');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'],\n $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'administrationArea');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], \n $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], \n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'security');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'],\n $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n if (in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n \\Cx\\Core\\Setting\\Controller\\Setting::show_external(\n $template,\n $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'],\n $templateObj->get()\n );\n }\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'otherConfigurations');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'],\n $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n\n\n // show also hidden settins\n if ( in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())\n && \\Permission::hasAllAccess()\n && isset($_GET['all'])\n ) {\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'core');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'CORE',\n 'CORE', \n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'release');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'RELEASE',\n 'RELEASE',\n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'component');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'COMPONENT',\n 'COMPONENT',\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'license');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'LICENSE', \n 'LICENSE', \n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'cache');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'CACHE', \n 'CACHE', \n 'TXT_CORE_CONFIG_',\n true\n );\n }\n $this->checkFtpAccess();\n $objTemplate->setVariable('SETTINGS_TABLE', $template->get());\n $objTemplate->parse('settings_system');\n }", "function get_settings()\n {\n #global $pdo, $db_settings;\n #$database = Database::getInstance();\n $result = Database::$content->query(\"SELECT name, value FROM \".Database::$db_settings['settings_table']);\n while($line = $result->fetch())\n {\n $settings[$line['name']] = $line['value'];\n }\n return $settings;\n }", "abstract protected function loadSettings();", "public function load_settings()\n {\n // Basic Settings\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_basic',\n\t\t\t'title'\t\t\t => 'Grundeinstellungen',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_basic = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_send_cache_control_header',\n\t\t\t'title'\t\t\t\t => 'Cache-Control Headers',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_send_cache_control_header = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_etag',\n\t\t\t'title'\t\t\t\t => 'ETag',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_etag = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_generate_weak_etag',\n\t\t\t'title'\t\t\t\t => 'Weak ETag',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_generate_weak_etag = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_last_modified',\n\t\t\t'title'\t\t\t\t => 'Modified Header',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_last_modified = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_expires',\n\t\t\t'title'\t\t\t\t => 'Expries Header',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_expires = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_add_backwards_cache_control',\n\t\t\t'title'\t\t\t\t => 'Legacy Cache Control',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_add_backwards_cache_control = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_mobile_detect',\n\t\t\t'title'\t\t\t\t => 'Mobile Geräteerkennung',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_mobile_detect = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_expires_max_age',\n\t\t\t'title'\t\t\t\t => 'Expires Max-Age',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_basic',\n\t\t\t'description' => 'Sekunden',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_expires_max_age = new Field( $args );\n\n // Compression\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_compression',\n\t\t\t'title'\t\t\t => 'Kompression',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_compression = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_gzip',\n\t\t\t'title'\t\t\t\t => 'GZip',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_gzip = new Field( $args );\n\n\t $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_br',\n\t\t\t'title'\t\t\t\t => 'Brotli',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_br = new Field( $args );\n\n\t $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_deflate',\n\t\t\t'title'\t\t\t\t => 'Deflate (Zlib)',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_compression',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_deflate = new Field( $args );\n\n // Monitoring\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_health',\n\t\t\t'title'\t\t\t => 'Monitoring',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_health = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_health',\n\t\t\t'title'\t\t\t\t => 'Health Check',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_health',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_health_enable = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_health_url',\n\t\t\t'title'\t\t\t\t => 'Health Url',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_health',\n\t\t\t'description' => 'Z.B. /healthz',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page\n\t\t);\n\t\t$asse_http_healt_url= new Field( $args );\n\n // CDN\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_cdn',\n\t\t\t'title'\t\t\t => 'CDN',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_cdn = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_cdn',\n\t\t\t'title'\t\t\t\t => 'CDN',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_cdn',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'dropdown', // text, textarea, password, checkbox, dropbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n 'options' => array( CDN::None => 'Keins', CDN::Akamai => 'Akamai', CDN::Cloudfront => 'Cloudfront' )\n\t\t);\n\t\t$asse_http_cdn = new Field( $args );\n\n // Advanced\n\t\t$args = array(\n\t\t\t'id'\t\t\t => 'asse_http_experimental',\n\t\t\t'title'\t\t\t => 'Experimental',\n\t\t\t'page'\t\t\t => $this->page,\n\t\t\t'description'\t=> '',\n\t\t);\n\t\t$asse_http_experimental = new Section( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_origin',\n\t\t\t'title'\t\t\t\t => 'Origin',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht! Kann nicht gesetzt werden, wenn HTTP_ORIGIN gesetzt ist',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n 'disabled' => true,\n 'disabled_default' => ORIGIN_HOST, // todo\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_origin = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_replace_urls',\n\t\t\t'title'\t\t\t\t => 'Urls ersetzen',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => true,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_etag_salt = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_etag_salt',\n\t\t\t'title'\t\t\t\t => 'ETag Salt',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => '',\n\t\t\t'type'\t\t\t\t => 'text', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_etag_salt = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_try_rewrite_categories',\n\t\t\t'title'\t\t\t\t => 'Rewrite Kategorien',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_try_rewrite_categories = new Field( $args );\n\n $args = array(\n\t\t\t'id'\t\t\t\t => 'asse_http_try_catch_404',\n\t\t\t'title'\t\t\t\t => 'Try Catch 404',\n\t\t\t'page'\t\t\t\t => $this->page,\n\t\t\t'section'\t\t\t => 'asse_http_experimental',\n\t\t\t'description' => 'Vorsicht!',\n\t\t\t'type'\t\t\t\t => 'checkbox', // text, textarea, password, checkbox\n\t\t\t'multi'\t\t\t\t => false,\n\t\t\t'option_group'\t=> $this->page,\n\t\t);\n\t\t$asse_http_expires_max_age = new Field( $args );\n }", "function custom_settings_page() { ?>\n\t<div class=\"wrap\">\n\t\t<h1>Custom Settings</h1>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php\n settings_fields('section');\n do_settings_sections('theme-options'); \n submit_button(); \n ?>\n\t\t</form>\n\t</div>\n\t<?php }", "function achilles_general_settings_callback() {\n echo 'Welcome to the Achilles Theme Settings. Here you will be able to set information for your property that will be used across the website.';\n}", "function construct_settings()\r\n\t{\r\n\t\tglobal $ilance, $phrase;\r\n\t\t\t\r\n\t\t$sql = $ilance->db->query(\"SELECT * FROM \" . DB_PREFIX . \"fbbridge_configuration\", 0, null, __FILE__, __LINE__);\r\n\t\tif ($ilance->db->num_rows($sql) > 0)\r\n\t\t{\r\n\t\t\t\t$html = '';\r\n\t\t\t\twhile ($res = $ilance->db->fetch_array($sql))\r\n\t\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\t$html .= '<tr>';\r\n\t\t\t\t\t$html .= '<td width=\"27%\" valign=\"top\" nowrap>'.stripslashes($res['description']).'</td>';\r\n\t\t\t\t\t$html .= '<td width=\"34%\" align=\"left\" valign=\"top\">';\r\n\t\t\t\t\tif($res['inputtype'] == \"yesno\")\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t\t$html .= '<input type=\"radio\" name=\"'.$res['name'].'\" id=\"'.$res['name'].'\" value=\"1\" ';\r\n\t\t\t\t\t\tif ($res['value'])\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= 'checked=\"checked\">';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$html .= '<label for=\"'.$res['name'].'\">'.$phrase['_yes'].'</label>';\r\n\r\n\t\t\t\t\t\t$html .= '<input name=\"'.$res['name'].'\" id=\"'.$res['name'].'2\" type=\"radio\" value=\"0\" ';\r\n\t\t\t\t\t\tif ($res['value'] == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= 'checked=\"checked\">';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<label for=\"'.$res['name'].'2\">'.$phrase['_no'].'</label>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($res['inputtype'] == 'textarea')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<textarea name=\"'.$res['name'].'\" id=\"'.$res['name'].'\" style=\"width:250px; height:100px;\">'.$res['value'].'</textarea>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($res['inputtype'] == 'text')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .='<input style=\"padding:2px; height:15px; width:150px; font-family: verdana;\" id=\"'.$res['name'].'\" type=\"text\" name=\"'.$res['name'].'\" value=\"'.$res['value'].'\" />';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t$html .= '</tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$html .= '<tr>';\r\n\t\t\t\t$html .= '<td width=\"27%\" height=\"15\">'.stripslashes($res['description']).'</td>';\r\n\t\t\t\t$html .= '</tr>';\r\n\t\t}\r\n\t\treturn $html;\r\n\t}", "public function settings()\n\t{\n\t\t$settings = array();\n\n\t\t$settings['early_global'] = array('c', array(\n\t\t 'member_id' => \"global_member_id\",\n\t\t 'group_id' => \"global_group_id\",\n\t\t // defaults\n\t\t), array('member_id','group_id'));\n\n\t $settings['early_logged_in'] = array('c', array(\n\t\t 'member_id' => \"logged_in_member_id\",\n\t\t 'group_id' => \"logged_in_group_id\",\n\t\t // defaults\n\t\t), array('member_id','group_id'));\n\n\t // for demo, include some others\n\t $settings['include_other'] = array('c', array(\n\t\t 'include_other' => \"Include other member variables\",\n\t\t), array());\n\t\t\n \t\t$settings['others'] = array('ms', array(\n\t\t 'username' => 'username',\n\t\t 'screen_name' => 'screen_name',\n\t\t 'email' => 'email',\n\t\t // 'last_visit' => 'last_visit',\n\t\t 'access_cp' => 'access_cp',\n\t\t // defaults\n\t\t), array());\n\n\t\t$settings['handy'] = array('c', array(\n\t\t 'comment_edit_time_limit' => \"comment_edit_time_limit\",\n\t\t), array('comment_edit_time_limit'));\n\n\t\treturn $settings;\n\t}", "public function register_settings() {\n\n\t\t// This include creates a variable called $settings.\n\t\t// TODO: Load this from a file instead ...\n\t\t$settings = array(\n\t\t\tarray(\n\t\t\t\t/*Sections*/\n\t\t\t\t'name'\t\t=> 'default',\n\t\t\t\t'title'\t\t=> __('General Settings','wpchaosclient'),\n\t\t\t\t'fields'\t=> array(\n\t\t\t\t\t/*Section fields*/\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-servicepath',\n\t\t\t\t\t\t'title' => __('Service Path','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-clientguid',\n\t\t\t\t\t\t'title' => __('Client GUID','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-accesspoint-guid',\n\t\t\t\t\t\t'title' => __('Access Point GUID','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-email',\n\t\t\t\t\t\t'title' => __('E-mail used for authentication','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-password',\n\t\t\t\t\t\t'title' => __('Password','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'password'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$this->settings = apply_filters('wpchaos-config', $settings);\n\n\t\tforeach($this->settings as $section) {\n\n\t\t\t//Validate\n\t\t\tif(!isset($section['name'],$section['title'],$section['fields']))\n\t\t\t\tcontinue;\n\n\t\t\t//Add section to WordPress\n\t\t\tadd_settings_section(\n\t\t\t\t$section['name'],\n\t\t\t\t$section['title'],\n\t\t\t\tnull,\n\t\t\t\t$this->menu_page\n\t\t\t);\n\n\t\t\tforeach($section['fields'] as $setting) {\n\t\t\t\t//Validate\n\t\t \t\tif(!isset($setting['title'],$setting['name'],$setting['type']))\n\t\t \t\t\tcontinue;\n\n\t\t \t\t//Are there any preconditions for this field to work properly?\n\t\t \t\tif(isset($setting['precond'])) {\n\t\t \t\t\tforeach($setting['precond'] as $precondition) {\n\t\t \t\t\t\tif(!$precondition['cond'])\n\t\t \t\t\t\t\tadd_action( 'admin_notices', function() use(&$precondition) { echo '<div class=\"error\"><p>'.$precondition['message'].'</p></div>'; },10);\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t\t// Add field to section\n\t\t \t\tadd_settings_field($setting['name'],\n\t\t\t\t\t$setting['title'],\n\t\t\t\t\tarray(&$this,'create_setting_field'),\n\t\t\t\t\t$this->menu_page,\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$setting);\n\n\t\t \t\t// Register field to be manipulated with\n\t\t \t\tregister_setting($this->menu_page,$setting['name']);\n\t\t\t}\n\n\t\t}\n\n\t }", "function settings_page() {\n global $wpdb, $wp_properties;\n\n include_once( __DIR__ . '/ui/settings-section.php' );\n\n }", "function remi_custom_settings()\n{\n register_setting( 'remi-settings-group','thumbnail_one');\n register_setting( 'remi-settings-group','thumbnail_one_title');\n register_setting( 'remi-settings-group','thumbnail_one_link');\n register_setting( 'remi-settings-group','thumbnail_one_pic');\n\n register_setting( 'remi-settings-group','thumbnail_two');\n register_setting( 'remi-settings-group','thumbnail_two_title');\n register_setting( 'remi-settings-group','thumbnail_two_link');\n register_setting( 'remi-settings-group','thumbnail_two_pic');\n\n register_setting( 'remi-settings-group','thumbnail_three');\n register_setting( 'remi-settings-group','thumbnail_three_title');\n register_setting( 'remi-settings-group','thumbnail_three_link');\n register_setting( 'remi-settings-group','thumbnail_three_pic');\n\n register_setting( 'remi-settings-group','remi_jumbotron');\n register_setting( 'remi-settings-group','remi_jumbotron_link');\n register_setting( 'remi-settings-group','remi_jumbotron_greeting');\n register_setting( 'remi-settings-group','remi_jumbotron_picture');\n register_setting( 'remi-settings-group','remi_home_list');\n register_setting( 'remi-settings-group','remi_home_list_title');\n\n\n /*\n for contact page\n */\n register_setting( 'remi-contact-group','remi_contact_email');\n register_setting( 'remi-contact-group','remi_contact_address');\n register_setting( 'remi-contact-group','remi_contact_city');\n register_setting( 'remi-contact-group','remi_contact_postcode');\n register_setting( 'remi-contact-group','remi_contact_num1');\n register_setting( 'remi-contact-group','remi_contact_num2');\n register_setting( 'remi-contact-group','twitter_handler','remi_sanitize_twitter_handler');\n register_setting( 'remi-contact-group','facebook_handler');\n register_setting( 'remi-contact-group','gplus_handler');\n register_setting( 'remi-contact-group','instagram_handler');\n register_setting( 'remi-contact-group','linkden_handler');\n\n\n add_settings_section( 'remi-home-options', 'Home Options',\n 'remi_home_options', 'Adekunle_remi');\n\n add_settings_section( 'remi-contact-options', 'Contact Options',\n 'remi_contact_options', 'Adekunle_remi2');\n\n\n /*\n for general page\n */\n add_settings_field( 'thumbnail-one', 'Thumbnail One', 'remi_thumbnail_one',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'thumbnail-two', 'Thumbnail Two', 'remi_thumbnail_two',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'thumbnail-three', 'Thumbnail Three', 'remi_thumbnail_three',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'remi-jumbotron-im', 'Jumbotron', 'remi_jumbotron_handler',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'remi-home-lis', 'Homepage Lists', 'remi_home_page_list',\n 'Adekunle_remi','remi-home-options');\n\n\n /*\n for contact page\n */\n add_settings_field( 'email-add', 'Email Address', 'remi_email_address',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'address-add', 'Full Address', 'remi_a_address',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'phone-add', 'Contact Number', 'remi_a_contact',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'twitter-im', 'Twitter Handler', 'remi_home_twitter_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'facebook-im', 'Facebook Handler', 'remi_home_facebook_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'gplus-im', 'Google+ Handler', 'remi_home_gplus_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'instagram-im', 'Instagram Handler', 'remi_home_instgram_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'linkden-im', 'LinkdIn Handler', 'remi_home_linkden_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n}", "function dl_cadi_settings(){\r\n\r\n}", "private function settings()\n\t{\n\t\tif($_POST)\n\t\t{\n\t\t\t// Available Vews\n config::set('s7n.views', $this->input->post('views'));\n\n\t\t\t// Default Sidebar Title\n config::set('s7n.default_sidebar_title', $this->input->post('default_sidebar_title'));\n\n\t\t\t// Default Sidebar Content\n config::set('s7n.default_sidebar_content', $this->input->post('default_sidebar_content'));\n\n\t\t\tmessage::info(__('Page Settings edited successfully'), 'admin/page/settings');\n\t\t}\n\n\t\t$this->head->title->append(__('Settings'));\n\n\t\t$this->template->title .= __('Settings');\n\t\t$this->template->content = View::factory('page/settings', array(\n\t\t\t'views' => config::get('s7n.page_views'),\n\t\t\t'default_sidebar_title' => config::get('s7n.default_sidebar_title'),\n\t\t\t'default_sidebar_content' => config::get('s7n.default_sidebar_content')\n\t\t));\n\t}", "public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}", "function theme_settings_page(){ \n\t?>\n\t<div class=\"wrap\">\n\t\t<h1>Virksomhedsinformation</h1>\n\t\t<p>Dette er globale virksomhedsoplysninger. Ændringer kan ses flere stedet på websitet</p>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php\n\t\t\tsettings_fields(\"section\");\n\t\t\tdo_settings_sections(\"theme-options\");\n\t\t\tsubmit_button();\n\t\t\t?>\n\t\t</form>\n\t</div>\n\t\n\t<?php }", "public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}", "protected function define_my_settings() {\n // No particular settings for this activity\n }", "public function getSettings();", "function register_initial_settings()\n {\n }", "function register_mysettings() {\n\tregister_setting( 'myoption-group', 'adsense_id' );\n\tregister_setting( 'myoption-group', 'site_url_one' );\n register_setting( 'myoption-group', 'site_url_two' );\n register_setting( 'myoption-group', 'site_url_three' );\n register_setting( 'myoption-group', 'site_url_four' );\n register_setting( 'myoption-group', 'site_url_five' );\n register_setting( 'myoption-group', 'site_font' );\n register_setting( 'myoption-group', 'site_total_posts' );\n register_setting( 'myoption-group', 'site_randomise_posts' );\n register_setting( 'myoption-group', 'site_show_curator_posts' );\n }", "public function settings() {\n\n\t\tdo_settings_sections( 'wpbgdc' );\n\n\t\tsubmit_button();\n\n\t\techo '<div class=\"clear\"></div>';\n\n\t}", "private function _settings($arg0 = '', $arg1 = '', $arg2 = ''){\n\t\t\n\t\t$this->load->model('model_app_data', 'app_data', true);\n\t\t$data['teams_promoters_venues'] = $this->app_data->retrieve_all_teams_promoters_venues();\n\t\t\n\t\t$this->load->view($this->view_dir . 'settings/view_super_admin_settings', $data);\n\t\t\n\t}", "protected function define_my_settings() {\n // No particular settings for this activity.\n }", "function defaultSettings($dsetting=\"\") {\n\t\tglobal $wpdb;\n\t\t$top10 = array(\t\"toplimit\"=>\"10\",\t//new in 1.8.3 - top stats list size\n\t\t\t\t\"topsearch\"=>\"1\",\n\t\t\t\t\"topreferrer\"=>\"1\",\n\t\t\t\t\"toprequest\"=>\"1\",\n\t\t\t\t\"topbrowser\"=>\"1\",\n\t\t\t\t\"topos\"=>\"1\",\n\t\t\t\t\"toplocale\"=>\"0\",\n\t\t\t\t\"topvisitor\"=>\"0\",\n\t\t\t\t\"toppostid\"=>\"0\",\t//new in v1.8.3 - top article by post-id\n\t\t\t\t\"topreferrer_exclude\"=>\"\",\n\t\t\t\t\"top_nospider\"=>\"0\");\t//new in v1.8.3 - exclude spiders from top stats\n\t\t$defaults = array(\n\t\t\t'wassup_active'\t\t=>\"1\",\n\t\t\t'wassup_loggedin'\t=>\"1\",\n\t\t\t'wassup_admin'\t\t=>\"1\",\n\t\t\t'wassup_spider'\t\t=>\"1\",\n\t\t\t'wassup_attack'\t\t=>\"1\",\n\t\t\t'wassup_hack'\t\t=>\"1\",\n\t\t\t'wassup_spamcheck'\t=>\"1\",\n \t\t'wassup_spam'\t\t=>\"1\",\n \t\t'wassup_refspam'\t=>\"1\",\n\t\t\t'wassup_exclude'\t=>\"\",\n\t\t\t'wassup_exclude_url'\t=>\"\",\n\t\t\t'wassup_exclude_user'\t=>\"\",\n\t\t\t'wassup_cache'\t\t=>\"1\",\n\t\t\t'wassup_chart'\t\t=>\"1\",\n\t\t\t'wassup_chart_type'\t=>\"2\",\n\t\t\t'delete_auto'\t\t=>\"never\",\n \t\t'delete_filter'\t\t=>\"\",\n\t\t\t'wassup_remind_mb'\t=>\"0\",\n\t\t\t'wassup_remind_flag'\t=>\"0\",\n\t\t\t'wassup_refresh'\t=>\"3\",\n\t\t\t'wassup_userlevel'\t=>\"8\",\n\t\t\t'wassup_screen_res'\t=>\"800\",\n\t\t\t'wassup_default_type'\t=>\"everything\",\n\t\t\t'wassup_default_spy_type'=>\"everything\",\n\t\t\t'wassup_default_limit'\t=>\"10\",\n\t\t\t'wassup_dashboard_chart'=>\"0\",\n\t\t\t'wassup_geoip_map'\t=>\"0\",\n\t\t\t'wassup_googlemaps_key'\t=>\"\",\n\t\t\t'wassup_spy_speed'\t=>\"5000\",\n\t\t\t'wassup_time_format'\t=>\"24\",\n\t\t\t'wassup_time_period'\t=>\"1\",\n\t\t\t'wassup_widget_title'\t=>\"Visitors Online\",\n\t\t\t'wassup_widget_ulclass'\t=>\"links\",\n\t\t\t'wassup_widget_loggedin'=>\"1\",\n\t\t\t'wassup_widget_comauth'\t=>\"1\",\n\t\t\t'wassup_widget_search'\t=>\"1\",\n\t\t\t'wassup_widget_searchlimit' =>\"5\",\n\t\t\t'wassup_widget_ref'\t=>\"1\",\n\t\t\t'wassup_widget_reflimit'=>\"5\",\n\t\t\t'wassup_widget_topbr'\t=>\"1\",\n\t\t\t'wassup_widget_topbrlimit'=>\"5\",\n\t\t\t'wassup_widget_topos'\t=>\"1\",\n\t\t\t'wassup_widget_toposlimit'=>\"5\",\n\t\t\t'wassup_widget_chars'\t=>\"18\",\n\t\t\t'wassup_alert_message'\t=>\"\",\n\t\t\t'wassup_uninstall'\t=>\"0\",\n\t\t\t'wassup_optimize'\t=>current_time('timestamp'),\n\t\t\t'wassup_top10'\t=>esc_attr(serialize($top10)),\n//\t\t\t\t\t\"topsearch\"=>\"1\", - moved\n//\t\t\t\t\t\"topreferrer\"=>\"1\", - moved\n//\t\t\t\t\t\"toprequest\"=>\"1\", - moved\n//\t\t\t\t\t\"topbrowser\"=>\"1\", - moved\n//\t\t\t\t\t\"topos\"=>\"1\", - moved\n//\t\t\t\t\t\"toplocale\"=>\"0\", - moved\n//\t\t\t\t\t\"topvisitor\"=>\"0\", - moved\n//\t\t\t\t\t\"topfeed\"=>\"0\", - moved\n//\t\t\t\t\t\"topcrawler\"=>\"0\", - moved\n//\t\t\t\t\t\"topreferrer_exclude\"=>\"\"))), - moved\n\t\t\t'whash' \t=>$this->get_wp_hash(),\n\t\t\t'wassup_version'=>\"\",\n\t\t\t'wassup_table' =>$wpdb->prefix . \"wassup\",\n\t\t\t'wassup_dbengine'=>$this->getMySQLsetting(\"engine\"));\n\n\t\t//never discard google maps api key with \"reset-to-default\"\n\t\tif (!empty($this->wassup_googlemaps_key)) {\n\t\t\t$defaults['wassup_googlemaps_key']= $this->wassup_googlemaps_key;\n\t\t}\n\t\t//never discard wassup_version' or 'wassup_table' with \"reset-to-default\"\n\t\tif (!empty($this->wassup_version)) {\n\t\t\t$defaults['wassup_version']= $this->wassup_version;\n\t\t}\n\t\tif (!empty($this->wassup_table)) {\n\t\t\t$defaults['wassup_table']= $this->wassup_table;\n\t\t}\n\t\t//New in 1.8.3: return a single default value when function argument given\n\t\tif (!empty($dsetting)) {\n\t\t\tif ($dsetting == \"top10\" || $dsetting == \"wassup_top10\" || $dsetting == \"top_stats\") {\n\t\t\t\treturn ($top10);\n\t\t\t} elseif (!empty($defaults[$dsetting])) {\n\t\t\t\treturn ($defaults[$dsetting]);\n\t\t\t} else {\n\t\t\t\treturn (null);\n\t\t\t}\n\t\t} else { \n\t\t\treturn($defaults);\n\t\t};\n\t}", "private function _get_general_section_settings() {\r\n\r\n global $WWOF_SETTINGS_SORT_BY, $WWOF_SETTINGS_DEFAULT_PPP;\r\n\r\n return array(\r\n\r\n array(\r\n 'title' => __( 'General Options', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => '',\r\n 'id' => 'wwof_general_main_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Use Alternate View Of Wholesale Page?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Checkbox on the right side of each product, and add to cart button at the bottom of the list' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_use_alternate_view_of_wholesale_page'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Disable Pagination?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Shows all products by lazy loading them in when the user scrolls down. The form will load in groups of products based on the number specified in the Products Per Page setting.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_disable_pagination'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Products Per Page' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'number',\r\n 'desc_tip' => sprintf( __( 'Number of products to display per page (for pagination) or how many products to load at a time (for lazy loading). Default is 12 products when left empty.' , 'woocommerce-wholesale-order-form' ) , $WWOF_SETTINGS_DEFAULT_PPP ),\r\n 'id' => 'wwof_general_products_per_page',\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show In Stock Quantity?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we display product stock quantity on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_show_product_stock_quantity'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show Product SKU?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we display product sku on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_show_product_sku'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Allow Product SKU Search?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we allow searching for products via sku on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_allow_product_sku_search'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show Product Thumbnail?', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Should we display a small product thumbnail on the product listing on the front end?' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_show_product_thumbnail'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Product Thumbnail Size', 'woocommerce-wholesale-order-form' ),\r\n 'desc' => __( 'This size is used in wholesale product listings', 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_product_thumbnail_image_size',\r\n 'css' => '',\r\n 'type' => 'wwof_image_dimension',\r\n 'default' => array(\r\n 'width' => '48',\r\n 'height' => '48'\r\n ),\r\n 'desc_tip' => true,\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Display the product details in a lightbox popup on click?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( \"Should the product details be displayed in a popup or redirect the user to the product's page?\" , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_display_product_details_on_popup'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Display Zero Inventory Products?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Zero inventory products are products that are out of inventory and do not allow backorders. This also includes non simple products whose composition requires a certain products that have zero inventory.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_display_zero_products'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Hide wholesale quantity discount prices.' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => sprintf( __( 'Hides the small table printed under the wholesale price when quantity based discounts are available for that product. Only used when <a href=\"%1$s\" target=\"blank\">WooCommerce Wholesale Prices Premium</a> is active.' , 'woocommerce-wholesale-order-form' ) , 'https://wholesalesuiteplugin.com/product/woocommerce-wholesale-prices-premium/' ),\r\n 'id' => 'wwof_general_hide_quantity_discounts'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Sort By' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => '',\r\n 'id' => 'wwof_general_sort_by',\r\n 'class' => 'chosen_select',\r\n 'options' => $WWOF_SETTINGS_SORT_BY\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Sort Order' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => '',\r\n 'id' => 'wwof_general_sort_order',\r\n 'class' => 'chosen_select',\r\n 'options' => array(\r\n 'asc' => __( 'Ascending' , 'woocommerce-wholesale-order-form' ),\r\n 'desc' => __( 'Descending' , 'woocommerce-wholesale-order-form' )\r\n )\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Display Cart Subtotal?' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Display cart subtotal at the bottom of the order form' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_display_cart_subtotal'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Cart Sub Total Prices Display' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Either to include or exclude price on sub total. Only used if \"Display Cart Sub Total\" option above is enabled.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_general_cart_subtotal_prices_display',\r\n 'class' => 'chosen_select',\r\n 'options' => array (\r\n 'incl' => __( 'Including tax' , 'woocommerce-wholesale-order-form' ),\r\n 'excl' => __( 'Excluding tax' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'default' => 'incl'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'List product variation individually' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'checkbox',\r\n 'desc' => __( 'Enabling this setting will list down each product variation individually and have its own row in the wholesale order form.' , 'woocommerce-wholesale-order-form' ),\r\n 'id' => 'wwof_general_list_product_variation_individually',\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Show Wholesale Order Requirements Message in Order Form' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Only works if there are Order Requirements set in WooCommerce Wholesale Prices Premium plugin settings.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_display_wholesale_price_requirement',\r\n 'class' => 'chosen_select',\r\n 'options' => array (\r\n 'yes' => __( 'Yes' , 'woocommerce-wholesale-order-form' ),\r\n 'no' => __( 'No' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'default' => 'yes'\r\n ),\r\n \r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_general_sectionend'\r\n )\r\n\r\n );\r\n\r\n }", "function custom_settings_page() { ?>\r\n<div class=\"wrap\">\r\n<h1>Custom Settings</h1>\r\n<form method=\"post\" action=\"options.php\">\r\n<?php settings_fields( 'section' );\r\ndo_settings_sections( 'theme-options' );\r\nsubmit_button(); ?>\r\n</form>\r\n</div>\r\n<?php }", "function get_settings()\n\t{\n\t\t$this->settings = array();\n\t\t\n\t\treturn true;\n\t}", "function register_mysettings()\n{\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_shop_id' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_api_key' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_api_secret' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_product_detail_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_product_list_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_designer_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_article_list_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_article_detail_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_items_per_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_language' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_locale' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_domain' );\n}", "function app_settings()\n\t{\n\t\t\t\t\n\t$this->data['message'] \t= ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'));\n\t\tif ($this->input->post()) \n\t\t{\n\t\t\t$this->check_isdemo(URL_SITE_SETTINGS);\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'site_title', \n\t\t\t$this->phrases['site title'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'sitename', \n\t\t\t$this->phrases['site name'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'address', \n\t\t\t$this->phrases['address'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'city', \n\t\t\t$this->phrases['city'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'state', \n\t\t\t$this->phrases['state'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'country', \n\t\t\t$this->phrases['country'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'latitude', \n\t\t\t$this->phrases['latitude'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'longitude', \n\t\t\t$this->phrases['longitude'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'zip', \n\t\t\t$this->phrases['zip code'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'phone', \n\t\t\t$this->phrases['phone'], \n\t\t\t'required|min_length[10])|max_length[11]');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'portal_email', \n\t\t\t$this->phrases['contact email'], \n\t\t\t'required|valid_email');\n\t\t\t\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'language_id', \n\t\t\t$this->phrases['select language'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'design_by', \n\t\t\t$this->phrases['design by'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'rights_reserved_content', \n\t\t\t$this->phrases['rights reserved'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'ios_url', \n\t\t\t$this->phrases['ios url'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'android_url', \n\t\t\t$this->phrases['android url'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'from_time', \n\t\t\t$this->phrases['from time'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'to_time', \n\t\t\t$this->phrases['to time'], \n\t\t\t'required');\n\t\t\t\n\t\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t\t\n\t\t\tif (!empty($_FILES['userfile']['name'])) {\n\t\t\t\t$ext = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);\n\t\t\t\t\n\t\t\t\tif (($ext != \"gif\") && ($ext != \"jpg\") && ($ext != \"png\") && ($ext != \"jpeg\")) {\n\t\t\t\t\t$msg = (isset($this->phrases['invalid file'])) ? $this->phrases['invalid file'] : \"Invalid File\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 1);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->form_validation->run() \t== TRUE\t) {\n\t\t\t\t\n\t\t\t\t$inputdata['site_title'] \t\t= $this->input->post('site_title');\n\t\t\t\t$inputdata['site_name'] \t\t= $this->input->post('sitename');\n\t\t\t\t$inputdata['address'] \t\t\t= $this->input->post('address');\n\t\t\t\t$inputdata['city'] \t\t\t\t= $this->input->post('city');\n\t\t\t\t$inputdata['state'] \t\t\t= $this->input->post('state');\n\t\t\t\t$inputdata['country'] \t\t\t= $this->input->post('country');\n\t\t\t\t$inputdata['longitude'] \t\t= $this->input->post('longitude');\n\t\t\t\t$inputdata['latitude'] \t\t\t= $this->input->post('latitude');\n\t\t\t\t$inputdata['zip'] \t\t\t\t= $this->input->post('zip');\n\t\t\t\t$inputdata['phone'] \t\t\t= $this->input->post('phone');\n\t\t\t\t$inputdata['from_time'] \t\t= $this->input->post('from_time');\n\t\t\t\t$inputdata['to_time'] \t\t\t= $this->input->post('to_time');\n\t\t\t\t$inputdata['land_line'] \t\t= $this->input->post('land_line');\n\t\t\t\t$inputdata['fax'] \t\t\t\t= $this->input->post('fax');\n\t\t\t\t$inputdata['portal_email'] \t\t= $this->input->post('portal_email');\n\t\t\t\t$inputdata['language_id'] \t\t= $this->input->post('language_id');\n\t\t\t\t$inputdata['currency'] \t\t\t= $this->input->post('currency');\n\t\t\t\t$inputdata['currency_symbol'] \t= $this->input->post('currency_symbol');\n\t\t\t\t$inputdata['country_code'] \t\t= $this->input->post('country_code');\n\t\t\t\t$inputdata['ios_url'] \t\t\t= $this->input->post('ios_url');\n\t\t\t\t$inputdata['android_url'] \t\t= $this->input->post('android_url');\n\t\t\t\t$inputdata['design_by'] \t\t= $this->input->post('design_by');\n\t\t\t\t$inputdata['rights_reserved_content'] = $this->input->post(\n\t\t\t\t'rights_reserved_content');\n\t\t\t\t\t\t\t\n\t\t\t\t$inputdata['facebook_api'] \t\t= $this->input->post('facebook_api');\n\t\t\t\t$inputdata['google_api'] \t\t= $this->input->post('google_api');\n\t\t\t\t\n\t\t\t\t$sms_notifications = 'No';\n\t\t\t\tif($this->input->post('sms_notifications')=='on'){\n\t\t\t\t\t$sms_notifications = 'Yes';\t\n\t\t\t\t}\n\t\t\t\t$inputdata['sms_notifications'] \t\t= $sms_notifications;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$push_notifications = 'No';\n\t\t\t\tif($this->input->post('fcm_push_notifications')=='on'){\n\t\t\t\t\t$push_notifications = 'Yes';\t\n\t\t\t\t}\n\t\t\t\t$inputdata['fcm_push_notifications'] \t\t= $push_notifications;\n\t\t\t\t\n\t\t\t\t$where['id'] \t\t\t\t\t= $this->input->post('update_record_id');\n\t\t\t\t\n\t\t\t\tif ($this->base_model->update_operation(\n\t\t\t\t$inputdata, TBL_SITE_SETTINGS, $where)) \n\t\t\t\t{\n\t\t\t\t\tif (!empty($_FILES['userfile']['name'])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$config['upload_path'] \t = IMG_SITE_LOGO;\n\t\t\t\t\t\t$config['allowed_types'] = ALLOWED_TYPES;\n\t\t\t\t\t\t$config['overwrite'] = TRUE;\n\t\t\t\t\t\t$config['file_name'] \t = 'site_logo.'. $ext;\n\t\t\t\t\t\t$this->load->library('upload', $config);\n\t\t\t\t\t\t$this->upload->initialize($config);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!$this->upload->do_upload()) {\n\t\t\t\t\t\t\t$this->prepare_flashmessage(\n\t\t\t\t\t\t\t$this->upload->display_errors() , 1);\n\t\t\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$input1['site_logo']= 'site_logo.'. $ext;\n\t\t\t\t\t\t\t$this->base_model->update_operation(\n\t\t\t\t\t\t\t$input1, TBL_SITE_SETTINGS, $where);\n\t\t\t\t\t\t\t$msg = (isset($this->phrases['updated successfully'])) ? $this->phrases['updated successfully'] : \"Updated Successfully\";\n\t\t\t\t\t\t\t$this->prepare_flashmessage($msg, 0);\n\t\t\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg = (isset($this->phrases['updated successfully'])) ? $this->phrases['updated successfully'] : \"Updated Successfully\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 0);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$msg = (isset($this->phrases['unable to update'])) ? $this->phrases['unable to update'] : \"Unable to update\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 1);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->prepare_flashmessage(validation_errors(),1);\n\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$site_settings \t= $this->base_model->fetch_records_from(TBL_SITE_SETTINGS);\n\t\tif (count($site_settings) > 0) \n\t\t\t$this->data['site_settings'] \t\t= $site_settings[0];\n\t\telse \n\t\t\t$this->data['site_settings'] \t\t= array();\n\t\t\n\t\t// LANGUAGE OPTIONS\n\t\t$lang_options \t\t\t\t\t\t\t= array('' => $this->phrases['select language']);\n\t\t$languages \t\t\t\t\t\t\t\t= $this->base_model->fetch_records_from(TBL_LANGUAGES,array('status'=>'Active'));\n\t\tforeach($languages as $row):\n\t\t\t$lang_options[$row->id] \t\t\t= ucfirst($row->lang_name);\n\t\tendforeach;\n\t\t\n\t\t// CURRENCY OPTIONS\n\t\t\n\t\t$currency_options = array(''=>$this->phrases['select currency']);\n\t\t\n\t\t$currencies = $this->base_model->fetch_records_from(TBL_CURRENCY);\n\t\tforeach($currencies as $row):\n\t\t\t$currency_options[$row->currency_code_alpha] = ucfirst($row->currency_name);\n\t\tendforeach;\n\t\t\n\t\t//echo \"<pre>\";\n\t\t//print_r($this->data['site_settings']); die();\n\t\t$this->data['lang_options'] \t\t\t= $lang_options;\n\t\t$this->data['currency_options'] \t\t= $currency_options;\n\t\t$this->data['active_class'] \t\t\t= ACTIVE_MASTER_SETTINGS;\n\t\t$this->data['title'] \t\t\t\t\t= (isset($this->phrases['app settings'])) ? $this->phrases['app settings'] : \"App Settings\";\n\t\t$this->data['content'] \t\t\t\t\t= 'site_settings';\n\t\t$this->_render_page(TEMPLATE_ADMIN, $this->data);\n\t}", "function settingsInit()\n\t{\n\t\t//Configuration variables: api_key, api_secret, callback_url\n\n\t\tadd_settings_section(\n\t\t\t\t'cvmaker_linkedin_settings', // ID\n\t\t\t\t'LinkedIn Integration Settings', // Title\n\t\t\t\tarray( $this, 'printHeaders' ), // Callback\n\t\t\t\t'cvmaker-admin' // Page\n\t\t\t\t);\n\t\t\n\t\tadd_settings_field(\n\t\t\t\t'li_api_key', // ID\n\t\t\t\t'Client ID', // Title\n\t\t\t\tarray( $this, 'printOption' ), // Callback\n\t\t\t\t'cvmaker-admin', // Page\n\t\t\t\t'cvmaker_linkedin_settings', // Section\n\t\t\t\tarray (\n\t\t\t\t\t\t'label_for' => 'li_api_key',\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t)\n\t\t\t\t);\n\t\t\n\t\tadd_settings_field(\n\t\t\t\t'li_api_secret',\n\t\t\t\t'Client Secret',\n\t\t\t\tarray( $this, 'printOption' ),\n\t\t\t\t'cvmaker-admin',\n\t\t\t\t'cvmaker_linkedin_settings',\n\t\t\t\tarray (\n\t\t\t\t\t\t'label_for' => 'li_api_secret',\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t)\n\t\t\t\t);\n\t\tadd_settings_field(\n\t\t\t\t'li_callback_url',\n\t\t\t\t'Callback URL',\n\t\t\t\tarray( $this, 'printOption' ),\n\t\t\t\t'cvmaker-admin',\n\t\t\t\t'cvmaker_linkedin_settings',\n\t\t\t\tarray (\n\t\t\t\t\t\t'label_for' => 'li_callback_url',\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t)\n\t\t\t\t);\n\t\tregister_setting(\n\t\t\t\t'cvmaker-admin', // Option group\n\t\t\t\t'li_api_key' // Option name\n\t\t\t\t);\n\t\tregister_setting(\n\t\t\t\t'cvmaker-admin', // Option group\n\t\t\t\t'li_api_secret' // Option name\n\t\t\t\t);\n\t\tregister_setting(\n\t\t\t\t'cvmaker-admin', // Option group\n\t\t\t\t'li_callback_url' // Option name\n\t\t\t\t);\n\t}", "public function page_init() { \n\n\t\t\tif (!get_option('dls_settings_site_id')) {\n\t\t\t\tadd_option('dls_settings_site_id');\n\t\t\t}\n\n\t\t\tif (!get_option('dls_settings_enabled_post_types')) {\n\t\t\t\tadd_option('dls_settings_enabled_post_types');\n\t\t\t}\n\n\t\t\tif (!get_option('dls_settings_replace_host_list')) {\n\t\t\t\tadd_option('dls_settings_replace_host_list');\n }\n\n\t\t\tif (!get_option('dls_settings_auto_redirect_to_admin_page')) {\n\t\t\t\tadd_option('dls_settings_auto_redirect_to_admin_page');\n }\n\n\t\t\tif (!get_option('dls_overwrite_viewable_permalink')) {\n\t\t\t\tadd_option('dls_overwrite_viewable_permalink');\n }\n\n \t\t\tif (!get_option('dls_overwrite_viewable_permalink_host')) {\n\t\t\t\tadd_option('dls_overwrite_viewable_permalink_host');\n\t\t\t}\n \n register_setting( 'my_option_group', 'dls_settings_site_id', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_enabled_post_types', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_replace_host_list', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_settings_auto_redirect_to_admin_page', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_overwrite_viewable_permalink', array( $this, 'sanitize' ) );\n register_setting( 'my_option_group', 'dls_overwrite_viewable_permalink_host', array( $this, 'sanitize' ) );\n\n add_settings_section( 'settings_site_id', 'Site ID', array( $this, 'print_site_id' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Set the site id for this site', array( $this, 'site_id_callback'), 'my-setting-admin', 'settings_site_id' ); \n\n add_settings_section( 'setting_section_id', 'Post types settings', array( $this, 'print_post_types_info' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Select post types', array( $this, 'post_type_callback'), 'my-setting-admin', 'setting_section_id' ); \n\n add_settings_section( 'settings_replace_hosts', 'Hosts to replace', array( $this, 'print_replace_hosts_info' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'List of hosts', array( $this, 'replace_hosts_callback'), 'my-setting-admin', 'settings_replace_hosts' ); \n\n add_settings_section( 'settings_auto_redirect_to_admin', 'Auto redirect to admin page', array( $this, 'print_auto_redirect_to_admin' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Auto redirect to admin page', array( $this, 'auto_redirect_to_admin_callback'), 'my-setting-admin', 'settings_auto_redirect_to_admin' ); \n\n add_settings_section( 'settings_overwrite_viewable_permalink', 'Overwrite the viewable permalink', array( $this, 'print_overwrite_viewable_permalink' ), 'my-setting-admin' ); \n\t\t\tadd_settings_field( 'dls-settings', 'Overwrite the viewable permalink', array( $this, 'overwrite_viewable_permalink_callback'), 'my-setting-admin', 'settings_overwrite_viewable_permalink' ); \n\t\t\tadd_settings_field( 'dls-settings-overwrite_viewable_permalink_host', 'Overwrite the viewable permalink host', array( $this, 'overwrite_viewable_permalink_host_callback'), 'my-setting-admin', 'settings_overwrite_viewable_permalink' ); \n\n\t\t}", "function ul_cadi_settings(){\r\n\r\n}", "private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }", "function faculty_settings_global() {\n faculty_setting_line(sprintf(__('Start by customizing your <a href=\"%s\">background</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-background')));\n faculty_setting_line(faculty_add_color_setting('body_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('body_font_family', __('Font', FACULTY_DOMAIN), 'family'));\n faculty_setting_line(faculty_add_size_setting('body_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('body_line_height', __('Line Height', FACULTY_DOMAIN)));\n do_action('faculty_settings_global');\n faculty_setting_line(faculty_add_note(__('All fonts listed are considered web-safe', FACULTY_DOMAIN)));\n}", "abstract protected function getSetting() ;", "function buddyexpressdesk_settings(){\n $settings = new stdClass;\n\t$GET = new BDESK_DB;\n $GET->statement('SELECT * FROM bdesk_site LIMIT 1');\n $GET->execute();\n\t$defaults = $GET->fetch();\n\tforeach ($defaults as $name => $value) {\n\t\tif (empty($paths->$name)) {\n\t\t\t$settings->$name = $value;\n\t\t}\n\t}\n\treturn $settings;\n}", "function custom_settings_page() { ?>\n <div class=\"wrap\">\n <h1>Custom Settings</h1>\n <form method=\"post\" action=\"options.php\">\n <?php\n settings_fields( 'section' );\n do_settings_sections( 'theme-options' ); \n submit_button(); \n ?> \n </form>\n </div>\n<?php }", "static public function get_settings() {\n\n\t\t$settings[] = array();\n\n\t\t$settings = array(\n\t\t\t'default_tab' => array(\n\t\t\t\t'default_tab_settings' => array(\n\t\t\t\t\t'name' => '<strong>' . __( 'Header', self::$plugin_name ) . '</strong>',\n\t\t\t\t\t'type' => 'header'\n\t\t\t\t),\n\t\t\t\t'missing_callback' => array(\n\t\t\t\t\t'name' => '<strong>' . __( 'Missing Callback', self::$plugin_name ) . '</strong>',\n\t\t\t\t\t'type' => 'non-exisit'\n\t\t\t\t),\n\t\t\t\t'checkbox' => array(\n\t\t\t\t\t'name' => __( 'Checkbox', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Checkbox', self::$plugin_name ),\n\t\t\t\t\t'type' => 'checkbox'\n\t\t\t\t),\n\t\t\t\t'multicheck' => array(\n\t\t\t\t\t'name' => __( 'Multicheck', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Multicheck with 3 options', self::$plugin_name ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'wp-human' => __( \"I read the <a href='https://wphuman.com/blog/'>WP Human Blog</a>\", self::$plugin_name ),\n\t\t\t\t\t\t'tang-rufus' => __( \"<a href='http://tangrufus.com/'>Tang Rufus' Blog</a> looks great\", self::$plugin_name ),\n\t\t\t\t\t\t'Filter' => __( 'You can apply filters on this option!', self::$plugin_name )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'multicheck'\n\t\t\t\t),\n\t\t\t\t'multicheck_without_options' => array(\n\t\t\t\t\t'name' => __( 'Multicheck', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Multicheck without options', self::$plugin_name ),\n\t\t\t\t\t'type' => 'multicheck'\n\t\t\t\t),\n\t\t\t\t'radio' => array(\n\t\t\t\t\t'name' => __( 'Radio', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Radio with 3 options', self::$plugin_name ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'wp-human' => __( \"I read the <a href='https://wphuman.com/blog/'>WP Human Blog</a>\", self::$plugin_name ),\n\t\t\t\t\t\t'tang-rufus' => __( \"<a href='http://tangrufus.com/'>Tang Rufus' Blog</a> looks great\", self::$plugin_name ),\n\t\t\t\t\t\t'Filter' => __( 'You can apply filters on this option!', self::$plugin_name )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'radio'\n\t\t\t\t),\n\t\t\t\t'radio_without_options' => array(\n\t\t\t\t\t'name' => __( 'Radio', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Radio without options', self::$plugin_name ),\n\t\t\t\t\t'type' => 'radio'\n\t\t\t\t),\n\t\t\t\t'text' => array(\n\t\t\t\t\t'name' => __( 'Text', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Text', self::$plugin_name ),\n\t\t\t\t\t'type' => 'text'\n\t\t\t\t),\n\t\t\t\t'text_with_std' => array(\n\t\t\t\t\t'name' => __( 'Text with std', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Text with std', self::$plugin_name ),\n\t\t\t\t\t'std' => __( 'std will be saved!', self::$plugin_name ),\n\t\t\t\t\t'type' => 'text'\n\t\t\t\t),\n\t\t\t\t'email' => array(\n\t\t\t\t\t'name' => __( 'Email', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Email', self::$plugin_name ),\n\t\t\t\t\t'type' => 'email'\n\t\t\t\t),\n\t\t\t\t'url' => array(\n\t\t\t\t\t'name' => __( 'URL', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'By default, only http & https are allowed', self::$plugin_name ),\n\t\t\t\t\t'type' => 'url'\n\t\t\t\t),\n\t\t\t\t'password' => array(\n\t\t\t\t\t'name' => __( 'Password', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Password', self::$plugin_name ),\n\t\t\t\t\t'type' => 'password'\n\t\t\t\t),\n\t\t\t\t'number' => array(\n\t\t\t\t\t'name' => __( 'Number', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Number', self::$plugin_name ),\n\t\t\t\t\t'type' => 'number'\n\t\t\t\t),\n\t\t\t\t'number_with_attributes' => array(\n\t\t\t\t\t'name' => __( 'Number', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Max: 1000, Min: 20, Step: 30', self::$plugin_name ),\n\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t'min' => 20,\n\t\t\t\t\t'step' => 30,\n\t\t\t\t\t'type' => 'number'\n\t\t\t\t),\n\t\t\t\t'textarea' => array(\n\t\t\t\t\t'name' => __( 'Textarea', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Textarea', self::$plugin_name ),\n\t\t\t\t\t'type' => 'textarea'\n\t\t\t\t),\n\t\t\t\t'textarea_with_std' => array(\n\t\t\t\t\t'name' => __( 'Textarea with std', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Textarea with std', self::$plugin_name ),\n\t\t\t\t\t'std' => __( 'std will be saved!', self::$plugin_name ),\n\t\t\t\t\t'type' => 'textarea'\n\t\t\t\t),\n\t\t\t\t'select' => array(\n\t\t\t\t\t'name' => __( 'Select', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Select with 3 options', self::$plugin_name ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'wp-human' => __( \"I read the <a href='https://wphuman.com/blog/'>WP Human Blog</a>\", self::$plugin_name ),\n\t\t\t\t\t\t'tang-rufus' => __( \"<a href='http://tangrufus.com/'>Tang Rufus' Blog</a> looks great\", self::$plugin_name ),\n\t\t\t\t\t\t'Filter' => __( 'You can apply filters on this option!', self::$plugin_name )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'select'\n\t\t\t\t),\n\t\t\t\t'rich_editor' => array(\n\t\t\t\t\t'name' => __( 'Rich Editor', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Rich Editor save as HTML markups', self::$plugin_name ),\n\t\t\t\t\t'type' => 'rich_editor'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'second_tab' => array(\n\t\t\t\t'extend_me' => array(\n\t\t\t\t\t'name' => 'Extend me',\n\t\t\t\t\t'desc' => __( 'You can extend me via hooks and filters.', self::$plugin_name ),\n\t\t\t\t\t'type' => 'text'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\treturn self::apply_tab_slug_filters( $settings );\n\t}", "protected function loadSettings() {}", "protected function loadSettings() {}", "protected function loadSettings() {}", "private function settings_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Global Settings', 'formidable' ) . '</h3>'\n\t\t\t\t. '<p><strong>' . __( 'General', 'formidable' ) . '</strong><br/>'\n\t\t\t\t. __( 'Turn stylesheets and scripts off, set which user roles have access to change and create forms, setup your reCaptcha, and set default messages for new forms and fields.', 'formidable' )\n\t\t\t\t. '<p><strong>' . __( 'Plugin Licenses', 'formidable' ) . '</strong><br/>'\n\t\t\t\t. sprintf( __( 'Once you&#8217;ve purchased %1$s or any addons, you&#8217;ll have to enter a license key to get access to all of their powerful features. A Plugin Licenses tab will appear here for you to enter your license key.', 'formidable' ), 'Formidable Pro' )\n \t . '</p>',\n\t\t\t'prev_page' => 'import',\n\t\t\t'next_page' => 'addons',\n\t\t);\n\t}", "public function initGeneralPageSettingsForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\t\t\n\t\t$aset = new ilSetting(\"adve\");\n\n\t\t// use physical character styles\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_use_physical\"), \"use_physical\");\n\t\t$cb->setInfo($this->lng->txt(\"adve_use_physical_info\"));\n\t\t$cb->setChecked($aset->get(\"use_physical\"));\n\t\t$form->addItem($cb);\n\n\t\t// blocking mode\n\t\t$cb = new ilCheckboxInputGUI($this->lng->txt(\"adve_blocking_mode\"), \"block_mode_act\");\n\t\t$cb->setChecked($aset->get(\"block_mode_minutes\") > 0);\n\t\t$form->addItem($cb);\n\n\t\t\t// number of minutes\n\t\t\t$ni = new ilNumberInputGUI($this->lng->txt(\"adve_minutes\"), \"block_mode_minutes\");\n\t\t\t$ni->setMinValue(2);\n\t\t\t$ni->setMaxLength(5);\n\t\t\t$ni->setSize(5);\n\t\t\t$ni->setRequired(true);\n\t\t\t$ni->setInfo($this->lng->txt(\"adve_minutes_info\"));\n\t\t\t$ni->setValue($aset->get(\"block_mode_minutes\"));\n\t\t\t$cb->addSubItem($ni);\n\t\t\n\t\t$form->addCommandButton(\"saveGeneralPageSettings\", $lng->txt(\"save\"));\n\t \n\t\t$form->setTitle($lng->txt(\"adve_pe_general\"));\n\t\t$form->setFormAction($ilCtrl->getFormAction($this));\n\t \n\t\treturn $form;\n\t}", "function display_global_settings()\n {\n $settings = array_merge($this->settings, $_POST);\n \n $site_url = rtrim($this->EE->config->item('site_url'), '/');\n $third_party_path_array = explode('/', trim(PATH_THIRD, '/'));\n $uri_segments_array = array();\n $uri_segments_array = array_slice($third_party_path_array, -3);\n //print_r($uri_segments_array);\n $third_party_uri = implode('/', $uri_segments_array);\n // Styles\n $this->EE->cp->add_to_head('<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$site_url.'/'.$third_party_uri.'/page_type_switcher/styles/display_global_settings.css\" />');\n \n $this->EE->lang->loadfile('page_type_switcher');\n \n //print_r($this->settings);\n \n // Get custom field info \n $query_field_info = $this->_get_field_info();\n $query_field_info_num_rows = $query_field_info->num_rows();\n //echo '$query_field_info_num_rows: ['.$query_field_info_num_rows.']<br><br>'.PHP_EOL;\n $query_field_info_result = $query_field_info->result_array();\n //print_r($query_field_info_result);\n \n // Find page type switcher's ftype_id\n $sql_ftype_id = \"SELECT fieldtype_id \n FROM exp_fieldtypes \n WHERE name = 'page_type_switcher'\n LIMIT 1\";\n $query_ftype_id = $this->EE->db->query($sql_ftype_id);\n if ($query_ftype_id->num_rows() == 1)\n {\n $ftype_id = $query_ftype_id->row('fieldtype_id');\n //echo '$ftype_id: ['.$ftype_id.']<br><br>'.PHP_EOL;\n }\n \n // Create fieldtype's site settings form\n $r = '';\n $r .= '<table class=\"mainTable padTable\" cellspacing=\"0\" cellpaddind=\"0\" border=\"0\">'.PHP_EOL;\n $r .= '<tr>'.PHP_EOL;\n $r .= '<td width=\"30%\">'.PHP_EOL;\n $r .= $this->EE->lang->line('page_types_max_num');\n $r .= '</td>'.PHP_EOL;\n $r .= '<td>'.PHP_EOL;\n $r .= '<input type=\"text\" name=\"page_types_max_num\" value=\"'.$this->settings['page_types_max_num'].'\" style=\"width: 90%;\" />';\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n \n if ($query_field_info_num_rows == 0)\n {\n $r .= '<script type=\"text/javascript\">alert(\"'.$this->EE->lang->line('no_page_type_switchers_in_field_groups_allert').'\");</script>'.PHP_EOL;\n }\n\n for ($i = 0; $i < $query_field_info_num_rows; $i++)\n {\n if ($i == 0 OR $query_field_info_result[$i]['group_id'] != $query_field_info_result[$i - 1]['group_id'])\n {\n $r .= '<tr class=\"header\">'.PHP_EOL;\n $r .= '<th colspan=\"2\">';\n $r .= $query_field_info_result[$i]['group_name'];\n $r .= '</th>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n \n for ($j = 1; $j <= $this->settings['page_types_max_num']; $j++)\n {\n $r .= '<tr>'.PHP_EOL;\n $r .= '<td width=\"30%\">'.PHP_EOL;\n $r .= str_replace('{number}', $j, $this->EE->lang->line('page_type_number_name'));\n $r .= '</td>'.PHP_EOL;\n $r .= '<td>'.PHP_EOL;\n $value = '';\n if (isset($this->settings['field_group'][$query_field_info_result[$i]['group_id']]['page_type_'.$j.'_name']))\n {\n $value = $this->settings['field_group'][$query_field_info_result[$i]['group_id']]['page_type_'.$j.'_name'];\n }\n $r .= '<input type=\"text\" name=\"'.'field_group['.$query_field_info_result[$i]['group_id'].'][page_type_'.$j.'_name]'.'\" value=\"'.$value.'\" style=\"width: 90%;\">'; \n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n }\n \n // Display all fields except page type switcher\n if ($query_field_info_result[$i]['field_type'] != 'page_type_switcher')\n {\n $r .= '<tr>'.PHP_EOL;\n $r .= '<td width=\"30%\">'.PHP_EOL;\n $r .= $query_field_info_result[$i]['field_label'];\n $r .= '</td>'.PHP_EOL;\n $r .= '<td style=\"white-space: pre\">'.PHP_EOL;\n for ($j = 1; $j <= $this->settings['page_types_max_num']; $j++)\n {\n $checked = '';\n if (isset($this->settings['page_types_field_id'][$query_field_info_result[$i]['field_id']]['page_type_'.$j]) AND $this->settings['page_types_field_id'][$query_field_info_result[$i]['field_id']]['page_type_'.$j] == 'y')\n {\n $checked = 'checked=\"checked\"';\n }\n $r .= str_replace('{number}', $j, $this->EE->lang->line('page_type_number_checkbox')).NBS.NBS.'<input type=\"checkbox\" name=\"'.'page_types_field_id['.$query_field_info_result[$i]['field_id'].'][page_type_'.$j.']'.'\" value=\"y\" '.$checked.'>'.NBS.NBS.NBS.NBS;\n \n }\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n }\n $r .= '</table>'.PHP_EOL;\n\n return $r;\n \n }", "function wpec_gd_settings_init(){\n\n register_setting( 'social_settings', 'social_settings', 'wpec_validate_options' );\n add_settings_section( 'facebook_section', 'Social Media Configuration', 'social_media_section_text', 'wpec_gd_options' );\n add_settings_field( 'facebook_api_key', 'Facebook Application API ID:', 'facebook_api_id', 'wpec_gd_options', 'facebook_section' );\n add_settings_field( 'facebook_app_secret', 'Faceook Application Secret:', 'facebook_app_secret', 'wpec_gd_options', 'facebook_section' );\n\n\t\n //Register Settings for each email. Arrays of Subject and Body\n register_setting( 'wpec_gd_main_options', 'wpec_gd_options_array', 'wpec_validate_options' );\n register_setting( 'wpec_gd_emails', 'site_owner_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'site_owner_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'site_owner_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'business_owner_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_tipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_untipped', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_expired', 'wpec_validate_emails' );\n register_setting( 'wpec_gd_emails', 'deal_purchaser_new_deal', 'wpec_validate_emails' );\n\n add_settings_section( 'main_section', __( 'Main Settings', 'wpec-group-deals' ), 'wpec_options_intro_text', 'wpec_gd_options' );\n add_settings_section( 'email_templates', __( 'Email Templates', 'wpec-group-deals' ), 'wpec_options_email_intro_text', 'wpec_gd_options' );\n \n add_settings_field( 'gd_api_id', __( 'Group Deals API ID', 'wpec-group-deals' ), 'gd_api_id', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_referral_credit', __( 'Referral Credit', 'wpec-group-deals' ), 'gd_referral_credit', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_logo_upload', __( 'Logo Upload', 'wpec-group-deals' ), 'gd_logo_upload', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_width', __( 'Group Deal Image Width', 'wpec-group-deals' ), 'wpec_options_img_width', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_height', __( 'Group Deal Image Height', 'wpec-group-deals' ), 'wpec_options_img_height', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_dd_home_image_crop', __( 'Crop Images?', 'wpec-group-deals' ), 'wpec_options_crop_img', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_paypal_email', __( 'Paypal Email:', 'wpec-group-deals' ), 'wpec_paypal_email', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_default_location', __( 'Default Location:', 'wpec-group-deals' ), 'wpec_default_location', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_default_page', __( 'What page should be used for the Group Deals landing page? NOTE: If you do not have multiple locations to choose from, the popup will not show. Going to the home page will show the featured deal you have created. :', 'wpec-group-deals' ), 'wpec_default_page', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_location_threshold', __( 'When determining a user\\'s location, how wide of a radius should the GeoIP system allow for nearby locations?', 'wpec-group-deals' ), 'wpec_location_threshold', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'gd_mobile_theme', __( 'Mobile Theme?', 'wpec-group-deals' ), 'gd_mobile_theme', 'wpec_gd_options', 'main_section' );\n add_settings_field( 'wpec_site_owner_tipped_subject', __( 'Site Owner - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_tipped_body', __( 'Site Owner - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_site_owner_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_untipped_subject', __( 'Site Owner - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_untipped_body', __( 'Site Owner - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_site_owner_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_expired_subject', __( 'Site Owner - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_site_owner_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_site_owner_expired_body', __( 'Site Owner - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_site_owner_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_tipped_subject', __( 'Business Owner - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_tipped_body', __( 'Business Owner - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_business_owner_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_untipped_subject', __( 'Business Owner - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_untipped_body', __( 'Business Owner - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_business_owner_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_expired_subject', __( 'Business Owner - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_business_owner_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_business_owner_expired_body', __( 'Business Owner - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_business_owner_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_tipped_subject', __( 'Deal Purchaser - Deal Tipped {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_tipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_tipped_body', __( 'Deal Purchaser - Deal Tipped {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_tipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_untipped_subject', __( 'Deal Purchaser - Deal Untipped {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_untipped_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_untipped_body', __( 'Deal Purchaser - Deal Untipped {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_untipped_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_expired_subject', __( 'Deal Purchaser - Deal Expired {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_expired_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_expired_body', __( 'Deal Purchaser - Deal Expired {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_expired_body', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_new_deal_subject', __( 'Deal Purchaser - New Deal {Subject}', 'wpec-group-deals' ), 'wpec_deal_purchaser_new_deal_subject', 'wpec_gd_options', 'email_templates' );\n add_settings_field( 'wpec_deal_purchaser_new_deal_body', __( 'Deal Purchaser - New Deal {Body}', 'wpec-group-deals' ), 'wpec_deal_purchaser_new_deal_body', 'wpec_gd_options', 'email_templates' );\n \n }", "public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }", "function wp_settings_update_func($settings) {\r\n\r\n switch ( $settings['key'] ) {\r\n\r\n case 'general':\r\n update_option( 'wpc_graphic', $settings['graphic'] );\r\n update_option( 'wpc_create_client', $settings['create_client'] );\r\n\r\n $current_settings = get_option( 'wpc_settings' );\r\n if ( !is_array( $current_settings ) )\r\n $current_settings = array();\r\n\r\n $settings['wpc_settings'] = array_merge( $current_settings, $settings['wpc_settings'] );\r\n //update settings value\r\n update_option( 'wpc_settings', $settings['wpc_settings'] );\r\n\r\n break;\r\n\r\n case 'business_info':\r\n $current_settings = get_option( 'wpc_business_info' );\r\n if ( !is_array( $current_settings ) )\r\n $current_settings = array();\r\n\r\n $settings['wpc_business_info'] = array_merge( $current_settings, $settings['wpc_business_info'] );\r\n //update settings value\r\n update_option( 'wpc_business_info', $settings['wpc_business_info'] );\r\n\r\n break;\r\n\r\n case 'skins':\r\n if ( $settings['theme'] )\r\n update_option( 'wpclients_theme', $settings['theme'] );\r\n break;\r\n\r\n case 'login_alerts':\r\n //login alerts notifications\r\n if ( isset( $settings['login_alerts'] ) ) {\r\n if( !isset( $settings['login_alerts']['successful'] ) && '1' != $settings['login_alerts']['successful'] )\r\n $settings['login_alerts']['successful'] = 0;\r\n if( !isset( $settings['login_alerts']['failed'] ) && '1' != $settings['login_alerts']['failed'] )\r\n $settings['login_alerts']['failed'] = 0;\r\n\r\n update_option( 'wpc_login_alerts', $settings['login_alerts'] );\r\n }\r\n break;\r\n }\r\n }", "function rst_settings()\n{\n require_once('inc/inc.rst-settings.php');\n}", "function sa_register_settings() {\n\t// Register settings and call sanitation functions\n\tregister_setting( 'tsc_theme_options', 'sa_options', 'sa_validate_options' );\n}", "private\n\t\tstatic function get_settings_url() {\n\t\t\treturn admin_url( 'options-general.php?page=' . self::LINKID_SETTINGS_PAGE_ID );\n\t\t}", "function wassupoptions() {\n\t\t//# initialize class variables with current options \n\t\t//# or with defaults if none\n\t\t$this->loadSettings();\n\t}", "function do_main()\n{\n\n global $message,$valid,$htmladmin,$scripts_onload,$main_heading, $incdir;\n\n $action = $_REQUEST['action'];\n\n $main_heading = 'General Settings';\n\n switch ($action) {\n\n case 'save':\n\n $return = save_item();\n break;\n\n }\n \n if ($message != \"\") {\n\n $page_contents .= <<< HTML\n <div class=\"alert alert-warning page\">\n <i class=\"glyphicon glyphicon-info-sign\"></i>\n <strong>$message</strong>\n </div>\nHTML;\n \n\n }\n\n $sql = \"SELECT `id`, `company_name`, `start_year`, `email_address`, `phone_number`,\n `address`, `js_code_head_close`, `js_code_body_open`, `js_code_body_close`, `adwords_code`,\n `slideshow_speed`, `homepage_slideshow_caption`, `mailchimp_api_key`, `mailchimp_list_id`,\n `map_latitude`, `map_longitude`, `map_address`, `map_styles`, `map_heading`, `map_description`,\n `map_zoom_level`, `map_marker_latitude`, `map_marker_longitude`, `tripadvisor_widget_code`, `donation_heading`, `donation_description`,\n `donation_terms`, `emergency_mode`, `emergency_mode_msg`\n FROM `general_settings`\n WHERE `id` = '1'\n LIMIT 1\";\n\n $row = fetch_row($sql);\n\n extract($row);\n\n\n $map_latitude = ( $map_latitude != 0 ) ? $map_latitude : '';\n $map_longitude = ( $map_longitude != 0 ) ? $map_longitude : '';\n $map_zoom_level = ( $map_zoom_level ) ? $map_zoom_level : 8;\n $map_marker_latitude = ( $map_marker_latitude != 0 ) ? $map_marker_latitude : '';\n $map_marker_longitude = ( $map_marker_longitude != 0 ) ? $map_marker_longitude : '';\n\n $emergency_mode_checked = ($emergency_mode == '1') ? 'checked=\"checked\"' : '';\n\n ##------------------------------------------------------------------------------------------------------\n ## Page functions\n\n $page_functions = <<< HTML\n <ul class=\"page-action\">\n <li><button type=\"button\" class=\"btn btn-default\" onclick=\"submitForm('save',1)\"><i class=\"glyphicon glyphicon-floppy-save\"></i> Save</button></li>\n </ul>\nHTML;\n\n// Social Icons\n\n $social_icons = fetch_all(\"SELECT `id`, `label`, `url`, `widget_blob`, `has_widget` FROM `social_links` WHERE `is_active` = '1' ORDER BY `rank`\");\n\n if(count($social_icons) > 0)\n {\n $links = '';\n foreach ($social_icons as $index => $social_icon)\n {\n $index++;\n\n if($social_icon['has_widget'])\n {\n $input = '<textarea style=\"width:700px;height:150px;\" name=\"social-item[]\" >'.$social_icon['widget_blob'].'</textarea>';\n }\n else\n {\n $input = '<input type=\"text\" style=\"width:700px\" name=\"social-item[]\" value=\"'.$social_icon['url'].'\" id=\"social-item-'.$index.'\">';\n }\n $links .= <<< H\n <tr>\n <td width=\"150\" valign=\"top\"><label for=\"social-item-$index\">{$social_icon['label']}</label></td>\n <td>\n <input type=\"hidden\" name=\"social-item-id[]\" value=\"{$social_icon['id']}\">\n <input type=\"hidden\" name=\"social-item-has-wdge[]\" value=\"{$social_icon['has_widget']}\">\n $input\n </td>\n </tr>\nH;\n }\n \n $social_links = <<< H\n \n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n $links\n</table>\n\nH;\n\n}\nelse\n{\n $social_links = '';\n}\n\n\n ##------------------------------------------------------------------------------------------------------\n ## Important Pages\n\n $sql = \"SELECT `imppage_name`, `imppage_id`, `page_id`\n FROM `general_importantpages`\n WHERE `imppage_showincms` = 'Y'\";\n\n $imppages_arr = fetch_all($sql);\n\n $imppages_list = '<table cellspacing=\"0\" cellpadding=\"5\" border=\"0\">';\n foreach($imppages_arr as $key => $array)\n {\n $imppage_name = ucwords($array['imppage_name']);\n $page_id = $array['page_id'];\n $imppage_id = $array['imppage_id'];\n\n $pages_select = page_list(false, 0, $page_id);\n\n $imppages_list .= <<< HTML\n <tr>\n <td>$imppage_name <input type=\"hidden\" name=\"imppage_id[]\" value=\"$imppage_id\"/></td>\n <td>\n <select name=\"page_id[]\">\n <option value=\"\">--select--</option>\n $pages_select\n </select>\n </td>\n </tr>\nHTML;\n }\n $imppages_list .= <<< HTML\n </table>\nHTML;\n\n\n\n \n ##------------------------------------------------------------------------------------------------------\n ## Details Content\n\n $contact_details = fetch_all(\"SELECT * FROM `contact_details`\");\n \n $address_table = '';\n\n foreach ($contact_details as $key => $contact_detail) {\n extract($contact_detail);\n\n $address_table .= <<<H\n <tr>\n <td>\n <label for=\"contact_name\">Name</label>\n <input name=\"contact_name[]\" id=\"contact_name\" type=\"text\" value=\"{$contact_name}\" style=\"width:350px;\" />\n </td>\n <td>\n <label for=\"contact_address\">Address</label>\n <input name=\"contact_address[]\" id=\"contact_address\" type=\"text\" value=\"{$contact_address}\" style=\"width:350px;\" />\n </td> \n <td>\n <label for=\"contact_phone_number\">Phone Number</label>\n <input name=\"contact_phone_number[]\" id=\"contact_phone_number\" type=\"text\" value=\"{$contact_phone_number}\" style=\"width:350px;\" />\n </td> \n <td>\n <label for=\"contact_email\">Email</label>\n <input name=\"contact_email[]\" id=\"contact_email\" type=\"text\" value=\"{$contact_email}\" style=\"width:350px;\" />\n <input name=\"contact_id[]\" type=\"hidden\" value=\"{$id}\" style=\"width:350px;\" />\n </td> \n </tr>\nH;\n\n }\n\n $companydetails_content = <<< HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n <tr>\n <td width=\"150\"><label for=\"company_name\">Company name</label></td>\n <td><input name=\"company_name\" id=\"company_name\" type=\"text\" value=\"{$company_name}\" style=\"width:350px;\" /></td>\n </tr>\n <!--<tr>\n <td width=\"150\"><label for=\"phone_number\">Phone Number</label></td>\n <td>\n <input name=\"phone_number\" type=\"text\" value=\"{$phone_number}\" style=\"width:150px;\" id=\"phone_number\" />\n </td>\n </tr>\n <tr>\n <td width=\"150\"><label for=\"start_year\">Start year</label></td>\n <td><input name=\"start_year\" type=\"text\" value=\"{$start_year}\" style=\"width:150px;\" id=\"start_year\" /></td>\n </tr> \n <tr>\n <td width=\"150\"><label for=\"slideshow_speed\">Slideshow Speed</label></td>\n <td><input name=\"slideshow_speed\" type=\"text\" value=\"{$slideshow_speed}\" style=\"width:150px;\" id=\"slideshow_speed\" /> <strong>&nbsp;seconds</strong></td>\n </tr>\n <tr>\n <td width=\"150\"><label for=\"booking_url\">Booking URL</label></td>\n <td><input name=\"booking_url\" type=\"text\" value=\"{$booking_url}\" style=\"width:350px;\" id=\"booking_url\" /></td>\n </tr>\n <tr>\n <td width=\"150\"><label for=\"homepage_slideshow_caption\">Homepage Slideshow Caption</label></td>\n <td><input name=\"homepage_slideshow_caption\" id=\"homepage_slideshow_caption\" type=\"text\" value=\"{$homepage_slideshow_caption}\" style=\"width:350px;\" /></td>\n </tr>-->\n <tr>\n <td width=\"150\" valign=\"top\"><label for=\"email_address\">Donation Email(s)</label> <span data-title=\"Separate multiple email addresses with a semicolon ( ; )\" data-placement=\"right\" data-toggle=\"tooltip\"></span></td>\n <td><textarea name=\"email_address\" style=\"width:350px;min-height:100px;\">{$email_address}</textarea></td>\n </tr>\n <!--<tr>\n <td width=\"150\" valign=\"top\"><label for=\"address\">Address</label></td>\n <td><textarea name=\"address\" style=\"width:350px;min-height:100px;\">{$address}</textarea></td>\n </tr> -->\n <tr><td colspan=\"2\">&nbsp;</td></tr>\n </table>\n\n <h1>Addresses</h1>\n <hr />\n\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n {$address_table}\n </table>\n\nHTML;\n\n ##------------------------------------------------------------------------------------------------------\n ## Achievements Content\n\n $achievements_query = fetch_all(\"SELECT * FROM `achievements`\");\n\n $achievements_table = '';\n\n foreach ($achievements_query as $key => $achievement) {\n\n extract($achievement);\n\n $achievements_table .= <<<H\n <tr>\n <td>\n <input name=\"achievement_id[]\" type=\"hidden\" value=\"{$id}\" style=\"width:350px;\" />\n <label for=\"achievement_count_details\">Count Details</label>\n <input name=\"achievement_count_details[]\" id=\"achievement_count_details\" type=\"text\" value=\"{$achievement_count_details}\" style=\"width:350px;\" />\n </td>\n <td>\n <label for=\"achievement_description\">Description</label>\n <input name=\"achievement_description[]\" id=\"achievement_description\" type=\"text\" value=\"{$achievement_description}\" style=\"width:350px;\" />\n </td> \n <td>\n <label for=\"achievement_icon_class\">Icon Class</label>\n <input name=\"achievement_icon_class[]\" id=\"achievement_icon_class\" type=\"text\" value=\"{$achievement_icon_class}\" style=\"width:350px;\" /> \n </td> \n \n </tr>\nH;\n }\n \n $achievements = <<< HTML\n \n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n {$achievements_table}\n <tr>\n <td colspan=\"3\">\n <p>Please select icons from <a href=\"http://fontawesome.io/icons/\" target=\"_blank\">FontAwesome</a></small>\n </td>\n </tr>\n </table>\n\nHTML;\n\n\n ##------------------------------------------------------------------------------------------------------\n ## Important pages Content\n $importantpages_content = <<< HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n <tr>\n <td colspan=\"4\">$imppages_list</td>\n </tr>\n </table>\nHTML;\n\n\n\n ##------------------------------------------------------------------------------------------------------\n ## Developer Content\n $developer_content = <<< HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n <tr>\n <td valign=\"top\"><label for=\"js_code_head_close\">Head tag insert (close)</label></td>\n <td valign=\"top\">\n <textarea name=\"js_code_head_close\" style=\"width:720px; height:150px;resize:none;\" id=\"js_code_head_close\">{$js_code_head_close}</textarea>\n <span data-toggle=\"tooltip\" data-placement=\"left\" data-title=\"Insert code before closing head tag e.g Google Analytics, Facebook Pixel\"></span>\n </td>\n </tr>\n <tr>\n <td valign=\"top\"><label for=\"js_code_body_open\">Body tag insert (open)</label></td>\n <td valign=\"top\">\n <textarea name=\"js_code_body_open\" style=\"width:720px; height:150px;resize:none;\" id=\"js_code_body_open\">{$js_code_body_open}</textarea>\n <span data-toggle=\"tooltip\" data-placement=\"left\" data-title=\"Insert code after opening body tag e.g Google Analytics, Facebook Pixel\"></span>\n </td>\n </tr>\n <tr>\n <td valign=\"top\"><label for=\"js_code_body_close\">Body tag insert (close)</label></td>\n <td valign=\"top\">\n <textarea name=\"js_code_body_close\" style=\"width:720px; height:150px;resize:none;\" id=\"js_code_body_close\">{$js_code_body_close}</textarea>\n <span data-toggle=\"tooltip\" data-placement=\"left\" data-title=\"Insert code before closing body tag e.g Google Analytics, Facebook Pixel\"></span>\n </td>\n </tr>\n <tr>\n <td valign=\"top\"><label for=\"adwords_code\">AdWords Tracking Code</label></td>\n <td valign=\"top\">\n <textarea name=\"adwords_code\" style=\"width:720px; height:150px;resize:none;\" id=\"adwords_code\">{$adwords_code}</textarea>\n <span data-toggle=\"tooltip\" data-placement=\"left\" data-title=\"Google AdWords Tracking Code\"></span>\n </td>\n </tr>\n </table>\nHTML;\n\n$widgets_content = <<< HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n <tr>\n <td style=\"vertical-align:top;\">Trip Advisor Widget</td>\n <td colspan=\"3\">\n <textarea name=\"tripadvisor_widget\" style=\"width:790px; height:200px;\">$tripadvisor_widget</textarea>\n </td>\n </tr>\n <tr>\n <td style=\"vertical-align:top;\">Facebook Widget</td>\n <td colspan=\"3\">\n <textarea name=\"facebook_widget\" style=\"width:790px; height:200px;\">$facebook_widget</textarea>\n </td>\n </tr>\n </table>\nHTML;\n\n$mailchimp_details = <<< HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n \n <tr>\n <td width=\"150\"><label for=\"mailchimp_list_id\">List ID</label></td>\n <td><input name=\"mailchimp_list_id\" type=\"text\" value=\"{$mailchimp_list_id}\" style=\"width:150px;\" id=\"mailchimp_list_id\" /></td>\n </tr>\n <tr>\n <td width=\"150\"><label for=\"mailchimp_api_key\">API Key</label></td>\n <td><input name=\"mailchimp_api_key\" type=\"text\" value=\"{$mailchimp_api_key}\" style=\"width:350px;\" id=\"mailchimp_api_key\" /></td>\n </tr>\n </table>\n\nHTML;\n\n$homepage_headings = <<< HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n \n <tr>\n <td width=\"150\"><label for=\"donation_heading\">Module Heading</label></td>\n <td><input name=\"donation_heading\" type=\"text\" value=\"{$donation_heading}\" style=\"width:300px;\" id=\"donation_heading\" /></td>\n </tr>\n <tr>\n <td width=\"150\" valign=\"top\"><label for=\"donation_description\">Short Description</label></td>\n <td><textarea name=\"donation_description\" style=\"width:800px; height: 250px;\" id=\"donation_description\">$donation_description</textarea>\n </td>\n </tr>\n </table>\n\nHTML;\n\n$donation_terms = <<<HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\"> \n <tr>\n <td>\n <textarea name=\"donation_terms\" class=\"check-max\" style=\"width:800px; min-height: 250px;\" id=\"donation_terms\">$donation_terms</textarea>\n <script>\n CKEDITOR.replace( 'donation_terms',\n {\n toolbar : 'MyToolbar',\n forcePasteAsPlainText : true,\n resize_enabled : false,\n height : 600,\n filebrowserBrowseUrl : jsVars.dataManagerUrl\n }); \n </script>\n </td>\n </tr>\n </table>\nHTML;\n\n\n$emergency_mode = <<<HTML\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n <tr>\n <td width=\"250\"><label for=\"emergency_mode\">Put Website into Emergency Mode?</label></td>\n <td><input name=\"emergency_mode\" type=\"checkbox\" $emergency_mode_checked id=\"emergency_mode\" value=\"1\" /></td>\n </tr> \n\n\n\n <tr>\n <td width=\"250\"><label for=\"emergency_mode_msg\">Emergency Mode Message:</label></td>\n <td>\n <textarea name=\"emergency_mode_msg\" class=\"check-max\" style=\"width:800px; min-height: 250px;\" id=\"emergency_mode_msg\">$emergency_mode_msg</textarea>\n <script>\n CKEDITOR.replace( 'emergency_mode_msg',\n {\n toolbar : 'MyToolbar',\n forcePasteAsPlainText : true,\n resize_enabled : false,\n height : 400,\n filebrowserBrowseUrl : jsVars.dataManagerUrl\n }); \n </script>\n </td>\n </tr>\n </table>\nHTML;\n\n$map_contents = <<< H\n\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\">\n <tr>\n <td width=\"100\"><label for=\"map_heading\">Marker Title</label></td>\n <td>\n <input type=\"text\" style=\"width:350px;\" id=\"map_heading\" name=\"map_heading\" value=\"{$map_heading}\">\n </td>\n </tr>\n <tr>\n <td width=\"100\"><label for=\"map_address\">Map Address</label></td>\n <td>\n <input type=\"text\" style=\"width:350px;\" id=\"map_address\" name=\"map_address\" value=\"{$map_address}\">\n <button type=\"button\" id=\"get-map-address\">Search</button>\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n <div id=\"gmap-canvas\">\n <h3 style=\"font-size:18px;color:#000;padding:10px;font-weight:700;margin:0;\">Loading map...</h3>\n </div>\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n <input type=\"hidden\" id=\"map_latitude\" name=\"map_latitude\" value=\"{$map_latitude}\">\n <input type=\"hidden\" id=\"map_longitude\" name=\"map_longitude\" value=\"{$map_longitude}\">\n <input type=\"hidden\" id=\"map_zoom_level\" name=\"map_zoom_level\" value=\"{$map_zoom_level}\">\n <input type=\"hidden\" id=\"map_marker_latitude\" name=\"map_marker_latitude\" value=\"{$map_marker_latitude}\">\n <input type=\"hidden\" id=\"map_marker_longitude\" name=\"map_marker_longitude\" value=\"{$map_marker_longitude}\">\n <textarea name=\"map_styles\" id=\"map_styles\" class=\"hidden\">{$map_styles}</textarea>\n </td>\n </tr>\n</table>\n\nH;\n\n $tripadvisor_widget_html = <<< H\n \n <textarea name=\"tripadvisor_widget_code\" id=\"tripadvisor_widget_code\" style=\"height:300px;width:100%;resize:none;\">{$tripadvisor_widget_code}</textarea>\n\n\nH;\n \n\n $scripts_ext .= '<script src=\"http://maps.google.com/maps/api/js?key=AIzaSyASNvs-56CpZIS0wxatFziPERq9ALArajU\"></script>';\n $scripts_ext .= '<script src=\"'.$htmladmin.'/js/general-map.js\"></script>';\n\n // require_once\n\n ##------------------------------------------------------------------------------------------------------\n ## tab arrays and build tabs\n\n $temp_array_menutab = array();\n \n $temp_array_menutab ['Google Map'] = $map_contents;\n $temp_array_menutab ['Company Details'] = $companydetails_content;\n $temp_array_menutab ['MailChimp Details'] = $mailchimp_details;\n $temp_array_menutab ['Social Links'] = $social_links;\n $temp_array_menutab ['Home Page Headings'] = $homepage_headings;\n $temp_array_menutab ['Donations Terms'] = $donation_terms;\n $temp_array_menutab ['Emergency Mode'] = $emergency_mode;\n $temp_array_menutab ['Achievements'] = $achievements;\n $temp_array_menutab ['TripAdvisor Widget'] = $tripadvisor_widget_html;\n $temp_array_menutab ['Important Pages'] = $importantpages_content;\n $temp_array_menutab ['Template Code'] = $developer_content;\n \n\n $counter = 0;\n $tablist =\"\";\n $contentlist=\"\";\n\n foreach($temp_array_menutab as $key => $value){\n\n $tablist.= \"<li><a href=\\\"#tabs-\".$counter.\"\\\">\".$key.\"</a></li>\";\n\n $contentlist.=\" <div id=\\\"tabs-\".$counter.\"\\\">\".$value.\"</div>\";\n\n $counter++;\n }\n\n $tablist=\"<div id=\\\"tabs\\\"><ul>\".$tablist.\"</ul><div style=\\\"padding:10px;\\\">\".$contentlist.\"</div></div>\";\n\n $page_contents = <<< HTML\n <form action=\"$htmladmin/index.php\" method=\"post\" name=\"pageList\" enctype=\"multipart/form-data\">\n $tablist\n <input type=\"hidden\" name=\"action\" value=\"\" id=\"action\">\n <input type=\"hidden\" name=\"do\" value=\"settings\">\n <input type=\"hidden\" name=\"id\" value=\"$id\">\n <input type=\"hidden\" name=\"set_id\" value=\"$id\">\n </form>\nHTML;\n\n require \"resultPage.php\";\n echo $result_page;\n exit();\n}", "function loadSettings() {\n\tsetupSiteURLs();\n}", "function theme_settings_page() { ?>\n\t <div class=\"wrap\">\n\t <h1>Social Media Settings</h1>\n\t <form method=\"post\" action=\"options.php\">\n\t <?php\n\t settings_fields( 'custom-theme-settings' );\n\t do_settings_sections( 'theme-settings' ); \n\t submit_button(); \n\t ?> \n\t </form>\n\t </div>\n\t<?php }", "public function basic_settings(){\r\n \tif($this->has_admin_panel()){\r\n return $this->module_basic_settings();\r\n }\r\n else{\r\n //access denied\r\n \treturn $this->module_no_permission();\r\n }\r\n }", "public function general_setting($web_name,$web_address,$web_phone1,$web_phone2,$web_email1,$web_email2,$web_start,$web_about)\n\t{\n\t\t$general_setting_insert = \"insert into general_setting(website_name,website_address,website_phone1,website_phone2,website_email1,website_email2,website_start,web_about) value('$web_name','$web_address','$web_phone1','$web_phone2','$web_email1','$web_email2','$web_start','$web_about')\";\n\t\t$general_setting_run = $this->connectdb->query($general_setting_insert);\n\t\treturn $general_setting_run;\n\t}", "private function _globalSettings(){\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n foreach ($_POST as $name => $value) {\r\n $config = HTMLPurifier_Config::createDefault();\r\n $purifier = new HTMLPurifier($config);\r\n $clean_html = $purifier->purify($value);\r\n }\r\n\r\n $settings = new stdClass();\r\n $settings->website_name = isset($_POST['mrzpn-menu-website-name'])?$_POST['mrzpn-menu-website-name']:'';\r\n $settings->global_script = isset($_POST['mrzpn-menu-global-script'])?$_POST['mrzpn-menu-global-script']:'';\r\n\r\n if(file_put_contents(ROOT.DS.'site'.DS.'content'.DS.'global_settings.json', json_encode($settings))){\r\n $response = 200;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "function Eevent_helper($settings='')\n\t{\n \t$this->settings = $this->get_site_settings($settings);\n\t}", "function settings_callback(){\n\trequire_once(COMPILER_PATH.\"templates/settings.php\");\n}", "function do_settings_sections($page)\n {\n }", "function pmp_manage_dist_settings() {\n\tinclude_once dirname(__DIR__) . '/templates/settings.php';\n}", "public function index()\n\t{\n\t\t$this->set_page_title(_l('web_setup'));\n\t\t$data['settings'] = get_settings();\n\t\t$data['content'] = $this->load->view('admin/settings/index', $data, TRUE);\n\t\t$this->load->view('admin/layouts/index', $data);\n\t}", "public function initialize_settings() {\n\n\t\t$default_settings = array();\n\n\t\tforeach ($this->settings as $id => $setting) {\n\t\t\tif ($setting['type'] != 'heading')\n\t\t\t\t$default_settings['$id'] = $setting['std'];\n\t\t}\n\n\t\tupdate_option('eaboot_options', $default_settings);\n\t}", "public function page_init()\n { \n register_setting(\n 'my_option_group', // Option group\n 'my_option_name', // Option name\n array( $this, 'sanitize' ) // Sanitize\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n 'CLAS DEPT Theme Settings', // Title\n array( $this, 'print_section_info' ), // Callback\n 'my-setting-admin' // Page\n ); \n\n add_settings_field(\n 'dept_address', // ID\n 'Department Address', // Title \n array( $this, 'dept_address_callback' ), // Callback\n 'my-setting-admin', // Page\n 'setting_section_id' // Section \n ); \n\n add_settings_field(\n 'title', \n 'Footer Title', \n array( $this, 'title_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'fb', \n 'Facebook Link', \n array( $this, 'fb_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'twitter', \n 'Twitter Link', \n array( $this, 'twitter_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'instagram', \n 'Instagram Link', \n array( $this, 'instagram_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'youtube', \n 'Youtube Link', \n array( $this, 'youtube_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n add_settings_field(\n 'rss', \n 'RSS Link', \n array( $this, 'rss_callback' ), \n 'my-setting-admin', \n 'setting_section_id'\n ); \n\n \n }", "static function get_settings(){\n\t\t\t\treturn array(\t\n\t\t\t\t\t'icon' => GDLR_CORE_URL . '/framework/images/page-builder/nav-template.png', \n\t\t\t\t\t'title' => esc_html__('Templates', 'goodlayers-core')\n\t\t\t\t);\n\t\t\t}", "function getSettings()\n\t{\n\t\treturn false;\n\t}", "public function getDefaultSettings();", "public function general_settings_inputs() {\n\t\t$option_object = $this->get_analytics_options();\n\n\t\t$campus = array(\n\t\t\t'pullman' => 'Pullman',\n\t\t\t'spokane' => 'Spokane',\n\t\t\t'vancouver' => 'Vancouver',\n\t\t\t'tri-cities' => 'Tri-Cities',\n\t\t\t'globalcampus' => 'Global Campus',\n\t\t\t'everett' => 'Everett',\n\t\t);\n\n\t\t$college = array(\n\t\t\t'arts-and-sciences' => 'Arts & Sciences',\n\t\t\t'cahnrs' => 'CAHNRS & Extension',\n\t\t\t'carson' => 'Carson',\n\t\t\t'education' => 'Education',\n\t\t\t'honors' => 'Honors',\n\t\t\t'medicine' => 'Medicine',\n\t\t\t'murrow' => 'Murrow',\n\t\t\t'nursing' => 'Nursing',\n\t\t\t'pharmacy' => 'Pharmacy',\n\t\t\t'vetmed' => 'VetMed',\n\t\t\t'voiland' => 'Voiland',\n\t\t);\n\n\t\t$unit_type = array(\n\t\t\t'center' => 'Center',\n\t\t\t'department' => 'Department',\n\t\t\t'laboratory' => 'Laboratory',\n\t\t\t'office' => 'Office',\n\t\t\t'program' => 'Program',\n\t\t\t'school' => 'School',\n\t\t\t'unit' => 'Unit',\n\t\t);\n\n\t\t// @todo complete units taxonomy.\n\t\t$units = array();\n\n\t\t?>\n\t\t<!-- campus -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-campus\">Campus:</label>\n\t\t<select id=\"wsu-analytics-campus\" name=\"wsuwp_analytics_option_map[campus]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['campus'] ); ?>>None</option>\n\t\t\t<option value=\"all\" <?php selected( 'all', $option_object['campus'] ); ?>>All</option>\n\t\t\t<?php foreach ( $campus as $key => $name ) : ?>\n\t\t\t\t<option value=\"<?php echo $key; ?>\" <?php selected( $key, $option_object['campus'] ); ?>><?php echo $name; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent a campus in location or association?</p><br/>\n\n\t\t<!-- college -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-college\">College:</label>\n\t\t<select id=\"wsu-analytics-college\" name=\"wsuwp_analytics_option_map[college]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['college'] ); ?>>None</option>\n\t\t\t<option value=\"all\" <?php selected( 'all', $option_object['college'] ); ?>>All</option>\n\t\t\t<?php foreach ( $college as $key => $name ) : ?>\n\t\t\t\t<option value=\"<?php echo $key; ?>\" <?php selected( $key, $option_object['college'] ); ?>><?php echo $name; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent a college as a whole or by association?</p><br/>\n\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-unit-type\">Unit Type:</label>\n\t\t<select id=\"wsu-analytics-unit-type\" name=\"wsuwp_analytics_option_map[unit_type]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['unit_type'] ); ?>>None</option>\n\t\t\t<?php foreach ( $unit_type as $k => $v ) : ?>\n\t\t\t\t<option value=\"<?php echo $k; ?>\" <?php selected( $k, $option_object['unit_type'] ); ?>><?php echo $v; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">What type of unit does this site represent?</p><br/>\n\n\t\t<!-- units -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-parent-unit\">Parent Unit:</label>\n\t\t<select id=\"wsu-analytics-parent-unit\" name=\"wsuwp_analytics_option_map[unit]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['unit'] ); ?>>None</option>\n\t\t\t<?php foreach ( $units as $key => $group ) : ?>\n\t\t\t\t<optgroup label=\"<?php echo $key; ?>\">\n\t\t\t\t<?php foreach ( $group as $item_key => $name ) : ?>\n\t\t\t\t\t<option value=\"<?php echo $item_key; ?>\" <?php selected( $item_key, $option_object['unit'] ); ?>><?php echo $name; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent an entity that has a parent unit? (e.g department, office, school)</p><br/>\n\n\t\t<!-- units -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-unit\">Unit:</label>\n\t\t<select id=\"wsu-analytics-unit\" name=\"wsuwp_analytics_option_map[subunit]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['subunit'] ); ?>>None</option>\n\t\t\t<?php foreach ( $units as $key => $group ) : ?>\n\t\t\t\t<optgroup label=\"<?php echo $key; ?>\">\n\t\t\t\t<?php foreach ( $group as $item_key => $name ) : ?>\n\t\t\t\t\t<option value=\"<?php echo $item_key; ?>\" <?php selected( $item_key, $option_object['subunit'] ); ?>><?php echo $name; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent an entity that is a unit? (e.g. department, office, school)</p><br/>\n\n\t\t<?php if ( ( function_exists( 'wsuwp_is_global_admin' ) && wsuwp_is_global_admin( wp_get_current_user()->ID ) ) || is_super_admin() ) : ?>\n\t\t<p><span class=\"wsu-analytics-label\">Track Global Analytics</span></p>\n\t\t<label>Yes <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_global]\" value=\"true\" <?php checked( 'true', $option_object['track_global'] ); ?> /></label>\n\t\t<label>No <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_global]\" value=\"false\" <?php checked( 'false', $option_object['track_global'] ); ?> /></label>\n\t\t<p class=\"description\">Should global WSU analytics be tracked on this site? This should normally be on and only disabled for debugging.</p><br/>\n\n\t\t<p><span class=\"wsu-analytics-label\">Track App Analytics</span></p>\n\t\t<label>Yes <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_app]\" value=\"true\" <?php checked( 'true', $option_object['track_app'] ); ?> /></label>\n\t\t<label>No <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_app]\" value=\"false\" <?php checked( 'false', $option_object['track_app'] ); ?> /></label>\n\t\t<p class=\"description\">Should WSUWP Platform analytics be tracked on this site? This should normally be on and only disabled for debugging.</p><br/>\n\n\t\t<p><span class=\"wsu-analytics-label\">Track Site Analytics</span></p>\n\t\t<label>Yes <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_site]\" value=\"true\" <?php checked( 'true', $option_object['track_site'] ); ?> /></label>\n\t\t<label>No <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_site]\" value=\"false\" <?php checked( 'false', $option_object['track_site'] ); ?> /></label>\n\t\t<p class=\"description\">Should analytics be tracked on this site? A Google Analytics ID is still required if this is enabled.</p><br/>\n\t\t<?php endif; ?>\n\n\t\t<hr/>\n\t\t<p class=\"description\">Instructions on how to set up your Google analytics to best use this plugin can be <a href=\"https://web.wsu.edu/wordpress/plugins/wsu-analytics/\">found here</a>.</p>\n\n\t\t<style>\n\t\t\t.wsu-analytics-label {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 185px;\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t\t.form-table td p.description {\n\t\t\t\tfont-size: 13px;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "public function default_settings_section_info() {\n global $WCPc;\n _e('Enter your default settings below', $WCPc->text_domain);\n }" ]
[ "0.8051905", "0.79481155", "0.7787004", "0.7676741", "0.7664723", "0.7584061", "0.757239", "0.757004", "0.7410104", "0.7282661", "0.7237992", "0.7221786", "0.7203514", "0.7183179", "0.7156995", "0.7154677", "0.71511805", "0.7137968", "0.7113793", "0.70986015", "0.7048427", "0.70179313", "0.7005942", "0.7004695", "0.69997257", "0.69921476", "0.69861114", "0.6978569", "0.6977631", "0.69676536", "0.69671726", "0.6963255", "0.69615525", "0.6959967", "0.6945338", "0.6941196", "0.69258016", "0.69181114", "0.6896237", "0.6887241", "0.6886483", "0.6879187", "0.68789864", "0.68713886", "0.6858865", "0.685426", "0.68533295", "0.68449867", "0.6842551", "0.6841366", "0.6841032", "0.6834722", "0.6832936", "0.6832467", "0.6830761", "0.68303686", "0.6830071", "0.6829909", "0.68268377", "0.6823639", "0.6816228", "0.6809266", "0.67998266", "0.6799076", "0.6786483", "0.67824936", "0.6779757", "0.67786276", "0.6773433", "0.67622894", "0.67594874", "0.67594874", "0.6758496", "0.6752449", "0.67494214", "0.6745636", "0.6744247", "0.6743156", "0.6738371", "0.67291135", "0.6713329", "0.66901594", "0.66850257", "0.66848665", "0.66818887", "0.668102", "0.66796064", "0.66703033", "0.66693413", "0.6667397", "0.666355", "0.6659487", "0.6659271", "0.6653895", "0.66533417", "0.66526824", "0.66472524", "0.66435665", "0.6641512", "0.66409165", "0.663012" ]
0.0
-1
Check's whether request url/route matches passed link
function on_page($path, $type = "name") { switch ($type) { case "url": $result = ($path == request()->is($path)); break; default: $result = ($path == request()->route()->getName()); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function hasRoute($link_function) {\n $routes = self::getRoutes();\n return isset($routes[$link_function]);\n }", "public function hasRoute(): bool;", "function route_match() {\n global $route;\n global $html;\n global $config;\n global $matched_route;\n\n $url = explode('index.php', $_SERVER['REQUEST_URI']);\n $url = @str_replace('.', '', substr($url[1], 1));\n if(strpos($url, '?') !== false) {\n $url = explode('?', $url);\n $url = $url[0];\n }\n\n if(!$url) {\n $matched_route = 'ROOT';\n require_once __DIR__ . '/app/' . $route['ROOT'];\n return true;\n }\n\n if(substr($url, -1) == '/') {\n $url = substr($url, 0, -1);\n }\n\n // Check for simple route match\n if(array_key_exists($url, $route)) {\n $matched_route = $url;\n require_once __DIR__ . '/app/' . $route[$url];\n return true;\n }\n\n // Check for regex\n foreach($route as $r => $page) {\n $matches = array();\n\n if(preg_match('#' . $r . '$#', $url, $matches)) {\n array_shift($matches);\n\n $_GET['custom_arguments'] = $matches;\n\n $matched_route = $r;\n require_once __DIR__ . '/app/' . $page;\n return true;\n }\n }\n\n return false;\n}", "public function match(): bool\n {\n $uri = $_SERVER['REQUEST_URI'];\n $parse = parse_url($uri);\n $url = trim($parse['path'] ?? '', '/');\n foreach ($this->routes as $route => $params) {\n if (preg_match($route, $url, $matches)) {\n $this->params = $params;\n return true;\n }\n }\n return false;\n }", "public function matchLinkAndRoute($linkpath){\n\t\t\treturn RouteMatcher::matchRouteAndLink($linkpath);\n\t\t\t\n\t\t}", "private static function matchRoute($regex, $requestedUrl)\n {\n return (preg_match($regex, $requestedUrl) === 1);\n }", "private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }", "public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }", "private function checkUrl() {\n $career = $this->route('career');\n\n $url = $this->input('url');\n $prefix = trans('module-careerplugin::options.url_prefix');\n $language = $career->language ?? $this->getLanguage();\n\n $fullUrl = ($language->language_code ?? '') . '/' . $prefix . '/' . $url;\n\n $urlModel = Url::findUrl($fullUrl);\n\n if (!$urlModel) {\n return true;\n }\n\n return $career && $urlModel->model_id === $career->id && $urlModel->model === Career::class;\n }", "protected function isLink() {}", "public function match(Zend_Controller_Request_Http $request)\r\n {\r\n \tif (Mage::app()->getStore()->isAdmin()) {\r\n return false;\r\n }\r\n \r\n \t$pathInfo = $request->getPathInfo();\r\n // remove suffix if any\r\n $suffix = Mage::helper('amlanding/url')->getSuffix();\r\n if ($suffix && '/' != $suffix){\r\n $pathInfo = str_replace($suffix, '', $pathInfo);\r\n }\r\n \r\n $pathInfo = explode('/', trim($pathInfo, '/ '), 2);\r\n $identifier = $pathInfo[0];\r\n $params = (isset($pathInfo[1]) ? $pathInfo[1] : '');\r\n \r\n \r\n\t\t/* @var $page Amasty_Xlanding_Model_Page */\r\n $page = Mage::getModel('amlanding/page');\r\n $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());\r\n if (!$pageId) {\r\n return false;\r\n }\r\n \r\n\r\n $params = trim($params, '/ ');\r\n if ($params){\r\n $params = explode('/', $params);\r\n Mage::register('amshopby_current_params', $params);\r\n if ('true' == (string)Mage::getConfig()->getNode('modules/Amasty_Shopby/active')){\r\n $parsed = Mage::helper('amshopby/url')->saveParams($request);\r\n if (!$parsed && !Mage::registry('amshopby_short_parsed')) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n $request->setModuleName('amlanding')\r\n ->setControllerName('page')\r\n ->setActionName('view')\r\n ->setParam('page_id', $pageId)\r\n ->setParam('am_landing', $identifier)\r\n ;\r\n \r\n return true;\r\n }", "private function checkURI()\n {\n // init vars\n $result = false;\n $uri = $this->getURI();\n $routesArray = $this->routes;\n\n // get existed rule for user requested uri\n foreach ($routesArray as $rulePattern => $path) {\n if (preg_match(\"~$rulePattern~i\", $uri)) {\n $result = [$rulePattern, $path];\n return $result;\n }\n }\n }", "public function matches(Route $route, Request $request)\n {\n global $current_screen;\n return $route->hookSuffix==$current_screen->id;\n }", "function match_against_router() {\n\n require_once APP_PATH . '/config/routing.php';\n\n if (isset($routes)) {\n $base_url = $this->get_base_url();\n\n foreach ($routes as $key => $val) {\n if ($key == $base_url) {\n return $val;\n }\n }\n }\n return false;\n }", "private function check_url() {\n\t\t$check_url_object = new Router();\n\t\t$this->loader->add_action( 'init', $check_url_object, 'boot' );\n\t}", "public function isActiveRoute($link, $output = \"active\")\n {\n if (Request::url() == $link->link) return $output;\n }", "public function checkingRoute()\n {\n\n global $route;\n $request = new Request;\n $requested_url = $request->server('QUERY_STRING');\n //!TEST\n // echo $requested_url;\n // echo '<br />';\n $requested_method = $request->server('REQUEST_METHOD');\n //! TEST\n // echo $requested_method;\n /* \n // $server_all = $request->serverAll();\n // echo '<pre>';\n // print_r($server_all);\n // echo '</pre>' ;\n // $route_object = new Route;\n */\n $all_routes = $route->getRoutingTable();\n\n // NOTE\n /*\n ! ezzay ana shayf Class Web and Route min 3'eer use key word \n ? routes/web.php & Core/Route.php\n */\n //!TEST\n // echo '<pre>';\n // print_r($all_routes);\n // echo '</pre>';\n\n foreach ($all_routes as $url => $info) {\n\n /* !//? to test $url returns\n echo '<pre>';\n print_r($url);\n echo '</pre>' ;\n */\n // // if ($requested_url == $url){\n if (preg_match($url,$requested_url , $matches )){\n if( $requested_method == strtolower($info['method'])) {\n $this->controller = $info['controller'];\n $this->action = $info['action'];\n $this->params = array_slice($matches , 1);\n return true ;\n }else{\n die(\"405 method does not exist\");\n }\n /* //!deprecated if statement (wrong else statement)\n // if ($requested_url != $single_route) {\n // die('404 url not found');\n // }\n // elseif ($requested_method != $info['method']) {\n // die('405 method not allowed');\n // }\n // else {\n // $this->controller = $info['controller'];\n // $this->method = $info['method'];\n // }\n */\n }\n // echo $this->controller;\n // echo '<br />';\n // echo $this->action ;\n // echo '<br />';\n }\n die(\"404 not found\");\n }", "private function hasUrlChanged($request)\n {\n }", "public function match()\n {\n $startWithHttp = strpos($this->userInput, 'http://') === 0 || strpos($this->userInput, 'https://') === 0;\n $validUrl = filter_var($this->userInput, FILTER_VALIDATE_URL);\n\n return $startWithHttp && $validUrl;\n }", "public function match(ServerRequestInterface $request, Route $route): bool\n {\n $uri = $request->getUri()->getPath();\n $path = $this->generatePath($route);\n\n if (!preg_match(\"#^$path$#i\", $uri, $matches)) {\n return false;\n }\n\n array_shift($matches);\n $route->setParameters($matches);\n\n return true;\n }", "private function is_url_and_page_type() {\n\t\t$page_types = array_values( array_filter( $this->redirects, function( Red_Item $redirect ) {\n\t\t\treturn $redirect->match && $redirect->match->get_type() === 'page';\n\t\t} ) );\n\n\t\tif ( count( $page_types ) > 0 ) {\n\t\t\t$request = new Red_Url_Request( Redirection_Request::get_request_url() );\n\t\t\t$action = $page_types[0]->get_match( $request->get_decoded_url(), $request->get_original_url() );\n\t\t\tif ( $action ) {\n\t\t\t\t$action->run();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function matchRoute($route) {\n // Route match exactly with the url?\n if ($route === $this->url) {\n return true;\n }\n\n $regex = str_replace(['/', ')', ':word', ':num'], ['\\/', ')?', '[\\w_-]+', '[\\d-]+'], $route);\n if (preg_match('~^' . $regex . '$~', $this->url)) {\n return true;\n }\n return false;\n }", "public function match($url){\n // $reg_exp = \"/^(?P<controller>[a-zA-Z]+)\\/(?P<action>[a-zA-Z]+)$/\";\n foreach($this->routes as $route => $params){\n if(preg_match($route, $url, $matches)){\n foreach($matches as $key=>$match){\n if(is_string($key)){\n $params[$key] = $match;\n }\n }\n $this->params = $params;\n \n return true;\n }\n }\n return false;\n }", "private function matchURL($request)\n {\n $uri = explode('/', $this->uri);\n $request_ = explode('/', $request);\n\n if (count($uri) !== count($request_)) {\n return false;\n }\n\n foreach ($uri as $k => $v):\n if (preg_match($this->regex, $v)) {\n unset($uri[$k]);\n unset($request_[$k]);\n }\n endforeach;\n return empty(array_diff($request_, $uri));\n }", "public function matches(Route $route, Request $request);", "public function hasRoute(string $name): bool;", "public static function validRoutes(){\n $routes = self::$urled;\n $urlroute = $_GET['url'];\n $response1 = 0;\n\n\n foreach ($routes as $route) {\n if($urlroute == $route){\n $response1 += 1;\n }\n }\n if($response1 == 0){\n $response = ['error'=>'404 - not valid url'];\n echo json_encode($response);\n\n }\n }", "public function matchCurrentRoute($url)\n {\n if (!is_array($url))\n $url = \\Yii::app()->getUrlManager()->parseUrl($url);\n\n $route = trim(array_shift($url), \"/\");\n $params = $url;\n if ($route != $this->getId() && $route != $this->getRoute())\n return false;\n\n foreach($params as $key => $value) {\n if (!isset($_GET[$key]) || $_GET[$key] != $value)\n return false;\n\n }\n return true;\n }", "function canHandleCurrentUrl() ;", "function check_link($url, $phone) {\n }", "protected function isActive($link): bool\n {\n if (empty($link)) {\n return false;\n }\n $uri = Request::fullUrl();\n $pathParts = explode('?', $uri);\n $path = trim(reset($pathParts), '/ ');\n return strpos($path, $link) === 0;\n }", "public function isDynamicUrl();", "private function match(string $url) : bool\n {\n foreach ($this->routes as $route => $params) {\n if (preg_match($route, $url, $matches)) {\n foreach ($matches as $key => $param) {\n if (is_string($key)) {\n $params[$key] = $param;\n }\n }\n $this->params = $params;\n return true;\n }\n }\n return false;\n }", "protected function isUrlActive()\n {\n $route = Url::route($this->url);\n if($route) return App::router()->getCurrent()->matches($route);\n return false;\n }", "public function checkLinkToRedirect()\n {\n $config = $this->_registry->get(\"config\");\n\n $redirectAfterLogin = filter_input(INPUT_GET, \"redirect_after_login\", FILTER_UNSAFE_RAW);\n\n if ($redirectAfterLogin && $redirectAfterLogin != null) {\n $testLink = $redirectAfterLogin;\n } else if (isset($_SERVER['HTTP_REFERER'])) {\n $router = Zend_Controller_Front::getInstance()->getRouter();\n\n if ($router->getCurrentRouteName() == \"login\") {\n $referer = $_SERVER['HTTP_REFERER'];\n $partialLink = explode(\"?redirect_after_login=\", $referer, 2);\n\n if (! isset($partialLink[1])) {\n return false;\n } else {\n $testLink = $partialLink[1];\n }\n }\n } else {\n return false;\n }\n\n // the redirection link must start with a '/' and\n // must not end up in the redirector again\n // or be in another host (avoids the use of @)\n\n $thisPage = explode(\"?\", $_SERVER['REQUEST_URI'], 2);\n $thisPage = $thisPage[0];\n\n if (mb_substr($testLink, 0, 1) == '/' && !mb_strpos($testLink, \"@\") && $thisPage != $testLink) {\n // @todo improve HTTPS support\n $redirTo = \"http://\" . $config['webhost'] . $testLink;\n\n Zend_Uri::setConfig(array('allow_unwise' => true));\n\n if (Zend_Uri::check($redirTo)) {\n $testUri = Zend_Uri::factory($redirTo);\n\n $path = $testUri->getPath();\n\n Zend_Uri::setConfig(array('allow_unwise' => false));\n\n return $path;\n }\n }\n\n return false;\n }", "public function canHandleCurrentUrl() {}", "public function requestCall($link): bool;", "public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}", "private function routeTest($requestUrl, $route) {\n\t\t// Break apart the route URL\n\t\t$routeUrl = array_filter(explode('/', $route->route));\n\t\t$routePath = '';\n\n\t\t// Loop over each part of the route\n\t\tforeach ($routeUrl as $routeFragmentId => $routeFragment) {\n\t\t\t// Does this fragment actually exist in the request?\n\t\t\tif (! isset($requestUrl[$routeFragmentId])) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Request has this fragment\n\t\t\t// If it is a variable, does the format match?\n\t\t\telse if (strpos($routeFragment, ':') === 0) {\n\t\t\t\t// Get the name of this fragment\n\t\t\t\t$routeFragmentName = substr($routeFragment, 1);\n\n\t\t\t\t// Get the format regex test\n\t\t\t\t$regexTest = isset($route->paramFormats[$routeFragmentName])\n\t\t\t\t\t? $route->paramFormats[$routeFragmentName]\n\t\t\t\t\t: '[\\w\\-]+';\n\n\t\t\t\t// And test\n\t\t\t\tif (! preg_match(\"/^{$regexTest}$/iu\", $requestUrl[$routeFragmentId])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Add this route declared variable to the GET request\n\t\t\t\t$_GET[$routeFragmentName] = $requestUrl[$routeFragmentId];\n\t\t\t}\n\n\t\t\t// This is not a regex test, so just check the strings are the same\n\t\t\telse if ($routeFragment != $requestUrl[$routeFragmentId]) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Build up the path\n\t\t\t$routePath .= '/' . $requestUrl[$routeFragmentId];\n\t\t}\n\n\t\t// This route has passed all of the fragment tests\n\t\t$this->_routePath = $routePath;\n\t\treturn true;\n\t}", "abstract public function getRouteMatch();", "public function path_matches($request_path)\n {\n }", "public function getRouteMatch();", "function isValidRoute($route) {\n \n return $route == 'campus' ||\n $route == 'extended' ||\n $route == 'nathanBisk' ||\n $route == 'downtown';\n}", "function ci_use_route(){\n\t\t$c_uri=$this->uri->segments;\n\t\t$c_ruri=$this->uri->rsegments;\n\n\t\t//--- we re-introduice the directori in RURI\n\t\tif($this->router->directory!=''){\n\t\t\tarray_unshift($c_ruri , trim($this->router->directory,'/'));\n\t\t\t$i = 1;\n\t\t\tforeach ($c_ruri as $val) $c_ruri[$i++] = $val;\n\t\t\tunset($c_ruri[0]);\n\t\t}\n\n\t\tif(count($c_uri) > count($c_ruri))return true;\n\t\t//--- Now if URI == RURI => there is no used route.\n\t\tif(count($c_uri) == count($c_ruri)) return (implode('/',$c_uri)==implode('/',$c_ruri))? false:true;\n\n\t\tfor($i=1;$i <= count($c_uri);$i++) {\n\t\t\tif($c_uri[$i]!=$c_ruri[$i]) return true;\n\t\t}\n\t\treturn false;\n\t}", "private function hasRouteParameters($route) {\n\n if (preg_match(\"/\\/:/\", $route)) {\n return true;\n }\n\n return false;\n }", "public function isOnRoute(): bool\n {\n $lang = $this->grav['language']->getActive();\n\n $path = $this->grav['uri']->rootUrl() ?: '/';\n $routes = $this->config->get('plugins.' . $this->name . '.routes');\n\n foreach ($routes as $route) {\n ['blog' => $blog, 'items' => $items] = $route;\n if ($path === $blog || str_starts_with($path, $items)) {\n if ($lang) {\n $route['blog'] = '/' . $lang . $route['blog'];\n $route['items'] = '/' . $lang . $route['items'];\n }\n $this->routes = $route;\n\n return true;\n }\n }\n\n return false;\n }", "public static function matchUrl(Request $first, Request $second)\n {\n if (null !== $first->getPath()) {\n $path = str_replace('#', '\\\\#', $first->getPath());\n\n if (!preg_match('#'.$path.'#', rawurldecode($second->getPath()))) {\n return false;\n }\n }\n\n return true;\n }", "public function linkCheck(Request $request)\n {\n // Validate request server side\n $request->validate([\n 'url' => 'required|active_url'\n ]);\n\n try {\n\n $linkUrl = trim( $request->url );\n $urlData = $this->getUrlData($linkUrl);\n\n // Return the data\n $result = array(\n 'url' => $linkUrl,\n 'title' => $urlData['link_title'],\n 'favicon' => $urlData['favicon'],\n 'iframe_blocked' => $urlData['iframe_blocked'],\n 'image' => $urlData['image']\n );\n\n\n return response($result, 200);\n\n } catch (Exception $e) {\n return response(['message' => 'Unable to process the URL you have entered'], 500);\n }\n }", "public function isActiveRoute();", "public function matchWhen($url = null)\n {\n if (null !== $url) {\n $this->setMatchUrl($url);\n }\n\n return strpos($this->getRequestedUrl(), $this->getMatchUrl()) === 0;\n }", "public function isRedirect();", "private function linkIsScenearioLink($link)\n {\n $parsedLink = parse_url($link);\n if(isset( $parsedLink['host'] ) \n && strpos( $parsedLink['host'], 'sceneario' ) !== false ){\n return true;\n }\n return false; \n }", "public function isRedirection();", "public function checklink() {\n\n if (isset($_POST['link'])) {\n $link = mb_strtolower(url_title(convert_accented_characters($this->input->post('link'))));\n $result = $this->Users->checklink($link);\n if ($result) {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 1)));\n } else {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 0)));\n }\n }\n }", "public static function route_exists($route){\n $route_parts = explode('/', trim($route, '/'));\n $total_size = count($route_parts);\n\n $possible_routes = array_filter(Router::$routes[$_SERVER['REQUEST_METHOD']], function ($route, $key) use ($total_size) {\n return $route['total_size'] === $total_size;\n }, ARRAY_FILTER_USE_BOTH);\n\n asort($possible_routes);\n\n foreach( $possible_routes as $key => $possible_route ){\n $new_key = explode('/', $key);\n $new_key = array_slice($new_key, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n $new_route = explode('/', $route);\n $new_route = array_slice($new_route, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n if( $new_key === $new_route ){\n if( $possible_route['params_number'] > 0 ){\n $possible_route['params'] = array_slice($route_parts, - $possible_route['params_number'] );\n } else {\n $possible_route['params'] = [];\n }\n return $possible_route;\n }\n }\n return false;\n }", "public function match(Request $request, ParsedRequest $parsedRequest)\n {\n $fromPath = $this->mergePathAndQuery($request);\n $toPath = $parsedRequest->getHref();\n\n if ($fromPath === $toPath) {\n return true;\n }\n\n $params = (new UriTemplate())->extract(\n $toPath,\n $fromPath,\n true\n );\n\n if ($params === null) {\n return false;\n }\n\n return true;\n }", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "function is_route(string $route): bool\n {\n return Route::currentRouteName() == $route;\n }", "private function match ($url) {\n foreach ($this->pattern as $key => $pattern) $url = str_replace('{' . $key . '}', '(?P<' . $key . '>' . $pattern . ')', $url);\n preg_match('#^' . $url . '$#', App::$request->url, $matches);\n foreach ($matches as $key => $val)\n if (array_key_exists($key,$this->pattern)) $this->params[$key] = $val;\n return !empty($matches);\n }", "private static function check_path_uri(&$request_uri, &$route_uri) : bool\n\t{\n\t\t$request = explode('/', $request_uri);\n\t\t$route = explode('/', $route_uri);\n\n\t\tif(count($request) !== count($route))\n\t\t\treturn false;\n\n\t\tforeach ($route as $key => $value)\n\t\t{\n\t\t\tif(preg_match('/#[0-9]+#/', $value) === 1)\n\t\t\t\tcontinue;\n\n\t\t\tif($request[$key] === $value)\n\t\t\t\tcontinue;\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasUrlGenerator(): bool;", "public function isMenuItemValidOmittedHrefAndRouteExpectFalse() {}", "public function verifyContainsURL(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidURL($word)) {\n return true;\n }\n }\n \n return false;\n }", "protected function checkRedirect() {}", "private static function rerouteCheck()\n {\n if ( ! Session::isValid()) {\n if (Session::hasTrainer()) {\n // we have a trainer but not a student\n self::computeImpliedRoute();\n } else {\n (new LoginTemplate())->display();\n }\n }\n }", "public function match(Request $request)\n {\n if ($this->method) {\n if ($request->getMethod() != $this->method) {\n return false;\n }\n }\n if ($this->hostname && $request->hasHeader('host')) {\n if ($request->getHeader('hostname') != $this->host) {\n return false;\n }\n }\n\n // Ejecutamos la función de validación\n $function = [$this, 'match' . $this->type];\n\n $url = $request->getRequestTarget();\n $result = $function($url);\n\n if ($result) {\n // Encontramos un match. Añadimos los args del request\n $result['args'] = array_merge($this->args, \n $result['args']);\n\n return $result;\n }\n\n\n // Not valid\n return false;\n }", "function urlcontains($string) {\n if (strpos('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'],$string) == true) {\n return true;\n }\n }", "abstract public function isLink($target);", "private function check_for_url_access($path,$query,$menu_slug){\n if(strpos('?'.$query .' ',$menu_slug. ' ') !== FALSE || strpos($path, '/' .$menu_slug) !== FALSE || strpos($path.'?'.$query .' ',$menu_slug. ' ') !== FALSE || strpos($query,$menu_slug) !== FALSE){\n return true;\n }\n return false;\n }", "public function execute(Request $request, Route $route) : bool{\n\n $pattern = str_replace('{', '(?P<', str_replace('}', '>[a-zA-Z0-9-_.,:;()]+)', $route->getUrlPattern()));\n $matches = [];\n\n if(preg_match('#^'.$pattern.'$#', $request->getUrl()->getUri(), $matches)){\n foreach($matches as $key => $value){\n if(!is_int($key)){\n $request->getParameters()->add($key, $value);\n }\n }\n return true;\n }\n return false;\n }", "public function hasLink() {\n return $this->link!=null;\n }", "public function is_valid_url()\r\n {\r\n return (!empty($this->internal_params['url']) &&\r\n piplapi_is_valid_url($this->internal_params['url']));\r\n }", "function mc_external_link( $link ) {\n\tif ( ! _mc_is_url( $link ) ) {\n\t\treturn 'class=\"error-link\"';\n\t}\n\n\t$url = parse_url( $link );\n\t$host = $url['host'];\n\t$site = parse_url( get_option( 'siteurl' ) );\n\t$known = $site['host'];\n\n\tif ( false === strpos( $host, $known ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function nav_is($url)\n{\n $current = URL::makeAbsolute(URL::getCurrentWithQueryString());\n\n return $url === $current || Str::startsWith($current, $url . '/');\n}", "public function __invoke(ServerRequestInterface $request, Route $route)\n {\n if (! $route->host) {\n return true;\n }\n\n $match = preg_match(\n $this->buildRegex($route),\n $request->getUri()->getHost(),\n $matches\n );\n\n if (! $match) {\n return false;\n }\n\n $route->attributes($this->getAttributes($matches));\n return true;\n }", "public function validate( IHTTPRouteRequest $request, IHTTPRoute $route ) : bool\n {\n if ( !in_array( self::COMMAND, $route->getOptions()))\n return true;\n \n return ( $request->getHeader( self::REQUESTED_WITH ) == self::REQUESTED_WITH_XHR );\n }", "private function matchUrl($route, $url) {\n $route = $this->removeTrailingSlash($route);\n $url = $this->removeTrailingSlash($url);\n\n if ($this->hasRouteParameters($route)) {\n $route = preg_replace( \"/:[0-9A-Za-z]*/\", \"[0-9A-Za-z]*\", $route);\n } else {\n $route = preg_replace(\"/\\*/\", \".*\", $route);\n }\n\n $route = preg_replace(\"/\\//\", \"\\/\", $route);\n $route = \"/^\" . $route . \"$/\";\n\n if (preg_match($route, $url)) {\n return true;\n }\n\n return false;\n }", "function ajax_action_check_url() {\n\n\t\t$hadError = true;\n\n\t\t$url = isset( $_REQUEST['url'] ) ? $_REQUEST['url'] : '';\n\n\t\tif ( strlen( $url ) > 0 && function_exists( 'get_headers' ) ) {\n\t\t\t\t\n\t\t\t$file_headers = @get_headers( $url );\n\t\t\t$exists = $file_headers && $file_headers[0] != 'HTTP/1.1 404 Not Found';\n\t\t\t$hadError = false;\n\t\t}\n\n\t\techo '{ \"exists\": '. ($exists ? '1' : '0') . ($hadError ? ', \"error\" : 1 ' : '') . ' }';\n\n\t\tdie();\n\t}", "public function responseCall($link): bool;", "function canViewButton($uri,$type=false)\n{\n if(isset($type) && $type != null)\n {\n if($type='route')\n {\n if(\\App\\Permission::where('route_name',$uri)->exists()) {\n $permission = \\App\\Permission::where('route_name', $uri)->first();\n $uri = $permission->route_uri;\n }\n }\n }\n $mdl=new \\App\\Http\\Middleware\\UserizationMiddleware();\n if($mdl->checkAccessibility($uri))\n {\n return true;\n }\n return false;\n}", "public function canHandleRequest(\\Eeno\\Http\\Request $request)\n {\n if( strcasecmp($request->method() , $this->method() ) == 0 &&\n strcasecmp($this->url() , $request->url() ) == 0)\n return true;\n return false; \n }", "function check_ref()\r\n\t{\r\n\t\t$srv = $_SERVER['SERVER_NAME']; //服务器名\r\n\t\t\r\n\t\tif (substr($_SERVER['HTTP_REFERER'],7,strlen($srv)) != $srv)\r\n\t {\r\n\t\t\t//header('Location: /');\r\n\t \t exit;\r\n\t }\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private function _exists(string $link): bool {\n foreach ($this->_links as $linkObject) {\n if($linkObject->getLink() == $link || $linkObject->getLink() == \"$link/\") {\n return true;\n }\n }\n\n return false;\n }", "protected function matchRoute($route) { \n \n $req = $this->getRequest();\n \n if($req['method'] != $route['method']) { return false; } \n $regex = $this->convertRoutePathToRegex($route['path']);\n \n $matches = false;\n \n preg_match_all($regex['regex'],$req['path'],$matches);\n //var_dump($matches);\n \n if(count($matches[0]) > 0) {\n foreach($regex['variables'] as $i=>$v) {\n $route['params'][$v] = $matches[($i+1)][0];\n }\n return $route;\n }\n \n return false;\n \n }", "private static function check_route($a_route){\n\t\t$args=explode(\"/\",$a_route);\n\t\t\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t\tdie();\n\t\t}\n\t}", "public function test_can_fetch_link_from_shortlink()\n {\n $this->get(route('shortlink.fetch.link', ['code' => 'AbcXyz']))->assertStatus(200);\n }", "public function match($url=null, $method=null)\n{\n foreach(RouteCollection::group($method) as $route)\n {\n $regex = $route->convertPattern();\n if(preg_match($regex, $url, $matches))\n {\n array_shift($matches);\n $this->matches = $matches;\n $this->route = $route;\n $route->register('matches', $matches);\n $route->register('regex', $regex);\n return $route->parameters();\n }\n }\n return false;\n}", "protected function match($url){\n\n //loop through routing table ($this->routes), check for a regex match to the route\n foreach ($this->routes as $route => $params):\n if( preg_match($route, $url, $matches) ){\n //matches contains the matches (params)\n // ($matches example) Array ( [0] => contolla/actioon [controller] => contolla [1] => contolla [action] => actioon [2] => actioon )\n foreach ($matches as $key => $match) {\n // we only want the custom named capture groups (strings)\n if(is_string($key)){\n //store new params from regex capture groups in the $routes params\n $params[$key] = $match;\n }\n }\n //store routes params in the instace of this object\n $this->params = $params;\n return true;\n }\n endforeach;\n //no match found\n return false;\n\n }", "public function checkRoute( $subpage ) {\n\t\t$matched = preg_match( '/^id\\/(?<id>\\d+)(\\/.*$|$)/', $subpage, $matches );\n\t\treturn $matched ? $matches : false;\n\t}", "public static function hostMatched() {\n\t\t// TODO: add third-party comparison\n\t\t$return = TRUE;\n\t\treturn TRUE;\n\t\tif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_SERVER['HTTP_REFERER']) && isset($_SERVER['HTTP_HOST'])) {\n\t\t\tlist(, , $referer_host) = explode('/', $_SERVER['HTTP_REFERER'], 4);\n\t\t\tif ($_SERVER['HTTP_HOST'] != $referer_host) {\n\t\t\t\t// Request came from a different site.\n\t\t\t\t$return = FALSE;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "public function checkFormat($link)\n {\n if (isset($link)) {\n $check = [\n (strstr(parse_url($link, PHP_URL_HOST), 'localhost')),\n (strstr(parse_url($link, PHP_URL_HOST), 'redcap'))\n ];\n if (in_array(true, $check))\n return true;\n return false;\n\n } else {\n throw new \\Exception('No config value passed for redcap-survey-redirect');\n }\n }", "private function detectRequest()\n {\n // Get URL\n $url = isset($_GET) && array_key_exists('url', $_GET) ? $_GET['url'] : '';\n $url = trim($url, '/');\n\n // Apply routes\n $url = $this->applyRoutes($url, $this->routes);\n\n // Split URL\n $params = explode('/', $url);\n if(empty($params[0])) {\n $params = array();\n }\n\n\n // Save parameters\n $this->params = $params;\n }", "function IsLink($short_url)\n\t{\n\t\t$this->db->where('id', hexdec($short_url));\n\t\t$this->db->from('links');\n\n\t\tif ($this->db->count_all_results() > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function hasRoute(): bool\n {\n return isset($this->route);\n }", "public static function match($url)\n {\n foreach(self::$routes as $route => $params){\n if (preg_match($route, $url, $matches)){\n foreach($matches as $key => $match){\n if (is_string($key)){\n $params[$key] = $match;\n }\n }\n self::$params = $params;\n return true;\n }\n }\n return false;\n }", "public function match($uri);", "private static function match_route($protocol, $route, $action, $args)\n\t{\n\t\t$maverick = \\maverick\\maverick::getInstance();\n\t\t\n\t\t// return if a route has already been matched\n\t\tif(isset($maverick->route))\n\t\t\treturn false;\n\t\t\n\t\t// return if the protocols don't match\n\t\tif(strtolower($_SERVER['REQUEST_METHOD']) == $protocol || $protocol == 'any')\n\t\t{\n\t\t\tpreg_match(\"~^{$route}$~\", $maverick->requested_route_string, $matches);\n\t\t\t\n\t\t\t// route match - assign the information back to the main maverick object\n\t\t\tif(!empty($matches))\n\t\t\t\t$maverick->controller = self::get_full_action($action, $args, $matches);\n\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function matchRoute() {\n\t\tforeach($this->routes as $pattern => $callback) {\n\t\t\tif (preg_match('{^' . $pattern . '$}', $this->url) === 1) {\n\t\t\t\tif(!isset($_SESSION)){ session_start(); }\n\t\t\t\t// Parameters\n\t\t\t\t$params = array();\n\t\t\t\tif (isset($callback['params'])) {\n\t\t\t\t\t$url = explode('/', $this->url);\n\t\t\t\t\t$url = array_slice($url, -1 * count($callback['params']));\n\t\t\t\t\t$params = array_combine(array_keys($callback['params']), $url);\n\t\t\t\t}\n\t\t\t\t// Secured (Backend)\n\t\t\t\tif (isset($callback['secured'])) {\n\t\t\t\t\tif (isset($_SESSION['auth']) && $_SESSION['auth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'http://' . $_SERVER['SERVER_NAME'] . '/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Secured (Frontend)\n\t\t\t\t} elseif (isset($callback['clientsecured'])) {\n\t\t\t\t\tif (isset($_SESSION['fauth']) && $_SESSION['fauth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'home/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Simple\n\t\t\t\t} else {\n\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// No match\n\t\t$this->dispatch('Default', 'error', array('code' => 404));\n\t\treturn;\n\t}", "public function verifyLink ($link)\n {\n $map = substr($link,0,3);\n if($map != 'http') {\n $newLink = 'http://' . $link;\n return $newLink;\n }\n }" ]
[ "0.6936334", "0.66675806", "0.6659667", "0.66127783", "0.6600663", "0.65738535", "0.65582985", "0.6469507", "0.64600587", "0.64049965", "0.6335055", "0.63331354", "0.63268185", "0.63233614", "0.6305586", "0.629175", "0.6252889", "0.62273103", "0.6226065", "0.6213071", "0.62076503", "0.6200985", "0.617844", "0.6167658", "0.61554784", "0.6147066", "0.6131824", "0.61260957", "0.6114691", "0.6103458", "0.60948575", "0.60883945", "0.6062213", "0.6050071", "0.6049617", "0.60463464", "0.60286516", "0.60268116", "0.60126674", "0.5988494", "0.5946035", "0.5933344", "0.5926666", "0.5924071", "0.5922923", "0.5912946", "0.5908382", "0.5905205", "0.58898443", "0.588911", "0.5887558", "0.5883799", "0.5871269", "0.5867524", "0.5825314", "0.5812016", "0.57974774", "0.5793382", "0.5779462", "0.576755", "0.5758666", "0.57568216", "0.5750947", "0.5750008", "0.5744053", "0.57354957", "0.5724795", "0.5721351", "0.5713796", "0.57129806", "0.57035285", "0.5693925", "0.56855255", "0.56755495", "0.566968", "0.56625384", "0.5660981", "0.5660466", "0.5653144", "0.565039", "0.5642105", "0.5641524", "0.56406724", "0.5628183", "0.5626927", "0.5625706", "0.5614573", "0.5612688", "0.5593701", "0.55913687", "0.5591238", "0.5588336", "0.5586083", "0.5583381", "0.5582618", "0.55770564", "0.55713147", "0.5570037", "0.556975", "0.55693364" ]
0.5592687
89
Appends passed value if condition is true
function return_if($condition, $value) { if ($condition) { return $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function append($value)\n {\n \t$this->values[] = $value;\n }", "public function addConditionValue($value): void\n {\n $index = $this->conditionPrefix . $this->conditionIndex;\n $this->indexedValues[$index] = $value;\n $this->conditionIndex++;\n }", "public function append($value)\n {\n return $this->add($value);\n }", "function append($value = \\null)\n {\n }", "public function append($value, $key = null) \n {\n $key ? $this->pushKey($key, $value) : $this->push($value);\n }", "public function append($value)\n {\n $this->items[] = $value;\n }", "public function appendValue($value) {\n $this->current->value($value);\n }", "public function appendTo($value) {\n \n return $this->prepend($value);\n }", "public function concat($value) {\n \n return $this->append($value);\n }", "public function add_value($value) : void\n {\n if(!($this -> $value === $value || in_array($value, $this -> value))){\n if(gettype($this -> value) === \"string\"){\n $this -> value = [$this -> value];\n }\n array_push($this -> value, $value);\n }\n }", "public function append($values);", "public function append($key, $value) {}", "public function append($key, $value = null);", "function conditionAddress($add2) {\n if ($add2 == \"\") {\n return \"\";\n } else {\n return \"{$add2}<br>\";\n }\n}", "public function addCondition($chain, $arguments, &$array)\n {\n array_push($array, new Condition($chain, $arguments, $this));\n }", "public function addCondition($condition);", "public function append(mixed $value) {\n $this->items[] = $value;\n return $this;\n }", "public function addCriteria($value) {\n return $this->_add(6, $value);\n }", "public function add_value($value){\n if ($value !== null){\n if (!is_array($this->value)){ //if the value is not an array, turn in into an array containing the former $value and new $value\n if ($this->value !== $value){ //if not a duplicate\n $arr = array();\n array_push($arr, $value, $this->value);\n\n $this->value = $arr; //set $this->value to the newly formed array\n }\n\n } else {\n array_push($this->value, $value);\n }\n }\n }", "private function append($key, $val)\n {\n $this->_data[$key] = sprintf(\"%s%s%s\", $this->_data[$key], $this->_join, $val);\n }", "public function append($key=null,$value=null){\n\n //get append\n if($key!==null && $value!==null){\n return $this->client->append($key,$value);\n }\n return null;\n\n }", "public function append($value) {\n $this->_value = $this->_value . $value;\n $this->countLength();\n \n return $this;\n }", "public function append($expression = null);", "function add_condition($item) {\n\t\treturn $this->conditions[$this->prefix.$item['id']] = $item['condition'];\n\t}", "public function addValue($value);", "public function append($key, $value)\n {\n // should failed.\n $sent = $this->_send(array(\n 'opcode' => 0x0e,\n 'key' => $key,\n 'value' => $value,\n ));\n $data = $this->_recv();\n if ($data['status'] == 0) {\n return TRUE;\n }\n\n return FALSE;\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "function append($key, $value) {\n return $this->memcached->append($key, $value);\n }", "public function appendHavingItem($value)\n {\n return $this->append(self::HAVING_ITEM, $value);\n }", "private function add($value, &$result) {\r\n\r\n // Get variable type\r\n $type = gettype($value);\r\n\r\n switch ($type) {\r\n case \"boolean\";\r\n $result .= $value ? \"true\" : \"false\";\r\n $result .= self::NEWLINE;\r\n break;\r\n case \"integer\":\r\n $result .= $value . self::NEWLINE;\r\n break;\r\n case \"double\":\r\n $result .= $value . self::NEWLINE;\r\n break;\r\n case \"string\":\r\n $result .= $value . self::NEWLINE;\r\n break;\r\n case \"array\":\r\n if ($this->remove_empty_elements && count($value) == 0)\r\n return;\r\n foreach ($value as $arr_key => $arr_val) {\r\n $this->add($arr_key . '::' . $arr_val, $result);\r\n }\r\n break;\r\n case \"object\":\r\n $properties = get_object_vars($value);\r\n foreach ($properties as $obj_key => $obj_val) {\r\n $this->add($obj_key . '::' . $obj_val . self::NEWLINE, $result);\r\n }\r\n break;\r\n default:\r\n\r\n break;\r\n }\r\n }", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "function add($key,$value = false) {\n\t\tif(is_array($key))\n\t\t\t$this->_output = array_merge($key, $this->_output);\n\t\telseif(array_key_exists($key,$this->_output)) {\n\t\t\tif(!is_array($this->_output[$key]))\n\t\t\t\t$this->_output[$key] = array($this->_output[$key]);\n\t\t\t\n\t\t\tif(is_array($value))\n\t\t\t\t$this->_output[$key] = array_merge($this->_output[$key],$value);\n\t\t\telse\n\t\t\t\t$this->_output[$key][] = $value;\n\t\t}\n\t\telse\n\t\t\t$this->_output[$key] = $value;\n\t}", "function append($data) {}", "public function append($conditions)\n {\n if(is_string($conditions)){\n $conditions = [ $conditions ];\n }\n $this->conditions = array_merge($this->conditions, $conditions);\n }", "public function appendLine($value = \"\")\r\n {\r\n $this->addElement($value.PHP_EOL);\r\n }", "public function append($value) {\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $v) {\n\t\t\t\t$this->append($v);\n\t\t\t}\n\t\t} else {\n\t\t\tarray_push($this->_value, $value);\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function insertAfterCondition(&$array, $condition, $newValue) {\n $newArray = [];\n $insertionCount = 0;\n $has_found = FALSE;\n \n foreach ($array as $key => $value) {\n $newArray[] = $value;\n\n if (!$has_found && call_user_func($condition, $key, $value)) {\n $has_found = TRUE;\n $newArray[] = $newValue;\n $insertionCount++;\n }\n }\n\n if (!$has_found) {\n $newArray[] = $newValue;\n }\n\n $array = $newArray;\n\n return $insertionCount;\n }", "public function addBy($value) {\n return $this->_add(4, $value);\n }", "function _appendText ($text) {\r\n if (!strlen ($text)) {\r\n return true;\r\n }\r\n switch ($this->_status) {\r\n case 0:\r\n case 7:\r\n return $this->_appendToLastTextChild ($text);\r\n case 1:\r\n return $this->_topNode ('appendToName', $text);\r\n case 2:\r\n case 4:\r\n $this->_savedName .= $text;\r\n return true;\r\n case 3:\r\n return $this->_topNode ('appendToAttribute', 'default', $text);\r\n case 5:\r\n $this->_savedValue .= $text;\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "private function addValueInListQuery($key,$value){\n /// \\param[in] $key The key (fieldname)\n /// \\param[in] $value The value(s) of the fieldname\n /// \\return a part of the query or nothing\n global $ORIONDB_DB;\n \n if(($key != \"\") && ($value != \"\")){\n if($this->_queryUnchanged[$this->_numberOfRecursions]){\n $returnQuery = \" WHERE \";\n $this->_queryUnchanged[$this->_numberOfRecursions] = false;\n }\n else {\n $returnQuery = \" AND \"; \n }\n $returnQuery .= $ORIONDB_DB->cleansql($key) . \" in (\" . $ORIONDB_DB->cleansql($value) . \")\";\n return $returnQuery;\n }\n}", "public function appendBuild(\\PB_Build $value)\n {\n return $this->append(self::BUILD, $value);\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public final function addCondition($k,$v){\n $this->defaultMatchCondition[$k]=$v;\n }", "protected function valueContainsAdd()\n {\n return (preg_match('/\\+/', $this->condition->value) == 1);\n }", "public function append($conditions, $glue=null)\n\t{\n\t\t// If no explicit glue is set use the object glue.\n\t\tif ($glue === null) {\n\t\t\t$glue = $this->_glue;\n\t\t}\n\n\t\t// Sanitize the glue.\n\t\t$glue = strtoupper($glue);\n\n\t\tif ($conditions) {\n\t\t\t$this->_conditions[] = array('c'=>$conditions, 'g'=>$glue);\n\t\t}\n\t}", "function appendValue($buttonvalue) {\n\treturn $_SESSION[\"result\"].$buttonvalue;\t\n}", "static function ensure(&$array, $value){\n\t\tif(array_search($value, $array) === false){\n\t\t\t$array[] = $value;\n\t\t}\n\t\treturn $array;\n\t}", "public function append($v) {\n $file = FALSE;\n if (($this->bottom - 1) >= $this->size) {// keep oldest file before delete\n $key = ($this->bottom + 1) % $this->size;\n $file = $this->get($key);\n }\n $this->bottom = ($this->bottom + 1) % $this->size;\n $this->buf[$this->bottom] = $v;\n if ($this->top >= $this->bottom) {\n $this->top = $this->bottom + 1;\n }\n return $file;\n }", "public function writeAttributeIf($condition, $attribute, $value)\n {\n if ($condition == true) {\n $this->xmlWriter->writeAttribute($attribute, $value);\n }\n }", "function append(Monad $value, Monad $list): Monad\n{\n return concat($list, $value);\n}", "public function append($data);", "private function appendQuery(string $method, $value)\n {\n if (!isset($this->__QUERY__[$method])) {\n $this->__QUERY__[$method] = [];\n }\n $this->__QUERY__[$method][] = $value;\n }", "protected function doConcatenate() {}", "public function appendPrice($value) {\n return $this->append(self::PRICE, $value);\n }", "public function appendResult($value)\n {\n return $this->append(self::_RESULT, $value);\n }", "public function appendResult($value)\n {\n return $this->append(self::_RESULT, $value);\n }", "function add_test($condition, $result_true, $recommend_true, $result_false, $recommend_false, $recommend_condition = FALSE) \n{\n\tglobal $recommendation, $test_result;\n\t\n\tif ($condition) {\n\t\t$test_result[] = \"<span style='color: green;'>\" . $result_true . \"</span>\";\n\t\tif (!$recommend_condition)\n\t\t\t$recommendation[] = $recommend_true;\n\t}\n\telse {\t\t\n\t\t$test_result[] = \"<span style='color: red;'>\" . $result_false . \"</span>\";\n\t\t$recommendation[] = $recommend_false;\n\t}\n}", "function googleAppendToQuery($fd, &$q, $sep=''){\n $f = (object)$fd;\n $fv = '';\n if (empty($f->value) && !empty($f->default))\n $fv = $f->default;\n else\n $fv = $f->value;\n if (!empty($fv)){\n $fv = preg_replace('/,/', '', $fv);\n if (empty($q))\n\t$q = $fv;\n else\n\t$q .= $sep.$fv;\n }\n }", "function fn_product_condition_get_product_data($product_id, &$field_list, $join, $auth, $lang_code, $condition) {\r\n $field_list .= 'condition';\r\n}", "public function append($content)\n {\n return !empty($content) ? ' ' . $this->renderContent($content) : '';\n }", "public function stdWrap_append($content = '', $conf = [])\n {\n return $content . $this->cObjGetSingle($conf['append'], $conf['append.'], '/stdWrap/.append');\n }", "public function append($name, $value)\n {\n $this->redis->append($name, $value);\n }", "public function addElse()\n\t{\n\t\t// Don't process if done or we've encountered a condition\n\t\t// that evaluated to TRUE. Even if other ones have not been\n\t\t// evaluated, that one will shortcut our else, so we prune\n\t\t// the else branch.\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ( ! $this->all_previous_could_eval)\n\t\t{\n\t\t\t$this->parser->output('{if:else}');\n\t\t}\n\n\t\t$this->last_result = TRUE;\n\t\t$this->setLastCouldEval(TRUE);\n\n\t\treturn $this->shouldAddBody();\n\t}", "function add( $value ) {\n\t\t$this->source .= $value;\n\t\treturn $this;\n\t}", "public function addCondition($condition) {\n $this->condition[] = $condition;\n return $this;\n }", "public function isAppend();", "public function appendLineup($value)\n {\n return $this->append(self::_LINEUP, $value);\n }", "public function appendLineup($value)\n {\n return $this->append(self::_LINEUP, $value);\n }", "public function pushWhen($condition, $value = null): self\n {\n $self = $this;\n\n if (is_null($value)) {\n return $this->deriveWithMacros('end', function () use ($self, $condition) {\n $self->pushWhen($condition, $this);\n return $self;\n });\n } else {\n return $this->when($condition, function () use ($value) {\n return $this->push($value);\n });\n }\n }", "function appendQuery($queryToAppend, $cart){\n $counter = 0;\n foreach ($cart as $id => $properties) {\n // First Append\n if($counter == 0){\n $queryToAppend .= 'isbn='.$properties['isbn'].' ';\n }\n // Subsequent Append\n else{\n $queryToAppend .= 'OR isbn='.$properties['isbn'].' ';\n }\n $counter++;\n }\n return $queryToAppend;\n }", "protected abstract function append($token);", "public function addValues($value) {\n return $this->_add(2, $value);\n }", "public function push($value)\r\n\t{\r\n\t}", "function SetValuePrepend( $k, $v ) { $this->_values[$k] = $v . $this->_values[$k]; }", "public function add($value)\n {\n $this->_elements[] = $value;\n return true;\n }", "public function setAppend($append);", "private function _sql_append($table) {\n\t\tif ($this->append) {\n\t\t\treturn \"OR $table.ID IN ({$this->append})\";\n\t\t}\n\t}", "public function append_result($result_append) {\n\t\t$this->_result .= $result_append;\n\t}", "public function appendFilter($filter)\n {\n return $this->addFilter($filter, self::CHAIN_APPEND);\n }", "public function filterOnAdd($data, Cond $cond = null)\n {\n return $this->filterData('add', (array)$data, $cond);\n }", "public function prependTo($value) {\n \n return $this->append($value);\n }", "public function addConditionToQuery($query, array $condition)\n\t{\n\t\t$value = trim(array_get($condition, 'value'));\n\t\t$field = array_get($condition, 'field');\n\t\t\n\t\tif ('xref_id' == $field) {\n\t\t\t$field = 'objectID';\n\t\t}\n\t\t\n\t\tif (array_get($condition, 'filter')) {\n\t\t\tif (is_numeric($value)) {\n\t\t\t\t$query['query']['numericFilters'][] = \"{$field}={$value}\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query['query']['facetFilters'][] = \"{$field}:{$value}\";\n\t\t\t}\n\t\t}\n\t\telse if (array_get($condition, 'lat')) {\n\t\t\t$query['query']['aroundLatLng'] = array_get($condition, 'lat') . ',' . array_get($condition, 'long');\n\t\t\t$query['query']['aroundRadius'] = array_get($condition, 'distance');\n\t\t}\n\t\telse {\n\t\t\t$query['terms'] .= ' ' . $value;\n\t\t\t\n\t\t\tif (!empty($field) && '*' !== $field) {\n\t\t\t\t$field = is_array($field) ? $field : array($field);\n\t\t\t\t$query['query']['restrictSearchableAttributes'] = implode(',', $field);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $query;\n\t}", "public function implode($value, $glue = '');", "public function append($region, $value)\n {\n return $this->appendOrPrepend($region, $value, 'append');\n }", "public function appendTo($value) {\n return $this->setProperty('appendTo', $value);\n }", "public function appendValues( $iColumn, $suffix, $value = null )\r\n {\r\n if (null == $value) {\r\n foreach ($this->data as $iRow => $rowData) {\r\n $this->data[$iRow][$iColumn] .= $suffix;\r\n }\r\n }\r\n else {\r\n foreach ($this->data as $iRow => $rowData) {\r\n if ($this->data[$iRow][$iColumn] === $value ) {\r\n $this->data[$iRow][$iColumn] .= $suffix;\r\n }\r\n }\r\n }\r\n }", "public function writeElementIf($condition, $element, $attribute = null, $value = null)\n {\n if ($condition == true) {\n if (is_null($attribute)) {\n $this->xmlWriter->writeElement($element, $value);\n } else {\n $this->xmlWriter->startElement($element);\n $this->xmlWriter->writeAttribute($attribute, $value);\n $this->xmlWriter->endElement();\n }\n }\n }", "function extend_url(&$url, $append)\n{\n if (($append != '') && (strpos($url, '?' . $append) === false) && (strpos($url, '&' . $append) === false)) {\n $url .= ((strpos($url, '?') === false) ? '?' : '&') . $append;\n }\n}", "public function addIfNotEmpty($xml, $tagName, $value) {\n if($value != null && $value != \"\") { \n $xml->addChild($tagName, $value);\n }\n }", "public function addToVariable($variable,$value){\n\n $var = $this->getSavedVariable($variable);\n\n if($var){\n $var = json_decode($var,true);\n if(is_array($var) AND !empty($var)){\n if(in_array($value,$var)){\n return false;\n } else {\n array_push($var,$value);\n }\n }\n }\n\n if(!is_array($var) OR empty($var)){\n $var = array();\n array_push($var,$value);\n }\n\n $var = json_encode($var);\n $this->saveVariable($variable,$var);\n\n }", "function acf_append_setting($name, $value)\n{\n}", "function addClause( $clause ) {\n\n\t\tglobal $whereClause;\n\n\t\t$whereClause .= ( $whereClause ) ? ' and ' : ' where ';\n\t\t$whereClause .= $clause;\n\n\t}", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "public function push($value) {\n\t\treturn $this->add($value);\n\t}", "public function append($var, $value) {\n\t\tif (isset($this->tpl_vars[$var])) {\n\t\t\tif (!is_array($this->tpl_vars[$var])) {\n\t\t\t\tsettype($this->tpl_vars[$var], 'array');\n\t\t\t}\n\t\t\t$this->tpl_vars[$var][] = $value;\n\t\t} else {\n\t\t\t$this->tpl_vars[$var] = array($value);\n\t\t}\n\t}", "public function append($key, $val)\n {\n $ret = $this->getConn()->append($key, $val) or $this->checkResultCode();\n return $ret;\n }", "function maybe( $value ) {\n\t\t$this->add(\"(\".$this->sanitize($value).\")?\");\n\t\treturn $this;\n\t}", "public function appendRechargeLimit($value)\n {\n return $this->append(self::RECHARGE_LIMIT, $value);\n }", "public function appendFilterSql($_select, $_backend)\r\n {\r\n \tif($this->_value){\r\n \t $db = Tinebase_Core::getDb();\r\n \t foreach($this->_value as $value){\r\n\t \t $correlationName = Tinebase_Record_Abstract::generateUID() . $value['cfId'] . 'cf';\r\n\t\r\n\t \t $_select->joinLeft(\r\n\t /* what */ array($correlationName => SQL_TABLE_PREFIX . 'customfield'), \r\n\t /* on */ $db->quoteIdentifier(\"{$correlationName}.record_id\") . \" = co.id AND \" \r\n\t . $db->quoteIdentifier(\"{$correlationName}.customfield_id\") . \" = \" . $db->quote($value['cfId']),\r\n\t /* select */ array());\r\n\t $_select->where($db->quoteInto($db->quoteIdentifier(\"{$correlationName}.value\") . $this->_opSqlMap[$this->_operator]['sqlop'], $value['value']));\r\n \t }\r\n \t\r\n // \techo $_select->assemble();\r\n// \t$filter = new Membership_Model_SoMemberFilter(array(), 'AND');\r\n//\t \t\r\n//\t \t$contactFilter = new Addressbook_Model_ContactFilter(array(\r\n//\t array('field' => 'customfield', 'operator' => 'equals', 'value' => $this->_value),\r\n//\t ));\r\n//\t $contactIds = Addressbook_Controller_Contact::getInstance()->search($contactFilter, NULL, FALSE, TRUE);\r\n//\t \r\n//\t $filter->addFilter(new Tinebase_Model_Filter_Id('contact_id', 'in', $contactIds));\r\n//\t \tTinebase_Backend_Sql_Filter_FilterGroup::appendFilters($_select, $filter, $_backend);\r\n \t}\r\n }", "function append($content) {\n\t\tif ($this->open('a')) {\n\t\t\treturn fwrite($this->f, $content);\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.6635248", "0.6097388", "0.5873732", "0.57035387", "0.5682717", "0.5667789", "0.56237364", "0.55909526", "0.5586592", "0.5492926", "0.5466513", "0.5396804", "0.5354344", "0.5344578", "0.5312921", "0.5307396", "0.53007483", "0.526229", "0.52469414", "0.5209624", "0.520457", "0.51994336", "0.5151364", "0.5134747", "0.5116189", "0.5113474", "0.51086146", "0.5102085", "0.5083433", "0.50596344", "0.505571", "0.5029883", "0.5026823", "0.50215125", "0.5020156", "0.5017642", "0.5008358", "0.5004649", "0.49966648", "0.49660462", "0.49561048", "0.4944062", "0.4937384", "0.4923314", "0.4902885", "0.489951", "0.48980194", "0.4893991", "0.4864353", "0.4858127", "0.48488528", "0.48477286", "0.4832493", "0.48289883", "0.48273522", "0.48273522", "0.48184624", "0.48173228", "0.4796796", "0.4788602", "0.47843885", "0.47705016", "0.47663963", "0.4765042", "0.47649765", "0.47649372", "0.47556484", "0.47556484", "0.47521123", "0.4751364", "0.47511783", "0.47482502", "0.47452992", "0.47440335", "0.47438848", "0.47430897", "0.47396258", "0.473935", "0.47308812", "0.47283575", "0.4727667", "0.4717872", "0.47057182", "0.47055563", "0.4704375", "0.4697123", "0.46968585", "0.4671368", "0.46618804", "0.4654897", "0.46452755", "0.46446863", "0.46424332", "0.4641864", "0.4636947", "0.4635385", "0.4633421", "0.46319136", "0.46261957", "0.460635" ]
0.48027804
58
Returns page title from passed values
function page_title($title, $separator = '-') { return "{$title} {$separator} "; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _GetPageTitle() {\n\t\t$page_title = 'Shirtswithstamps: T-Shirts with stamps for every ocassion';\n\t\t\n\t\tif (isset($_GET['DepartmentId']) && isset($_GET['CategoryId'])) {\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' &raquo; '.Catalog::GetCategoryName($_GET['CategoryId']).' - Shirts With Stamps';\n\t\t\t\n\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' &raquo; '.Catalog::GetCategoryName($_GET['CategoryId']).' - Page '.((int)$_GET['Page']).' - Shirtswithstamps';\t\n\t\t}\n\t\t\n\t\telseif (isset($_GET['DepartmentId'])) {\n\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' - Shirts With Stamps';\n\t\t\t\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t\t$page_title = Catalog::GetDepartmentName($_GET['DepartmentId']).' - Page '.((int)$_GET['Page']).' - Shirts With Stamps';\n\t\t}\n\t\t\n\t\telseif (isset($_GET['ProductId'])) {\n\t\t\t$page_title = Catalog::GetProductName($_GET['ProductId']).' - Shirts With Stamps';\n\t\t}\n\t\t\n\t\telseif (isset($_GET['SearchResults'])) {\n\t\t\t$page_title = '';\n\t\t\t\n\t\t\t// Display the search string\n\t\t\t$page_title = trim(str_replace('-', ' ', $_GET['SearchString'])).' (';\n\t\t\t\n\t\t\t// Display 'all-words' search or 'any-words' search\n\t\t\t$all_words = isset($_GET['AllWords']) ? $_GET['AllWords'] : 'off';\n\t\t\t\n\t\t\t$page_title .= (($all_words == 'on') ? 'all' : 'any').'-words search';\n\t\t\t\n\t\t\t// Display the page number\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page'] < 1))\n\t\t\t\t$page_title .= ', page '.((int)$_GET['Page']);\n\t\t\t\t\n\t\t\t$page_title .= ')';\n\t\t}\n\t\t\n\t\telse {\n\t\t\tif (isset($_GET['Page']) && ((int)$_GET['Page']) > 1)\n\t\t\t\t$page_title .= ' - Page '.((int)$_GET['Page']);\n\t\t}\n\t\t\n\t\treturn $page_title;\n\t}", "public function getTitle() {\n return (isset($this->titlePage)) ? $this->titlePage.' - '.Params::param('metainfo-titlePage') : Params::param('metainfo-titlePage');\n }", "public function getPageTitle(): string;", "function GetTitle() {\r\n global $PageTitle;\r\n if (isset($PageTitle)){echo $PageTitle;}else{echo 'BHM Accessories';}\r\n }", "protected function renderPageTitle() {}", "function getTitle(){\r\n\r\n \tglobal $pageTitle;\r\n \r\n if(isset($pageTitle)){\r\n\r\n \techo $pageTitle;\r\n\r\n }else{\r\n\r\n \techo 'Default';\r\n }\r\n\r\n }", "private static final function getPageTitle () {\r\n // Execute the <title tag> .tp file;\r\n $webHeaderString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_title.tp');\r\n return $webHeaderString->doToken ('[%TITLE_REPLACE_STRING%]',\r\n implode (_DCSP, ((self::$objPageTitleBackward->toInt () == 1) ? (self::$objPageTitle->arrayReverse ()->toArray ()) :\r\n self::$objPageTitle->toArray ())));\r\n }", "static public function getTitle() {\n\t\treturn self::$page_title;\n\t}", "function page_title()\n {\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n return ucwords(str_replace('-', ' ', $page));\n }", "function getTitle() ;", "function pageTitle(){\n\t\tglobal $pageTitle;\n\t\techo isset($pageTitle) ? $pageTitle : \"Default\";\n\t}", "abstract protected function getPageTitle(): string;", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }", "function page_title($title = ''){\r\n\tglobal $eqdkp, $user;\r\n\t$pt_prefix\t\t= (defined('IN_ADMIN')) ? $user->lang['admin_title_prefix'] : $user->lang['title_prefix'];\r\n\t$main_title\t\t= sprintf($pt_prefix, $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']);\r\n\treturn sanitize((( $title != '' ) ? $title.' - ' : '').$main_title, TAG);\r\n}", "protected function getPageTitle() {\r\n\t\treturn $this->pageTitle;\r\n\t}", "public function getPageTitle() {\r\n\t\t$config = $this->getConfig();\r\n return $config[\"title\"];\r\n }", "private function getPageTitle() {\n return $this->pageTitle;\n }", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "function get_page_title()\n {\n return $this->object->name;\n }", "public function get_page_title() {\n\n\t\tob_start();\n\n\t\t$this->output_page_title();\n\t\t$this->output_vendor_info();\n\n\t\treturn ob_get_clean();\n\t}", "function getTitle();", "function getTitle();", "function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}", "public function get_title();", "public function getPageTitle() {\n return $this->configuration['page_title'];\n }", "public function get_page_title() {\n return $this->get_string('page_title');\n }", "public function getTitle()\n {\n $list = $this->getPages();\n\n return isset($list[$this->page])\n ? $list[$this->page]\n : '';\n }", "public function getPageTitleInfo()\n {\n static $pageTitleInfo = null;\n\n if ( $pageTitleInfo ) {\n return $pageTitleInfo;\n }\n $translator = $this->view->translator;\n $input = $this->view->input;\n \n $pageConfig = $this->view->pageConfig;\n $titleChunks = array();\n\n if ($pageConfig->useTitlePrefix() ) {\n $titleChunks[] = $translator ? $translator->_($pageConfig->getTitlePrefix()) : $pageConfig->getTitlePrefix();\n }\n\n $name = $pageConfig->getTitle(); \n $titleChunks[] = $translator ? $translator->_($name) : $name;\n\n $titleChunks = array_reverse($titleChunks);\n $pageTitleInfo = join( $titleChunks, $pageConfig->getTitlePrefixDelimiter() );\n return $pageTitleInfo;\n }", "abstract protected function getTitle();", "public function getPageTitle()\n {\n return $this->page_title;\n }", "function get_title()\n {\n }", "function gettitle() {\n\n\t\tglobal $pagetiltle;\n\n\t\tif (isset($pagetiltle)) {\n\n\t\t\techo $pagetiltle;\n\t\t} else {\n\n\t\t\techo lang('DEFAULT');\n\t\t}\n\t}", "public function getPageTitle() {\n\t\treturn $this->pageTitle;\n\t}", "function show_title()\r\n{\r\n\tglobal $WebPagesList,$CurrentActivePage;\r\n\techo getTitle( $CurrentActivePage );\r\n}", "public function title() {\n\t\tif ( ! is_object( $this->object ) ) {\n\t\t\treturn esc_html__( 'Page not found', 'nhg-seo' );\n\t\t}\n\n\t\t$title = Strategy::get_from_meta( 'post', $this->object->ID, $this->object, 'title' );\n\t\tif ( \\is_string( $title ) && '' !== $title ) {\n\t\t\treturn $title;\n\t\t}\n\n\t\treturn Strategy::get_title( 'post', $this->object->post_type, $this->object );\n\t}", "public function getPageTitle()\n {\n return parent::getPageTitle() ?:\n (\n isset($this->get['pages']) ? $this->tableAdmin->translate('Pages') :\n (\n isset($this->get['products']) ? $this->tableAdmin->translate('Products') :\n (\n isset($this->get['urls']) ? $this->tableAdmin->translate('URL') :\n ''\n )\n )\n );\n }", "public abstract function getTitle();", "function setTitle() {\n global $pageTitle;\n\n $pageTitle = isset($pageTitle) ? $pageTitle : 'Default' ;\n echo $pageTitle;\n }", "public static function title();", "public function getTitle() {\n return \\Drupal::config('taxonomy_facets.settings')->get('page_title');\n }", "function pageTitle()\n{\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n echo ucwords(str_replace('-', ' ', $page));\n}", "function getPageTitle() {\n\t\tglobal $current_page_title;\n\t\t\n\t\treturn $current_page_title;\n\t}", "public static function title($page_title = false)\r\n\t{\r\n\t\t$title = '';\r\n\t\tif($page_title)\r\n\t\t{\r\n\t\t\t$title = $page_title . ' | ';\r\n\t\t}\r\n\t\treturn $title . Kohana::$config->load('site')->get('name');\r\n\t}", "public static function title($page_title = false)\r\n\t{\r\n\t\t$title = '';\r\n\t\tif($page_title)\r\n\t\t{\r\n\t\t\t$title = $page_title . ' | ';\r\n\t\t}\r\n\t\treturn $title . Kohana::$config->load('site')->get('name');\r\n\t}", "function printPageTitle($title)\r\n {\r\n return \"<div class='pageTitle'>\".$title.\"</div>\";\r\n }", "function getPageTitle() {\n return $this->title;\n }", "function gettitle(){\n global $pagetitle;\n if(isset($pagetitle)){\n echo $pagetitle;\n }else{\n echo 'Default';\n }\n }", "function getHtmlTitle()\n\t{\n\t\t// set up the page title\n\t\tif ($this->isContentPage) {\n\t\t\t\n\t\t\tif (isset($this->map[$this->area]['show'][$this->page]) &&\n\t\t\t\t$this->map[$this->area]['show'][$this->page] != $this->page) {\n\t\t\t\t// use the 'show' text\n\t\t\t\t$htmlTitle = $this->map[$this->area]['show'][$this->page];\n\t\t\t} else {\n\t\t\t\t// if the nav title and the page name are the same,\n\t\t\t\t// show a hierarchy instead.\n\t\t\t\t// for content pages, the name is based on the\n\t\t\t\t// area and page-path\n\t\t\t\t$htmlTitle = $this->area;\n\t\t\t\t\n\t\t\t\tif (count($this->path)) {\n\t\t\t\t\t$htmlTitle .= ' -- ' .\n\t\t\t\t\timplode(' : ', $this->path);\n\t\t\t\t} else {\n\t\t\t\t\t$htmlTitle .= ' : ' . $this->page;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\t// for non-content (administrative) pages, the\n\t\t\t// name is based on the script name.\n\t\t\t$htmlTitle = basename(strip_tags($_SERVER['SCRIPT_NAME']));\n\t\t\t$htmlTitle = str_replace('.php', '', $htmlTitle);\n\t\t\t$htmlTitle = str_replace('_', ' ', $htmlTitle);\n\t\t\t$htmlTitle = ucwords($htmlTitle);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $htmlTitle;\n\t}", "abstract public function getTitle();", "abstract public function getTitle();", "abstract public function getTitle();", "function page_title()\n{\n $page = isset($_GET['page']) ? htmlspecialchars($_GET['page']) : 'Home';\n\n echo ucwords(str_replace('-', ' ', $page));\n}", "public static function get_page_title() {\n\t\t// Set the current page of the WP query since it's used by SEO plugins.\n\t\tglobal $wp_query, $page;\n\t\t$oldPage = $wp_query->get( 'page' );\n\t\tif ( $page > 1 ) {\n\t\t\t$wp_query->set( 'page', $page );\n\t\t} else {\n\t\t\t$wp_query->set( 'page', null );\n\t\t}\n\n\t\t// Get the title.\n\t\t$title = self::get_page_titleHelper();\n\t\t$title = html_entity_decode( $title, ENT_QUOTES, 'UTF-8' );\n\n\t\t// Set back the current page.\n\t\t$wp_query->set( 'page', $oldPage );\n\n\t\t// Return the title.\n\t\treturn $title;\n\t}", "private function getTitle() {\n\t\tif ($_GET['doc'] == 'index') {\n\t\t\treturn $this->config['title'];\n\t\t}\n\t\treturn $this->texy->headingModule->title . ' - ' . $this->config['title'];\n\t}", "public function pageTitle($title = '') {\n $page_title = '';\n if (empty($title)) {\n $page_title .='Ticketchai | Home ';\n } else {\n $page_title .=$title;\n }\n\n return \"<title>\" . $page_title . \"</title>\";\n }", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "function set_title() {\n \tglobal $pageTitle;\n \tif (isset($pageTitle))\n \t\techo 'Tanqeeb | ' . $pageTitle;\n \telse\n \t\techo 'Tanqeeb';\n}", "function od_set_page_title($orig_title) {\n\t\treturn \"Map | \"; // set the page title (could be improved, eg based on filters. Might be something the user wants to set\n\t}", "function getDataTitle($data)\n{\n\t\t$dataTitle = getData($data, \"Page/Title\");\n\t\treturn $dataTitle[0];\n}", "function getTitle() {\n \n global $pageTitle;\n if(isset($pageTitle)){\n echo $pageTitle;\n } else {\n echo 'Default';\n }\n}", "private static function get_page_titleHelper() {\n\t\tglobal $wpseo_front;\n\t\tif (\n\t\t\tisset( $wpseo_front ) &&\n\t\t\tmethod_exists( $wpseo_front, 'title' )\n\t\t) {\n\t\t\treturn $wpseo_front->title( '', false );\n\t\t}\n\n\t\t// If the SEO Ultimate plugin is active and compatible.\n\t\tglobal $seo_ultimate;\n\t\tif (\n\t\t\tisset( $seo_ultimate ) &&\n\t\t\tproperty_exists( $seo_ultimate, 'modules' ) &&\n\t\t\tisset( $seo_ultimate->modules['titles'] ) &&\n\t\t\tmethod_exists( $seo_ultimate->modules['titles'], 'get_title' )\n\t\t) {\n\t\t\t@$title = $seo_ultimate->modules['titles']->get_title();\n\n\t\t\treturn $title;\n\t\t}\n\n\t\t// If all else fails, return the standard WordPress title. Unfortunately, most theme hard-code their <title> tag.\n\t\treturn wp_title( '', false );\n\t}", "function site_title( $nd = ' - ' ) {\r\n\r\n\tglobal $db;\t\r\n\t\r\n\tif( isset( $_GET['page'] ) ) {\r\n\t\t$link = $_GET['page'];\r\n\t} else {\r\n\t\t$link = 'home-page';\t\r\n\t}\t\r\n\r\n\t$result = mysql_query(\"SELECT title FROM pages WHERE link='$link'\");\r\n\tif( !$result ) {\r\n\t\t$title = 'Not Found';\r\n\t} else {\r\n\t\t$page = mysql_fetch_array( $result );\r\n\t\t$title = $page['title'];\t\r\n\t}\r\n\r\n\techo SITENAME . $nd . $title;\t\r\n\t\r\n}", "public function title();", "public function title();", "protected function view_getPageTitle() {\n return 'HalloPizza';\n }", "function get_admin_page_title()\n {\n }", "public function adaptPageTitle(&$title)\n {}", "function get_title() {\n\t\treturn $this->settings['title'];\n\t}", "public function setPageTitle($page_name);", "public function setPageTitle($page_name);", "public function getTitle(): string\n {\n return I18N_PAGES;\n }", "function getTitle(){\n global $pageTitle;\n if(isset($pageTitle)) echo $pageTitle;\n else echo 'Default';\n\n}", "function getTitle() {\n\t\tif($this->title) {\n\t\t\treturn $this->title;\n\t\t}\n\t\telse if(Session::getValue(\"nav_sindex\")) {\n\t\t\t$query = new Query();\n\t\t\tif($query->sql(\"SELECT name FROM \".UT_NAV.\" WHERE sindex = '\".Session::getValue(\"sindex\").\"'\")) {\n\t\t\t\treturn $query->getQueryResult(0, \"name\");\n\t\t\t}\n\t\t}\n\t\treturn SITE_NAME;\n\t}", "public function getTitle(){\n\n $title = $this->getField('title', '');\n if(empty($title)){ return $title; }//if\n\n if($title_prefix = $this->getTitlePrefix()){\n $title = $title_prefix.$this->getTitleSep().$title;\n }//if\n\n if($title_postfix = $this->getTitlePostfix()){\n $title .= $this->getTitleSep().$title_postfix;\n }//if\n\n return $title;\n\n }", "function jfk2013_page_title() {\r\n\techo get_jfk2013_page_title();\r\n}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}", "public function getTitle() {}" ]
[ "0.7869759", "0.76231176", "0.7594234", "0.758278", "0.7578267", "0.75586426", "0.7556905", "0.7524355", "0.7510254", "0.750972", "0.74869823", "0.7486178", "0.7485864", "0.74839693", "0.7469107", "0.7439949", "0.74377686", "0.74294674", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7361788", "0.7359966", "0.7350371", "0.73427594", "0.73427594", "0.73416746", "0.7341408", "0.73152554", "0.73141724", "0.7301109", "0.72956", "0.72605467", "0.7244089", "0.7236088", "0.7232063", "0.72222316", "0.72201663", "0.71924603", "0.71639055", "0.71635914", "0.7151781", "0.7148343", "0.712637", "0.7125856", "0.71217877", "0.71202356", "0.71202356", "0.71195334", "0.71058124", "0.7096288", "0.7091937", "0.70831484", "0.70831484", "0.70831484", "0.7077438", "0.707663", "0.7069928", "0.70213425", "0.7021056", "0.70099074", "0.7003251", "0.6988837", "0.6981065", "0.69768214", "0.69751936", "0.69630957", "0.69630957", "0.6961269", "0.6959671", "0.69543546", "0.69304514", "0.6920677", "0.6920677", "0.6916331", "0.6909675", "0.69092745", "0.68975735", "0.68927044", "0.6886467", "0.68856484", "0.68856484", "0.68856484", "0.68856484", "0.68856484", "0.68856484", "0.68856484", "0.68856484", "0.68856484" ]
0.70793283
66
Schrijft Bestelregels weg in DB bestelregel
public function createBestelRegel($BestelID, $ProductID, $Aantal, $Prijs) { $sql = "INSERT INTO bestelregel (BestelID, ProductID, Aantal, Prijs) VALUES (".$BestelID.", ".$ProductID.", ".$Aantal.", ".$Prijs.")"; $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD); $dbh->exec($sql); $dbh=NULL; return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gesuchter_wert_sql($abfrage,$gesuchte_spalte) {\n\t$mysqli=MyDatabase();\t\n\tif ($result=$mysqli->query($abfrage)) {\n\t\twhile ($row=$result->fetch_object()) {\n\t\t\t$gesuchter_wert=$row->$gesuchte_spalte;\n\t\t}\n\t}\t\n\tif (!isset($gesuchter_wert)) {$gesuchter_wert=0;}\n\treturn $gesuchter_wert;\n}", "function gesuchtes_feld($angabe,$tabelle,$gegebene_spalte,$gesuchte_spalte) {\n\t$mysqli=MyDatabase();\n\t$abfrage=\"SELECT `$gesuchte_spalte` FROM `$tabelle` WHERE `$gegebene_spalte`='$angabe'\";\n\tif ($result=$mysqli->query($abfrage)) {\n\t\twhile ($row=$result->fetch_object()) {\n\t\t\t$gesuchter_wert=$row->$gesuchte_spalte;\n\t\t\t}\n\t\t}\t\n\tif (!isset($gesuchter_wert)) {$gesuchter_wert=0;}\n\treturn $gesuchter_wert;\n}", "function get_bestelling_nafg($conn) // vraag tafels op die niet afgehandeld zijn\n\t{\n\t\t$query = \"SELECT tafel,product,aantal FROM bestelling WHERE afgehandeld=0 \";\n\t\treturn mysqli_query($conn,$query);\n\t}", "function get_bestelling_nbet($conn) // vraag tafels op die niet afgehandeld zijn\n\t{\n\t\t$query = \"SELECT tafel,product,aantal FROM bestelling WHERE betaald=0 \";\n\t\treturn mysqli_query($conn,$query);\n\t}", "function sviRezultati() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM tabela t join korisnik k on t.korisnikID = k.korisnikID order by t.brojPoena desc';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "function LoadBestellungStandardwerte($id,$adresse)\n {\n $arr = $this->app->DB->SelectArr(\"SELECT * FROM adresse WHERE id='$adresse' LIMIT 1\");\n $field = array('name','vorname','abteilung','unterabteilung','strasse','adresszusatz','plz','ort','land','ustid','email','telefon','telefax','lieferantennummer');\n foreach($field as $key=>$value)\n {\n $this->app->Secure->POST[$value] = $arr[0][$value];\n $uparr[$value] = $arr[0][$value];\n }\n $this->app->DB->UpdateArr(\"bestellung\",$id,\"id\",$uparr);\n $uparr=\"\";\n\n //liefernantenvorlage\n $arr = $this->app->DB->SelectArr(\"SELECT * FROM lieferantvorlage WHERE adresse='$adresse' LIMIT 1\");\n $field = array('kundennummer','zahlungsweise','zahlungszieltage','zahlungszieltageskonto','zahlungszielskonto','versandart');\n foreach($field as $key=>$value)\n {\n //$uparr[$value] = $arr[0][$value];\n $this->app->Secure->POST[$value] = $arr[0][$value];\n }\n //$this->app->DB->UpdateArr(\"bestellung\",$id,\"id\",$uparr);\n\n }", "function gesuchter_wert($id,$tabelle,$gesuchte_spalte) {\n\t$mysqli=MyDatabase();\n\t\tif ($id!=0) {\n\t\t\t$abfrage=\"SELECT `$gesuchte_spalte` FROM `$tabelle` WHERE `ID`=$id\";\n\t\t\t#echo \"Funktion gesuchter_wert bildet SQL-Befehl - \".$abfrage;\n\t\t\tif ($result=$mysqli->query($abfrage)) {\n\t\t\t\twhile ($row=$result->fetch_object()) {\n\t\t\t\t\t$gesuchter_wert=$row->$gesuchte_spalte;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t\telse {\n\t\t\t$gesuchter_wert=\"N.N.\";\n\t\t}\n\tif (!isset($gesuchter_wert)) {$gesuchter_wert=0;}\n\treturn $gesuchter_wert;\n}", "function insert_into_bereich($table, $konvertierung_id, $user_id) {\n\t\t# Based on XPlanung 5.0.1\n\t\t# For XP_Plan\n\t\t$sql = \"INSERT INTO xplan_gml.\" . $table . \"(gml_id, nummer, name, bedeutung, detailliertebedeutung, erstellungsmassstab, geltungsbereich, user_id, konvertierung_id, rasterbasis, \";\n\t\tswitch ($table) {\n\t\t\tcase 'so_bereich' : {\n\t\t\t} break;\n\t\t\tcase 'rp_bereich' : {\n\t\t\t\t$sql .= \"versionbrog, versionbrogtext, versionlplg, versionlplgtext, geltungsmassstab, \";\n\t\t\t} break;\n\t\t\tdefault : {\n\t\t\t\t# Default = BP_Plan and FP_Plan (equivalent Bereich-attribute in XPlanung 5.0.1)\n\t\t\t\t$sql .= \"versionbaunvodatum, versionbaugbtext, versionsonstrechtsgrundlagetext, versionbaunvotext, versionsonstrechtsgrundlagedatum, versionbaugbdatum, \";\n\t\t\t};\n\t\t}\n\n\t\t$sql .= \"\n\t\t\t\tgehoertzuplan)\n\t\t\tSELECT\n\t\t\t\ttrim(leading 'Gml_' FROM (trim(leading 'GML_' FROM gmlas.id)))::text::uuid AS gml_id,\n\t\t\t\tgmlas.nummer AS nummer,\n\t\t\t\tgmlas.xplan_name AS name,\n\t\t\t\tgmlas.bedeutung::xplan_gml.xp_bedeutungenbereich AS bedeutung,\n\t\t\t\tgmlas.detailliertebedeutung AS detailliertebedeutung,\n\t\t\t\tgmlas.erstellungsmassstab AS erstellungsmassstab,\n\t\t\t\tST_Multi(ST_ForceRHR(st_transform(gmlas.geltungsbereich,\". $this->epsg .\"))) AS geltungsbereich,\n\t\t\t\t\" . $user_id . \" AS user_id,\n\t\t\t\t\" . $konvertierung_id . \" AS konvertierung_id,\n\t\t\t\ttrim(leading '#gml_' FROM lower(gmlas.rasterbasis_href)) AS rasterbasis,\";\n\n\t\tswitch ($table) {\n\t\t\tcase 'so_bereich' : {\n\t\t\t} break;\n\t\t\tcase 'rp_bereich' : {\n\t\t\t\t$sql .= \"\n\t\t\t\tgmlas.versionbrog AS versionbrog,\n\t\t\t\tgmlas.versionbrogtext AS versionbrogtext,\n\t\t\t\tgmlas.versionlplg AS versionlplg,\n\t\t\t\tgmlas.versionlplgtext As versionlplgtext,\n\t\t\t\tgmlas.geltungsmassstab AS geltungsmassstab,\";\n\t\t\t} break;\n\t\t\tdefault : {\n\t\t\t\t# Default = BP_Plan and FP_Plan (equivalent Bereich-attribute in XPlanung 5.0.1)\n\t\t\t\t$sql .= \"\n\t\t\t\tgmlas.versionbaunvodatum AS versionbaunvodatum,\n\t\t\t\tgmlas.versionbaugbtext AS versionbaugbtext,\n\t\t\t\tgmlas.versionsonstrechtsgrundlagetext AS versionsonstrechtsgrundlagetext,\n\t\t\t\tgmlas.versionbaunvotext AS versionbaunvotext,\n\t\t\t\tgmlas.versionsonstrechtsgrundlagedatum AS versionsonstrechtsgrundlagedatum,\n\t\t\t\tgmlas.versionbaugbdatum AS versionbaugbdatum,\";\n\t\t\t};\n\t\t}\n\t\t// string needs to be lowered both to simplify cutting #gml_ in all forms and\n\t\t// because uuid (e.g. in gml_id of the associated plan) is always lowercase when cast to text\n\t\t// will take first plan encountered in gmlas-schema if bereich id is not set (or could not be read by ogr)\n\t\t$sql .= \"\n\t\t\t\tCASE\n\t\t\t\t\tWHEN gmlas.gehoertzuplan_href IS NOT NULL THEN trim(leading '#gml_' FROM lower(gmlas.gehoertzuplan_href))::uuid\n\t\t\t\t\tELSE trim(leading '#gml_' FROM lower((SELECT DISTINCT id FROM \" . $this->gmlas_schema . \".\" . substr($table,0,3) . \"plan LIMIT 1)))::uuid\n\t\t\t\tEND AS gehoertzuplan\n\t\t\tFROM\n\t\t\t\t\" . $this->gmlas_schema . \".\" . $table . \" gmlas\n\t\t\t;\";\n\t\t# echo $sql;\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_assoc($ret[1]);\n\t\treturn $result;\n\t}", "function get_openstaandeDossiers_namen() {\n $result = $this->db->query(\"SELECT * from islp.view_openstaande_dossiers_hitparade order by opsteller \");\n if (!$result) {\n $this->error(\"Check query in get_openstaandeDossiers_namen in klasse functioneelBeheer_model\");\n }\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "function get_diensten() {\n $result = $this->db->query(\"SELECT distinct dienst from islp.view_openstaande_dossiers order by dienst\");\n if (!$result) {\n $this->error(\"Check query in get_diensten in klasse functioneelBeheer_model\");\n }\n while ($row = $result->fetch_assoc()) {\n if (empty($row['dienst'])) {\n $row['dienst'] = '_geen dienst';\n }\n $rows[] = $row;\n }\n return $rows;\n }", "function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}", "function afficherreservation(){\n\t\t$sql=\"select hotel.nom hotel ,hotel.ville,reservation.* from (reservation inner join hotel on reservation.idhotel=hotel.id) order by idres \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function obtenerViajesplus();", "function afficherRendezvouss(){\n\t\t$sql=\"SElECT * From rendezvous\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function ausgabe_gespeicherte_elemente($spalte_zur_ausgabe,$tabelle,$spalte_wert,$vergleichswert) {\n\t$mysqli=MyDatabase();\n\t$abfrage=\"SELECT `$spalte_zur_ausgabe` FROM $tabelle WHERE `$spalte_wert` LIKE $vergleichswert LIMIT 1\";\n\tif ($result=$mysqli->query($abfrage)) {\n\t\twhile ($row=$result->fetch_object()) {\n\t\t\t$ausgabe=$row->$spalte_zur_ausgabe;\n\t\t\treturn $ausgabe;\n\t\t\t}\n\t\t}\n\t}", "function trier(){\r\n \r\n $db = config::getConnexion();\r\n $sql=\"SElECT * From livreur ORDER BY nom\";\r\n\r\n try{\r\n $req=$db->prepare($sql);\r\n $req->execute();\r\n $livreur= $req->fetchALL(PDO::FETCH_OBJ);\r\n return $livreur;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "abstract function getSQL();", "function afficherhotels(){\n\t\t$sql=\"SElECT * From hotel order by id\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function absender_bestimmen($absender,$db){\n$query1=\"select * from user\";\n\t$antwort1=$db->query($query1);\n\t$antwort1=array_bildung($antwort1);\n\t\n\t$i=0;\n\tforeach($absender[Absender] as $name => $inhalt){\n\tif($inhalt==0){\n\t\t$absender[Absender][$i]=\"Information an Alle !\";\n\t}\n\t\n\t\t$k=0;\n\t\tforeach($antwort1[id] as $name1 => $inhalt1){\n\t\t\tif($inhalt==$inhalt1){\n\t\t\t\t$absender[Absender][$i]=$antwort1[Name][$k].\"&nbsp;&nbsp;\".$antwort1[Vorname][$k].\"&nbsp;&nbsp;- \".$antwort1[Bemerkung][$k].\" -\";\n\t\t\t}\n\t\t$k++;\n\t\t}\n\t$i++;\n\t}\n\treturn $absender;\n}", "public function getSchvaleneClanky(){\n $sth = $this->db->prepare(\"SELECT * FROM PRISPEVKY\n WHERE stav LIKE 'schváleno'\");\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }", "function llamarRegistrosMySQLPlaneServicios() {\n\t\t\tglobal $res;\n\t\t\t$cnx = conectar_mysql(\"Salud\");\n\t\t\t$cons = \"SELECT * FROM Salud.EPS ORDER BY AutoId ASC\";\n\t\t\t$res = mysql_query($cons);\n\t\t\treturn $res; \n\t\t\n\t\t}", "public function change()\n {\n\t$import_fossils = $this->execute (\n\t\"INSERT INTO fossil (id, submission_date, paleo_decision, latitude, longitude, title, description, visitor_id, rationale) VALUES\n\n\t(1,'2015-07-02',1,40.781979,-73.972014,'Shark tooth','Shark tooth',101,'Pleistocene Carcharodon carcharias'),\n(2,'2015-07-02',1,40.781979,-73.972014,'Presumably fossil','Presumably fossil',102,'Foraminiferal limestone'),\n(3,'2015-07-03',1,40.781979,-73.972014,'Maybe T. rex bone','Maybe T. rex bone',103,'Fossil bone chunk'),\n(4,'2015-07-03',2,40.781979,-73.972014,'Fossil?','Fossil?',104,'Probably mineral'),\n(5,'2015-07-04',1,40.781979,-73.972014,'Fossils','Fossils',105,'Fossils'),\n(6,'2015-07-05',1,40.781979,-73.972014,'Presumably fossil','Presumably fossil',106,'Probable Favosites and a rock'),\n(7,'2015-07-06',1,40.781979,-73.972014,'Fossil rib with human workmanship','Fossil rib with human workmanship',107,'Probable fossil bone with possible much-later human workmanship'),\n(8,'2015-07-06',1,40.781979,-73.972014,'Fossil','Fossil',108,'Trimerus cephalon'),\n(9,'2015-07-07',2,40.781979,-73.972014,'I guess \\'fossil\\'','I guess \\'fossil\\'',109,'Rocks'),\n(10,'2015-07-08',2,40.781979,-73.972014,'Fossil','Fossil',110,'Rock'),\n(11,'2015-07-11',1,40.781979,-73.972014,'Bone','Bone',111,'Horse radioulna and femur fragments, possibly as old as Ice Age'),\n(12,'2015-07-12',1,40.781979,-73.972014,'Presumably fossil','Presumably fossil',112,'Bryozoan hash'),\n(13,'2015-07-12',1,40.781979,-73.972014,'He was told fish but doubts it','He was told fish but doubts it',113,'Gastropods'),\n(14,'2015-07-13',1,40.781979,-73.972014,'Fossil worm tubes and a kind of sea creature, maybe a snail or shell fossil or something else','Fossil worm tubes and a kind of sea creature, maybe a snail or shell fossil or something else',114,'Worm tubes/plant bits/or nothing and a fossil snail'),\n(15,'2015-07-16',2,40.781979,-73.972014,'Fossil','Fossil',115,'Rock'),\n(16,'2015-07-18',2,40.781979,-73.972014,'Fossil','Fossil',116,'Limonite'),\n(17,'2015-07-21',1,40.781979,-73.972014,'Fossil coral or fossil beehive','Fossil coral or fossil beehive',117,'Fossil coral'),\n(18,'2015-07-21',2,40.781979,-73.972014,'Fossilized egg','Fossilized egg',118,'Rock'),\n(19,'2015-07-24',2,40.781979,-73.972014,'Fossil dinosaur egg','Fossil dinosaur egg',119,'Rock'),\n(20,'2015-07-24',2,40.781979,-73.972014,'Octopus Fossil','Octopus Fossil',120,'Calcite cave formation'),\n(21,'2015-07-25',2,40.781979,-73.972014,'Possible fossil egg and tooth','Possible fossil egg and tooth',121,'Probable weathered limestone and ironstone nodule'),\n(22,'2015-07-26',2,40.781979,-73.972014,'Trilobyte','Trilobyte',122,'Fake'),\n(23,'2015-07-26',1,40.781979,-73.972014,'Fossil of maybe a fish, maybe a vertebrate [vertebra?] or a shoulder blade','Fossil of maybe a fish, maybe a vertebrate [vertebra?] or a shoulder blade',123,'Probable fossil marine mammal bone fragment'),\n(24,'2015-07-26',2,40.781979,-73.972014,'Presumably fossil','Presumably fossil',124,'Possible stromatolite, oncolite, or thrombolite'),\n(25,'2015-07-27',1,40.781979,-73.972014,'Possible fossil bone','Possible fossil bone',125,'Fossil bone, maybe turtle'),\n(26,'2015-07-27',2,40.781979,-73.972014,'Possible fossil','Possible fossil',126,'Very odd rock'),\n(27,'2015-07-29',2,40.781979,-73.972014,'Fossil head','Fossil head',127,'Rock'),\n(28,'2015-07-30',2,40.781979,-73.972014,'Fossil egg or septarian concretion','Fossil egg or septarian concretion',128,'Rock or possibly degraded rubber/plastic'),\n(29,'2015-07-31',1,40.781979,-73.972014,'Fossil vertebrates, arthropods and plants (several kinds of fishes, angiosperms, auroch, \ncycads, grasses, and reptile from L. Dev., Perm., Triassic, L. Cret., Paleocene, Miocene, Paleogene, Quaternary','Fossil vertebrates, arthropods and plants (several kinds of fishes, angiosperms, auroch, \ncycads, grasses, and reptile from L. Dev., Perm., Triassic, L. Cret., Paleocene, Miocene, Paleogene, Quaternary',129,'IDs are probably correct'),\n(30,'2015-08-01',2,40.781979,-73.972014,'Dinosaur eggs','Dinosaur eggs',130,'Chert concretions'),\n(31,'2015-08-02',1,40.781979,-73.972014,'Fossil plant','Fossil plant',131,'Calamites pith cast'),\n(32,'2015-08-02',2,40.781979,-73.972014,'Fossil tooth embedded in rock','Fossil tooth embedded in rock',132,'Rock'),\n(33,'2015-08-03',1,40.781979,-73.972014,'Fossil','Fossil',133,'Probably fossil'),\n(34,'2015-08-03',2,40.781979,-73.972014,'Possible fossilized skull of a small of the \\\"preserved flesh\\\" type','Possible fossilized skull of a small of the \\\"preserved flesh\\\" type',134,'Rock'),\n(35,'2015-08-04',1,40.781979,-73.972014,'Fossils','Fossils',135,'Mostly brachiopods'),\n(36,'2015-08-04',1,40.781979,-73.972014,'Fossil','Fossil',136,'Stigmarian rhizomorph'),\n(37,'2015-08-05',1,40.781979,-73.972014,'Possible fossil impressions of a scaly, reptilian type texture, similar to a snake\\'s skin','Possible fossil impressions of a scaly, reptilian type texture, similar to a snake\\'s skin',137,'Fossil lycopsids'),\n(38,'2015-08-09',3,40.781979,-73.972014,'Possible fossil insect or maybe fish or crab','Possible fossil insect or maybe fish or crab',138,'Possible olenellid trilobite'),\n(39,'2015-08-10',3,40.781979,-73.972014,'Presumable fossil skeleton','Presumable fossil skeleton',139,'Possible ammonite'),\n(40,'2015-08-11',1,40.781979,-73.972014,'Fossil tooth or coral','Fossil tooth or coral',140,'Mostly fossil crinoids with bivalve or brachiopod'),\n(41,'2015-08-12',2,40.781979,-73.972014,'Fossil dinosaur egg','Fossil dinosaur egg',141,'Glassy nodule'),\n(42,'2015-08-12',1,40.781979,-73.972014,'Possible fossil','Possible fossil',142,'Mammoth molar'),\n(43,'2015-08-13',2,40.781979,-73.972014,'Fossil front toe or claw from early crocodillian or turtle','Fossil front toe or claw from early crocodillian or turtle',143,'Flint nodule'),\n(44,'2015-08-14',1,40.781979,-73.972014,'Possible fossil','Possible fossil',144,'Fossil echinoid mold'),\n(45,'2015-08-15',2,40.781979,-73.972014,'Possible fossil fungus','Possible fossil fungus',145,'Probable calcite cave formation'),\n(46,'2015-08-16',3,40.781979,-73.972014,'Fossils','Fossils',146,'Branching bryozoan and un known'),\n(47,'2015-08-16',2,40.781979,-73.972014,'Presumably fossil','Presumably fossil',147,'Horn coral'),\n(48,'2015-08-17',2,40.781979,-73.972014,'Possible fossil on possible fossil bone','Possible fossil on possible fossil bone',148,'Waterworn piece of coral with attached weathered worm tube'),\n(49,'2015-08-18',1,40.781979,-73.972014,'Fossil','Fossil',149,'Fossil mammal calcaneum'),\n(50,'2015-08-18',2,40.781979,-73.972014,'Presumably fossil','Presumably fossil',150,'Probable mineral growth'),\n(51,'2015-08-19',2,40.781979,-73.972014,'Fossil whale','Fossil whale',151,'Modern sperm whale'),\n(52,'2015-08-20',1,40.781979,-73.972014,'Trace fossils','Trace fossils',152,'Trace fossils or non-organismal sedimentary features'),\n(53,'2015-08-20',2,40.781979,-73.972014,'“Embryo of a spinosauridae” and fossil egg','“Embryo of a spinosauridae” and fossil egg',153,'Rocks'),\n(54,'2015-08-20',2,40.781979,-73.972014,'Fossil','Fossil',154,'Probably just a rock'),\n(55,'2015-08-21',2,40.781979,-73.972014,'Fossil','Fossil',155,'Rock'),\n(56,'2015-08-21',3,40.781979,-73.972014,'Fossils','Fossils',156,'Probable partial ammonite, unidentifiable fossil, chert'),\n(57,'2015-08-21',2,40.781979,-73.972014,'Marine turtle fossil','Marine turtle fossil',157,'Rock'),\n(58,'2015-08-24',1,40.781979,-73.972014,'Plateosaurus','Plateosaurus',158,'Fossil cave bear finger'),\n(59,'2015-08-25',3,40.781979,-73.972014,'Possible fossil','Possible fossil',159,'Possible trace fossil'),\n(60,'2015-08-26',2,40.781979,-73.972014,'Possible fossilised [sic] egg','Possible fossilised [sic] egg',160,'Mineral accumulation'),\n(61,'2015-08-27',2,40.781979,-73.972014,'Possible dinosaur fossil','Possible dinosaur fossil',161,'Rock'),\n(62,'2015-08-27',1,40.781979,-73.972014,'Fossils','Fossils',162,'Calamites, Favosites, horn coral, colonial coral, other coral or bryozoan'),\n(63,'2015-08-28',1,40.781979,-73.972014,'Possible fossil','Possible fossil',163,'Vinctifer comptoni'),\n(64,'2015-08-29',1,40.781979,-73.972014,'Fossil marine bone','Fossil marine bone',164,'Fossil fish tooth'),\n(65,'2015-08-29',3,40.781979,-73.972014,'Possible fossil bone','Possible fossil bone',165,'Probable rock, if a fossil: maybe a burrow'),\n(66,'2015-08-30',3,40.781979,-73.972014,'Fossil','Fossil',166,'Probable fossil, maybe fish or plant'),\n(67,'2015-08-31',3,40.781979,-73.972014,'Fossil','Fossil',167,'Possible fossil'),\n(68,'2015-09-01',2,40.781979,-73.972014,'Fossilized coral','Fossilized coral',168,'Rock'),\n(69,'2015-09-03',2,40.781979,-73.972014,'Rather large bone (presumably not fossil)','Rather large bone (presumably not fossil)',169,'Tuna bone'),\n(70,'2015-09-03',1,40.781979,-73.972014,'Fossils','Fossils',170,'Productid brachiopod, unknown impression, Syringopora-like coral, horn coral'),\n(71,'2015-09-03',1,40.781979,-73.972014,'Possible fossil','Possible fossil',171,'Fossil nautiloid'),\n(72,'2015-09-04',3,40.781979,-73.972014,'Dinosaur tooth','Dinosaur tooth',172,'Probable fossil'),\n(73,'2015-09-04',3,40.781979,-73.972014,'Fossil plant or animal','Fossil plant or animal',173,'Probable rudist and unknown'),\n(74,'2015-09-04',1,40.781979,-73.972014,'Fossil','Fossil',174,'Clam steinkern'),\n(75,'2015-09-05',1,40.781979,-73.972014,'Possible fossil','Possible fossil',175,'Horn coral'),\n(76,'2015-09-05',3,40.781979,-73.972014,'Fossil','Fossil',176,'Oyster shell, possibly fossil'),\n(77,'2015-09-06',1,40.781979,-73.972014,'Fossils, possible bone','Fossils, possible bone',177,'2 horn corals, a porous rock, and possible obsidian, cow tooth'),\n(78,'2015-09-08',2,40.781979,-73.972014,'Possible fossil','Possible fossil',178,'Probable layered flint'),\n(79,'2015-09-08',3,40.781979,-73.972014,'Fossils','Fossils',179,'A rock and fossil corals'),\n(80,'2015-09-08',2,40.781979,-73.972014,'Presumably fossil bone','Presumably fossil bone',180,'Likely modern ?cow phalanx'),\n(81,'2015-09-10',1,40.781979,-73.972014,'Possible fossil worm','Possible fossil worm',181,'Probable straight-shelled nautiloid, possible brachiopod, probable horn coral, indet. fossil'),\n(82,'2015-09-11',1,40.781979,-73.972014,'Tooth','Tooth',182,'Upper left horse molar or premolar'),\n(83,'2015-09-12',2,40.781979,-73.972014,'Fossils','Fossils',183,'Unknown'),\n(84,'2015-09-13',2,40.781979,-73.972014,'Possible fossil','Possible fossil',184,'Likely modern encrusting bryozoan'),\n(85,'2015-09-14',3,40.781979,-73.972014,'Possible fossil','Possible fossil',185,'Possibly fossil puffer fish jaw'),\n(86,'2015-09-14',2,40.781979,-73.972014,'Possible fossil tooth','Possible fossil tooth',186,'Non-fossil unknown'),\n(87,'2015-09-16',1,40.781979,-73.972014,'fossil','fossil',187,'brachiopod'),\n(88,'2015-09-16',1,40.781979,-73.972014,'Possible fossil jawbone','Possible fossil jawbone',188,'Pleistocene bison or musk ox jaw fragment'),\n(89,'2015-09-17',2,40.781979,-73.972014,'Fossil bone','Fossil bone',189,'Weathered chunk of sandstone matrix'),\n(90,'2015-09-18',2,40.781979,-73.972014,'Top of spine and ribs of Anchisaurus','Top of spine and ribs of Anchisaurus',190,'Weathered chunk of layered sedimentary rock and other rocks'),\n(91,'2015-09-19',1,40.781979,-73.972014,'Fossil','Fossil',191,'Fossil turtle shell fragments, croc osteoderms, and other fragments'),\n(92,'2015-09-19',2,40.781979,-73.972014,'Presumably fossil','Presumably fossil',192,'Probably modern mammal (maybe dolphin) vertebral epiphysis'),\n(93,'2015-09-19',2,40.781979,-73.972014,'Unusual fossil','Unusual fossil',193,'Unknown, but doubtful that it is a fossil'),\n(94,'2015-09-20',1,40.781979,-73.972014,'Fossil','Fossil',194,'Possible turtle and vertebrae'),\n(95,'2015-09-23',1,40.781979,-73.972014,'Possible fossilized tooth','Possible fossilized tooth',195,'Probable horn coral'),\n(96,'2015-09-24',3,40.781979,-73.972014,'Fossils','Fossils',196,'Possible turtle bone (?fossil), Enchodus fang'),\n(97,'2015-09-25',1,40.781979,-73.972014,'Fossil','Fossil',197,'Possibly Devonian coral, brachiopod, and other marine invertebrates'),\n(98,'2015-09-25',2,40.781979,-73.972014,'Fossil','Fossil',198,'Probably coalified plant remains,\nnatural fracture patterns and mineral stains, rock'),\n(99,'2015-09-25',1,40.781979,-73.972014,'Possible fossil','Possible fossil',199,'Moroccan Orthoceras, doctored ammonite'),\n(100,'2015-09-27',2,40.781979,-73.972014,'Bog dinosaur with skin','Bog dinosaur with skin',200,'Rock'),\n(101,'2015-09-27',2,40.781979,-73.972014,'Fossil','Fossil',201,'Unknown'),\n(102,'2015-09-29',1,40.781979,-73.972014,'Fossil','Fossil',202,'Possible coalified wood'),\n(103,'2015-09-30',1,40.781979,-73.972014,'Fossil shell and possible coral','Fossil shell and possible coral',203,'Fossil brachiopod and probable coral'),\n(104,'2015-09-30',1,40.781979,-73.972014,'Dinosaur bone','Dinosaur bone',204,'Probably fossils'),\n(105,'2015-10-01',1,40.781979,-73.972014,'Possible turtle','Possible turtle',205,'Snails'),\n(106,'2015-10-01',2,40.781979,-73.972014,'Some form of fossil reptile, maybe a pterosaur','Some form of fossil reptile, maybe a pterosaur',206,'Fake'),\n(107,'2015-10-01',1,40.781979,-73.972014,'Fossil tooth, tusk, or plant','Fossil tooth, tusk, or plant',207,'Castoroides upper incisor fragment'),\n(108,'2015-10-01',1,40.781979,-73.972014,'Bone','Bone',208,'Probable fragment of cow or horse scapula'),\n(109,'2015-10-04',2,40.781979,-73.972014,'Dinosaur egg, fossil animal head','Dinosaur egg, fossil animal head',209,'Concretion, rock'),\n(110,'2015-10-04',1,40.781979,-73.972014,'Fossil','Fossil',210,'Probable Arthrophycus-like trace fossil'),\n(111,'2015-10-05',1,40.781979,-73.972014,'Fossil shell','Fossil shell',211,'Horn coral'),\n(112,'2015-10-05',2,40.781979,-73.972014,'Presumably fossil egg','Presumably fossil egg',212,'Concretion'),\n(113,'2015-10-05',2,40.781979,-73.972014,'Fossil with a lot of sharp teeth, hardened reptile scales, two short arms and fingers all tangled up under the head or skin that settled after it died','Fossil with a lot of sharp teeth, hardened reptile scales, two short arms and fingers all tangled up under the head or skin that settled after it died',213,'Rock'),\n(114,'2015-10-05',2,40.781979,-73.972014,'Fossil','Fossil',214,'Rock with crystals'),\n(115,'2015-10-06',2,40.781979,-73.972014,'2 chamber fossilized heart','2 chamber fossilized heart',215,'Chert nodule'),\n(116,'2015-10-08',2,40.781979,-73.972014,'?Possibly fossil whale vertebrae','?Possibly fossil whale vertebrae',216,'Modern whale vertebrae'),\n(117,'2015-10-08',1,40.781979,-73.972014,'Fossil','Fossil',217,'Fossil, probably marine invertebrate'),\n(118,'2015-10-09',1,40.781979,-73.972014,'Presumably fossil','Presumably fossil',218,'Horn coral'),\n(119,'2015-10-09',3,40.781979,-73.972014,'Possible fossil','Possible fossil',219,'Helmet shell lip'),\n(120,'2015-10-10',1,40.781979,-73.972014,'Fossil','Fossil',220,'Small cetacean vertebra'),\n(121,'2015-10-10',2,40.781979,-73.972014,'Possible fossil','Possible fossil',221,'Botryoidal mineral'),\n(122,'2015-10-11',1,40.781979,-73.972014,'Presumably fossil','Presumably fossil',222,'Probable crinoid stem fragment'),\n(123,'2015-10-12',2,40.781979,-73.972014,'Fossil','Fossil',223,'Probable non-fossil rock'),\n(124,'2015-10-12',1,40.781979,-73.972014,'Fossil shell','Fossil shell',224,'Fossil snail'),\n(125,'2015-10-13',1,40.781979,-73.972014,'Fossil','Fossil',225,'Halysites'),\n(126,'2015-10-14',3,40.781979,-73.972014,'Trace fossil or straight-shelled cephalopod, and possible fossil imprint','Trace fossil or straight-shelled cephalopod, and possible fossil imprint',226,'Probable trace fossil, rock'),\n(127,'2015-10-15',2,40.781979,-73.972014,'Presumably fossil','Presumably fossil',227,'Probably rock'),\n(128,'2015-10-15',1,40.781979,-73.972014,'Fossil','Fossil',228,'Horn coral'),\n(129,'2015-10-17',1,40.781979,-73.972014,'Mastodon teeth','Mastodon teeth',229,'Mastodont teeth'),\n(130,'2015-10-19',1,40.781979,-73.972014,'Fossil','Fossil',230,'Isotelus pygidium'),\n(131,'2015-10-19',2,40.781979,-73.972014,'Fossil','Fossil',231,'Rock'),\n(132,'2015-10-20',2,40.781979,-73.972014,'Possible fossil','Possible fossil',232,'Odd rock'),\n(133,'2015-10-22',2,40.781979,-73.972014,'Not rocks','Not rocks',233,'Geodes'),\n(134,'2015-10-22',2,40.781979,-73.972014,'Fossil skull','Fossil skull',234,'Rock'),\n(135,'2015-10-23',2,40.781979,-73.972014,'Big dinosaur bone','Big dinosaur bone',235,'Rock'),\n(136,'2015-10-23',1,40.781979,-73.972014,'Presumably fossil bone','Presumably fossil bone',236,'Palmoxylon'),\n(137,'2015-10-23',2,40.781979,-73.972014,'Presumably fossils','Presumably fossils',237,'Sedimentary concretions'),\n(138,'2015-10-23',2,40.781979,-73.972014,'Possible fossil','Possible fossil',238,'Rock'),\n(139,'2015-10-24',1,40.781979,-73.972014,'Fossil','Fossil',239,'Ammonite chamber steinkern'),\n(140,'2015-10-25',1,40.781979,-73.972014,'Fossil','Fossil',240,'Probable orthocone'),\n(141,'2015-10-25',2,40.781979,-73.972014,'cephalopod concretions','cephalopod concretions',241,'unknown'),\n(142,'2015-10-26',3,40.781979,-73.972014,'Possible fossils (one possible fossil anemone)','Possible fossils (one possible fossil anemone)',242,'Manganese dendrites, horn coral, branching bryozoan mold'),\n(143,'2015-10-26',2,40.781979,-73.972014,'Fossil','Fossil',243,'Septarian concretions'),\n(144,'2015-10-26',3,40.781979,-73.972014,'Fossil, coprolites','Fossil, coprolites',244,'Heteromorph ammonite, non-coprolites'),\n(145,'2015-10-27',3,40.781979,-73.972014,'Possible fossil','Possible fossil',245,'Possible fossil'),\n(146,'2015-10-27',1,40.781979,-73.972014,'Possible fossil','Possible fossil',246,'Ammonite'),\n(147,'2015-10-28',2,40.781979,-73.972014,'Fossil','Fossil',247,'Rock'),\n(148,'2015-10-28',2,40.781979,-73.972014,'Bones or a skeleton of a dragon that spits fire','Bones or a skeleton of a dragon that spits fire',248,'No response required'),\n(149,'2015-10-28',1,40.781979,-73.972014,'Fossil','Fossil',249,'Probably mold of club urchin spine'),\n(150,'2015-10-28',2,40.781979,-73.972014,'Possible fossilized egg','Possible fossilized egg',250,'Concretion'),\n(151,'2015-10-30',1,40.781979,-73.972014,'Megalodon tooth','Megalodon tooth',251,'Probable Megalodon projectile point'),\n(152,'2015-10-30',1,40.781979,-73.972014,'Presumably fossil','Presumably fossil',252,'Fossil shell');\"\n\n\t);\n }", "public function getSQL();", "function bestillingAvBrod($type, $antall, $tidspunkt){\r\n //Kunden får oversikt over alle brøene som er tilgjengelig\r\n\r\n //kunden får oversikt over hvor mange brød man kan bestillinger\r\n\r\n //Kunden velger tidspunkt nå brød skal hentes.\r\n\r\n //Informasjon sendes mot database i tabellen som man trenger.\r\n }", "function einstellungen_data ()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE bgalset_id='1'\",\n\t\t\t$this->db_praefix.\"ecard_einstellungen\"\n\t\t);\n\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "public static function getAllBesttj() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "function featuredItems()\n{\n \treturn query(\"SELECT titel, beschrijving, b.bodBedrag\n \t\t\t\tfrom tblVoorwerp v\n \t\t\t\tinner join (select voorwerpNummer, max(bodBedrag) as bodBedrag\n \t\t\t\tfrom tblBod\n \t\t\t\tgroup by voorwerpNummer) b on v.voorwerpNummer=b.voorwerpNummer\n where v.voorwerpNummer in (select top 5 v.voorwerpNummer\n \t\t\t\tfrom tblVoorwerp v\n \t\t\t\tinner join (select voorwerpNummer, max(bodBedrag) as bodBedrag\n \t\t\t\tfrom tblBod\n \t\t\t\tgroup by voorwerpNummer) b on v.voorwerpNummer=b.voorwerpNummer\n \t\t\t\torder by startPrijs/bodBedrag*100 desc)\");\n}", "function newsItem_BacaDataListing_Terpopuler_All( $tbl_news ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news ORDER BY dilihat DESC\");\n\treturn $sql;\n}", "function put_bestelling_in_database($bestelling,$conn)\n\t{\n\t$query=\t\"INSERT INTO bestelling(tafel,product,aantal,user) VALUES('\".$bestelling['tafel'].\"','\".$bestelling['product'].\"','\".$bestelling['aantal'].\"','\".$bestelling['user'].\"');\";\n\t\tmysqli_query($conn,$query);\n\t\t// echo $query;\n\t}", "function newskomentar_listdata($tbl_newskomentar){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar\");\n\t\treturn $sql;\n}", "function hentAlleAktiviteter()\n{\n return Aktivitet::All()->sortByDesc(\"Dato\");\n}", "function sqlStudentAll()\n\t{\n\t\t//echo '<hr>Nama class ini :' . __METHOD__ . '()<hr>';\n\t\t$sql = \"SELECT student_name,student_roll_number,student_dob,student_grade_id,student_id\"\n\t\t. \" FROM tbl_student INNER JOIN tbl_grade \"\n\t\t. \" ON tbl_grade.grade_id = tbl_student.student_grade_id \"\n\t\t. \"\";\n\n\t\treturn $sql;\n\t}", "function insert_all_regeln_into_db($konvertierung_id, $stelle_id) {\n\t\t$geometry_type = ''; # Default\n\t\t$bereiche_ids = $this->get_all_bereiche_ids_of_konvertierung($konvertierung_id);\n\t\t# TODO Check for each regel if bereich = bereich, and enter it accordingly in rule\n\t\t#$bereich_gml_id = 'd48608a2-6f3c-11e8-8ca0-1f2b7a47118e'; #Placeholder\n\n\t\t$classes = $this->get_possible_classes_for_regeln($this->gmlas_schema);\n\t\t# Loop over relevant bereiche -> classes -> geom\n\t\t$bereich_index = 0;\n\t\tforeach($bereiche_ids as $bereich_gml_id) {\n\t\t\t# index is used for modifying regel by name\n\t\t\t$bereich_index++;\n\t\t\tforeach($classes as $c) {\n\t\t\t\tif($this->check_if_table_has_entries_for_bereich($this->gmlas_schema, $c, $bereich_gml_id)) {\n\t\t\t\t\t# Loop over all geom-types to get a rule for each\n\t\t\t\t\t# use only ST_Point, ST_MultiPoint, ST_LineString, ST_MultiLineString, ST_Polygon and ST_MultiPolygon\n\t\t\t\t\t$geometry_types = $this->get_geometry_types_of_class_in_schema($c, $this->gmlas_schema);\n\t\t\t\t\tforeach($geometry_types as $g) {\n\t\t\t\t\t\t$sql_regel = $this->get_gmlas_to_gml_regel_for_class_in_bereich_with_geom($c, $bereich_gml_id, $g);\n\t\t\t\t\t\t$sql_regel = str_replace(\"'\", \"''\", $sql_regel); # Replaces all single commas with 2x single commas to escape them in SQL\n\t\t\t\t\t\t$this->insert_regel_into_db($c, $sql_regel, $g, $konvertierung_id, $stelle_id, $bereich_gml_id, $bereich_index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function listar_boletines() {\n\t\t$query = \"SELECT newsletters.*\n\t\tFROM newsletters\n\t\tORDER BY fecha_publicacion desc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function selectAbstimmungenHeute() {\n\tglobal $pdo;\n\t$pdolocal = $pdo;\n\tdate_default_timezone_set(\"Europe/Berlin\");\n\n\t// Hole alle heutigen Abstimmungen von allen Usern der Gruppe (,der der aktuelle User angehört)\n\t$sqlSelAbstHeute = $pdolocal->prepare(\"SELECT abstimmen.u_ID, abstimmen.g_ID, e_ID1, e_ID2 FROM abstimmen WHERE datum = :datum AND abstimmen.g_ID = :g_ID\");\n\t$sqlSelAbstHeute->execute(array('datum' => date(\"Y-m-d\",time()),'g_ID' => $_SESSION['g_ID']));\n\t$sqlSelAbstHeuteRes = $sqlSelAbstHeute->fetchAll();\n\n\treturn $sqlSelAbstHeuteRes;\n}", "function geraClassesBDBase(){\n # Abre o template da classe BD e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.ModeloBDBase.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n $nomeClasse\t = $this->getCamelMode(ucfirst((string)$aTabela['NOME']));\n $objetoClasse = \"\\$o$nomeClasse\";\n # varre a estrutura dos campos da tabela em questao\n $aCampoInsert = $aValorInsert = $aCampoUpdate = $aChaveWhere = $aCampoConsulta = $aFKCampo = array();\n $aChaveAltera = $aChave = $aChaveWhereSel = $aChaveWhereDel = $aFKJoin = $aVerificaPK = array();\n \n $i = 2;\n\n foreach($aTabela as $oCampo){\n $nomeCampo = (string)$oCampo->NOME;\n\n # recupera valores a serem substituidos no modelo\n $aCampoInsert[] = $nomeCampo;\n if((int)$oCampo->CHAVE == 1){\n $aChaveWhere[] = \"$nomeCampo = {\\$reg['$nomeCampo']}\";\n $aChaveWhereSel[] = (string)$aTabela['NOME'].\".$nomeCampo = \\$$nomeCampo\";\n $aChaveWhereDel[] = \"$nomeCampo = \\$$nomeCampo\";\n $aChave[] = \"\\$$nomeCampo\";\n $aVerificaPK[] = $nomeCampo;\n $aChaveAltera[] = \"\\$cv == \\\"$nomeCampo\\\"\";\n if((string)$oCampo->FKTABELA != ''){\n $aCampoUpdate[] = \"$nomeCampo = \\\".\\$reg['$nomeCampo'].\\\"\";\n }\n }\n else{\n $aCampoUpdate[] = ((string)$oCampo->FKTABELA != '') ? \n \"$nomeCampo = \\\".\\$reg['$nomeCampo'].\\\"\" : \n \"$nomeCampo = '\\\".\\$reg['$nomeCampo'].\\\"'\";\t\t\t\t\n }\n\n if((string)$oCampo->FKTABELA != ''){\n $aValorInsert[] = (preg_match(\"#[dD]ata.*[Cc]adastro#is\", $nomeCampo)) ? \"\\\".\\$oConexao->data_cadastro_padrao.\\\"\" : \"\\\".\\$reg['$nomeCampo'].\\\"\";\n $tabelaFK = ((string)$aTabela['SCHEMA'] != \"\") ? (string)$aTabela['SCHEMA'].\".\".(string)$oCampo->FKTABELA : (string)$oCampo->FKTABELA;\n $aFKJoin[] = \"$tabelaFK \\n\\t\\t\\t\\t\\ton (\".(string)$aTabela['NOME'].\".$nomeCampo = \".(string)$oCampo->FKTABELA.\".\".(string)$oCampo->FKCAMPO.\")\";\n \n $i++;\n }\n else{\n $aValorInsert[] = ((int)$oCampo->CHAVE == 1) ? \n \"\\\".\\$reg['$nomeCampo'].\\\"\" : \n \"'\\\".\\$reg['$nomeCampo'].\\\"'\";\n }\n\n // =========== Montagem dos Campos da Consulta =============\n if((int)$oCampo->CHAVE != 1){\n $aCampoConsulta[] = (string)$aTabela['NOME'].\".$nomeCampo like '\\$valor'\";\n }\t\n }\n # =========== Monta demais valores a serem substituidos ========\n $aCampoInsert = join($aCampoInsert, \",\\n\\t\\t\\t\\t\\t\");\n $aValorInsert = join($aValorInsert, \",\\n\\t\\t\\t\\t\\t\");\n $aCampoUpdate = join($aCampoUpdate, \",\\n\\t\\t\\t\\t\\t\");\n $aChaveWhere = join($aChaveWhere, \" \\n\\t\\t\\t\\t\\tand \");\n $aChaveWhereSel = join($aChaveWhereSel, \" \\n\\t\\t\\t\\t\\tand \");\n $aChaveWhereDel = join($aChaveWhereDel, \" \\n\\t\\t\\t\\t\\tand \");\n $sCampoConsulta = join($aCampoConsulta, \" \\n\\t\\t\\t\\t\\tor \");\n $aChave = join($aChave,\t \",\");\n $aColuna = $this->getCamposSelect((string)$aTabela['NOME']);\n $aColuna = join($aColuna, \",\\n\\t\\t\\t\\t\\t\");\n\n $tabelaJoin = (((string)$aTabela['SCHEMA'] != \"\") ? (string)$aTabela['SCHEMA'].\".\".(string)$aTabela['NOME'] : (string)$aTabela['NOME']);\n\n $sVerificaPK = NULL;\n foreach($aVerificaPK as $v){\n $sVerificaPK .= \"\\t\\t\\$reg['$v'] = (\\$reg['$v'] != '') ? \\$reg['$v'] : \\\"null\\\";\\n\";\n }\n\n if(count($aFKJoin) > 0){\n $tabelaJoin .= \" \\n\\t\\t\\t\\tleft join \".join($aFKJoin,\"\\n\\t\\t\\t\\tleft join \");\n }\n \n $nomeTabela = (((string)$aTabela['SCHEMA'] != \"\") ? (string)$aTabela['SCHEMA'].\".\".(string)$aTabela['NOME'] : (string)$aTabela['NOME']);\n $chavesWhereConsulta = (($sCampoConsulta!='') ? $sCampoConsulta : '1=1');\n $sChaveAltera = (count($aChaveAltera)>0) ? \"if(\".implode(\" || \", $aChaveAltera).\") continue;\" : \"\";\n \n # ======== Substitui todas os parametros pelas variaveis ja processadas ==========\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%VERIFICA_PK%%', $sVerificaPK, $copiaModelo);\n $copiaModelo = str_replace('%%OBJETO_CLASSE%%', $objetoClasse, $copiaModelo);\n $copiaModelo = str_replace('%%TABELA%%', $nomeTabela, $copiaModelo);\n $copiaModelo = str_replace('%%CAMPOS_INS%%', $aCampoInsert, $copiaModelo);\n $copiaModelo = str_replace('%%VAL_CAMPOS_INS%%', $aValorInsert, $copiaModelo);\n $copiaModelo = str_replace('%%CAMPOS_UPD%%', $aCampoUpdate, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE%%', $aChaveWhere, $copiaModelo);\n $copiaModelo = str_replace('%%LISTA_CHAVES%%', $aChave, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE_SEL%%', $aChaveWhereSel, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE_DEL%%', $aChaveWhereDel, $copiaModelo);\n $copiaModelo = str_replace('%%TABELA_JOIN%%', $tabelaJoin, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE_CONS%%', $chavesWhereConsulta, $copiaModelo);\n $copiaModelo = str_replace('%%COLUNAS%%', $aColuna, $copiaModelo); //Por Enquanto\n $copiaModelo = str_replace('%%CAMPOS_CHAVE_ALTERAR%%', $sChaveAltera, $copiaModelo);\n \n\n unset($sCampoConsulta);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/bdbase\";\n if(!file_exists($dir)) \n mkdir($dir);\n $fp = fopen(\"$dir/class.$nomeClasse\".\"BDBase.php\",\"w\");\n fputs($fp,$copiaModelo); \n fclose($fp);\n }\n return true;\n }", "private function Zapis_jednu_kolizi() { \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n//echo \"<hr><br>* v Zapis_jednu_kolizi:\";\r\n\r\n //vyberu kolizi z uc_kolize_table pokud jiz existuje\r\n $query= \"SELECT * FROM uc_kolize_table WHERE id_ucastnik =\" . $this->id_ucastnik . \" and id_s_typ_kolize_FK=\" . $this->id_s_typ_kolize_FK ;\r\n //echo \"<br>*dotaz v Zapis_jednu_kolizi: \" . $query;\r\n $data = $dbh->prepare($query)->execute();\r\n //var_dump($data);\r\n \r\n if ($data) {\r\n $zaznam_kolize = $data->fetch() ; //vemu prvni (je predpoklad ze je jen jedna)\r\n if ($zaznam_kolize) {\r\n //echo \"<br>kolize je - budu prepisovat\"; //budu prepisovat\r\n $query1 = \"UPDATE uc_kolize_table set \" .\r\n \"revidovano='\" . $this->revidovano . \"', \" .\r\n \"revidovano_pozn='\" . $this->revidovano_pozn . \"', \" .\r\n \"valid=1 \" . \r\n \"WHERE id_uc_kolize_table =\" . $zaznam_kolize['id_uc_kolize_table'];\r\n //echo \"<br>\" . $query1; \r\n $data1 = $dbh->prepare($query1)->execute(); \r\n \r\n }\r\n else {\r\n //echo \"<br>kolize neni - budu vkladat\"; //budu vkladat\r\n $query1 = \"INSERT uc_kolize_table set \" . \r\n \"id_ucastnik= \" . $this->id_ucastnik . \", \" .\r\n \"id_s_typ_kolize_FK=\" . $this->id_s_typ_kolize_FK . \", \" .\r\n \"revidovano='\" . $this->revidovano . \"', \" .\r\n \"revidovano_pozn='\" . $this->revidovano_pozn . \"', \" .\r\n \"valid=1, date_vzniku=now() \" ;\r\n //echo \"<br>\" . $query1; \r\n $data1 = $dbh->prepare($query1)->execute();\r\n \r\n }\r\n } \r\n\r\n//echo \"<hr>\";\r\n}", "function datagolongan() {\n\t\t\t\t$koneksi = $this->koneksi;\n\t\t\t\t// SQL\n\t\t\t\t$query\t\t\t= \"SELECT * FROM golongan\";\n\t\t\t\t\n\t\t\t\t$sql\t\t\t= mysqli_query($koneksi,$query);\n\t\t\t\t\n\t\t\t\treturn $sql;\n\t\t\t}", "public function origen() {\n $sql =\"SELECT DISTINCT aeroport FROM vols ORDER BY aeroport ASC\";\n $query=$this->db->prepare($sql);\n $query->execute();\n $res=$query->fetchAll();\n \n return $res;\n }", "function pobierz_studentow() {\n\t\t$baza = polacz_z_baza();\n\n\t\t$zapytanie = 'select * from studenci';\n\t\t$wynik = mysqli_query($baza, $zapytanie);\n\n\t\tzakoncz_polaczenie($baza);\n\n\t\treturn $wynik;\n\t}", "function recuperer_bsm_entier(){\n global $db;\n $sql = \"SELECT * FROM bsm \";\n $req = $db->prepare($sql);\n $req-> execute();\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "public function alleBestellungen(){\n\n\t\treturn array(\n\t\t\t[\"ID\" => 1, \"Vorname\" => \"Wenke\", \"Nachname\" => \"Tautz\"],\n\t\t\t[\"ID\" => 2, \"Vorname\" => \"Christoph\", \"Nachname\" => \"Silge\"],\n\t\t\t[\"ID\" => 3, \"Vorname\" => \"Henry\", \"Nachname\" => \"Juwig\"],\n\t\t\t[\"ID\" => 4, \"Vorname\" => \"Felix\", \"Nachname\" => \"Klotzsche\"]\n\t\t);\n\t}", "function historial(){\n\n\t\t//Instanciamos y nos conectamos a la bd\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta = \"SELECT tipo_denuncia.*,denuncia.* FROM denuncia INNER JOIN tipo_denuncia ON denuncia.td_cod_tipo_denuncia=tipo_denuncia.td_cod_tipo_denuncia WHERE denuncia.de_estado='tomado'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute();\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n\t}", "public static function getVSeStranke(){\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id_stranke, ime, priimek, email, geslo, naslov, telefon FROM stranke\");\n \n $statement->execute();\n\n return $statement->fetchAll();\n }", "function optimizeDatabase() {}", "public function findBatiments($language) {\r\n $select = $this->_createSelectQuery();\r\n // batiment\r\n $select->field('id', $this->_tableName);\r\n $select->field('nom_' . $language, $this->_tableName, 'nom');\r\n $select->field('description_' . $language, $this->_tableName, 'description');\r\n $select->field('image', $this->_tableName);\r\n $select->field('niveau', $this->_tableName);\r\n $select->field('cout', $this->_tableName);\r\n $select->field('entretien', $this->_tableName);\r\n $select->field('duree_construction', $this->_tableName);\r\n $select->field('duree_recolte', $this->_tableName);\r\n $select->field('duree_hospitalisation', $this->_tableName);\r\n $select->field('cout_hospitalisation', $this->_tableName);\r\n $select->field('gain', $this->_tableName);\r\n $select->field('capacite', $this->_tableName);\r\n $select->field('visibilite', $this->_tableName);\r\n $select->field('id_prev', $this->_tableName);\r\n // Batiment Suivant\r\n $select->field('id', 'batiment_suivant', 'id_next');\r\n // type_batiment 1\r\n $select->field('id', 'type1_batiment', 'id_type1');\r\n $select->field('id_parent', 'type1_batiment', 'id_parent_type1');\r\n $select->field('nom_' . $language, 'type1_batiment', 'nom_type1');\r\n $select->field('is_unique', 'type1_batiment', 'is_unique_type1');\r\n // type_batiment 2\r\n $select->field('id', 'type2_batiment', 'id_type2');\r\n $select->field('id_parent', 'type2_batiment', 'id_parent_type2');\r\n $select->field('nom_' . $language, 'type2_batiment', 'nom_type2');\r\n $select->field('is_unique', 'type2_batiment', 'is_unique_type2');\r\n // From et jointures\r\n $select->from($this->_tableName);\r\n $select->innerJoin('type_batiment', array('batiment.id_type = type1_batiment.id'), 'type1_batiment');\r\n $select->leftJoin('type_batiment', array('type1_batiment.id_parent = type2_batiment.id'), 'type2_batiment');\r\n $select->leftJoin('batiment', array('batiment_suivant.id_prev = batiment.id'), 'batiment_suivant');\r\n // Ordre\r\n $select->order('batiment.niveau');\r\n\r\n return $this->_mapper->buildObjectsFromRows($this->_selectAll($select));\r\n }", "function afficherreservation(){\n\t\t$sql=\"SElECT * From reservation\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function getNaujienosVisi() {\n $manoSQL = \"SELECT * FROM naujienos order by id DESC \";\n // $rezultataiOBJ - Mysql Objektas\n $rezultataiOBJ = mysqli_query(getPrisijungimas(), $manoSQL);\n return $rezultataiOBJ;\n}", "public function getSql();", "public function getSql();", "function galerien_liste()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s\n\t\t\t\t\t\tORDER BY bgalg_order_id\",\n\t\t\t$this->db_praefix.\"ecard_galerien\"\n\t\t);\n\t\t$temp_return = $this->db->get_results($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "function newsItem_BacaDataListing_Terkini_All( $tbl_news ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "function sanalista($kieli){\n $kysely = haeYhteys()->prepare(\"SELECT sana from sana WHERE kieliID = ? ORDER BY sana\");\n if ($kysely->execute(array($kieli))){\n return $kysely;\n } else {\n return null;\n }\n }", "function datask() {\n\t\t\t\t$koneksi = $this->koneksi;\n\t\t\t\t// SQL\n\t\t\t\t$query\t\t\t= \"SELECT * FROM sk\";\n\t\t\t\t\n\t\t\t\t$sql\t\t\t= mysqli_query($koneksi,$query);\n\t\t\t\t\n\t\t\t\treturn $sql;\n\t\t\t}", "function getHotelsByNameOrderBy( $ime_grada, $kriterij )\n\t{\n\t\t//slucaj kad korisnik zeli sortirati po atributima iz tablice projekt_hoteli\n\t\t\tif($kriterij === 'udaljenost_od_centra' || $kriterij === 'ocjena' || $kriterij === 'broj_zvjezdica')\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$db = DB::getConnection();\n\t\t\t\t\tif($kriterij === 'udaljenost_od_centra')\n\t\t\t\t\t\t$st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE ime_grada=:ime_grada ORDER BY udaljenost_od_centra' );\n\t\t\t\t\tif($kriterij === 'ocjena')\n\t\t\t\t\t\t$st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE ime_grada=:ime_grada ORDER BY ocjena' );\n\t\t\t\t\tif($kriterij === 'broj_zvjezdica')\n\t\t\t\t\t\t$st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE ime_grada=:ime_grada ORDER BY broj_zvjezdica' );\n\t\t\t\t\t$st->execute(array('ime_grada' => $ime_grada));\n\t\t\t}\n\t\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t\t//popuni polje soba koje je dodatna varijbla u klasi hotel.class osim atributa iz\n\t\t\t//tablice projekt_hoteli\n\t\t\t$arr = array();\n\t\t\twhile( $row = $st->fetch() )\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$db = DB::getConnection();\n\t\t\t\t\t$st2 = $db->prepare( 'SELECT * FROM projekt_sobe WHERE id_hotela=:id_hotela' );\n\t\t\t\t\t$st2->execute(array('id_hotela' => $row['id']));\n\t\t\t\t}\n\t\t\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t\t\t$arr2 = array();\n\t\t\t\twhile ($row2 = $st2->fetch())\n\t\t\t\t\t$arr2[] = new Soba($row['ime_hotela'], $row2['id'], $row2['id_hotela'], $row2['broj_osoba'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row2['tip_kreveta'], $row2['vlastita_kupaonica'], $row2['cijena_po_osobi']);\n\t\t\t\t$arr[] = new Hotel( $row['id'], $row['ime_grada'], $row['ime_hotela'], $row['adresa_hotela'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['udaljenost_od_centra'], $row['ocjena'], $row['broj_zvjezdica'], $arr2 );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$arr = array();\n\t\t\t//prvo dohvati sobe soritrane po kriteriju\n\t\t\t$sobe = $this->getRoomsByNameOrderBy($ime_grada, $kriterij);\n\t\t\tforeach($sobe as $var)\n\t\t\t{\n\t\t\t\t//za svaku sobu nadji hotel kojem pripada\n\t\t\t\t$db = DB::getConnection();\n\t\t\t $st = $db->prepare( 'SELECT * FROM projekt_hoteli WHERE id=:id_hotela' );\n\t\t\t\t$st->execute(array('id_hotela' => $var->id_hotela));\n\t\t\t\twhile( $row = $st->fetch() )\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$db = DB::getConnection();\n\t\t\t\t\t\t//mozda nepotreban dio, bitno je samo dohvatit sobe hotela kao i u gornjem\n\t\t\t\t\t\t//prvom slucaju da bi se to polje moglo spremit u klasu hotel.class\n\t\t\t\t\t\tif($kriterij === 'broj_osoba')\n\t\t\t\t\t\t\t$st2 = $db->prepare( 'SELECT * FROM projekt_sobe WHERE id_hotela=:id_hotela ORDER BY broj_osoba' );\n\t\t\t\t\t if($kriterij === 'cijena_po_osobi')\n\t\t\t\t\t\t\t$st2 = $db->prepare( 'SELECT * FROM projekt_sobe WHERE id_hotela=:id_hotela ORDER BY cijena_po_osobi' );\n\t\t\t\t\t\t$st2->execute(array('id_hotela' => $row['id']));\n\t\t\t\t\t}\n\t\t\t\t\tcatch( PDOException $e ) { exit( 'PDO error ' . $e->getMessage() ); }\n\n\t\t\t\t\t$arr2 = array();\n\t\t\t\t\twhile ($row2 = $st2->fetch())\n\t\t\t\t\t\t$arr2[] = new Soba($row['ime_hotela'], $row2['id'], $row2['id_hotela'], $row2['broj_osoba'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row2['tip_kreveta'], $row2['vlastita_kupaonica'], $row2['cijena_po_osobi']);\n\t\t\t\t\t$arr[] = new Hotel( $row['id'], $row['ime_grada'], $row['ime_hotela'], $row['adresa_hotela'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['udaljenost_od_centra'], $row['ocjena'], $row['broj_zvjezdica'], $arr2 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\n\t}", "function allinea_db() {\r\n\t\t\r\n\t\t$in=$this->session_vars;\r\n\t\t$conn=$this->conn;\r\n\t\t$service=$this->service;\r\n\t\t$tb_exist = false;\r\n\t\t$str_synonym=\"select * from USER_SYNONYMS where synonym_name='\" . $this->form ['TABLE'] . \"'\";\r\n\t\t$sql = new query ( $conn );\r\n\t\t$sql->set_sql ( $str_synonym );\r\n\t\t$sql->exec ();//non richiede binding\r\n\t\t$sql->get_row();\r\n\t\tif($sql->row['TABLE_NAME']!='') $this->form ['TABLE']=$sql->row['TABLE_NAME'];\r\n\t\t$query = \"select column_name from user_col_comments where table_name='\" . $this->form ['TABLE'] . \"'\";\r\n\t\t$sql = new query ( $conn );\r\n\t\t$sql->set_sql ( $query );\r\n\t\t$sql->exec ();//non richiede binding\r\n\t\t$all_field_exist = true;\r\n\t\tforeach ( $this->fields as $key => $val ) {\r\n\t\t\tif (isset ( $val ['TYPE'] ) && $val ['TYPE'] != '')\r\n\t\t\t$field_type = \"field_{$val['TYPE']}\";\r\n\t\t\telse\r\n\t\t\t$field_type = \"field\";\r\n\t\t\t\r\n\t\t\tif ($this->config_service['field_lib'] != '' && file_exists ( $this->config_service['field_lib'] . $field_type . \".inc\" )) {\r\n\t\t\t\tinclude_once $this->config_service['field_lib'] . $field_type . \".inc\";\r\n\t\t\t} else\r\n\t\t\tinclude_once \"{$field_type}.inc\";\r\n\t\t\t$this->no_field_value_by_tb=true;\r\n\t\t\t$field_obj = new $field_type ( $this, $key, $this->conn, $this->tb_vals, $this->session_vars, $this->service, $this->errors);\r\n\t\t\t$this->no_field_value_by_tb=false;\r\n\t\t\t$allinea_stmt [$key] = $field_obj->allinea_db ();\r\n\t\t\tif ($field_obj->attributes ['PK'] == 'yes') {\r\n\t\t\t\t$sql_pk_fields .= \"{$field_obj->attributes['VAR']},\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sql_pk_fields = rtrim ( $sql_pk_fields, \",\" );\r\n\t\tif ($sql->numrows > 0) {\r\n\t\t\t$tb_exist = true;\r\n\t\t\t$i = 0;\r\n\t\t\twhile ( $sql->get_row () ) {\r\n\t\t\t\t$res [$i] = $sql->row ['COLUMN_NAME'];\r\n\t\t\t\t$i ++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($tb_exist) {\r\n\t\t\t$sql_pk = null;\r\n\t\t\t$c = 0;\r\n\t\t\t$all_field_exist = true;\r\n\t\t\tforeach ( $allinea_stmt as $key => $val ) {\r\n\t\t\t\tif ($val != '') {\r\n\t\t\t\t\t$field_exist = false;\r\n\t\t\t\t\tforeach ( $val as $vk => $vval ) {\r\n\t\t\t\t\t\t$nome_campo = explode ( \" \", $vval );\r\n\t\t\t\t\t\t$field_exist [$key] [$vk] = false;\r\n\t\t\t\t\t\tforeach ( $res as $key_res => $val_res ) {\r\n\t\t\t\t\t\t\tif ($val_res == $nome_campo [0] || $nome_campo [0] == '') {\r\n\t\t\t\t\t\t\t\t$field_exist [$key] [$vk] = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tforeach ( $field_exist as $key1 => $val1 ) {\r\n\t\t\t\t\t\tforeach ( $val1 as $vk => $boolval )\r\n\t\t\t\t\t\tif (! $boolval) {\r\n\t\t\t\t\t\t\t$all_field_exist = false;\r\n\t\t\t\t\t\t\t$index = (count ( $this->fields ) * $vk) + $key;\r\n//\t\t\t\t\t\t\t$eq_sql_str [$index] = \"alter table EQ_\" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t\t$s_sql_str [$index] = \"alter table S_\" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t\t$sql_str [$index] = \"alter table \" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$sql_pk_drop = \"alter table \" . $this->form ['TABLE'] . \" drop constraint PK_\" . $this->form ['TABLE'] . \" cascade\";\r\n\t\t\t$sql_pk = \"alter table \" . $this->form ['TABLE'] . \" add constraint PK_\" . $this->form ['TABLE'] . \" primary key ($sql_pk_fields)\";\r\n\t\t\t$sql_fk_coord_drop = \"alter table \" . $this->form ['TABLE'] . \" drop constraint FK_\" . $this->form ['TABLE'] . \"_COORD cascade\";\r\n\t\t\tglobal $config_service;\r\n\t\t\tif ($config_service ['VISITNUM_PROGR'] == 1)\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t\telse\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t} else {\r\n\t\t\t$this->body .= \"Table <b>\" . $this->form ['TABLE'] . \"</b> doesn't exist<br/>\";\r\n\t\t\tforeach ( $allinea_stmt as $key => $val ) {\r\n\t\t\t\tforeach ( $val as $key_f => $val_f )\r\n\t\t\t\tif ($val_f != '')\r\n\t\t\t\t$sql_create_fields .= \"{$val_f},\";\r\n\t\t\t}\r\n\t\t\t$sql_create_fields = rtrim ( $sql_create_fields, \",\" );\r\n\t\t\t$sql_str_ini = \"create table \" . $this->form ['TABLE'] . '(';\r\n\t\t\t$sql_str_end = \")\";\r\n\t\t\t$sql_str [0] = $sql_str_ini . $sql_create_fields . $sql_str_end;\r\n\t\t\t$sql_pk = \"alter table \" . $this->form ['TABLE'] . \" add constraint PK_\" . $this->form ['TABLE'] . \" primary key ($sql_pk_fields)\";\r\n\t\t\t$config_service=$this->config_service;\r\n\t\t\tif ($config_service ['VISITNUM_PROGR'] == 1)\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t\telse\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n//\t\t\t$eq_sql_str [0] = \"create table EQ_\" . $this->form ['TABLE'] . \" (ID NUMBER, COMMENTO varchar2(400),\" . $sql_create_fields . $sql_str_end;\r\n//\t\t\t$eq_sql_str [1] = \"alter table EQ_\" . $this->form ['TABLE'] . \" add constraint EQ_PK_\" . $this->form ['TABLE'] . \" primary key (ID)\";\r\n\r\n\t\t\t$s_sql_str [0] = \"create table S_\" . $this->form ['TABLE'] . \"(USERID VARCHAR2(20),MODDT DATE,MODPROG NUMBER not null,FL_QUERY CHAR(1) not null,ID_QUERY NUMBER,\" . $sql_create_fields . $sql_str_end;\r\n\t\t\t$s_sql_str [1] = \"alter table S_\" . $this->form ['TABLE'] . \" add constraint S_PK_\" . $this->form ['TABLE'] . \" primary key (MODPROG)\";\r\n\r\n\t\t}\r\n\t\tif (isset ( $in ['CREATE'] ) || isset ( $in ['CREATE_' . $this->form ['TABLE']] )) {\r\n\t\t\tforeach ( $sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tforeach ( $eq_sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tforeach ( $s_sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tif ($sql_pk_drop != '') {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($sql_pk_drop); // bind non necessario\r\n\t\t\t}\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ($sql_pk); // bind non necessario\r\n\t\t\tif ($sql_fk_coord_drop != '') {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($sql_fk_coord_drop); // bind non necessario\r\n\t\t\t}\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ($sql_fk_coord); // bind non necessario\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\treturn ($tb_exist && $all_field_exist);\r\n\t}", "public function getListNewestBusiness(){\n\t\tglobal $dbObj;\n\t\t$sql = \"SELECT * FROM \".BLIST.\" WHERE is_new = 1 \";\n\t\t$count = $dbObj->num_rows($dbObj->query($sql));\n\t\tif($count>0){\n\t\t\t$res = $dbObj->fetch_all_array($sql);\n\t\t\treturn $res;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function get_all_gestion()\r\n {\r\n $gestion = $this->db->query(\"\r\n SELECT\r\n *\r\n\r\n FROM\r\n `gestion`\r\n\r\n WHERE\r\n 1 = 1\r\n\r\n ORDER BY `cod_ges` DESC\r\n \")->result_array();\r\n\r\n return $gestion;\r\n }", "function triprix(){\r\n $sql=\"SELECT * FROM livraison ORDER BY prix ASC\";\r\n $db = config::getConnexion();\r\n try{\r\n $liste=$db->query($sql);\r\n return $liste;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "public function sql_examen(){\r\n $sql=\"SELECT * FROM texamen WHERE estatus='1' order by descripcion\";\r\n\t\t$cursor=parent::ejecuta_sql($sql);\t\r\n// verifica que la consulta arroje al menos 1 fila para poder enviar la sentencia sql\r\n\t\tif(parent::getNRegistro($cursor)<0)\r\n\t\t\treturn 1;//fallo la operacion\r\n\t\t\telse \r\n\t\t\treturn $sql;\t\t\r\n\t\t\t\r\n\t\t\tparent::cerrar_bd();\r\n }", "public function lagre() {\n\n try\n {\n $sql_tekst = \"INSERT INTO Stikkord \";\n $sql_tekst .= \"(tekst)\";\n $sql_tekst .= \"VALUES (\";\n $sql_tekst .= \"'\".$this->hentTekst().\"'\";\n $sql_tekst .= \")\";\n $setning = self::$db->prepare($sql_tekst);\n\n\n if($setning->execute()) {\n $this->settId(self::$db->lastInsertId());\n } else\n // dersom stikkordet allerede finnes, hent id til stikkordet og bruk det\n {\n $tekst=$this->hentTekst();\n $sql_tekst = \"SELECT * FROM Stikkord WHERE tekst = :tekst\";\n\n $setning = self::$db->prepare($sql_tekst);\n $setning->bindParam(':tekst',$tekst,PDO::PARAM_STR);\n $setning->execute();\n $stikkord = $setning->fetchObject('Stikkord');\n $this->settId($stikkord->hentId());\n\n }\n\n }\n catch (Exception $e) {\n print $e->getMessage() . PHP_EOL;\n }\n\n return $setning;\n\n }", "public function fullDataBase()\n {\n print \"<table cellpadding='10' border=solid bordercolor=black>\";\n print\"<tr>\n <td>ROW</td> <td>EXCHANGE</td>\n <td>NAME</td> <td>IPO</td>\n <td>SYMBOL</td> <td>PRICE</td>\n <td>CAP</td> <td>UPDATED</td>\n <td>SECTOR</td> <td>INDUSTRY</td>\n </tr>\";\n $sql = \"SELECT * FROM companies ORDER BY ipodate DESC, cap DESC\";\n\n foreach ($this->conn->query($sql) as $row) {\n print \"<tr> <td nowrap>\";\n print $row['id'] . \"</td><td nowrap>\";\n print $row['stockexchange'] . \"</td><td nowrap>\";\n print $row['name'] . \"</td><td nowrap>\";\n print $row['ipodate'] . \"</td><td nowrap>\";\n print $row['symbol'] . \"</td><td nowrap>\";\n print $row['price'] . \"</td><td nowrap>\";\n print $row['cap'] . \"</td><td nowrap>\";\n print $row['created_at'] . \"</td><td nowrap>\";\n print $row['sector'] . \"</td><td nowrap>\";\n print $row['industry'] . \"</td></tr>\";\n }\n print \"</table>\";\n }", "function listerchambre(){\n \n try {\n $sql = \"SELECT * FROM chambre_hospitalisation ORDER BY id_chambre DESC\";\n \n// $resultat = $this->executeRequete($sql)->fetchAll();\n $result = $this->executeRequete($sql)->fetchAll();\n \n// var_dump($resultat);\n// die();\n return $result;\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "function sqlGradeList()\n\t{\n\t\t//echo '<hr>Nama class ini :' . __METHOD__ . '()<hr>';\n\t\t$sql = \" SELECT * FROM tbl_grade \"\n\t\t. \"\";\n\n\t\treturn $sql;\n\t}", "function setRelevantItems($dbh, $rubriek_op_laagste_Niveau, $voorwerp)\n{\n $relevantItems = '';\n try {\n $stmt = $dbh->prepare(\"SELECT top 4 v.voorwerpnummer, v.titel, v.looptijdEindmoment, (SELECT TOP 1 filenaam FROM bestand f WHERE v.voorwerpnummer = f.voorwerp) AS bestandsnaam, MAX(Bodbedrag) AS hoogsteBod, CURRENT_TIMESTAMP AS serverTijd FROM Voorwerp v left join Bod b ON v.voorwerpnummer = b.voorwerp join VoorwerpInRubriek r ON v.voorwerpnummer = r.voorwerp WHERE r.rubriek_op_laagste_Niveau = :rubriek_op_laagste_Niveau AND voorwerpnummer != :voorwerpnummer and veilinggesloten = 0 GROUP BY Voorwerpnummer, titel, looptijdEindmoment\"); /* prepared statement */\n $stmt->bindValue(\":voorwerpnummer\", $voorwerp, PDO::PARAM_STR);\n $stmt->bindValue(\":rubriek_op_laagste_Niveau\", $rubriek_op_laagste_Niveau, PDO::PARAM_STR); /* helpt tegen SQL injection */\n $stmt->execute(); /* stuurt alles naar de server */\n while ($results = $stmt->fetch()) {\n $relevantItems .= createItemScript($results['titel'], $results['looptijdEindmoment'], $results['bestandsnaam'], $results['hoogsteBod'], $results['voorwerpnummer'], $dbh);\n }\n echo $relevantItems;\n } catch (PDOException $e) {\n echo \"Fout\" . $e->getMessage();\n header('Location: errorpage.php?err=500');\n }\n}", "public static function Znevalidni_kolize_ucastnika_vsechny($iducast) {\r\n//echo \"<hr><br>*Znevalidnuji vsechny kolize ucastnika , formular=\" . $formular;\r\n \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n //vyberu vsechny ulozene kolize z tabulky uc_kolize_table\r\n $query= \"SELECT * FROM uc_kolize_table \" .\r\n \"WHERE id_ucastnik=\" . $iducast . \" and uc_kolize_table.valid\" ;\r\n\r\n //echo \"<br>*dotaz na kolize v Znevalidni_kolize_ucastnika: \" . $query;\r\n \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute(); \r\n while($zaznam_kolize = $sth->fetch(PDO::FETCH_ASSOC)) {\r\n //echo \"<br>*Znevalidnuji kolizi: \" . $zaznam_kolize[id_uc_kolize_table];\r\n \r\n $query1 = \"UPDATE uc_kolize_table SET \" .\r\n \"valid=0 WHERE uc_kolize_table.id_uc_kolize_table=\" . $zaznam_kolize['id_uc_kolize_table'] ;\r\n $data1= $dbh->prepare($query1)->execute(); \r\n }\r\n \r\n//echo \"<hr>\";\r\n}", "function suchPerson($muster) {\n //$pre = ($_SESSION[\"preon\"])?\"%\":\"\"; //wiederspricht sich mit der Zeile danach\n $pre = isset($muster[\"pre\"])?$_SESSION[\"pre\"]:\"\";\n $fuzzy=$muster[\"fuzzy\"];\n $andor = $muster[\"andor\"];\n $rechte=berechtigung(\"cp_\");\n\n $joinCustomer = \" left join customer K on C.cp_cv_id=K.id\";\n $joinVendor = \" left join vendor V on C.cp_cv_id=V.id\";\n if ($muster[\"cp_name\"]==\"~\") {\n $where=\"and upper(cp_name) ~ '^\\[^A-Z\\].*$'\";\n } else {\n $dbf = array(\"cp_name\", \"cp_givenname\", \"cp_gender\", \"cp_title\" ,\n \"cp_street\", \"cp_zipcode\", \"cp_city\", \"cp_country\", \"country\",\n \"cp_phone1\", \"cp_fax\", \"cp_homepage\", \"cp_email\",\n \"cp_notes\", \"cp_stichwort1\",\"cp_birthday\", \"cp_beziehung\",\n \"cp_abteilung\", \"cp_position\", \"cp_cv_id\", \"cp_owener\");\n $keys=array_keys($muster);\n $anzahl=count($keys);\n $where=\"\";\n if ( isset( $muster[\"customer_name\"] ) ) {\n $whereCustomer = \"K.name ilike '$pre\" . $muster[\"customer_name\"] . \"$fuzzy'\";\n $whereVendor = \"V.name ilike '$pre\" . $muster[\"customer_name\"] . \"$fuzzy'\";\n } else {\n $whereCustomer = '1=1';\n $whereVendor = '1=1';\n }\n\n $daten=false;\n $tbl0=false;\n\n $where = array();\n for ($i=0; $i<$anzahl; $i++) {\n if (in_array($keys[$i],$dbf) && $muster[$keys[$i]]) {\n $suchwort=trim($muster[$keys[$i]]);\n $suchwort=strtr($suchwort,\"*?\",\"%_\");\n if ($keys[$i]==\"cp_birthday\") {$d=explode(\"\\.\",$suchwort); $suchwort=$d[2].\"-\".$d[1].\"-\".$d[0]; };\n if ($keys[$i]==\"cp_phone1\") {\n //Telefonnummer in beliebigen Telefonfeld suchen.\n $tmp =\"(cp_phone1 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_phone2 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_mobile1 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_mobile2 like '\".$pre.$suchwort.\"$fuzzy' \";\n $tmp .=\"or cp_satphone like '\".$pre.$suchwort.\"$fuzzy')\";\n $where[] = $tmp;\n } else {\n $where[].=$keys[$i].\" ilike '\".$pre.$suchwort.\"$fuzzy'\";\n }\n }\n }\n $where = implode (\" $andor \",$where);\n $x=0;\n }\n $felderContact=\"C.cp_id, C.cp_cv_id, C.cp_title, C.cp_name, C.cp_givenname, C.cp_fax, C.cp_email, C.cp_gender as cp_gender\";\n $felderContcatOrCustomerVendor=\"COALESCE (C.cp_country, country) as cp_country,COALESCE (C.cp_zipcode, zipcode) as cp_zipcode,\n COALESCE (C.cp_city, city) as cp_city, COALESCE (C.cp_street, street) as cp_street,\n COALESCE (NULLIF (C.cp_phone1, ''), NULLIF (C.cp_mobile1, ''), phone) as cp_phone1\";\n\n\n $rs0=array(); //leere arrays initialisieren, damit es keinen fehler bei der funktion array_merge gibt\n if ($muster[\"customer\"]){ //auf checkbox customer mit Titel Kunden prüfen\n $sql0=\"select $felderContact, $felderContcatOrCustomerVendor, K.name as name, K.language_id as language_id,\n 'C' as tbl from contacts C$joinCustomer where C.cp_cv_id=K.id and ($whereCustomer $andor $where) and $rechte order by cp_name\";\n $rs0=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs0) $rs0=array();\n }\n $rs1=array(); //s.o.\n if ($muster[\"vendor\"]){ //auf checkbox vendor mit Titel Lieferant prüfen\n $sql0=\"select $felderContact, $felderContcatOrCustomerVendor, V.name as name, V.language_id as language_id, 'V' as tbl\n from contacts C$joinVendor where C.cp_cv_id=V.id and ($whereVendor $andor $where) and $rechte order by cp_name\";\n $rs1=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs1) $rs1=array();\n }\n $rs2=array(); //s.o.\n if ( isset( $muster[\"deleted\"] ) ) { //auf checkbox deleted mit Titel \"gelöschte Ansprechpartner (Kunden und Lieferanten)\" prüfen\n // es gibt nicht nur gelöschte Personen, sonder auch Personen ohne Zuordnung zu Firmen, z.B. private Adressen\n $sql0=\"select $felderContact, C.cp_country, C.cp_zipcode, C.cp_city, C.cp_street, C.cp_phone1,\n '' as name,'P' as tbl from contacts C where $rechte and (\".$where.\") and C.cp_cv_id is null order by cp_name\";\n $rs2=$GLOBALS['dbh']->getAll($sql0);\n if (!$rs2) $rs2=array();\n }\n return array_merge($rs0,$rs1,$rs2); //alle ergebnisse zusammenziehen und zurückgeben\n}", "function tridate(){\r\n $sql=\"SELECT * FROM livraison ORDER BY date ASC\";\r\n$db = config::getConnexion();\r\n try{\r\n $liste=$db->query($sql);\r\n return $liste;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "public static function listaSabana($idsede, $idfacultad, $anio)\n {\n $sql =\"SELECT sed.nombre as sede, CONCAT(car.nombre,' - ',pe.nombre) as carreraplan, car.nombre as carrera, fac.nombre as facultad, CONCAT(per.apellido,', ',per.nombre) as persona,\n per.apellido, per.nombre,\n tp.descripcion as tipodocumento, \n per.numerodoc,\n m.nombre as materia,\n td.descripcion as tipodesignacion,\n cd.descripcion as categoria, \n cd.idcategoriadesignacion,\n edes.descripcion as estadodesignacion,\n mp.anodecursada,\n IFNULL(des.horas, 0 ) as horas,\n td.descripcion as tipo, \n if(des.adhonorem,'AD HONOREM','') as adhonorem, \n if(des.licencia,'EN LICENCIA','') as licencia, \n ded.descripcion as dedicacion,\n sed.abreviacion as sedeabreviada,\n car.idcarrera,\n YEAR(des.inicio) as ciclolectivo,\n DATE_FORMAT(des.inicio, '%d/%m/%Y') AS inicioformat, DATE_FORMAT(des.fin, '%d/%m/%Y') AS finformat,\n des.idresolucionprofesor,\n rp.resolucion,\n des.iddesignacion \n FROM designaciones des \n JOIN estados_designaciones edes ON des.idestadodesignacion = edes.idestadodesignacion\n JOIN profesores prof ON des.idprofesor = prof.idprofesor\n JOIN personas per ON prof.idpersona = per.idpersona \n JOIN tipos_documentos tp ON per.idtipodoc = tp.idtipodoc\n JOIN dedicaciones ded ON des.iddedicacion = ded.iddedicacion\n JOIN catedras cat ON des.idcatedra = cat.idcatedra \n JOIN sedes sed ON cat.idsede = sed.idsede \n JOIN materias_planes mp ON cat.idmateriaplan = mp.idmateriaplan\n JOIN materias m ON mp.idmateria = m.idmateria\n JOIN planes_estudios pe ON mp.idplanestudio = pe.idplanestudio\n JOIN carreras car ON pe.idcarrera = car.idcarrera \n JOIN facultades fac ON car.idfacultad = fac.idfacultad \n JOIN tipos_designaciones td ON des.idtipodesignacion = td.idtipodesignacion\n JOIN categoria_designaciones cd ON td.idcategoriadesignacion= cd.idcategoriadesignacion \n LEFT JOIN resoluciones_profesores rp ON des.idresolucionprofesor = rp.idresolucionprofesor\n WHERE des.idestadodesignacion = 4 AND YEAR(des.inicio)= \".$anio.\" AND car.idfacultad = \".$idfacultad.\" AND sed.idsede= \".$idsede.\" \n ORDER BY car.nombre, per.apellido; \";\n \n $q = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchAssoc($sql);\n\n return $q;\n }", "public function lihatDataGaleri(){\n\t\t$this->db->where(\"tipe\",1);\n\t\treturn $this->db->get(\"galeri\");\n\t}", "function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}", "Function donneefournisseurs()\r\n {\r\n echo \"copie des données de la table fournisseurs\";\r\n $req=\"INSERT INTO `\".Valorisation::$anneenouvelle.\"`.`fournisseurs` SELECT * FROM `\".Valorisation::$anneeancienne.\"`.`fournisseurs`\";\r\n Valorisation::$bddnew->query($req); \r\n }", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "function afficherprods(){\r\n\t\t$sql=\"SElECT * From categorie\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}", "function get_openstaandeDossiers_namen_dienst($dienst) {\n if ($dienst == 'Interventiedienst%20') {\n $dienst = 'Interventiedienst / Onthaal';\n } else {\n $dienst = urldecode($dienst);\n }\n $result = $this->db->query(\"SELECT * from islp.view_openstaande_dossiers_hitparade_dienst WHERE lower(dienst) = \\\"\" . strtolower($dienst) . \"\\\"\");\n if (!$result) {\n $this->error(\"Check query in get_openstaandeDossiers_namen_dienst in klasse functioneelBeheer_model\");\n }\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}", "function listQueryKGB() {\n\t\t\t$sql = \"select p.nik,\".static::schema.\".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as namalengkap,\n\t\t\t\t\tr.*,substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkglama as varchar), 4),3,2)+' bulan' as mklama,\n\t\t\t\t\tsubstring(right(replicate('0', 4) + cast(r.mkgbaru as varchar), 4),1,2)+' tahun '+substring(right(replicate('0', 4) + cast(r.mkgbaru as varchar), 4),3,2)+' bulan' as mkbaru,\n\t\t\t\t\tpl.golongan as golonganlama, pb.golongan as golonganbaru\n\t\t\t\t\tfrom \".self::table('pe_kgb').\" r \n\t\t\t\t\tleft join \".self::table('ms_pegawai').\" p on p.idpegawai=r.idpegawai\n\t\t\t\t\tleft join \".self::table('ms_unit').\" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pl on pl.idpangkat=r.pangkatlama\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pb on pb.idpangkat=r.pangkatbaru\";\n\t\t\t\n\t\t\tif(Modul::getRole() == 'Jab'){ //bila atasan\n\t\t\t\t$sql .= \" where p.emailatasan = '\".Modul::getUserEmail().\"'\";\n\t\t\t}\n\t\t\t\n\t\t\treturn $sql;\n\t\t}", "private function stuurmailNaarVorigeBieder(){\n $conn = getConn();\n $sql = \" SELECT G.Emailadres FROM Gebruiker G INNER JOIN Bod B ON G.Gebruikersnaam = B.Gebruikersnaam\n WHERE B.Bodbedrag = (SELECT MAX(B.Bodbedrag) FROM Bod B \n WHERE Bodbedrag < ( SELECT MAX(B.Bodbedrag) FROM Bod b ) AND Voorwerpnummer = ?)\";\n $params=array($this->voorwerpnummer);\n $stmt = sqlsrv_prepare($conn, $sql, $params);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if ($stmt) {\n while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $emailadres = $row['Emailadres'];\n $this->stuurMail($emailadres);\n }\n\n }\n else{\n die(print_r(sqlsrv_errors(), true));\n }\n\n }", "function query_sugerencia($nameColum,$nameSearch,$conexion) {\n\t\t$consulta_Sugerencia = \"SELECT * FROM sugerencia WHERE $nameColum = '$nameSearch'\";\n\t\t$resultado = $conexion -> query($consulta_Sugerencia);\n\t\t$count_Sugerencia = $resultado ->num_rows;\n\n\t\tif($count_Sugerencia >= 1) {\n\t\t\t$row = mysqli_fetch_array($resultado);\n\t\t\t$id_sugerencia = $row['id_sugerencia'];\n\t\t\t$id_orden = $row['id_orden'];\n\t\t\t$sugerencia = $row['descripcion_sugerencia'];\n\t\t\t$info_sugerencia = [\"id_sugerencia\" => $id_sugerencia, \"id_orden\" => $id_orden, \"descripcion_sugerencia\" => $sugerencia];\n\t\t\treturn $info_sugerencia;\n\t\t}\n\t}", "public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function get_bewerbungen(){\n \n $this->db->order_by('SeminarID', 'ASC');\n $query = $this->db->get('seminarbewerbung');\n return $query->result_array();\n }", "function obtenirNomEtablissementsOffrantChambres ($connexion) {\r\n\r\n $req = \"SELECT DISTINCT nom FROM Etablissement e \r\n INNER JOIN Offre o ON e.id = o.idEtab \r\n ORDER BY id\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt;\r\n\r\n }", "function afficherAvis(){\r\n\t\t$sql=\"SElECT * From avis\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}", "function show_best($a,$b,$c)\n{\n$sql = \"SELECT datum, views FROM stats_site WHERE pageid='\".$a.\"' AND modus='\".$b.\"' ORDER BY 'views' DESC LIMIT 0,$c\";\n$result = mysql_db_query(\"portal\",$sql);\necho \"<table>\";\nwhile ($zeile=mysql_fetch_array($result))\n{\nextract($zeile);\necho '<tr><td>';\nwochentag($datum);\necho '</td><td width=\"100\">'.substr($datum,8,2).'.'.substr($datum,5,2).'.'.substr($datum,0,4).'</td><td><b>'. $views .'</b></td></tr>';\n}\necho \"</table>\";\n}", "function _buildQuery_bible_versions()\n\t{\n\t\ttry \n\t\t{\n\t\t\t$db = $this->getDbo();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('b.bible_name');\n\t\t\t$query->from('`#__zefaniabible_bible_names` AS b');\n\t\t\t$db->setQuery($query);\n\t\t\t$data = $db->loadObjectList();\t\t\t\t\n\t\t}\n\t\tcatch (JException $e)\n\t\t{\n\t\t\t$this->setError($e);\n\t\t}\n\t\treturn $data;\t\t\n\t}", "function triernote(){\n\t\t$sql=\"SElECT * From hotel order by note desc\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function get_openstaandeDossiers($naam) {\n $naam = urldecode($naam);\n $result = $this->db->query(\"SELECT * FROM islp.view_openstaande_dossiers WHERE lower(opsteller) = \\\"\" . strtolower($naam) . \"\\\"\");\n if (!$result) {\n $this->error(\"Check query in get_openstaandeDossiers(naam) in klasse functioneelBeheer_model\");\n }\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "function fromOneToTheOther($db1, $table1, $db2, $table2){\n\n\t$firstRecs = dbMassData(\"SELECT * FROM \".$db1.\".\".$table1.\" WHERE Package = 'Local' OR Package IS NULL\");\n\t$secRecs = dbMassData(\"SELECT * FROM \".$db2.\".\".$table2.\" WHERE Package = 'Local' OR Package IS NULL\");\n\t\n\t\n\n\t//print_r($firstRecs);\n\tfor($i=0; $i<count($firstRecs); $i++){\n\t\t$insertString = \"\";\n\t\t$insertString1 = \"\";\n\t\t$insertString2 = \"\";\n\t\t$allKeys = array();\n\t\t$allVals = array();\n\n\t\tforeach ($firstRecs[$i] as $key => $value){\n\n\n\t\t\tif(in_array($key, $allKeys) == false){\n\t\t\t\tarray_push($allKeys, $key);\n\t\t\t}\n\t\t\tarray_push($allVals, $value);\n\n\t\t\t\n\t\t}\n\n\t\t//construct insert string\n\t\tfor($j=0; $j <count($allKeys); $j++){\n\n\t\t\tif($j == 0){\n\t\t\t\t$insertString1 = $insertString1 . \"`\".$allKeys[$j].\"`\";\n\t\t\t\t$insertString2 = $insertString2 . \"'\".str_replace(\"'\", \"\\'\", $allVals[$j]).\"'\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$insertString1 = $insertString1 . \", `\". $allKeys[$j].\"`\";\n\t\t\t\t$insertString2 = $insertString2 . \", '\". str_replace(\"'\", \"\\'\", $allVals[$j]).\"'\";\n\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$insertString = \"INSERT INTO \".$db2.\".\".$table2.\" ($insertString1) VALUES ($insertString2)\";\n\t\n\t\t//echo($insertString);\n\n\t\tdbQuery($insertString);\n\t}\n\n\n\n\t\n\n\n}", "function insert_regel_into_db($class, $regel, $geometry_type, $konvertierung_id, $stelle_id, $bereich_gml_id, $bereich_index) {\n\t\t$uml_class = $this->get_uml_classname($class);\n\n\t\t$sql = \"INSERT INTO xplankonverter.regeln\";\n\t\t$sql .= \"(class_name, factory, sql, geometrietyp, name, beschreibung, konvertierung_id, stelle_id, bereich_gml_id)\";\n\t\t$sql .= \" SELECT \";\n\t\t$sql .= \"'\" . $uml_class . \"' AS class_name, \";\n\t\t$sql .= \"'sql'::xplankonverter.enum_factory AS factory, \";\n\t\t$sql .= \"'\" . $regel . \"' AS sql, \";\n\t\tswitch($geometry_type) {\n\t\t\tcase \"ST_Point\":\n\t\t\tcase \"ST_MultiPoint\":\n\t\t\t\t$sql .= \" 'Punkte'::xplankonverter.enum_geometrie_typ AS geometrietyp, \";\n\t\t\t\t$sql .= \"'\" . $uml_class . \"_\" . $bereich_index . \"_\" . \"Punkte' AS name, \";\n\t\t\t\tbreak;\n\t\t\tcase \"ST_LineString\":\n\t\t\tcase \"ST_MultiLineString\":\n\t\t\tcase \"ST_CompoundCurve\":\n\t\t\t\t$sql .= \" 'Linien'::xplankonverter.enum_geometrie_typ AS geometrietyp, \";\n\t\t\t\t$sql .= \"'\" . $uml_class . \"_\" . $bereich_index . \"_\" . \"Linien' AS name, \";\n\t\t\t\tbreak;\n\t\t\tcase \"ST_Polygon\":\n\t\t\tcase \"ST_MultiPolygon\":\n\t\t\tcase \"ST_CurvePolygon\":\n\t\t\tcase \"ST_MultiSurface\":\n\t\t\t\t$sql .= \" 'Flächen'::xplankonverter.enum_geometrie_typ AS geometrietyp, \";\n\t\t\t\t$sql .= \"'\" . $uml_class . \"_\" . $bereich_index . \"_\" . \"Flaechen' AS name, \";\n\t\t\t\tbreak;\n\t\t}\n\t\t$sql .= \"'regel created automatically from gmlas extraction' AS beschreibung, \";\n\t\t$sql .= $konvertierung_id . \" AS konvertierung_id, \";\n\t\t$sql .= $stelle_id . \" AS stelle_id, \";\n\t\t$sql .= \"'\" . $bereich_gml_id . \"' AS bereich_gml_id \";\n\t\t#echo 'INSERT regeln: ' . $sql;\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t}", "function all($table)\n{\n try {\n //connexion bd\n $cnx = connecter_db();\n //preparer une sql\n $rp = $cnx->prepare(\"select * from $table order by id desc \");\n //executer\n $rp->execute();\n $resultat = $rp->fetchAll(); //extraire tous\n return $resultat;\n } catch (PDOException $e) {\n echo \"Erreur dans all\" . $e->getMessage();\n }\n}", "protected function getDatabaseDifferences() {}", "public function get_sql()\n {\n }", "function zhSql($w_id){\n $condition['id>?'] = $w_id;\n $rs = Data_Mysql_Table_Winchance_New::select('id,active_name,online_status,space_id', $condition, '', 50);\n if(!empty($rs)){\n import($rs);\n $w_info = end($rs);\n $w_id = (int)$w_info['id'];\n zhSql($w_id);\n }else{\n Q(\"数据关联完成'\");\n }\n}", "function afficherachats(){\n\t\t$sql=\"SElECT * From achat order by ref\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n\t catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function getAlleOogkleuren(){\n\n $sql = \"SELECT *\n FROM oogkleuren order by oogkleur asc\";\n $dbh = new PDO(DBCONFIG::$DB_CONNSTRING, DBCONFIG::$DB_USERNAME, DBCONFIG::$DB_PASSWORD);\n $resultSet = $dbh->query($sql);\n $lijst = array();\n foreach ($resultSet as $rij){\n $oogkleur=Oogkleur::create($rij['oogkleurId'],$rij[\"oogkleur\"]);\n array_push($lijst,$oogkleur);\n }\n $dbh=null;\n return $lijst;\n }", "function ambil_proyek_dpp()\n\t{\n\t\t$sql=\"SELECT * FROM irena_view_sbsn_proyek_dpp\";\n\t\treturn $this->db->query($sql);\n\t}", "function afficherProduits(){\n\t\t$sql=\"SElECT * From paniers \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t\n }", "function eateries(){\n $sql= $this->chk(\n \"SELECT \n eatery.name,\n eatery.description,\n eatery.rate\n FROM \n eatery \"\n );\n // \n $eateries= $this->sqlData($sql);\n echo ($eateries);\n }", "function sviKorisnici() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM korisnik ';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "function svaPitanja() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM pitanje ';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "abstract public function query();" ]
[ "0.63985133", "0.6234279", "0.6209573", "0.6175856", "0.61626637", "0.5964679", "0.59003776", "0.5876892", "0.5865127", "0.5861853", "0.5848731", "0.5839881", "0.5830965", "0.582932", "0.57983", "0.57590437", "0.5742291", "0.5739879", "0.5739242", "0.5731642", "0.5694837", "0.56814796", "0.56720334", "0.566114", "0.56472623", "0.5629863", "0.555345", "0.55508494", "0.55378115", "0.55130047", "0.54933697", "0.5478348", "0.54640037", "0.5457723", "0.5448756", "0.5447517", "0.5443749", "0.54363567", "0.54250747", "0.54142284", "0.5412262", "0.53942406", "0.53899425", "0.5381997", "0.5374815", "0.5369732", "0.5369694", "0.5366314", "0.53590024", "0.53590024", "0.53487253", "0.53475374", "0.5331357", "0.5330695", "0.5330667", "0.5330217", "0.5327336", "0.53268427", "0.5318382", "0.53150856", "0.53089887", "0.5303237", "0.52964", "0.52919286", "0.5288481", "0.52880996", "0.528436", "0.5282703", "0.5279378", "0.52731746", "0.5265194", "0.52586186", "0.5253799", "0.5252803", "0.52517635", "0.52489436", "0.5247844", "0.5244601", "0.5242449", "0.52389646", "0.5234095", "0.52338094", "0.52298343", "0.52221507", "0.5219422", "0.5215976", "0.5214456", "0.5212658", "0.5211671", "0.5211347", "0.5210011", "0.5206109", "0.5200813", "0.51987493", "0.5193273", "0.51895213", "0.51888454", "0.5186083", "0.5184304", "0.51831543", "0.51700896" ]
0.0
-1
return array van alle regels van BestelID
public static function getBestellingRegelsFromId($BestelID) { $sql = "SELECT * FROM bestelregel WHERE BestelID='".$BestelID."'"; $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD); $result = $dbh->query($sql); $arrBestelregel = array(); foreach ($result as $rij) { $bestelregel = new Bestelregel($rij["ProductID"], $rij["Aantal"]); array_push($arrBestelregel, $bestelregel); } $dbh = null; if (isset($arrBestelregel)) { return $arrBestelregel; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function alleBestellungen(){\n\n\t\treturn array(\n\t\t\t[\"ID\" => 1, \"Vorname\" => \"Wenke\", \"Nachname\" => \"Tautz\"],\n\t\t\t[\"ID\" => 2, \"Vorname\" => \"Christoph\", \"Nachname\" => \"Silge\"],\n\t\t\t[\"ID\" => 3, \"Vorname\" => \"Henry\", \"Nachname\" => \"Juwig\"],\n\t\t\t[\"ID\" => 4, \"Vorname\" => \"Felix\", \"Nachname\" => \"Klotzsche\"]\n\t\t);\n\t}", "function get_all_bereiche_ids_of_konvertierung($konvertierung_id) {\n\t\t# requests xp_bereich to work for all schemata\n\t\t$sql = \"\n\t\t\tSELECT \n\t\t\t\tgml_id\n\t\t\tFROM\n\t\t\t\txplan_gml.xp_bereich\n\t\t\tWHERE\n\t\t\t\tkonvertierung_id = \" . $konvertierung_id . \";\n\t\t\t\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$bereiche = pg_fetch_all_columns($ret[1]);\n\t\treturn $bereiche;\n\t}", "public function getLesIdFrais(){\r\n\t\t$req = \"select fraisforfait.id as idfrais from fraisforfait order by fraisforfait.id\";\r\n\t\t$res = PdoGsb::$monPdo->query($req);\r\n\t\t$lesLignes = $res->fetchAll();\r\n\t\treturn $lesLignes;\r\n\t}", "public function getAllID()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('u.id')\n ->from('gamers', 'u');\n $statement = $queryBuilder->execute();\n $gamersID = $statement->fetchAll();\n foreach ($gamersID as $gamerID) {\n var_dump($gamerID);\n }\n return $gamersID; \n }", "public function getAlleOogkleuren(){\n\n $sql = \"SELECT *\n FROM oogkleuren order by oogkleur asc\";\n $dbh = new PDO(DBCONFIG::$DB_CONNSTRING, DBCONFIG::$DB_USERNAME, DBCONFIG::$DB_PASSWORD);\n $resultSet = $dbh->query($sql);\n $lijst = array();\n foreach ($resultSet as $rij){\n $oogkleur=Oogkleur::create($rij['oogkleurId'],$rij[\"oogkleur\"]);\n array_push($lijst,$oogkleur);\n }\n $dbh=null;\n return $lijst;\n }", "public function eventisegnalati(){\r\n $query = \"SELECT DISTINCT idev FROM segnalazione \";\r\n\t\t$result = self::$conn->query($query);\r\n $id = array();\r\n if($result){\r\n while($row = $result->fetch_assoc()){\r\n $id[] = $row['idev']; \r\n }\r\n }\r\n return $id;\r\n }", "public function getLesIdFrais()\n {\n $requetePrepare = PdoGsb::$monPdo->prepare(//Cette requête classe les idFrais par id\n 'SELECT fraisforfait.id as idfrais '\n . 'FROM fraisforfait ORDER BY fraisforfait.id'\n );\n $requetePrepare->execute();\n return $requetePrepare->fetchAll();\n }", "public function fellows() {\n\t\t$list = array();\n\t\t$db = Db::getInstance();\n\t\t$req = $db->prepare('SELECT IdSeguace FROM Seguaci WHERE IdUtente = :id');\n\t\t$req->execute(array('id' => $this->id()));\n\t\tforeach ($req->fetchAll() as $result) {\n\t\t\t$list[] = $result['IdSeguace'];\n\t\t}\n\t\treturn $list;\n\t}", "public function getVilles()\n {\n $arrVillesSelectionnees = [];\n if (count($this->villes) > 0) {\n //dd($this->villes);\n foreach ($this->villes as $ville) {\n array_push($arrVillesSelectionnees, $ville->id);\n }\n\n return json_encode($arrVillesSelectionnees);\n } else {\n return json_encode([]);\n }\n }", "function getBkRms($ID){\r\n $inx = 0;\r\n $arrpack = array();\r\n $conn = getConnection();\r\n\r\n $stmt = $conn->prepare(\"SELECT rooms_idrooms FROM rms_reservd where reservations_idreservations = ?\");\r\n $stmt->bind_param(\"i\", $ID);\r\n \r\n $stmt->execute();\r\n\r\n $result = $stmt->get_result();\r\n\r\n if($result->num_rows > 0){\r\n while($row = $result->fetch_assoc()){\r\n $arrpack[$inx] = $row['rooms_idrooms'];\r\n $inx++;\r\n }\r\n }\r\n $conn->close(); \r\n\r\n return $arrpack;\r\n }", "public function getLesIdFrais()\n {\n $requetePrepare = PdoGsb::$monPdo->prepare(\n 'SELECT fraisforfait.id as idfrais '\n . 'FROM fraisforfait ORDER BY fraisforfait.id'\n );\n $requetePrepare->execute();\n return $requetePrepare->fetchAll();\n }", "public function getLesIdFrais()\n {\n $requetePrepare = PdoGsb::$monPdo->prepare(\n 'SELECT fraisforfait.id as idfrais '\n . 'FROM fraisforfait ORDER BY fraisforfait.id'\n );\n $requetePrepare->execute();\n return $requetePrepare->fetchAll();\n }", "public abstract function get_ids();", "function ordina_id(){\n $mysqli = connetti();\n $sql = \"SELECT * FROM spesa WHERE 1=1 ORDER BY id ASC\";\n $risultato_query = $mysqli->query($sql);\n $array_righe = [];\n while($righe_tabella = $risultato_query->fetch_array(MYSQLI_ASSOC)){\n $array_righe[] = $righe_tabella;\n }\n chiudi_connessione($mysqli);\n return $array_righe;\n}", "public function ultimoID()\n {\n $sentencia = \"SELECT id, clNumReporte FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n\n return $registros;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function getIds();", "public function getIds();", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function getIdValue()\n {\n $valores = array();\n \n foreach ($this->findBy(array(), array('nome' => 'ASC')) as $item) {\n $valores[$item->getId()] = $item->getNome();\n }\n\n return $valores;\n }", "function listeGroupes(){\n $groupes = array();\n $connexion = new Connexion();\n $query = 'SELECT * FROM GROUPE';\n $result = $connexion->query($query);\n foreach($result as $row){\n $groupes[] = array('id'=>$row['id'],'libelle'=>$row['libelle'],'nombre'=>$row['nombre']);\n }\n return $groupes;\n}", "public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}", "function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "private function telaPerfilGerente()\r\n {\r\n //Carregando as lojas do banco de dados\r\n $repositorio = $this->getDoctrine()->getRepository('DCPBundle:Quebra');\r\n\r\n $sql = $repositorio->createQueryBuilder('l')\r\n ->select('l.id')\r\n ->groupby('l.id')\r\n ->getquery();\r\n\r\n $resultado = $sql->getResult();\r\n\r\n $loja = array();\r\n $contLoja = 0;\r\n foreach($resultado as $data)\r\n {\r\n if (!in_array($data, $loja))\r\n {\r\n $loja[$contLoja] = $data[\"id\"];\r\n $contLoja++;\r\n }\r\n }\r\n \r\n return $loja;\r\n }", "function getAllRitten($gebruikerId) {\n $this->db->where('gebruikerIdVrijwilliger', $gebruikerId);\n $query = $this->db->get('rit');\n return $query->result();\n }", "public function getEpisodeIds(){\n $result = array();\n $progam = null;\n $con = $this->mysqli->prepare(\n \"SELECT EpNum FROM episode where programName=? and callsign=?\");\n $con->bind_param('ss',$this->name,$this->callsign);\n $con->bind_result($progam);\n if($con->execute()){\n while($con->fetch()){\n array_push($result, $progam);\n }\n return $result;\n }\n else{return false;}\n }", "public static function getAllSchoolIds(){\n $schoolIds = array();\n $result = mysql_query(\"SELECT id FROM school\") or die(mysql_error());\n while($row = mysql_fetch_array($result)){\n array_push($schoolIds, $row['id']);\n }\n return $schoolIds;\n }", "function getChambreListId(){\n try {\n $sql = 'select id_chambre, numero_chambre from chambre_hospitalisation order by id_chambre desc';\n $resilt = $this->executeRequete($sql)->fetchAll();\n return $resilt;\n //var_dump($resilt);\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "public function getAllIds(): array;", "public function GetId()\n\t{\n\t\t$datas = $this->db->query('select DISTINCT id_komponenbiaya from masterkomponenbiaya order by id_komponenbiaya asc');\n\t\treturn $datas;\n\t}", "function ss_hammerOID_pollers_indexes() {\n\n $return_arr = array();\n\t\t\n\t$rows = db_fetch_assoc(\"SELECT id FROM poller\");\n\n\n for ($i=0;($i<sizeof($rows));$i++) {\n $return_arr[$i] = $rows[$i]['id'];\n }\n\n return $return_arr;\n}", "public static function readAllId() {\n try {\n $database = SModel::getInstance();\n $query = \"select id from producteur\";\n $statement = $database->prepare($query);\n $statement->execute();\n $results = array();\n while ($tuple = $statement->fetch()) {\n $results[] = $tuple[0];\n }\n return $results;\n } catch (PDOException $e) {\n printf(\"%s - %s<p/>\\n\", $e->getCode(), $e->getMessage());\n return NULL;\n }\n }", "public function getIdArray()\n {\n $idArray = array();\n\n foreach ($this as $importedVideo) {\n $idArray[] = $importedVideo->id;\n }\n\n return $idArray;\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function listId()\n {\n return $this->contractor->all()->pluck('id')->all();\n }", "public function obtenerViajesplus();", "protected function groeperingen()\n\t{\n\t\t$query = $this->connection->table('handelaars_groepering');\n\t\t$groeperingen = $query->where('handelaarid', $this->handelaarid)\n\t\t\t->get(array('groeperingid'));\n\t\t$this->groeperingen = array_map(function($item)\n\t\t{\n\t\t\treturn $item->groeperingid;\n\t\t}, $groeperingen);\n\t}", "function globalUniqueShoeGenRefs(){\n\t\t\n\t\t$global_parents_data=array();\n\t\t$global_parents_data_file=array();\n\t\t$global_parents_xls_file=array();\n\t\t$genData=CepClLahalleShoeGen::select('lahs_nomod','lahs_reference','lahs_reference_folder','lahs_export_filename')\n\t\t\t\t\t\t\t\t\t ->where('lahs_status','=',1)->get();\n\t\t\n\t\t//echo \"<pre>\"; print_r($genData);\n\t\tforeach ($genData as $key => $value) {\n\t\t\t$global_parents_data[]=$value['lahs_nomod'];\n\t\t\t$global_parents_data_file[$value['lahs_nomod']]=$value['lahs_reference'];\n\t\t\t$global_parents_xls_file[$value['lahs_nomod']]=$value['lahs_export_filename'];\n\t\t}\n\t\t\t\n\t\t\n\t\t//$res=mysql_fetch_array($res);\n\t\treturn array($global_parents_data,$global_parents_data_file,$global_parents_xls_file);\n\t}", "public function get_bewerbungen(){\n \n $this->db->order_by('SeminarID', 'ASC');\n $query = $this->db->get('seminarbewerbung');\n return $query->result_array();\n }", "public static function liste_id_type_salle() {\n\t\t\t$listeId = Array();\n\t\t\ttry {\n\t\t\t\t$pdoOptions[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;\n\t\t\t\t$bdd = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME, DB_LOGIN, DB_PASSWORD, $pdoOptions);\n\t\t\t\t$bdd->query(\"SET NAMES utf8\");\n\t\t\t\t$req = $bdd->prepare(\"SELECT id FROM \".Type_Salle::$nomTable.\" ORDER BY nom\");\n\t\t\t\t$req->execute();\n\t\t\t\twhile ($ligne = $req->fetch()) {\n\t\t\t\t\tarray_push($listeId, $ligne['id']);\n\t\t\t\t}\n\t\t\t\t$req->closeCursor();\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\techo \"Erreur : \".$e->getMessage().\"<br />\";\n\t\t\t}\n\t\t\treturn $listeId;\n\t\t}", "public function getVakterInnenDogn()\n {\n $vakterInnenDogn = array();\n if ($this->harVakt()) {\n foreach (VaktListe::medBrukerId($this->brukerId) as $vakt) {\n if (floor((strtotime($vakt->getDato()) - time()) / (60 * 60 * 24)) <= 1 && !$vakt->erFerdig()) {\n $vakterInnenDogn[] = $vakt;\n }\n }\n }\n return $vakterInnenDogn;\n }", "public function getGenres()\n {\n $sql = \"select G.GEN_ID as id, GEN_NOM as nom, count(ALB_ID) AS nbAlbums \" .\n \"from T_GENRE G left join T_ALBUM A on G.GEN_ID=A.GEN_ID group by G.GEN_ID order by GEN_NOM\";\n return $this->executerRequete($sql);\n }", "function galerien_liste()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s\n\t\t\t\t\t\tORDER BY bgalg_order_id\",\n\t\t\t$this->db_praefix.\"ecard_galerien\"\n\t\t);\n\t\t$temp_return = $this->db->get_results($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "public function getLesAppartenancesGenre($idGenre){\r\n // Dialogue avec la BDD\r\n $mesAppartenances = DB::table('appartenir')\r\n ->where('NUMGENRE', $idGenre)\r\n ->select()\r\n ->get();\r\n return $mesAppartenances;\r\n }", "public function get_all_godzina_better(){\n\t\t$data=array();\n\t\t$query = $this->db->query('select * from godzina');\t\n\t\tforeach($query->result() as $row){\n\t\t\t\tarray_push($data,array(\n\t\t\t\t'id_godzina'=>$row->id_godzina,\n\t\t\t\t'godzina'=>substr($row->godzina,0,5)\n\t\t\t\t));\n\t\t\t\n\t\t}\n\t\treturn $data;\n\t}", "public function getNivelesArray()\n {\n $niveles = $this->getNiveles(); \n $ArrayNiv = Array();\n if ($niveles) {\n foreach ($niveles as $niv){\n $ArrayNiv[$niv['id']] = $niv['nivNombre'];\n }\n }\n return $ArrayNiv;\n }", "public function getArrayAllEngineers(){\n $query = $this->db->query(\"\n SELECT \n CONCAT(n_name_user, ' ', n_last_name_user) AS name, \n k_id_user AS id\n FROM user WHERE n_role_user = 'ingeniero'\n \");\n $ingenieros = [];\n for ($i=0; $i < count($query->result_array()); $i++) { \n $ingenieros[$i]['name'] = $query->result_array()[$i]['name'];\n $ingenieros[$i]['id'] = $query->result_array()[$i]['id'];\n }\n return $ingenieros;\n }", "public function getById($id) {\r\n $sql = \"SELECT * FROM bestelling inner join bestelregel on bestelregel.betellingid=bestelling.idwhere id=?\";\r\n $args = func_get_args();\r\n $stmt = parent::execPreppedStmt($sql, $args);\r\n $result = $stmt->fetch();\r\n foreach ($resultSet as $result) {\r\n $bestelling = Bestelling:: create($result['id'], $result['userid'], $result['tijdstip']);\r\n $bestelregel = Bestelregel:: create($result['bestelregelid'], $result['bestelregelprijs'], $bestelling);\r\n $arr[] = $bestelregel;\r\n }\r\n return $arr;\r\n }", "public static function getRegencies() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName('a.id', 'value'));\n\t\t$query->select($db->quoteName('a.name', 'text'));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_regencies', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t\n\t\t$db->setQuery($query);\n\t\t$data = $db->loadObjectList();\n\n\t\tarray_unshift($data, (object) array(\n\t\t\t'value' => 0,\n\t\t\t'text' => 'Semua Kabupaten/Kota'\n\t\t));\n\n\t\treturn $data;\n\t}", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(Salesperson::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "function recupererid(){\n\t\t$sql=\"select max(idres) maximum from reservation \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\t foreach($liste as $row){$id=$row['maximum'] ;}\n\t\t return $id;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function gen_dd_array()\n {\n $vec = array();\n if($result = $this->get($this->_table) )\n {\n foreach($result as $reg)\n { \n $vec[$reg->id] = $reg->name;\n }\n }\n return $vec;\n }", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "function getEventIDs() {\n\t\t$return = array();\n\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$return[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getLangileak()\n\t{\n\t\t$sql = 'SELECT DISTINCT e.user_id AS id'\n\t\t . ' FROM sf_guard_user_group e,'\n\t\t . ' sf_guard_group s'\n\t\t . ' WHERE s.id = e.group_id'\n\t\t . ' AND s.id = :saila';\n\n\t\t$parametroak = array();\n\t\t$parametroak[':saila'] = $this->getId();\n\n\t\t$cn = Doctrine_Manager::getInstance()->connection();\n\t\t$cmd = $cn->prepare($sql);\n\t\t$cmd->execute($parametroak);\n\t\t$cursor = $cmd->fetchAll(PDO::FETCH_ASSOC);\n\t\t$cmd->closeCursor();\n\n\t\t$erabiltzaileak = array();\n\t\tforeach ($cursor as $registro)\n\t\t{\n\t\t\tarray_push($erabiltzaileak, $registro[\"id\"]);\n\t\t}\n\n\t\treturn $erabiltzaileak;\n\t}", "function getIdBosses() {\n return $this->idBosses;\n }", "function get_all_id(K_Laravel_Creator\\Models\\Base_Model $base_mobel) {\n $model_datas = $base_mobel->all();\n //error_log($model_datas);\n $model_id = array();\n foreach($model_datas as $model_data){\n array_push($model_id,$model_data['id']);\n }\n return $model_id;\n}", "public function getListeGenre() {\n try {\n $lesGenres = DB::table('GENRE')\n ->Select('IDGENRE','LIBELLEGENRE')\n\n ->get();\n return $lesGenres;\n } catch (QueryException $e) {\n throw new MonException($e->getMessage());\n }\n }", "public static function getGatewayListID(){\n $row = Gateway::where(array('Status'=>1))->lists('Title', 'GatewayID');\n if(!empty($row)){\n $row = array(\"\"=> \"Select a Gateway\")+$row;\n }\n return $row;\n }", "public function getDataForMakeIdMethod(): array\n {\n return [\n 0 => [\n 0 => [\n 'userId' => 8,\n ],\n ],\n ];\n }", "static public function visAlle() {\n $alle_stikkord = array();\n\n try {\n $setning = self::$db->prepare(\"SELECT * FROM Stikkord\");\n $setning->execute();\n\n while ($stikkord = $setning->fetchObject('Stikkord') )\n {\n $alle_stikkord[] = $stikkord;\n\n }\n\n }\n catch (Exception $e) {\n print $e->getMessage() . PHP_EOL;\n }\n\n return $alle_stikkord;\n\n }", "public function get_bydeler_info()\n\t{\n\t\t$bydeler = array();\n\t\tforeach (game::$bydeler as $bydel)\n\t\t{\n\t\t\t$bydeler[$bydel['id']] = array(\n\t\t\t\t\"cars\" => 0,\n\t\t\t\t\"b_id\" => $bydel['id'],\n\t\t\t\t\"b_active\" => $bydel['active'],\n\t\t\t\t\"ff_id\" => null,\n\t\t\t\t\"ff_name\" => null,\n\t\t\t\t\"garage\" => null,\n\t\t\t\t\"garage_max_cars\" => null,\n\t\t\t\t\"garage_free\" => 0,\n\t\t\t\t\"garage_next_rent\" => null\n\t\t\t);\n\t\t}\n\t\t\n\t\t// antall biler vi har i de ulike bydelene (garasjene)\n\t\t$result = \\Kofradia\\DB::get()->query(\"\n\t\t\tSELECT b_id, COUNT(id) AS ant\n\t\t\tFROM users_gta\n\t\t\tWHERE ug_up_id = \".$this->up->id.\"\n\t\t\tGROUP BY b_id\");\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (!isset($bydeler[$row['b_id']])) continue;\n\t\t\t$bydeler[$row['b_id']]['cars'] = $row['ant'];\n\t\t}\n\t\t\n\t\t// informasjon om garasjene vi har\n\t\t$result = \\Kofradia\\DB::get()->query(\"\n\t\t\tSELECT ugg_b_id, ugg_places, ugg_time_next_rent, ff_id, ff_name\n\t\t\tFROM users_garage\n\t\t\t\tLEFT JOIN ff ON ff_id = ugg_ff_id\n\t\t\tWHERE ugg_up_id = \".$this->up->id);\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\tif (!isset($bydeler[$row['ugg_b_id']])) continue;\n\t\t\t$bydeler[$row['ugg_b_id']]['garage'] = true;\n\t\t\t$bydeler[$row['ugg_b_id']]['ff_id'] = $row['ff_id'];\n\t\t\t$bydeler[$row['ugg_b_id']]['ff_name'] = $row['ff_name'];\n\t\t\t$bydeler[$row['ugg_b_id']]['garage_max_cars'] = $row['ugg_places'];\n\t\t\t$bydeler[$row['ugg_b_id']]['garage_free'] = max(0, $row['ugg_places'] - $bydeler[$row['ugg_b_id']]['cars']);\n\t\t\t$bydeler[$row['ugg_b_id']]['garage_next_rent'] = $row['ugg_time_next_rent'];\n\t\t}\n\t\t\n\t\treturn $bydeler;\n\t}", "function Array_Get_Lugares()\n{\n $lugares = consultar(\"SELECT * FROM tb_lugares \"); \n $datos = array();\n while ($valor = mysqli_fetch_array($lugares)) {\n $id_lugares = $valor['id_lugar'];\n $nombre = $valor['nombre'];\n $vector = array(\n 'id_lugares'=>\"$id_lugares\",\n 'nombre' => \"$nombre\",\n );\n array_push($datos, $vector);\n }\n\n return $datos; \n}", "function getRooms($id) {\n\t\t$query = \"SELECT node FROM sentinels WHERE profId='$id' AND deleted!='1' ORDER BY timeBuilt DESC\";\n\n\t\t$dbc = connect_to_db();\n\t\t$result = perform_query($dbc, $query);\n\n\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t$online[] = $row;\n\t\t}\n\t\tdisconnect_from_db($dbc, $result);\n\n\t\t$resultAr = array();\n\t\tif (!empty($online)) {\n\t\t\tforeach ($online as $a => $b) {\n\t\t\t\tforeach ($b as $c => $a) {\n\t\t\t\t\tarray_push($resultAr, $b[$c]);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\t\treturn $resultAr;\n\t}", "public function get_genres_array()\n {\n // use a defined function to get the rows we need.\n $results = $this->get_genres();\n $genres = [];\n\n // fill in the blank array using a foreach loop.\n foreach ($results as $row) $genres[$row['genre_id']] = $row['genre_title'];\n return $genres;\n }", "public function getAllVisiteurs(){\r\n\t\t$req =\"select * from visiteur where comptable=0\";\r\n\t\t\r\n\t\t$res = PdoGsb::$monPdo->query($req);\r\n\t\t$lesVisiteurs =array();\r\n\t\t$laLigne = $res->fetch();\r\n\t\twhile($laLigne != null)\t{\r\n\t\t\t$selection = $laLigne['id'];\r\n $nom=$laLigne['nom'];\r\n $prenom=$laLigne['prenom'];\r\n\t\t\t$lesVisiteurs[\"$selection\"]=array(\r\n \"id\"=>\"$selection\",\r\n \"nom\"=>\"$nom\",\r\n \"prenom\"=>\"$prenom\"\r\n );\r\n\t\t\t$laLigne = $res->fetch(); \t\t\r\n\t\t}\r\n\t\treturn $lesVisiteurs;\r\n\t}", "private function getGriidcStaff(): array\n {\n $entityManager = $this->getDoctrine()->getManager();\n //get user Ids of Griidc Staff to exclude from the report with personDataRepository roles of:\n //Manager (1), Developer (2), Support (3), Subject Matter Expert (4)\n $griidcUserQueryString = 'SELECT account.userId FROM ' . PersonDataRepository::class .\n ' personDataRepository JOIN ' . Person::class .\n ' person WITH person.id = personDataRepository.person JOIN ' . Account::class .\n ' account WITH account.person = person.id WHERE personDataRepository.role in (1, 2, 3, 4) ';\n $griidcUserResult = $entityManager->createQuery($griidcUserQueryString)->getScalarResult();\n return array_column($griidcUserResult, 'userId');\n }", "public function sigLeadershipsIds()\n {\n return $this->sigs()->where('main', 1)->lists('id')->toArray();\n }", "public static function getHotelAsArray() {\n \t$table = new Hotel();\n \t$where = $table->select()->order(\"name ASC\");\n \t$rows = $table->fetchAll($where);\n \t$ret = array();\n \tforeach ($rows as $row) {\n \t\t$ret[$row->id] = $row->name;\n \t}\n \treturn $ret;\n }", "protected function getNids() {\n // Reload view to avoid cache issues.\n // Be warned, this only works if view returns exactly the same results in the same order!\n // If the sort createria are ambicious, duplicates are shown, in which case it's necessarry to add another\n // sort createria\n $view = Views::getView($this->view->id());\n $nids = [];\n $view->setDisplay($this->options['display']);\n $view->preExecute();\n $view->execute();\n foreach ($view->result as $row) {\n $nids[] = $row->nid;\n }\n return $nids;\n }", "public function getReverseEngineeringRelicIDs()\n {\n return $this->reverseEngineeredFromRelicIDs;\n }", "public function getAllIds();", "public function get_ids($rodada,$categoria=null){\n $where = '';\n if ($categoria){\n $where = \"where ranking='$categoria'\";\n }\n $q = \"select id from $rodada $where order by confirmado desc, quadra, ranking, desafiante_posicao\";\n $lista = $this->banco->consultar($q);\n foreach ($lista as $par){\n $ids[] = $par['id'];\n }\n return $ids;\n }", "public function listId() {\n\t\treturn $this->academic_session->all()->pluck('id')->all();\n\t}", "function getIds( array $Objects );", "public function get_genres()\n {\n return $this->db->get('tbl_genre')->result_array();\n }", "public function getAgentIds() {\n $retVal = [];\n foreach ($this->rAgents as $agent) {\n $retVal[] = $agent->id;\n }\n return $retVal;\n }", "public function getId_recette()\n {\n return $this->_id_recette;\n }", "public function getIds()\n {\n\n }", "public static function obtenerEmpresas(){ \n $partidas = self::find() \n ->orderBy('razon_social')\n ->all();\n return ArrayHelper::map($partidas,'empresa_id','razon_social');\n }", "function getOrderByID($ID){\r\n $inx = 0;\r\n $arrpack = array();\r\n $conn = getConnection();\r\n\r\n $stmt = $conn->prepare(\"SELECT A.am_name, B.quantity, B.price FROM billing_ords B, amenities A where B.amenities_idamenities = A.idamenities and B.bo_idreservations = ?\");\r\n $stmt->bind_param(\"i\", $ID);\r\n \r\n $stmt->execute();\r\n\r\n $result = $stmt->get_result();\r\n\r\n if($result->num_rows > 0){\r\n while($row = $result->fetch_assoc()){\r\n $arrpack[$inx][0] = $row['am_name'];\r\n $arrpack[$inx][1] = $row['quantity'];\r\n $arrpack[$inx][2] = $row['price'];\r\n $inx++;\r\n }\r\n }\r\n $conn->close(); \r\n\r\n return $arrpack;\r\n }", "public function getObjectIds();", "static public function visAlleForInnlegg(int $Innlegg_id) {\n\n $stikkordTabell= array();\n\n try\n {\n\n $setning = self::$db->prepare(\"SELECT Stikkord.id, Stikkord.tekst, Innlegg_stikkord.Innlegg_id FROM Stikkord, Innlegg_stikkord WHERE Stikkord.id=Innlegg_stikkord.Stikkord_id AND Innlegg_stikkord.Innlegg_id = :id\");\n $setning->bindParam(':id',$Innlegg_id,PDO::PARAM_INT);\n $setning->execute();\n\n while ($stikkord = $setning->fetchObject('Stikkord') )\n {\n $stikkordTabell[] = $stikkord;\n }\n\n }\n catch (Exception $e) {\n print $e->getMessage() . PHP_EOL;\n }\n\n return $stikkordTabell;\n }", "public static function winnersIds()\n {\n return DB::table('competitionentries')->where('winner', '=', 1)->get();\n }", "protected function _getLeveranciersData($id){\n\t\t$lMdl \t\t\t= new App_Model_Leverancierproduct();\n\t\t$leveranciers \t= $lMdl->fetchByProduct($id);\n\t\t\n\t\treturn $leveranciers;\n\t}", "function formulaires_joindre_infographies_donnees_identifier_dist($id_infographies_data, $retour='', $config_fonc='infographies_edit_config'){\n\treturn serialize(array(intval($id_infographies_data)));\n}", "public function getListeVisiteurs(){\n\t\t$req = \"select * from visiteur order by VIS_MATRICULE\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetchAll();\n\t\treturn $ligne;\n\t}", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getSekolahId();\n $pks[1] = $this->getSemesterId();\n $pks[2] = $this->getIdRuang();\n $pks[3] = $this->getHari();\n\n return $pks;\n }", "public function IngredientesPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM ingredientes LEFT JOIN proveedores ON ingredientes.codproveedor = proveedores.codproveedor WHERE ingredientes.codingrediente = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codingrediente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function get_all_genero()\n {\n $genero = $this->db->query(\"\n SELECT\n *\n\n FROM\n `genero`\n\n WHERE\n 1 = 1\n\n ORDER BY `genero_id` DESC\n \")->result_array();\n\n return $genero;\n }", "public function primopiano(){\r\n $query = \"SELECT idev, owner FROM primopiano\";\r\n\t\t$result = self::$conn->query($query);\r\n $id =array();\r\n if($result){\r\n while($row = $result->fetch_assoc()){\r\n $id[] = $row['idev']; \r\n }\r\n }\r\n return $id;\r\n }", "public function getIdre()\n {\n return $this->idre;\n }", "public function getIdDetalles()\n {\n $sql = \"SELECT id_detalle FROM detalle_solicitud\";\n $params = array(null);\n return Database::getRows($sql, $params);\n }", "function kuva_puurid(){\n\tif(isset($_SESSION['user'])) {\n\t\tglobal $connection;\n\t\t$puurid = array();\n\t\t$query = \"SELECT DISTINCT(puur) FROM anita_loomaaed ORDER BY puur\";\n\t\t$result = mysqli_query($connection, $query) or die (\"$query - \". mysqli_error($connection));\n\t\twhile($rida = mysqli_fetch_assoc($result)){\n\t $puuriId = $rida['puur'];\n\t \t$puuriQuery = \"SELECT * FROM anita_loomaaed WHERE puur=$puuriId\";\n\t \t$puuriResult = mysqli_query($connection, $puuriQuery) or die (\"$puuriQuery - \". mysqli_error($connection));\n\t while($puuriLoom = mysqli_fetch_assoc($puuriResult)){ \n \t$puurid[$puuriId][] = $puuriLoom;\n }\n\t}\n\t\tinclude_once('views/puurid.html');\n\t}\n\n\telse {\n\t\tinclude_once('views/login.html');\n\t}\n\t/*\n\techo \"<pre>\";\n\tprint_r($puurid);\n\techo \"</pre>\";\n\t*/\n}" ]
[ "0.65718067", "0.64814", "0.6462641", "0.6409762", "0.6257897", "0.6219593", "0.6206344", "0.6188429", "0.61761147", "0.6148916", "0.6142261", "0.6134887", "0.613374", "0.6104324", "0.60840917", "0.6064643", "0.6064643", "0.6048372", "0.6033722", "0.6021515", "0.601085", "0.6005723", "0.6002407", "0.59985274", "0.5986837", "0.59493744", "0.5919081", "0.59169936", "0.5910605", "0.5896194", "0.58905923", "0.588209", "0.5874228", "0.5874228", "0.5874228", "0.5874228", "0.5874228", "0.5874228", "0.5874228", "0.5874228", "0.5854368", "0.5851874", "0.58349055", "0.58219355", "0.5821739", "0.5801541", "0.58003354", "0.5796343", "0.57821745", "0.5774514", "0.5770177", "0.5769639", "0.5762144", "0.57621306", "0.57618344", "0.575957", "0.57578975", "0.5750516", "0.5744649", "0.5736509", "0.5731775", "0.5722695", "0.57199734", "0.57137716", "0.57129544", "0.5706753", "0.57058024", "0.5696248", "0.5694376", "0.56926244", "0.56925714", "0.56888276", "0.568053", "0.5679947", "0.56796056", "0.5656518", "0.5650031", "0.56482244", "0.56319386", "0.56302017", "0.56215787", "0.5611746", "0.56055844", "0.560422", "0.55994874", "0.55941886", "0.55930114", "0.55913347", "0.5588301", "0.558725", "0.55824697", "0.55812526", "0.5578933", "0.5574879", "0.55739677", "0.5571577", "0.5571231", "0.55638516", "0.5561762", "0.55605996" ]
0.7542626
0
Menampilkan halaman pembuatan kelas
public function newClass() { $listCategories = Categories::where('deleted_at', '=', null)->orderBy('name', 'asc')->get(); $listSpeakers = Speakers::where('deleted_at', '=', null)->orderBy('name', 'asc')->get(); return view('pages.admin.class.addClass', compact('listCategories', 'listSpeakers')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function halamanbaru(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_halaman->halamanstatis();\n\t\t$data['record2'] = $this->model_halaman->en_halamanstatis();\n\t\t$this->load->view('administrator/mod_halaman/view_halaman2',$data);\n\t}", "public function aksi_tambah_pengikut_suket014()\n\t{\n\t\t$id_permohonan = $this->input->post('id_permohonan_surat');\n\n\t\t$data_pengikut = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'umur' => $this->input->post('umur'),\n\t\t\t'status_perkawinan' => $this->input->post('status_perkawinan'),\n\t\t\t'pendidikan_terakhir' => $this->input->post('pendidikan_terakhir'),\n\t\t\t'nama_ortu' => $this->input->post('nama_ortu'),\n\t\t\t'status_hub_kk' => $this->input->post('status_hub_kk'),\n\t\t);\n\n\t\t$this->m_warga->aksi_tambah_pengikut($data_pengikut);\n\n\t\t$this->session->set_flashdata('success', 'ditambahkan');\n\t\tredirect('warga/list_pengikut_suket014/' . $id_permohonan);\n\t}", "public function aksi_tambah_permohonan_suket013()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat_tinggal' => $this->input->post('alamat_tinggal'),\n\t\t\t'penghasilan' => $this->input->post('penghasilan'),\n\t\t\t'terbilang' => $this->input->post('terbilang'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_penghasilan');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket013/' . $id_surat . '/' . $id_permohonan);\n\t}", "function data_mhs(){\r\n\t\t\techo \"KodeMataKuliah : \".$this->KodeMataKuliah.\"<br />\";\r\n\t\t\techo \"SKS : \".$this->SKS.\"<br />\";\r\n\t\t\techo \"Daftar matakuliah yang diambil:<br />\";\r\n\t\t\t\r\n\t\t\t$i = 0; // nomor urut daftar SKS matakuliah yang diambil\r\n\t\t\tforeach($this->NamaMataKuliah as $mk){\r\n\t\t\t\techo ++$i.\". \".$mk.\"<br />\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Cuma buat ganti baris aja kok :-)\r\n\t\t\techo \"<br />\";\r\n\t\t}", "public function aksi_tambah_permohonan_suket003()\n\t{\n\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat_tinggal' => $this->input->post('alamat_tinggal'),\n\t\t\t'keperluan' => $this->input->post('keperluan'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_belum_memiliki_rumah');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket003/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function tambahsoal()\n\t{\n\t\t$data['title'] = 'Tambah Soal';\n\t\t$data['listmapel'] = $this->m_admin->list_mapel()->result();\n\t\t$data['listkelas'] = $this->m_admin->list_kelas()->result();\n\t\t$data['listguru'] = $this->m_admin->list_guru()->result();\n\n\t\t$this->header($data);\n\t\t$this->load->view('tambahsoal');\n\t\t$this->load->view('template/footer');\n\t}", "public function pembatalan_angsuran()\n\t{\n\t\t$data['container'] = 'transaction/pembatalan_angsuran';\n\t\t$this->load->view('core',$data);\n\t}", "public function bernafas()\n \t{\n \t\techo 'Bernafas menggunakan hidung, '.PHP_EOL;\n \t}", "public function aksi_tambah_pengikut_suket012()\n\t{\n\t\t$id_permohonan = $this->input->post('id_permohonan_surat');\n\n\t\t$data_pengikut = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'umur' => $this->input->post('umur'),\n\t\t\t'status_perkawinan' => $this->input->post('status_perkawinan'),\n\t\t\t'pendidikan_terakhir' => $this->input->post('pendidikan_terakhir'),\n\t\t\t'nama_ortu' => $this->input->post('nama_ortu'),\n\t\t\t'status_hub_kk' => $this->input->post('status_hub_kk'),\n\t\t);\n\n\t\t$this->m_warga->aksi_tambah_pengikut($data_pengikut);\n\n\t\t$this->session->set_flashdata('success', 'ditambahkan');\n\t\tredirect('warga/list_pengikut_suket012/' . $id_permohonan);\n\t}", "public function aksi_tambah_permohonan_suket004()\n\t{\n\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama_benar' => $this->input->post('nama_benar'),\n\t\t\t'nama_salah' => $this->input->post('nama_salah'),\n\t\t\t'nama_dokumen_benar' => $this->input->post('nama_dokumen_benar'),\n\t\t\t'nama_dokumen_salah' => $this->input->post('nama_dokumen_salah'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat' => $this->input->post('alamat'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_beda_nama');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket004/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function index() \n {\n\t\t$this->papar->senaraiPegawai['biodata'] = $this->tanya->cariMedan('nama_pegawai', \n\t\t\t'namaPegawai,Nama_Penuh,email,nohp,unit', \n\t\t\tarray('medan'=>'unit', 'id'=>'ekonomi'));\n\t\n\t\t//\n\t\t$this->papar->ralat = null;\n\t\t\n\t\t$this->papar->pegawai = senarai_kakitangan();\n $this->papar->baca($this->_folder . '/index', 0);\n }", "public function aksi_tambah_permohonan_suket006()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat_tinggal' => $this->input->post('alamat_tinggal'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_belum_pernah_menikah');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket006/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function aksi_tambah_permohonan_suket001()\n\t{\n\t\t// $kades = $this->m_warga->cek_kades();\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t// 'id_kades' => $kades['id_kades'],\n\t\t\t'status' => $this->input->post('status'),\n\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat' => $this->input->post('alamat'),\n\t\t\t'nama_usaha' => $this->input->post('nama_usaha'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_usaha');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket001/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function tambah(){\n $this->template->views('crud/tambah_mahasiswa'); //untuk menampilkan view tambah_mahasiswa\n }", "public function laporan()\n\t{\n\n\t\t$data['halaman'] = 'view_laporan';\n\t\t$this->load->view('admin/page', $data);\n\t}", "public function aksi_tambah_permohonan_suket005()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'alamat' => $this->input->post('alamat'),\n\t\t\t'nama_kegiatan' => $this->input->post('nama_kegiatan'),\n\t\t\t'hari_kegiatan' => $this->input->post('hari_kegiatan'),\n\t\t\t'tanggal_kegiatan' => $this->input->post('tanggal_kegiatan'),\n\t\t\t'jam' => $this->input->post('jam'),\n\t\t\t'tempat' => $this->input->post('tempat'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_izin_keramaian');\n\t\tif ($_FILES != null) {\n\t\t\t$this->aksi_upload_lampiran_suket005($id_surat);\n\t\t}\n\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket005/' . $id_surat . '/' . $id_permohonan);\n\t}", "function salah()\n\t{\n\t\t# debug\n\t\t$this->tanya->dapatid($_POST['password']);\n\t\t$this->papar->mesej = 'Ada masalah pada user dan password';\n\n\t\t# Set pemboleubah utama\n\t\t$this->papar->sesat = 'Enjin Carian - Sesat';\n\t\t$this->papar->isi = '';\n\n\t\t# Pergi papar kandungan\n\t\t//$this->semakPembolehubah($this->papar->mesej); # Semak data dulu\n\t\t$this->paparKandungan('index', 'salah');\n\t}", "public function aksi_tambah_permohonan_suket007()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'agama' => $this->input->post('agama'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'agama' => $this->input->post('agama'),\n\t\t\t'alamat_tinggal' => $this->input->post('alamat_tinggal'),\n\t\t\t'keperluan' => $this->input->post('keperluan'),\n\t\t);\n\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_tidak_mampu');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket007/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function tambah()\n\t{\n\t\t$this->session->set_userdata('aksi', 'tambah');\n\t\t$data['level'] = $this->session->userdata('level');\n\n\t\t$this->load->view('page/admin/tema/head',$data);\n\t\t$this->load->view('page/admin/tema/menu');\n\t\t$this->load->view('page/admin/sliders/tambah_halaman');\n\t\t$this->load->view('page/admin/tema/footer');\n\t}", "public function jadikanKetua()\n {\n // Menghapus hak akses sebagai anggota dari pengirim undangan\n $this->hakAksesPengguna()->detach(\n HakAkses::where('nama', HakAkses::ANGGOTA)->first()\n );\n\n // menjadikan pengirim undangan sebagai ketua\n $this->hakAksesPengguna()->attach(\n HakAkses::where('nama', HakAkses::KETUA_TIM)->first(), [\n 'status_request' => 'Approved'\n ]\n );\n }", "public function aksi_tambah_permohonan_suket014()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'agama' => $this->input->post('agama'),\n\t\t\t'kewarganegaraan' => $this->input->post('kewarganegaraan'),\n\t\t\t'pendidikan_terakhir' => $this->input->post('pendidikan_terakhir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'status_perkawinan' => $this->input->post('status_perkawinan'),\n\t\t\t'alamat_asal' => $this->input->post('alamat_asal'),\n\t\t\t'no_kk' => $this->input->post('no_kk'),\n\t\t\t'tanggal_kk' => $this->input->post('tanggal_kk'),\n\t\t\t'alamat_pindah' => $this->input->post('alamat_pindah'),\n\t\t\t'kelurahan_pindah' => $this->input->post('kelurahan_pindah'),\n\t\t\t'kecamatan_pindah' => $this->input->post('kecamatan_pindah'),\n\t\t\t'kabupaten_pindah' => $this->input->post('kabupaten_pindah'),\n\t\t\t'provinsi_pindah' => $this->input->post('provinsi_pindah'),\n\t\t\t'tanggal_pindah' => $this->input->post('tanggal_pindah'),\n\t\t\t'alasan_pindah' => $this->input->post('alasan_pindah'),\n\t\t\t'jumlah_pengikut' => $this->input->post('jumlah_pengikut'),\n\t\t);\n\n\t\t$this->m_warga->tambah_suket($data_surat, 'srt_ket_pindah');\n\n\t\tredirect('warga/list_pengikut_suket014/' . $id_permohonan);\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t}", "public function tambah_toko(){\n\t}", "public function aksi_tambah_permohonan_suket009()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama_alm' => $this->input->post('nama_alm'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'umur' => $this->input->post('umur'),\n\t\t\t'tempat_kediaman' => $this->input->post('tempat_kediaman'),\n\t\t\t'hari_meninggal' => $this->input->post('hari_meninggal'),\n\t\t\t'tanggal_meninggal' => $this->input->post('tanggal_meninggal'),\n\t\t\t'tempat_meninggal' => $this->input->post('tempat_meninggal'),\n\t\t\t'alasan_meninggal' => $this->input->post('alasan_meninggal'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_kematian');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket009/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function registrasi_berdasarkan_perorangan()\n\t{\n\t\t$data['content'] = 'keuangan/registrasi_berdasarkan_perorangan';\n\t\t$data['data'] = $this->m_aka->registrasi_berdasarkan_perorangan();\n\t\t$data['pagination'] = $this->pagination->create_links();\t\t\n\t\t$this->load->view('content', $data);\n\t}", "function berita_penghargaan(){\n\t\tcek_session_admin();\n\t\t$data['record'] = $this->model_penghargaan->berita_penghargaan();\n\t\t$this->load->view('administrator/mod_berita_penghargaan/view_penghargaan',$data);\n\t}", "public function aksi_tambah_permohonan_suket002()\n\t{\n\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'agama' => $this->input->post('agama'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat_tinggal' => $this->input->post('alamat_tinggal'),\n\t\t\t'alamat_kk' => $this->input->post('alamat_kk'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_domisili');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket002/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function set_pengiriman($id){ // untuk membuat database langkah pengiriman\n\t\t$cek = $this->M_biodata->get_biodata($id)->result();\n\t\t$this->load->model('M_transaksi');\n\t\tif (count($cek)>0){\n\t\t\tforeach ($cek as $c){\n\t\t\t\t\n\t\t\t};\n\t\t\t$data = array(\n\t\t\t'nama' => $c->namaAlumni,\n\t\t\t'alamat' => $c->alamat,\n\t\t\t'noHp' => $c->noHp,\n\t\t\t'id_pemesan' => $c->id_alumni\n\t\t\t);\t\n\t\t\t$this->M_transaksi->set_pengiriman($data,'pengiriman');\n\t\t$this->set_pembayaran($id);\n\t\t}\n\t}", "public function aksi_tambah_permohonan_suket012()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'status_perkawinan' => $this->input->post('status_perkawinan'),\n\t\t\t'agama' => $this->input->post('agama'),\n\t\t\t'kewarganegaraan' => $this->input->post('kewarganegaraan'),\n\t\t\t'pendidikan_terakhir' => $this->input->post('pendidikan_terakhir'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'alamat' => $this->input->post('alamat'),\n\t\t\t'tanggal_tinggal' => $this->input->post('tanggal_tinggal'),\n\t\t\t'kepindahan_dari' => $this->input->post('kepindahan_dari'),\n\t\t\t'nama_ayah' => $this->input->post('nama_ayah'),\n\t\t\t'nama_ibu' => $this->input->post('nama_ibu'),\n\t\t\t'jml_pengikut' => $this->input->post('jml_pengikut'),\n\t\t);\n\n\t\t$this->m_warga->tambah_suket($data_surat, 'srt_pengantar_kk');\n\n\t\tredirect('warga/list_pengikut_suket012/' . $id_permohonan);\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t}", "function antrian(){\n\t\t// baca antrian yang tersedia, tampilkan nama dan waktu datang\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('dokter/antri');\n\t\t$this->load->view('static/footer');\n\t}", "public function aksi_setujui_permohonan_005()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_izin_keramaian');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_izin_keramaian')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "public function aksi_setujui_permohonan_004()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_beda_nama');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_beda_nama')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "public function satuan_tambah()\n {\n // mengecek hak mengakses \n if (!$this->satuanModel->checkAksesSatuan()) {\n // mengembalikan ke halaman dashboard jika hak aksesnya tidak sesuai\n return redirect()->to('/dashboard');\n }\n\n // inisiasi data $session\n $session = session();\n \n // inisiasi $data \n $data = [\n 'title' => 'Satuan',\n 'subtitle' => 'form tambah satuan',\n 'satuan' => $this->satuanModel->getSatuan(),\n 'last_id' => $this->satuanModel->generatenewidSatuan(),\n 'validation' => \\Config\\Services::validation(), // didapet dari withInput() validation\n 'nama' => $session->get('nama'),\n 'role' => $session->get('role')\n ];\n\n // menampilkan form tambah satuan\n return view('satuan/satuan_tambah', $data);\n }", "public function tambah_aksi(){\n\t\t$this->simple_login->checkLogin();\n\n\t\t$this->_rule();\n\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t$data['title'] = 'Tambah Pengguna';\n\n\t\t\t$this->view('admin/user/tambah', $data, FALSE);\n\n\t\t}else{\n\t\t\t$data = [\n\t\t\t\t'nama' \t\t\t=> htmlspecialchars($this->input->post('nama', true)),\n\t\t\t\t'email' \t\t=> htmlspecialchars($this->input->post('email', true)),\n\t\t\t\t'username' \t\t=> htmlspecialchars($this->input->post('username', true)),\n\t\t\t\t'password' \t\t=> SHA1($this->input->post('password')),\n\t\t\t\t'alamat' \t\t=> htmlspecialchars($this->input->post('alamat', true)),\n\t\t\t\t'telp' \t\t=> htmlspecialchars($this->input->post('telp', true)),\n\t\t\t\t'akses_level' \t=> 2,\n\t\t\t\t'active'\t\t=> 1,\n\t\t\t\t'tanggal_daftar' => time(),\n\t\t\t\t'tanggal_update' => time(),\n\t\t\t\t'foto' => 'default.jpg'\n\t\t\t];\n\t\t\t$this->user_model->inputDataPengguna('users', $data);\n\t\t\t$this->session->set_flashdata('pesan', '<div class=\"alert alert-success\" role=\"alert\">Data Pelanggan Berhasil Di tambahkan! </div>');\n\t\t\tredirect('admin/user');\n\t\t}\t\n\t}", "function hapus(){\n\t\t$previllage = 1;\n\t\tcheck_super_user($this->session->tipe_user,$previllage);\t\t\t\t\n\n\t \t$id = $this->uri->segment(3);\n\t \t//Mencegeah bypass\n\t\tif ($this->fungsi->pilihan_advanced(\"tb_soal\",\"id\",$id)->row(\"user_id\") != $this->fungsi->user_login()->id and $this->session->tipe_user < 2 ) {\n\t\t\t$this->session->set_flashdata('danger','Bukan Aksesnya');\n\t\t\tredirect('soal');\n\t\t}\n\t\t\n\t\t$this->soal_m->hapus($id);\n\t\t$this->session->set_flashdata('danger','Berhasil Di Hapus');\n\t\tredirect('soal');\n\t}", "public function aksi_tambah_permohonan_suket008()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama_istri' => $this->input->post('nama_istri'),\n\t\t\t'tempat_lahir_istri' => $this->input->post('tempat_lahir_istri'),\n\t\t\t'tanggal_lahir_istri' => $this->input->post('tanggal_lahir_istri'),\n\t\t\t'pekerjaan_istri' => $this->input->post('pekerjaan_istri'),\n\t\t\t'alamat_tinggal' => $this->input->post('alamat_tinggal'),\n\t\t\t'nama_suami' => $this->input->post('nama_suami'),\n\t\t\t'tempat_lahir_suami' => $this->input->post('tempat_lahir_suami'),\n\t\t\t'tanggal_lahir_suami' => $this->input->post('tanggal_lahir_suami'),\n\t\t\t'pekerjaan_suami' => $this->input->post('pekerjaan_suami'),\n\t\t\t'alasan' => $this->input->post('alasan'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_janda');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket008/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function index()\n {\n $this->session->unset_userdata('id_kelas_sekarang', '');\n $this->session->unset_userdata('kelas_sekarang', '');\n\n\n\n // Cari semua data kelas\n $kelas = $this->kelas->cari_semua();\n\n // data kelas ada, tampilkan\n if ($kelas) {\n // buat tabel\n $tabel = $this->kelas->buat_tabel($kelas);\n\n $this->data['tabel_data'] = $tabel;\n $this->load->view('template', $this->data);\n }\n // data kelas tidak ada\n else {\n $this->data['pesan'] = 'Tidak ada data kelas.';\n $this->load->view('template', $this->data);\n }\n }", "public function kawasan()\n {\n $data = ['aktif' => 'kawasan',\n 'data_kws' => $this->M_prospektus->get_data_kawasan()->result_array()\n ];\n\n $this->template->load('template', 'prospektus/V_kawasan', $data);\n }", "public function aksi_setujui_permohonan_013()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_penghasilan');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_penghasilan')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "public function halaman_selengkapnya($id){\n\t\t$data['judul1'] = 'Detail Laporan';\n\t\t$data['lapor'] = $this->Lapor_model->getDataId($id);\n\t\t//folder = Lapor dan file = halaman_selengkapnya\n\t\t$this->load->view('templates/header_daftar_login',$data);\n\t\t$this->load->view('Lapor/halaman_selengkapnya',$data);\n\t\t$this->load->view('templates/footer');\n\t}", "public function tambah()\n {\n $data['userdata'] = $this->userdata;\n\n $data['page'] = \"Tambah\";\n $data['judul'] = \"Data Nasabah\";\n $data['deskripsi'] = \"Manage Data Nasabah\";\n\n $data['jenisID'] = $this->M_nasabah->jenisID();\n\n $data['majelis'] = $this->M_nasabah->majelis();\n $data['petugas'] = $this->M_nasabah->petugas();\n $data['sektor_usaha'] = $this->M_nasabah->sektor_usaha();\n $data['kantor'] = $this->M_nasabah->kantor();\n $data['agama'] = $this->M_nasabah->agama();\n $data['status_nikah'] = $this->M_nasabah->status_nikah();\n\n $data['desa'] = $this->M_nasabah->desa();\n $data['kecamatan'] = $this->M_nasabah->kecamatan();\n $data['kota_kab'] = $this->M_nasabah->kota_kab();\n $data['provinsi'] = $this->M_nasabah->provinsi();\n\n $this->template->views('nasabah/tambah_nasabah', $data);\n }", "public function aksi_setujui_permohonan_003()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_belum_memiliki_rumah');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_belum_memiliki_rumah')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "function berinamateman($teman){\n\t\t$this->nama_teman=$teman;\n\t}", "function laporanHarian(){\n $this->load->view('templates/header');\n $this->load->view('user/kasir/laporanHarian');\n $this->load->view('templates/footer');\n }", "public function kosongkanDataBarang() {\n $this->daftar_barang = [];\n $this->editData();\n }", "public function aksi_tambah_permohonan_suket010()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nama_anak' => $this->input->post('nama_anak'),\n\t\t\t'hari_lahir' => $this->input->post('hari_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'jam_lahir' => $this->input->post('jam_lahir'),\n\t\t\t'kelahiran' => $this->input->post('kelahiran'),\n\t\t\t'kembar_ke' => $this->input->post('kembar_ke'),\n\t\t\t'tempat_persalinan' => $this->input->post('tempat_persalinan'),\n\t\t\t'alamat_persalinan' => $this->input->post('alamat_persalinan'),\n\t\t\t'penolong_persalinan' => $this->input->post('penolong_persalinan'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'nama_ibu' => $this->input->post('nama_ibu'),\n\t\t\t'tanggal_lahir_ibu' => $this->input->post('tanggal_lahir_ibu'),\n\t\t\t'alamat_ibu' => $this->input->post('alamat_ibu'),\n\t\t\t'umur_ibu' => $this->input->post('umur_ibu'),\n\t\t\t'kewarganegaraan_ibu' => $this->input->post('kewarganegaraan_ibu'),\n\t\t\t'nama_ayah' => $this->input->post('nama_ayah'),\n\t\t\t'tanggal_lahir_ayah' => $this->input->post('tanggal_lahir_ayah'),\n\t\t\t'umur_ayah' => $this->input->post('umur_ayah'),\n\t\t\t'kewarganegaraan_ayah' => $this->input->post('kewarganegaraan_ayah'),\n\t\t\t'no_kk' => $this->input->post('no_kk'),\n\t\t\t'no_ktp' => $this->input->post('no_ktp'),\n\t\t\t'nama_pemohon' => $this->input->post('nama_pemohon'),\n\t\t\t'hubungan_dengan_bayi' => $this->input->post('hubungan_dengan_bayi'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_ket_kelahiran');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket010/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function data_pendidikan_terakhir()\n\t{\n\t\t$data = array(\n\t\t\t'data_pendidikan_terakhir' => $this->master_pendidikan_terakhir_model->select_master_pendidikan_terakhir(), \n\t\t);\n\n\t\t$this->load->view('data_pendidikan_terakhir_content', $data, FALSE);\n\t}", "public function aksi_setujui_permohonan_014()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_pindah');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_pindah')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "function latihan_soal(){\r\n \tif($this->session->userdata('akses')=='1' || $this->session->userdata('akses')=='2' || $this->session->userdata('akses')=='3'){\r\n \t$this->load->view('v_latihan_soal');\r\n \t}else{\r\n \techo \"Anda tidak berhak mengakses halaman ini\";\r\n \t}\r\n \t}", "public function pengiriman()\n\t\t{\n\t\t\t$def['title'] = SHORT_SITE_URL.' | Data User Pengiriman';\n\t\t\t$def['breadcrumb'] = 'Data User Pengiriman';\n\n\t\t\t$this->load->view('partials/head', $def);\n\t\t\t$this->load->view('partials/navbar');\n\t\t\t$this->load->view('partials/breadcrumb', $def);\n\t\t\t$this->load->view('admin/upengiriman');\n\t\t\t$this->load->view('partials/footer');\n\t\t\t$this->load->view('admin/plugins/upengiriman');\n\t\t}", "function index(){\n\t\t$this->load->library('malasngoding'); // fungsi untuk manggil\n\t\t$this->malasngoding->nama_saya(); // di sini untuk menggunakan fungsi/method yang di buat di library\n echo \"<br/>\";\n $this->malasngoding->nama_kamu(\"Andi\");\n\t}", "public function aksi_tambah_permohonan_suket011()\n\t{\n\t\t$data_permohonan = array(\n\t\t\t'id_nama_surat' => $this->input->post('id_nama_surat'),\n\t\t\t'id_warga' => $this->input->post('id_warga'),\n\t\t\t'status' => $this->input->post('status'),\n\t\t);\n\n\t\t$id_permohonan = $this->m_warga->tambah_permohonan($data_permohonan);\n\n\t\t$data_surat = array(\n\t\t\t'id_permohonan_surat' => $id_permohonan,\n\t\t\t'nik' => $this->input->post('nik'),\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'golongan_darah' => $this->input->post('golongan_darah'),\n\t\t\t'agama' => $this->input->post('agama'),\n\t\t\t'pekerjaan' => $this->input->post('pekerjaan'),\n\t\t\t'status_perkawinan' => $this->input->post('status_perkawinan'),\n\t\t\t'no_kk' => $this->input->post('no_kk'),\n\t\t\t'alamat' => $this->input->post('alamat'),\n\t\t\t'rt' => $this->input->post('rt'),\n\t\t\t'kelurahan' => $this->input->post('kelurahan'),\n\t\t\t'kecamatan' => $this->input->post('kecamatan'),\n\t\t\t'tanggal_tinggal' => $this->input->post('tanggal_tinggal'),\n\t\t\t'no_surat_pindah' => $this->input->post('no_surat_pindah'),\n\t\t\t'tanggal_surat_pindah' => $this->input->post('tgl_surat_pindah'),\n\t\t);\n\n\t\t$id_surat = $this->m_warga->tambah_suket($data_surat, 'srt_pengantar_ktp');\n\n\t\t$this->session->set_flashdata('success', 'disimpan');\n\t\tredirect('warga/detail_suket011/' . $id_surat . '/' . $id_permohonan);\n\t}", "public function aksi_setujui_permohonan_007()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_tidak_mampu');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_tidak_mampu')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "function berinamaTeman($teman){\r\n\t\t\t$this->nama_teman = $teman;\r\n\t\t}", "public function aksi_setujui_permohonan_002()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_domisili');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_domisili')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "public function tambah(){\n\t\t//$data['grup'] = $this->sinisa_model->getgrup()->result();\n\t\t//$data['user'] = $this->sinisa_model->getAll()->result();\n\t\t$this->load->view('crud/pengajuan_view');\n\t}", "function index()\n\t{\n\t\t$data['hardware'] = $this->Mhardware->tampil_hardware();\n\t\t//mengambil data dari fungsi tampil_departemen\n\t\t$data['departemen'] = $this->Mdepartemen->tampil_departemen();\n\t\t\n\t\t$data['judul'] = \"Tabel Aset Kantor\";\n\t\t$this->theme->set_ui(\"admin/tampilhardware\", $data);\n\t}", "public function percepatan_pelunasan()\n\t{\n\t\t$data['container'] = 'transaction/percepatan_pelunasan_koptel';\n\t\t$data['account_cash'] = $this->model_transaction->get_account_cash();\n\t\t$this->load->view('core',$data);\n\t}", "public function viewPesanMasuk()\n\t{\n\t\t$ambil_akun1 = $this->Wali_Kelas_model->ambil_user($this->session->userdata('uname'));\n\t\t$ambil_status = $this->Wali_Kelas_model->ambil_status($this->session->userdata('kode'));\n\t\t$data = array(\n\t\t\t'user1' => $ambil_akun1,\n\t\t\t'status' => $ambil_status\n\t\t);\n\t\t$data['jumlah']=$this->Wali_Kelas_model->ambil_jumlah($this->session->userdata('uname'));\n\t\t$data['notifInformasi']=$this->Wali_Kelas_model->notifInformasi_Wali();\n\t\t$data['ListNotifInformasi']=$this->Wali_Kelas_model->ListNotifInformasi_Wali();\n\t\t$data['notif'] = $this->Wali_Kelas_model->notifikasiPesan();\n\t\t$data['LihatNotifRespon']=$this->Wali_Kelas_model->LihatNotifRespon_Wali();\n\t\t$data['notifPesan'] = $this->Wali_Kelas_model->notifPesan_Wali();\n\t\t$data['ListnotifPesan'] = $this->Wali_Kelas_model->ListNotifPesan_Wali();\n\t\t$data['ListPesanMasuk'] = $this->Wali_Kelas_model->getAllPesanMasuk();\n\t\t$this->load->view('W_Pesan_Masuk',$data);\n\t}", "public function aksi_setujui_permohonan_008()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_janda');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_janda')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "function pasien()\n\t{\n\t\t$data['pasien'] \t\t= $this->Kesehatan_M->readS('pasien')->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/daftar_pasien',$data);\n\t\t$this->load->view('static/footer');\n\t}", "function universitas(){\r\n \tif($this->session->userdata('akses')=='1' || $this->session->userdata('akses')=='2' || $this->session->userdata('akses')=='3'){\r\n \t$this->load->view('v_universitas');\r\n \t}else{\r\n \techo \"Anda tidak berhak mengakses halaman ini\";\r\n \t}\r\n \t}", "public function aksi_setujui_permohonan_010()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_kelahiran');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_kelahiran')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "public function hapus_registrasi_berdasarkan_perorangan()\n\t{\n\t\t$this->m_aka->hapus_registrasi_berdasarkan_perorangan();\n\t\tredirect('c_index_aka/registrasi_berdasarkan_perorangan');\n\t}", "public function index()\r\n\t{\r\n\t\t$data['pinjaman'] = $this->model_pinjaman->semua_pinjaman();\r\n\t\t$this->load->view('admin/pinjaman_index', $data);\r\n\t}", "function tahun_lapkeu(){\n\t\tcek_session_admin();\n\t\t$data['tahun'] = $this->model_lapkeu->tahun_lapkeu();\n\t\t$this->load->view('administrator/mod_thnlapkeu/view_thn',$data);\n\t}", "public function form_tambah_pengikut_suket014($id_permohonan)\n\t{\n\n\t\t$data['warga'] = $this->db->get_where('warga', ['id_warga' =>\n\t\t$this->session->userdata('id_warga')])->row_array();\n\t\t$data['total_notif'] = $this->m_warga->jumlah_notif()->result();\n\n\t\t$data_permohonan['id_permohonan'] = $this->db->get_where('srt_ket_pindah', ['id_permohonan_surat' => $id_permohonan])->row_array();\n\n\t\t$this->load->view('header');\n\t\t$this->load->view('warga/sidebar_warga', $data);\n\t\t$this->load->view('topbar', $data);\n\t\t$this->load->view('warga/suket_014/form_tambah_pengikut_suket014', $data_permohonan);\n\t\t$this->load->view('footer');\n\t}", "public function tambah()\n\t{\n\t\t$this->session->set_userdata('aksi', 'tambah');\n\t\t$data['level'] = $this->session->userdata('level');\n\n\t\t$id_pembeli = $this->input->get('id');\n\t\t$data['data_pembeli'] = $this->mpembeli->get_edit_pembeli($id_pembeli);\n\t\t$this->session->set_flashdata('token', $this->input->get('token'));\n\t\t$data['get_token2'] = $this->input->get('id');\n\n\t\t$this->load->view('page/admin/tema/head',$data);\n\t\t$this->load->view('page/admin/tema/menu');\n\t\t$this->load->view('page/admin/alamat/tambah_halaman');\n\t\t$this->load->view('page/admin/tema/footer');\n\t}", "public function tambah($id_blok = null)\n\t{\n\t\t$data = [ 'aktif'\t=> 'prospektus',\n\t\t\t\t 'unit'\t=> $this->M_prospektus->get_unit_blok($id_blok),\n 'id_blok' => $id_blok\n\t\t\t\t];\n\n\t\t$this->template->load('template','prospektus/V_tambah_data', $data);\n\t}", "public function DataPesanan()\n\t{\n\t\t$data['DataOrder'] = $this->MSudi->GetDataJoin('tbl_order','tbl_menu','tbl_order.id_menu = tbl_menu.id')->result();\n\t\t$data['content'] = 'VPesanan';\n\t\t$this->load->view('welcome_message', $data);\n\t}", "function HapusDataTemplatePesan()\n\t{\n\t\tinclude '../../koneksi/koneksi.php';\n\n\t\t//inisialisasi\n\t\t$id = $_GET['id'];\n\n\t\t$status_hapus = \"0\";\n\n\t\t//hapus dari tabel pesan\n\t\t$sql = \"UPDATE pesan SET status_hapus = ? WHERE id = ?\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param('si', $status_hapus, $id);\n\t\tif($stmt->execute()){\n\t\t\t$_SESSION['status_operasi_tp'] = \"berhasil_menghapus\";\n\t\t}else{\n\t\t\t$_SESSION['status_operasi_tp'] = \"gagal_menghapus\";\n\t\t}\n\t\t$stmt->close();\n\t}", "public function tampilkan(){\n $gejalas = Gejala::get();\n\n return view('admin.penentuan_penyakit')->withGejalas($gejalas);\n }", "public function tambah_pelanggan_bayar()\n {\n\n $layanan = Data_layanan::all();\n $kategori = Data_kategori::all();\n $pop = Data_pop::all();\n $sektor = Data_sektor::all();\n $tipe = Data_tipe_pengguna::all();\n\n\n return view('pelanggan/tambah_pelanggan_bayar', ['datalayanan' => $layanan, 'kategori' => $kategori, 'pop' => $pop, 'sektor' => $sektor, 'tipe' => $tipe,]);\n }", "public function form_tambah_pejabat_berwenang()\n {\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n $data['jumlah_permohonan_masuk'] = $this->m_admin->jumlah_permohonan_masuk()->result();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n\n $this->load->view('header');\n $this->load->view('admin/sidebar_admin');\n $this->load->view('topbar', $data);\n $this->load->view('admin/form_tambah_pejabat_berwenang');\n $this->load->view('footer');\n }", "public function pilih_tanda_tangan($id_permohonan_surat)\n {\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n $data['jumlah_permohonan_masuk'] = $this->m_admin->jumlah_permohonan_masuk()->result();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n\n $data_detail['pejabat'] = $this->m_admin->get_data_pejabat()->result();\n $data_detail['kades'] = $this->m_admin->get_data_kades()->result();\n $data_detail['permohonan'] = $this->m_admin->get_id_permohonan($id_permohonan_surat, 'permohonan_surat')->result();\n\n $this->load->view('header');\n $this->load->view('admin/sidebar_admin');\n $this->load->view('topbar', $data);\n $this->load->view('admin/pilih_tanda_tangan', $data_detail);\n $this->load->view('footer');\n }", "public function aksi_ubah_kata_sandi_profil_saya()\n\t{\n\t\t$kata_sandi_awal = $this->input->post('kata_sandi_awal');\n\t\t$data_lama = sha1($kata_sandi_awal);\n\n\t\t$kata_sandi = $this->input->post('kata_sandi');\n\t\t$kata_sandi_hash = sha1($kata_sandi);\n\n\t\t$data_baru = array(\n\t\t\t'kata_sandi' => $kata_sandi_hash,\n\t\t);\n\n\t\t$where = $this->input->post('id_warga');\n\n\t\t$warga = $this->m_warga->cek_warga($where);\n\n\t\tif ($data_lama === $warga['kata_sandi']) {\n\t\t\t$this->m_warga->ubah_kata_sandi_profil_saya($where, $data_baru, 'warga');\n\t\t\t$this->session->set_flashdata('success', '<b>Kata Sandi</b> Berhasil Diubah');\n\t\t\tredirect('warga/form_ubah_kata_sandi_profil_saya/' . $where);\n\t\t} else {\n\t\t\t$this->session->set_flashdata('error', '<b>Kata Sandi Lama</b> Salah');\n\t\t\tredirect('warga/form_ubah_kata_sandi_profil_saya/' . $where);\n\t\t}\n\t}", "public function barang_tambah_proses()\n\t{\n\t\t// define array data for insert\n\t\t$indata = array(\n\t\t'nama_barang' => $_POST['nama_barang'],\n\t\t'harga_barang' => $_POST['harga'],\n\t\t'stok' => $_POST['stok'],\n\t\t'deskripsi' => $_POST['isi'],\n\t\t'kode_kategori' => $_POST['kategori']\n\t\t);\n\t\t\n\t\t// define configuration for upload image\n\t\t$config['upload_path'] = './uploads/';\n\t\t$config['allowed_types'] = 'gif|jpg|png';\n\t\t$config['max_size'] = 2000;\n\t\t$config['max_width'] = 2048;\n\t\t$config['max_height'] = 1024;\n\t\t\n\t\t// set configuration\n\t\t$this->load->library('upload', $config);\n\t\t\n\t\t// if image is can't to uploaded\n\t\tif ( ! $this->upload->do_upload('gambar'))\n\t\t{\n\t\t\techo $this->upload->display_errors();\n\t\t}\n\t\telse // can to upload\n\t\t{\n\t\t\t// define array name for gambar from data uploaded\n\t\t\t$indata['gambar'] = $this->upload->data('file_name');\n\t\t}\n\t\t\n\t\t// insert execution\n\t\t$this->ModelsKedai->insert(\"barang\",$indata);\n\t\t\n\t\t// goto barang page\n\t\tredirect('administrator/barang/1');\n\t}", "public function tambah_listsiswa(){\n\t\t$this->load->view(\"admin/header\");\n\t\t$this->load->view(\"admin/menu\");\n\t\t$this->load->view(\"admin/listsiswa/form_tambah_listsiswa\");\n\t\t$this->load->view(\"admin/footer\");\n\t}", "public function aksi_setujui_permohonan_009()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_kematian');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_kematian')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "public function aksi_setujui_permohonan_011()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_pengantar_ktp');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_pengantar_ktp')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "function tambah()\n\t{\n\t\t$data['departemen'] = $this->Mdepartemen->tampil_departemen();\n\t\t//mengambil data dari fungsi tampil_pegawai\n\t\t$data['pegawai'] = $this->Mpegawai->tampil_pegawai();\n\t\t//mengambil data dari fungsi tampil_kategori\n\t\t$data['kategori'] = $this->Mkategori->tampil_kategori();\n\t\t//mengambil data dari fungsi tampil_hardware\n\t\t$data['hardware'] = $this->Mhardware->tampil_hardware();\n\n\t\t$data['judul'] = \"Form Tambah Hardware\";\n\t\t//Menampilkan form tambahhardware\n\t\t$this->theme->set_ui(\"admin/tambahhardware\", $data);\n\n\t\t//menyimpan inputan dari form tambahhardware\n\t\t$inputan = $this->input->post();\n\n\t\t//jika ada inputan dari form\n\t\tif($inputan)\n\t\t{\n\t\t\t//menjalankan fungsi simpan_hardware\n\t\t\t$this->Mhardware->simpan_hardware($inputan);\n\n\t\t\tredirect(\"admin/hardware\");\n\t\t}\n\t\t\n\n\t}", "public function aksi_ubah_pengikut_suket014()\n\t{\n\t\t$id_permohonan_surat = $this->input->post('id_permohonan_surat');\n\t\t$id_pengikut = $this->input->post('id_pengikut');\n\t\t$data = array(\n\t\t\t'nama' => $this->input->post('nama'),\n\t\t\t'tempat_lahir' => $this->input->post('tempat_lahir'),\n\t\t\t'tanggal_lahir' => $this->input->post('tanggal_lahir'),\n\t\t\t'jenis_kelamin' => $this->input->post('jenis_kelamin'),\n\t\t\t'umur' => $this->input->post('umur'),\n\t\t\t'status_perkawinan' => $this->input->post('status_perkawinan'),\n\t\t\t'pendidikan_terakhir' => $this->input->post('pendidikan_terakhir'),\n\t\t\t'nama_ortu' => $this->input->post('nama_ortu'),\n\t\t\t'status_hub_kk' => $this->input->post('status_hub_kk'),\n\t\t);\n\n\t\tif ($this->m_warga->aksi_ubah_pengikut($id_pengikut, $data, 'pengikut')); {\n\t\t\t$this->session->set_flashdata('success', 'diubah');\n\t\t\tredirect('warga/list_pengikut_suket014/' . $id_permohonan_surat);\n\t\t}\n\t}", "public function verifikasi_pendebetan_angsuran_koptel()\n\t{\n\t\t$data['container'] = 'transaction/verifikasi_pendebetan_angsuran_koptel';\n\t\t$data['debet'] = $this->model_transaction->get_data_angsuran1();\n\t\t$data['akun'] = $this->model_transaction->get_data_akun();\n\t\t$this->load->view('core',$data);\n\t}", "function tambah_mk($SKSMK){\r\n\t\t\t// Format seperti di bawah ini secara otomatis akan\r\n\t\t\t// menambahkan data atau nilai baru ke dalam array\r\n\t\t\t// pada indeks paling belakang.\r\n\t\t\t// Jadi apabila sudah ada 5 data pada array tsb,\r\n\t\t\t// maka data baru akan disimpan pada posisi ke-6.\r\n\t\t\t$this->NamaMataKuliah[] = $SKSMK;\r\n\t\t}", "public function aksi_setujui_permohonan_006()\n {\n $data = array(\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_belum_pernah_menikah');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_belum_pernah_menikah')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n }\n }", "function berinamateman ($teman) {\n $this->nama_teman=$teman;\n }", "public function data_pengumuman_akademik()\n\t{\n\t\t$data['data'] = $this->m_aka->data_pengumuman_akademik(); \n\t\t$data['pagination'] = $this->pagination->create_links();\n\t\t$data['content'] = 'posting_pengumuman/data_pengumuman_akademik';\n\t\t$this->load->view('content', $data);\n\t}", "function pemeriksaan($nomor_pasien)\n\t{\n\t\t$data['pasien'] = $this->Kesehatan_M->read('pasien',array('nomor_pasien'=>$nomor_pasien))->result();\n\t\tif ($data['pasien'] != array()) {\n\t\t\t$data['rekam_medis'] = $this->Kesehatan_M->read('rekam_medis',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('nomor_pasien'\t\t=>\t$nomor_pasien,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'MONTH(tanggal_jam)'=>\tdate('m'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'YEAR(tanggal_jam)'\t=>\tdate('Y'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'DAY(tanggal_jam)'\t=>\tdate('d')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t))->result();\n\t\t\t$this->load->view('static/header');\n\t\t\t$this->load->view('static/navbar');\n\t\t\t$this->load->view('dokter/pemeriksaan',$data);\n\t\t\t$this->load->view('static/footer');\n\t\t}else{\n\t\t\t$this->load->view('static/header');\n\t\t\t$this->load->view('static/navbar');\n\t\t\t$data['heading']\t= \"Halaman tidak ditemukan\";\n\t\t\t$data['message']\t= \"<p> Klik <a href='\".base_url().\"Dokter/index'>disini </a>untuk kembali melihat daftar pasien yang sedang antri</p>\";\n\t\t\t$this->load->view('errors/html/error_404',$data);\n\t\t}\n\t}", "public function tambah_resources()\n {\n $id_pros = $this->uri->segment(3);\n\n $data = ['id_pros' => $id_pros,\n 'aktif' => 'prospektus',\n 'data_gambar' => $this->M_prospektus->get_file_foto()\n ];\n\n $this->template->load('template', 'prospektus/V_tambah_res', $data);\n\n }", "function apa_kabar() {\n return \"Apa kabar dunia?\"; //tidak menampilkan apapun\n}", "public function cetak_pengadaan()\n {\n $data['row'] = $this->Pengadaan_Model->ambil_pengadaan_brg()->result();\n\n\n $this->template->load('template', 'laporan/laporan_pengadaan/form_pengadaan', $data);\n }", "public function o_nama()\n {\n $this->show('o_nama',[]);\n }", "public function proses_tambah()\n\t{\n\t\t$data = array(\n\t\t\t'page_title' \t=> \"Tambah Latihan Soal\", \n\t\t\t'form_action' => current_url(),\n\t\t\t'submateri'\t\t=> $this->model_adm->fetch_all_materi()\n\t\t\t);\n\n\t\t//fetch input (make sure that the variable name is the same as column name in database!) \n\t\t$params \t\t\t\t= $this->input->post(null, true);\n\t\t$sub_materi \t\t \t\t= $params['sub_materi'];\n\n\t\t$this->form_validation->set_rules('sub_materi', 'Sub Materi', 'required');\n\t\t\n\t\t//run the validation\n\t\tif ($this->form_validation->run() == FALSE) \n\t\t{\n\t\t\talert_error(\"Error\", \"Data gagal ditambahkan\");\n\t\t\t$this->load->view('pg_admin/latihansoal_form', $data);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//passing input value to Model\n\t\t\t$result = $this->model_adm->add_latihan_soal($sub_materi);\n\t\t\talert_success(\"Sukses\", \"Data berhasil ditambahkan\");\n\t\t\tredirect('pg_admin/latihansoal');\n\t\t\t// echo \"Status Insert: \" . $result;\n\t\t}\t\n\t}", "public function mahasiswa()\n {\n $data['halaman'] = \"Data Mahasiswa\";\n $data['mahasiswa'] = $this->mod->m_get_all_mahasiswa_plus_dosen();\n // print('<pre>');print_r($data);exit();\n $this->load->view('head.php', $data);\n $this->load->view('sidebar.php');\n $this->load->view('header.php');\n $this->load->view('dosen/mahasiswa.php', $data);\n $this->load->view('footer.php');\n }", "public function aksi_setujui_permohonan_001()\n {\n $data = array(\n // 'status' => $this->input->post('status'),\n 'tgl_persetujuan_admin' => date(\"Y/m/d\"),\n 'notif' => 'Belum Dibaca',\n 'notif_rt' => 'Belum Dibaca',\n );\n\n $data_surat = array(\n 'no_registrasi' => $this->input->post('no_registrasi'),\n 'no_bulan' => $this->input->post('no_bulan'),\n 'no_tahun' => $this->input->post('no_tahun'),\n );\n\n $detailhere = $this->input->post('id_permohonan_surat');\n\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat');\n $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_usaha');\n\n if (\n $this->m_admin->update_status_permohonan($detailhere, $data, 'permohonan_surat')\n && $this->m_admin->update_nomor_admin_surat($detailhere, $data_surat, 'srt_ket_usaha')\n ); {\n $this->session->set_flashdata('success', 'disetujui');\n redirect('admin/pilih_tanda_tangan/' . $detailhere);\n // redirect('admin/list_data_permohonan_selesai');\n }\n }", "public function admin_hrd_tambah_karyawan(){\n\t\t\t$nik = Input::get('nik');\n\t\t\t$id_status_karyawan = Input::get('id_status_karyawan');\n\t\t\t$nama = Input::get('nama');\n\t\t\t$alamat = Input::get('alamat');\n\t\t\t$tempat_lahir = Input::get('tempat_lahir'); \n\t\t\t$tanggal_lahir = Input::get('tanggal_lahir');\n\t\t\t$agama = Input::get('agama');\n\t\t\t$jenis_kelamin = Input::get('jenis_kelamin');\n\t\t\t$tanggal_mulai_kerja = Input::get('tanggal_mulai_kerja'); \n\t\t\t$id_golongan = Input::get('id_golongan');\n\t\t\t$id_jabatan = Input::get('id_jabatan');\n\t\t\t$id_jurusan = Input::get('id_jurusan');\n\t\t\t$no_telepon = Input::get('no_telepon');\n\t\t\t$email = Input::get('email');\n\t\t\t$pendidikan = Input::get('pendidikan');\n\t\t\t$status_nikah = Input::get('status_nikah');\n\t\t\t$foto = Input::get('foto');\n\t\t\t$status = Input::get('status');\n\t\t\treturn Karyawan::tambah_karyawan($nik, $id_status_karyawan, $nama, $alamat, $tempat_lahir, $tanggal_lahir, $agama, $jenis_kelamin, $tanggal_mulai_kerja, $id_golongan, $id_jabatan, $id_jurusan, $no_telepon, $email, $pendidikan, $status_nikah, $foto, $status); \n\t\t}", "public function form_alasan_tolak($id_permohonan_surat)\n {\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n $data['jumlah_permohonan_masuk'] = $this->m_admin->jumlah_permohonan_masuk()->result();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n\n $data_detail['id_permohonan_surat'] = $this->db->get_where('permohonan_surat', ['id_permohonan_surat' =>\n $id_permohonan_surat])->row_array();\n\n $this->load->view('header');\n $this->load->view('admin/sidebar_admin');\n $this->load->view('topbar', $data);\n $this->load->view('admin/form_alasan_tolak', $data_detail);\n $this->load->view('footer');\n }", "public function ringkasan_harian()\n {\n $menu = 'database';\n $subMenu = 'akad';\n\n $dateNow = Carbon::now()->format('Y-m-d');\n $nameFieldSorted = 'akad.tanggal_akad';\n \n $dataAkadBaru = $this->dataAkad($nameFieldSorted, $dateNow, 'baru');\n $dataAkadUlang = $this->dataAkad($nameFieldSorted, $dateNow, 'ulang');\n $dataPendapatan = $this->dataPendapatan($nameFieldSorted, $dateNow);\n\n $akadBaru = $this->totalPencairanAkad($dateNow, 'baru');\n $akadUlang = $this->totalPencairanAkad($dateNow, 'ulang');\n $totalRealisasi = 'Rp.'.nominal($akadBaru->data + $akadUlang->data);\n $akadBaru = $akadBaru->nominal;\n $akadUlang = $akadUlang->nominal;\n\n $pendapatanBtitip = $this->pendapatanBiaya($dateNow, 'bt_7_hari');\n $pendapatanBadmin = $this->pendapatanBiaya($dateNow, 'biaya_admin');\n\n $column = config('library.column.akad_nasabah.list_akad_nasabah');\n $listTime = config('library.form.akad.list_time');\n $waktuAkad = config('library.special.nasabah_akad.waktu_akad');\n $paymentOption = config('library.form.akad.payment_option');\n $jangkaWaktuAkad = config('library.special.nasabah_akad.jangka_waktu_akad');\n $detailJenisBarang = config('library.special.nasabah_akad.detail_jenis_barang');\n \n return $this->template('akad.index.ringkasan-akad.index', compact(\n 'menu', 'subMenu', 'listTime', 'waktuAkad', 'paymentOption', \n 'jangkaWaktuAkad', 'detailJenisBarang', 'column', 'dataAkadBaru',\n 'dataAkadUlang', 'dataPendapatan', 'akadBaru', 'akadUlang', 'pendapatanBtitip',\n 'pendapatanBadmin', 'totalRealisasi'\n ));\n }", "public function stok(){\n\n $hasil = $this->admin_model->ambilDataStok();\n $data['hasil'] = $hasil;\n\n $this->load->view('admin/header');\n $this->load->view('admin/stok', $data);\n $this->load->view('front/footer');\n\n }", "public function index()\n {\n //jika bukan admin maka alihkan ke halaman dashboard\n $this->is_admin();\n\n $data = [\n 'title' => 'Data Pegawai'\n ];\n\n $this->template->kasir('pegawai/index', $data);\n }", "public function form_tambah_pengikut_suket012($id_permohonan)\n\t{\n\n\t\t$data['warga'] = $this->db->get_where('warga', ['id_warga' =>\n\t\t$this->session->userdata('id_warga')])->row_array();\n\t\t$data['total_notif'] = $this->m_warga->jumlah_notif()->result();\n\n\t\t$data_permohonan['id_permohonan'] = $this->db->get_where('srt_pengantar_kk', ['id_permohonan_surat' => $id_permohonan])->row_array();\n\n\t\t$this->load->view('header');\n\t\t$this->load->view('warga/sidebar_warga', $data);\n\t\t$this->load->view('topbar', $data);\n\t\t$this->load->view('warga/suket_012/form_tambah_pengikut_suket012', $data_permohonan);\n\t\t$this->load->view('footer');\n\t}", "function berinama($saya){\r\n\t\t\t$this->nama_saya = $saya;\r\n\t\t}" ]
[ "0.7061618", "0.6708213", "0.66740704", "0.6671819", "0.66531307", "0.6643389", "0.66344225", "0.6585777", "0.6557329", "0.65266424", "0.65264046", "0.65206337", "0.65034795", "0.65016115", "0.64889276", "0.64796966", "0.6459133", "0.6449085", "0.64430726", "0.6440806", "0.6421039", "0.6418382", "0.6416935", "0.64160794", "0.6413334", "0.64056593", "0.64053357", "0.6389127", "0.6370146", "0.6365852", "0.6349504", "0.6341509", "0.63290167", "0.63284844", "0.6321773", "0.6321178", "0.63191885", "0.6318809", "0.63160264", "0.63026553", "0.630138", "0.6298744", "0.62887704", "0.62883574", "0.62854743", "0.6280722", "0.6278378", "0.6278011", "0.62727934", "0.6271625", "0.6265874", "0.62652767", "0.6264493", "0.626327", "0.6263001", "0.62623733", "0.62617147", "0.6256926", "0.62450874", "0.6238299", "0.62370694", "0.6229579", "0.622947", "0.6211833", "0.6211479", "0.6211373", "0.6210983", "0.62073886", "0.6206575", "0.61961234", "0.61919135", "0.6178453", "0.6173901", "0.6172494", "0.61723286", "0.61679155", "0.6165263", "0.6165182", "0.61605036", "0.61598635", "0.6155018", "0.61540234", "0.6147864", "0.6146044", "0.6144166", "0.6141922", "0.6140309", "0.6139551", "0.6137548", "0.61365235", "0.61350083", "0.6133875", "0.6127834", "0.6112549", "0.61074036", "0.61041254", "0.60976034", "0.6096892", "0.6087922", "0.6081956", "0.6070569" ]
0.0
-1
List all class in user mode
public function listClassUser($category = null, $type = null) { $listCategories = Categories::where('deleted_at', '=', null)->get(); if ($category == 'search') { $listClasses = Classes::where('name', 'like', '%' . $type . '%') ->where('is_draft', '=', 0) ->where('deleted_at', '=', null) ->with('speaker') ->orderBy('id', 'desc') ->paginate(12); } else if ($category == null || $type == null) { $listClasses = Classes::where('deleted_at', '=', null) ->where('is_draft', '=', 0) ->with('speaker') ->orderBy('id', 'desc') ->paginate(12); } else { if ($category == 'all' && $type != null) { $listClasses = Classes::where('type', '=', $type) ->where('is_draft', '=', 0) ->where('deleted_at', '=', null) ->with('speaker') ->orderBy('id', 'desc') ->paginate(12); } else if ($type == 'all' && $category != null) { $listClasses = Classes::where('category_id', '=', $category) ->where('is_draft', '=', 0) ->where('deleted_at', '=', null) ->with('speaker') ->orderBy('id', 'desc') ->paginate(12); } else if ($category == 'all' && $type == 'all') { $listClasses = Classes::where('deleted_at', '=', null) ->where('is_draft', '=', 0) ->with('speaker') ->orderBy('id', 'desc') ->paginate(12); } else { $listClasses = Classes::where('category_id', '=', $category) ->where('is_draft', '=', 0) ->where('type', '=', $type) ->where('deleted_at', '=', null) ->with('speaker') ->orderBy('id', 'desc') ->paginate(12); } } return view('pages.user.class.index_class', ['listClasses' => $listClasses, 'listCategories' => $listCategories, 'category_id' => $category, 'type' => $type]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getAvailableUserClasses() {\n return array('Administrator', 'Member');\n }", "static function getUserInstanciableClasses(){\n \n //get all the classes\n $AllClasses=get_declared_classes();\n \n foreach($AllClasses as $Class):\n \n $class = new ReflectionClass($Class);\n \n if($class->isInstantiable() && $class->isUserDefined()):\n \n $InstanciableClasses[]=$Class;\n \n endif;\n \n \n endforeach;\n \n return $InstanciableClasses;\n \n \n }", "public function uc_get_classlist($filter = FALSE)\n\t{\n\t\t$ret = array();\n\t\t$this->readTree(FALSE);\t\t\t\t// Make sure we have data\n\t\tforeach ($this->class_tree as $k => $v)\n\t\t{\n\t\t\tif (!$filter || check_class($filter))\n\t\t\t{\n\t\t\t\t$ret[$k] = array('userclass_name' => $v, 'userclass_description' => $v['userclass_description'], 'userclass_editclass' => $v['userclass_editclass']);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function viewClass(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM clazz ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function getClasses();", "public function getClasses();", "public function getClasses();", "public function availableClasses()\n {\n }", "function getUserTypes() {\n return array(self::HOME => self::HOME,\n self::CLINIC => self::CLINIC);\n }", "static function userClassesThatCanSeePrivate() {\n return array('Administrator', 'Member');\n }", "public function getUserbyClass()\r\n {\r\n echo \"GetUserByClass\";\r\n }", "public function all_user()\n {\n $this->res->SetObject(RCD::SC, RCD::SC, FALSE, $this->db->get('user')->result());\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "static function getAvailableUserInstances() {\n return array(new Administrator(), new Member());\n }", "public function listMyClassUser()\n {\n $listClasses = LogClasses::where('user_id', '=', Auth()->user()->id)\n ->where('deleted_at', '=', null)\n ->with(['class.category', 'class.speaker'])\n ->orderBy('created_at', 'desc')\n ->paginate(12);\n return view('pages.user.class.myclass', ['listClasses' => $listClasses]);\n }", "public function all()\n {\n return $this->classes;\n }", "function get_user_types() {\n\t$policy = new Config;\n\treturn $policy->getUserTypes();\n}", "public function getAllClassNames() \n {\n\n }", "function classlist()\n{\n global $pdo;\n $ret = array();\n $res = $pdo->run(\"SELECT * FROM groups ORDER BY group_id ASC\");\n while ($row = $res->fetch(PDO::FETCH_ASSOC)) {\n $ret[] = $row;\n }\n\n return $ret;\n}", "public function getAllClasses () {\n\t\t$qry = \"SELECT * from $this->table_name\";\n\t\t$dbh = $this->db->prepare($qry);\n\t\t$dbh->execute();\n\t\tif($dbh->rowCount()) {\n\t\t\treturn $dbh->fetchAll();\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "abstract public function getClasses();", "public function getUsersList()\n {\n }", "public function getUserTypes()\n {\n return $this->find()->all();\n }", "function getUsers(){\n }", "function getUsers(){\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public static function classes(): array;", "public function listAll()\n {\n }", "public function classesList(){\n\t\t$data['fl_classes']=array();\n\t\t// get the flight from db\n\t\t$tbl=$this->session->userdata('prefix').'flightclass';\n\t\t// get the db tables list\n\t\t$tableList=getTables(); // define in custom helper\n\t\t// check if the tbl exist in db \n\t\tif(in_array($tbl, $tableList)){\n\t\t\t$data['fl_classes']=$this->Common_model->select($tbl);\n\t\t} \n\t\t$this->show_front('flight/flight_class', $data);\n\t}", "private static function classList()\n {\n // $path = __DIR__;\n $path = base_path(config('spatie-permission-generate.controllers_root_path'));\n $fqcns = array();\n\n $allFiles = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($path));\n $phpFiles = new \\RegexIterator($allFiles, '/\\.php$/');\n foreach ($phpFiles as $phpFile) {\n $content = file_get_contents($phpFile->getRealPath());\n $tokens = token_get_all($content);\n $namespace = '';\n for ($index = 0; isset($tokens[$index]); $index++) {\n if (!isset($tokens[$index][0])) {\n continue;\n }\n if (T_NAMESPACE === $tokens[$index][0]) {\n $index += 2; // Skip namespace keyword and whitespace\n while (isset($tokens[$index]) && is_array($tokens[$index])) {\n $namespace .= $tokens[$index++][1];\n }\n }\n if (T_CLASS === $tokens[$index][0] && T_WHITESPACE === $tokens[$index + 1][0] && T_STRING === $tokens[$index +\n 2][0]) {\n $index += 2; // Skip class keyword and whitespace\n if ($namespace != 'App\\Http\\Controllers\\Auth') {\n $fqcns[] = $namespace . '\\\\' . $tokens[$index][1];\n }\n\n\n # break if you have one class per file (psr-4 compliant)\n # otherwise you'll need to handle class constants (Foo::class)\n break;\n }\n }\n }\n\n return $fqcns;\n }", "public function getLTIUsers();", "function classlist(){\r\n $query = \"SELECT \r\n * \r\n FROM \r\n userClass\r\n WHERE\r\n classID > :userClass\";\r\n\r\n // prepare query\r\n $stmt = $this->conn->prepare($query);\r\n $this->userClass=htmlspecialchars(strip_tags($_SESSION[\"userClass\"]));\r\n $stmt->bindParam(\":userClass\", $this->userClass); \r\n\r\n // execute query\r\n $stmt->execute();\r\n\r\n return $stmt;\r\n }", "abstract protected function get_activatable_classes();", "public static function getUsers(){\n return self::find()->all();\n }", "protected function getRegisteredClasses() {}", "static public function ctrListarUsuario( ){\n\n\t\treturn ModeloUsuarios::mdlListarUsuario( );\n\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "function get_user_class()\n{\n return $GLOBALS[\"CURUSER\"][\"class\"];\n}", "function get_users()\n {\n //Unimplemented\n }", "public function getUsedClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) && $class->attribute( 'object_count' ) > 0 )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }", "public function index()\n {\n $this->user_list();\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "private static function userTypes(){\n $reflector = (new \\ReflectionClass(__CLASS__));\n return array_diff($reflector->getConstants(),$reflector->getParentClass()->getConstants());\n }", "public function index()\n {\n return $this->user->all();\n }", "public function all(){\n\t\t$sql = \"select * from users\";\n\t\t$stmt= $this->connect->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll(PDO::FETCH_CLASS, 'User');\n\t\treturn $result;\n\t}", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "protected function UsersClass() {\n\t//if (vcApp::Me()->GetDropinManager()->HasModule('vbz.users')) {\n\t// return KS_CLASS_ADMIN_USER_ACCOUNTS;\n\t//} else {\n\t return 'vcUserTable';\n\t//}\n }", "public function index()\n {\n $cls = stdClass::all();\n return view(\"classes.list\", compact([\"cls\"]));\n }", "public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}", "function listUsers() {\n return $this->users;\n }", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "public static function getUserTypes() {\n return array_keys(self::userTypes());\n }", "static function list()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n $collections = [];\n\n foreach ($user_meta as $id => $attrs) {\n $collections[] = new self($id);\n }\n\n return $collections;\n }", "function user_list()\n\t{\n\t\t$this->db->where('is_active','1');\n\t\t\n\t\t$result = $this->db->get('user');\n\t\treturn $result->result_array();\n\t}", "public function users();", "public function users();", "public function users();", "public function users();", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "function ListClases(){\n\t\t$nodepal=$this->getMainNode();\n\t\techo(\"Lista de Clases: <br>\");\n\t\tforeach ($this->clases[$nodepal] as $key=>$value) {\n\t\t echo(\"$value<br/>\\n\");\n\t\t}\n\t}", "public static function getAllUser()\n\t{\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function viewClassType(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM clazz_type ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function retrieve_class_list()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('class_add');\n\t\t$this->db->where('status',1); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function getClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function index()\n {\n $this->userlist();\n }", "public function retrieve_class_list()\n\t{\n\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('class_add');\n\t\t$this->db->where('status',1); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function listAll();", "public function listAll();", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "function list_users() {\n $status = session_status();\n if($status == PHP_SESSION_NONE){\n session_start(); /// initialize session\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n return $d[\"users\"];\n }", "public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }", "public function getUserTypes()\n\t{\n\t\treturn array_flip($this->model->getAccessLevels());\n\t}", "public function getAllUsers()\n {\n return \"users from mongo\";\n }", "function exchange_get_user_caps() {\n\treturn array(\n\t\t'list_users',\n\t\t'edit_users',\n\t\t'create_users',\n\t\t'add_users',\n\t\t'remove_users',\n\t\t'promote_users',\n\t);\n}", "public static function all() {\n\t\t$pdo = FizzConfig::getDB();\n\t\t$sql = \"SELECT * FROM \" . static::tablename();\n\t\t$result = $pdo->query($sql);\n\t\treturn $result->fetchAll(\\PDO::FETCH_CLASS, get_called_class());\n\t}", "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "public function fetchAllClassIds ()\r\n {\r\n $member_id = $this->getMember_id(true);\r\n $student_class_obj = new Acad_Model_StudentClass();\r\n $student_class_obj->setMember_id($member_id);\r\n return $student_class_obj->fetchClassIds();\r\n }", "function managementUsersAll(){\n $Users = new \\Project\\Models\\ManagementUserManager();\n $allUser = $Users->allManagementUser();\n\n require 'app/views/back/managementUsers.php';\n }", "public function getAllTheoryClasses(){\n header(\"Content-Type: application/json\");\n echo json_encode($this->modelUser->getAllTheoryClasses());\n }", "public function uc_required_class_list($optlist = '', $just_ids = FALSE)\n\t{\n\t\t$ret = array();\n\t\tif (!$optlist) $optlist = 'public,guest,nobody,member,classes';\t\t// Set defaults to simplify ongoing processing\n\n\t\tif ($optlist == 'editable')\n\t\t{\n\t\t\t$temp = array_flip(explode(',',$this->get_editable_classes()));\n\t\t\tif ($just_ids) return $temp;\n\t\t\tforeach ($temp as $c => $t)\n\t\t\t{\n\t\t\t\t$temp[$c] = $this->class_tree[$c]['userclass_name'];\n\t\t\t}\n\t\t\treturn $temp;\n\t\t}\n\n\t\t//TODO - $optlist == all\n\t\t$opt_arr = explode(',',$optlist);\n\t\tforeach ($opt_arr as $k => $v)\n\t\t{\n\t\t\t$opt_arr[$k] = trim($v);\n\t\t}\n\n\t\t$opt_arr = array_flip($opt_arr);\t\t// This also eliminates duplicates which could arise from applying the other options, although shouldn't matter\n\n\t\tif (isset($opt_arr['force'])) unset($opt_arr['filter']);\n\n\t\tif (isset($opt_arr['blank']))\n\t\t{\n\t\t\t$ret[e_UC_BLANK] = 1;\n\t\t}\n\n\t\t// Do the 'fixed' classes next\n\t\tforeach ($this->text_class_link as $k => $v)\n\t\t{\n\t\t\t//\t\tif (isset($opt_arr[$k]) || isset($opt_arr['force']))\n\t\t\tif (isset($opt_arr[$k]))\n\t\t\t{\n\t\t\t\t$ret[$v] = $just_ids ? '1' : $this->fixed_classes[$v];\n\t\t\t}\n\t\t}\n\n\t\t// Now do the user-defined classes\n\t\tif (isset($opt_arr['classes']) || isset($opt_arr['force']))\n\t\t{\t// Display those classes the user is allowed to:\n\t\t\t//\tMain admin always sees the lot\n\t\t\t//\ta) Mask the 'fixed' user classes which have already been processed\n\t\t\t// b) Apply the visibility option field ('userclass_visibility')\n\t\t\t// c) Apply the matchclass option if appropriate\n\t\t\tforeach($this->class_tree as $uc_id => $row)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($uc_id,$this->fixed_classes)\n\t\t\t\t&& ( getperms('0')\n\t\t\t\t\t|| (\n\t\t\t\t\t\t(!isset($optlist['matchclass']) || check_class($uc_id))\n\t\t\t\t\t\t&& (!isset($optlist['filter']) || check_class($row['userclass_visibility']))\n\t\t\t\t\t )\n\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t $ret[$uc_id] = $just_ids ? '1' : $this->class_tree[$uc_id]['userclass_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Above loop slightly changes the display order of earlier code versions.\n\t\t\tIf readonly must be last, delete it from the $text_class_link array, and uncomment the following code\n\n\t\t\tif (isset($opt_arr['readonly']))\n\t\t\t{\n\t\t\t $ret[e_UC_READONLY] = $this->class_tree[e_UC_READONLY]['userclass_description'];\n\t\t\t}\n\t\t*/\n\t\t\t\n\t\treturn $ret;\n\t}", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "Public Function getAllUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}", "function mostraTodasClasses() {\r\n\t$arrayClasses = get_declared_classes();\r\n\t\r\n\tif (count($arrayClasses)) {\r\n\t\tforeach ($arrayClasses as $classe) {\r\n\t\t\techo \"Métodos da classe {$classe}<br/>\";\r\n\t\t\t\r\n\t\t\t$metodos = get_class_methods($classe);\r\n\t\t\tif (!count($metodos)) {\r\n\t\t\t\techo \"Classe não possui nenhum método<br/>\";\r\n\t\t\t} else {\r\n\t\t\t\tforeach ($metodos as $metodo) {\r\n\t\t\t\t\techo \"Método: {$metodo} <br/>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"Propriedades:<br />\";\r\n\t\t\t$properties = get_class_vars($classe);\r\n\t\t\tif (!count($properties)) {\r\n\t\t\t\techo \"<i>Não possui</i><br />\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tforeach($properties as $propriedade => $valor) {\r\n\t\t\t\t\techo \"Propriedade: {$propriedade}, Valor: {$valor} <br />\";\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<hr/>\";\r\n\t\t}\r\n\t}\r\n}", "public function all()\n {\n $this->forUsersMachine();\n }", "public function class()\n {\n return User::class;\n }", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "function classes() {\n\tcore();\n}", "public function selectAll(){\r\n $query = 'SELECT * FROM user_tbl';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute();\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n foreach ($users as $user){\r\n echo $user->username.\"<br>\";\r\n }\r\n }", "public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}", "protected function getAllClasses()\n {\n return $this->getClassesFromNamespace($this->getAppNamespace());\n }", "function getAllClasses(){\r\n $query=$this->db->get('class');\r\n if($query->num_rows()>0){\r\n // return result set as an associative array\r\n return $query->result();\r\n }\r\n }", "function listAllUsers($gid)\n {\n return array();\n }", "public function getAllClass()\n {\n $routes = $this->createMap(route_path());\n return array_keys($routes);\n }", "static function isAvailableUserClass($class) {\n return in_array($class, Users::getAvailableUserClasses());\n }", "public function getUserList() {\n return $this->users;\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public static function getPSUClasses(){return file_get_contents('queries/psuclasses.txt');}" ]
[ "0.7115923", "0.6675465", "0.6661889", "0.6482631", "0.6467848", "0.6467848", "0.6467848", "0.64382726", "0.6430977", "0.64124274", "0.6378397", "0.6241828", "0.6184686", "0.6169037", "0.6150231", "0.61384255", "0.6130779", "0.61231565", "0.61200404", "0.6116923", "0.6042809", "0.6032223", "0.59985906", "0.59964967", "0.59964967", "0.5995371", "0.59664917", "0.59577084", "0.59492266", "0.5942559", "0.5931106", "0.59245414", "0.5912058", "0.5899413", "0.58926004", "0.5890323", "0.58825964", "0.5864171", "0.5861316", "0.5858079", "0.5845418", "0.58282906", "0.5828047", "0.5826609", "0.5824564", "0.5821338", "0.5818672", "0.58179355", "0.58160377", "0.580655", "0.57929385", "0.5785179", "0.5783503", "0.5781842", "0.5781726", "0.5781726", "0.5781726", "0.5781726", "0.5781592", "0.5777221", "0.57709396", "0.5768662", "0.57648695", "0.5756148", "0.57430124", "0.5733566", "0.5726093", "0.5725239", "0.5725239", "0.57216287", "0.57144797", "0.57098407", "0.5696353", "0.56933594", "0.56925917", "0.5690051", "0.56821185", "0.56681645", "0.56565773", "0.5651091", "0.5650266", "0.56445813", "0.56443864", "0.56443864", "0.56443864", "0.5644367", "0.56411254", "0.5637933", "0.56377494", "0.5632361", "0.56294554", "0.5617513", "0.5617059", "0.561517", "0.56141216", "0.5600541", "0.55990857", "0.5590702", "0.5587224", "0.55869436", "0.5586415" ]
0.0
-1
List all class in user mode
public function listMyClassUser() { $listClasses = LogClasses::where('user_id', '=', Auth()->user()->id) ->where('deleted_at', '=', null) ->with(['class.category', 'class.speaker']) ->orderBy('created_at', 'desc') ->paginate(12); return view('pages.user.class.myclass', ['listClasses' => $listClasses]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getAvailableUserClasses() {\n return array('Administrator', 'Member');\n }", "static function getUserInstanciableClasses(){\n \n //get all the classes\n $AllClasses=get_declared_classes();\n \n foreach($AllClasses as $Class):\n \n $class = new ReflectionClass($Class);\n \n if($class->isInstantiable() && $class->isUserDefined()):\n \n $InstanciableClasses[]=$Class;\n \n endif;\n \n \n endforeach;\n \n return $InstanciableClasses;\n \n \n }", "public function uc_get_classlist($filter = FALSE)\n\t{\n\t\t$ret = array();\n\t\t$this->readTree(FALSE);\t\t\t\t// Make sure we have data\n\t\tforeach ($this->class_tree as $k => $v)\n\t\t{\n\t\t\tif (!$filter || check_class($filter))\n\t\t\t{\n\t\t\t\t$ret[$k] = array('userclass_name' => $v, 'userclass_description' => $v['userclass_description'], 'userclass_editclass' => $v['userclass_editclass']);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function viewClass(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM clazz ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function getClasses();", "public function getClasses();", "public function getClasses();", "public function availableClasses()\n {\n }", "function getUserTypes() {\n return array(self::HOME => self::HOME,\n self::CLINIC => self::CLINIC);\n }", "static function userClassesThatCanSeePrivate() {\n return array('Administrator', 'Member');\n }", "public function getUserbyClass()\r\n {\r\n echo \"GetUserByClass\";\r\n }", "public function all_user()\n {\n $this->res->SetObject(RCD::SC, RCD::SC, FALSE, $this->db->get('user')->result());\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "static function getAvailableUserInstances() {\n return array(new Administrator(), new Member());\n }", "public function all()\n {\n return $this->classes;\n }", "function get_user_types() {\n\t$policy = new Config;\n\treturn $policy->getUserTypes();\n}", "public function getAllClassNames() \n {\n\n }", "function classlist()\n{\n global $pdo;\n $ret = array();\n $res = $pdo->run(\"SELECT * FROM groups ORDER BY group_id ASC\");\n while ($row = $res->fetch(PDO::FETCH_ASSOC)) {\n $ret[] = $row;\n }\n\n return $ret;\n}", "public function getAllClasses () {\n\t\t$qry = \"SELECT * from $this->table_name\";\n\t\t$dbh = $this->db->prepare($qry);\n\t\t$dbh->execute();\n\t\tif($dbh->rowCount()) {\n\t\t\treturn $dbh->fetchAll();\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "abstract public function getClasses();", "public function getUsersList()\n {\n }", "public function getUserTypes()\n {\n return $this->find()->all();\n }", "function getUsers(){\n }", "function getUsers(){\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public static function classes(): array;", "public function listAll()\n {\n }", "public function classesList(){\n\t\t$data['fl_classes']=array();\n\t\t// get the flight from db\n\t\t$tbl=$this->session->userdata('prefix').'flightclass';\n\t\t// get the db tables list\n\t\t$tableList=getTables(); // define in custom helper\n\t\t// check if the tbl exist in db \n\t\tif(in_array($tbl, $tableList)){\n\t\t\t$data['fl_classes']=$this->Common_model->select($tbl);\n\t\t} \n\t\t$this->show_front('flight/flight_class', $data);\n\t}", "private static function classList()\n {\n // $path = __DIR__;\n $path = base_path(config('spatie-permission-generate.controllers_root_path'));\n $fqcns = array();\n\n $allFiles = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($path));\n $phpFiles = new \\RegexIterator($allFiles, '/\\.php$/');\n foreach ($phpFiles as $phpFile) {\n $content = file_get_contents($phpFile->getRealPath());\n $tokens = token_get_all($content);\n $namespace = '';\n for ($index = 0; isset($tokens[$index]); $index++) {\n if (!isset($tokens[$index][0])) {\n continue;\n }\n if (T_NAMESPACE === $tokens[$index][0]) {\n $index += 2; // Skip namespace keyword and whitespace\n while (isset($tokens[$index]) && is_array($tokens[$index])) {\n $namespace .= $tokens[$index++][1];\n }\n }\n if (T_CLASS === $tokens[$index][0] && T_WHITESPACE === $tokens[$index + 1][0] && T_STRING === $tokens[$index +\n 2][0]) {\n $index += 2; // Skip class keyword and whitespace\n if ($namespace != 'App\\Http\\Controllers\\Auth') {\n $fqcns[] = $namespace . '\\\\' . $tokens[$index][1];\n }\n\n\n # break if you have one class per file (psr-4 compliant)\n # otherwise you'll need to handle class constants (Foo::class)\n break;\n }\n }\n }\n\n return $fqcns;\n }", "public function getLTIUsers();", "function classlist(){\r\n $query = \"SELECT \r\n * \r\n FROM \r\n userClass\r\n WHERE\r\n classID > :userClass\";\r\n\r\n // prepare query\r\n $stmt = $this->conn->prepare($query);\r\n $this->userClass=htmlspecialchars(strip_tags($_SESSION[\"userClass\"]));\r\n $stmt->bindParam(\":userClass\", $this->userClass); \r\n\r\n // execute query\r\n $stmt->execute();\r\n\r\n return $stmt;\r\n }", "abstract protected function get_activatable_classes();", "public static function getUsers(){\n return self::find()->all();\n }", "protected function getRegisteredClasses() {}", "static public function ctrListarUsuario( ){\n\n\t\treturn ModeloUsuarios::mdlListarUsuario( );\n\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "function get_user_class()\n{\n return $GLOBALS[\"CURUSER\"][\"class\"];\n}", "function get_users()\n {\n //Unimplemented\n }", "public function getUsedClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) && $class->attribute( 'object_count' ) > 0 )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }", "public function index()\n {\n $this->user_list();\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "private static function userTypes(){\n $reflector = (new \\ReflectionClass(__CLASS__));\n return array_diff($reflector->getConstants(),$reflector->getParentClass()->getConstants());\n }", "public function index()\n {\n return $this->user->all();\n }", "public function all(){\n\t\t$sql = \"select * from users\";\n\t\t$stmt= $this->connect->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll(PDO::FETCH_CLASS, 'User');\n\t\treturn $result;\n\t}", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "protected function UsersClass() {\n\t//if (vcApp::Me()->GetDropinManager()->HasModule('vbz.users')) {\n\t// return KS_CLASS_ADMIN_USER_ACCOUNTS;\n\t//} else {\n\t return 'vcUserTable';\n\t//}\n }", "public function index()\n {\n $cls = stdClass::all();\n return view(\"classes.list\", compact([\"cls\"]));\n }", "public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}", "function listUsers() {\n return $this->users;\n }", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "public static function getUserTypes() {\n return array_keys(self::userTypes());\n }", "static function list()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n $collections = [];\n\n foreach ($user_meta as $id => $attrs) {\n $collections[] = new self($id);\n }\n\n return $collections;\n }", "function user_list()\n\t{\n\t\t$this->db->where('is_active','1');\n\t\t\n\t\t$result = $this->db->get('user');\n\t\treturn $result->result_array();\n\t}", "public function users();", "public function users();", "public function users();", "public function users();", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "function ListClases(){\n\t\t$nodepal=$this->getMainNode();\n\t\techo(\"Lista de Clases: <br>\");\n\t\tforeach ($this->clases[$nodepal] as $key=>$value) {\n\t\t echo(\"$value<br/>\\n\");\n\t\t}\n\t}", "public static function getAllUser()\n\t{\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function viewClassType(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM clazz_type ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function retrieve_class_list()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('class_add');\n\t\t$this->db->where('status',1); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function getClassList()\n {\n $return = array();\n $classes = eZContentClass::fetchList();\n $classBlacklist = self::getClassBlacklist(); \n foreach( $classes as $class )\n {\n if ( !isset( $classBlacklist[$class->attribute('identifier')] ) )\n {\n $return[$class->attribute('identifier')] = $class;\n }\n }\n ksort( $return );\n return $return;\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function index()\n {\n $this->userlist();\n }", "public function retrieve_class_list()\n\t{\n\t\n\t\t$this->db->select('*');\n\t\t$this->db->from('class_add');\n\t\t$this->db->where('status',1); \n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\treturn false;\n\t}", "public function listAll();", "public function listAll();", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "function list_users() {\n $status = session_status();\n if($status == PHP_SESSION_NONE){\n session_start(); /// initialize session\n }\n $user_name = check_logged(); /// function checks if visitor is logged in.\n if (!$user_name)\n return;\n\n $allowed = false;\n if (!check_role( \"admin\" )) {\n return false;\n }\n\n // read the permissions database\n $d = loadDB();\n return $d[\"users\"];\n }", "public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }", "public function getUserTypes()\n\t{\n\t\treturn array_flip($this->model->getAccessLevels());\n\t}", "public function getAllUsers()\n {\n return \"users from mongo\";\n }", "function exchange_get_user_caps() {\n\treturn array(\n\t\t'list_users',\n\t\t'edit_users',\n\t\t'create_users',\n\t\t'add_users',\n\t\t'remove_users',\n\t\t'promote_users',\n\t);\n}", "public static function all() {\n\t\t$pdo = FizzConfig::getDB();\n\t\t$sql = \"SELECT * FROM \" . static::tablename();\n\t\t$result = $pdo->query($sql);\n\t\treturn $result->fetchAll(\\PDO::FETCH_CLASS, get_called_class());\n\t}", "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "public function fetchAllClassIds ()\r\n {\r\n $member_id = $this->getMember_id(true);\r\n $student_class_obj = new Acad_Model_StudentClass();\r\n $student_class_obj->setMember_id($member_id);\r\n return $student_class_obj->fetchClassIds();\r\n }", "function managementUsersAll(){\n $Users = new \\Project\\Models\\ManagementUserManager();\n $allUser = $Users->allManagementUser();\n\n require 'app/views/back/managementUsers.php';\n }", "public function getAllTheoryClasses(){\n header(\"Content-Type: application/json\");\n echo json_encode($this->modelUser->getAllTheoryClasses());\n }", "public function uc_required_class_list($optlist = '', $just_ids = FALSE)\n\t{\n\t\t$ret = array();\n\t\tif (!$optlist) $optlist = 'public,guest,nobody,member,classes';\t\t// Set defaults to simplify ongoing processing\n\n\t\tif ($optlist == 'editable')\n\t\t{\n\t\t\t$temp = array_flip(explode(',',$this->get_editable_classes()));\n\t\t\tif ($just_ids) return $temp;\n\t\t\tforeach ($temp as $c => $t)\n\t\t\t{\n\t\t\t\t$temp[$c] = $this->class_tree[$c]['userclass_name'];\n\t\t\t}\n\t\t\treturn $temp;\n\t\t}\n\n\t\t//TODO - $optlist == all\n\t\t$opt_arr = explode(',',$optlist);\n\t\tforeach ($opt_arr as $k => $v)\n\t\t{\n\t\t\t$opt_arr[$k] = trim($v);\n\t\t}\n\n\t\t$opt_arr = array_flip($opt_arr);\t\t// This also eliminates duplicates which could arise from applying the other options, although shouldn't matter\n\n\t\tif (isset($opt_arr['force'])) unset($opt_arr['filter']);\n\n\t\tif (isset($opt_arr['blank']))\n\t\t{\n\t\t\t$ret[e_UC_BLANK] = 1;\n\t\t}\n\n\t\t// Do the 'fixed' classes next\n\t\tforeach ($this->text_class_link as $k => $v)\n\t\t{\n\t\t\t//\t\tif (isset($opt_arr[$k]) || isset($opt_arr['force']))\n\t\t\tif (isset($opt_arr[$k]))\n\t\t\t{\n\t\t\t\t$ret[$v] = $just_ids ? '1' : $this->fixed_classes[$v];\n\t\t\t}\n\t\t}\n\n\t\t// Now do the user-defined classes\n\t\tif (isset($opt_arr['classes']) || isset($opt_arr['force']))\n\t\t{\t// Display those classes the user is allowed to:\n\t\t\t//\tMain admin always sees the lot\n\t\t\t//\ta) Mask the 'fixed' user classes which have already been processed\n\t\t\t// b) Apply the visibility option field ('userclass_visibility')\n\t\t\t// c) Apply the matchclass option if appropriate\n\t\t\tforeach($this->class_tree as $uc_id => $row)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($uc_id,$this->fixed_classes)\n\t\t\t\t&& ( getperms('0')\n\t\t\t\t\t|| (\n\t\t\t\t\t\t(!isset($optlist['matchclass']) || check_class($uc_id))\n\t\t\t\t\t\t&& (!isset($optlist['filter']) || check_class($row['userclass_visibility']))\n\t\t\t\t\t )\n\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t $ret[$uc_id] = $just_ids ? '1' : $this->class_tree[$uc_id]['userclass_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* Above loop slightly changes the display order of earlier code versions.\n\t\t\tIf readonly must be last, delete it from the $text_class_link array, and uncomment the following code\n\n\t\t\tif (isset($opt_arr['readonly']))\n\t\t\t{\n\t\t\t $ret[e_UC_READONLY] = $this->class_tree[e_UC_READONLY]['userclass_description'];\n\t\t\t}\n\t\t*/\n\t\t\t\n\t\treturn $ret;\n\t}", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "Public Function getAllUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}", "function mostraTodasClasses() {\r\n\t$arrayClasses = get_declared_classes();\r\n\t\r\n\tif (count($arrayClasses)) {\r\n\t\tforeach ($arrayClasses as $classe) {\r\n\t\t\techo \"Métodos da classe {$classe}<br/>\";\r\n\t\t\t\r\n\t\t\t$metodos = get_class_methods($classe);\r\n\t\t\tif (!count($metodos)) {\r\n\t\t\t\techo \"Classe não possui nenhum método<br/>\";\r\n\t\t\t} else {\r\n\t\t\t\tforeach ($metodos as $metodo) {\r\n\t\t\t\t\techo \"Método: {$metodo} <br/>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"Propriedades:<br />\";\r\n\t\t\t$properties = get_class_vars($classe);\r\n\t\t\tif (!count($properties)) {\r\n\t\t\t\techo \"<i>Não possui</i><br />\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tforeach($properties as $propriedade => $valor) {\r\n\t\t\t\t\techo \"Propriedade: {$propriedade}, Valor: {$valor} <br />\";\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<hr/>\";\r\n\t\t}\r\n\t}\r\n}", "public function all()\n {\n $this->forUsersMachine();\n }", "public function class()\n {\n return User::class;\n }", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "function classes() {\n\tcore();\n}", "public function selectAll(){\r\n $query = 'SELECT * FROM user_tbl';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute();\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n foreach ($users as $user){\r\n echo $user->username.\"<br>\";\r\n }\r\n }", "public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}", "protected function getAllClasses()\n {\n return $this->getClassesFromNamespace($this->getAppNamespace());\n }", "function getAllClasses(){\r\n $query=$this->db->get('class');\r\n if($query->num_rows()>0){\r\n // return result set as an associative array\r\n return $query->result();\r\n }\r\n }", "function listAllUsers($gid)\n {\n return array();\n }", "public function getAllClass()\n {\n $routes = $this->createMap(route_path());\n return array_keys($routes);\n }", "static function isAvailableUserClass($class) {\n return in_array($class, Users::getAvailableUserClasses());\n }", "public function getUserList() {\n return $this->users;\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public static function getPSUClasses(){return file_get_contents('queries/psuclasses.txt');}" ]
[ "0.7115923", "0.6675465", "0.6661889", "0.6482631", "0.6467848", "0.6467848", "0.6467848", "0.64382726", "0.6430977", "0.64124274", "0.6378397", "0.6241828", "0.6184686", "0.6169037", "0.61384255", "0.6130779", "0.61231565", "0.61200404", "0.6116923", "0.6042809", "0.6032223", "0.59985906", "0.59964967", "0.59964967", "0.5995371", "0.59664917", "0.59577084", "0.59492266", "0.5942559", "0.5931106", "0.59245414", "0.5912058", "0.5899413", "0.58926004", "0.5890323", "0.58825964", "0.5864171", "0.5861316", "0.5858079", "0.5845418", "0.58282906", "0.5828047", "0.5826609", "0.5824564", "0.5821338", "0.5818672", "0.58179355", "0.58160377", "0.580655", "0.57929385", "0.5785179", "0.5783503", "0.5781842", "0.5781726", "0.5781726", "0.5781726", "0.5781726", "0.5781592", "0.5777221", "0.57709396", "0.5768662", "0.57648695", "0.5756148", "0.57430124", "0.5733566", "0.5726093", "0.5725239", "0.5725239", "0.57216287", "0.57144797", "0.57098407", "0.5696353", "0.56933594", "0.56925917", "0.5690051", "0.56821185", "0.56681645", "0.56565773", "0.5651091", "0.5650266", "0.56445813", "0.56443864", "0.56443864", "0.56443864", "0.5644367", "0.56411254", "0.5637933", "0.56377494", "0.5632361", "0.56294554", "0.5617513", "0.5617059", "0.561517", "0.56141216", "0.5600541", "0.55990857", "0.5590702", "0.5587224", "0.55869436", "0.5586415" ]
0.6150231
14
Return combo list of differents status of a proposal Values are id of table c_propalst
function selectAskPriceSupplierStatus($selected='',$short=0) { global $langs; $sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst"; $sql .= " WHERE active = 1"; dol_syslog(get_class($this)."::selectAskPriceSupplierStatus", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { print '<select class="flat" name="askpricesupplier_statut">'; print '<option value="">&nbsp;</option>'; $num = $this->db->num_rows($resql); $i = 0; if ($num) { while ($i < $num) { $obj = $this->db->fetch_object($resql); if ($selected == $obj->id) { print '<option value="'.$obj->id.'" selected>'; } else { print '<option value="'.$obj->id.'">'; } $key=$obj->code; if ($langs->trans("PropalStatus".$key.($short?'Short':'')) != "PropalStatus".$key.($short?'Short':'')) { print $langs->trans("PropalStatus".$key.($short?'Short':'')); } else { $conv_to_new_code=array('PR_DRAFT'=>'Draft','PR_OPEN'=>'Opened','PR_CLOSED'=>'Closed','PR_SIGNED'=>'Signed','PR_NOTSIGNED'=>'NotSigned','PR_FAC'=>'Billed'); if (! empty($conv_to_new_code[$obj->code])) $key=$conv_to_new_code[$obj->code]; print ($langs->trans("PropalStatus".$key.($short?'Short':''))!="PropalStatus".$key.($short?'Short':''))?$langs->trans("PropalStatus".$key.($short?'Short':'')):$obj->label; } print '</option>'; $i++; } } print '</select>'; } else { dol_print_error($this->db); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProposalStatusList()\n {\n $query = \"SELECT StatusID, Name FROM ProposalStatus;\";\n $stmt = $this->conn->prepare( $query );\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function getListCpr()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_certify_receipt t, \n (SELECT @rownum := 0) r ORDER BY id_cpr ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "function AllPropsAcceptRejectByOppIDEval1($id)\n {\n $query = \"select count(*) as total from Proposal where ((`Status` is null) OR (`Status` not in (10,15,60,65))) AND OpportunityID = :ID ;\";\n $stmt = $this->conn->prepare( $query );\n\n // bind parameters\n $stmt->bindParam(':ID', $id);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $rowCount = $stmt->rowCount();\n $proposalCount = 0;\n if($rowCount > 0)\n {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $proposalCount = $row['total'];\n }\n\n if($proposalCount > 0)\n return false;\n else\n return true;\n }", "function AllPropsAcceptRejectByOppIDEval2($id)\n {\n $query = \"select count(*) as total from Proposal where ((`Status` is null) OR (`Status` not in (60,65))) AND OpportunityID = :ID ;\";\n $stmt = $this->conn->prepare( $query );\n\n // bind parameters\n $stmt->bindParam(':ID', $id);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $rowCount = $stmt->rowCount();\n $proposalCount = 0;\n if($rowCount > 0)\n {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $proposalCount = $row['total'];\n }\n\n if($proposalCount > 0)\n return false;\n else\n return true;\n }", "function getProposals() {\n\t\t$results = \"\";\n\t\t$sql = \"SELECT Proposal.ProposalID, Proposal.CustomerID, Proposal.ServiceID, Proposal.DateCreated, Customer.FirstName, Customer.LastName, Service.Name \".\n\t\t\"FROM Proposal \".\n\t\t\"JOIN Customer ON Proposal.CustomerID = Customer.CustomerID \".\n\t\t\"JOIN Service ON Proposal.ServiceID = Service.ServiceID\";\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "function tbc_books_in_progress_all()\n{\n $output = \"\";\n $query = db_select('list_of_category');\n $query->fields('list_of_category');\n $query->orderBy('id', 'ASC');\n $category_list = $query->execute();\n $query = \"\n SELECT po.creation_date, pe.book as book, pe.author as author, pe.publisher as publisher,pe.edition as edition, pe.isbn as isbn, pe.year as year, pe.id as pe_id, loc.category_name as category, loc.category_id as cat_id\nFROM textbook_companion_preference pe \nLEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id\nLEFT JOIN list_of_category loc on pe.category = loc.category_id\nWHERE po.proposal_status IN (1,4) AND pe.approval_status = 1 \nORDER BY po.creation_date DESC\n \";\n $result = db_query($query);\n $proposal_rows = array();\n $i = $result->rowCount();\n $category_data = _tbc_list_of_category($preference_data->category);\n $output = \"<hr>\";\n while ($row = $result->fetchObject())\n {\n $proposal_date = date(\"d-m-Y\", $row->creation_date); // remove comment to display year\n if ($row->category != NULL)\n {\n $category = $row->category;\n } //$row->category != NULL\n else\n {\n $category = \"Not assigned\";\n }\n $preference_rows[] = array(\n $i,\n $proposal_date,\n $row->book . \"<br><br>[ Author: \" . $row->author . \", Publisher: \" . $row->publisher . \", Year: \" . $row->year . \", Edition: \" . $row->edition . \", ISBN: \" . $row->isbn . \" ]\",\n $category\n );\n $i--;\n } //$row = $result->fetchObject()\n $preference_header = array(\n 'No',\n 'Proposal Date',\n 'Book',\n 'Category'\n );\n $output .= theme('table', array(\n 'header' => $preference_header,\n 'rows' => $preference_rows\n ));\n return $output;\n}", "function dwsim_flowsheet_completed_proposals_all()\n{\n\t$output = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 3);\n\t$query->orderBy('actual_completion_date', 'DESC');\n\t//$query->condition('is_completed', 1);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$output .= \"Work has been completed for the following flow sheets. We welcome your contributions. For more details, please visit \".l(\"https://dwsim.fossee.in/flowsheeting-project\",\"https://dwsim.fossee.in/flowsheeting-project\", array('attributes' => array('target' => '_blank'))).\"<br>\".\"<h4>\".\"If you are looking for flowsheeting project ideas, \".l(\"click here\",\"https://dwsim.fossee.in/flowsheeting-ideas\",array('attributes' => array('class' => array('flash_content'), 'target' => '_blank'))).\"</h4>\".\"<hr>\";\n\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$output .= \"Total number of completed flowsheets: \" . $result->rowCount() . \"<br>\";\n\t\t$output .= \"Work has been completed for the following flow sheets. We welcome your contributions. For more details, please visit \".l(\"https://dwsim.fossee.in/flowsheeting-project\",\"https://dwsim.fossee.in/flowsheeting-project\", array('attributes' => array('target' => '_blank'))).\"<br>\".\"<h4>\".\"If you are looking for flowsheeting project ideas, \".l(\"click here\",\"https://dwsim.fossee.in/flowsheeting-ideas\",array('attributes' => array('class' => array('flash_content'), 'target' => '_blank'))).\"</h4>\".\"<hr>\";\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$completion_date = date(\"Y\", $row->actual_completion_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\tl($row->project_title, \"flowsheeting-project/dwsim-flowsheet-run/\" . $row->id, array('attributes' => array('title' => 'This is a zip file containing a pdf (abstract) and a dwxml/dwxmz file which is the DWSIM flow sheet which is to be viewed by right clicking on the file and opening with DWSIM.'))),\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$completion_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year of Completion'\n\t\t);\n\t\t$output .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $output;\n}", "public function getDeliveryStatusList(){\n\t\t/* variable initialization */\n\t\t$strReturnArr\t= $strQueryArr\t= array();\n\t\t\n\t\t/* Creating query array */\n\t\t$strQueryArr\t= array(\n\t\t\t\t\t\t\t\t\t'table'=>$this->_strTableName,\n\t\t\t\t\t\t\t\t\t'column'=>array('id','description'),\n\t\t\t\t\t\t\t\t\t'where'=>array('attribute_code'=>DELIVERY_STATUS_WIDGET_ATTR_CODE),\n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t \n\t\t/* Get data from dataset */\n\t\t$strResultSetArr\t= $this->_databaseObject->getDataFromTable($strQueryArr);\n\t\t/* removed used variable */\n\t\tunset($strQueryArr);\n\t\t\n\t\t/* if status found teh do needful */\n\t\tif(!empty($strResultSetArr)){\n\t\t\t/* Iterting the loop */\n\t\t\tforeach($strResultSetArr as $strResultSetArrKey => $strResultSetArrValue){\n\t\t\t\t/* setting the key value paris */\n\t\t\t\t$strReturnArr['keyvalue'][$strResultSetArrValue['id']]\t= $strResultSetArrValue['description'];\n\t\t\t}\n\t\t}\n\t\t/* set the default result set */\n\t\t$strReturnArr['defaultvalue']\t= $strResultSetArr;\n\t\t/* removed used variable */\n\t\tunset($strResultSetArr);\n\t\t\n\t\t/* return the status result set */\n\t\treturn $strReturnArr;\n\t}", "function getCommonProvisions();", "function getStatus() {\n \t\n \t$status = array();\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_contacter'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"to_contact\"] = $result['num_contact'];\n\n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'contacte'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"contacted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_rappeler'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"call_back\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'termine'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"deleted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_motif FROM mp_activation_motifs\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n\n $status[\"number_motif\"] = $result['num_motif'];\n \n \n return $status;\n }", "public static function getListaProvincias() {\n $droptions = Provincia::find()->orderBy('nombre_provincia')->asArray()->all();\n return ArrayHelper::map($droptions, 'id', 'nombre_provincia');\n }", "public static function getStatusList() {\r\n return [\r\n self::STATUS_ACTIVE => 'Active',\r\n self::STATUS_RETIRED => 'Retired'\r\n ];\r\n }", "public function proposals()\r\n {\r\n if (!staff_can('view', 'proposals')) {\r\n $where = get_proposals_sql_where_staff($this->staffId);\r\n $this->CI->db->where($where);\r\n }\r\n $this->CI->db->where_in('status', [1, 4, 6]);\r\n $this->CI->db->where('rel_id', $this->leadId);\r\n $this->CI->db->where('rel_type', 'lead');\r\n\r\n return $this->CI->db->count_all_results('proposals');\r\n }", "public function get_checklist_approval_data() {\n\n $approval_data = array();\n\n $query = db_select('checklist_inspections', 'c')\n ->fields('c', array('order_num','category','unit_id','nid','approved','inspected_by','repair_data','date_submitted','follow_up_alert','comments'))\n ->condition('approved', NULL);\n $results = $query->execute();\n\n foreach ($results as $val) {\n $approval_data[] = (array) $val;\n }\n return $approval_data;\n }", "public function sGetComparisonList()\n {\n return $this->productComparisons->sGetComparisonList();\n }", "public function combo_indicadores_pei(){\n $salida = \"\";\n $acc_id = $_POST[\"elegido\"];\n\n $combog = pg_query(' select pt.*,rmp.*\n from _acciones_estrategicas ae\n Inner Join _resultado_mplazo as rmp On rmp.acc_id=ae.acc_id\n Inner Join _pterminal_mplazo as pt On pt.rm_id=rmp.rm_id\n where ae.acc_id='.$acc_id.' and rmp.rm_estado!=\\'3\\' and pt.ptm_estado!=\\'3\\'\n order by pt.ptm_codigo desc');\n $salida .= \"<option value=''>\" . mb_convert_encoding('SELECCIONE INDICADOR', 'cp1252', 'UTF-8') . \"</option>\";\n while ($sql_p = pg_fetch_row($combog)) {\n $salida .= \"<option value='\" . $sql_p[0] . \"'>\" .$sql_p[2].\".- \".$sql_p[5] . \"</option>\";\n }\n echo $salida;\n }", "function getStatusList() {\n $statusList = array();\n foreach (Constants::$statusNames as $id => $name) {\n $statusList[$id] = \"$id - $name\";\n }\n return $statusList;\n}", "public function getStatusList()\n {\n $option = '';\n $query = $this->db->query(\"SELECT * FROM status\");\n while ($rdata = mysqli_fetch_assoc($query)) {\n $option .= '<option value=\"' . $rdata['idStatus'] . '\">' . mb_strtoupper(\n $rdata['nombreStatus']\n ) . '</option>';\n }\n\n return $option;\n }", "public static function getStatusList()\n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "public function getStatusesList(){\n return $this->_get(1);\n }", "public function load_proposal()\n {\n return $this->db\n ->select('epro_proposal.*,epro_proposal_detail.*,epro_proposal_administrasi.*,epro_proposal.id as idprop')\n ->from('epro_proposal')\n ->join('epro_proposal_detail','epro_proposal_detail.id_proposal=epro_proposal.id','left')\n ->join('epro_proposal_administrasi','epro_proposal_administrasi.id_proposal=epro_proposal.id','left')\n ->get();\n }", "public function getPayoneStatusList() \n {\n $aPayoneStatusList = $this->_oFcpoHelper->fcpoGetPayoneStatusList();\n \n $aNewList = array();\n foreach ($aPayoneStatusList as $sStatusId) {\n $oStatus = new stdClass();\n $oStatus->sId = $sStatusId;\n $oStatus->sTitle = $this->_oFcpoHelper->fcpoGetLang()->translateString('fcpo_status_'.$sStatusId, null, true);\n $aNewList[] = $oStatus;\n }\n \n return $aNewList;\n }", "function getOrderStatusList(){\n\treturn [\n\t\t\"NEW\" => [\n\t\t\t'code' => 1,\n\t\t\t'text' => \"Yet to Start\"\n\t\t],\n\t\t\"IN_PROGRESS\" => [\n\t\t\t'code' => 2,\n\t\t\t'text' => \"Working\"\n\t\t],\n\t\t\"DELIVERED\" => [\n\t\t\t'code' => 3,\n\t\t\t'text' => \"Delivered\"\n\t\t],\n\t\t\"IN_REVIEW\" => [\n\t\t\t'code' => 4,\n\t\t\t'text' => \"In review\"\n\t\t],\n\t\t\"COMPLETED\" => [\n\t\t\t'code' => 5,\n\t\t\t'text' => \"Completed\"\n\t\t],\n\t\t\"CANCELLED\" => [\n\t\t\t'code' => 6,\n\t\t\t'text' => \"Cancelled\"\n\t\t],\n\t\t\"PENDIND_REQUIREMENT\" => [\n\t\t\t'code' => 7,\n\t\t\t'text' => \"Pending Requirement\"\n\t\t]\n\t];\n}", "function listarCotizacionProcesoCompra(){\n\t\t$this->procedimiento='adq.f_cotizacion_sel';\n\t\t$this->transaccion='ADQ_COTPROC_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t$this->setCount(false);\n\t\t\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cotizacion','int4');\t \n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function dept_choice(){\n $outputs = array();\n $dept_type = (new TbMsCmnCdModel())->getCdKeyY(TbMsCmnCdModel::$department_type_cd_pre);\n $outputs['dept_type'] = $this->arrKeyVal2NewArr($dept_type);\n $dept_status = TbHrDeptModel::getStatusForDept();\n $outputs['dept_status'] = $this->arrKeyVal2NewArr($dept_status);\n $dept_incharge = TbHrDeptModel::getTypeForEDRelation();\n $outputs['dept_incharge'] = $this->arrKeyVal2NewArr($dept_incharge);\n\n return $outputs;\n }", "public function getStatus() {\r\n\t\t$status = array();\r\n\t\tif ($this -> draft) {\r\n\t\t\t$status['type'] = 0;\r\n\t\t\t$status['condition'] = 'draft';\r\n\t\t\treturn $status;\r\n\t\t}\r\n\t\tif ($this -> is_approved) {\r\n\t\t\t$status['type'] = 2;\r\n\t\t\t$status['condition'] = 'approved';\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$status['type'] = 1;\r\n\t\t\t$status['condition'] = 'pending';\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "public static function getOptionList() {\n $cotizaciones = Cotizacion::find()->where([\"estado_cotizacion\" => self::ESTADO_ACEPTADA])->orWhere([\"estado_cotizacion\" => self::ESTADO_ACEPTADA_PARTIAL])->all();\n return ArrayHelper::map($cotizaciones, '_id', 'textCotizacion');\n }", "public function violation_listSec()\r\n\t{\r\n\t\t$status_id = 1;//1 means pending pa siya\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tINNER JOIN tbl_violations v \r\n\t\t\t\tON i.item_id = v.vehicle_id\r\n\t\t\t\tWHERE v.status = ?\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql, [$status_id]);\r\n\r\n\t\treturn $result;\r\n\t}", "public abstract function getSelectedStatuses();", "public function getStatusList()\n {\n return ['0' => __('修改'), '1' => __('提议'), '2' => __('新增'), '3' => __('废止')];\n }", "function list_actividades_componente($com_id){\n $sql = 'select p.prod_id,p.com_id,p.prod_producto,p.prod_ppto,p.indi_id,p.prod_indicador,p.prod_linea_base, p.prod_meta,p.prod_fuente_verificacion,p.prod_unidades,p.prod_ponderacion,p.estado,p.prod_mod,\n p.prod_resultado,p.acc_id,p.prod_cod, p.prod_observacion,p.mt_id,p.or_id,i.indi_descripcion,\n ore.or_id,ore.or_codigo,og.og_id,og.og_codigo, ae.acc_id,ae.acc_codigo,oe.obj_codigo,a.*\n from _productos p\n Inner Join indicador as i On i.indi_id=p.indi_id\n \n Inner Join objetivos_regionales as ore On ore.or_id=p.or_id\n\n Inner Join objetivo_programado_mensual as opm On ore.pog_id=opm.pog_id\n Inner Join objetivo_gestion as og On og.og_id=opm.og_id\n Inner Join _acciones_estrategicas as ae On ae.acc_id=og.acc_id\n Inner Join _objetivos_estrategicos as oe On oe.obj_id=ae.obj_id\n\n Inner Join _actividades as a On a.prod_id=p.prod_id\n \n where p.com_id='.$com_id.' and p.estado!=\\'3\\'\n order by p.prod_cod, oe.obj_codigo, ae.ae asc'; \n $query = $this->db->query($sql);\n return $query->result_array();\n }", "public function sGetComparisons()\n {\n return $this->productComparisons->sGetComparisons();\n }", "function getCurrentPropositions()\n {\n //Get the current prop\n $getPropsSql = \"SELECT * FROM propositions WHERE isOld = 0\";\n $propsReply = safeQuery($getPropsSql);\n\n //Get the total amount of current bets\n $totalAmountOfBets = getAmountOfBets();\n\n //Calculate the total amount of rewards\n $payoutPercentage = getPayoutPercentage();\n $amountOfRewards = floor($payoutPercentage * $totalAmountOfBets);\n\n //Construct the reply\n $reply = array();\n //Loop over every row\n foreach($propsReply as $row)\n {\n //Get the amount of bets for this proposition\n $amountOfBets = getAmountOfBets($row[\"id\"]);\n //Calculate the chance to win (0 if there are no bets yet at all)\n $chanceToWin = 0;\n if($totalAmountOfBets != 0)\n $chanceToWin = $amountOfBets / $totalAmountOfBets;\n //Calculate the amount of winners (\"cocktailkoers\") on this proposition\n $amountOfWinners = floor($chanceToWin * $amountOfRewards);\n\n //Add the row to the reply\n $reply[] = array(\"id\"=>$row[\"id\"], \"description\"=>stripslashes($row[\"description\"]), \"amountOfWinners\"=>$amountOfWinners);\n }\n\n return $reply;\n }", "function getPropertiesList1($id,$id1){\r\n $q = \"select * from projects where Ptype = '$id' and ProjectType = '$id1'\";\r\n //$result = mysql_query($q);\r\n return $q;\r\n }", "public function getcboregprocede() {\n \n $sql = \"select ctipo as 'cprocede', dregistro as 'dprocede' from ttabla where ctabla = 47 and ncorrelativo <> 0 order by dregistro;\";\n\t\t$query = $this->db->query($sql);\n \n if ($query->num_rows() > 0) {\n\n $listas = '<option value=\"0\" selected=\"selected\">::Elegir</option>';\n \n foreach ($query->result() as $row)\n {\n $listas .= '<option value=\"'.$row->cprocede.'\">'.$row->dprocede.'</option>'; \n }\n return $listas;\n }{\n return false;\n }\t\n }", "function get_commission_combo()\n {\n $output = '';\n $query = $this->db->query('select * from commissions order by commissionPercent');\n foreach($query->result() as $row)\n {\n $output .= '<option value=\"' . $row->commissionPercent . '\"';\n $output .= '>' . $row->commissionPercent . '</option>';\n }\n return $output;\n }", "public function fcpoGetStatus() \n {\n $sQuery = \"SELECT oxid FROM fcpotransactionstatus WHERE fcpo_txid = '{$this->oxorder__fcpotxid->value}' ORDER BY fcpo_sequencenumber ASC\";\n $aRows = $this->_oFcpoDb->getAll($sQuery);\n\n $aStatus = array();\n foreach ($aRows as $aRow) {\n $oTransactionStatus = $this->_oFcpoHelper->getFactoryObject('fcpotransactionstatus');\n $sTransactionStatusOxid = (isset($aRow[0])) ? $aRow[0] : $aRow['oxid'];\n $oTransactionStatus->load($sTransactionStatusOxid);\n $aStatus[] = $oTransactionStatus;\n }\n\n return $aStatus;\n }", "public function viewableAffiliateProductStatuses()\r\n {\r\n return array(\r\n Product::ACTIVE,\r\n Product::INACTIVE,\r\n );\r\n }", "public function getProdStatuses() {\n $dql = \"SELECT i from Infrastructure i\";\n $prodStatuses = $this->em\n ->createQuery($dql)\n ->getResult();\n return $prodStatuses;\n }", "public function proposals()\n {\n return $this->hasMany(Proposal::class, 'proposer_contractor_id');\n }", "public function Get_Status() {\n $flags = array(\n 'complete' => array(\n 'code' => 'complete',\n 'name' => 'Complete',\n //'_update' => array($this,'_Status_Make_Complete'),\n ),\n 'cool' => array(\n 'code' => 'cool',\n 'name' => 'Cool',\n //'_update' => array($this,'_Status_Make_Complete'),\n )\n );\n // Apply any filter for adding to the flag list\n $status = apply_filters('vcff_reports_status',$status,$this);\n // Return the flag list\n return $flags;\n }", "public static function getDecisionDropdown() {\n\n $decisions = Decision::orderBy('decision', 'ASC')->get();\n\n $decisions_for_dropdown = [];\n foreach($decisions as $decision) {\n $decisions_for_dropdown[$decision->id] = $decision->decision;\n }\n\n return $decisions_for_dropdown;\n }", "function get_ballot_type_assign_status($l_id){\n\n $this->db->from('ballot_map');\n $this->db->where('l_id' , $l_id);\n $query = $this->db->get();\n $list = $query->result();\n\n $map_to_t_id = array();\n foreach ($list as $key => $value) {\n array_push($map_to_t_id, $value->{'t_id'});\n }\n\n\n $this->db->from('ballot_type');\n $query = $this->db->get();\n $list = $query->result();\n\n\n foreach ($list as $key => $value) {\n if (in_array($value->{'t_id'}, $map_to_t_id)) {\n $list[$key]->{'assign'} = 'true';\n }else{\n $list[$key]->{'assign'} = 'false';\n }\n }\n\n return $list;\n }", "public function get_data_pros_con()\n {\n \t$this->db->select('p.add_time, n.nama_pengguna, p.id_prospektus, p.status');\n \t$this->db->from('prospektus as p');\n \t$this->db->join('pengguna as n', 'n.id_pengguna = p.id_pengguna', 'inner');\n \t$this->db->where('p.status !=', null);\n \t$this->db->order_by('p.add_time', 'desc');\n\n \treturn $this->db->get();\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_APPROVAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL,\n self::STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL_REVERSED,\n self::STATUS_AUTH_ADJUSTMENT_AUTHORISED,\n self::STATUS_AUTH_ADJUSTMENT_ERROR,\n self::STATUS_AUTH_ADJUSTMENT_REFUSED,\n self::STATUS_AUTHORISED,\n self::STATUS_BANK_TRANSFER,\n self::STATUS_BANK_TRANSFER_PENDING,\n self::STATUS_BOOKED,\n self::STATUS_BOOKING_PENDING,\n self::STATUS_CANCELLED,\n self::STATUS_CAPTURE_PENDING,\n self::STATUS_CAPTURE_REVERSAL_PENDING,\n self::STATUS_CAPTURE_REVERSED,\n self::STATUS_CAPTURED,\n self::STATUS_CAPTURED_EXTERNALLY,\n self::STATUS_CHARGEBACK,\n self::STATUS_CHARGEBACK_EXTERNALLY,\n self::STATUS_CHARGEBACK_PENDING,\n self::STATUS_CHARGEBACK_REVERSAL_PENDING,\n self::STATUS_CHARGEBACK_REVERSED,\n self::STATUS_CREDITED,\n self::STATUS_DEPOSIT_CORRECTION,\n self::STATUS_DEPOSIT_CORRECTION_PENDING,\n self::STATUS_DISPUTE,\n self::STATUS_DISPUTE_CLOSED,\n self::STATUS_DISPUTE_EXPIRED,\n self::STATUS_DISPUTE_NEEDS_REVIEW,\n self::STATUS_ERROR,\n self::STATUS_EXPIRED,\n self::STATUS_FAILED,\n self::STATUS_FEE,\n self::STATUS_FEE_PENDING,\n self::STATUS_INTERNAL_TRANSFER,\n self::STATUS_INTERNAL_TRANSFER_PENDING,\n self::STATUS_INVOICE_DEDUCTION,\n self::STATUS_INVOICE_DEDUCTION_PENDING,\n self::STATUS_MANUAL_CORRECTION_PENDING,\n self::STATUS_MANUALLY_CORRECTED,\n self::STATUS_MATCHED_STATEMENT,\n self::STATUS_MATCHED_STATEMENT_PENDING,\n self::STATUS_MERCHANT_PAYIN,\n self::STATUS_MERCHANT_PAYIN_PENDING,\n self::STATUS_MERCHANT_PAYIN_REVERSED,\n self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING,\n self::STATUS_MISC_COST,\n self::STATUS_MISC_COST_PENDING,\n self::STATUS_OPERATION_AUTHORIZED,\n self::STATUS_OPERATION_BOOKED,\n self::STATUS_OPERATION_PENDING,\n self::STATUS_OPERATION_RECEIVED,\n self::STATUS_PAYMENT_COST,\n self::STATUS_PAYMENT_COST_PENDING,\n self::STATUS_RECEIVED,\n self::STATUS_REFUND_PENDING,\n self::STATUS_REFUND_REVERSAL_PENDING,\n self::STATUS_REFUND_REVERSED,\n self::STATUS_REFUNDED,\n self::STATUS_REFUNDED_EXTERNALLY,\n self::STATUS_REFUSED,\n self::STATUS_RESERVE_ADJUSTMENT,\n self::STATUS_RESERVE_ADJUSTMENT_PENDING,\n self::STATUS_RETURNED,\n self::STATUS_SECOND_CHARGEBACK,\n self::STATUS_SECOND_CHARGEBACK_PENDING,\n self::STATUS_UNDEFINED,\n ];\n }", "public function getEnumStatusSupply(){\n return ['WAITING','IN PROGRESS','CANCELED','COMPLETED'];\n }", "public function get_procecution_ids_using_name($name,$office_id, $ended){\n $Procecution_ids=array();\n $conn= DBConnect::getConnection();\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql=\"SELECT id FROM procecutions where customer_id=(\n SELECT id FROM customers where name= \\\"$name\\\" and office_id = $office_id ) and ended=$ended;\"; \n $result=$conn->query($sql);\n if ($result->num_rows ==0 ) { echo \" p u name Error \";}\n else{\n while($row = $result->fetch_assoc()) {\n $Procecution_ids[]=$row[\"id\"];\n }\n return $Procecution_ids;\n }\n }", "function selectByOppIDStatus($id, $Status)\n {\n $query = \"SELECT ProposalID, OpportunityID, BidderID, Status, ps.Name as StatusName, TechnicalScore, FeeScore, FinalTotalScore, ContractAwarded, CreatedDate, LastEditDate FROM Proposal p LEFT JOIN ProposalStatus ps ON ps.StatusID = p.Status WHERE OpportunityID = :OpportunityID and p.Status = :Status ;\";\n $stmt = $this->conn->prepare( $query );\n\n // bind parameters\n $stmt->bindParam(':OpportunityID', $id);\n $stmt->bindParam(':Status', $Status);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function getActiveChoices()\n {\n $choices = $this->find()->where(['category_id'=> $this->category_id, 'status' => 1])->orderBy('name')->all();\n\n $html = '';\n foreach($choices as $choice){\n\n $html .= ' <label><input type=\"checkbox\" value=\"'.$choice->id.'\" name=\"StartupForm[technology][]\"> '.$choice->name.'</label>';\n }\n return $html;\n }", "function olc_get_customers_statuses() {\n\n\t$customers_statuses_array = array(array());\n\t$customers_statuses_query = olc_db_query(SELECT.\"customers_status_id, customers_status_name, customers_status_image, customers_status_discount, customers_status_ot_discount_flag, customers_status_ot_discount\".SQL_FROM . TABLE_CUSTOMERS_STATUS . SQL_WHERE.\"language_id = '\" . SESSION_LANGUAGE_ID . \"' order by customers_status_id\");\n\t$i=1; // this is changed from 0 to 1 in cs v1.2\n\twhile ($customers_statuses = olc_db_fetch_array($customers_statuses_query)) {\n\t\t$i=$customers_statuses['customers_status_id'];\n\t\t$customers_statuses_array[$i] = array('id' => $customers_statuses['customers_status_id'],\n\t\t'text' => $customers_statuses['customers_status_name'],\n\t\t'csa_public' => $customers_statuses['customers_status_public'],\n\t\t'csa_image' => $customers_statuses['customers_status_image'],\n\t\t'csa_discount' => $customers_statuses['customers_status_discount'],\n\t\t'csa_ot_discount_flag' => $customers_statuses['customers_status_ot_discount_flag'],\n\t\t'csa_ot_discount' => $customers_statuses['customers_status_ot_discount'],\n\t\t'csa_graduated_prices' => $customers_statuses['customers_status_graduated_prices']\n\t\t);\n\t}\n\treturn $customers_statuses_array;\n}", "public function getSelectedCandidatesDetails()\n {\n \t$db = Zend_Db_Table::getDefaultAdapter();\n \t$query = \"select c.id,c.candidate_name,c.emailid from main_candidatedetails c\n where c.isactive = 1 and c.cand_status = 'Selected' and c.backgroundchk_status in ('Yet to start','Completed') and c.id not in (select rccandidatename from main_users\n where isactive = 1 and rccandidatename is not null)\";\n \t \n \t$result = $db->query($query);\n \t$candidateData= $result->fetchAll();\n \treturn $candidateData;\n \t \n }", "public static function getStatusList()\n {\n return array(\n self::STATUS_TRASH => 'trash',\n self::STATUS_DRAFT => 'draft',\n self::STATUS_PUBLISHED => 'published',\n );\n }", "public function listaProyectos(){\n\t\t$query = \"SELECT * FROM alm_proyecto WHERE ISNULL(alm_proy_usr_baja) ORDER BY alm_proy_estado\";\n\t\treturn $this->mysql->query($query);\n\t}", "public function getListPre()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_p_receipt t, \n (SELECT @rownum := 0) r ORDER BY id_pre ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "abstract public static function getStatuses();", "function getallprefect(){\n $q = $this->db->query('SELECT * FROM prefectures');\n return $q;\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "public function getProfessionList(){\n return $this->_get(20);\n }", "function my_ticket_list ($d){\n switch ($d['my_status']) {\n case 0:\n $d['status']=['1','2','3', '7'];\n break;\n case 1:\n $d['status'] = ['4'];\n break;\n case 2:\n $d['status'] = [];\n $d['ready_for_survey'] =0;\n break;\n case 3:\n $d['status'] = ['5','6'];\n break;\n default:;\n }\n return $this->ticket_list($d);\n }", "public function get_case_change_status()\n {\n $this->db->select('*');\n $case_status = $this->db->get('case_change_status');\n $case_status_change = $case_status->result();\n return $case_status_change;\n }", "public function status($id)\n {\n if (Auth::user()->type == 'chefservice') {\n $status = DB::table('envois')\n ->join('courriers', 'courriers.id', '=', 'envois.courrier_id')\n ->select('envois.status')\n ->where([['courriers.id', '=', $id], ['envois.service_id', '=', Auth::user()->service_id]])\n ->get();\n return $status;\n }\n }", "public function getStatuses ($class) {\n\t\t\tif (count($this) === 0) return [];\n\n\t\t\t$db \t\t= db::singleton();\n\t\t\t$view \t\t= TABLE_DOCUMENTO . \"_{$class}_estado\";\n\t\t\t$set \t\t= $this->toComaList();\n\t\t\t$status \t= \"IF (estado IS NULL, \". documento::ESTADO_PENDIENTE .\", estado)\";\n\t\t\t$SQL \t\t= \"SELECT {$status} FROM {$view} WHERE uid_solicituddocumento IN ({$set}) GROUP BY estado\";\n\t\t\t$statuses \t= $db->query($SQL, '*', 0);\n\n\n\t\t\treturn new ArrayIntList(array_map('intval', $statuses));\n\t\t}", "function paymentmethods() {\r\n $db = JFactory::getDBO();\r\n $query = \"SELECT id,payment_method,status FROM #__em_paymentmethod\";\r\n $db->setQuery($query);\r\n $result = $db->loadObjectList();\r\n return $result;\r\n }", "private function getCompleteList(): array\n {\n $stmt = $this->connection->executeQuery(\n '\n SELECT sip.ip_address, sip.netmask, sip.first_ip_address, sip.last_ip_address,\n s.service_id, t.tariff_id, t.download_speed, t.upload_speed\n FROM service_ip sip\n INNER JOIN service_device sd ON sip.service_device_id = sd.service_device_id\n INNER JOIN service s ON s.service_id = sd.service_id\n INNER JOIN tariff t ON t.tariff_id = s.tariff_id\n WHERE s.status != :statusEnded\n AND s.deleted_at IS NULL\n ORDER BY sip.ip_address\n ',\n [\n 'statusEnded' => Service::STATUS_ENDED,\n ]\n );\n\n return $stmt->fetchAll();\n }", "public static function status()\n {\n return [\n 'ati' => 'Ativo',\n 'ina' => 'Inativo'\n ];\n }", "function get_all_prop_details()\n {\n $this->db->order_by('prop_id', 'desc');\n return $this->db->get('prop_details')->result_array();\n }", "public static function statuses() {\n return [\n self::STATUS_ACTIVE => 'Активный',\n self::STATUS_DISABLED => 'Отключен',\n ];\n }", "public function getListProgressAcceptance()\n\t{\n\t\t$str_result='';\n\t\t$model_kegiatan=Kegiatan::model()->findByPk($this->kegiatan);\n\t\tforeach (ValueKegiatan::model()->findAllByAttributes(array('unit_kerja'=>$this->unitkerja,'kegiatan'=>$this->kegiatan,'jenis'=>1)) as $key => $value)\n\t\t{\n\t\t\tif(HelpMe::isAuthorizeUnitKerja($model_kegiatan->unit_kerja)){\n\t\t\t\t$str_result.=('- [ <a href=\"#myModal\" role=\"button\" class=\"update_terima\" \n\t\t\t\t\tdata-id=\"'.$value->id.'\" \n\t\t\t\t\tdata-unitkerja=\"'.$value->unit_kerja.'\" \n\t\t\t\t\tdata-tanggal=\"'.date(\"Y-m-d\",strtotime($value->tanggal_pengumpulan)).'\" \n\t\t\t\t\tdata-jumlah=\"'.$value->jumlah.'\"\n\t\t\t\t\tdata-toggle=\"modal\">Update</a> ] '.HelpMe::HrDate($value['tanggal_pengumpulan']).' <b>Jumlah : '.$value['jumlah'].'</b> <br/>');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$str_result.=('- '.HelpMe::HrDate($value['tanggal_pengumpulan']).' <b>Jumlah : '.$value['jumlah'].'</b><br/>');\n\t\t\t}\n\t\t}\n\t\treturn $str_result;\n\t}", "public function getComunasByProvincia()\n\t{\n\t\t$selectedprovincia = $_POST['selectedprovincia'];\n\t\t$provincias = $this->Model_Comuna->getComunasByProvincia($selectedprovincia);\n\t\techo json_encode($provincias);\n\t}", "public function propertsByCategory($category_id = null, $is_combination = false, $branch_id = null)\n {\n $result = [];\n /** @var ShopOptionType[] $core_option_types */\n\n /* $core_option_types = CoreOptionType::find()\n ->all();*/\n\n $core_option_types = $this->core_option_types;\n\n if (!empty($category_id)) {\n\n //$core_category = CoreCategory::findOne($category_id);\n $core_category = $this->core_categories->where('id', $category_id)->first();\n $core_category = $this->toObject(ShopCategory::class, $core_category);\n\n $core_option_type_ids = array_map(function ($a) use ($is_combination) {\n $a = (array)$a;\n if ($is_combination) {\n if (array_key_exists('is_combination', $a)) {\n if ($a['shop_option_type'] !== \"\")\n return $a['shop_option_type'];\n }\n } else {\n if ($a['shop_option_type'] !== \"\")\n return $a['shop_option_type'];\n }\n }, json_decode($core_category->shop_option_type));\n /*\n $core_option_type = collect($core_category->shop_option_type);\n $core_option_type_ids = $core_option_type->map(function ($a) use ($is_combination) {\n if ($is_combination) {\n if (array_key_exists('is_combination', $a)) {\n if ($a['shop_option_type'] !== \"\")\n return $a['shop_option_type'];\n }\n } else {\n if ($a['shop_option_type'] !== \"\")\n return $a['shop_option_type'];\n }\n });*/\n\n\n //vdd($core_option_type_ids);\n\n\n /* $core_option_types = CoreOptionType::find()\n ->where([\n 'id' => $core_option_type_ids\n ])\n ->all();*/\n\n\n $core_option_types = $this->core_option_types\n ->whereIn('id', $core_option_type_ids);\n\n }\n //vdd($core_option_types);\n if ($branch_id !== null)\n\n /* $core_option_types = array_filter($core_option_types, function ($a) use ($branch_id) {\n if ($a->shop_option_branch_id === $branch_id)\n return true;\n else\n return false;\n });*/\n\n $core_option_types = $core_option_types->filter(function ($a) use ($branch_id) {\n if ($a->shop_option_branch_id === $branch_id)\n return true;\n else\n return false;\n });\n\n\n foreach ($core_option_types as $core_option_type) {\n $core_option_type = $this->toObject(ShopOptionType::class, $core_option_type);\n $property_item = new PropertyItem();\n $property_item->name = $core_option_type->name;\n\n //$branch = CoreOptionTypeBranch::findOne($core_option_type->shop_option_branch_id);\n $branch = $this->core_option_type_branches->where('id', $core_option_type->shop_option_branch_id)->first();\n\n $branch = $this->toObject(ShopOptionBranch::class, $branch);\n $property_item->branch = $branch->name;\n\n /*\n $core_option = CoreOption::find()->where([\n 'shop_option_type_id' => $core_option_type->id\n ])->all();*/\n\n\n $core_option = $this->core_options\n ->where('shop_option_type_id', $core_option_type->id);\n\n foreach ($core_option as $option) {\n $option = $this->toObject(ShopOption::class, $option);\n $property_item->items[$option->id] = $option->name;\n\n }\n\n $result[] = $property_item;\n }\n return $result;\n }", "public function GetProf_andCourse(){\n\t\t$Prof_andCourse = array();\n\t\t$query = \"SELECT classname, professor from classes;\";\n\t\t$result = pg_query($this->con,$query);\n\t\tif (!$result) {\n \t\t\techo \"An error occurred.\\n\";\n \t\t\texit;\n\t\t}\n\t\twhile($row = pg_fetch_row($result)){\n $input = \"$row[0] $row[1]\";\n array_push($Prof_andCourse, $input);\n\t\t}\n\t\treturn $Prof_andCourse;\n }", "function get_entradas_proveedor_list($id) {\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and e.cproveedores_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getCertStatuses() {\n $dql = \"SELECT c from CertificationStatus c\";\n $certStatuses = $this->em\n ->createQuery($dql)\n ->getResult();\n return $certStatuses;\n }", "public function detailGrNotApprove($item){\n /* buat query temporary untuk dijoinkan dengan ec_gr_status */\n $_tmp = array();\n foreach($item as $i){\n $_t = array();\n foreach($i as $_k => $_v){\n array_push($_t,$_v .' as '.$_k);\n }\n array_push($_tmp,'select '.implode(',',$_t).' from dual');\n }\n $sql_tmp = implode(' union ',$_tmp);\n $sql = <<<SQL\n select EGS.*\n from EC_GR_STATUS EGS\n join ({$sql_tmp})TT\n on TT.GR_NO = EGS.GR_NO and TT.GR_YEAR = EGS.GR_YEAR and TT.GR_ITEM_NO = EGS.GR_ITEM_NO\n where EGS.STATUS = 0\nSQL;\n //log_message('ERROR',$sql);\n return $this->db->query($sql)->result_array();\n }", "public function getEstadoProyectoArray()\n {\n $dql = \"SELECT ep.id, ep.eprEstadoProyecto\n FROM sgiiBundle:TblEstadoProyecto ep\n WHERE ep.eprEstado = 1\";\n $query = $this->em->createQuery($dql);\n $estadoProyecto = $query->getResult();\n \n $ArrayEp = Array();\n if ($estadoProyecto) {\n foreach ($estadoProyecto as $ep){\n $ArrayEp[$ep['id']] = $ep['eprEstadoProyecto'];\n }\n }\n return $ArrayEp;\n }", "function getEstadoRp($fEstado, $opt){\r\nconnect();\r\n switch($opt){\r\n\tcase 0:\r\n\t $status[0] = 'PE'; $d_status[0] = 'Pendiente';\r\n\t\t $status[1] = 'PA'; $d_status[1] = 'Pagado';\r\n\t\t $cant = 2;\r\n\t\t for($i=0;$i<$cant;$i++){\r\n\t\t if($status[$i]==$fEstado) echo\"<option value='$status[$i]' selected>$d_status[$i]</option>\";\r\n\t\t\telse echo\"<option value='$status[$i]'> $d_status[$i]</option>\";\r\n\t\t }\r\n }\r\n}", "public function getdepositorDeatils() {\n $select = $this->select()\n ->from(array('wr' => 'withdrawal_request'))\n ->setIntegrityCheck(false)\n ->join(array('u' => 'users'), 'u.user_id = wr.user_id', array(\"u.user_name\"))\n ->where('wr.status =?', '1');\n\n $result = $this->getAdapter()->fetchAll($select);\n if ($result) :\n return $result;\n endif;\n }", "protected function armaColeccionObligatorios() {\n $dao = new PGDAO();\n $result = array();\n $where = $this->strZpTprop();\n if ($where != '') {\n $colec = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARACOBLIG . \" and tipoprop in (\" . $where . \")\"));\n } else {\n $colec = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARACOBLIG));\n }\n foreach ($colec as $carac) {\n $result[$carac['id_zpcarac']] = 0;\n }\n return $result;\n }", "function monitor_list_statuses() {\n $query = \"select distinct(`wf_status`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_status'];\n }\n return $ret;\n }", "public function getConfirmedPendingProducts($purc_order_id, $pid, $prod_ref_id){\n\t\t$this->db->select(\"SUM(PCL.total_qty) as total_qty\");\n\t\t$this->db->from(\"purchase_confirm_list AS PCL\");\n\t\t$this->db->where(\"PCL.prod_ref_id\",$prod_ref_id);\n\t\t$this->db->where(\"PCL.purc_order_id\",$purc_order_id);\n\t\t$this->db->where(\"PCL.order_pid \", $pid);\n\t\t$this->db->where(\"PCL.qc_status <> 'Rejected' \");\t\t\t\n\t\t$query_all_prod_qty = $this->db->get();\n\t\t\n\t\t//echo $this->db->last_query();die;\n\t\tif($query_all_prod_qty->num_rows()>0)\n\t\t{\n\t\t\treturn $query_all_prod_qty->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t}", "public function getProvincias()\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch,\tarray(\tCURLOPT_RETURNTRANSFER\t=> TRUE,\n\t\t\t\t\t\t\t\t\t\tCURLOPT_HEADER\t\t\t=> FALSE,\n\t\t\t\t\t\t\t\t\t\tCURLOPT_CONNECTTIMEOUT\t=> 5,\n\t\t\t\t\t\t\t\t\t\tCURLOPT_USERAGENT\t\t=> $this->setUserAgent(),\n\t\t\t\t\t\t\t\t\t\tCURLOPT_URL\t\t\t\t=> \"{$this->webservice_url}/oep_tracking/Oep_Track.asmx/GetProvincias\",\n\t\t\t\t\t\t\t\t\t\tCURLOPT_FOLLOWLOCATION\t=> TRUE));\n\t\t$dom = new DOMDocument();\n\t\t$dom->loadXml(curl_exec($ch));\n\t\t$xpath = new DOMXPath($dom);\n\t\t\n\t\t$provincias = array();\n\t\tforeach (@$xpath->query(\"//Provincias/Provincia\") as $provincia)\n\t\t{\n\t\t\t$provincias[] = array( \t'id' \t\t=> $provincia->getElementsByTagName('IdProvincia')->item(0)->nodeValue,\n\t\t\t\t\t\t\t\t\t'provincia' => $provincia->getElementsByTagName('Descripcion')->item(0)->nodeValue, \n\t\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn $provincias;\n\t}", "public function getProvincias()\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch,\tarray(\tCURLOPT_RETURNTRANSFER\t=> TRUE,\n\t\t\t\t\t\t\t\t\t\tCURLOPT_HEADER\t\t\t=> FALSE,\n\t\t\t\t\t\t\t\t\t\tCURLOPT_CONNECTTIMEOUT\t=> 5,\n\t\t\t\t\t\t\t\t\t\tCURLOPT_USERAGENT\t\t=> $this->setUserAgent(),\n\t\t\t\t\t\t\t\t\t\tCURLOPT_URL\t\t\t\t=> \"{$this->webservice_url}/oep_tracking/Oep_Track.asmx/GetProvincias\",\n\t\t\t\t\t\t\t\t\t\tCURLOPT_FOLLOWLOCATION\t=> TRUE));\n\t\t$dom = new DOMDocument();\n\t\t$dom->loadXml(curl_exec($ch));\n\t\t$xpath = new DOMXPath($dom);\n\t\t\n\t\t$provincias = array();\n\t\tforeach (@$xpath->query(\"//Provincias/Provincia\") as $provincia)\n\t\t{\n\t\t\t$provincias[] = array( \t'id' \t\t=> $provincia->getElementsByTagName('IdProvincia')->item(0)->nodeValue,\n\t\t\t\t\t\t\t\t\t'provincia' => $provincia->getElementsByTagName('Descripcion')->item(0)->nodeValue, \n\t\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn $provincias;\n\t}", "public function listConfirmacaoCompleta()\n\t{\n\t\t$sql = new Conexao;\n\n\t\treturn $sql->select(\"\n\t\t\tSELECT \n\t\t\ta.idConfirmacaoApuracao, a.idUsuario idgerouOcorrencia, a.isPositivo, a.isNegativo, a.dataRegistro registroConfirmacao,\n\t\t\tb.idCriarApuracao, b.idUsuario, b.tipoApuracao, b.descricao, b.status, b.dataCriacao, b.dataRegistro,\n\t\t\tc.idVitimasCriarApuracao, c.idVitimasApuracao,\n\t\t\td.idPessoa,\n\t\t\te.qualFamilia,\n\t\t\tf.idResponsavelVitimas,\n\t\t\tg.idPessoa idPessoaResponsavel,\n\t\t\th.nome nomeVitima, h.sexo sexoVitima, h.cpf cpfVitima,\n\t\t\ti.nome nomeResponsavel, i.cpf cpfResponsavel,\n\t\t\tj.celular celularVitima,\n\t\t\tk.celular celularResponsavel,\n\t\t\tl.cep cepVitima, l.rua ruaVitima, l.numero numeroVitima, l.bairro bairroVitima, \n\t\t\tl.cidade cidadeVitima, l.estado estadoVitima, l.complemento complementoVitima,\n\t\t\tm.cep cepResponsavel, m.rua ruaResponsavel, m.numero numeroResponsavel, m.bairro bairroResponsavel, \n\t\t\tm.cidade cidadeResponsavel, m.estado estadoResponsavel, m.complemento complementoResponsavel,\n\t\t\to.nome nomeGerouOcorrencia\n\t\t\tFROM tb_confirmacaoapuracao a\n\t\t\tINNER JOIN tb_criarapuracao b ON a.idCriarApuracao = b.idCriarApuracao\n\t\t\tINNER JOIN tb_vitimascriarapuracao c ON b.idCriarApuracao = c.idCriarApuracao\n\t\t\tINNER JOIN tb_vitimasapuracao d ON c.idVitimasApuracao = d.idVitimasApuracao\n\t\t\tINNER JOIN tb_familiaapuracao e ON d.idVitimasApuracao = e.idVitimasApuracao\n\t\t\tINNER JOIN tb_responsavelVitimas f ON d.idVitimasApuracao = f.idVitimasApuracao\n\t\t\tINNER JOIN tb_responsavelapuracao g ON f.idResponsavelApuracao = g.idResponsavelApuracao\n\t\t\tINNER JOIN tb_pessoa h ON d.idPessoa = h.idPessoa\n\t\t\tINNER JOIN tb_pessoa i ON g.idPessoa = i.idPessoa\n\t\t\tINNER JOIN tb_contato j ON h.idContato = j.idContato\n\t\t\tINNER JOIN tb_contato k ON i.idContato = k.idContato\n\t\t\tINNER JOIN tb_endereco l ON h.idEndereco = l.idEndereco\n\t\t\tINNER JOIN tb_endereco m ON i.idEndereco = m.idEndereco\n\t\t\tINNER JOIN tb_usuario n ON a.idUsuario = n.idUsuario\n\t\t\tINNER JOIN tb_pessoa o ON n.idPessoa = o.idPessoa\n\t\t\tORDER BY a.idConfirmacaoApuracao DESC\n\t\t\");\n\t}", "public function getProduits() {\n $produit = Produit::get();\n\n return json_encode($produit);\n }", "function statusclassify($app,$con,$ele)\n{\n $i=1;$j=1;\n $sql1=\"SELECT status1,status2,status3,advisor from preod where appno like '$app'\";\n $data=$con->query($sql1);\n $set=$data->fetch_assoc();\n if($set['status1']=='Approved')\n {\n $i++;\n if($set['status2']=='Approved')\n {\n $i++;\n if($set['status3']=='Approved')\n {\n $i++;\n if($set['advisor']=='Approved')\n $i++;\n else if($set['advisor']=='Declined')\n $j=-1;\n else\n $j=1;\n }\n else if($set['status3']=='Declined')\n $j=-1;\n else\n $j=1;\n }\n else if($set['status2']=='Declined')\n $j=-1;\n else\n $j=1;\n\n }\n else if($set['status1']=='Declined')\n $j=-1;\n else\n $j=1;\n $sql1=\"SELECT `appno`,`status` from postod where appno like '$app'\";\n $data=$con->query($sql1);\n if($data->num_rows==0)\n {\n if($set['advisor']=='Approved')\n $j=-1;\n }\n else\n {\n $j=1;\n $set=$data->fetch_assoc();\n\n $i++;\n if($set['status']=='Approved')\n {\n $i++;\n }\n }\n $status='';\n if(strcmp($ele,\"status\")==0)\n {\n if($j==1)\n { switch($i)\n {\n case 1: $status='Permission Form Submitted';\n break;\n case 2: $status='Staff 1 Approved';\n break;\n case 3: $status='Staff 2 Approved';\n break;\n case 4: $status='Staff 3 Approved';\n break;\n case 5: $status='Advisor Approved';\n break;\n case 6: $status='Certificate Uploaded';\n break;\n case 7: $status='OD Approved';\n break;\n\n }\n }\n if($j==-1)\n { switch($i+2)\n {\n case 1: $status='Permission Form Submitted';\n break;\n case 2: $status='Permission Form Submitted';\n break;\n case 3: $status='Staff 1 Decined';\n break;\n case 4: $status='Staff 2 Declined';\n break;\n case 5: $status='Staff 3 Declined';\n break;\n case 6: $status='Advisor Declined';\n break;\n case 7: $status='Certificate Not Uploaded';\n break;\n case 8: $status='OD Declined';\n break;\n\n }\n }\n\n return $status;\n }\n return statusbar($i,$j);\n}", "public function degreelist(){\n\t\t\t$pgcatname = $this->input->post('stu_prgcate');\n\t\t\t$list = $this->commodel->get_listspfic2('program','','prg_name,prg_id,prg_branch','prg_category',$pgcatname,'prg_name,prg_branch');\n\t\techo \"<select>\";\n\t\techo \"<option disabled selcted>Select Programe</option>\";\n\t\tforeach($list as $datas): \n \t\t \techo \"<option id='degree' value='$datas->prg_id'> \" .\"$datas->prg_name\".'('.$datas->prg_branch.')'.\"</option>\";\n \t\tendforeach;\n\t\techo \"</select>\";\n\t }", "public static function getStatusesList()\n {\n $sql = 'SELECT id AS value, display_name AS text '\n . 'FROM location_status '\n . 'WHERE active = 1';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "function tbc_completed_books_all()\n{\n $category_id = NULL;\n $output = \"\";\n $output = \"<h4>Category</h4>\";\n $output .= \"<hr style='background-color: #abb2b8;' /><div style='width:100%; float:left;'><h4>\";\n $output .= _textbook_companion_list_of_new_category($category_id);\n $output .= \"</h4></div>\";\n $result_count = db_query(\"SELECT pe.book FROM {textbook_companion_preference} pe LEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1\");\n $row_count = $result_count->rowCount();\n $output .= \"<p style='clear: both;'>Total number of completed books : &nbsp;\" . $row_count . \" </p><br><span style='color:red;'>The list below is not the books as named but only are the solved example for R</span>\";\n $output .= \"<hr style='background-color: #abb2b8;' />\";\n $result_category = db_query(\"SELECT * FROM {list_of_category} WHERE category_id !=0\");\n $row_category_count = $result_category->rowCount();\n $output .= \"<ol style='list-style-type: upper-roman;'><h4>\";\n for ($i = 1; $i <= $row_category_count; $i++)\n {\n $output .= \"<div id=$i>\" . _textbook_companion_list_of_new_category_display($i) . \"</div><br>\";\n } //$i = 1; $i <= $row_category_count; $i++\n $output .= \"</h4></ol>\";\n return $output;\n}", "public function getProdAssociates($id)\n\t\t{\n\t\t\t$prodAssocs=\\DB::table('prod_assoc_segment')->join('prod_associate','prod_associate.MAssoc_ID','=','prod_assoc_segment.MAssoc_ID')\n\t\t\t->select('prod_assoc_segment.MAssoc_ID','prod_associate.MAssoc_FirstName')->where('prod_assoc_segment.Seg_ID',$id)->get();\n\t\t\t$listProAssoc=array('success'=>true, $prodAssocs);\n\t\treturn $listProAssoc;\n\t\t\t\n\t\t}", "function getStatusKriteria($idkriteria){\n $q = _query(\"SELECT * FROM kriteria where id_kriteria = '$idkriteria'\");\n $d = _fetch_array($q);\n return $d['tipe_kriteria'];\n}", "public function jml_permohonan_prosesBO()\n {\n $this->db->select('id_permohonan_ptsp, COUNT(id_permohonan_ptsp) as permohonan_prosesBO');\n $this->db->from('permohonan_ptsp');\n $this->db->where(\n 'status',\n 'Proses BO'\n );\n $this->db->where('status_delete', 0);\n\n $hasil = $this->db->get();\n return $hasil;\n }", "function listar_proveedores(){\n\t\t$sql=\"\n\tSELECT\n\t\tcp.IDPROVEEDOR IDPROV, cp.NOMBREFISCAL, cp.NOMBRECOMERCIAL, \n\t\tcp.IDTIPODOCUMENTO, cp.IDDOCUMENTO, cp.EMAIL1, cp.EMAIL2, cp.EMAIL3,\n\t\tcp.BRSCH, csb.RAMO, cp.FDGRV, cp.ZTERM, cp.MWSKZ, cp.PARVO, cp.PAVIP,\n\t\tcp.ACTIVO,cp.INTERNO,\n\t\tcp.ARREVALRANKING,\n\t\tcp.CDE,\n\t\tcp.SKILL,\n\t\tcp.EVALFIDELIDAD,\n\t\tcp.EVALINFRAESTRUCTURA,\n\t\tcp.EVALSATISFACCION,\n\t\tcp.IDMONEDA,\n\t\tYEAR(cp.FECHAINICIOACTIVIDADES) ANIO,\n\t\tMONTH(cp.FECHAINICIOACTIVIDADES) MES, \n\t\tDAY(cp.FECHAINICIOACTIVIDADES) DIA,\n\t\tcpu.*,\n\t\tcpt.*\n\tFROM\n\t$this->catalogo.catalogo_proveedor cp\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_ubigeo cpu ON cp.IDPROVEEDOR=cpu.IDPROVEEDOR \n\t\tLEFT JOIN $this->catalogo.catalogo_sap_brsch csb ON cp.BRSCH = csb.BRSCH\t\n\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_telefono cpt ON cp.IDPROVEEDOR = cpt.IDPROVEEDOR AND cpt.PRIORIDAD=1\n\t\n\t\t\";\n\n\t$result =$this->query($sql);\n\treturn $result;\n\t}", "function dwsim_flowsheet_progress_all()\n{\n\t$page_content = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 1);\n\t$query->condition('is_completed', 0);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";;\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$approval_date = date(\"Y\", $row->approval_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t$row->project_title,\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$approval_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year'\n\t\t);\n\t\t$page_content .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $page_content;\n}", "function selectAll()\n {\n $query = \"SELECT ProposalID, OpportunityID, BidderID, Status, ps.Name as StatusName, TechnicalScore, FeeScore, FinalTotalScore, ContractAwarded, CreatedDate, LastEditDate FROM Proposal p LEFT JOIN ProposalStatus ps ON ps.StatusID = p.Status;\";\n $stmt = $this->conn->prepare( $query );\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function selectRealObsProp($prop){\n\t$bookList = array();\n\t$aa = 0;\n\tfor ($i=0; $i<sizeof($prop); $i++){\n\t\t//$prop[$i]\n\t\tif (strlen($prop[$i])>4){\n\t\t\t$bookList[$aa]=$prop[$i];\n\t\t\t$aa = $aa+1;\n\t\t}\n\t}\n\treturn $bookList;\n}", "function listStatus($con, $def_status)\n\t{\n\t\tswitch ($def_status) \n\t\t{\n\t\t\tcase 0:\n\t\t\t\t$statusText = \"Inactive/Archived\";\n\t\t\t\tbreak;\n\t\t\tcase 1: \n\t\t\t\t$statusText = \"Active\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$statusText = \"Pending\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$statusText = \"Undetermined\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $statusText;\n\t}", "public function listarActivos(){\n $sql = \"SELECT c.idcompra, c.nrofactura, date(c.fecha) as fecha, p.razonsocial AS proveedor, concat(per.nombre, ' ', per.apellido) AS personal, c.monto, c.estado \n FROM compras c JOIN proveedores p ON c.idproveedor = p.idproveedor JOIN personales per ON c.idpersonal = per.idpersonal WHERE c.estado = '1'\n ORDER BY c.idcompra DESC\";\n return ejecutarConsulta($sql);\n }", "function ListaProveedoresInactivos() {\n\n\t//obtiene el id del usuario\n\t$sql = \"SELECT * FROM proveedor WHERE estado = 'INACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Ok\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de proveedores!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}", "public static function statuses()\n {\n return [\n self::STATUS_PENDING => Yii::t('app', 'Pending'),\n self::STATUS_REJECTED => Yii::t('app', 'Rejected'),\n self::STATUS_ACCEPTED => Yii::t('app', 'Accepted')\n ];\n }" ]
[ "0.68880457", "0.5902665", "0.58107495", "0.5808453", "0.5746115", "0.56819946", "0.5648069", "0.55413383", "0.55396396", "0.55171937", "0.5429772", "0.5349765", "0.5348022", "0.53479105", "0.53405845", "0.5319196", "0.5316652", "0.53141123", "0.5296049", "0.52773917", "0.526679", "0.52224714", "0.5218951", "0.52161634", "0.52156925", "0.52122694", "0.5202586", "0.51846534", "0.5177652", "0.516411", "0.5154504", "0.5143204", "0.51358104", "0.512204", "0.5111379", "0.5083646", "0.505976", "0.50483155", "0.5047407", "0.50317186", "0.501263", "0.500234", "0.49922442", "0.49840742", "0.4980412", "0.4976798", "0.49751818", "0.49617723", "0.49562618", "0.49558073", "0.4954311", "0.49515912", "0.49415657", "0.49289733", "0.49284872", "0.49264622", "0.49188063", "0.49188063", "0.49184924", "0.49134508", "0.4912861", "0.49096227", "0.49086663", "0.49067578", "0.49063534", "0.49032938", "0.49025396", "0.48991802", "0.4894084", "0.48928404", "0.48854515", "0.48839664", "0.4882786", "0.48814395", "0.48732293", "0.48648173", "0.486404", "0.4860599", "0.4859023", "0.48557636", "0.48550904", "0.48519704", "0.48519704", "0.484743", "0.48466322", "0.48441622", "0.48427507", "0.48408148", "0.4835298", "0.48293304", "0.48281494", "0.48280287", "0.48243606", "0.48240146", "0.48238748", "0.4823514", "0.48228848", "0.48225492", "0.48209128", "0.4820289" ]
0.49753904
46
Get the route key for the model.
public function getRouteKeyName() { return 'hash'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteKey();", "public function getRouteKey();", "public function getRouteKey()\n {\n return $this->getAttribute($this->getRouteKeyName());\n }", "public function getRouteKey()\n {\n $slug = $this->slugField();\n\n return $this->$slug;\n }", "public function getRouteKey()\n {\n return Hasher::encode($this->getKey());\n }", "public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }", "public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }", "public function getRouteKey()\n {\n return $this->getTranslation('url', app()->getLocale());\n }", "public function getRouteKeyName()\n {\n return $this->getKeyName();\n }", "public function getRouteKey() {\n return $this->slug;\n }", "public function getRouteKeyName();", "public function getRouteKeyName();", "public function getRouteKey()\n {\n return $this->slug;\n }", "public function getRoutingKey();", "public function getRoutingKey();", "public function id(): string\n {\n return $this->model->getRouteKey();\n }", "protected function getModelPrimaryKey(): string\n {\n $model = $this->option('model');\n $model = new $model;\n\n return $model->getRouteKeyName();\n }", "public function getRouteKeyName()\n {\n return 'key';\n }", "public function getRouteKeyValue(): string\n {\n if (!empty($this->slug)) {\n return 'slug';\n }\n return 'id';\n }", "public function getRouteKeyName()\n {\n return 'id';\n }", "public function getRouteKeyName()\n {\n return 'id';\n }", "public function getRouteKeyName()\n {\n return 'id';\n }", "public function getRouteKeyName()\n\t{\n\t return 'id';\n\t}", "public function getRouteKeyName()\n {\n return 'hash_id';\n }", "public function getRouteKey()\n {\n \t$this->slug;\n }", "public function getRoutingKey() {\n return $this->routing_key;\n }", "public function getRouteKeyName() {\n\t\treturn 'user_id';\n\t}", "public function getRouteKeyName(): string\n {\n if (request()->expectsJson()) {\n return 'id';\n }\n return 'slug';\n }", "public function getRouteKeyName(){\n\t\treturn '';\n\t}", "public function getRouteKeyName()\n {\n return request()->segment(1) === 'admin' ? 'id' : 'account_code';\n }", "public function getModelKey()\n {\n if (isset($this->modelKey) == false) {\n $reflectionClass = new ReflectionClass($this->owner);\n $this->modelKey = $reflectionClass->getShortName();\n }\n\n return $this->modelKey;\n }", "public function getRouteKeyName() {\n\t\t\t\n\t\t\treturn 'reference';\n\t\t}", "public function getRouteKeyName()\n {\n /* используется для того чтобы можно было в маршруте \n * например таком: Route::get('products/{category}/{product}', 'ProductsController@index');\n * получить \n * нужную категорию не по колонке id, а по колонке slug\n */\n return 'slug';\n }", "public function getRouteKeyName() {\n return 'url';\n }", "public function getRouteKeyName()\n {\n return 'url';\n }", "public function getRouteKeyName()\n {\n return 'device_info_id';\n }", "public function getRouteKeyName(): string\n {\n return 'token';\n }", "public function getRouteKeyName(): string\n {\n return 'name';\n }", "public function getRoutingKey():string { return $this->routing_key; }", "public function getRouteKeyName()\n {\n return 'uuid';\n }", "public function getRouteKeyName()\n {\n return 'uuid';\n }", "public function getRouteKeyName()\n {\n return 'uuid';\n }", "public function getRouteKeyName()\n {\n return 'uuid';\n }", "public function getRouteKeyName()\n {\n return 'uuid';\n }", "public function getRouteKeyName()\n {\n // get the category where the name column is equal to user input\n return 'name';\n }", "public function routingKey()\n {\n return $this->message->delivery_info['routing_key'];\n }", "protected function detectObjectKeyFromRoute()\n {\n $request = $this->requestStack->getCurrentRequest();\n Return $request ? Objects::normalizeObjectKey($request->attributes->get('_jarves_object')) : '';\n }", "protected function getModelKey($model)\n\t{\n\t\ttry {\n\t\t\treturn $model->getKey();\n\t\t} catch (\\Illuminate\\Database\\Eloquent\\MissingAttributeException $e) {}\n\t}", "public function getRouteKeyName(): string {\n\t\t\treturn 'slug';\n\t\t}", "public function getRouteKeyName()\n\t{\n\t\treturn 'ID_RequeCli';\n\t}", "public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}", "public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}", "public function getRouteKeyName()\n\t{\n\t return 'token';\n\t}", "public function getRouteKeyName()\n {\n return 'name';\n }", "public function getRouteKeyName()\n {\n return 'name';\n }", "public function getRouteKeyName()\n {\n return 'name';\n }", "protected function getI18nKey()\n {\n return str_replace('/', '.', self::services()->get('inflector')->underscore(get_class($this->model)));\n }", "public function getRouteKeyName()\n {\n return 'stripe_id';\n }", "public function getRouteKeyName()\n\t{\n\t return request()->segment(1) === 'admin' ? 'id' : 'startdatetime';\n\t}", "public function getRouteKeyName()\n {\n return 'name';\n }", "public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}", "public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}", "public function getRouteKeyName(): string\n {\n return 'slug';\n }", "public function getRouteKeyName(): string\n {\n return 'slug';\n }", "public function getModelKeyName()\n {\n // Create an instance of the model to get primary key name\n // I couldn't find a better solution \n $model = $this->getModel();\n $model = new $model;\n return $model->getKeyName();\n }", "public function key()\n {\n return key($this->_models);\n }", "public function moduleKeyForModel($model);", "public function get_key() {\n\t\treturn array_get($this->attributes, static::$key);\n\t}", "public function getRouteKeyName(): string\n {\n return 'username';\n }", "public function getRouteId()\n {\n return $this->routeId;\n }", "public function getRouteKeyName()\n {\n return 'name_ascii';\n }", "public function getKey()\n {\n return $this->id;\n }", "public function getRouteKeyName()\n {\n \treturn 'slug';\n }", "public function getRouteKeyName() {\n return 'slug';\n }", "public function getRouteKeyName() {\n return 'slug';\n }", "public function getRouteKeyName() {\n return 'slug';\n }", "public function getRouteKeyName()\n\t{\n\t\treturn 'slug';\n\t}", "public function getRouteKeyName()\n\t{\n\t\treturn 'slug';\n\t}", "public function getKey()\n {\n return $this->__get(\"key\");\n }", "public static function uriKey()\n {\n return Str::singular(Str::snake(class_basename(get_called_class()), '-'));\n }", "public function getKey()\n {\n return $this->getId();\n }", "public function getResourceKey(): string\n {\n return 'model';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }", "public function getRouteKeyName()\n {\n return 'slug';\n }" ]
[ "0.8331818", "0.8331818", "0.8329921", "0.82206964", "0.81144017", "0.804808", "0.804808", "0.787448", "0.7854665", "0.78247094", "0.78018355", "0.78018355", "0.77601475", "0.7715494", "0.7715494", "0.7662308", "0.76057196", "0.7566795", "0.7543832", "0.7517731", "0.7517731", "0.7517731", "0.74438316", "0.73869556", "0.73442286", "0.7337966", "0.7319577", "0.73080826", "0.72591925", "0.7226187", "0.7213134", "0.7187175", "0.7166322", "0.71295536", "0.7102366", "0.70696646", "0.7006846", "0.7000706", "0.6972724", "0.6930168", "0.6930168", "0.6930168", "0.6930168", "0.6930168", "0.6928411", "0.68860686", "0.68843246", "0.6817445", "0.68099856", "0.6807444", "0.6797272", "0.6797272", "0.67793125", "0.67770004", "0.67770004", "0.67770004", "0.6757504", "0.6747738", "0.67347765", "0.6718301", "0.6687912", "0.6687912", "0.6629009", "0.6629009", "0.6599651", "0.65946543", "0.65777916", "0.6523157", "0.651793", "0.6517794", "0.6506454", "0.6482014", "0.6478576", "0.64622515", "0.64622515", "0.64622515", "0.6452802", "0.6452802", "0.6450729", "0.6446262", "0.6442249", "0.6439345", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922", "0.6435922" ]
0.68904066
45
Returns the test dataset.
protected function getDataSet() { return new ArrayDataSet($this->getDataSetArray()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDataSet()\n {\n return $this->createMySQLXMLDataSet(__DIR__ . '/../paczkolab_test.xml');\n }", "protected function getDataSet()\n {\n //Dataset TokenTest.xml has the minimal data we need to perform our tests\n $classFile = str_replace('.php', '.xml', __FILE__);\n return $this->createFlatXMLDataSet($classFile);\n }", "protected function getDataSet(){\n return $this->createXMLDataSet(\n dirname(__FILE__) . '/../_dataSet/commonTest.xml'\n );\n }", "protected function getDataSet(){\n return $this->createXMLDataSet(\n dirname(__FILE__) . '/../_dataSet/commonTest.xml'\n );\n }", "protected function getDataSet()\n {\n return new \\PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/DataSet/base.yml');\n }", "protected function getDataSet()\n\t{\n\t\treturn $this->createXMLDataSet(dirname(__FILE__).'/_fixtures/DirectDeposit.fixture.xml');\n\t}", "protected function getDataSet()\n {\n $testcase = $this->getName(false);\n // Just basename fails on linux systems\n $className = str_replace('.php', '', __FILE__);\n $classFile = $className . '.xml';\n $testFile = $className . '_' . $testcase . '.xml';\n if (file_exists($testFile)) {\n return new \\PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($testFile);\n }\n if (file_exists($classFile)) {\n return new \\PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet($classFile);\n }\n\n return null;\n }", "public function readTestData()\n {\n return $this->testData->get();\n }", "function getDataSet() {\n\t\treturn $this->addDataSets(array(\"init.yml\"));\n\t}", "function getDataSet() {\n\t\treturn $this->addDataSets(array(\"init.yml\"));\n\t}", "public static function get_dataset()\r\n {\r\n $ds = new Datasets();\r\n return $ds->get_by_type(self::DATASET_TYPE);\r\n }", "protected function getDataSet() {\n\t\treturn $this->createXMLDataSet ( dirname ( __FILE__ ) . '\\..\\..\\data\\cron\\empty_dstable_1_article_2_attach_test_data.xml' );\n\t}", "protected function getDataSet()\n {\n return $this->createFlatXMLDataSet(dirname(__FILE__) . '/truncateDataTables.xml');\n // Use below to return an empty data set if we don't want to truncate and seed\n //return new PHPUnit_Extensions_Database_DataSet_DefaultDataSet();\n }", "protected function getDataSet()\n {\n return $this->createXMLDataSet(FIXTURE . '/Xml/bookAndAuthor.xml');\n }", "protected function getDataSet()\n {\n $seedFilePath = __DIR__ . '/databaseXml/seed.xml';\n return $this->createXMLDataSet($seedFilePath);\n }", "protected function getDataSet() {\n\t\treturn $this->createXMLDataSet ( dirname ( __FILE__ ) . '\\..\\..\\data\\cron\\1_DS_1_article_test_1_dupl_attach_1_unpub_attach_1_new_valid_DS_data.xml' );\n\t}", "public function getDataSet()\n\t{\n\t\treturn new PHPUnit_Extensions_Database_DataSet_XmlDataSet(dirname(__FILE__) . '/../data/Users.xml');\n\t}", "public function getDataSet()\n {\n return $this->getConnection()->createDataSet();\n }", "protected function getDataSet()\n {\n $dataset = $this->createFlatXMLDataSet(__DIR__ . '/../../../doctrine/truncateDataTables.xml');\n return $dataset;\n // Use below to return an empty data set if we don't want to truncate and seed\n //return new PHPUnit_Extensions_Database_DataSet_DefaultDataSet();\n }", "public function dataset()\n {\n return $this->data;\n }", "abstract public function getTestData(): array;", "protected function getDataSet()\n\t{\n\t\t$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', \"'\", '\\\\');\n\n\t\t$dataSet->addTable('jos_languages', JPATH_TEST_DATABASE . '/jos_languages.csv');\n\n\t\treturn $dataSet;\n\t}", "abstract protected function getDataSet();", "protected function getDataSet()\n\t{\n\t\t$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet(',', \"'\", '\\\\');\n\n\t\t$dataSet->addTable('jos_extensions', JPATH_TEST_DATABASE . '/jos_extensions.csv');\n\n\t\treturn $dataSet;\n\t}", "public function getDataSet()\n {\n $originalXml = dirname(__FILE__).'/Flats/all-original-data.xml';\n return $this->createFlatXMLDataSet($originalXml);\n }", "public function getDataSet()\n {\n $originalXml = dirname(__FILE__).'/Flats/all-original-data.xml';\n return $this->createFlatXMLDataSet($originalXml);\n }", "abstract protected function getTestData() : array;", "public static function getDataset()\n {\n $dataset = new Beans\\Dataset();\n \n $dataset->setStatus(0);\n $dataset->setCreatedOn(date(Application::TIMESTAMP));\n $dataset->setDistinctMolecules(0);\n $dataset->setInitialMolecules(0);\n $dataset->setIsCleaned(0);\n $dataset->setTs(date(Application::TIMESTAMP));\n \n return $dataset;\n }", "function getDataSets()\n {\n if ($this->getResource('wdrs:describedby')){\n $dataset = $this->getResource('wdrs:describedby')->all('void:inDataset');\n }else {\n $schemaUrls = $this->allResources('schema:url');\n $describedBy = array_filter($schemaUrls, function($schemaUrl)\n {\n return(strpos($schemaUrl->getURI(), 'worldcat.org/title'));\n });\n $describedBy = array_shift($describedBy);\n $dataset = $describedBy->all('void:inDataset');\n }\n \n return $dataset;\n }", "protected function getDataSet()\n {\n return $this->createFlatXMLDataSet(dirname(__FILE__).'/_files/category.xml');\n }", "public function testDatasetReturnsData()\n {\n $size = 100;\n\n $response = $this->get('/api/dataset?size={$size}');\n\n $response->assertStatus(200);\n $response->assertJsonCount($size, \"\");\n }", "public function getTestData()\n {\n return [\n 'user_id' => 1,\n 'status' => 1,\n 'created_at' => '2016-01-21 15:00:00',\n 'updated_at' => '2016-01-21 18:00:00'\n ];\n }", "public function provideTestData()\n {\n return [\n ['9141405', true],\n ['1709107983', true],\n ['0122116979', true],\n ['0121114867', true],\n ['9030101192', true],\n ['9245500460', true],\n\n ['9141406', false],\n ['1709107984', false],\n ['0122116970', false],\n ['0121114868', false],\n ['9030101193', false],\n ['9245500461', false],\n ];\n }", "protected function getDataSet()\n {\n return new CompositeDataSet([]);\n }", "protected function getTestData(){\n\t\treturn \"application/testdata/Pagers.php\" ;\n\t}", "protected function getDataSet()\n {\n return $this->getYamlDataSet('bookings.yml');\n }", "public function getDataSetCollection(): DataSetCollection {\n\n return $this->dataSetCollection;\n\n }", "protected function getDataSet()\n {\n return $this->createArrayDataSet([\n 'eventbus_event' => [\n [\n 'id' => '1',\n 'update_time' => '2017-11-20 17:12:59',\n 'create_time' => '2017-11-20 17:12:59',\n 'event_id' => '0115060e-cdd3-11e7-b85c-02427a6bfbd8',\n 'event_name' => 'open',\n 'topic' => 'merchant',\n 'payload' => '{\"merchant_id\":3333}',\n ],\n ],\n 'eventbus_subscriber' => [\n [\n 'id' => '1',\n 'update_time' => '2017-11-20 17:14:34',\n 'create_time' => '2017-11-20 17:14:34',\n 'topic' => 'merchant',\n 'notify_url' => 'http://localhost/event-bus/notification',\n 'enabled' => 1,\n ],\n ],\n 'eventbus_log' => [],\n ]);\n }", "protected function fixtureData() {\n\t\t$rows = array();\n\t\tfor($i = 0; $i < 50; $i++) {\n\t\t\t$rows[] = array(\n\t\t\t\t\"name\" => \"Test Item \".$i,\n\t\t\t\t\"popularity\" => $i,\n\t\t\t\t\"author\" => \"Test Author \".$i,\n\t\t\t\t\"description\" => str_repeat(\"lorem ipsum dolor est \",rand(3,20)),\n\n\t\t\t);\n\t\t}\n\t\treturn $rows;\n\t}", "public function getDataSet()\n {\n return new ArrayDataSet( array(\n 'Faculty' => array(\n array('facID' => 1, 'userName' => 'alvin', 'passWord' => 'pw', 'email' => '[email protected]', 'firstName' => 'alvin', 'lastName' => 'one'),\n array('facID' => 2, 'userName' => 'palmer', 'passWord' => 'pw123', 'email' => '[email protected]', 'firstName' => 'palmer', 'lastName' => 'two'),\n array('facID' => 3, 'userName' => 'gunay', 'passWord' => '$pw2', 'email' => '[email protected]', 'firstName' => 'gunay', 'lastName' => 'three')\n ),\n )\n );\n }", "protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }", "public function getData() {\n\t\t// si les donnée ne sont pas initialisé, on les crée\n\t\tif (empty($this->DataSet)) {$this->setDataSet(new pData());}\n\t\treturn $this->DataSet;\n\t}", "public function testCanGetDatasetByTitleAndOptionallyByAccountAndProject() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n $topLevel = new DatasetInstanceSummary(\"Top Level Dataset\", \"test-json\");\n $topLevelId = $this->datasetService->saveDataSetInstance($topLevel, null, null);\n\n $account1 = new DatasetInstanceSummary(\"Account Dataset 1\", \"test-json\");\n $account1Id = $this->datasetService->saveDataSetInstance($account1, null, 1);\n\n $account2 = new DatasetInstanceSummary(\"Account Dataset 2\", \"test-json\");\n $account2Id = $this->datasetService->saveDataSetInstance($account2, null, 2);\n\n $project1 = new DatasetInstanceSummary(\"Project Dataset 1\", \"test-json\");\n $project1Id = $this->datasetService->saveDataSetInstance($project1, \"soapSuds\", 2);\n\n $project2 = new DatasetInstanceSummary(\"Project Dataset 2\", \"test-json\");\n $project2Id = $this->datasetService->saveDataSetInstance($project2, \"wiperBlades\", 2);\n\n $this->assertEquals($this->datasetService->getDataSetInstance($topLevelId), $this->datasetService->getDataSetInstanceByTitle(\"Top Level Dataset\", null, null));\n $this->assertEquals($this->datasetService->getDataSetInstance($account1Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 1\", null, 1));\n $this->assertEquals($this->datasetService->getDataSetInstance($account2Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 2\", null, 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project1Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 1\", \"soapSuds\", 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project2Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 2\", \"wiperBlades\", 2));\n\n\n }", "public function provideTestData()\n {\n return [\n // variant one\n ['1197423162', true],\n ['1000000606', true],\n\n // variant one\n ['8137423260', false],\n ['600000606', false],\n ['51234309', false],\n\n // variant two\n ['1000000406', true],\n ['1035791538', true],\n ['1126939724', true],\n ['1197423460', true],\n\n // variant two\n ['1000000405', false],\n ['1035791539', false],\n ['8035791532', false],\n ['535791830', false],\n ['51234901', false],\n ];\n }", "public function provideTestData()\n {\n return [\n // variant 1\n ['1016', true],\n ['26260', true],\n ['242243', true],\n ['242248', true],\n ['18002113', true],\n ['1821200043', true],\n ['1011', false],\n ['26265', false],\n ['18002118', false],\n ['6160000024', false],\n\n // variant 2\n ['1015', true],\n ['26263', true],\n ['242241', true],\n ['18002116', true],\n ['1821200047', true],\n ['3456789012', true],\n ['242249', false],\n ['1234567890', false],\n ];\n }", "public function testData()\n {\n $output = $this->primer->getPatterns(array('components/test-group/data-autoload'), false);\n\n $this->assertEquals($output, '1.2');\n }", "public function provideTestData()\n {\n return [\n // Variant 1\n ['6100272324', true],\n ['6100273479', true],\n\n ['6100272885', false],\n ['6100273377', false],\n ['6100274012', false],\n\n // Variant 2\n ['5700000000', true],\n ['5700000001', true],\n ['5799999998', true],\n ['5799999999', true],\n\n ['5699999999', false],\n ['5800000000', false],\n ];\n }", "public final function getDataSet(): QueryDataSet {\n\t\t$dataset = new QueryDataSet($this->getConnection());\n\t\t$dataset->addTable(\"role\");\n\t\t$dataset->addTable(\"profile\");\n\t\t$dataset->addTable(\"posting\");\n\t\t$dataset->addTable(\"savedJob\");\n\t\treturn $dataset;\n\t}", "public function get_all_tests()\n\t{\n\t\treturn $this->db->get('test')->result();\n\t}", "protected function fixture() {\n return new \\rdbms\\sqlite3\\SQLite3Connection(new \\rdbms\\DSN('sqlite://localhost/'));\n }", "function get_data()\n\t{\n\t\t$query = $this->db->get(\"Testing\");\n\n\t\treturn $query;\n\t}", "public function getTestcases() {\n if ($this->graded_testcases === null) {\n $this->loadTestcases();\n }\n return $this->graded_testcases;\n }", "protected function getDataSet()\n {\n $dir = $GLOBALS['DB_CSV_DIR'];\n\n // create a new CSV data set\n $dataSet = new CsvDataSet();\n\n $dataSet->addTable('Address', $dir . \"Address.csv\");\n $dataSet->addTable('Person', $dir . \"Person.csv\");\n $dataSet->addTable('EmailAddress', $dir . \"EmailAddress.csv\");\n $dataSet->addTable('L_EmailAddressType', $dir . \"L_EmailAddressType.csv\");\n $dataSet->addTable('R_PersonEmailAddress', $dir . \"R_PersonEmailAddress.csv\");\n\n return $dataSet;\n }", "public static function getDataSetType()\n {\n return static::$datasetType;\n }", "protected function fixture() {\n return new \\rdbms\\ibase\\InterBaseConnection(new \\rdbms\\DSN('ibase://localhost/'));\n }", "public function getBigqueryDataset()\n {\n return $this->bigquery_dataset;\n }", "public function dataSets()\n\t{\n\t\treturn $this->data_sets;\n\t}", "function dataset0 ( ) // 允許外界直接[接觸]到內部的_dataset (可能反向排序)\n{\n return $this->_dataset;\n}", "private function getTestData()\n {\n return [\n 'url' => 'http://www.mystore.com',\n 'access-token' => 'thisisaccesstoken',\n 'integration-token' => 'thisisintegrationtoken',\n 'method' => \\Magento\\Framework\\HTTP\\ZendClient::POST,\n 'body'=> ['token' => 'thisisintegrationtoken','url' => 'http://www.mystore.com'],\n ];\n }", "public function getTestAddAndGetData()\n {\n return [\n ['namespace_1', 'key_11'],\n ['namespace_2', 'key_21'],\n ];\n }", "public function getTests();", "public static function getExampleResponseDataStore()\n {\n return array (\n 'id' => 1,\n 'name' => 'Tester Tesrov',\n 'email' => '[email protected]',\n 'email_verified_at' => '',\n 'role' => '0',\n 'api_token' => '733260741c131187810bc1a0a6446628653f9e5c4cc9f17402d6131b619cc5fb',\n 'created_at' => '2019-09-14 23:36:27',\n 'updated_at' => '2019-09-15 00:04:14',\n 'deleted_at' => '',\n );\n }", "public function dataSet()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\DataSet');\n\t}", "public function _fixtures()\n {\n return [\n\n 'base_date' => [\n 'class' => BaseDataFixture::class,\n 'dataFile' => codecept_data_dir() . 'base_data_data.php',\n ],\n\n ];\n }", "public function getTrainDataset($strategy)\n {\n $res = new Bets(Bet::where('active', false)\n ->where('strategy_key', $strategy)\n ->orderBy('id', 'asc')->get());\n\n //$data = $res->toCsv();\n $dataset = $this->createDataset($res);\n\n\n return $dataset;\n\n }", "public function getDataProvider()\n {\n return $this->dataProvider;\n }", "public function getBigqueryOutputDataset()\n {\n return $this->bigquery_output_dataset;\n }", "public function getSetDataProvider() {}", "public function setTestData(Dataset $dataset)\n {\n $this->testData = $dataset;\n }", "protected function getOneTest()\n {\n $endpoint = $this->getPluralName();\n $responseKey = $this->getCamelCasedPluralName();\n $loader = $this->getDataLoader();\n $data = $loader->getOne();\n $returnedData = $this->getOne($endpoint, $responseKey, $data['user']);\n $this->compareData($data, $returnedData);\n\n return $returnedData;\n }", "protected function fixture() {\n return new \\rdbms\\pgsql\\PostgreSQLConnection(new \\rdbms\\DSN('pgsql://localhost/'));\n }", "public function getData()\n {\n return DataTables::of(App\\Models\\Config::all())->make(true);\n }", "public static function get_tests()\n {\n }", "abstract protected function getFixtures();", "public function testGetData()\n {\n $this->getWeather->setUrl();\n $result = $this->getWeather->getData();\n\n $this->assertIsArray($result);\n }", "public function getDataProvider()\n\t{\n\t\treturn $this->_dataProvider;\n\t}", "public function getTestCases ()\n {\n return $this->_testCases;\n }", "public static function required_sample_data() {\n return null;\n }", "public function getById($id) {\r\n return $this->testsetEntity->find($id);\r\n }", "public function data()\n {\n return [\n 'name' => $this->faker->text,\n 'cast' => $this->faker->text,\n 'genere' => $this->faker->text,\n 'description' => $this->faker->paragraph,\n 'image' => $this->faker->text,\n ];\n }", "public function getDatasetsList() {\n return $this->_get(3);\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => UserFixture::className(),\n 'dataFile' => codecept_data_dir() . 'login_data.php',\n ],\n ];\n }", "private function _get_test_data( $type, $filename ) {\n\t\treturn file_get_contents( HH_HUGO_COMMAND_DIR . '/tests/data/' . $type . '/' . $filename );\n\t}", "public function getDatasetsList() {\n return $this->_get(1);\n }", "public function getContent() {\n return $this->arDataset; \n }", "public function getData()\n {\n $data = parent::getData();\n\n return $data;\n }", "public function getData()\n {\n $this->initialize();\n\n return $this->data;\n }", "public static function suite() {\n\t\t$suite = new CakeTestSuite('All Indicadores Tests');\n\t\t$suite->addTestDirectoryRecursive(App::pluginPath('Indicadores') . 'Test' . DS . 'Case' . DS);\n\n\t\treturn $suite;\n\t}", "public function getPredictDataset($id = 0)\n {\n $request = Bet::where('active', true)\n ->where('traded', false)\n ->orderBy('id', 'asc');\n if($id){\n $request = $request->where('id', $id);\n }\n\n $res = new Bets($request->get());\n //$data = $res->toCsv();\n $dataset = $this->createDataset($res, true);\n\n return $dataset;\n }", "public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => BookFixture::class,\n 'dataFile' => codecept_data_dir() . 'book.php'\n ],\n ];\n }", "public function getDataProvider();", "public function getDataProvider();", "public function getDatasetsList() {\n return $this->_get(4);\n }", "public function getTest()\n {\n return $this->hasOne(Test::className(), ['id' => 'test_id']);\n }", "public function getTests()\n\t{\n\t\t# code...\n\t\treturn $this->tests;\n\t}", "public function getTestData()\n {\n yield [false, false, '-5 days', '+5 days', true];\n // changing before last dockdown period is not allowed with grace permission\n yield [false, true, '-5 days', '+5 days', true];\n // changing before last dockdown period is allowed with full permission\n yield [true, true, '-5 days', '+5 days', false];\n yield [true, false, '-5 days', '+5 days', false];\n // changing a value in the last lockdown period is allowed during grace period\n yield [false, false, '+5 days', '+5 days', false];\n // changing outside grace period is not allowed\n yield [false, false, '+5 days', '+11 days', true];\n // changing outside grace period is allowed with grace and full permission\n yield [false, true, '+5 days', '+11 days', false];\n yield [true, false, '+5 days', '+11 days', false];\n yield [true, true, '+5 days', '+11 days', false];\n }", "function getTestDataFromFile($file) {\n return require $file;\n}", "public function get_data();", "public function fixtures() \n {\n return [\n 'categories' => CategoryFixture::className(),\n ];\n }", "public function getData() {\r\n if ($this->data == null) {\r\n $this->data = new DataExport($this->chart);\r\n }\r\n\r\n return $this->data;\r\n }" ]
[ "0.7723198", "0.7719603", "0.7709923", "0.7709923", "0.76564926", "0.74969155", "0.7416149", "0.7410265", "0.7383849", "0.7383849", "0.73000264", "0.7262511", "0.7208042", "0.7174706", "0.7144803", "0.70893824", "0.705882", "0.7034158", "0.70333415", "0.6942394", "0.6715493", "0.67067224", "0.67011243", "0.6680784", "0.6619884", "0.6619884", "0.65945333", "0.6456147", "0.64102274", "0.64073884", "0.639251", "0.63312423", "0.62187135", "0.61892724", "0.6179517", "0.6146724", "0.611629", "0.60986155", "0.6071384", "0.599983", "0.5984957", "0.59815675", "0.5967247", "0.59589595", "0.59492093", "0.5932539", "0.5927817", "0.58925253", "0.588908", "0.5873543", "0.58490014", "0.5848424", "0.58114743", "0.5783137", "0.57656664", "0.5745276", "0.5737871", "0.5705636", "0.5694161", "0.5675464", "0.5661731", "0.5630823", "0.5623741", "0.5622641", "0.55977553", "0.5572378", "0.5569399", "0.55658454", "0.5562267", "0.55504006", "0.5500428", "0.5469426", "0.54568785", "0.54532224", "0.544612", "0.5443081", "0.5424961", "0.54205877", "0.5417626", "0.5415216", "0.54047316", "0.54045236", "0.53974205", "0.53960174", "0.538793", "0.53826106", "0.53729767", "0.5372828", "0.5367152", "0.5364662", "0.5363172", "0.5363172", "0.53618747", "0.534964", "0.5339446", "0.5338701", "0.5328708", "0.5317081", "0.53170687", "0.5316751" ]
0.61672574
35
>> End __construct() Establishes the expiration time (in seconds) of cache storage. An Exception will be thrown if time is less or equal to 0.
public function setExpTime( $expTime = 0 ) {//-------------------->> setExpTime() if ( (int) $expTime <= 0 ) {//---------->> if invalid $expTime throw new CacheManager_Exception( "Expiration Time ({$expTime}) must be greater than 0" ); }//---------->> End if invalid $expTime $this->_expTime = (int) $expTime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n\t{\n\t\t$this->cache_ttl = intval(ee()->TMPL->fetch_param('ttl'));\n\t\t// For speed and API purposes, limit the cache to 30sec minimum\n\t\tif ($this->cache_ttl < 30)\n\t\t{\n\t\t\t$this->cache_ttl = 30;\n\t\t}\n\t}", "public function expires($time = 3600){\n\n\t\tif(!is_numeric($time)){\n\t\t\tthrow new Exception('Invalid cache expiration.');\n\t\t}\n\t\t$key = ($this->cache_key . (!is_null($this->custom_key) ? '-' . $this->custom_key : ''));\n\t\t$this->redis_client->set($key, $this->cache_data);\n\t\t$this->redis_client->expire($key, $time);\n\t\t$this->redis_client->ttl($key);\n\n\t}", "function cache() {\n\n if ( func_num_args() == 0 ) {\n return $this->expireTime;\n } elseif ( func_num_args() == 1 ) {\n if ( is_bool(($arg = func_get_arg(0))) ) {\n if ( $arg ) {\n $this->expireTime = 3600;\n } else {\n $this->expireTime = 0;\n }\n } elseif ( is_numeric($arg) ) {\n $this->expireTime = $arg;\n } else {\n return isset($this->cache_expires[$arg])?$this->cache_expires[$arg]:0;\n }\n } elseif ( func_num_args() == 2 ) {\n if ( is_numeric(($arg=func_get_arg(1))) ) {\n $this->cache_expires[func_get_arg(0)] = $arg;\n } elseif ( is_bool($arg) ) {\n if ( $arg ) {\n $this->cache_expires[func_get_arg(0)] = 3600;\n } else {\n $this->cache_expires[func_get_arg(0)] = 0;\n }\n }\n }\n }", "public function __construct($cache_file, $cache_time) {\n\t\t$this->cache_file = $cache_file;\n\t\t$this->cache_time = $cache_time;\n\t}", "public function __construct(int $expires = 84000)\n {\n $this->created = time();\n $this->expires = $expires;\n $this->expires = $this->created + $this->expires;\n }", "function __construct($cache_file_name, $cache_file_time, $cache_file_extension, $cache_file_path){\n\n\t\tif($cache_file_extension == '')\t\n\t\t\t$cache_file_extension = '.cache';\n\t\t\n\t\tif(!is_dir($cache_file_path)){\n\t\t\t$oldumask = umask(0);\n\t\t\tmkdir($cache_file_path,0777,true);\n\t\t\tumask($oldumask);\t\n\t\t}\t\t\n\n\t\tCache::$path = $cache_file_path.'/'.$cache_file_name.$cache_file_extension;\n\t\tCache::$time = $cache_file_time;\n\t\t//echo Cache::$path;\n\t\t//exit;\n\t}", "public function getCacheLifetime(): int;", "public function __construct( $options = array() )\n {\n $this->properties['ttl'] = 86400;\n $this->properties['extension'] = '.cache';\n parent::__construct( $options );\n }", "public function __construct($defaultTimeToLive = CacheInterface::MAX_TTL)\n {\n $this->setDefaultTTL($defaultTimeToLive);\n $this->cache = [];\n }", "public function getCacheMaxAge() {\n return 0;\n }", "protected function getCacheLifetime(): ?int\n {\n return 86400;\n }", "public function __construct($location, $expiration) {\n\t\tif(extension_loaded(\"eAccelerator\")) {\n\t\t\t// store expiration-time\n\t\t\t$this->expiration = $expiration;\n\t\t\t// cleanup the cache\n\t\t\teaccelerator_gc();\n\t\t} else {\n\t\t\tthrow new Exception(\"PHP-Extension 'eAccelerator' is required but not loaded!!!\");\n\t\t}\n\t}", "final public function cache($time = false) {\n\t\t\t$this->cache_ttl = $time;\n\t\t\treturn $this;\n\t\t}", "private function __construct()\r\r\n\t{\t\t\r\r\n\t\t$class_name = sprintf(CPF_CACHE_STORAGE_CLASS_FORMAT, Cpf_Core_Config::get_instance()->value('CACHE.STORAGE'));\t\t\r\r\n\t\t$this->_storage = new $class_name();\r\r\n\t}", "public function setCacheLifetime(int $seconds);", "public function getExpiration();", "public function getExpiration()\n {\n }", "function test_expires_in()\n {\n # Only Memcache & Redis support expires_in.\n if (get_class($this) == 'Test_ActiveSupport_Cache_MemcacheStore'\n or get_class($this) == 'Test_ActiveSupport_Cache_RedisStore')\n {\n # caching second var (with ttl)\n $this->cache->write('other_var', '23', array('expires_in' => 2));\n $this->assert_equal($this->cache->read('other_var'), '23');\n sleep(3);\n $this->assert_false($this->cache->read('other_var'));\n $this->assert_equal($this->cache->read('var'), 'value');\n }\n }", "public function __construct()\r\n {\r\n if(!ctype_alnum($this->cache_name))\r\n {\r\n throw new \\RuntimeException(\"You need to set the cache name properly, it can only be alphnum!\");\r\n }\r\n \r\n $this->cache_file = DIR_SECURE_CACHE.'/'.$this->cache_name.'.cache';\r\n \r\n if( !is_readable( $this->cache_file ) )\r\n { \r\n $this->makeCache();\r\n $this->saveCache();\r\n }\r\n }", "public function test_get_does_not_return_exceeded_entry()\n {\n // be checked for expiration...\n $con = $this->newConnection();\n\n $mainStorage = $this->newMainStorage($con);\n\n\n $storage = $this->newStorage($mainStorage);\n\n $until = (new \\DateTime());\n $storage->put('foo', 'bar', [], $until);\n\n $storage2 = $this->newTestStorage($mainStorage);\n\n $storage2->now = time() + 100;\n\n $this->assertNull($storage2->get('foo'));\n }", "public function expire();", "public function __construct($Cache = null) {\n// session_start(); //Cria a sessão\n $this->CheckSession($Cache); //Realiza toda a checagem que vai estar neste metodo\n }", "function __construct() {\n $this->_cache = [];\n }", "public function getCacheInvalidator();", "public function setCacheTime($seconds)\n {\n if (!is_numeric($seconds)) {\n throw new YinYang_Exception('Cache time must be numeric');\n }\n $this->_cacheTime = $seconds;\n\n return $this;\n }", "public function __construct ($options)\r\n {\r\n \t//echo get_class($options);exit;\r\n \tif (get_class($options) == 'Zend_Cache_Core'){\r\n \t\t$this->cache = $options;\r\n \t} else {\r\n\t if ($options instanceof Zend_Config) {\r\n\t $options = $options->toArray();\r\n\t }\r\n\t if (! is_array($options)) {\r\n\t throw new Exception('Invalid cache options; must be array or Zend_Config object');\r\n\t }\r\n\t if (array('frontend' , 'backend' , 'frontendOptions' , 'backendOptions') != array_keys($options)) {\r\n\t throw new Exception('Invalid cache options provided');\r\n\t }\r\n\t $options['frontendOptions']['automatic_serialization'] = true;\r\n\t $this->cache = Zend_Cache::factory($options['frontend'], $options['backend'], $options['frontendOptions'], $options['backendOptions']);\r\n \t}\r\n }", "public function getExpiresIn();", "protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}", "public function getCacheLifetime()\n {\n return self::DEFAULT_CACHE_LIFETIME;\n }", "private function getExpiration()\n {\n return (self::EXPIRATION_IN_MINUTES * 60);\n }", "protected function initializeCache() {}", "public function __construct()\n {\n $this->timestamp = time();\n $this->permissionClauseCache = [];\n }", "protected function initializeCache() {}", "public function GetSessionExpirationSeconds ();", "private function __construct()\n\t{\n\t\t$this->_loadCacheObj();\n\t\treturn;\n\t}", "public function setExpirationTime(?int $timestamp = null): self\n {\n if ($this->expirationTime) {\n throw OsstException::propertyAlreadySet('Expiration time');\n }\n\n $timestamp = $timestamp ?? time() + self::DEFAULT_EXPIRATION_TIME_OFFSET;\n\n if ($timestamp <= time()) {\n throw OsstException::expirationTimeInPast($timestamp);\n }\n\n $this->expirationTime = $timestamp;\n\n return $this;\n }", "private function checkVars() {\n if (!$this->key) {\n throw new Cex('The cache key is not set!', Cex::E_NO_KEY);\n } else {\n if ($this->value === null) {\n $this->value = '';\n }\n if (!is_numeric($this->lifetime)) {\n $this->lifetime = (int)$this->lifetime;\n }\n }\n\n return $this;\n }", "public function __construct(\n protected Repository $cache,\n protected ?int $maxCount = null,\n protected ?int $maxLength = null\n ) {\n //\n }", "public function getCacheExpiry()\n {\n return $this->cachePeriod;\n }", "public function getExpires()\n {\n\n }", "public function getCacheExp();", "public function expiresAt();", "public function expiresAt();", "public function __construct() {\r\n $this->cache = new MemCacheInterface(self::$CACHE_HOST, self::$CACHE_PORT, self::$CACHE_PREFIX, self::$CACHE_GROUP);\r\n }", "function __construct() {\t\t\n\t\t\t// start the session\n\t\t\tself::start();\n\t\t\t\n\t\t\t// get session expire time\n\t\t\t$expiretime = self::get('expiretime');\n\t\t\t\n\t\t\t//check session\t\t\n\t\t\tif(isset($expiretime)) {\n\t\t\t\tif(self::get('expiretime') < time()) {\n\t\t\t\t\tself::destroy();\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t//session time\n\t\t\t$minutes = SESSION_TIMEOUT;\n\t\t\t\n\t\t\t//set session time out\t\t\n\t\t\tself::set('expiretime', time() + ($minutes * 60));\n\t\t}", "private function _getCacheLifeTime() {\n\n $getDefaultCache = $this->_readDefaultCache();\n if (isset($getDefaultCache['frontend']['lifetime']) && !empty($getDefaultCache['frontend']['lifetime']))\n $chacheLifetime = $getDefaultCache['frontend']['lifetime'];\n $chacheLifetime = !empty($chacheLifetime) ? $chacheLifetime : 300;\n return $chacheLifetime;\n }", "public function getExpiration()\n {\n // expire now\n return new \\DateTime();\n }", "public function setExpires($value = -1)\n {\n\n }", "public function setCacheLifetime($cacheLifetime);", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function howLongToCacheInSeconds(){\n return(120); //two minutes by default\n }", "public function cacheTimeout($value = NULL) {\n $class_name = get_class($this);\n return variable_get($class_name . TingClientRequest::cache_lifetime, '1');\n }", "public function getExpirationTime(): int\n {\n return $this->expirationTime;\n }", "function __construct(\\qio\\Directory\\Cache $cache) {\n $this->cache = $cache;\n }", "public function cacheLifetime()\n {\n return config('personality-insights.cache_expiration');\n }", "abstract public function cachedTime(string $key): ?int;", "public function cacheTimeout($value = NULL) {\n $class_name = get_class($this);\n\n return variable_get($class_name . TingClientRequest::cache_lifetime, '1');\n }", "protected function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpirationTime() {\n return $this->shareData[\"expire\"];\n }", "public function cacheFor(): DateTimeInterface|DateInterval|float|int|null;", "protected function _getCacheLifetime()\n\t{\n\t\treturn Mage::helper('bcp')->getAdvancedConfig('html_page_cache_time');\n\t}", "public function cacheExpire($newCacheExpire = null);", "public function getExpiration() {\n return $this->expiration;\n }", "protected function __construct() {\n if (!file_exists(self::getCachePath())) {\n mkdir(self::getCachePath(), 0777, true);\n }\n }", "private function __construct()\n {\n $this->time = time();\n }", "public function __construct( $item_limit, $byte_limit, $time ) {\n\t\t$this->is_full_flag = false;\n\t\t$this->timestamp = $time;\n\n\t\t$this->finder = new Jetpack_Sitemap_Finder();\n\t\t$this->doc = new DOMDocument( '1.0', 'UTF-8' );\n\n\t\t$this->item_capacity = max( 1, intval( $item_limit ) );\n\t\t$this->byte_capacity = max( 1, intval( $byte_limit ) ) - strlen( $this->doc->saveXML() );\n\t}", "public function __construct() {\n $this->time = time();\n }", "function &createCache() {}", "public function expires_at ($time) {\n\t\t// session cookies should be set with null instead of 0\n\t\tif (empty($time)) {\n\t\t\t$time = null;\n\t\t}\n\n\t\t$this->expires = $time;\n\t}", "public function __construct(Cache $cache)\n {\n $this->cache = $cache;\n }", "public function __construct(Cache $cache)\n {\n $this->cache = $cache;\n }", "static function check_expired_cache(){\n\n\t\tglobal $wpdb;\n\t\t$limit = 2000;\n\t\tif ( class_exists( 'WRC_Logger' ) ) {\n\t\t\tself::$logger = new WRC_Logger( get_called_class() );\n\t\t\t$cron_limit = get_option( WRC_Logger::SETTING_FLAG . '_limit', '2000' );\n\t\t\tif ( is_numeric( $cron_limit ) ) {\n\t\t\t\t$limit = $cron_limit;\n\t\t\t}\n\t\t}\n\n\t\t$expiredBefore = date('Y-m-d', strtotime('-1 year'));\n\n\t\t$query = '\nDELETE FROM ' . REST_CACHE_TABLE . ' \nWHERE rest_expires < \"' . $expiredBefore . '\" AND rest_to_update=0\nLIMIT ' . $limit;\n\n\t\ttry {\n\t\t\tif ( $wpdb->query( $query ) ) {\n\t\t\t\t// executed successfully\n\t\t\t} else {\n\t\t\t\tif ( function_exists( 'newrelic_notice_error' ) ) {\n\t\t\t\t\tnewrelic_notice_error( 'CRON FAIL: Unable to perform cleanup on un-requested old API cache. Limit ' . $limit . ', Expired ' . $expiredBefore );\n\t\t\t\t}\n\t\t\t}\n\t\t}catch( \\Exception $e){\n\t\t\tif ( function_exists( 'newrelic_notice_error' ) ) {\n\t\t\t\tnewrelic_notice_error( 'CRON FAIL: '.$e->getMessage().'. Limit ' . $limit . ', Expired ' . $expiredBefore );\n\t\t\t}\n\t\t}\n\t\treturn;\n\n\t}", "public function getCacheTTL();", "public function setExpiration($expiration = 0)\n {\n $expiration = (int) $expiration;\n\n if ($expiration > 0) {\n $this->expiration = $expiration;\n } else {\n throw new \\InvalidArgumentException($expiration . \" is an invalid expiration argument\");\n }\n\n return $this;\n }", "public function setExpiresAt($timestamp);", "public function __construct($id = null)\n {\n parent::__construct($id);\n\n // Set the now, we use this a lot\n $this->now = time();\n\n if (mt_rand(1, 100) === 1) {\n // Do garbage collection\n $this->delete_expired();\n }\n\n if ($this->expires < $this->now) {\n // This object has expired\n $this->delete();\n }\n }", "function wprss_feed_cache_lifetime( $seconds ) {\n return 1; // one second\n }", "private function __session_key_expirey_limit() {\n return time() - 60;\n }", "public function setCacheLifetime($value)\n {\n $this->cacheLifetime = max((int) $value, 0);\n\n return $this;\n }", "public function setExpiry( $expiry );", "protected function removeExpiredCacheEntries() {}", "protected function _getExpires()\n\t{\n\t\treturn $this->_expires;\n\t}", "public function cache($since, $time = '+1 day') {\n\t\tif (!is_int($time)) {\n\t\t\t$time = strtotime($time);\n\t\t}\n\t\t$this->header(array(\n\t\t\t'Date' => gmdate(\"D, j M Y G:i:s \", time()) . 'GMT'\n\t\t));\n\t\t$this->modified($since);\n\t\t$this->expires($time);\n\t\t$this->sharable(true);\n\t\t$this->maxAge($time - time());\n\t}", "public function getExpires()\r\n {\r\n return $this->expires;\r\n }", "public function getExpirationTime()\n {\n return $this->_expiration_time;\n }", "function checkKeys()\n{\n $cache = Cache::get()->first();\n\n if (!$cache) {\n $cache = new Cache();\n refreshKeys($cache);\n }\n else { \n if (time() > $cache->timeout){\n refreshKeys($cache);\n }\n }\n}", "public function setCacheTime($time)\n\t{\n\t\t$this->iCacheTime = $time;\n\t}", "function __construct($file, $cacheLifetime)\n {\n $this->file = $file;\n $this->cacheLifetime = $cacheLifetime;\n }", "public function __construct(Ticker $ticker)\n {\n\t\t$ticker->update_cachefile();\n }", "protected function calculatePageCacheTimeout() {}", "public function __construct($accessToken, $expirationTime)\n {\n $this->_access_token = $accessToken;\n $this->_expiration_time = $expirationTime;\n }", "public function getExpiresIn(): int\n {\n return $this->expiresIn;\n }", "public function cacheFor()\n {\n return now()->addMinutes(2);\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->unactivatedPostsExpiration = (int)config('settings.cron.unactivated_posts_expiration', $this->unactivatedPostsExpiration);\n\t\t$this->activatedPostsExpiration = (int)config('settings.cron.activated_posts_expiration', $this->activatedPostsExpiration);\n\t\t$this->archivedPostsExpiration = (int)config('settings.cron.archived_posts_expiration', $this->archivedPostsExpiration);\n\t}", "private function manageNonceCache()\n {\n if (!$this->di->has('cache')) {\n throw new Exception(\n \"Nonce backend 'cache' requires cache service to be configured.\"\n );\n }\n $this->cache->save($this->nonceCacheKey, true);\n }", "public static function getCacheControl() {}", "public function cacheFor()\n {\n // return now()->addMinutes(5);\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }" ]
[ "0.67760265", "0.6632737", "0.6494018", "0.64309925", "0.62257385", "0.61697084", "0.61397326", "0.6121235", "0.61200494", "0.61146575", "0.6088086", "0.60651386", "0.60520744", "0.6030503", "0.60157645", "0.59920114", "0.59904605", "0.59550166", "0.59392595", "0.58948153", "0.5868835", "0.5834534", "0.58304536", "0.58205086", "0.5807388", "0.5804992", "0.58017313", "0.5752582", "0.5750228", "0.5746198", "0.5742883", "0.5741956", "0.57363635", "0.5712401", "0.5703083", "0.56961226", "0.5690496", "0.5689483", "0.5684424", "0.56773096", "0.56733906", "0.56728727", "0.56728727", "0.56587213", "0.5655525", "0.5649067", "0.56430596", "0.5636962", "0.5632743", "0.56284577", "0.56284577", "0.56241506", "0.56193924", "0.56152356", "0.56065446", "0.5604275", "0.5598543", "0.5586692", "0.5576961", "0.5559039", "0.5548737", "0.5546889", "0.55450237", "0.5541706", "0.5537924", "0.55279", "0.5512753", "0.5509877", "0.5508867", "0.5483922", "0.5483548", "0.5483548", "0.54811406", "0.54727465", "0.54664093", "0.5460959", "0.5458914", "0.5455148", "0.54539514", "0.5447306", "0.54473007", "0.54451036", "0.544385", "0.5442387", "0.54410154", "0.54399383", "0.5439561", "0.54386777", "0.5436976", "0.54348576", "0.54284656", "0.5427267", "0.54207796", "0.5419361", "0.54161143", "0.54151493", "0.5414912", "0.5409002", "0.540355", "0.540355" ]
0.62456685
4
>> End setExpTime() Retrieves a content form cache without taking care about the expiration time param. If the cache doesn't exist, the returned value will be null.
abstract public function getCacheContent( $cacheID = '', $unserialize = true );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cache() {\n\n if ( func_num_args() == 0 ) {\n return $this->expireTime;\n } elseif ( func_num_args() == 1 ) {\n if ( is_bool(($arg = func_get_arg(0))) ) {\n if ( $arg ) {\n $this->expireTime = 3600;\n } else {\n $this->expireTime = 0;\n }\n } elseif ( is_numeric($arg) ) {\n $this->expireTime = $arg;\n } else {\n return isset($this->cache_expires[$arg])?$this->cache_expires[$arg]:0;\n }\n } elseif ( func_num_args() == 2 ) {\n if ( is_numeric(($arg=func_get_arg(1))) ) {\n $this->cache_expires[func_get_arg(0)] = $arg;\n } elseif ( is_bool($arg) ) {\n if ( $arg ) {\n $this->cache_expires[func_get_arg(0)] = 3600;\n } else {\n $this->cache_expires[func_get_arg(0)] = 0;\n }\n }\n }\n }", "final public function cache($time = false) {\n\t\t\t$this->cache_ttl = $time;\n\t\t\treturn $this;\n\t\t}", "public function getCacheExp();", "public function clearCache(int $expTime = 0);", "public function setExpTime( $expTime = 0 )\r\n {//-------------------->> setExpTime()\r\n\r\n if ( (int) $expTime <= 0 ) {//---------->> if invalid $expTime\r\n throw new CacheManager_Exception( \"Expiration Time ({$expTime}) must be greater than 0\" );\r\n }//---------->> End if invalid $expTime\r\n\r\n $this->_expTime = (int) $expTime;\r\n\r\n }", "public function expires($time = null) {\n\t\tif ($time !== null) {\n\t\t\t$date = $this->_getUTCDate($time);\n\t\t\t$this->_headers['Expires'] = $date->format('D, j M Y H:i:s') . ' GMT';\n\t\t}\n\t\tif (isset($this->_headers['Expires'])) {\n\t\t\treturn $this->_headers['Expires'];\n\t\t}\n\t\treturn null;\n\t}", "public function cacheFor(): DateTimeInterface|DateInterval|float|int|null;", "public function expires($time = 3600){\n\n\t\tif(!is_numeric($time)){\n\t\t\tthrow new Exception('Invalid cache expiration.');\n\t\t}\n\t\t$key = ($this->cache_key . (!is_null($this->custom_key) ? '-' . $this->custom_key : ''));\n\t\t$this->redis_client->set($key, $this->cache_data);\n\t\t$this->redis_client->expire($key, $time);\n\t\t$this->redis_client->ttl($key);\n\n\t}", "public function getExpiresAt();", "public function cacheExpire($newCacheExpire = null);", "function set($key, $value, $expiry_time=self::CACHE_SESSION) {\n\t\tif($expiry_time == self::CACHE_NEVER) return;\n\t\tif($expiry_time > 0) $expiry_time += time();\n\t\t$this->_cache[$key] = array($value, $expiry_time);\n\t}", "private function cached($key, $value, $time = 5)\n\t{\n\t\tif (App::environment('local') === false) {\n\t\t\treturn $this->cache->remember($key, $time, function() use ($value) {\n\t\t\t\treturn $value;\n\t\t\t});\n\t\t} else {\n\t\t\treturn $value;\n\t\t}\n\t}", "protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}", "public function cache( $method, $args, $value = NULL, $expire = NULL )\n { \n // If no value is specified, we are trying to retrieve a value\n if( is_null($value) ) \n {\n return Cache::get($method, $args);\n } \n // Set the cached data\n return Cache::set($method, $args, $value, $expire);\n }", "public function cache($since, $time = '+1 day') {\n\t\tif (!is_int($time)) {\n\t\t\t$time = strtotime($time);\n\t\t}\n\t\t$this->header(array(\n\t\t\t'Date' => gmdate(\"D, j M Y G:i:s \", time()) . 'GMT'\n\t\t));\n\t\t$this->modified($since);\n\t\t$this->expires($time);\n\t\t$this->sharable(true);\n\t\t$this->maxAge($time - time());\n\t}", "public function setCaching($cache);", "function cached($url = false, $cache_timeout = 15) {\n\t\tif(!$url) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$cache_file = $this->cachefile($url);\n\t\t\n\t\t$cache_timeout = $cache_timeout * 60;\n\t\t\n\t\t$cache_exists = file_exists($cache_file);\n\t\t\n\t\tif($cache_exists) {\n\t\t\t$cache_valid = (filemtime($cache_file)+$cache_timeout > time());\n\t\t} else {\n\t\t\t$cache_valid = false;\n\t\t}\n\t\t\n\t\tif($cache_exists && $cache_valid) {\n\t\t\t$cache_data = trim(file_get_contents($cache_file));\n\t\t\t$cache_object = @json_decode($cache_data);\n\t\t\tif($cache_data && $cache_object) {\n\t\t\t\treturn $cache_object;\n\t\t\t}\n\t\t} else if($cache_exists && !$cache_valid) {\n\t\t\tunlink($cache_file);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function setExpirationTime($expire) {\n $this->shareData[\"expire\"] = $expire;\n return $this;\n }", "public static function publicCache(\n ResponseInterface $response,\n /*# int */ $cacheTime = 120\n )/*# : ResponseInterface */ {\n $maxAge = $cacheTime * 60;\n return $response\n ->withAddedHeader('Expires', self::timeStamp($maxAge))\n ->withAddedHeader('Cache-Control', \"public, max-age={$maxAge}\")\n ->withAddedHeader('Last-Modified', self::timeStamp());\n }", "public function set_cache($maxAge = 60)\n\t{\n\t\theader(\"Expires: Mon, 06 Jan 1990 00:00:01 GMT\"); // Date in the past\n\t\theader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified\n\t\theader(\"Cache-Control: no-cache, max-age=$maxAge, must-revalidate\");\n\t\theader(\"Pragma: no-cache\");\n\t}", "public function setExpires($value = -1)\n {\n\n }", "public function getCacheExpiry()\n {\n return $this->cachePeriod;\n }", "public function setObjToCache($key, $value, $timeToCache = 0);", "public static function setCache($cache) {}", "public function setAutoExpirationTime() {\n $this->shareData[\"expire\"] = $this->getAutoExpirationTime();\n return $this;\n }", "protected static function cache($cache)\n\t{\n\t\t// Active Smarty cache for a specified time or endless\n\t\tif ($cache > 0 OR $cache == -1)\n\t\t{\n\t\t\tstatic::$smarty->setCaching(true);\n\t\t\tstatic::$smarty->setCacheLifetime($cache);\n\t\t}\n\t\telse\n\t\t\tstatic::$smarty->setCaching(false);\n\t}", "public function getCacheMaxAge() {\n return 0;\n }", "public function setCacheTime($time)\n\t{\n\t\t$this->iCacheTime = $time;\n\t}", "private function _cache_get_content($cache_id, $cache_group = 'global', $time = false)\n {\n\n $mem_var = $this->mw_cache_mem;\n if (isset($mem_var[$cache_group])) {\n if (isset($mem_var[$cache_group][$cache_id]) and $mem_var[$cache_group][$cache_id] != false) {\n //\t\t print $mem_var[$cache_group][$cache_id];\n return $mem_var[$cache_group][$cache_id];\n }\n\n }\n\n $mode = 2;\n\n if (!strstr($cache_group, 'global')) {\n $mode = 1;\n }\n\n $cache = $this->_cache_get_content_encoded($cache_id, $cache_group, $time);\n\n if ($cache == false or $cache == '' or $cache == '---empty---' or $cache == '---false---' or (is_array($cache) and empty($cache))) {\n $this->mw_cache_mem[$cache_group][$cache_id] = false;\n return false;\n } else {\n // $cache = base64_decode($cache);\n $cache = @unserialize($cache);\n $this->mw_cache_mem[$cache_group][$cache_id] = $cache;\n return $cache;\n }\n }", "public function getExpiresIn();", "public function expires($expires_time = null)\n {\n // If the values '0' or '-1' are specified then set the value through the header()\n // function as it will accept any string, otherwise use the private dateHeader()\n // function to verify that the value is valid for an 'Expires' header.\n if (is_string($expires_time) && ($expires_time === '0' || $expires_time === '-1')) {\n return $this->header('Expires', $expires_time);\n } else {\n return $this->dateHeader('Expires', $expires_time, 'expires', '$expires_time');\n }\n }", "public function getExpiration();", "public function setExpiry( $expiry );", "public function setCache($content, $tempCacheName = null) {\n $isCacheEnabled = $this->isCacheEnabled();\n if (empty($isCacheEnabled))\n return;\n if (!empty($content)) {\n $cacheName = $this->_cacheName();\n if (empty($cacheName))\n return;\n $currentCache = $this->_readDefaultCache();\n $backendOptions = $currentCache['backend']['File'];\n $frontendOptions = $currentCache['frontend'];\n $cache = Zend_Cache::factory('Page', 'File', $frontendOptions, $backendOptions);\n $cache->setLifetime($this->_getCacheLifeTime());\n $cache->save($content, $cacheName);\n }\n\n return;\n }", "public function remember($time = -1)\n\t{\n\t\t$this->cache->time = ($time > 0) ? $time : $this->settings['caching']['time'];\n\n\t\treturn $this;\n\t}", "public function setValToCache($key, $value, $timeToCache = 0);", "#[Pure]\nfunction http_cache_last_modified($timestamp_or_expires = null) {}", "final public function get():? object\n\t{\n\t\tif ($stm = $this->_prepare('SELECT `value`,\n\t\t\t\tDATE_FORMAT(`expires`, \"%Y-%m-%dT%TZ\") AS `expires`\n\t\t\t\t FROM `Cache`\n\t\t\t\t WHERE `key` = :key\n\t\t\t\t LIMIT 1;')\n\t\t) {\n\t\t\t$stm->execute(['key' => $this->getKey()]);\n\n\t\t\tif ($result = $stm->fetchObject()) {\n\t\t\t\tprint_r($result);\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getFromCache() {}", "public static function expireCacheEntry(array $options) {\n $options['caching'] = 'expire';\n // With caching set to expire, get_population_data doesn't actually do the\n // service request.\n self::get_population_data($options);\n }", "public function getCache();", "function test_expires_in()\n {\n # Only Memcache & Redis support expires_in.\n if (get_class($this) == 'Test_ActiveSupport_Cache_MemcacheStore'\n or get_class($this) == 'Test_ActiveSupport_Cache_RedisStore')\n {\n # caching second var (with ttl)\n $this->cache->write('other_var', '23', array('expires_in' => 2));\n $this->assert_equal($this->cache->read('other_var'), '23');\n sleep(3);\n $this->assert_false($this->cache->read('other_var'));\n $this->assert_equal($this->cache->read('var'), 'value');\n }\n }", "function cache($field, $type, $id,$delta, $item) {\n $cid = \"{$field}_{$type}_{$id}_{$delta}:\" . \\Drupal::languageManager()\n ->getCurrentLanguage()\n ->getId();\n $camData = NULL;\n\n if ($cache = \\Drupal::cache()\n ->get($cid)) {\n // It's in cache\n $camData = $cache->data;\n\n if($this->currentTimeMillis() >= $camData['time'] ) {\n // Cache expired\n $info = pathinfo($item->link);\n $data = WebcamHelper::requesturl( $item->link, $item->refresh_rate/1000);\n\n if ($data != false) {\n $imageSrc = 'data:image/' . $info['extension'] . ';base64,' . base64_encode($data);\n }elseif($camData['src'] != false){\n // Failed to retrieve the image, but there is an old one in the cache\n $imageSrc = $camData['src'];\n }else{\n // Failed to retrieve the image, and there isn't one in the cache\n $imageSrc = false;\n }\n \\Drupal::cache()\n ->set($cid, ['src' => $imageSrc, 'time' => $this->currentTimeMillis() + $item->refresh_rate]);\n }\n return isset($imageSrc) ? $imageSrc : $camData['src'];\n }\n else {\n // We don't have it in cache\n $info = pathinfo($item->link);\n $data = WebcamHelper::requesturl( $item->link, $item->refresh_rate/1000);\n\n if ($data != false) {\n $imageSrc = 'data:image/' . $info['extension'] . ';base64,' . base64_encode($data);\n }else{\n $imageSrc = false;\n }\n\n \\Drupal::cache()\n ->set($cid, ['src' => $imageSrc, 'time' => $this->currentTimeMillis() + $item->refresh_rate]);\n }\n return $imageSrc;\n }", "function getHash($hash,$expTime=0)\t{\n\t\t\t//\n\t\t$expTime = intval($expTime);\n\t\tif ($expTime)\t{\n\t\t\t$whereAdd = ' AND tstamp > '.(time()-$expTime);\n\t\t}\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('content', 'cache_hash', 'hash=\"'.$GLOBALS['TYPO3_DB']->quoteStr($hash, 'cache_hash').'\"'.$whereAdd);\n\t\tif ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t\t\treturn $row['content'];\n\t\t}\n\t}", "public function getExpires()\n {\n\n }", "public static function getCache() {\n\t\treturn null;\n\t}", "private function _cache_get_content_encoded($cache_id, $cache_group = 'global', $time = false)\n {\n $use_apc = false;\n if ($cache_group === null) {\n\n $cache_group = 'global';\n }\n\n if ($cache_id === null) {\n\n return false;\n }\n\n $cache_id = trim($cache_id);\n\n $cache_group = $cache_group . DS;\n\n $cache_group = reduce_double_slashes($cache_group);\n if ($use_apc == false) {\n $mem = $this->_cache_get_content_from_memory($cache_id, $cache_group);\n //d($mem);\n if ($mem != false) {\n //d($cache_id);\n // exit();\n return $mem;\n }\n }\n\n $cache_file = $this->_cache_get_file_path($cache_id, $cache_group);\n $cache_file = normalize_path($cache_file, false);\n $get_file = $cache_file;\n\n\n $cache = false;\n try {\n if ($get_file != false) {\n if (isset($get_file) == true and is_file($get_file)) {\n $t = intval($time);\n if ($time != false and $t > 0) {\n if (time() - $t > filemtime($get_file)) {\n /// cache is expired\n return false;\n }\n }\n $cache = @file_get_contents($cache_file);\n } else {\n $this->_cache_get_content_from_memory($cache_id, $cache_group, false);\n return false;\n }\n }\n } catch (Exception $e) {\n $cache = false;\n }\n\n if (isset($cache) and strval($cache) != '') {\n $search = MW_CACHE_CONTENT_PREPEND;\n $replace = '';\n $count = 1;\n $cache = str_replace($search, $replace, $cache, $count);\n }\n\n if (isset($cache) and $cache != false and ($cache) != '') {\n $this->_cache_get_content_from_memory($cache_id, $cache_group, $cache);\n return $cache;\n }\n return false;\n }", "public function setCacheExpiry($ttl = 3600)\n {\n $this->cachePeriod = abs(intval($ttl));\n }", "public function cacheFor()\n {\n // return now()->addMinutes(5);\n }", "static function get($name,$maxAge=null){\n\t\tif(! self::$enable )\n\t\t\treturn null;\n\t\tself::init();\n\t\t$maxAge = self::_ttl(null===$maxAge?self::$ttl : $maxAge);\n\t\t$i = self::$backend->getItem($name);\n\t\t#- check for validity\n\t\tif( ! $i->checkValididty($maxAge) ){\n\t\t\treturn cacheItem::dropInstance($name);\n\t\t}\n\t\treturn $i->content;\n\t}", "function InPlaceCache_cacheMiss($cachePath, $content, &$parser)\r\n{\r\n\tglobal $gInPlaceCache_mergePostRender, $gInPlaceCacheEmitComments, $action;\r\n\r\n\t// create a copy of the parser to prevent side effects\r\n\t// to the main parser\r\n\t$local_parser = clone $parser;\r\n\t// create a new ParserOutput object\r\n\t// so that only the templates this section is dependent on\r\n\t// will be written to cache\r\n\t$local_parser->mOutput = new ParserOutput;\r\n\t// parse the content save the ParserOutput object\r\n\t$cacheOutput = $local_parser->parse($content, $parser->getTitle(), $parser->getOptions());\r\n\t// return the text output of the ParserOutput object\r\n\t$retv = $cacheOutput->mText;\r\n \r\n\t// Check if parsing caused caching to be disabled\r\n\tif($local_parser->mCacheTime == -1)\r\n\t{\r\n\t\t// disable caching since content is not cacheable\r\n\t\t$parser->disableCache();\r\n\t\tif($gInPlaceCacheEmitComments)\r\n\t\t\t$retv .= '<!-- InPlaceCache: parsing content caused caching to be disabled, cache not stored -->';\r\n\t}\r\n elseif($action == 'submit')\r\n {\r\n // Don't write cache for previews, also wierdly MW renders once for action=submit then again action=view after saving an article\r\n // this causes issues with <ti3>...</ti3> rendering as if it had <pre> infront of it\r\n $retv .= '<!-- InPlaceCache: action=submit cache write ignored -->';\r\n // If the cache exists:\r\n // remove the old cache file when action=submit since its bad\r\n // and cacheMiss isn't going to write to the cache\r\n if($cachePath[0])\r\n unlink($cachePath[1]);\r\n }\r\n\t// write the parser output cache to file since content is cacheable\r\n\telse \r\n InPlaceCache_writeCache($cachePath, $cacheOutput);\r\n\t\r\n\t// perform the equivalent of a cache hit\r\n\tInPlaceCache_mergeParserOutputTo($parser->mOutput, $cacheOutput);\r\n\t\r\n\treturn $retv; \r\n}", "function wp_cache_set($key, $value, $group = '', $expiration = 0)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->set($key, $value, $group, $expiration);\n}", "public function setCacheLifetime($cacheLifetime);", "public function setExpiry($var)\n {\n GPBUtil::checkInt64($var);\n $this->expiry = $var;\n\n return $this;\n }", "public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}", "public function set_cache( $minutes = 0 ) {\n $this->cache_lifetime = $minutes;\n return $this;\n }", "public function cacheFor()\n {\n return now()->addMinutes(2);\n }", "protected function _getExpires()\n\t{\n\t\treturn $this->_expires;\n\t}", "public function cacheGet() {\n }", "function getCacheFileContent($url, $cacheTime) {\n $fileName = sha1($url);\n $file = Gear_Cache::getFullfile($fileName, $cacheTime);\n if ($file) {\n return $file;\n } else {\n $file = file_get_contents($url);\n Gear_Cache::setFullFile($fileName, $file);\n return $file;\n }\n}", "public function setCache($key, $val = null, $expires = null)\n {\n return $this->memcache->set($key, $val, null, $expires);\n }", "public function setExpiresAt($timestamp);", "private function cacheAccessToken()\n {\n return Cache::remember('t-pay-access-token', now()->addMinutes(config('tpay.token_session')), function () {\n return $this->getAccessToken();\n });\n }", "public function cacheFor()\n {\n return now()->addMinutes(1440);\n }", "public function getExpirationTime() {\n return $this->shareData[\"expire\"];\n }", "public function getCachingTime()\n {\n return $this->caching_time;\n }", "public function get_expiration() \n\t{ \n\t// si no esta en memoria abrirlo\n\tif(empty($this->TA)) {\n\t\t$TA_file = file($this->path.self::TA, FILE_IGNORE_NEW_LINES);\n\t\tif($TA_file) {\n\t\t\t$TA_xml = '';\n\t\t\tfor($i=0; $i < sizeof($TA_file); $i++)\n\t\t\t\t$TA_xml.= $TA_file[$i]; \n\t\t\t$this->TA = $this->xml2Array($TA_xml);\n\t\t\t$r = $this->TA['header']['expirationTime'];\n\t\t} else {\n\t\t\t$r = false;\n\t\t}\n\t} else {\n\t\t$r = $this->TA['header']['expirationTime'];\n\t}\n\treturn $r;\n\t}", "public function getExpires()\n {\n return $this->get('Expires');\n }", "public function expiresAt();", "public function expiresAt();", "protected function setInCache( $memcKey, $value, $expiry ) {\n\t\t// getMemcKey() can return false\n\t\tif ( $memcKey === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update the instance cache if it's already been populated\n\t\tif ( $this->cached !== null ) {\n\t\t\t$this->cached[$memcKey] = $value;\n\t\t}\n\n\t\t$this->cache->set( $memcKey, $value, $expiry );\n\t}", "public function cached($ttl = 0) {\n $this->temporaryCacheTtl = $ttl;\n return $this;\n }", "public function cache() {\n\t\treturn $this->_cache;\n\t}", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "private function set_cache( $key, $data = '' ) {\n\t\t$ttl = HOUR_IN_SECONDS;\n\n\t\t/**\n\t\t * Filters the cache expiration.\n\t\t *\n\t\t * Can be used to adjust the time until expiration in seconds for the cache\n\t\t * of the data retrieved for the given URL.\n\t\t *\n\t\t * @since 5.9.0\n\t\t *\n\t\t * @param int $ttl The time until cache expiration in seconds.\n\t\t */\n\t\t$cache_expiration = apply_filters( 'rest_url_details_cache_expiration', $ttl );\n\n\t\treturn set_site_transient( $key, $data, $cache_expiration );\n\t}", "function getCache() {\n\t\t// The following line is only for classloading purposes\n\t\t$categoryEntryDao =& $this->getEntryDAO();\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\n\t\t// Load and return the cache, building it if necessary.\n\t\t$filename = $this->getCacheFilename();\n\t\tif (!file_exists($filename)) $this->rebuildCache();\n\t\t$contents = file_get_contents($filename);\n\t\tif ($contents) return unserialize($contents);\n\t\treturn null;\n\t}", "public function cache(Rest_Cache $cache = NULL)\n\t{\n\t\tif ($cache === NULL)\n\t\t{\n\t\t\treturn $this->_cache;\n\t\t}\n\n\t\t$this->_cache = $cache;\n\t\treturn $this;\n\t}", "public static function getCache() {}", "public function getExpires()\r\n {\r\n return $this->expires;\r\n }", "private function _getCacheLifeTime() {\n\n $getDefaultCache = $this->_readDefaultCache();\n if (isset($getDefaultCache['frontend']['lifetime']) && !empty($getDefaultCache['frontend']['lifetime']))\n $chacheLifetime = $getDefaultCache['frontend']['lifetime'];\n $chacheLifetime = !empty($chacheLifetime) ? $chacheLifetime : 300;\n return $chacheLifetime;\n }", "public function getCache() {\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $isCacheEnabled = $this->isCacheEnabled();\n if (empty($isCacheEnabled))\n return false;\n\n $cacheName = $this->_cacheName();\n if (empty($cacheName))\n return null;\n $cache = Zend_Registry::get('Zend_Cache');\n\n try {\n $getCache = $cache->load($cacheName);\n } catch (Exception $e) {\n return null;\n }\n if (!empty($getCache))\n return $getCache;\n\n return null;\n }", "function cache();", "public static function getCacheFile() {\n\t\t$cache = false;\n\t\t$can_be_cached = PageCache::canBeCached();\n\t\tif ($can_be_cached) {\n\t\t\t// Before checking cache, lets check cache reffreshment triggers (specific prices)\n\t\t\tPageCacheDAO::triggerReffreshment();\n\n\t\t\t$controller = Dispatcher::getInstance()->getController();\n\t\t\t$cache_life = 60 * ((int)Configuration::get('pagecache_'.$controller.'_timeout'));\n\t\t\t$cache_file = PageCache::_getCacheFilepath();\n\n\t\t\tif (Tools::getIsset('delpagecache') && file_exists($cache_file)) {\n\t\t\t\tunlink($cache_file);\n\t\t\t}\n\n\t\t\t$pseudo_uri = self::getPseudoRequestURI();\n\t\t\t$filemtime = @filemtime($cache_file);\n\t\t\tif ($filemtime && ($cache_life < 0 or (microtime(true) - $filemtime < $cache_life))) {\n\t\t\t\tif (Configuration::get('pagecache_stats')) {\n\t\t\t\t\tPageCacheDAO::incrementCountHit($pseudo_uri);\n\t\t\t\t}\n\t\t\t\t$cache = $cache_file;\n\t\t\t}\n\n\t\t\t// Store cache used in a readable cookie (0=no cache; 1=server cache; 2=browser cache)\n\t\t\tif (self::isDisplayStats()) {\n\t\t\t\t$cache_type = 0;\n\t\t\t\tif ($cache) {\n\t\t\t\t\t$cache_type = 1;\n\t\t\t\t}\n\t\t\t\tif (PHP_VERSION_ID <= 50200) /* PHP version > 5.2.0 */\n\t\t\t\t\tsetcookie('pc_type_' . md5($pseudo_uri), $cache_type, time()+60*60*1, '/', null, 0);\n\t\t\t\telse\n\t\t\t\t\tsetcookie('pc_type_' . md5($pseudo_uri), $cache_type, time()+60*60*1, '/', null, 0, false);\n\t\t\t}\n\t\t}\n\t\tif (Configuration::get('pagecache_logs') > 1) {\n\t\t\t// Log debug\n\t\t\t$controller = Dispatcher::getInstance()->getController();\n\t\t\t$is_ajax = Tools::getIsset('ajax') ? 'true' : 'false';\n\t\t\t$is_get = strcmp($_SERVER['REQUEST_METHOD'], 'GET') == 0 ? 'true' : 'false';\n\t\t\t$ctrl_enabled = Configuration::get('pagecache_'.$controller) ? 'true' : 'false';\n\t\t\t$is_debug = !Configuration::get('pagecache_debug') || Tools::getValue('dbgpagecache') !== false ? 'false' : 'true';\n\t\t\t$token_ok = (int)(Configuration::get('PS_TOKEN_ENABLE')) != 1 ? 'true' : 'false';\n\t\t\t$is_logout = Tools::getValue('logout') === false && Tools::getValue('mylogout') === false ? 'false' : 'true';\n\t\t\t$can_be_cached = $can_be_cached ? 'true' : 'false';\n\t\t\t$cache_life = 60 * ((int)Configuration::get('pagecache_'.$controller.'_timeout'));\n\t\t\t$cache_file = PageCache::_getCacheFilepath();\n\t\t\t$exists = file_exists($cache_file) ? 'true' : 'false';\n\t\t\t$date_infos = '';\n\t\t\tif (file_exists($cache_file)) {\n\t\t\t\t$now = date(\"d/m/Y H:i:s\", microtime(true));\n\t\t\t\t$last_date = date(\"d/m/Y H:i:s\", filemtime($cache_file));\n\t\t\t\t$date_infos = \"now=$now file=$last_date\";\n\t\t\t}\n\t\t\tLogger::addLog(\"PageCache | cache | !is_ajax($is_ajax) && is_get($is_get) && ctrl_enabled($ctrl_enabled) \".\n\t\t\t\t\"&& !is_debug($is_debug) && token_ok($token_ok) && !is_logout($is_logout) = $can_be_cached \".\n\t\t\t\t\"controller=$controller cache_life=$cache_life cache_file=$cache_file exists=$exists $date_infos\", 1, null, null, null, true);\n\t\t}\n\t\treturn $cache;\n\t}", "public static function cache(){\n\n if (!isset(self::$_cache)) {\n if(!GO::isInstalled()){\n self::$_cache=new \\GO\\Base\\Cache\\None();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(!isset(GO::session()->values['cacheDriver'])){\n\t\t\t\t\t\t\t\t$cachePref = array(\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Apcu\",\n\t\t\t\t\t\t\t\t\t\t\"\\\\GO\\\\Base\\\\Cache\\\\Disk\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tforeach($cachePref as $cacheDriver){\n\t\t\t\t\t\t\t\t\t$cache = new $cacheDriver;\n\t\t\t\t\t\t\t\t\tif($cache->supported()){\n\n\t\t\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\t\t\tGO::session()->values['cacheDriver'] = $cacheDriver;\n\t\t\t\t\t\t\t\t\t\tself::$_cache=$cache;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cacheDriver = GO::session()->values['cacheDriver'];\n\t\t\t\t\t\t\t\tGO::debug(\"Using $cacheDriver cache\");\n\t\t\t\t\t\t\t\tself::$_cache = new $cacheDriver;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n }\n return self::$_cache;\n }", "public function cache()\n {\n return $this->cache;\n }", "public function getExpires(): \\DateTime\n {\n return $this->expires;\n }", "public function cache($f=SQL::CACHE, $expire=0)\n {\n $this->cache = $f;\n $this->expire = $expire;\n return $this;\n }", "protected function get_cache() {\n\t\n // uncomment next line to flush previous cache\n\t //delete_transient($this->get_cache_id()); \n\t\n \treturn get_transient( $this->get_cache_id() ); \t \n\t}", "public function getExpiration()\n {\n // expire now\n return new \\DateTime();\n }", "public function saveToCacheForever();", "public function getExpires() {\n return $this->expires;\n }", "function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}", "public function setExpireTime($value)\n {\n return $this->set(self::_EXPIRE_TIME, $value);\n }", "public function setExpireTime($value)\n {\n return $this->set(self::_EXPIRE_TIME, $value);\n }", "public function setExpireTime($value)\n {\n return $this->set(self::_EXPIRE_TIME, $value);\n }", "public function setExpireTime($value)\n {\n return $this->set(self::_EXPIRE_TIME, $value);\n }", "public static function cache($secondsToCache = 31536000)\n {\n $expiresTimestamp = gmdate('D, d M Y H:i:s', time() + $secondsToCache) . ' GMT';\n\n /**\n * The Expires entity-header field gives the date/time\n * after which the response is considered stale.\n *\n * https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21\n */\n header('Expires: ' . $expiresTimestamp);\n\n /**\n * The Cache-Control general-header field is used to specify\n * directives that MUST be obeyed by all caching mechanisms\n * along the request/response chain.\n *\n * https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9\n */\n header('Cache-Control: max-age=' . $secondsToCache);\n }", "function &createCache() {}", "public static function printCache (){\n\t?>\n\t\n\t\t\t\t<!-- Cache Settings -->\n\t\t\t\t<h3>Cache Settings</h3>\n\t\t\t\t<table class='form-table'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\"><label for='gdocs_cache_expiry'>Lifespan</label></th>\n\t\t\t\t\t\t\t<td><input type=\"text\" size=\"40\" id='gdocs_cache_expiry' name=\"gdocs_cache_expiry\" value=\"<?php echo get_option ('gdocs_cache_expiry'); ?>\" /><span class='description'>minutes</span><br/><span class='description'><strong>Set to <code>0</code> to turn off caching.</strong></span></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\n\t<?php\n\t}", "public function clearCache($maxAge);", "function ClearCache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)\n {\n return $this->_smarty->clear_cache($tpl_file, $cache_id, $compile_id, $exp_time);\n }" ]
[ "0.693514", "0.665393", "0.6604886", "0.64926875", "0.6409107", "0.6151491", "0.603896", "0.6023669", "0.6018186", "0.5997096", "0.5943438", "0.5936688", "0.59275585", "0.58980334", "0.5814625", "0.5812415", "0.57907104", "0.57767457", "0.5720273", "0.5718782", "0.571045", "0.5708854", "0.57033044", "0.5683713", "0.56825113", "0.5676592", "0.5673991", "0.5659407", "0.56589776", "0.56506217", "0.56225294", "0.5621646", "0.5619199", "0.56178594", "0.56124157", "0.5603134", "0.55818456", "0.5577887", "0.5577842", "0.55718714", "0.5561809", "0.5558594", "0.55480695", "0.5543992", "0.55337566", "0.5523009", "0.5522452", "0.5520276", "0.5516793", "0.55096084", "0.5506392", "0.5504013", "0.5499108", "0.5498294", "0.54962146", "0.54910415", "0.5480769", "0.54793173", "0.54759467", "0.5472572", "0.5472106", "0.5472062", "0.5467381", "0.5466341", "0.54648626", "0.5456834", "0.5453053", "0.5446339", "0.54412514", "0.54412514", "0.5416677", "0.54127866", "0.5406013", "0.5401601", "0.53892183", "0.53864384", "0.5384413", "0.53822243", "0.5375875", "0.53616077", "0.53578717", "0.5357646", "0.5354075", "0.53536206", "0.53509665", "0.53441936", "0.5333603", "0.53333735", "0.5329393", "0.5328007", "0.53266895", "0.5323379", "0.5322196", "0.5322196", "0.5322196", "0.5322196", "0.5322196", "0.53154534", "0.5310893", "0.53084975", "0.5307638" ]
0.0
-1
Retrieves a content from cache taking care about the expiration time param. If the cache doesn't exist or is invalid, the returned value will be a null value.
abstract public function getCache( $cacheID = '', $unserialize = true );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFromCache() {}", "public function get($cache_name);", "function getCache() {\n\t\t// The following line is only for classloading purposes\n\t\t$categoryEntryDao =& $this->getEntryDAO();\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\n\t\t// Load and return the cache, building it if necessary.\n\t\t$filename = $this->getCacheFilename();\n\t\tif (!file_exists($filename)) $this->rebuildCache();\n\t\t$contents = file_get_contents($filename);\n\t\tif ($contents) return unserialize($contents);\n\t\treturn null;\n\t}", "final public function get():? object\n\t{\n\t\tif ($stm = $this->_prepare('SELECT `value`,\n\t\t\t\tDATE_FORMAT(`expires`, \"%Y-%m-%dT%TZ\") AS `expires`\n\t\t\t\t FROM `Cache`\n\t\t\t\t WHERE `key` = :key\n\t\t\t\t LIMIT 1;')\n\t\t) {\n\t\t\t$stm->execute(['key' => $this->getKey()]);\n\n\t\t\tif ($result = $stm->fetchObject()) {\n\t\t\t\tprint_r($result);\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getCache();", "private function inCache()\n\t{\n\t\t$content = $this->_cache->retrieve($this->redditid); //faster if we have it in cache already\n\t\treturn $content;\n\t}", "protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }", "protected function getContentFromCacheFile() {}", "function _cache_get ($cache_name = \"\") {\n\t\tif (empty($cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\treturn $this->_get_cache_file($cache_file_path);\n\t}", "public function getCachedResult() {\n $cachePath = $this->_getCachePath();\n if (is_file($cachePath)) {\n $cacheModifiedTime = filemtime($cachePath);\n if ($cacheModifiedTime < time() - CACHE_EXPIRED_DELAY) {\n $result = $this->getLiveResult();\n if ($result)\n return $result;\n else\n touch($cachePath);\n }\n\n return file_get_contents($cachePath);\n }\n\n return $this->getLiveResult();\n }", "public function getCache() {\n\t\tif (file_exists($this->cache_file)) {\n\t\t\t$cache_contents = file_get_contents($this->cache_file);\n\t\t\treturn $cache_contents;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function getCache() {}", "public function cacheRead( $name ) {\n\t\tif ( ZC_CACHE == 'none' || $this->isAdmin() ) return null; // admin -> no cache\n\t\t\n\t\t$content = null;\n\t\t$name = $this->_cacheName( $name );\n\t\tif ( ZC_CACHE == 'apc' ) {\n\t\t\t$content = apc_fetch( ZC_CACHE_PREFIX. $name, $success );\n\t\t\tif ( ! $success ) $content = null;\n\t\t}\n\t\telse {\n\t\t\t$file = ZC_CACHE_DIR . '/'. $name. '.cache';\n\t\t\tif ( file_exists( $file ) )\n\t\t\t\t$content = unserialize( file_get_contents( $file ) );\n\t\t}\n\t\treturn $content;\n\t}", "abstract public function getCacheContent( $cacheID = '', $unserialize = true );", "public function getCache() {\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $isCacheEnabled = $this->isCacheEnabled();\n if (empty($isCacheEnabled))\n return false;\n\n $cacheName = $this->_cacheName();\n if (empty($cacheName))\n return null;\n $cache = Zend_Registry::get('Zend_Cache');\n\n try {\n $getCache = $cache->load($cacheName);\n } catch (Exception $e) {\n return null;\n }\n if (!empty($getCache))\n return $getCache;\n\n return null;\n }", "protected function readFromCache()\r\n {\r\n $result = null;\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n $result = apc_fetch($this->getCacheKey());\r\n }\r\n return $result;\r\n }", "private function _cache_get_content($cache_id, $cache_group = 'global', $time = false)\n {\n\n $mem_var = $this->mw_cache_mem;\n if (isset($mem_var[$cache_group])) {\n if (isset($mem_var[$cache_group][$cache_id]) and $mem_var[$cache_group][$cache_id] != false) {\n //\t\t print $mem_var[$cache_group][$cache_id];\n return $mem_var[$cache_group][$cache_id];\n }\n\n }\n\n $mode = 2;\n\n if (!strstr($cache_group, 'global')) {\n $mode = 1;\n }\n\n $cache = $this->_cache_get_content_encoded($cache_id, $cache_group, $time);\n\n if ($cache == false or $cache == '' or $cache == '---empty---' or $cache == '---false---' or (is_array($cache) and empty($cache))) {\n $this->mw_cache_mem[$cache_group][$cache_id] = false;\n return false;\n } else {\n // $cache = base64_decode($cache);\n $cache = @unserialize($cache);\n $this->mw_cache_mem[$cache_group][$cache_id] = $cache;\n return $cache;\n }\n }", "public static function getCache() {\n\t\treturn null;\n\t}", "public function cacheGet() {\n }", "public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}", "public function get($key, $expiration = 0)\n {\n $path = $this->createFullCachePath($key);\n if (is_readable($path) && filemtime($path) >= (time() - $expiration)) {\n return file_get_contents($path);\n }\n return null;\n }", "public function stdWrap_cacheRead($content = '', $conf = [])\n {\n if (!isset($conf['cache.'])) {\n return $content;\n }\n $result = $this->getFromCache($conf['cache.']);\n return $result === false ? $content : $result;\n }", "public function getCache()\n {\n return $this->get('cache', false);\n }", "protected function get_cache() {\n\t\n // uncomment next line to flush previous cache\n\t //delete_transient($this->get_cache_id()); \n\t\n \treturn get_transient( $this->get_cache_id() ); \t \n\t}", "public function readCache() {\n\t\tif(file_exists($this -> sCacheDir . $this -> sCacheFile)) {\n\t\t\treturn file_get_contents($this -> sCacheDir . $this -> sCacheFile);\n\t\t}\n\t\treturn false;\n\t}", "function asu_brand_get_cached_content($cache_id, $file_path, $reset = FALSE) {\n\n if($output = cache_get($cache_id)) {\n $output = $output->data;\n }\n\n if ($reset || $output==NULL || !isset($output)) {\n\n // set timeout to 1.5 seconds. if it takes too long, fall back\n // to long term caching\n $options = array(\n 'timeout' => 1.5\n );\n\n $output = drupal_http_request($file_path, $options);\n\n //if ($output = drupal_http_request($file_path)) {//$output = file_get_contents($file_path)) {\n if ($output->code == 200) {\n $output = $output->data;\n\n cache_set($cache_id, $output, 'cache', time() + ASU_BRAND_CACHE_LIFETIME);\n variable_set($cache_id, $output);\n } else {\n // File resource is not available; use long term cache and cache it for 1 hour.\n $output = variable_get($cache_id, NULL);\n cache_set($cache_id, $output, 'cache', time() + 3600);\n watchdog('asu_brand', 'Unable to load @path to the cache; using long term cache.', array('@path' => $file_path), WATCHDOG_ERROR);\n }\n }\n \n return $output;\n}", "public function getCache($key) {\n\t\t$cachedFileContent = null;\n\t\t$cacheFile = $this->getCacheFile($key);\n\t\tif(is_readable($cacheFile)) {\n\t\t\t$f = fopen($cacheFile,'r');\n\t\t\tif(is_resource($f)) {\n\t\t\t\t// Acquire lock to read file\n\t\t\t\tif(flock($f,LOCK_SH)) {\n\t\t\t\t\t$cachedFileContent = fread($f,filesize($cacheFile));\n\t\t\t\t\t// release lock\n\t\t\t\t\tflock($f,LOCK_UN);\n\t\t\t\t}\n\t\t\t\tfclose($f);\n\t\t\t}\n\t\t}\n\t\treturn $cachedFileContent;\n\t}", "private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }", "private function get_cache() {\n exit(file_get_contents($this->cache_file));\n }", "function getCacheFileContent($url, $cacheTime) {\n $fileName = sha1($url);\n $file = Gear_Cache::getFullfile($fileName, $cacheTime);\n if ($file) {\n return $file;\n } else {\n $file = file_get_contents($url);\n Gear_Cache::setFullFile($fileName, $file);\n return $file;\n }\n}", "function GetFromCache()\n {\n return File::GetContents($this->file);\n }", "function getCache() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT cached_result FROM $this->cacheTable WHERE post_id = '\" . $this->db->escape( $this->postID ) . \"'\";\n\t\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( !$results[0] )\n\t\t\treturn false;\n\t\t\t\n\t\treturn $results[0]->cached_result;\n\t}", "static function get($name,$maxAge=null){\n\t\tif(! self::$enable )\n\t\t\treturn null;\n\t\tself::init();\n\t\t$maxAge = self::_ttl(null===$maxAge?self::$ttl : $maxAge);\n\t\t$i = self::$backend->getItem($name);\n\t\t#- check for validity\n\t\tif( ! $i->checkValididty($maxAge) ){\n\t\t\treturn cacheItem::dropInstance($name);\n\t\t}\n\t\treturn $i->content;\n\t}", "protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}", "function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }", "function cached($url = false, $cache_timeout = 15) {\n\t\tif(!$url) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$cache_file = $this->cachefile($url);\n\t\t\n\t\t$cache_timeout = $cache_timeout * 60;\n\t\t\n\t\t$cache_exists = file_exists($cache_file);\n\t\t\n\t\tif($cache_exists) {\n\t\t\t$cache_valid = (filemtime($cache_file)+$cache_timeout > time());\n\t\t} else {\n\t\t\t$cache_valid = false;\n\t\t}\n\t\t\n\t\tif($cache_exists && $cache_valid) {\n\t\t\t$cache_data = trim(file_get_contents($cache_file));\n\t\t\t$cache_object = @json_decode($cache_data);\n\t\t\tif($cache_data && $cache_object) {\n\t\t\t\treturn $cache_object;\n\t\t\t}\n\t\t} else if($cache_exists && !$cache_valid) {\n\t\t\tunlink($cache_file);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function get($path) {\n\t\treturn $this->cache[$path] ?? null;\n\t}", "function get($key) {\n $cacheFile = $this->_getFilePath($key); \n if (!file_exists($cacheFile)){\n return '';\n }\n $fp = fopen($cacheFile, 'r');\n $meta = $this->_readMeta($fp);\n if ($meta['expired']!=0 && $meta['expired']<time()){\n fclose($fp);\n unlink($cacheFile);\n return '';\n }\n $ret = '';\n $str = '';\n while($str = fread($fp, 8192)){\n $ret .= $str;\n }\n fclose($fp);\n return unserialize($ret);\n\n }", "protected function getCache($key = null) {\n if (!$key) {\n $key = \"data\";\n }\n $fullKey = \"cache-\".$this->getID().\"-{$key}\";\n\n $found = false;\n $cached = \\apcu_fetch($fullKey, $found);\n if ($found) {\n return $cached;\n }\n return false;\n }", "public function get()\n {\n return Cache::get($this->cacheKey);\n }", "public function getContentCache()\n {\n return $this->contentCache;\n }", "public function getCache($key)\n {\n return $this->memcache->get($key);\n }", "function getContent($file) {\r\n\t\t$cacheFile = '../cache' . DIRECTORY_SEPARATOR . md5($file);\r\n\t\tif (file_exists($cacheFile)) {\r\n\t\t\t$fh = fopen($cacheFile, 'r') or die(\"Unable to open file!\");\r\n\t\t\t$timeElapsed = time() - filemtime($cacheFile);\r\n\t\t\t// if data was cached recently, return cached data\r\n\t\t\tif ($timeElapsed < 86400) {\r\n\t\t\t\treturn fread($fh, filesize($cacheFile));\r\n\t\t\t}\r\n\r\n\t\t\t// else delete cache file\r\n\t\t\tfclose($fh);\r\n\t\t\tunlink($cacheFile);\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public function getCache()\n\t{\n\t\treturn CacheBot::get($this->getCacheKey(), self::$objectCacheLife);\n\t}", "function getItem($name){\n\t\t$i = cacheItem::getInstance($name);\n\t\tif(empty($i->cacheTime) && empty($i->content) ){\n\t\t\t$datas = $this->db->select_row(self::$tableName,'*',array('WHERE name=?',$name));\n\t\t\tif( false !== $datas)\n\t\t\t\t$i->setDatas($datas);\n\t\t}\n\t\treturn $i;\n\t}", "public function getCache()\n {\n if ($this->cache && $this->cacheExists()) {\n return(file_get_contents($this->getCacheFile()));\n } else {\n return(false);\n }\n }", "static public function getFromUrl(){\n $args = func_get_args();\n\n $cacheIsExpired = true; // By default we assume no cache then never expire (then cache always expire !)\n\n $cache = static::getCache();\n if( !is_null($cache) && isset($args[0]) && is_string($args[0]) ){ // Cache defined ?\n $cacheIsExpired = $cache->setRequest($args[0])->isExpired();\n }\n\n set_error_handler(array('\\Draeli\\RssBridge\\Utils', 'set_error_handler'));\n\n $argsLng = count($args);\n\n if( $cacheIsExpired ){\n if( !isset($args[1]) ){\n $args[1] = false;\n }\n\n if( !isset($args[2]) ){\n $randVersion = rand(23, 30) . '.' . rand(0, 9);\n\n // http://www.php.net/manual/fr/context.http.php\n // http://en.wikipedia.org/wiki/List_of_HTTP_header_fields\n $context = stream_context_create(array(\n 'http' => array(\n 'header' =>\n 'Accept-Charset: utf-8' . \"\\r\\n\" . \n 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:' . $randVersion . ') Gecko/' . date('Ymd') . ' Firefox/' . $randVersion . \"\\r\\n\", // À la bourrin ! :)\n )\n ));\n $args[2] = $context;\n }\n\n $argsFileGetContens = $argsLng > 5 ? array_slice($args, 0, 5) : $args;\n /*\n Note : il est possible d'utilisater les options de context, cf. http://www.php.net/manual/fr/context.http.php + http://fr2.php.net/manual/en/function.file-get-contents.php\n */\n $sourceHtml = call_user_func_array('\\file_get_contents', $argsFileGetContens );\n }\n else{ // Cache not expired, we reload stuff\n $sourceHtml = $cache->loadData();\n }\n\n if( $sourceHtml === false ){\n throw new \\Exception('No data to load from this URL');\n }\n\n $argsStrGetContens = $argsLng > 5 ? array_slice($args, 5) : array();\n array_unshift($argsStrGetContens, $sourceHtml);\n\n $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'str_get_html'), $argsStrGetContens);\n // $result = call_user_func_array( array('\\Sunra\\PhpSimple\\HtmlDomParser', 'file_get_html'), $args );\n restore_error_handler ();\n\n if( !is_null($cache) ){ // Cache expired or not exist, we refresh cache\n $cache->saveData($sourceHtml);\n }\n\n return $result;\n }", "public function getCache() {\n\t\t$this->sync();\n\t\treturn $this->cache;\n\t}", "public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}", "public function check_cache() \r\n\t{\r\n\t\tif (!is_readable($this->cache_file))\r\n\t\t{\r\n\t\t\t$this->generate_cache();\r\n\t\t}\r\n\t\t$contents = file_get_contents($this->cache_file);\r\n\t\treturn $contents;\r\n\t}", "function get($key) {\n\t\t\tglobal $__cachemem;\n\t\t\t$file = CACHE_DIR.md5($key).\".cache\";\n\t\t\tif($__cachemem[$key] != \"\") {\n\t\t\t\treturn $__cachemem[$key];\n\t\t\t}\n\t\t\tif(@file_exists($file)) {\n\t\t\t\t$dump = file_get_contents($file);\n\t\t\t\tdebugLog(\"Cache file gelesen\", \"Cache File wurde erfolgreich gelesen - KEY: '\".$key.\"'\",$file);\n\t\t\t\t$res = @unserialize($dump);\n\t\t\t\t$__cachemem[$key] = $res;\n\t\t\t\treturn $res;\n\t\t\t} else {\n\t\t\t\t//debugLog(\"Cache File fehler\",\"Cache file konnte nicht gefunden werden, expired?\",$file,UNKWN,DBUG_WARNING);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function fetch(RequestInterface $request) {\n /** @var int|null $maxAge */\n $maxAge = NULL;\n\n if ($request->hasHeader('Cache-Control')) {\n $reqCacheControl = new KeyValueHttpHeader($request->getHeader('Cache-Control'));\n if ($reqCacheControl->has('no-cache')) {\n // Can't return cache.\n return NULL;\n }\n\n $maxAge = $reqCacheControl->get('max-age', NULL);\n }\n elseif ($request->hasHeader('Pragma')) {\n $pragma = new KeyValueHttpHeader($request->getHeader('Pragma'));\n if ($pragma->has('no-cache')) {\n // Can't return cache.\n return NULL;\n }\n }\n\n $cache = $this->storage->fetch($this->getCacheKey($request));\n if ($cache !== NULL) {\n $varyHeaders = $cache->getVaryHeaders();\n\n // Vary headers exist from a previous response, check if we have a cache\n // that matches those headers.\n if (!$varyHeaders->isEmpty()) {\n $cache = $this->storage->fetch($this->getCacheKey($request, $varyHeaders));\n\n if (!$cache) {\n return NULL;\n }\n }\n\n // This is where the original method checks the original request URL.\n if ($maxAge !== NULL) {\n if ($cache->getAge() > $maxAge) {\n // Cache entry is too old for the request requirements!\n return NULL;\n }\n }\n\n if (!$cache->isVaryEquals($request)) {\n return NULL;\n }\n }\n\n return $cache;\n }", "public function get($key)\n {\n $prefixed = $this->prefix.$key;\n\n $cache = $this->table()->where('key', '=', $prefixed)->first();\n\n // If we have a cache record we will check the expiration time against current\n // time on the system and see if the record has expired. If it has, we will\n // remove the records from the database table so it isn't returned again.\n if (! is_null($cache)) {\n if (is_array($cache)) {\n $cache = (object) $cache;\n }\n\n if (time() >= $cache->expiration) {\n $this->forget($key);\n\n return;\n }\n\n return unserialize($cache->value);\n }\n }", "private function _getCache($term) {\n\t\t// find our search term\n\t\t$result = $this->db->get_where('Cache', array('Term' => $term, 'Expires >' => date(\"Y-m-d H:i:s\")))->row_array();\n\t\t// did we get one that isn't expired?\n\t\tif ($result) { \n\t\t\t// cache hit\n\t\t\treturn $result['Data'];\n\t\t}\n\t\t// cache miss\n\t\treturn false;\n\t}", "private function _cache_get_content_encoded($cache_id, $cache_group = 'global', $time = false)\n {\n $use_apc = false;\n if ($cache_group === null) {\n\n $cache_group = 'global';\n }\n\n if ($cache_id === null) {\n\n return false;\n }\n\n $cache_id = trim($cache_id);\n\n $cache_group = $cache_group . DS;\n\n $cache_group = reduce_double_slashes($cache_group);\n if ($use_apc == false) {\n $mem = $this->_cache_get_content_from_memory($cache_id, $cache_group);\n //d($mem);\n if ($mem != false) {\n //d($cache_id);\n // exit();\n return $mem;\n }\n }\n\n $cache_file = $this->_cache_get_file_path($cache_id, $cache_group);\n $cache_file = normalize_path($cache_file, false);\n $get_file = $cache_file;\n\n\n $cache = false;\n try {\n if ($get_file != false) {\n if (isset($get_file) == true and is_file($get_file)) {\n $t = intval($time);\n if ($time != false and $t > 0) {\n if (time() - $t > filemtime($get_file)) {\n /// cache is expired\n return false;\n }\n }\n $cache = @file_get_contents($cache_file);\n } else {\n $this->_cache_get_content_from_memory($cache_id, $cache_group, false);\n return false;\n }\n }\n } catch (Exception $e) {\n $cache = false;\n }\n\n if (isset($cache) and strval($cache) != '') {\n $search = MW_CACHE_CONTENT_PREPEND;\n $replace = '';\n $count = 1;\n $cache = str_replace($search, $replace, $cache, $count);\n }\n\n if (isset($cache) and $cache != false and ($cache) != '') {\n $this->_cache_get_content_from_memory($cache_id, $cache_group, $cache);\n return $cache;\n }\n return false;\n }", "public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}", "public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}", "function _get_cache_file ($cache_file = \"\") {\n\t\tif (empty($cache_file)) {\n\t\t\treturn null;\n\t\t}\n\t\tif ($this->USE_MEMCACHED) {\n//\t\t\t$cache_key = basename($cache_file);\n//\t\t\t$data = $this->MC_OBJ->get($cache_key);\n// TODO\n\t\t// Common (files-based) cache code\n\t\t} else {\n\t\t\tclearstatcache();\n\t\t\tif (!file_exists($cache_file)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Delete expired cache files\n\t\t\t$last_modified = filemtime($cache_file);\n\t\t\t$TTL = $this->CACHE_TTL;\n\t\t\tif ($last_modified < (time() - $TTL)) {\n\t\t\t\tunlink($cache_file);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Get data from file\n\t\t\t$data = [];\n\t\t\tif (DEBUG_MODE) {\n\t\t\t\t$_time_start = microtime(true);\n\t\t\t}\n\t\t\t// Try to include file\n\t\t\tinclude ($cache_file);\n/*\t\t\t@eval(\"?> \".file_get_contents($cache_file).\" <?php\"); */\n\t\t\tif (DEBUG_MODE) {\n\t\t\t\t$GLOBALS['include_files_exec_time'][strtolower(str_replace(DIRECTORY_SEPARATOR, \"/\", $cache_file))] = (microtime(true) - $_time_start);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }", "public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}", "static public function cache($provider = null) {\n $impl = self::instance();\n return $impl->get_resource('cache', $provider);\n }", "public function getCache()\n {\n return $this->Cache;\n }", "protected function getCache()\n {\n return $this->cache;\n }", "public static function getCache() {\n\n if (Config::get('app.cache') != 0 && !Auth::check()) { //\n $page = (Paginator::getCurrentPage() > 1 ? Paginator::getCurrentPage() : '');\n $key = 'route-' . Str::slug(Request::fullurl()) . $page;\n\n if (Cache::has($key)) {\n die(Cache::get($key));\n }\n }\n }", "public function get($name, $maxAge = false) {\n //Get data from cache\n $cache = $this->con->get($name);\n\n if ($cache === false)\n return false;\n\n $ttl = ($maxAge === false) ? $cache['ttl'] : $maxAge;\n \n // Check that stored data hasn't expired\n if ($ttl == 0 || ($cache['date'] + $ttl > time())) {\n // We want the cache no matter how old it is\n return unserialize($cache['data']);\n }\n else if (isset($cache['updateDate'])) {\n // The cache has expired but someone else is probably generating a\n // new one. We need to check the updateDate if it should time out \n // the attempt or just return old cache while waiting for the \n // generating process to finish.\n\n if ((time() - $cache['updateDate']) > $this->updateTimeout) {\n $cache['updateDate'] = time();\n $this->con->set($name, $cache, 0, 0);\n return false;\n }\n else\n return unserialize($cache['data']);\n }\n else {\n // The cache doesn't exist so we'll assume someone will create it\n // after we return false. We'll save the time so that this\n // attempt at creating a cache can time out.\n\n $cache['updateDate'] = time();\n $this->con->set($name, $cache, 0, 0);\n return false;\n }\n\n }", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "public function getCache() {\n\n // return our instance of Cache\n return $this->oCache;\n }", "public function readCache()\n {\n return $this->readFile()->unpackData();\n }", "function get($name){\n $name = md5($name).'.cache';\n if(file_exists($this->_tmp_path.$this->_type.$name)){\n $str = file_get_contents($this->_tmp_path.$this->_type.$name);\n return unserialize($str);\n }else{\n return new Cylix_Exception('cache file not found', 'Cache error');\n }\n }", "public function get( $key ) {\n if ( isset( $this->cache[ $key ] ) ) {\n return $this->cache[ $key ];\n }else{\n return null;\n }\n }", "function get_content($file,$hours = 24) {\n // Setup caching time\n $current_time = time(); \n $expire_time = $hours * 60 * 60; \n $file_time = filemtime(utf8_decode($file));\n \n // Retrieve cached file\n if (file_exists($file) && ($current_time - $expire_time < $file_time)) {\n return file_get_contents($file);\n }\n else {\n // Fetch from the internet\n $content = fetch_distro_from_internet();\n //Cache file\n file_put_contents($file,$content);\n \n return $content;\n }\n\n }", "public function getCache($url, $data = []){\n \t$this->_setData($data);\n \t$this->cacheredis \t= $this->redis->hGet(\"api/$url\",$this->dataredis );\n \t#$this->common->debug(\"api/$url\",FALSE);\n \t#$this->common->debug($this->dataredis);\n \tif( $this->cacheredis){\n \t\treturn $this->cacheredis;\n \t}else{\n \t\treturn FALSE;\n \t}\n }", "public function cache()\n {\n return $this->cache;\n }", "public function get($name, $cache = true) {}", "public function get ($key) {\n try {\n if (empty($key) ) throw new Exception(\"Empty 'name'!\");\n $filename = $this->ValidateFileName($key);\n $result = @file_get_contents(CACHE.$filename);\n if ($result === false) throw new Exception(\"Can't read file '\".CACHE.$filename.\"'!\");\n //$result = unserialize($result);\n $result = json_decode($result, true, JSON_UNESCAPED_UNICODE);\n if (!empty($result)){ //is_array($result) // for unserialize !empty($result)\n if (isset($result['expiries']) && $result['expiries']<time()) {\n $this->rm($key);\n return NULL;\n }\n return $result['value'];\n }\n } catch (Exception $e) {\n //echo 'Exception: ', $e->getMessage(), \"\\n\";\n }\n return NULL;\n }", "public function get_from_cache(string $cache_key)\n {\n if ($this->cache_output()) {\n if (!empty ($cache_key)) {\n $cache_content = get_transient($cache_key);\n if ($cache_content) {\n return $cache_content;\n }\n }\n }\n return FALSE;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function getCache()\n {\n return $this->cache;\n }", "public function cache() {\n\t\treturn $this->_cache;\n\t}", "public function getCache($url){\n\t\t$hash = md5($url);\n\n\t\treturn apc_fetch($hash);\n\t}", "function get_cache(Repository $repo) {\n $key = cache_key($repo);\n $data = get_transient($key);\n if ($data !== false) {\n return json_decode($data, true);\n }\n return false;\n}", "public function getCache(): string\n {\n return $this->cache;\n }", "public static function getCached($cacheKey)\n {\n if (empty(self::$cacheStorage)) {\n return null;\n }\n // get the value from cache\n $value = self::$cacheStorage->getCached($cacheKey);\n // check if we serialized it for storage\n if (!empty($value) && is_string($value) && strpos($value, ':serial:') === 0) {\n try {\n $value = unserialize(substr($value, 8));\n } catch (Exception $e) {\n }\n }\n return $value;\n }", "public function getObjFromCache($key);", "public function getCache($name, $invalidator = null, $duration = null)\n\t{\n\t\t$storage = $this->_getStorage($name, $this->durationIntoSeconds($duration));\n\t\t$cache = $storage->get();\n\n\t\tif ( !is_array($cache) || $cache['invalidator'] !== $invalidator ) {\n\t\t\t$storage->invalidate();\n\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( $cache['expiration'] && $cache['expiration'] < time() ) {\n\t\t\t$storage->invalidate();\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $cache['data'];\n\t}", "function get($key) {\n return $this->cacheObj->get($key);\n }", "public function getCacheExp();", "public function get($key) {\n $this->logger->debug('Getting cache data for key [' . $key . ']');\n $filePath = $this->getFilePath($key);\n if (!file_exists($filePath)) {\n $this->logger->info('No cache file found for the key [' . $key . '], return false');\n return false;\n }\n $this->logger->info('The cache file [' . $filePath . '] for the key [' . $key . '] exists, check if the cache data is valid');\n $data = $this->getCacheFileContent($filePath);\n if ($data === false) {\n $this->logger->error('The cache data for the key [' . $key . '] is not valid, return false');\n // If unserializing somehow didn't work out, we'll delete the file\n unlink($filePath);\n return false;\n }\n if (time() > $data['expire']) {\n $this->logger->info('The cache data for the key [' . $key . '] already expired delete the cache file [' . $filePath . ']');\n // Unlinking when the file was expired\n unlink($filePath);\n return false;\n } \n $this->logger->info('The cache not yet expire, now return the cache data '\n . 'for key [' . $key . '], the cache will expire ' \n . 'at [' . date('Y-m-d H:i:s', $data['expire']) . ']');\n return $data['data'];\n }", "private function checkCache($method, array $params, &$can_cache, &$cache_key)\n {\n $cache_key = implode('-', array_merge([$method], $params));\n $can_cache = 'GET' === $method;\n \n if ($can_cache && ($content = $this->cache->fetch($cache_key))) {\n return $content;\n }\n \n return null;\n }", "public function content()\n {\n return $this->cache->get('content');\n }", "public function getCache()\n {\n return $this->_cache;\n }", "function InPlaceCache_readCache(/* $hash, */ $path)\r\n{\r\n//\t$path = InPlaceCache_checkCache($hash);\r\n\t\r\n\tif($path[0] === false)\r\n\t\treturn false;\r\n\t\t\r\n\treturn unserialize(file_get_contents($path[1]));\r\n}", "function getCache() {\n return $this->cache;\n }", "public function get($key) {\n $filename = $key.'.cache';\n $file = $this->file_path_for_key($key);\n $ttl = $this->definition->get_ttl();\n $maxtime = 0;\n if ($ttl) {\n $maxtime = cache::now() - $ttl;\n }\n $readfile = false;\n if ($this->prescan && array_key_exists($filename, $this->keys)) {\n if ((!$ttl || $this->keys[$filename] >= $maxtime) && file_exists($file)) {\n $readfile = true;\n } else {\n $this->delete($key);\n }\n } else if (file_exists($file) && (!$ttl || filemtime($file) >= $maxtime)) {\n $readfile = true;\n }\n if (!$readfile) {\n return false;\n }\n // Open ensuring the file for reading in binary format.\n if (!$handle = fopen($file, 'rb')) {\n return false;\n }\n // Lock it up!\n // We don't care if this succeeds or not, on some systems it will, on some it won't, meah either way.\n flock($handle, LOCK_SH);\n $data = '';\n // Read the data in 1Mb chunks. Small caches will not loop more than once. We don't use filesize as it may\n // be cached with a different value than what we need to read from the file.\n do {\n $data .= fread($handle, 1048576);\n } while (!feof($handle));\n // Unlock it.\n flock($handle, LOCK_UN);\n // Return it unserialised.\n return $this->prep_data_after_read($data);\n }", "public function getCache(): Cache\n {\n return $this->cache;\n }" ]
[ "0.7521091", "0.7293938", "0.7276305", "0.71754813", "0.7143361", "0.71254385", "0.70932305", "0.7043015", "0.7038775", "0.70352143", "0.697849", "0.6959729", "0.69508094", "0.6870477", "0.68694645", "0.6845388", "0.68122286", "0.6805663", "0.6787952", "0.6782692", "0.6778374", "0.6734217", "0.67327297", "0.6674563", "0.6671654", "0.6668997", "0.66583145", "0.6656664", "0.6656421", "0.6655979", "0.6653603", "0.66253126", "0.66075426", "0.6590328", "0.65824527", "0.6560596", "0.65591747", "0.6549684", "0.6544784", "0.6541101", "0.6534797", "0.6529153", "0.65275353", "0.65202856", "0.6515493", "0.6500202", "0.6494727", "0.64739", "0.64692074", "0.6449973", "0.64451283", "0.6436398", "0.6425868", "0.6421468", "0.64168346", "0.6415492", "0.64139986", "0.64124584", "0.64095885", "0.6408604", "0.6397435", "0.63924533", "0.63861233", "0.63774127", "0.6372324", "0.636886", "0.6368389", "0.6365553", "0.63597417", "0.63555807", "0.634879", "0.6345809", "0.6333197", "0.6325776", "0.6320023", "0.6319031", "0.63163686", "0.63163686", "0.63163686", "0.63163686", "0.63163686", "0.63163686", "0.63163686", "0.6313275", "0.631131", "0.63109714", "0.63089794", "0.6307764", "0.63035494", "0.6295923", "0.62887824", "0.6284888", "0.6272396", "0.62681973", "0.62592584", "0.6254833", "0.62546057", "0.6246923", "0.6236131", "0.62348187" ]
0.666551
26
Saves the received data inside an especific cache persistance layer. If the cache with the ID doesn't exist, this method will try to create it. Otherwise, the file content will be replaced with the new data definition. If the data was successfully saved, the returned value will be a true boolean value.
abstract public function save( $data = null, $cacheID = '', $serialize = true );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "private function _cache_save($data_to_cache, $cache_id, $cache_group = 'global')\n {\n\n if ($data_to_cache == false) {\n $cache_file = $this->_cache_get_file_path($cache_id, $cache_group);\n $cache_file = normalize_path($cache_file, false);\n if (is_file($cache_file)) {\n @unlink($cache_file);\n }\n return false;\n } else {\n\n $mem_var = $this->mw_cache_mem;\n if (!isset($mem_var[$cache_group])) {\n $this->mw_cache_mem[$cache_group] = array();\n }\n\n if ($data_to_cache == '--true--') {\n $this->mw_cache_mem[$cache_group][$cache_id] = true;\n } else {\n $this->mw_cache_mem[$cache_group][$cache_id] = $data_to_cache;\n\n }\n\n $data_to_cache = serialize($data_to_cache);\n\n $this->_cache_write_to_file($cache_id, $data_to_cache, $cache_group);\n\n return true;\n }\n }", "public function save($id, $data)\n {\n $id = $this->uniqId.'-'.$id;\n\n if (!$this->apcIsEnabled()) {\n return false;\n }\n\n if ($this->debug) {\n $this->cache->save($id, $data, 20);\n } else {\n $this->cache->save($id, $data);\n }\n\n return false;\n }", "function save($id, $cachedata, $expires, $group, $userdata)\n {\n $this->flushPreload($id, $group);\n\n $file = $this->getFilename($id, $group);\n if (!($fh = @fopen($file, 'wb'))) {\n return new Cache_Error(\"Can't access '$file' to store cache data. Check access rights and path.\", __FILE__, __LINE__);\n }\n\n // File locking (exclusive lock)\n if ($this->fileLocking) {\n flock($fh, LOCK_EX);\n }\n // file format:\n // 1st line: expiration date\n // 2nd line: user data\n // 3rd+ lines: cache data\n $expires = $this->getExpiresAbsolute($expires);\n fwrite($fh, $expires . \"\\n\");\n fwrite($fh, $userdata . \"\\n\");\n fwrite($fh, $this->encode($cachedata));\n\n // File unlocking\n if ($this->fileLocking) {\n flock($fh, LOCK_UN);\n }\n fclose($fh);\n\n // I'm not sure if we need this\n\t// i don't think we need this (chregu)\n // touch($file);\n\n return true;\n }", "public function set($data) {\r\n if ($this->path === null) {\r\n trigger_error('TS3Viewer: no cache path given', E_USER_WARNING);\r\n return false;\r\n }\r\n\r\n if (!file_exists($this->path) || !is_writable($this->path)) {\r\n trigger_error(\"TS3Viewer: cache directory '\" . $this->path . \"' does't exists or isn't writable\", E_USER_WARNING);\r\n return false;\r\n }\r\n\r\n return file_put_contents($this->path . $this->key . $this->ext, serialize($data));\r\n }", "protected function _save()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\t$_data = json_encode( $this->contents() );\n\n\t\tif ( $this->_compressStore )\n\t\t{\n\t\t\t$_data = Utility\\Storage::freeze( $this->contents() );\n\t\t}\n\n\t\tif ( false === file_put_contents( $_file, $_data ) )\n\t\t{\n\t\t\tUtility\\Log::error( 'Unable to store Oasys data in \"' . $_file . '\". System error.' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function save($data, $id, $ttl = 0)\n {\n $cacheFile = $this->fileName($id);\n if (!$file = fopen($cacheFile, \"w\")) {\n throw new \\Exception(sprintf('Cache file \"%s\" can not be created.', $cacheFile));\n }\n $content = \"<?php return \" . var_export($data, true) . \";?>\";\n fwrite($file, $content);\n fclose($file);\n return true;\n }", "public function save($cache_name, $cache_data, $expires);", "public function save(): bool\n {\n\n $bytes_written = file_put_contents($this->file_name, json_encode($this->getData()));\n\n if ($bytes_written === FALSE) {\n return false;\n }\n\n return true;\n }", "protected function save()\n {\n // Add the version to the map\n $this->map['version'] = $this->version;\n\n // try to serialize into the known path\n if (file_put_contents($this->mapPath, serialize((array) $this->map)) >= 0) {\n // Remove the version entry and return the result\n unset($this->map['version']);\n\n return true;\n\n } else {\n // Remove the version entry and return the result\n unset($this->map['version']);\n\n return false;\n }\n }", "function save($id, $cachedata, $expires, $group, $userdata)\n {\n $this->flushPreload($id, $group);\n \n $cachedata = $this->encode($cachedata);\n $expires_abs = $this->getExpiresAbsolute($expires);\n\n $size = 1 + strlen($cachedata) + strlen($expires_abs) + strlen($userdata) + strlen($group);\n $size += strlen($size);\n \n $data = array(\n 'cachedata' => $cachedata, \n 'expires' => $expires_abs,\n 'userdata' => $userdata\n );\n $id = strtoupper(md5($group)) . $id;\n \n msession_lock($id);\n \n if (!msession_set($id, '_pear_cache', true)) {\n msession_unlock($id);\n return new Cache_Error(\"Can't write cache data.\", __FILE__, __LINE__);\n }\n \n if (!msession_set($id, '_pear_cache_data', $data)) {\n msession_unlock($id);\n return new Cache_Error(\"Can't write cache data.\", __FILE__, __LINE__);\n }\n \n if (!msession_set($id, '_pear_cache_group', $group)) {\n msession_unlock($id);\n return new Cache_Error(\"Can't write cache data.\", __FILE__, __LINE__);\n }\n \n if (!msession_set($id, '_pear_cache_size', $size)) {\n msession_unlock($id);\n return new Cache_Error(\"Can't write cache data.\", __FILE__, __LINE__);\n }\n \n // let msession do some GC as well\n // note that msession works different from the PEAR Cache.\n // msession deletes an entry if it has not been used for n-seconds.\n // PEAR Cache deletes after n-seconds.\n if ($expires != 0) {\n msession_timeout($id, $expires);\n }\n msession_unlock($id);\n\n return true;\n }", "private function _cache($filename, $file_data)\n\t{\n if(empty($file_data))\n {\n\t\t\tlog_message('debug', 'Assets: Cache file '.$filename.' was empty and therefore not written to disk at '.$this->cache_path);\n\t\t\treturn false;\n }\n\n\t\t$filepath = $this->cache_path . $filename;\n\t\t$success = file_put_contents($filepath, $file_data);\n\t\t\n if($success)\n {\n\t\t\tlog_message('debug', 'Assets: Cache file '.$filename.' was written to '.$this->cache_path);\n\t\t\treturn TRUE;\n }\n else\n {\n\t\t\tlog_message('error', 'Assets: There was an error writing cache file '.$filename.' to '.$this->cache_path);\n\t\t\treturn FALSE;\n }\n\t}", "private function save_cache() : bool {\n\t\tif ($this->use_cache) {\n\t\t\tif (!$this->cache_path) {\n\t\t\t\tthrow new Exception('Cannot save cache when $cache_path is not set.');\n\t\t\t}\n\n\t\t\tfile_put_contents($this->cache_path, json_encode($this->posts, JSON_UNESCAPED_UNICODE));\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function save ( $data, $key ){\n echo \"No cache\";\n $this->clear($key);\n $data_str = serialize( array( \"mtime\" => time(), \"body\" => $data ) );\n $len = strlen($data_str);\n $shm_id = shmop_open(ftok('.',$key), \"c\", 0644, $len);\n if (!$shm_id) return false;\n $shm_bytes_written = shmop_write($shm_id, $data_str, 0);\n if ($shm_bytes_written != $len) return false;\n }", "public static function internal_cache_save()\n {\n if (! is_array(self::$write_cache)) {\n return false;\n }\n\n // Get internal cache names\n $caches = array_keys(self::$write_cache);\n\n // Nothing written\n $written = false;\n\n foreach ($caches as $cache) {\n if (isset(self::$internal_cache[$cache])) {\n // Write the cache file\n self::cache_save($cache, self::$internal_cache[$cache], self::$configuration['core']['internal_cache']);\n\n // A cache has been written\n $written = true;\n }\n }\n\n return $written;\n }", "public function save(CacheItemInterface $item): bool;", "public function cacheSave($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 8)\n\t{\n\t\tif (null === self::getCache()) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn self::getCache()->save($data, $id, $tags, $specificLifetime, $priority);\n\t}", "public function store($name, $data) {\n\t\t\t$ret = false;\n\t\t\t$hash = md5($name);\n\t\t\t$file = sprintf(\"{$this->cache_dir}/{$hash}\");\n\t\t\tif ( is_object($data) || is_array($data) ) {\n\t\t\t\t$data = call_user_func($this->serializer, $data);\n\t\t\t}\n\t\t\tif ($data) {\n\t\t\t\t$ret = file_put_contents($file, $data) !== false;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}", "public static function save($data): bool\n {\n $storage_data = serialize($data);\n file_put_contents(self::$path.self::$filename, $storage_data);\n return true;\n }", "public function save(string $id, $data, int $ttl = null, bool $raw = false) : bool\n\t{\n\t\t$this->cache[$id] = $data;\n\n\t\treturn true;\n\t}", "public function save($id, $data, $lifetime = 3600)\n {\n $dir = $this->getDirectory($id);\n if (!is_dir($dir)) {\n if (!mkdir($dir, 0755, true)) {\n return false;\n }\n }\n $file_name = $this->getFileName($id);\n $lifetime = ($lifetime > 0) ? (time() + $lifetime) : 0;\n $serialized = serialize($data);\n $result = static::atomic_file_put_contents($file_name, $lifetime . PHP_EOL . $serialized);\n if ($result === false) {\n return false;\n }\n return true;\n }", "function save($data, $key)\n {\n return $this->cache->save($data, $key, $this->group);\n }", "public function save(CacheItem $item): bool;", "function save() {\r\n\t\t$this->log .= \"save() called<br />\";\r\n\t\tif (count($this->data) < 1) {\r\n\t\t\t$this->log .= \"Nothing to save.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//create file pointer\r\n\t\tif (!$fp=@fopen($this->filename,\"w\")) {\r\n\t\t\t$this->log .= \"Could not create or open \".$this->filename.\"<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//write to file\r\n\t\tif (!@fwrite($fp,serialize($this->data))) {\r\n\t\t\t$this->log .= \"Could not write to \".$this->filename.\"<br />\";\r\n\t\t\tfclose($fp);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//close file pointer\r\n\t\tfclose($fp);\r\n\t\treturn true;\r\n\t}", "public function save($id, $data, $lifeTime = 0)\n\t{\n\t\t$prefix_id = $this->id_prefix . $id;\n\n\t\t$date = null;\n\t\tif ($lifeTime) {\n\t\t\t$date = date('Y-m-d H:i:s', time()+$lifeTime);\n\t\t}\n\n\t\tif (!is_scalar($data)) {\n\t\t\t$data = serialize($data);\n\t\t}\n\n\t\ttry {\n\t\t\t$this->db->executeUpdate(\"\n\t\t\t\tREPLACE INTO cache SET id = ?, data = ?, date_expire = ?\n\t\t\t\", array($prefix_id, $data, $date));\n\t\t} catch (\\Exception $e) {\n\t\t\tif (!$this->silence_exceptions) {\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\n\t\t$this->loaded[$prefix_id] = $data;\n\n\t\treturn true;\n\t}", "public static function cache_save($name, $data, $lifetime)\n {\n if ($lifetime < 1) {\n return false;\n }\n\n $path = self::$internal_cache_path.'kohana_'.$name;\n\n if ($data === null) {\n // Delete cache\n return (is_file($path) and unlink($path));\n } else {\n // Using encryption? Encrypt the data when we write it\n if (self::$internal_cache_encrypt===true) {\n // Encrypt and write data to cache file\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);\n $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);\n\n // Serialize and encrypt!\n $encrypted_text = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, self::$internal_cache_key, serialize($data), MCRYPT_MODE_ECB, $iv);\n\n return (bool) file_put_contents($path, $encrypted_text);\n } else {\n // Write data to cache file\n return (bool) file_put_contents($path, serialize($data));\n }\n }\n }", "public function write($id, $data) {\r\n if ($data != self::getDataAtSessionStart()) {\r\n\r\n // Update APC cache (and expiration date)\r\n apc_store($id, $data, self::getLifeTime());\r\n\r\n // Relies on parent write\r\n parent::write($id, $data);\r\n }\r\n\r\n return true;\r\n }", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "public function save()\n {\n $this->setData(array(\n 'modified' => time(),\n 'modifiedReadable' => Zend_Date::now()->get(Zend_Date::ISO_8601)\n ));\n \n $unmappedData = $this->getBean()->asDeepArray(true);\n if(key_exists('_id', $unmappedData)) {\n unset($unmappedData['_id']);\n }\n\n if (!($id = $this->_save($unmappedData, $this->getId()))) {\n return false;\n }\n\n $this->_setId($id);\n \n return true;\n }", "protected function saveToCache() {}", "public function saveCache($data) {\n\t\t$data = serialize($data);\n\t\ttry {\n\t\t\t$old = umask(0);\n\t\t\tumask(0);\n\t\t\tfile_put_contents($this->path, $data);\n\t\t\tchmod($this->path, 0755);\n\t\t\tumask($old);\n\t\t} catch (Exception $e) {\n\t\t\tutils::log('Err on saving data to file \"' . $this->path . '\": ' . $e->getMessage(), \"cache-err\");\n\t\t}\n\t}", "public function saveFromCache($ID, $Destination)\n {\n /* Get the raw picture from the cache */\n $Picture = $this->getFromCache($ID);\n\n /* Do we have a hit? */\n if ($Picture == null) {\n return false;\n }\n\n /* Flush the picture to a file */\n $Handle = fopen($Destination, \"w\");\n fwrite($Handle, $Picture);\n fclose($Handle);\n\n /* All went fine */\n return true;\n }", "public function save() {\t\t\t\t\n\t\tif (file_put_contents($this->filename, $this->objects)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function create_cache($file_name, $content) {\n \n if (!file_put_contents($file_name, $content)) {\n return true;\n } else {\n return false;\n }\n \n }", "function save() {\n $this->log .= \"save() called<br />\";\n if (count($this->data) < 1) {\n $this->log .= \"Nothing to save.<br />\";\n return false;\n }\n //create file pointer\n $this->log .= \"Save file name: \".$this->filename.\"<br />\";\n if (!$fp=@fopen($this->filename,\"w\")) {\n $this->log .= \"Could not create or open \".$this->filename.\"<br />\";\n return false;\n }\n //write to file\n if (!@fwrite($fp,serialize($this->data))) {\n $this->log .= \"Could not write to \".$this->filename.\"<br />\";\n fclose($fp);\n return false;\n }\n //close file pointer\n fclose($fp);\n return true;\n }", "public function set($key, $data) {\n $this->ensure_path_exists();\n $filename = $key.'.cache';\n $file = $this->file_path_for_key($key, true);\n $result = $this->write_file($file, $this->prep_data_before_save($data));\n if (!$result) {\n // Couldn't write the file.\n return false;\n }\n // Record the key if required.\n if ($this->prescan) {\n $this->keys[$filename] = cache::now() + 1;\n }\n // Return true.. it all worked **miracles**.\n return true;\n }", "protected function doSet($id, $data, $ttl = Cache::TTL_NO_EXPIRY)\n {\n if ($ttl > 0) {\n $ttl = time() + $ttl;\n }\n\n $fileName = $this->getFilename($id);\n $filePath = pathinfo($fileName, PATHINFO_DIRNAME);\n\n if (!is_dir($filePath)) {\n mkdir($filePath, 0777, true);\n }\n\n $cacheEntry = array(\n 'ttl' => $ttl,\n 'data' => $data\n );\n\n return file_put_contents($fileName, serialize($cacheEntry));\n }", "public function save ($key, $data) {\n return $this->cache->set($key, $data);\n }", "function write_cache(&$var, $filename) {\n $filename = DIR_FS_CACHE . $filename;\n $success = false;\n\n// try to open the file\n if ($fp = @fopen($filename, 'w')) {\n// obtain a file lock to stop corruptions occuring\n flock($fp, 2); // LOCK_EX\n// write serialized data\n fputs($fp, serialize($var));\n// release the file lock\n flock($fp, 3); // LOCK_UN\n fclose($fp);\n $success = true;\n }\n\n return $success;\n }", "public static function save_cache() {\n if (self::$_cache_invalid) {\n if (@file_put_contents(self::$_path_cache_file\n , serialize(self::$_abs_file_paths))) {\n error_log('failed to write absolute file path cache to: ' . self::$_path_cache_file);\n }\n }\n }", "abstract public function save($cacheLabel, $cacheData, $expire = null);", "function writeCacheObject ($contents)\n {\n $fp = fopen ($this->cacheObjectId, 'w');\n if ($fp != FALSE) {\n if (fputs ($fp, $contents)) {\n fclose($fp);\n $return = TRUE;\n } else {\n $return = FALSE;\n }\n } else {\n $return = FALSE;\n }\n\n return $return;\n }", "public function saveData($content, $dataId)\n {\n return Mage::app()->getCache()->save(\n $content,\n $this->_getCacheId($dataId),\n array(Mage_Core_Block_Abstract::CACHE_GROUP),\n 86400\n );\n }", "public function save($data): bool\n {\n return (bool) file_put_contents($this->path, json_encode($data, JSON_PRETTY_PRINT));\n }", "public function save()\n {\n if(!$this->canSave())\n return false;\n\n try\n {\n if ($this->id == null) //new object\n {\n $stmt = $this->connection->prepare(\"insert into \" . self::$table_name . \"(ticketID, filename) values(?, ?)\");\n $stmt->execute([$this->ticket->id, $this->filename]);\n $this->id = $this->connection->lastInsertId();\n }\n else //updating is not possible\n {\n return false;\n }\n\n return true;\n }\n catch (\\PDOException $e)\n {\n print_r($e->errorInfo);\n return false;\n }\n }", "public function set($id, $data, $lifetime = 3600)\n {\n $dir = $this->getDirectory($id);\n if (!is_dir($dir)) {\n if (!mkdir($dir, 0755, true)) {\n return false;\n }\n }\n $file_name = $this->getFileName($id);\n $lifetime = time() + $lifetime;\n $serialized = serialize($data);\n $result = file_put_contents($file_name, $lifetime . PHP_EOL . $serialized);\n if ($result === false) {\n return false;\n }\n return true;\n }", "function store($data, $id, $group = null)\n {\n // Get the default group\n $group = ($group) ? $group : $this->_options['defaultgroup'];\n\n // Get the storage handler and store the cached data\n $handler = $this->_getStorage();\n if ($handler != null && $this->_options['caching']) {\n return $handler->store($id, $group, $data);\n }\n return false;\n }", "protected function _saveCache($data, $cacheId, $tags = array())\n {\n return $this->_getCache()->save($data, $cacheId, $tags);\n }", "public function WriteCache($siteId, $content)\n\t{\n\t\t$name = $this->cacheBaseDir . '/ebaydetails_' . $siteId . '.xml';\n\n\t\tif (!is_dir($this->cacheBaseDir)) {\n\t\t\tif (!isc_mkdir($this->cacheBaseDir)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (!$this->fileHandler->CheckDirWritable($this->cacheBaseDir)) {\n\t\t\tisc_chmod($this->cacheBaseDir, ISC_WRITEABLE_DIR_PERM);\n\t\t}\n\n\t\t// Create a file if it's not exist\n\t\tif (!is_file($name)) {\n\t\t\ttouch($name);\n\t\t}\n\t\treturn $this->fileHandler->WriteToFile($content, $name);\n\t}", "public function save($id, $data)\n\t{\n\t\t$this->cache->load($id);\n\t\t$this->cache->save( serialize($data) );\n\t}", "public function testSave()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 50, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n }", "public function writeCache($sCacheData = false) {\n\t\tif(isset($sCacheData) && strlen($sCacheData) > 0) {\n\t\t\tif(file_put_contents($this -> sCacheDir . $this -> sCacheFile, $sCacheData)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private function store( $name, $data ){\n if( is_string($data) ){\n $ext = '.js';\n }\n else {\n $ext = '.dat';\n $data = serialize($data);\n }\n $path = $this->base.'/'.$name.$ext;\n $bytes = file_put_contents( $path, $data, LOCK_EX );\n return $bytes === strlen($data);\n }", "public function save() {\r\n if(isset($this->id)) {\r\n // Really just to update the caption\r\n $this->update();\r\n } else {\r\n // Make sure there are no errors\r\n if(!empty($this->errors)) { return FALSE; }\r\n\r\n // Can't save without filename and temp location\r\n if(empty($this->passport_path) || empty($this->temp_path)) {\r\n $this->errors[] = \"The file location was not available.\";\r\n return FALSE;\r\n }\r\n\r\n // Determine the target_path\r\n $target_path = SITE_ROOT.DS.'public'.DS.$this->upload_dir.DS.$this->passport_path;\r\n\r\n // Make sure a file doesn't already exist in the target location\r\n if(file_exists($target_path)) {\r\n $this->errors[] = \"The file {$this->passport_path} already exists.\";\r\n return FALSE;\r\n }\r\n\r\n // Attempt to move the file\r\n if(move_uploaded_file($this->temp_path, $target_path)) {\r\n // Success\r\n // Save a corresponding entry to the database\r\n if($this->create()){\r\n // We are done with temp_path, the file isn't there anymore\r\n unset($this->temp_path);\r\n return TRUE;\r\n }\r\n } else {\r\n // File was not saved.\r\n $this->errors[] = \"The file upload failed, possible due to incorrect permissions on the upload folder.\";\r\n return FALSE;\r\n }\r\n\r\n }\r\n\r\n }", "public function write($id, $data)\n\t{\n\t\ttry\n\t\t{\n\t\t\tif($this->table()->where('id', '=', $id)->count() != 0)\n\t\t\t{\n\t\t\t\treturn (bool) $this->table()->where('id', '=', $id)->update(array('data' => $data, 'expires' => (time() + $this->maxLifetime)));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->table()->insert(array('id' => $id, 'data' => $data, 'expires' => (time() + $this->maxLifetime)));\n\t\t\t}\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function save() {\n\n\t\tif ( $this->exists ) {\n\t\t\t// update changed fields\n\t\t\t$changed_data = array_intersect_key( $this->data, array_flip( $this->changed_fields ) );\n\n\t\t\t// serialize\n\t\t\t$changed_data = array_map( 'maybe_serialize', $changed_data );\n\n\t\t\tif ( empty( $changed_data ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$queue_id = $this->get_id();\n\n\t\t\t$updated = $this->update( $queue_id, $changed_data );\n\n\t\t\tif ( false === $updated ) {\n\t\t\t\t// Return here to prevent cache updates on error\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tdo_action( 'ig_es_object_update', $this ); // cleans object cache\n\t\t} else {\n\t\t\t$this->set_created_at( new DateTime() );\n\t\t\t$this->data = array_map( 'maybe_serialize', $this->data );\n\t\t\t\n\t\t\t// insert row\n\t\t\t$queue_id = $this->insert( $this->data );\n\n\t\t\tif ( $queue_id ) {\n\t\t\t\t$this->exists = true;\n\t\t\t\t$this->id = $queue_id;\n\t\t\t} else {\n\n\t\t\t\tES()->logger->error( sprintf( __( 'Could not insert into \\'%1$s\\' table. \\'%1$s\\' may not be present in the database.', 'email-subscribers' ), $this->table_name ), $this->logger_context );\n\n\t\t\t\t// Return here to prevent cache updates on error\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// reset changed data\n\t\t// important to reset after cache hooks\n\t\t$this->changed_fields = [];\n\t\t$this->original_data = $this->data;\n\n\t\treturn true;\n\t}", "protected function save() {\n $values = $this->values;\n\n $values[self::METADATA_NAMESPACE] = array(\n 'first_trace' => $this->getFirstTrace(),\n 'last_trace' => $this->getLastTrace(),\n 'regeneration_trace' => $this->getRegenerationTrace(),\n 'requests_count' => $this->getRequestsCounter(),\n 'fingerprint' => $this->getFingerprint(),\n );\n\n return $this->getStorage()->store($this->getId(), $values);\n }", "public function save(): bool\n {\n if ($this->operation === self::OP_CREATE) {\n $dir = dirname($this->path);\n if (!is_dir($dir)) {\n if ($this->newDirMode !== self::DIR_MODE) {\n $mask = @umask(0);\n $result = @mkdir($dir, $this->newDirMode, true);\n @umask($mask);\n } else {\n $result = @mkdir($dir, 0777, true);\n }\n if (!$result) {\n throw new RuntimeException(\"Unable to create the directory '$dir'.\");\n }\n }\n }\n if (@file_put_contents($this->path, $this->content) === false) {\n throw new RuntimeException(\"Unable to write the file '{$this->path}'.\");\n }\n\n if ($this->newFileMode !== self::FILE_MODE) {\n $mask = @umask(0);\n @chmod($this->path, $this->newFileMode);\n @umask($mask);\n }\n\n return true;\n }", "public static function save($area, $name, $value, $context = null)\r\n {\r\n if (!RuntimeConfiguration::$cache)\r\n {\r\n return false;\r\n }\r\n\r\n try\r\n {\r\n $cacheDir = self::getCacheDir($area);\r\n $cacheFileName = self::getCacheFileName($name, $context);\r\n $cachePath = $cacheDir . $cacheFileName;\r\n\r\n if ($value instanceof ICacheable)\r\n {\r\n $cache = $value->getCache();\r\n }\r\n else\r\n {\r\n $cache = serialize($value);\r\n }\r\n\r\n static $permissionCode = 0774;\r\n\r\n $oldmask = umask(0); // Avoid readonly folder\r\n\r\n // Create folder if not exists\r\n if (!file_exists($cacheDir))\r\n {\r\n mkdir($cacheDir, $permissionCode, true);\r\n chmod($cacheDir, $permissionCode);\r\n }\r\n\r\n // Create file\r\n file_put_contents($cachePath, $cache);\r\n chmod($cachePath, $permissionCode);\r\n\r\n umask($oldmask); // Restore default configuration\r\n\r\n return true;\r\n }\r\n catch (Exception $ex)\r\n {\r\n return false;\r\n }\r\n }", "function cache($type, $parameters, $data)\n{\n if($type == 'browse')\n $filename = CACHE.'/browse.'.$parameters['browsenode'].'.'.$parameters['page'].'.'.$parameters['mode'].'.dat';\n if($type == 'search')\n $filename = CACHE.'/search.'.$parameters['search'].'.'.$parameters['page'].'.'.$parameters['mode'].'.dat';\n if($type == 'asin')\n $filename = CACHE.'/asin.'.$parameters['asin'].'.'.$parameters['mode'].'.dat';\n \n $data = serialize($data);\n \n $fp = fopen($filename, 'wb');\n if(!$fp||(fwrite($fp, $data)==-1))\n {\n echo ('<p>Error, could not store cache file');\n }\n fclose($fp);\n}", "public function write(string $id, string $data): bool\n {\n if (!$id) {\n return false;\n }\n\n /** @var string $pkField */\n $pkField = $this->_table->getPrimaryKey();\n $session = $this->_table->newEntity([\n $pkField => $id,\n 'data' => $data,\n 'expires' => time() + $this->_timeout,\n ], ['accessibleFields' => [$pkField => true]]);\n\n return (bool)$this->_table->save($session);\n }", "function InPlaceCache_writeCache(/* $hash, */ $path, &$data)\r\n{\r\n//\t$path = InPlaceCache_checkCache($hash);\r\n\t\r\n\tif($path[0] === false)\r\n\t{\r\n\t\tif(!is_dir($path[3]))\r\n\t\t\tmkdir($path[3]);\r\n\t\tif(!is_dir($path[2]))\r\n\t\t\tmkdir($path[2]);\r\n\t}\r\n\r\n\tfile_put_contents($path[1], serialize(&$data));\r\n}", "function _cache_put ($cache_name = \"\", $data = null) {\n\t\tif (is_null($data)) {\n\t\t\t$data = [];\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\t$this->_put_cache_file($data, $cache_file_path, $data);\n\t}", "public function save($data, $id, $tags = array(), $specificLifetime = false)\n {\n $result = parent::save($data, $id, array(), $specificLifetime);\n if ($tags) {\n if (!method_exists($this->_handle, 'tag_add')) {\n \\Zend_Cache::throwException('Method tag_add() is not supported by the PHP memcached extension!');\n }\n foreach ($tags as $tag) {\n $this->_handle->tag_add($tag, $id);\n }\n return true;\n }\n return $result;\n }", "public function write($id, $data)\n {\n $file = (string) $this->path . '/' . $id;\n\n $result = file_put_contents($file, $data);\n\n return $result !== false;\n }", "public function save() \n\t{\n\t\tif (is_null ( $this->getDataFile () )) \n\t\t{\n\t\t\tthrow new Exception ( 'Data File is not set' );\n\t\t}\n\t\t\n\t\tif (!is_dir(dirname($this->getDataFile())))\n\t\t{\n\t\t\tthrow new Exception('Directory holding data file does not exist');\n\t\t}\n\t\t\n\t\tif (!$handle = fopen($this->getDataFile(), 'w')) \n\t\t{\n\t\t\tthrow new Exception('Cannot open file');\n\t\t}\n\t\t\n\t\t// Write $somecontent to our opened file.\n\t\tif (fwrite($handle, $this) === FALSE) \n\t\t{\n\t\t\tthrow new Exception('Cannot write to file');\n\t\t}\n\t\t\n\t\tfclose($handle);\n\t\t\n\t\treturn true;\n\t}", "public function write($id, $data)\n {\n return file_put_contents(\"{$this->savePath}/sess_$id\", $data) === false ? false : true;\n }", "function elgg_filepath_cache_save($type, $data) {\n\tglobal $CONFIG;\n\n\tif ($CONFIG->viewpath_cache_enabled) {\n\t\t$cache = elgg_get_filepath_cache();\n\t\treturn $cache->save($type, $data);\n\t}\n\n\treturn false;\n}", "public function saveData($datas){\n\t\t// large input data.\n\t\t$writeStream = file_put_contents($this->getCacheFile(), serialize($datas));\n\n\t\tif($writeStream === false) {\n\t\t\tthrow new \\Exception('Cannot write the cache... Do you have the right permissions ?');\n\t\t}\n\n\t\treturn $this;\n\t}", "public function save(){\n\t\t\tif(isset($this->id)){\n\t\t\t\t$this->update();\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//checking for errors\n\t\t\t\t//Can't save if there are pre=existing errors.\n\t\t\t\tif(!empty($this->errors)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//Can't save without filename and temp location on server.\n\t\t\t\tif(empty($this->filename) || empty($this->temp_path)){\n\t\t\t\t\t$this->errors[]=\"The file location is not available!\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//Determine the target path\n\t\t\t\t$upload_dir=\"images\";\n\t\t\t\t$target_path=\"../../public/\".$upload_dir.\"/\".$this->filename;\n\t\t\t\t//$target_path=$this->filename;\n\t\t\t\tif(file_exists($target_path)){\n\t\t\t\t\t$this->errors[]=\"The file {$this->filename} already exists!\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t//Attempt to move the file.\n\t\t\t\tif(move_uploaded_file($this->temp_path, $target_path)){\n\t\t\t\t\t//success\n\t\t\t\t\t//save corresponding entry into database.\n\t\t\t\t\tif($this->create()){\n\t\t\t\t\t\t//we are done with temp_path.\n\t\t\t\t\t\tunset($this->temp_path);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t//file not moved.\n\t\t\t\t\t\t$this->error[]=\"file can't be uploaded because of some denied permissions.\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function set($key, $data, $ttl = 0) {\n $expire = time() + $ttl;\n $this->logger->debug('Setting cache data for key [' . $key . '], '\n . 'time to live [' . $ttl . '], '\n . 'expire at [' . date('Y-m-d H:i:s', $expire) . ']');\n $filePath = $this->getFilePath($key);\n $handle = fopen($filePath, 'w');\n if (!is_resource($handle)) {\n $this->logger->error('Can not open the file cache '\n . '[' . $filePath . '] for the key [' . $key . '], return false');\n return false;\n }\n flock($handle, LOCK_EX); // exclusive lock, will get released when the file is closed\n //Serializing along with the TTL\n $cacheData = serialize(array(\n 'mtime' => time(),\n 'expire' => $expire,\n 'data' => $data,\n 'ttl' => $ttl\n ));\t\n if ($this->compressCacheData) {\n $cacheData = gzdeflate($cacheData, 9);\n }\t \n $result = fwrite($handle, $cacheData);\n if (!$result) {\n $this->logger->error('Can not write cache data into file [' . $filePath . '] '\n . 'for the key [' . $key . '], return false');\n fclose($handle);\n return false;\n } \n $this->logger->info('Cache data saved into file [' . $filePath . '] for the key [' . $key . ']');\n fclose($handle);\n chmod($filePath, 0640);\n return true;\n }", "public function setCache($new_data) {\n\t\tif (file_exists(dirname($this->cache_file))) {\n\t\t\tif (is_writeable(dirname($this->cache_file))) {\n\t\t\t\tif (file_put_contents($this->cache_file, $new_data)) {\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdie('Can\\'t write cache file, please check the cache directory permissions. Is it writeable by this script?');\n\t\t\t}\n\t\t} else {\n\t\t\tdie('DEAD');\n\t\t\techo 'HERE';\n\t\t\t// first create the cache\n\t\t\t$this->createCacheDirectory();\n\t\t\t// then fill the cache\n\t\t\t$this->setCache($new_data);\n\t\t}\n\t}", "public function save($data = null) {\n\t\tif (!is_null($data)) {\n\t\t\t$this->set($data);\n\t\t}\n\n\t\t$sw = $this->exists();\n\n\t\tif ($this->errors = $this->before_save(!$sw)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// there's nothing to save:\n\t\tif (!count($this->new_data)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// execute appropriate save operation:\n\t\tif (isset($this->new_data['id'])) unset($this->new_data['id']);\n\t\t$ret = ($sw ? $this->_update() : $this->_create());\n\t\t\n\t\tif ($ret && ($this->errors = $this->after_save(!$sw))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "public static function store($_name,$_data) {\n\t\tif (is_null(self::$l1cache) && !self::prep())\n\t\t\treturn FALSE;\n\t\t$_key=$_SERVER['SERVER_NAME'].'.'.$_name;\n\t\t// Serialize data for storage\n\t\t$_time=time();\n\t\t// Add timestamp\n\t\t$_val=serialize(array($_time,$_data));\n\t\t// Instruct back-end to store data\n\t\tswitch (self::$l1cache['type']) {\n\t\t\tcase 'folder':\n\t\t\t\t$_ok=file_put_contents(\n\t\t\t\t\tself::$l1cache['id'].$_key,$_val,LOCK_EX\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'apc':\n\t\t\t\t$_ok=apc_store($_key,$_val);\n\t\t\t\tbreak;\n\t\t\tcase 'memcache':\n\t\t\t\t$_ok=memcache_set(self::$l1cache['id'],$_key,$_val);\n\t\t\t\tbreak;\n\t\t\tcase 'xcache':\n\t\t\t\t$_ok=xcache_set($_key,$_val);\n\t\t\t\tbreak;\n\t\t}\n\t\tif (is_bool($_ok) && !$_ok) {\n\t\t\tF3::$global['CONTEXT']=$_name;\n\t\t\ttrigger_error(self::TEXT_Store);\n\t\t\treturn FALSE;\n\t\t}\n\t\tself::$l1cache['current']=array(\n\t\t\t'name'=>$_name,'data'=>$_data,'time'=>$_time\n\t\t);\n\t\treturn TRUE;\n\t}", "public function save()\r\n {\r\n $module = Yii::$app->controller->module;\r\n if ($this->operation === self::OP_OVERWRITE) {\r\n $dir = dirname($this->path);\r\n if (!is_dir($dir)) {\r\n $mask = @umask(0);\r\n $result = @mkdir($dir, $module->newDirMode, true);\r\n @umask($mask);\r\n if (!$result) {\r\n return \"Unable to create the directory '$dir'.\";\r\n }\r\n }\r\n }\r\n if (@file_put_contents($this->path, $this->content) === false) {\r\n return \"Unable to write the file '{$this->path}'.\";\r\n }\r\n\r\n return true;\r\n }", "function save()\n {\n $save = false;\n if ( $this->lastActivity === NULL )\n return false;\n foreach ( $this->dataInterfaces as $data )\n {\n if ( $data->save() )\n $save = true;\n }\n return $save;\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function store($data, $id, $group = null)\n\t{\n\t\t// Get the default group\n\t\t$group = ($group) ? $group : $this->_options['defaultgroup'];\n\n\t\t// Get the storage and store the cached data\n\t\t$handler = $this->_getStorage();\n\t\tif (!($handler instanceof Exception) && $this->_options['caching'])\n\t\t{\n\t\t\t$handler->_lifetime = $this->_options['lifetime'];\n\t\t\treturn $handler->store($id, $group, $data);\n\t\t}\n\t\treturn false;\n\t}", "public function save($key, $data, $ttl=0)\n\t{\n\n\t\t$success = $this->_cache->set($key, $data, $ttl);\n\t\treturn $success;\n\n\t}", "protected function saveDataFile($fileName, $data){\n //without complaining so be careful because it's a lazy writer\n //it will also create files if they don't exist\n if(file_put_contents($fileName, $data)){\n return true;\n }else{\n return false;\n }\n \n }", "public function store($key = '', $data = '', $ttl = 0)\n\t{\n\t\tif (!empty($key))\n\t\t{\n\t\t\tif ($ttl > 0)\n\t\t\t{\n\t\t\t\t$this->ttl = $ttl;\n\t\t\t}\n\t\t\tif (empty($data))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$filename = $this->getfilename($key);\n\t\t\tif (isset($data) AND is_array($data))\n\t\t\t{\n\t\t\t\t$data = serialize($data);\n\t\t\t}\n\t\t\t//file_put_contents($filename, $data, LOCK_EX);\n\t\t\tfile_put_contents($filename, $data);\n\t\t\ttouch($filename);\n\t\t}\n\t\treturn false;\n\t}", "function save() {\n $id = (int)$this->getId();\n $fields = array();\n foreach ($this->_data as $col => &$value) {\n if (($value->flags & DATAFLAG_CHANGED)) // only save/update values that have been changed\n {\n $fields[] = new ColVal($col, $value->dataType, $value->value);\n }\n }\n if (sizeof($fields) == 0) {\n if ($id == 0) {\n return false;\n }\n return true;\n }\n\n if ($id != 0) {\n // update\n if (!App::getDBO()->update($this->getTableName(), $fields, \"id=$id\")) {\n return false;\n }\n } else {\n // save new (insert)\n if ($id = App::getDBO()->insert($this->getTableName(), $fields)) {\n $this->_data['id']->value = $id;\n $this->_data['id']->flags = DATAFLAG_LOADED;\n } else {\n return false;\n }\n }\n\n // if we got here, the save was successful\n\n foreach ($this->_data as $col => &$value) {\n if (($value->flags & DATAFLAG_CHANGED)) // we just saved/updated values that were changed\n {\n $value->flags &= ~DATAFLAG_CHANGED;\n } // remove changed flag\n }\n\n return true;\n }", "abstract protected function _doSave($id, $data, $lifeTime = false);", "function write_cache($filename, $code)\n\t{\n\t\t// check if cache is writable\n\t\tif(!$this->cache_writable)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// check if filename is valid\n\t\tif(substr($filename, 0, strlen($this->cachedir)) !== $this->cachedir)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// try to open file\n\t\t$file = @fopen($filename, 'w');\n\t\tif(!$file)\n\t\t{\n\t\t\t// try to create directories\n\t\t\t$dir = substr($filename, strlen($this->cachedir), strlen($filename));\n\t\t\t$dirs = explode('/', $dir);\n\t\t\t$path = $this->cachedir;\n\t\t\t@umask(0);\n\t\t\tif(!@is_dir($path))\n\t\t\t{\n\t\t\t\tif(!@mkdir($path))\n\t\t\t\t{\n\t\t\t\t\t$this->cache_writable = 0;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t@chmod($path, 0777);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$count = sizeof($dirs);\n\t\t\tif($count > 0)\n\t\t\tfor($i = 0; $i < ($count - 1); $i++)\n\t\t\t{\n\t\t\t\tif($i > 0)\n\t\t\t\t{\n\t\t\t\t\t$path .= '/';\n\t\t\t\t}\n\t\t\t\t$path .= $dirs[$i];\n\t\t\t\tif(!@is_dir($path))\n\t\t\t\t{\n\t\t\t\t\tif(!@mkdir($path))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->cache_writable = 0;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t@chmod($path, 0777);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// try to open file again after directories were created\n\t\t\t$file = @fopen($filename, 'w');\n\t\t}\n\t\tif(!$file)\n\t\t{\n\t\t\t$this->cache_writable = 0;\n\t\t\treturn false;\n\t\t}\n\n\t\t$data = '<' . '?php' . \"\\n\\n// eXtreme Styles mod cache. Generated on \" . gmdate('r') . \" (time = \" . time() . \")\\n\\n\" . \"if (!defined('IN_ICYPHOENIX')) exit;\\n\\n\" . '?' . '>' . $code;\n\n\t\t@flock($file, LOCK_EX);\n\t\t@fwrite ($file, $data);\n\t\t@flock($file, LOCK_UN);\n\t\t@fclose($file);\n\t\t@chmod($filename, 0777);\n\t\treturn true;\n\t}", "public function save()\n\t{\n\t\t//we should do any cleanup if possible\n\t\tif ($this->isDirty())\n\t\t\t$this->clean();\n\t\n\t\t//save it to wherever\n\t\t$data = $this->saveData();\n\n\t\t//bust our cache.\n\t\tif ($this->useObjectCaching)\n\t\t\t$this->deleteCache();\n\t\t\n\t\treturn $data;\n\t}", "protected function _saveStatusToCache()\n {\n try {\n $this->_cache->save( json_encode($this->_status), 'jirafe_analytics_installer', array('jirafe_analytics_installer'), null);\n return true;\n } catch (Exception $e) {\n Mage::helper('jirafe_analytics')->log('ERROR', 'Jirafe_Analytics_Model_Installer::_saveStatusToCache()', $e->getMessage(), $e);\n return false;\n }\n }", "protected function saveToPackageCache() {}", "public function save()\n {\n return file_put_contents($this->getFilepath(), $this->read());\n }", "public function store($key, $data, $lifetime = 0)\n {\n $file_path = $this->getFilePath($key);\n $dir = \\dirname($file_path);\n\n if (!is_dir($dir)) {\n try {\n \\mkdir($dir, 0777, true);\n } catch (Exception $e) {\n throw new \\Exception('Could create cache directory: ' . $file_path . \" - \" . $e->getMessage());\n }\n }\n\n try {\n $fh = \\fopen($file_path, 'a+');\n } catch (\\Exception $e) {\n throw new \\Exception('Could not write to cache: ' . $file_path . \" - \" . $e->getMessage());\n }\n\n //exclusive lock\n \\flock($fh, LOCK_EX);\n\n \\fseek($fh, 0);\n\n \\ftruncate($fh, 0);\n\n if ($lifetime != 0) {\n $lifetime = time() + $lifetime;\n }\n\n $data = \\serialize(array($lifetime, $data));\n\n if (\\fwrite($fh, $data) === false) {\n throw new \\Exception('Could not write to cache: ' . $file_path);\n }\n\n \\fclose($fh);\n\n if ($key != $this->catalog_key) {\n $this->catalogKeyAdd($key, $lifetime);\n }\n return true;\n }", "private function read()\n\t{\n\t\t$fp = @fopen($this->filename, 'r');\n\t\tif ($fp === false) return false;\n\t\t$stats = fstat($fp);\n\t\tfclose($fp);\n\n\t\t$buf = file_get_contents($this->filename);\n\t\t$obj = unserialize($buf);\n\n\t\tif\n\t\t(\n\t\t\t! is_null($obj->expires)\n\t\t\t&& time() - $stats['atime'] > $obj->expires * 60\n\t\t)\n\t\t{\n\t\t\t# delete the session data file\n\t\t\tunlink($this->filename);\n\n\t\t\t$this->mkNew();\n\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# old \"expires\" value SHOULD NOT be used\n\t\t\t$this->id\t\t\t= $obj->id;\n\t\t\t$this->name\t\t\t= $obj->name;\n\t\t\t$this->comment\t\t= $obj->comment;\n\t\t\t$this->domain\t\t= $obj->domain;\n\t\t\t$this->maxage\t\t= $obj->maxage;\n\t\t\t$this->path\t\t\t= $obj->path;\n\t\t\t$this->secure\t\t= $obj->secure;\n\n\t\t\t$this->cachectrl\t= $obj->cachectrl;\n\n\t\t\t$this->autosave\t\t= $obj->autosave;\n\t\t\t$this->filename\t\t= $obj->filename;\n\n\t\t\t$this->data = $obj->data;\n\n\t\t\treturn true;\n\t\t}\n\t}", "public function save()\n\t{\n\t\treturn file_put_contents(self::filepath($this->name), $this->content);\n\t}", "public function save(CacheItemInterface $item)\n {\n return true;\n }", "public function write($id, $data){\n\n $sess_id = $this->sess_id_prefix.$id;\n\n\n // create if row / document not exist\n if($this->docExist === false)\n {\n \n\n $insertResult = $this->coll->insertOne( array('sess_id' => $sess_id, 'data' => $data, 'expireAt' => $this->expireAt ) );\n\n return ( $insertResult->getInsertedCount() == 1 );\n\n \n }\n else\n {\n\n $updateResult = $this->coll->updateOne( \n array('sess_id' => $sess_id), \n \n array('$set' => array('data' => $data, 'expireAt'=> $this->expireAt) ) \n\n );\n\n return ( $updateResult->getMatchedCount() == 1 );\n \n }\n }", "public function save($name, $data) {\n\t\t$str = serialize($data);\n\t\t$filename = $this->cache_dir.DIRECTORY_SEPARATOR.$name.'-'.strtotime('now').'.frc';\n\t\t// Get existing files to be deleted\n\t\t$existingFiles = $this->getFilesByName($name);\n\t\tif ( $existingFiles ) \n\t\t\tforeach ($existingFiles as $eFile ) unlink($eFile);\n\t\t\n\t\tfile_put_contents($filename, $str);\n\t}", "protected function _write($var, $data, $ttl = 2592000)\n\t{\n\t\tif (!$this->memcached->replace($this->key_prefix . $var, $data, $ttl))\n\t\t{\n\t\t\treturn $this->memcached->set($this->key_prefix . $var, $data, $ttl);\n\t\t}\n\t\treturn true;\n\t}", "public function save(string $path, $filename = null): bool {\n $filename = $filename ?: $this->getName();\n\n return file_put_contents($path.$filename, $this->getContent()) !== false;\n }", "public function write($id = NULL, $data = '') \n\t{\n\t\t/*\n\t\t * Case 2: We check to see if the session already exists. If it does\n\t\t * then we need to update it. If not, then we create a new entry.\n\t\t */\n// if($this->session_id && $this->session_id != $id)\n//\t\t{\n//\t \t$this->_conn->query(\"UPDATE {$this->table_name} SET data = '{$data}' WHERE {$this->primary_key} = '{$id}'\");\n//\t\t}\n//\t\telse\n//\t\t{\n//\t\t\t$this->_conn->query(\"INSERT INTO {$this->table_name}({$this->primary_key},data) VALUES('{$id}','{$data}')\");\n//\t\t}\n// return TRUE;\n\n\t\t$time = date('Y-m-d H:i:s', time());\n\t\t$this->_conn->query(\"REPLACE `{$this->table_name}` (`{$this->primary_key}`,`last_activity`,`data`) VALUES('{$id}','{$time}','{$data}')\");\n return TRUE;\n\t}", "public function update($id, $data) {\n\t\t$file = $this->init['path']['data'] . $id . $this->init['data']['ext'];\n\t\t// If the file doesn't exist\n\t\tif (!file_exists($file)) {\n\t\t\t// Ooops, the file didn't exist\n\t\t\treturn false;\n\t\t} else {\n\t\t\t// Replace the existing contents with the data\n\t\t\treturn file_put_contents($file, $data);\n\t\t}\n\t}", "function _put_cache_file ($data = [], $cache_file = \"\") {\n\t\tif (empty($cache_file)) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->USE_MEMCACHED) {\n// TODO\n//\t\t\t$cache_key = basename($cache_file);\n//\t\t\t$this->MC_OBJ->put($cache_key, $data, $this->CACHE_TTL);\n\t\t// Common (files-based) cache code\n\t\t} else {\n\t\t\tforeach ((array)$data as $k => $v) {\n\t\t\t\t$file_text .= \"\\t'\".$this->_put_safe_slashes($k).\"' => \";\n\t\t\t\t$file_text .= is_array($v) ? $this->_create_array_code($v) : \"'\".$this->_put_safe_slashes($v).\"',\";\n\t\t\t\t$file_text .= \"\\r\\n\";\n\t\t\t}\n\t\t\tfile_put_contents($cache_file, $this->_auto_header. \"\\$data = array(\\r\\n\".$file_text.\");\". $this->_auto_footer);\n\t\t}\n\t}", "public function save() {\r\n $dateNow = date('Y-m-d H:i:s', time());\r\n $this->id = (int) $this->id;\r\n \r\n if (!empty($this->id)) {\r\n //update case\r\n if ($this->_update()) {\r\n return true;\r\n }\r\n }\r\n else {\r\n //Insert case\r\n if ($this->_insert()) {\r\n return true;\r\n }\r\n }\r\n }" ]
[ "0.71868056", "0.7137549", "0.6970445", "0.696513", "0.6947165", "0.687277", "0.6760302", "0.66594326", "0.66177636", "0.65944284", "0.6548331", "0.65441805", "0.6462965", "0.6459722", "0.6451877", "0.641449", "0.64091235", "0.6366744", "0.6353055", "0.63118786", "0.63017464", "0.629827", "0.6295564", "0.6269304", "0.62687635", "0.6256909", "0.62470835", "0.624532", "0.623748", "0.6233291", "0.6222888", "0.62050354", "0.6196261", "0.61898965", "0.6183303", "0.61720484", "0.6164204", "0.6161017", "0.6155246", "0.6106368", "0.6090822", "0.6088174", "0.60836434", "0.60768294", "0.6071927", "0.60712683", "0.606571", "0.6064624", "0.60634387", "0.6063344", "0.6028768", "0.5992752", "0.59778804", "0.5971105", "0.5931054", "0.5903684", "0.58928365", "0.58895326", "0.5878646", "0.586882", "0.58561885", "0.58537114", "0.58530027", "0.5848575", "0.5845736", "0.58422637", "0.5841274", "0.5834867", "0.5818063", "0.58119804", "0.5805536", "0.58009344", "0.5795329", "0.57816845", "0.57774323", "0.57747227", "0.5771055", "0.57630455", "0.57604617", "0.5755199", "0.5754876", "0.57276094", "0.57231504", "0.57119524", "0.5689317", "0.56718785", "0.56627643", "0.5641078", "0.56346124", "0.56281906", "0.56214535", "0.5618007", "0.56080145", "0.55914265", "0.55906534", "0.5582819", "0.5581844", "0.5576229", "0.55758804", "0.55652016" ]
0.6611174
9
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Display a listing of the resource.
public function index() { $Project = Project::paginate(); return ProjectResource::collection($Project); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function listing() {\r\n\r\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446377", "0.7361922", "0.72984487", "0.7248631", "0.7162871", "0.7148215", "0.7131838", "0.71028054", "0.7102395", "0.70988023", "0.7048243", "0.6993516", "0.6989079", "0.69341344", "0.69001913", "0.6899167", "0.68920904", "0.6887188", "0.68661547", "0.6849159", "0.683002", "0.6801792", "0.6796645", "0.67952746", "0.678579", "0.6760132", "0.6741144", "0.67304057", "0.6726034", "0.6723304", "0.6723304", "0.6723304", "0.67188966", "0.67061126", "0.67046595", "0.67042124", "0.6664004", "0.6663109", "0.66603667", "0.66595376", "0.6656908", "0.66536283", "0.6648508", "0.6619696", "0.66191936", "0.66145146", "0.66056865", "0.6600895", "0.66007215", "0.6593214", "0.6587006", "0.6585572", "0.6584028", "0.65802413", "0.65751636", "0.6574276", "0.6572553", "0.65703243", "0.6569474", "0.6563628", "0.6563418", "0.65516967", "0.655156", "0.65460885", "0.65367365", "0.6533626", "0.6533064", "0.6527408", "0.65251255", "0.6524834", "0.65202224", "0.6517302", "0.65167385", "0.6516062", "0.65148616", "0.6506742", "0.65018", "0.6501768", "0.6494415", "0.64921784", "0.6486631", "0.6485237", "0.6484199", "0.64841217", "0.6479556", "0.6478558", "0.6469807", "0.646858", "0.64683306", "0.6466808", "0.64637285", "0.64616066", "0.6458575", "0.6457558", "0.64535207", "0.64534074", "0.64524984", "0.64491946", "0.6448726", "0.6447211", "0.64461327" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7173978", "0.71492267", "0.71434265", "0.7143343", "0.71356934", "0.7127626", "0.7122704", "0.71151215", "0.71151215", "0.71151215", "0.711137", "0.7093674", "0.708441", "0.70805633", "0.7079313", "0.70560336", "0.70560336", "0.705535", "0.7038748", "0.7038717", "0.70355713", "0.7033314", "0.70298624", "0.70262384", "0.7025372", "0.70192045", "0.7017566", "0.70037806", "0.70029014", "0.69999987", "0.6995955", "0.6994461", "0.69932437", "0.698907", "0.6985915", "0.69654584", "0.69652516", "0.6956021", "0.6951258", "0.6950627", "0.69471824", "0.69432425", "0.6941303", "0.69406337", "0.6937103", "0.6937103", "0.69363457", "0.6934366", "0.6931313", "0.6927307", "0.6926027", "0.6922591", "0.69176334", "0.69158953", "0.6911744", "0.6910005", "0.6909594", "0.6907657", "0.6902698", "0.6900764", "0.69007087", "0.6900391", "0.68942374", "0.68933", "0.68929493", "0.68912417", "0.68912417", "0.68911326", "0.6888626", "0.6887399", "0.68857414", "0.6884495", "0.6881287", "0.6878567", "0.6875623", "0.687334", "0.68722713", "0.6870009", "0.68697596", "0.6869062", "0.6868769" ]
0.0
-1