query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Get the working group id base on the user and the event
|
function getWGId($idUser, $idEvent){
$connexion = openDBConnexion();
$request = $connexion->prepare('
SELECT WorkingGroups_has_Events.workinggroups_idWorkingGroups FROM bdd_satisfevent.WorkingGroups_has_Events
INNER JOIN users_has_workinggroups ON users_has_workinggroups.workinggroups_idWorkingGroups = workinggroups_has_events.workinggroups_idWorkingGroups
WHERE users_idUsers = ?
AND events_idEvents = ?');
$request->execute(array($idUser, $idEvent));
$result = $request->fetchAll();
return $result[0]['workinggroups_idWorkingGroups'];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getGroupId()\n {\n return $this->baseEvent->getGroupId();\n }",
"function getEventByWorkingGroup($idWG)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT Events_idEvents FROM bdd_satisfevent.workinggroups_has_events WHERE Workinggroups_idWorkinggroups = ?');\n $request->execute(array($idWG));\n $result = $request->fetchAll();\n return $result[0];\n}",
"private function getGroupID(){\n\n\t global $db;\n\t \n\t #set to 0, guest has no group setup.\n\t\tif($this->user == \"guest\"){\n\t\t $getGID = 0;\n\t\t return($getGID);\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT gid FROM ebb_group_users WHERE Username='\".$this->user.\"' AND Status='Active' LIMIT 1\";\n\t\t\t$getGID = $db->fetchResults();\n\n\t\t\treturn($getGID['gid']);\n\t\t}\n\t}",
"function getUserGroupId() {\n\t\treturn $this->getData('userGroupId');\n\t}",
"function getUserWorkinggroups($user, $event)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n SELECT * FROM users_has_workinggroups\n INNER JOIN workinggroups_has_events on workinggroups_has_events.workinggroups_idworkinggroups = users_has_workinggroups.workinggroups_idworkinggroups\n\t\tINNER JOIN workinggroups on workinggroups.idWorkingGroups = users_has_workinggroups.WorkingGroups_idWorkingGroups \n WHERE users_has_workinggroups.users_idusers = ?\n AND workinggroups_has_events.Events_idEvents = ?'\n );\n $request->execute(array($user, $event));\n $result = $request->fetchAll();\n return $result;\n}",
"public function getGroupId() {\n\t\treturn $this->Session->read('UserAuth.User.user_group_id');\n\t}",
"public function getUsergroup() {}",
"public function getGroupid()\n {\n return $this->groupid;\n }",
"private function getUserGroup(): int {\n return $this->core->getUser()->getGroup();\n }",
"function group_id($group_id=null)\n {\n if (isset($group_id)) {\n $this->group_id = intval($group_id);\n }\n return $this->group_id;\n }",
"public function getGroupId() {\n\t\tif(is_null($this->task)) {\n\t\t\t$this->task = Task::model()->findByPk($this->taskId);\n\t\t}\n\t\treturn $this->task->groupId;\n\t}",
"private function getGroupID()\n {\n if (App::auth()->loggedIn() === false)\n {\n return -1;\n }\n \n return (int) App::auth()->user()->groupID;\n }",
"function getGroup() {\n\n\tglobal $db;\n\treturn $db->getGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"function event_id() \n {\n $list = explode( ':', $this->rule->rule_key);\n if ( count( $list) == 4 && $list[2] == 'event') return $list[3];\n return NULL;\n }",
"function getGroupId($group)\n {\n return '';\n }",
"public function id(): string\n {\n return $this->groupId;\n }",
"public function getGroupId()\n {\n return $this->group_id;\n }",
"public function getGroupId()\n {\n return $this->group_id;\n }",
"public function getGroupId()\n {\n return $this->__get(\"group_id\");\n }",
"private function grouping_group_assigned($event) {\n global $DB;\n $groupid = $event->other['groupid'];\n $members = groups_get_members($groupid, 'userid');\n $group = groups_get_group($groupid, 'courseid');\n $courseid = $group->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n\n $insertcalls = array();\n $deletecalls = array();\n\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n foreach ($members as $member) {\n $gmail = $this->get_google_authenticated_users_gmail($member->userid);\n if (has_capability('moodle/course:view', $coursecontext, $member->userid)) {\n // Manager; do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $member->userid)) {\n // Teacher (enrolled) (active); do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true)) {\n // Student (enrolled) (active); continue checks.\n if ($course->visible == 1) {\n // Course is visible, continue checks.\n rebuild_course_cache($courseid, true);\n $modinfo = get_fast_modinfo($courseid, $member->userid);\n $cminfo = $modinfo->get_cm($cmid);\n $sectionnumber = $this->get_cm_sectionnum($cmid);\n $secinfo = $modinfo->get_section_info($sectionnumber);\n if ($cminfo->uservisible && $secinfo->available && is_enrolled($coursecontext, $member->userid, '', true)) {\n // Course module and section are visible and available.\n // Insert reader permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'reader';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } else {\n // User cannot access course module; delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($gmail);\n $permission = $this->service->permissions->get($fileid, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n }\n }\n // Course is not visible; do nothing.\n }\n // User is not enrolled in course; do nothing.\n }\n }\n }\n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n\n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n }",
"function user_getgroup()\n\t{\n\t\t$id = $this->user_getid();\n\t\t$perms = $this->DB->database_select('users', 'gid', array('uid' => $id), 1);\n\t\treturn ($perms === false) ? false : $perms['gid'];\n\t}",
"public function getGroupId() {\n return $this->groups[0]->getId();\n }",
"public function getgroupId()\n {\n return $this->group_id;\n }",
"public function getGroupId(){\n return $this->groupId;\n }",
"public function getTaskGroup() {}",
"public function getGroupId()\n\t{\n\t\treturn $this->group_id;\n\t}",
"function get_cur_group() {\n\t\tif (!isset($_SESSION['dfl_group'])) {\n\t\t\t// return comma-separated list of default groups from database\n\t\t\tlgi_mysql_fetch_session(\"SELECT GROUP_CONCAT(`name`) AS `dfl_group` FROM %t(usergroups) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' AND p.`dfl`=TRUE\", $this->userid);\n\t\t\t// maybe there were no groups defined and it is not specified in the certificate; then use username\n\t\t\t// TODO this will work only if usercerts.fixedgroups if TRUE, but I'm too lame to check that right now\n\t\t\tif (!isset($_SESSION['dfl_group']))\n\t\t\t\t$_SESSION['dfl_group'] = $this->userid;\n\t\t}\n\t\treturn $_SESSION['dfl_group'];\n\t}",
"function testGetGroupEventByUserId()\n {\n $groups = $this->GroupEvent->getGroupEventByUserId(5, 1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), array(1));\n\n //Test valid user not in group\n $groups = $this->GroupEvent->getGroupEventByUserId(8, 1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), null);\n\n //Test invalid user\n $groups = $this->GroupEvent->getGroupEventByUserId(999, 1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), null);\n\n //Test invalid event\n $groups = $this->GroupEvent->getGroupEventByUserId(3, 999);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), null);\n }",
"function wrmp_get_settingsgroup()\n{\n\tstatic $wrmp_settings_gid;\n\n\t// if we have already stored the value\n\tif(isset($wrmp_settings_gid))\n\t{\n\t\t// don't waste a query\n\t\t$gid = (int) $wrmp_settings_gid;\n\t}\n\telse\n\t{\n\t\tglobal $db;\n\n\t\t// otherwise we will have to query the db\n\t\t$query = $db->simple_select('settinggroups', 'gid', \"name='wrmp_settings'\");\n\t\t$gid = (int) $db->fetch_field($query, 'gid');\n\t}\n\treturn $gid;\n}",
"public function getIdGroup()\n {\n return $this->groupid;\n }"
] |
[
"0.652635",
"0.6381773",
"0.61937577",
"0.6164693",
"0.6144389",
"0.6006382",
"0.5998823",
"0.5975784",
"0.59653914",
"0.58733255",
"0.583411",
"0.5826008",
"0.5791973",
"0.57471985",
"0.57310975",
"0.569286",
"0.56752086",
"0.56752086",
"0.5636416",
"0.5630865",
"0.56105065",
"0.56035435",
"0.55948335",
"0.5586123",
"0.5583387",
"0.5580052",
"0.5577628",
"0.5551235",
"0.55389965",
"0.5522361"
] |
0.71097666
|
0
|
Returns INSERT statement for the configuration
|
private static function getInsertStatement(array $options) {
$keys = array();
$values = array();
foreach ($options as $k=>$v) {
$value = "'${v}'";
$key = $k;
if (substr($k, 0, 1) == '!') {
$key = substr($k, 1);
$value = $v;
}
$keys[] = $key;
$values[] = $value;
}
$keys = implode(', ', $keys);
$values = implode(', ', $values);
return "INSERT INTO ".TABLE_CONFIGURATION." (${keys}) VALUES (${values})";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getInsertSql()\n {\n $str1 = '';\n $str2 = '';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str1 .= ',';\n $str2 .= ',';\n }\n\n\n $str1 .= $k . \" \";\n $str2 .= $this->prepareForQuery($this->$k) . \" \";\n\n\n }\n }\n $str = 'INSERT INTO ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n $str = $str . $this->tblName . ' ( ';\n $str .= $str1;\n $str .= ') VALUES (';\n $str .= $str2;\n $str .= ');';\n return $str;\n }",
"public function insertSql(){\n\n $columnNames = implode(',', $this->params['columnNames']);\n $columnNamePdo = implode(',', $this->params['columnNamePdo']);\n $columnsValues = implode(',', $this->paramsValues);\n $sql = \"INSERT INTO {$this->table} ({$columnNames}) VALUES ({$columnNamePdo})\";\n \n return $sql;\n }",
"public function createInsertSql(): \\Hx\\Db\\Sql\\InsertInterface;",
"public function sql(): string\n {\n $columnsNames = array();\n $columnsValues = array();\n\n foreach ($this->parameters as $key => $val) {\n $arg = $this->getArgName($key);\n $columnsNames[] = $this->escape($key); \n $columnsValues[] = ':' . $arg;\n } \n return trim(sprintf(\n 'INSERT INTO %s (%s) VALUES (%s)',\n $this->escape($this->tableName),\n implode(', ', $columnsNames),\n implode(', ', $columnsValues)\n ));\n }",
"public function buildInsert()\n {\n $columns = array();\n $values = array();\n\n /* build sql arguments */\n\n if ( $this->driver->placeholder ) {\n foreach( $this->insert as $k => $v ) {\n if ( is_integer($k) )\n $k = $v;\n\n if ( is_array($v) ) {\n // just interpolate the raw value\n $columns[] = $this->driver->getQuoteColumn($k);\n $values[] = $v[0];\n } else {\n $columns[] = $this->driver->getQuoteColumn($k);\n $newK = $this->setPlaceHolderVar( $k , $v );\n $values[] = $this->driver->getPlaceHolder($newK);\n }\n }\n\n } else {\n foreach( $this->insert as $k => $v ) {\n if ( is_integer($k) ) {\n $k = $v;\n }\n $columns[] = $this->driver->getQuoteColumn( $k );\n $values[] = $this->driver->inflate($v);\n }\n }\n\n $sql = 'INSERT INTO ' . $this->getTableSql() \n . ' ( '\n . join(',',$columns) \n . ') VALUES (' \n . join(',', $values ) \n . ')';\n ;\n\n if ( $this->returning && ( 'pgsql' == $this->driver->type ) ) {\n $sql .= ' RETURNING ' . $this->driver->getQuoteColumn($this->returning);\n }\n\n if ( $this->driver->trim ) {\n return trim($sql);\n }\n return $sql;\n }",
"private function formatInsertCommand( )\n {\n $data_buffer_length = @ count( $this->data_buffer );\n if ( $data_buffer_length == 0 )\n return false;\n\n $sql = 'INSERT INTO ' . $this->table_name . ' ';\n $sql_columns = '(';\n $sql_values = ' VALUE(';\n $this->quote( );\n $i = 0;\n foreach ( $this->data_buffer as $k => $v )\n {\n $sql_columns .= $k;\n $sql_values .= $v;\n if ( ( $i + 1 ) < $data_buffer_length )\n {\n $sql_columns .= ',';\n $sql_values .= ',';\n }\n $i++;\n }\n $sql_columns .= ')';\n $sql_values .= ')';\n $sql .= $sql_columns . $sql_values;\n return $sql;\n }",
"public function get_insert()\n {\n $pairs = !empty($this->multiset) ? $this->multiset: array($this->set);\n\n $vals = array();\n $keys = null;\n foreach ($pairs as $row)\n {\n $keys = array_keys($row);\n $vals[] = join(', ', self::prepare($row));\n }\n $keys = join(', ', $keys);\n $vals = join('), (', $vals);\n $table = self::quote_name($this->table);\n return \"insert into $table ($keys) values ($vals)\";\n }",
"function getSQLInsert() {\n\t\n\t\t$action = $this->getAction();\n\t\t$module = $this->getModule();\n\t\t$section = $this->getSection();\n\t\t$access = $this->getAccess();\n\t\t$accessAffiliateUser = $this->getAccessAffiliateUser();\n\t\t$active = $this->getActive();\n\t\t$pair = $this->getPair();\n\t\n\t\t$query = \"INSERT INTO `security_action` (`action`,`module`,`section`,`access`,`accessAffiliateUser`, `active` , `pair` ) VALUES ('$action','$module','$section','$access','$accessAffiliateUser','$active','$pair');\";\n\t\treturn $query;\n\t\t\n\t}",
"protected function _sql_insert ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'INSERT INTO ';\n /*\n In which table ?\n */\n $sql .= $this->aTables[0] . ' ';\n /*\n Use fields names ?\n */\n $sql .= (empty($this->aFields)) ? '' : \"\\n(\" . implode(', ', $this->aFields) . ')';\n /*\n Insert values.\n */\n $sql .= \"\\nVALUES (\" . implode(\", \", $this->aValues) . \")\";\n /*\n Return SQL.\n */\n return $sql;\n }",
"protected function buildSQL(): string\n {\n $sql = 'INSERT' . PHP_EOL;\n\n $sql .= $this->buildTable();\n $sql .= $this->buildFields();\n $this->buildBindings();\n $sql .= $this->buildValues();\n $sql .= $this->buildValuesFromSelect();\n $sql .= $this->buildReturning();\n\n\n return $sql;\n }",
"protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}",
"public function getSQL()\n {\n if (empty($this->values)) {\n throw new \\LogicException('You need to add at least one set of values before generating the SQL.');\n }\n\n $platform = $this->connection->getDatabasePlatform();\n $columnList = '';\n\n if (! empty($this->columns)) {\n $columnList = sprintf(\n ' (%s)',\n implode(\n ', ',\n array_map(\n function ($column) use ($platform) {\n $column = new Identifier($column);\n\n return $column->getQuotedName($platform);\n },\n $this->columns\n )\n )\n );\n }\n\n return sprintf(\n 'INSERT INTO %s%s VALUES (%s)',\n $this->table->getQuotedName($platform),\n $columnList,\n implode(\n '), (',\n array_map(\n function (array $valueSet) {\n return implode(', ', $valueSet);\n },\n $this->values\n )\n )\n );\n }",
"public function get()\n {\n $values = (array) $this->parts['values'];\n\n $keys = ' (' . implode(', ', array_keys($values)) . ')';\n\n $values = ' VALUES (' . implode(', ', $values) . ')';\n\n return 'INSERT INTO ' . $this->table() . $keys . $values;\n }",
"function to_str() {\n $smt=\"INSERT \\n\"\n //\n //Get the root of the sql \n . \"INTO {$this->root->fromexp()}\\n\"\n //The values\n . \"{$this->str_values()}\\n\"\n //\n //The joins if any because some insert may have sqls as their root\n .\"{$this->joins->to_str()}\" \n \n \n ;\n //\n //Return the sql statement that inserts \n return $smt;\n }",
"private function _prepareTransactionInsertStatement()\n {\n $stmtName = '_insertTransactionStatement';\n\n $prefix = $this->_tablePrefix;\n $queryString = 'INSERT INTO `'.$prefix.'Transactions` ';\n $queryString .= '(`transactionID`, `createDate`, `modifyDate`)';\n $queryString .= 'VALUES';\n $queryString .= '(:transID, NOW(), NOW())';\n return $this->_prepareGenericStatement(\n $stmtName,\n $queryString\n );\n }",
"public function insert() : string\n {\n if (empty($this->newProperties)) {\n $this->fillProperties();\n }\n\n $params = [];\n $columns = [];\n\n foreach ($this->newProperties as $key => $value) {\n if ($key === 'id') {\n continue;\n }\n\n $params[\":{$key}\"] = $value;\n $columns[] = \"`{$key}`\";\n }\n\n $columns = implode(', ', $columns);\n $placeholders = implode(', ', array_keys($params));\n $tableName = static::getTableName();\n\n $sql = sprintf(\n \"INSERT INTO `%s` (%s) VALUES (%s)\",\n $tableName,\n $columns,\n $placeholders\n );\n\n $stmt = static::getConn()->prepare($sql);\n $stmt->execute($params);\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return static::getLastInsertId();\n }",
"public function insertSql()\n {\n $sql = \"INSERT INTO \" . $this->dbName . '.' . $this->table\n . \" (\" . implode($this->fields, \", \") . \")\n VALUES (:\" . implode($this->fields, \", :\") . \");\";\n\n $this->query = $sql;\n }",
"protected function prepareSaveStatement() {\n $fields = implode(',', $this->columns);\n\n $placeholders = [];\n foreach ($this->columns as $column) {\n $placeholders[] = ':' . $column;\n }\n $placeholders = implode(',', $placeholders);\n\n // Prepare our statement.\n return $this->connection->prepare(\"INSERT INTO {$this->table} ($fields) VALUES ($placeholders)\");\n }",
"public function getSql()\n {\n $columns = implode(\", \", $this->columns);\n\n $result = \"\";\n $result = \"CONSTRAINT $this->name \\n\\t\\tPRIMARY KEY ( \\n\\t\\t\\t$columns \\n\\t\\t)\";\n\n return $result;\n }",
"protected abstract function getInsertStatement(array $columnSets);",
"public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}",
"function db_get_insert_statement($mysqli, $keys, $values)\n{\n\t$query = '';\n\n\tforeach ($keys as $key) {\n\t\t$query_keys[] = '`' . $key['name'] . '`';\n\t}\n\t$query .= '(' . implode(',', $query_keys) . ')';\n\n\t$value_array = array();\n\tforeach ($values as $value) {\n\t\t$value_items = array();\n\t\tforeach ($keys as $key) {\n\t\t\tif (array_key_exists($key['name'], $value)) {\n\t\t\t\t$value_items[] = __db_escape_values($mysqli, $key['type'], $value[$key['name']]);\n\t\t\t} else {\n\t\t\t\t$value_items[] = 'DEFAULT';\n\t\t\t}\n\t\t}\n\t\t$value_array[] = '(' . implode(',', $value_items) . ')';\n\t}\n\t$query .= ' VALUES ' . implode(',', $value_array);\n\n\treturn $query;\n}",
"private function getSqlInsertStatement(array $hookDescriptions)\n {\n $valuesToInsert = [];\n foreach ($hookDescriptions as $hookDescription) {\n $valuesToInsert[] = sprintf(\n '(NULL,\"%s\",\"%s\",\"%s\",\"1\")',\n pSQL($hookDescription->getName()),\n pSQL($hookDescription->getTitle()),\n pSQL($hookDescription->getDescription())\n );\n }\n\n if (empty($valuesToInsert)) {\n return '';\n }\n\n return sprintf(\n 'INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`) VALUES %s;',\n implode(',', $valuesToInsert)\n );\n }",
"public function getCreateSql() {\n $sql = \"\";\n foreach ($this->tables as $tableName => $sqlTemplate) {\n $tmp = self::formatSql($sqlTemplate, $this->db->getTableSet());\n $sql .= (substr($tmp, -1) === ';') ? $tmp : $tmp . ';';\n } \n return $sql;\n }",
"public function testInsertSqlIsProperlyPrepared()\n {\n $batch_insert = $this->connection->batchInsert('writers', ['name', 'birthday']);\n\n $property = (new \\ReflectionClass(BatchInsert::class))->getProperty('sql_foundation');\n $property->setAccessible(true);\n\n $sql_foundation = $property->getValue($batch_insert);\n\n $this->assertEquals('INSERT INTO `writers` (`name`, `birthday`) VALUES ', $sql_foundation);\n }",
"public function compileInsert(Builder $builder, array $values): string \n {\n $table = $this->wrapTable($builder->from);\n\n if (empty($values)) {\n return \"insert into {$table} default values\";\n }\n\n if ( ! is_array(headItem($values))) {\n $values = [$values];\n }\n\n $columns = $this->columnize(array_keys(headItem($values)));\n\n $parameters = collect($values)->map(fn ($record) => '('.$this->parameterize($record).')')\n ->implode(', ');\n\n return \"insert into $table ($columns) values $parameters\";\n }",
"protected function _storePgtSql()\n\t{\n\t\treturn 'INSERT INTO ' . $this->getTable() . ' (pgt_iou, pgt) VALUES (:pgt_iou, :pgt)';\n\t}",
"public function addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\n }",
"public static function sqlInsert($params)\n\t{\t\n\t\tif(!$params) return \"\";\n\t $table = $params[\"table\"];\n\t\tunset($params[\"table\"]);\n\t\t$columns = array_keys($params);\n\t\t$columns = implode(\", \", $columns);\n\n\t \tforeach($params as $key => $param)\n\t\t\t$values[] = \"?\";\n\t\t$values = implode(\",\", $values);\n\t return \"INSERT INTO $table ($columns) VALUES ($values)\";\n\t}",
"final public function generateSQL()\n {\n return implode(self::STATEMENTS_DELIMITER, array_map(function ($part) {\n return current($part);\n }, $this->generateOrderedSQLParts()));\n }"
] |
[
"0.7297543",
"0.723196",
"0.69954044",
"0.6951405",
"0.6889822",
"0.68562096",
"0.68002415",
"0.6761208",
"0.67434525",
"0.66645634",
"0.6567215",
"0.6537455",
"0.6465932",
"0.6457262",
"0.64342535",
"0.642758",
"0.63511896",
"0.63438666",
"0.62071216",
"0.6191851",
"0.61589015",
"0.61401904",
"0.61057866",
"0.6098704",
"0.6067274",
"0.6046834",
"0.60349643",
"0.6007163",
"0.59702426",
"0.59636843"
] |
0.7452282
|
0
|
/ Function for displaying success msgs on the page
|
function displaySuccessMsg() {
if(isset($_SESSION['success'])) {
// Set up row in accordance with Bootstrap grid
/*echo '<div class="container"><div class="row"><div class="col-md-12">';*/
echo '<div class="row"><div class="col-md-12">';
foreach ($_SESSION['success'] as $success) {
echo '<p class="success">',$success,'</p>';
}
/*echo '</div></div></div>';*/
echo '</div></div>';
// Unset errors for page refresh
unset ($_SESSION['success']);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function displaySuccessMessage($index,$params = array()) {\n\t\tglobal $lang;\n\t\n\t\treturn '<div class=\"alert alert-success\">'.getLang('form_success_'.$index,$params).'</div>';\n\t}",
"function success($msg) {\n if ($msg) {\n echo \" <div class=\\\"success\\\">\" . $msg . \"</div>\\n\";\n } else {\n echo \" <div class=\\\"success\\\">\" . _('Something has been successfully performed. What exactly, however, will remain a mystery.') . \"</div>\\n\";\n }\n}",
"public function successMsg(){\n if(defined('PLUGIN_OPTIONS'))\n return $this->moduleSuccessMsg();\n return browser\\msg::pageNotFound();\n }",
"function formSuccess() {\n\n // Template\n $this->r->text['back_url'] = suxFunct::getPreviousURL();\n $this->r->title .= \" | {$this->r->gtext['success']}\";\n\n $this->tpl->display('success.tpl');\n\n }",
"public function get_success_message() {\r\n\t\treturn '';\r\n\t}",
"function ufclas_matlab_admin_notice_success(){\n\t$message = ufclas_matlab_get_success();\n\t?>\n <div class=\"notice notice-success\">\n <p><?php echo __( 'Import successful. View the imported page: ', 'ufclas-matlab' ) . $message; ?> </p>\n </div>\n <?php\n\t\n}",
"function success() {\n echo \"<br />\";\n \n echo \"Thank you for contacting us. We will be in touch with you very soon.\";\n \n echo \"<br />\";\n \n \n \n }",
"function _showStatus() {\r\n $okMessage = implode('<br />', $this->_okMessage);\r\n $errMessage = implode('<br />', $this->_errMessage);\r\n\r\n if (!empty($errMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_ERROR_MESSAGE', $errMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('errormsg');\r\n }\r\n\r\n if (!empty($okMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_OK_MESSAGE', $okMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('okmsg');\r\n }\r\n }",
"function successMsg($msg)\n{\n\treturn \"<div class=\\\"successMsg\\\">$msg</div>\";\n}",
"function successMsg($msg)\n{\n\treturn \"<div class=\\\"successMsg\\\">$msg</div>\";\n}",
"public function printSuccessMessage()\n {\n printf('Successfully checked %d lines in %d files :)'. PHP_EOL, $this->lines, $this->files);\n }",
"function getSuccessMessage()\r\n {\r\n if(isset($_SESSION['success_message']))\r\n {\r\n /**\r\n * This is for storing the session array\r\n * @var array\r\n */\r\n $success_message_array = $_SESSION['success_message'];\r\n\r\n /**\r\n * This is for creating the error message\r\n * @var string\r\n */\r\n $response = \"<table>\";\r\n\r\n foreach ($success_message_array as $array_key\t=>\t$array_value)\r\n {\r\n $response .= \"<tr><td class='success_message'>\".$array_value.\"</td></tr><tr><td class='success_message_seperator'></td></tr>\";\r\n }\r\n\r\n $response .= \"</table>\";\r\n\r\n unset ($_SESSION['success_message']);\r\n\r\n return $response;\r\n }\r\n }",
"public function actionSuccess()\n {\n return $this->render('success');\n }",
"function printSessionSuccessMessage(){\n\t\tif (!empty($_SESSION[\"successMessage\"])) {\n\t\t\techo(\"<div class=\\\"alert alert-success alert-dismissible fade show text-center\\\" role=\\\"alert\\\">\" \n\t\t\t\t. $_SESSION[\"successMessage\"] \n\t\t\t\t. \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\">×</span></button></div>\");\n\t\t}\n\t}",
"function outputResultMessage()\n {\n global $application;\n\n if (!is_array($this -> _Errors) && $this -> _Errors != 'Success')\n return '';\n\n $template_contents = array(\n 'ResultMessage' => (($this -> _Errors == 'Success')\n ? getMsg('CTL', 'CTL_PGE_MSG_SUCCESS')\n : getMsg('CTL', 'CTL_PGE_MSG_ERROR')),\n 'ResultMessageColor' => (($this -> _Errors == 'Success')\n ? 'green'\n : 'red')\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n return $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'result-message.tpl.html',\n array()\n );\n }",
"function success_page($msg, $redirect_to = \"\", $redirect_time = 0)\n{\n page_header($redirect_to, $redirect_time);\n echo ' <div class=\"success\">'.$msg.'</div>';\n page_footer();\n exit;\n}",
"public function actionSuccess()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\t\t\n\t\t$email = Yii::app()->request->getParam('email');\n\t\t$this->render('success', array('email'=>$email,'is_found'=>true));\n\t}",
"public function show_success_message() {\n\t\tif ( $this->have_settings_been_saved() ) {\n\t\t\techo '<p class=\"wpseo-message\"><span class=\"dashicons dashicons-yes\"></span>',\n\t\t\t\tesc_html__( 'Settings saved.', 'wordpress-seo' ),\n\t\t\t\t'</p>';\n\t\t}\n\t}",
"public function form_success()\n {\n \tif ($this->session->has_userdata('success_message')) \n \t{\n \t\t# code...\n \t\t$this->data = array_merge($this->data, array(\n \t\t\t'msg'\t\t=> $this->session->userdata('success_message')['msg'],\n \t\t\t'msg2'\t\t=> $this->session->userdata('success_message')['msg2'],\n \t\t\t're_link'\t=> $this->session->userdata('success_message')['re_link'],\n \t\t\t'msg3'\t\t=> $this->session->userdata('success_message')['msg3'],\n \t\t\t're_link2'\t=> $this->session->userdata('success_message')['re_link2'] \n\t\t\t));\n\n \t\tif ($this->session->userdata('success_message')['type'] == 'participants') \n \t\t{\n \t\t\t# code...\n \t\t\t$this->data['output'] = $this->Model_return->return_participants($this->session->userdata('success_message')['id']);\n \t\t}\n \t\telseif ($this->session->userdata('success_message')['type'] == 'event') \n \t\t{\n \t\t\t# code...\n \t\t\t$this->data['output'] = $this->Model_return->return_event($this->session->userdata('success_message')['id']);\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$this->data['output'] = NULL;\n \t\t}\n \t\t$this->render($this->set_views->form_success());\n \t}\n \telse\n \t{\n \t\tredirect('/Form');\n \t}\n }",
"public function callbackSuccess()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the callback method returned true.</i></p>\"); \n $this->redirectTo();\n }",
"function show_message($msg=\"\"){\n\t\tswitch($msg){\n\t\t\tcase 'business_location_success':\n\t\t\t\t$msg=\"<div class='message success'>Thank You, Business Destination Updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'offer_update_success':\n\t\t\t\t$msg=\"<div class='message success'>Offer Updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'offer_add_success':\n\t\t\t\t$msg=\"<div class='message success'>Offer Added</div>\";\n\t\t\tbreak;\n\t\t\tcase 'booking_update_success':\n\t\t\t\t$msg=\"<div class='message success'>Booking Updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'room_update_success':\n\t\t\t\t$msg=\"<div class='message success'>Room Updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'room_add_success':\n\t\t\t\t$msg=\"<div class='message success'>Room Added</div>\";\n\t\t\tbreak;\n\t\t\tcase 'house_update_success':\n\t\t\t\t$msg=\"<div class='message success'>House Updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'house_add_success':\n\t\t\t\t$msg=\"<div class='message success'>House Added</div>\";\n\t\t\tbreak;\n\t\t\tcase 'package_update_success':\n\t\t\t\t$msg=\"<div class='message success'>Package Updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'package_add_success':\n\t\t\t\t$msg=\"<div class='message success'>Package Added</div>\";\n\t\t\tbreak;\n\t\t\tcase 'property_update_success':\n\t\t\t\t$msg=\"<div class='message success'>Property updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'property_insert_success':\n\t\t\t\t$msg=\"<div class='message success'>Property added to database</div>\";\n\t\t\tbreak;\n\t\t\tcase 'image_upload_success':\n\t\t\t\t$msg=\"<div class='message success'>Images uploaded</div>\";\n\t\t\tbreak;\n\t\t\tcase 'image_upload_success_partially':\n\t\t\t\t$msg=\"<div class='message success'>Images uploaded (some images skipped due to size limit)</div>\";\n\t\t\tbreak;\n\t\t\tcase 'image_upload_error':\n\t\t\t\t$msg=\"<div class='message error'>Error uploading images</div>\";\n\t\t\tbreak;\n\t\t\tcase 'image_upload_error_no_files_selected':\n\t\t\t\t$msg=\"<div class='message error'>No files selected</div>\";\n\t\t\tbreak;\n\t\t\tcase 'image_upload_error_no_user':\n\t\t\t\t$msg=\"<div class='message error'>Error locating property owner, please contact administrator</div>\";\n\t\t\tbreak;\n\t\t\tcase 'form_missing_fields':\n\t\t\t\t$msg=\"<div class='message error'>Error: please enter fields where required</div>\";\n\t\t\tbreak;\n\t\t\tcase 'set_rate_no_selection':\n\t\t\t\t$msg=\"<div class='message error'>Skipped action, nothing selected for update</div>\";\n\t\t\tbreak;\n\t\t\tcase 'set_rate_success':\n\t\t\t\t$msg=\"<div class='message success'>Rates updated</div>\";\n\t\t\tbreak;\n\t\t\tcase 'db_error':\n\t\t\t\t$msg=\"<div class='message error'>Database connection error, please contact administrator</div>\";\n\t\t\tbreak;\n\t\t\tcase 'access_denied':\n\t\t\t\t$msg=\"<div class='message error'>Sorry, you don't have permissions to view this page</div>\";\n\t\t\tbreak;\n\t\t}\n\t\t$this->set_html('system_message',$msg);\n\t\treturn $this;\n\t}",
"public function successMessage() { return $this->successMessage; }",
"function pms_display_success_messages( $messages = array(), $return = false ) {\r\n\r\n $output = '';\r\n\r\n if( !empty( $messages ) ) {\r\n $output = '<div class=\"pms_success-messages-wrapper\">';\r\n\r\n foreach( $messages as $message ) {\r\n $output .= '<p>' . $message . '</p>';\r\n }\r\n\r\n $output .= '</div>';\r\n }\r\n\r\n if( $return )\r\n return $output;\r\n else\r\n echo $output;\r\n\r\n }",
"public function successMsg($str_message,$jump_url=\"\"){\r\n\t\t$this->success($str_message,$jump_url);\r\n\t\texit;\r\n\t}",
"public function license_success_message() {\n\t\t$message = __( 'Your Block Lab license was successfully activated!', 'block-lab' );\n\t\treturn sprintf( '<div class=\"notice notice-success\"><p>%s</p></div>', esc_html( $message ) );\n\t}",
"public function notice_success( $itens = '' ) {\n\t\t$class = 'notice notice-success is-dismissible';\n\t\t$message = __( 'Sync completed successfully.', 'elemarjr' );\n\t\treturn sprintf( '<div class=\"%1$s\"><p>%2$s</p>%3$s</div>', esc_attr( $class ), esc_html( $message ), wp_kses_post( $itens ) );\n\t}",
"public function SuccessContent()\n {\n if ($object = $this->NewObject()) {\n $message = $this->Data()->SuccessMessage;\n return $this->editingMessageWithKeywords($object, $message);\n }\n }",
"public function success();",
"public function successAction()\r\n {\r\n View::renderTemplate('Signup/success.html');\r\n }",
"function alert(){\r\n\tglobal $errors, $success,$warning;\r\n\r\n\t if (isset($errors) && !empty($errors)){\r\n\t\t$allerror = \"<ul>\";\r\n\t\tforeach($errors as $value){\r\n\t\t\t$allerror .= \"<li>$value </li>\";\r\n\t\t}\r\n\t\t$allerror .= \"</ul>\";\r\n\r\n\t\techo '<br><div class=\"alert alert-danger alert-block\"><h4>Error!</h4>'.$allerror.'</div>';\r\n\r\n\t}\r\n\r\n\telse if (isset($success)){\r\n\t\techo '<div class=\"alert alert-success\"><strong>Success! </strong>'.$success.'</div>';\r\n\t\t}\r\n\r\n\telse if (isset($warning)){\r\n\t\techo '<div class=\"alert\"><strong>Warning! </strong>'.$warning.'</div>';\r\n\t}\r\n}"
] |
[
"0.7768924",
"0.7753875",
"0.7735741",
"0.75878567",
"0.7514757",
"0.750029",
"0.7392212",
"0.73364615",
"0.73083806",
"0.73083806",
"0.7304544",
"0.72780824",
"0.72702426",
"0.722043",
"0.7167448",
"0.7103742",
"0.70419693",
"0.7015826",
"0.7008529",
"0.6980826",
"0.6975675",
"0.6961377",
"0.6959888",
"0.6956346",
"0.6954502",
"0.69441366",
"0.6932099",
"0.6921513",
"0.68891543",
"0.6877589"
] |
0.7935905
|
0
|
Extract config items from HTML string.
|
public function extract($html): array
{
if (!$html instanceof Dom) {
$this->dom->loadStr($html);
}
$fields_data = [];
foreach ($this->config as $field_name => $field_config) {
$fields_data[$field_name] = $this->extractSelector($field_config, $this->dom);
}
return $fields_data;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}",
"public function parseStringForCmsElementInfo($string);",
"function parseHtml($s_str)\r\n{\r\n$i_indicatorL = 0;\r\n$i_indicatorR = 0;\r\n$s_tagOption = \"\";\r\n$i_arrayCounter = 0;\r\n$a_html = array();\r\n// Search for a tag in string\r\nwhile( is_int(($i_indicatorL=strpos($s_str,\"<\",$i_indicatorR))) ) {\r\n// Get everything into tag...\r\n$i_indicatorL++;\r\n$i_indicatorR = strpos($s_str,\">\", $i_indicatorL);\r\n$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );\r\n$a_tag = explode( ' ', $s_temp );\r\n// Here we get the tag's name\r\nlist( ,$s_tagName,, ) = each($a_tag);\r\n$s_tagName = strtoupper($s_tagName);\r\n// Well, I am not interesting in <br>, </font> or anything else like that...\r\n// So, this is false for tags without options.\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];\r\nif( $b_boolOptions ) {\r\n// Without this, we will mess up the array\r\n$i_arrayCounter = (int)count($a_html[$s_tagName]);\r\n// get the tag options, like src=\"htt://\". Here, s_tagTokOption is 'src'and s_tagTokValue is '\"http://\"'\r\n\r\ndo {\r\n$s_tagTokOption = strtoupper(strtok($s_tagOption[1], \"=\"));\r\n$s_tagTokValue = trim(strtok(\"=\"));\r\n$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =\r\n$s_tagTokValue;\r\n$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&\r\n$s_tagOption[1];\r\n} while( $b_boolOptions );\r\n}\r\n}\r\nreturn $a_html;\r\n}",
"protected function parse($html) {\n $this->crawler->addHtmlContent($html, 'UTF-8');\n return $this->crawler->filterXPath(\"//div[contains(@class,'sr_item')]\")\n ->each(function(Crawler $node, $i){\n return [\n 'hotelid' => $node->attr('data-hotelid'),\n 'score' => $node->attr('data-score'),\n 'name' => $node->filterXPath(\"//span[contains(@class,'sr-hotel__name')]\")->text(),\n 'location' => $node->filterXPath(\"//div[contains(@class,'address')]/a[contains(@class,'district_link')]\")->text(),\n // 'price' => $node->filterXPath(\"//table/tr/td[contains(@class,'roomPrice')]/div[contains(@class,'smart_price_style')]\")->text(),\n ];\n });\n }",
"public function parse($html);",
"public function parse($html);",
"public static function extract(string $html)\n {\n static::$classes = new Arr();\n static::load();\n static::$config = cache('monsoon') ?? Config::get();\n\n $classes = new Arr();\n $mediaqueries = new Arr();\n $screens = new Arr(static::$config['screens']);\n $pseudos = new Arr(static::$pseudos);\n $str = new Builder();\n\n foreach(explode('<', $html) as $tag)\n {\n if(!Str::startWith($tag, ['!', '/']) && $tag !== '' && Str::has($tag, 'class=\"'))\n {\n $break = Str::break($tag, 'class=\"');\n $split = explode(' ', Str::break($break[1], '\"')[0]);\n $css = new Arr();\n\n foreach($split as $util)\n {\n $negative = Str::startWith($util, '-');\n $util = Str::moveFromStart(Str::moveFromEnd($util, '!'), '-');\n $pseudo = Str::break($util, ':')[0];\n $mediaquery = false;\n\n if(Str::has($util, ':'))\n {\n $util = Str::break($util, ':')[1];\n\n if($pseudos->has($pseudo) || $screens->hasKey($pseudo))\n {\n if($screens->hasKey($pseudo))\n {\n $mediaquery = true;\n }\n }\n else\n {\n $pseudo = null;\n }\n }\n else\n {\n $pseudo = null;\n }\n\n if(static::$classes->hasKey($util))\n {\n if($mediaquery)\n {\n $key = $pseudo . '-' . $util;\n $css->push($key);\n\n if($mediaqueries->hasKey($pseudo))\n {\n $data = new Arr($mediaqueries->get($pseudo));\n $data->push(static::generate($key, $util, null, $negative));\n $mediaqueries->set($pseudo, $data->unique()->get());\n }\n else\n {\n $mediaqueries->set($pseudo, [static::generate($key, $util, null, $negative)]);\n }\n }\n else\n {\n $key = $util;\n\n if(!is_null($pseudo))\n {\n $key = $pseudo . '-' . $util;\n }\n\n $css->push($key);\n $cache = cache('util_' . $key);\n\n if(is_null($cache))\n {\n $cache = cache('util_' . $key, static::generate($key, $util, $pseudo, $negative));\n }\n\n $classes->set($key, $cache);\n }\n }\n else\n {\n $array = new Arr(explode('-', $util));\n $value = $array->last();\n $class = $array->pop()->implode('-');\n\n if(static::$classes->hasKey($class))\n {\n if($mediaquery)\n {\n $key = $pseudo . '-' . $util;\n $css->push($key);\n\n if($mediaqueries->hasKey($pseudo))\n {\n $data = new Arr($mediaqueries->get($pseudo));\n $data->push(static::generate($key, $class, null, $negative, $value));\n $mediaqueries->set($pseudo, $data->unique()->get());\n }\n else\n {\n $mediaqueries->set($pseudo, [static::generate($key, $class, null, $negative, $value)]);\n }\n }\n else\n {\n $key = $util;\n\n if(!is_null($pseudo))\n {\n $key = $pseudo . '-' . $util;\n }\n\n $css->push($key);\n $cache = cache('util_' . $key);\n \n if(is_null($cache))\n {\n $cache = cache('util_' . $key, static::generate($key, $class, $pseudo, $negative, $value));\n }\n\n $classes->set($util, $cache);\n }\n }\n else\n {\n $css->push($util);\n }\n }\n }\n\n $str->append('<' . $break[0]);\n $str->append('class=\"' . Str::moveFromBothEnds($css->implode(' '), ' ') . '\"');\n $str->append(Str::break($break[1], '\"')[1]);\n }\n else\n {\n $str->append('<' . $tag);\n }\n }\n\n foreach($mediaqueries->get() as $key => $item)\n {\n $media = new Builder('@media only screen and (max-width:' . $screens->get($key) . 'px){');\n\n foreach($item as $css)\n {\n $media->append($css);\n }\n\n $media->append('}');\n\n TemplateEngine::addStylesheet($key . '-utilities', $media->get());\n }\n\n if(!$classes->empty())\n {\n TemplateEngine::addStylesheet('monsoon-utilities', $classes->implode(PHP_EOL));\n }\n\n if($str->startWith('<<'))\n {\n $str->move(1);\n }\n \n return $str->get();\n }",
"function parseINI($str) {\n list(, $data) = preg_split('/^\\\\[Data\\\\]\\\\s*$/mu', $str, 2);\n preg_match_all('/^([^=]+)=(.*)$/mu', $data, $matches);\n return array_combine(array_map('trim', $matches[1]), array_map('trim', $matches[2]));\n}",
"function parse ($html) {\n // TODO fix by shijp : 临时方案\n if (is_array($html)) {\n return $html;\n }\n\n // If there are no HTML tags, ignore it\n if (false === strpos($html, '<'))\n return $html;\n if (! preg_match(\"/<(?=[a-zA-Z\\/])/\", $html))\n return $html;\n\n $this->clear();\n return parent::parse($html);\n }",
"function extract_attrib_2($html) {\n\tpreg_match_all('/<a[^>]*\\>/', $html, $matcha); //匹配img标签\n\tforeach ($matcha[0] as $k => $vala) {\n\t\tpreg_match_all('/(href)=(\"[^\"]*\")/i', $vala, $matchesa);\n\t\t$zh = substr(trim($matchesa[2][0], '\"'), -3);\n\t\t// dd($zh,in_array($zh, ['png','jpg','peg','gif','bmp','et/']));\n\t\tif (in_array($zh, ['png', 'jpg', 'peg', 'gif', 'bmp'])) {\n\t\t\t$vala2 = str_insert($vala, 3, ' class=\"gallery-item-hook\"');\n\t\t\t$html = str_replace($vala, $vala2, $html);\n\t\t}\n\t\t// dd($val,$k,$matches[2][0]);\n\t\t// dd($matches);\n\t}\n\tpreg_match_all('/<img[^>]*\\>/', $html, $match); //匹配img标签\n\t// dd($match);\n\tforeach ($match[0] as $k => $val) {\n\t\tpreg_match_all('/(id|alt|title|src)=(\"[^\"]*\")/i', $val, $matches);\n\t\t$html = str_replace($val, '<a href=' . $matches[2][0] . ' class=\"gallery-item-hook\">' . $val . '</a>', $html);\n\t\t// dd($val, $k, $matches[2][0]);\n\t\t// dd($matches);\n\t}\n\treturn ['html' => $html];\n}",
"function parseLinkAttrs($html)\n {\n $stripped = preg_replace($this->_removed_re,\n \"\",\n $html);\n\n $html_begin = $this->htmlBegin($stripped);\n $html_end = $this->htmlEnd($stripped);\n\n if ($html_begin === false) {\n return [];\n }\n\n if ($html_end === false) {\n $html_end = strlen($stripped);\n }\n\n $stripped = substr($stripped, $html_begin,\n $html_end - $html_begin);\n\n // Workaround to prevent PREG_BACKTRACK_LIMIT_ERROR:\n $old_btlimit = ini_set( 'pcre.backtrack_limit', -1 );\n\n // Try to find the <HEAD> tag.\n $head_re = $this->headFind();\n $head_match = [];\n if (!$this->match($head_re, $stripped, $head_match)) {\n ini_set( 'pcre.backtrack_limit', $old_btlimit );\n return [];\n }\n\n $link_data = [];\n $link_matches = [];\n\n if (!preg_match_all($this->_link_find, $head_match[0],\n $link_matches)) {\n ini_set( 'pcre.backtrack_limit', $old_btlimit );\n return [];\n }\n\n foreach ($link_matches[0] as $link) {\n $attr_matches = [];\n preg_match_all($this->_attr_find, $link, $attr_matches);\n $link_attrs = [];\n foreach ($attr_matches[0] as $index => $full_match) {\n $name = $attr_matches[1][$index];\n $value = $this->replaceEntities(\n $this->removeQuotes($attr_matches[2][$index]));\n\n $link_attrs[strtolower($name)] = $value;\n }\n $link_data[] = $link_attrs;\n }\n\n ini_set( 'pcre.backtrack_limit', $old_btlimit );\n return $link_data;\n }",
"function article_html() {\n return parse(Registry::prop('article', 'html'), false);\n}",
"function parse_list($html)\r\n {\r\n // demarcate the beginning and end of portion we want to work with\r\n $html_start = '<ul>';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n\r\n // scrape id and name of activity and put it into array\r\n preg_match_all('#(?P<id>\\d+)\">(?P<name>.*?)</a><br />#si', $html, $activities_all, PREG_SET_ORDER);\r\n \r\n // takes every activity and adds on info from activity specific site\r\n foreach ($activities_all as $activity)\r\n {\r\n $activity += parse_one($activity['id']);\r\n }\r\n \r\n /*\r\n // functionally the same as foreach loop. Useful if requests are timing out or if only a small portion need to be rescraped\r\n for ($i = 400; $i < 442; $i++)\r\n {\r\n $activities_all[$i] += parse_one($activities_all[$i]['id']);\r\n }\r\n */\r\n // makes array smaller by getting rid of entries under numerical index\r\n $activities_all = unset_numeric_keys_($activities_all);\r\n return $activities_all;\r\n }",
"public static function extractSettingValues($string)\n {\n $values = [];\n $errors = [];\n\n $list = \\explode(\"\\n\", $string);\n $list = \\array_map('trim', $list);\n $list = \\array_filter($list, 'strlen');\n\n foreach ($list as $position => $text) {\n // Check for an explicit key.\n $matches = [];\n if (\\preg_match('/(.*)=(.*)/', $text, $matches)) {\n // Trim key and value to avoid unwanted spaces issues.\n $key = \\trim($matches[1]);\n $value = \\trim($matches[2]);\n $values[$key] = $value;\n } else {\n $errors[] = $position;\n }\n }\n\n return [$values, $errors];\n }",
"function parse_categories($html)\r\n {\r\n // truncate the html string for easier processing\r\n $html_start = '<ul class=\"org-cats-2\">';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n \r\n // pull OSL category and the ID they assign to later add to tag table\r\n preg_match_all('#value=\"(\\d*?)\".*?>\\s*(.*?)\\s<#si', $html, $categories_all, PREG_SET_ORDER); \r\n foreach ($categories_all as $index => $tag)\r\n {\r\n $categories_all[$index][2] = substr($tag[2],0,-12);\r\n }\r\n return $categories_all; \r\n }",
"function variables_from_string($markup) {\r\n\t\t$regexp = new LiquidRegexp('/\\s*('.LIQUID_QUOTED_FRAGMENT.')\\s*/');\r\n\t\t$parts = explode(',', $markup);\r\n\t\t$result = array();\r\n\t\t\r\n\t\tforeach($parts as $part) {\r\n\t\t\t$regexp->match($part);\r\n\t\t\t\r\n\t\t\tif ($regexp->matches[1]) {\r\n\t\t\t\t$result[] = $regexp->matches[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t\t\r\n\t}",
"protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }",
"function parse() {\n\t\t$this->parse_zones($this->get_product_text());\n\n\t\t// STEP 2: Parse out VTEC\n\t\t$this->parse_vtec();\n\n\t\t// STEP 3: Relay readiness\n\t\t$this->properties['relay'] = true;\n\n\t\t// FINAL: Return the properties array\n\t\treturn $this->properties;\n\t}",
"public function parseHtml($html)\n {\n // So as a quick fix, we'll str_replace those ahead of time\n // and then keep the Xpath parser consistent.\n $html = str_replace(\n [\n '<td>Vendor:</td>',\n '<td>Reference Number:</td>',\n '<td>Contract Date:</td>',\n '<td>Description of Work:</td>',\n '<td>Contract Period :</td>',\n '<td>Contract Period:</td>',\n '<td>Delivery Date:</td>',\n '<td>Contract Value:</td>',\n '<td>Comments:</td>',\n // Fixes for eg.\n // https://www.statcan.gc.ca/eng/about/contract/2004/62700-04-0035\n '<th class=\"row-stub\" scope=\"row\">Nom du vendeur:</th>',\n '<th class=\"row-stub\" scope=\"row\">Numéro de référence :</th>',\n '<th class=\"row-stub\" scope=\"row\">Description of Work:</th>',\n ],\n [\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Contract Date:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Contract Period :</th>',\n '<th scope=\"row\">Delivery Date:</th>',\n '<th scope=\"row\">Contract Value:</th>',\n '<th scope=\"row\">Comments:</th>',\n // Replacements per above\n '<th scope=\"row\">Vendor:</th>',\n '<th scope=\"row\">Reference Number:</th>',\n '<th scope=\"row\">Description of Work:</th>',\n\n ],\n $html\n );\n\n $keyArray = [\n 'vendorName' => 'Vendor',\n 'referenceNumber' => 'Reference Number',\n 'contractDate' => 'Contract Date',\n 'description' => 'Description of work',\n 'extraDescription' => 'Detailed Description',\n 'contractPeriodStart' => '',\n 'contractPeriodEnd' => '',\n 'contractPeriodRange' => 'Contract Period',\n 'deliveryDate' => 'Delivery Date',\n 'originalValue' => 'Original Contract Value',\n 'contractValue' => 'Contract Value',\n 'comments' => 'Comments',\n ];\n\n return Parsers::extractContractDataViaGenericXpathParser($html, \"//table//th[@scope='row']\", \"//table//td\", ' to ', $keyArray);\n }",
"public function extract( array $allConfig ) {\n\t\t$pbConfig = [];\n\t\t$allWidgets = Obj::pathOr( [], [ 'wpml-config', $this->configRoot, 'widget' ], $allConfig );\n\n\t\tforeach ( $allWidgets as $widget ) {\n\t\t\t$widgetName = Obj::path( ['attr', 'name'], $widget );\n\n\t\t\t$pbConfig[ $widgetName ] = [\n\t\t\t\t'conditions' => $this->parseConditions( $widget, $widgetName ),\n\t\t\t\t'fields' => $this->parseFields( Obj::pathOr( [], ['fields', 'field'], $widget ) ),\n\t\t\t];\n\n\t\t\t$fieldsInItems = Obj::prop( 'fields-in-item', $widget );\n\n\t\t\tif ( $fieldsInItems ) {\n\t\t\t\t$pbConfig[ $widgetName ]['fields_in_item'] = [];\n\t\t\t\t$fieldsInItems = $this->normalize( $fieldsInItems );\n\n\t\t\t\tforeach ( $fieldsInItems as $fieldsInItem ) {\n\t\t\t\t\t$itemOf = Obj::path( [ 'attr', 'items_of' ], $fieldsInItem );\n\t\t\t\t\t$pbConfig[ $widgetName ]['fields_in_item'][ $itemOf ] = $this->parseFields( Obj::propOr( [], 'field', $fieldsInItem ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$integrationClasses = $this->parseIntegrationClasses( $widget );\n\n\t\t\tif ( $integrationClasses ) {\n\t\t\t\t$pbConfig[ $widgetName ]['integration-class'] = $integrationClasses;\n\t\t\t}\n\t\t}\n\n\t\treturn $pbConfig;\n\t}",
"function wp_kses_attr_parse($element)\n {\n }",
"public function parseString($htmlInput) {\n\t\t\treturn $this->markdownify->parseString($htmlInput);\n\t\t}",
"function _parseHtml($html)\n\t\t{\n\t\t\t$html=preg_replace(\"/<!DOCTYPE((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$html=preg_replace(\"/<script((.|\\n)*?)>((.|\\n)*?)<\\/script>/ims\",\"\",$html);\n\t\t\tpreg_match(\"/<head>((.|\\n)*?)<\\/head>/ims\",$html,$matches);\n\t\t\t$head=$matches[1];\n\t\t\tpreg_match(\"/<title>((.|\\n)*?)<\\/title>/ims\",$head,$matches);\n\t\t\t$this->title = $matches[1];\n\t\t\t$html=preg_replace(\"/<head>((.|\\n)*?)<\\/head>/ims\",\"\",$html);\n\t\t\t$head=preg_replace(\"/<title>((.|\\n)*?)<\\/title>/ims\",\"\",$head);\n\t\t\t$head=preg_replace(\"/<\\/?head>/ims\",\"\",$head);\n\t\t\t$html=preg_replace(\"/<\\/?body((.|\\n)*?)>/ims\",\"\",$html);\n\t\t\t$this->htmlHead=$head;\n\t\t\t$this->htmlBody=$html;\n\t\t\treturn;\n\t\t}",
"function parse_block_attributes( $attr_string ) {\n\t$attributes_matcher = '/([^\\s]+)=\"([^\"]+)\"\\s*/';\n\tpreg_match_all( $attributes_matcher, $attr_string, $matches );\n\t$attributes = array();\n\tforeach ( $matches[1] as $index => $attribute_match ) {\n\t\t$attributes[ $attribute_match ] = $matches[2][ $index ];\n\t}\n\n\treturn $attributes;\n}",
"public function parseItem ($html)\n {\n \t$images = [];\n\n /*\n transform http://a.ftcs.es/inmesp/anuncio/2015/04/03/135151707/253141017.jpg/w_0/c_690x518/p_1/\n to http://a.ftcs.es/inmesp/anuncio/2015/04/03/135151707/253141017.jpg\n */\n \tforeach ($json->multimedia as $img)\n {\n if ($img->type != 'image') {continue;}\n $src = $img->src;\n\n $path = explode(\".jpg\", $src);\n $images[] = $path[0] . \".jpg\";\n }\n\n $features = [];\n foreach ($json->features as $feature) {\n $features[$feature->key] = $feature->value;\n }\n\n $data = [\n 'title' => $json->buildingType . \"-\". $json->id,\n 'description' => $json->description,\n 'images' => $images,\n 'location' => $json->location,\n 'price' => (double)$json->price,\n 'meters' => (double)$features['surface'],\n 'url' => $this->domain . \"/es/\" . $json->detail->{'es-ES'}\n ];\n\n if ($features['rooms']) {\n $data['rooms'] = $features['rooms'];\n }\n\n \tif ($data[\"meters\"] == 0 || empty($data[\"description\"])) {\n \t\treturn false;\n \t}\n\n \treturn $data;\n\n\t}",
"function emarking_extract_images_url($html)\n{\n $images = array();\n $number = preg_match_all('/<img [^>]*src\\s*=\\s*\"([^\"]*)\"[^>]*>/', $html, $images);\n return $images;\n}",
"public static function get_CSS_S_HTML(): string\n {\n $html = '\n <option value=\"563533\"> /[global]/PUBLICATIONS/EGU/ACP/ACP Bootstrap CSS File</option>\n<option value=\"782\"> /[global]/PUBLICATIONS/EGU/ACP/ACP CSS File</option>\n<option value=\"2754\"> /[global]/PUBLICATIONS/EGU/EGU CSS</option>\n<option value=\"18550\"> /[global]/PUBLICATIONS/EGU/ACP/Font Awesome v3.2 Min Css</option>\n<option value=\"18551\"> /[global]/PUBLICATIONS/EGU/ACP/Font Awesome v3.2 Min ie7 Css</option>\n<option value=\"163924\"> /[global]/PUBLICATIONS/Template base css 2018</option>\n<option value=\"240357\"> /[global]/PUBLICATIONS/Template base css 2018 mobile opt</option>\n<option value=\"262955\"> /[global]/PUBLICATIONS/Template base css 2018 mobile opt media</option>\n<option value=\"553405\"> /[global]/PUBLICATIONS/Template base css 2019 mobile opt</option>\n<option value=\"553406\"> /[global]/PUBLICATIONS/Template base css 2019 mobile opt media</option>\n<option value=\"553407\"> /[global]/PUBLICATIONS/Template Bootstrap bridge css</option>\n<option value=\"1283\"> /[global]/PUBLICATIONS/Template css addon extendend content</option>\n<option value=\"120\"> /[global]/PUBLICATIONS/Template css base</option>\n<option value=\"19074\"> /[global]/PUBLICATIONS/Template css base 2015</option>\n<option value=\"24190\"> /[global]/Template css base candidate</option>\n<option value=\"24294\"> /[global]/PUBLICATIONS/Template css display-mathml</option>\n<option value=\"24295\"> /[global]/PUBLICATIONS/Template css editor</option>\n<option value=\"19796\"> /[global]/PUBLICATIONS/Template css editor bridge</option>\n<option value=\"17695\"> /[global]/Template css Font Awesome</option>\n<option value=\"75462\"> /[global]/Template CSS Font Awesome 4.7.0.min</option>\n<option value=\"23035\"> /[global]/Template css Font Open Sans</option>\n<option value=\"19803\"> /[global]/PUBLICATIONS/Template css font style</option>\n<option value=\"24302\"> /[global]/PUBLICATIONS/Template css grid-system unsemantic</option>\n<option value=\"20666\"> /[global]/PUBLICATIONS/Template css journals addon extended content</option>\n<option value=\"16236\"> /[global]/PUBLICATIONS/Template css JQuery Toggle - deprecated</option>\n<option value=\"24297\"> /[global]/PUBLICATIONS/Template css jquery-ui slider pips</option>\n<option value=\"392\"> /[global]/PUBLICATIONS/Template css print base</option>\n<option value=\"19818\"> /[global]/PUBLICATIONS/Template css print base 2015</option>\n<option value=\"1026718\"> /[global]/PUBLICATIONS/Template Editor bridge hide blocks css 2021</option>\n<option value=\"774031\"> /[global]/PUBLICATIONS/Template EGUSphere Base special CSS</option>\n<option value=\"774025\"> /[global]/Template One-column base print css 2020</option>\n<option value=\"778693\"> /[global]/Template One-column base special css 2020</option>\n<option value=\"19817\"> /[global]/Template style social icon CSS</option>\n ';\n\n return $html;\n }",
"public function str_get_html() {\n\t\treturn call_user_func_array ( '\\Remios\\Utils\\Adapters\\simplehtmldom\\str_get_html' , func_get_args() );\n\t}",
"protected function parse($html)\n {\n $doc = new \\DOMDocument();\n $doc->loadHTML('<?xml encoding=\"UTF-8\">' . $html);\n\n $xpath = new \\DOMXPath($doc);\n\n $title = $xpath->query(\"//div[@id='title']/div[@class='left']/h1\");\n $developer = $xpath->query(\"//div[@id='title']/div[@class='left']/h2\");\n $description = $xpath->query(\"//div[@class='product-review']/p\");\n\n if (empty($title) || empty($developer) || empty($description)) {\n throw new InvalidPageException('Invalid page format');\n }\n\n $this->title = $title->item(0)->textContent;\n $this->developer = ltrim($developer->item(0)->textContent, 'By ');\n $this->description = $description->item(0)->textContent;\n $this->source = 'apple';\n }",
"protected function parseEditorOptions($string)\n\t{\n\t\t$options = [];\n\t\t$substrings = preg_split('/,\\s*\\n|\\n/', trim($string));\n\t\tforeach ($substrings as $bits) {\n\t\t\t$option = explode(\":\", $bits, 2);\n\n\t\t\tif (count($option) == 2) {\n\t\t\t\t$value = trim(trim($option[1]), \"'\\\"\");\n\t\t\t\tif (($s = strtolower($value)) === 'false') {\n\t\t\t\t\t$value = false;\n\t\t\t\t} elseif ($s === 'true') {\n\t\t\t\t\t$value = true;\n\t\t\t\t}\n\t\t\t\t$options[trim($option[0])] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $options;\n\t}"
] |
[
"0.58115834",
"0.5393598",
"0.5345785",
"0.5284241",
"0.52229565",
"0.52229565",
"0.50033617",
"0.4992499",
"0.49718833",
"0.49245822",
"0.48836386",
"0.48683754",
"0.48652428",
"0.4857328",
"0.47878367",
"0.47819012",
"0.4779727",
"0.47584182",
"0.4746905",
"0.4733241",
"0.47243917",
"0.4710102",
"0.46976975",
"0.46936917",
"0.4690178",
"0.46494126",
"0.46196982",
"0.45888147",
"0.45877686",
"0.45818454"
] |
0.5809875
|
1
|
Build the HTML for the 404 page
|
public function get_404_page(){
$html = '<article class="wm-article" id="page-404"><h1 class="wm-article-title">404 - Page Not Found</h1>';
$html .= '<h2 class="wm-article-title">Uh oh.</h2><p>The content you requested could not be found. You can try searching with the search bar above or go back to the <a href="' . get_home_url() . '">home page</a>.</p>';
$html .= '</article>';
return $html;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function error404() {\n header('This is not the page you are looking for', true, 404);\n $html404 = sprintf(\"<title>Error 404: Not Found</title>\\n\" .\n \"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-lg-10 offset-lg-1\\\">\" .\n \"<div class=\\\"row wow fadeIn\\\" data-wow-delay=\\\"0.4s\\\"><div class=\\\"col-lg-12\\\"><div class=\\\"divider-new\\\">\" .\n \"<h2 class=\\\"h2-responsive\\\">Error 404</h2>\" .\n \"</div></div>\" .\n \"<div class=\\\"col-lg-12 text-center\\\">\" .\n \"<p>The page <i>%s</i> does not exist.</p>\" .\n \"</div></div></div></div></div></main>\", $_SERVER[\"REQUEST_URI\"]);\n echo $html404;\n }",
"function Errors_404()\n{\n\treturn \"<html>\n\t\t\t<head>\n\t\t\t\t<title>404 Not Found</title>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<h1>Not Found</h1>\n\t\t\t\t<p>The requested URL was not found on this server.</p>\n\t\t\t\t<p>Additionally, a 404 Not Found\n\t\t\t\terror was encountered while trying to use an ErrorDocument to handle the request.</p>\n\t\t\t</body>\n\t\t\t</html>\";\n}",
"public function error404(): void {\n $this->template->set( _ROOT_TPL_ . 'error404.html');\n\n $tplVars = [\n 'HDR_ERROR' => $this->locale['ERR_404'], \n 'TXT_ERROR' => $this->locale['TXT_SOMETHING_WRONG']\n ];\n\n $this->template->setVars( $tplVars );\n\n $this->content->html = $this->template->parse();\n }",
"public function Error404() {\n\t\t$this -> Render();\n\t}",
"public function Error404()\n\t{\n\t\t$this->Render();\n\t}",
"private function spawn404Error()\n {\n Utils_Request::sendHttpStatusCode(Utils_Request::CLIENT_NOT_FOUND);\n try {\n FrontDispatcher::instance()->setConfig($this->_config)->render('404');\n }\n catch (Exception $e) {\n die('Cannot render 404 page!');\n }\n }",
"function notfound() {\n\t\t$this->fw->render('404');\n\t}",
"private function create404()\n {\n $this->response->setStatusCode(404);\n\n $url = $this->request->originalUrl ?: $this->request->getUrl();\n $escaper = new Escaper();\n $message = sprintf(\n \"Cannot %s %s\\n\",\n $escaper->escapeHtml($this->request->getMethod()),\n $escaper->escapeHtml((string) $url)\n );\n $this->response->end($message);\n }",
"public function RenderError404PlainText ();",
"public function show404()\n {\n header(\"HTTP/1.1 404 Not Found\");\n $this->title .= 'ошибка 404'; \n $this->content = System::template('client/v_404.php');\n }",
"public function action_404() {\n $this->template->content = View :: factory('error/404');\n }",
"function error_404()\n\t{\n\t\t$this->output->set_status_header('404');\n\t\t$this->template->set_template('error');\n\t\t$this->template->write('title', 'HappyPerks');\n\t\t$data = $this->template->write_view('content', '404/error', isset($data) ? $data : NULL,true);\n\t\tprx($data);\n\t\t// $this->template->render();\n\n\t}",
"public function pageNotFound404()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'faq');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | 404 Page Not found')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/page_not_found');\n }",
"private function pagERROR404()\n\t{\n\t\t$tekst = new TekstVerwerken;\n\t\t\n\t\t$pageOutput = $this->menu();\n\t\t$pageOutput.= $this->div('open', 'id=\"inhoud\"');\n\t\t$pageOutput.= $this->h2('full', '', 'De pagina die je zoekt kon niet worden gevonden.');\n\t\t$pageOutput.= $this->p('full', 'style=\"padding: 10px\"', 'De pagina \"'.$tekst->cleanHTML($_SESSION['page']).'\" bestaat niet op de website.<br>Denk je dat dit een vergissing is, gelieve dan het contactformulier te gebruiken om dit probleem te melden. Vermeld in dit bericht zeker het gedeelte dat tussen quotes staat.');\n\t\t$pageOutput.= $this->div('close');\n\t\treturn $pageOutput;\n\t}",
"function pageNotFound()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : 404 - Page Not Found';\n \n $this->loadViews(\"404\", $this->global, NULL, NULL);\n }",
"function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page-404',\n\t\t)\n\t);\n}",
"public function Page404(){\n\t\t$data = array(\n\t\t\t'aplikasi'\t\t=> $this->app_name,\n\t\t\t'title_page' \t=> 'Page 404',\n\t\t\t'title' \t\t=> '',\n\t\t\t// 'c'\t\t\t\t=> $c\n\t\t);\n\t\t$this->load->view('layout/V_404', $data);\n\t}",
"public function ooops()\r\n\t{\r\n\t\t$this->template->view('utilities/404.php');\r\n\t}",
"function lb_show_404_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'page_404',\n\t\t)\n\t);\n}",
"protected function RenderError() {\n echo view('errors/404');\n exit;\n }",
"public function show404();",
"public static function write404() {\r\n // impostiamo il codice della risposta http a 404 (file not found)\r\n header('HTTP/1.0 404 Not Found');\r\n $titolo = \"<h1>File non trovato.</h1>\";\r\n $messaggio1 = \"La pagina che hai richiesto non è disponibile\";\r\n $messaggio2 = \"Per tornare in home page clicca <a href='index.php'><font color='blue'>qui</font></a>\";\r\n echo $titolo . '<br>' . $messaggio1 . '<br>' . $messaggio2;\r\n exit();\r\n }",
"function myNotFound()\n{\n global $app, $globalSettings;\n $app->render('error.html', [\n 'page' => mkPage(getMessageString('not_found1')),\n 'title' => getMessageString('not_found1'),\n 'error' => getMessageString('not_found2')]);\n}",
"public function notFound()\r\n {\r\n\r\n $this->render('Page Not Found', '404.view');\r\n }",
"public function get404Tpl(){\n return $this->templates['404'];\n }",
"public function error_404()\n\t{\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tmeta::set_title('This Page will be Forever Missed');\n\t\t$this->template\n\t\t\t->set('title', 'Missing Page')\n\t\t\t->set('content', View::factory('errors/404'));\n\t}",
"public function action_404(){\n\t\t$this->template->title = 'けんさく';\n\t\t$this->template->content = View::forge('util/404');\n\t\t$this->template->breadcrumb = array(array(\"url\" => \"/util/404\", \"name\" => \"404 Not Found\"));\n\t}",
"static function showError404()\n {\n header(\"HTTP/1.0 404 Not Found\");\n include(\"views/layout/404.php\");\n exit();\n }",
"private function pageNotFound()\n {\n $this->theme->setTitle(\"Sidan saknas\");\n $this->views->add('error/404', [\n 'title' => 'Sidan saknas',\n ], 'main-wide');\n }",
"protected function show404()\n {\n $resp = $this->render('errors/404.phtml');\n $resp->status = 404;\n return $resp;\n }"
] |
[
"0.76333153",
"0.75446385",
"0.732521",
"0.730215",
"0.71489125",
"0.711139",
"0.7106229",
"0.71031475",
"0.70857406",
"0.70511013",
"0.7046355",
"0.69810414",
"0.69568044",
"0.6938217",
"0.69349355",
"0.69050485",
"0.68822885",
"0.6860923",
"0.6857469",
"0.68534213",
"0.6852134",
"0.6813748",
"0.68111897",
"0.6804779",
"0.67766625",
"0.6771271",
"0.6766152",
"0.6757718",
"0.6754608",
"0.67480505"
] |
0.7592076
|
1
|
Build the HTML for a post page
|
public function get_post_page(){
global $wp_query;
$post = $wp_query->posts[0];
if( !post_password_required( $post->ID ) ){
// TODO: PULL IN ALL THE $WM_posts FUNCTIONS AND DELETE THAT CLASS
$dates = $this->get_raw_dates( $post->ID );
$published = date_create_from_format( get_option('date_format'), $dates[0] );
$published = $published->format('Y-m-d') . ' 00:00';
$html = '<article class="wm-article-content"><div id="wm-article-header-wrapper"><div id="wm-article-header"><div class="wm-article-title">';
$html .= $this->get_html_title( $post, false);
$html .= '</div><div class="wm-article-meta"><div>Published <time datetime="' . $published . '" title="published">' . $dates[0] . '</time>.';
if( $dates[1] ){
$updated = date_create_from_format( get_option('date_format'), $dates[1] );
$updated = $updated->format('Y-m-d') . ' 00:00';
$html .= ' Updated <time datetime="' . $updated . '" title="updated">' . $dates[1] . '</time>.';
}
$html .= '</div>';
$html .= $this->get_author_meta( $post );
$html .= '</div><canvas id="wm-article-qrcode" width="100" height="100"></canvas></div></div>';
$html .= apply_filters( 'the_content', $post->post_content );
$html .= '</article>';
} else {
$html = '<article class="wm-article" id="post-' . $post->ID . '">' . $this->get_html_title( $post, false );
$html .= get_the_password_form( $post->ID );
$html .= '</article>';
}
return $html;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createHTML () {\r\n\t\t\r\n\t\t//Declare STD Object $res\r\n\t\t$res = $this->blogstate->blogStatement();\r\n\r\n\t\t$blogPost = \"\";\r\n\r\n\t\t//Adding news items contained in $res variable.\r\n\t\tforeach($res AS $key => $val) {\r\n\t\t\t$catLink = \"\";\r\n\t\t\t$categoryAnchors = explode(\",\",($val->category));\r\n\t\t\t\r\n\t\t\tforeach($categoryAnchors as $catVal) {\r\n\t\t\t\t$catLink .= \"<a href='\". $this->db->getQueryString(array('genre' => $catVal)) .\"'>$catVal</a> \";\r\n\t\t\t}\r\n\r\n\t\t\t//Calling the function handleString to handle the $val-data variable with the chosen filters.\r\n \t\t\t$blogPost .= \"\r\n \t\t\t\t<div class='one-blog-post'>\r\n \t\t\t\t\t<h2><a href='newsitem.php?slug=\". $val->slug .\"'>{$val->title}</a></h2>\r\n \t\t\t\t\t<p>{$this->handleString($val->DATA, $val->slug, $val->FILTER)}</p>\r\n\r\n \t\t\t\t\t<div class='container-fluid'>\r\n \t\t\t\t\t\t<p class='pull-right'>Kategori: \". $catLink .\" Publicerad: {$val->published}</p>\r\n \t\t\t\t\t</div>\r\n \t\t\t\t</div>\";\r\n\t\t}\r\n\r\n\t\t//Adding HTML markup to $out.\r\n\t\t$out = \"\r\n\t\t\t\t<div class='container-fluid text-center show-all-movies'>\r\n\t\t\t\t\tNyheter\r\n\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t<div class='blog-posts'> \t\r\n\t\t\t\t\t{$blogPost}\r\n\t\t\t\t</div>\r\n\t\t\";\r\n\t\treturn $out;\r\n\t}",
"public function postPage(){\n require_once \"controller/Post.php\";\n $post = new Post();\n require_once \"controller/Comment.php\";\n $comment = new Comment();\n //gets the post id in URL\n $idPost = $this->_url[1];\n //adds post info\n $html_post = $post->getPost($idPost);\n $html = View::makeHtml($html_post, \"post_template\");\n $html .= \"<br/><div id=\\\"comments\\\"><h2>Commentaires</h2><ul>\";\n //count nb of comments for the post\n $nb_comments = $comment->countComments($idPost);\n //according to nb of comments\n switch ($nb_comments[\"nb_comments\"]){\n case 0:\n $html .= \"<p>Pas encore de commentaire</p>\";\n break;\n case 1:\n //adds comments infos\n $html_comments = $comment->getComments($idPost);\n $html .= View::makeHtml($html_comments, \"comments_template\");\n break;\n default:\n $html_comments = $comment->getComments($idPost);\n $html .= View::makeLoopHtml($html_comments, \"comments_template\");\n break;\n }\n //adds the \"leave a comment\" form\n $html .= \"</ul>\";\n $html .= View::makeHtml([\n \"{{ path }}\" => $GLOBALS[\"path\"],\n \"{{ idPost }}\" => $idPost\n ],\"add_comment_template\");\n $html .= \"</div>\";\n return [\n \"{{ pageTitle }}\" => $html_post[\"{{ post_title }}\"],\n \"{{ content }}\" => $html,\n \"{{ path }}\" => $GLOBALS[\"path\"]\n ];\n }",
"private function buildPost($post) {\n\t\treturn $this->getInLayout(SNUG_VIEWS . '_post.haml', $post);\n\t}",
"function render()\n\t{\n\t\tglobal $tpl, $ilTabs, $ilCtrl, $lng, $ilToolbar, $ilUser, $tree;\n\t\t\n\t\tif(!$this->checkPermissionBool(\"read\"))\n\t\t{\n\t\t\tilUtil::sendInfo($lng->txt(\"no_permission\"));\n\t\t\treturn;\n\t\t}\n\n\t\t$ilTabs->activateTab(\"content\");\n\t\t\n\t\t// toolbar\n\t\tif($this->mayContribute())\n\t\t{\n\t\t\t$ilToolbar->setFormAction($ilCtrl->getFormAction($this, \"createPosting\"));\n\n\t\t\tinclude_once \"Services/Form/classes/class.ilPropertyFormGUI.php\";\n\t\t\t$title = new ilTextInputGUI($lng->txt(\"title\"), \"title\");\n\t\t\t$ilToolbar->addInputItem($title, $lng->txt(\"title\"));\n\t\t\t\n\t\t\tinclude_once \"Services/UIComponent/Button/classes/class.ilSubmitButton.php\";\n\t\t\t$button = ilSubmitButton::getInstance();\n\t\t\t$button->setCaption(\"blog_add_posting\");\n\t\t\t$button->setCommand(\"createPosting\");\n\t\t\t$ilToolbar->addButtonInstance($button);\n\t\t\t\t\t\t\n\t\t\t// exercise blog?\t\t\t\n\t\t\tinclude_once \"Modules/Exercise/classes/class.ilObjExercise.php\";\t\t\t\n\t\t\t$exercises = ilObjExercise::findUserFiles($ilUser->getId(), $this->node_id);\n\t\t\tif($exercises)\n\t\t\t{\n\t\t\t\t$info = array();\t\t\t\t\n\t\t\t\tforeach($exercises as $exercise)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t// #9988\n\t\t\t\t\t$active_ref = false;\n\t\t\t\t\tforeach(ilObject::_getAllReferences($exercise[\"obj_id\"]) as $ref_id)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!$tree->isSaved($ref_id))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$active_ref = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($active_ref)\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t$part = $this->getExerciseInfo($exercise[\"ass_id\"]);\n\t\t\t\t\t\tif($part)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$info[] = $part;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif(sizeof($info))\n\t\t\t\t{\n\t\t\t\t\tilUtil::sendInfo(implode(\"<br />\", $info));\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\t\t\t\t\n\t\t// $is_owner = ($this->object->getOwner() == $ilUser->getId());\n\t\t$is_owner = $this->mayContribute();\n\t\t\n\t\t$list_items = $this->getListItems($is_owner);\n\t\t\n\t\t$list = $nav = \"\";\t\t\n\t\tif($list_items)\n\t\t{\t\n\t\t\t$list = $this->renderList($list_items, \"preview\", null, $is_owner);\t\t\t\n\t\t\t$nav = $this->renderNavigation($this->items, \"render\", \"preview\", null, $is_owner);\t\t\n\t\t}\n\t\t\n\t\t$this->setContentStyleSheet();\t\n\t\t\t\t\t\n\t\t$tpl->setContent($list);\n\t\t$tpl->setRightContent($nav);\n\t}",
"function processForHtmlDisplay($post) {\n\t\t$npost = array();\n \t$npost['id'] = $post['postid'];\n $npost['postid'] = $post['postid'];\n $npost['permalink'] = (defined('CLEANURLS')) ? str_replace('%postid%',$post['postid'],URL_POST) : BLOGURL.'?postid='.$post['postid'];\n $npost['trackbackurl'] = (defined('CLEANURLS')) ? BLOGURL.'trackback/tbpost='.$post['postid'] : BLOGURL.'trackback.php&tbpost='.$post['postid'];\n $npost['title'] = htmlspecialchars($post['title']);\n if($post['modifier'] != '') {\n $npost['body'] = $this->apply_modifier($post['modifier'], $post['body']);\n // replace only &'s that are by themselves, else we risk converting an entity\n $npost['body'] = str_replace(' & ', ' & ', $npost['body']);\n }\n $npost['status'] = $post['status'];\n $npost['posttime'] = $post['posttime'];\n $npost['modifytime'] = $post['modifytime'];\n\n // what we need here is that the date format\n // is available in the control panel as an option\n // this is only here as a convience, the date_format modifier should be used.\n //$npost['posttime_f'] = date(\"D M j G:i:s T Y\",$post['posttime']);\n //$npost['modifytime_f'] = date(\"D M j G:i:s T Y\",$post['modifytime']);\n switch(intval($post['NUMCOMMENTS'])) {\n case 1 : $npost['commenttext'] = \"One comment\"; break;\n case 0 : $npost['commenttext'] = \"Add Comment\"; break;\n default: $npost['commenttext'] = $post['NUMCOMMENTS'] .\" comments\"; break;\n }\n $npost['commentcount'] = $post['NUMCOMMENTS'];\n //TODO move this to a section module\n\t\t$npost['sections'] = array();\n if($post['sections'] != '') {\n //Transform the 'list' of sections into an array for use in a SQL statement\n\t\t\t$tmp_sec_ar = explode(\":\",trim($post['sections']));\n\t\t\tarray_shift($tmp_sec_ar);\n\t\t\tarray_pop($tmp_sec_ar);\n\t\t\t$sect = join(',', $tmp_sec_ar);\n\t\t\t$sql = 'SELECT * FROM `'.T_SECTIONS.'` WHERE sectionid IN ('.$sect.')';\n\t\t\t$rs = $this->_db->Execute($sql);\n\t\t\tif($rs){\n\t\t\t\twhile($section = $rs->FetchRow()){\n\t\t\t\t\t$npost['sections'][] = array('id' => $section['sectionid'], 'nicename' => $section['nicename']); //, 'url' => $section['url']);\n\t\t\t\t}\n\t\t\t}\n }\n //add the author info\n $npost['author'] = array(\n 'id' => $post['ownerid'],\n 'nickname' => htmlspecialchars($post['nickname']),\n 'email' => htmlspecialchars($post['email']),\n 'fullname' => htmlspecialchars($post['fullname']));\n $npost['hidefromhome'] = $post['hidefromhome'];\n $npost['autodisabledate'] = $post['autodisabledate'];\n if($post['allowcomments'] == 'disallow' || ($post['allowcomments'] == 'timed' and $post['autodisabledate'] < time())){\n $npost['allowcomments'] = FALSE;\n }\n else {\n $npost['allowcomments'] = TRUE;\n }\n return $npost;\n }",
"public function buildHTML() {\n $vars = array('page' => &$this);\n\n // Trigger various page hooks.\n // Page init.\n $this->env->hook('page_preload', $vars);\n\n // This is an AJAX request. Skip loading index.html and just provide requested content.\n if (isset($_REQUEST['ajax'])) {\n $this->html = NodeFactory::render($this->env);\n }\n // This is an actual HTML page request. Commonly index.html.\n elseif (!empty($this->getIndexFile())) {\n $this->html = file_get_contents($this->env->dir['docroot'] . '/' . $this->getIndexFile());\n }\n // In case of a special pre-loaded page request, i.e. Shadow node edit.\n elseif (!empty($this->getData('content'))) {\n $this->html = $this->getData('content');\n }\n elseif (!is_file($this->env->dir['docroot'] . '/' . $this->getIndexFile())) {\n $this->html = t('Hello! Quanta seems not installed (yet) in your system. Please follow the <a href=\"https://www.quanta.org/installation-instructions\">Installation Instructions</a><br /><br />Reason: file not found(' . $this->getIndexFile() . ')');\n }\n\n // Trigger various page hooks.\n // Page init.\n $this->env->hook('page_init', $vars);\n\n // Page's body classes. // TODO: deprecate, include in page init.\n $this->env->hook('body_classes', $vars);\n\n // Page after build.\n $this->env->hook('page_after_build', $vars);\n\n // Page complete.\n $this->env->hook('page_complete', $vars);\n\n }",
"function view_post($slug){\r\n if(!$slug[0])\r\n return array();\r\n\r\n // create variable to hold the final html output\r\n $content = array();\r\n\r\n // get all content pieces that are submitted to the page\r\n $result = $this->reg->db->GetAll('SELECT id, title, content, last_edited, show_title, show_date, advanced, head\r\n FROM system__content\r\n WHERE url_slug = ?\r\n AND state = ?', array($slug[0], 'published'));\r\n\r\n // loop though and create posts for each content piece\r\n if(count($result)){\r\n foreach($result as $row){\r\n // escape data for output\r\n $html['id'] = $this->reg->validation->escape_html($row['id']);\r\n\r\n $content[$html['id']]['title'] \t\t= $this->reg->validation->escape_rich_text($row['title']);\r\n $content[$html['id']]['content'] \t= $this->reg->validation->escape_rich_text($row['content']);\r\n $content[$html['id']]['date'] \t\t= date('M j, Y', $this->reg->validation->escape_html(strtotime($row['last_edited'])));\r\n $content[$html['id']]['show_title'] = (bool)$row['show_title'];\r\n $content[$html['id']]['show_date'] = (bool)$row['show_date'];\r\n\r\n // include head if post is set as advanced\r\n if($row['advanced']){\r\n $this->reg->config->set('head.', $row['head']);\r\n }\r\n }\r\n }\r\n\r\n // return final html\r\n return $content;\r\n }",
"private function renderPostTemplate() {\r\n\t\t$posts = $this->getPosts();\r\n\t\t$renderedposts = array();\r\n\t\tforeach($posts as $post) { \r\n\t\t\t$post_template = file_get_contents('post.html');\r\n\t\t\t$title = $post['title'];\r\n\t\t\t$author = $post['author'];\r\n\t\t\t$postdate = $post['postdate'];\r\n\t\t\t$text = $post['text'];\r\n\t\t\t$text = nl2br($text);\r\n\t\t\t\r\n\t\t\t$post_template = str_replace(\"{{title}}\", $title, $post_template);\r\n\t\t\t$post_template = str_replace(\"{{author}}\", $author, $post_template);\r\n\t\t\t$post_template = str_replace(\"{{date}}\", $postdate, $post_template);\r\n\t\t\t$post_template = str_replace(\"{{text}}\", $text, $post_template);\r\n\t\t\t\r\n\t\t\tarray_push($renderedposts, $post_template);\r\n\t\t}\r\n\t\treturn $renderedposts;\r\n\t}",
"function view_page($slug){\r\n if(!$slug[0])\r\n return array();\r\n\r\n // create variable to hold the final html output\r\n $content = array();\r\n\r\n // get all content pieces that are submitted to the page\r\n $result = $this->reg->db->GetAll('SELECT system__content.id, title, content, last_edited, show_title, show_date, advanced, head\r\n FROM system__intersect__navigation_content\r\n LEFT JOIN system__content\r\n ON system__intersect__navigation_content.content_id = system__content.id\r\n LEFT JOIN system__navigation\r\n ON system__intersect__navigation_content.navigation_id = system__navigation.id\r\n WHERE system__navigation.url_slug = ?\r\n AND state = ?\r\n ORDER BY created DESC', array($slug[0], 'published'));\r\n\r\n // loop though and create posts for each content piece\r\n if(count($result)){\r\n foreach($result as $row){\r\n // escape data for output\r\n $html['id'] = $this->reg->validation->escape_html($row['id']);\r\n\r\n $content[$html['id']]['title'] \t\t= $this->reg->validation->escape_rich_text($row['title']);\r\n $content[$html['id']]['content'] \t= $this->reg->validation->escape_rich_text($row['content']);\r\n $content[$html['id']]['date'] \t\t= date('M j, Y', $this->reg->validation->escape_html(strtotime($row['last_edited'])));\r\n $content[$html['id']]['advanced'] = (bool)$row['advanced'];\r\n $content[$html['id']]['show_title'] = (bool)$row['show_title'];\r\n $content[$html['id']]['show_date'] = (bool)$row['show_date'];\r\n\r\n // include head if post is set as advanced\r\n if($row['advanced']){\r\n $this->reg->config->set('head.', $row['head']);\r\n }\r\n }\r\n }\r\n\r\n // return final html\r\n return $content;\r\n }",
"function generate() {\n\t\t// List of post types to generate content\n\t\t$types = array(); \n\n\t\t// Per-type content \n\t\t$lorems = array();\n\t\t$photos = array();\n\n\t\t// Per-type per-post content counts\n\t\t$nposts = array();\n\t\t$nparas = array();\n\t\t$nphotos = array();\n\n\t\t// Post titles\n\t\t$titles = array();\n\n\t\t// Time spread of posts\n\t\t$months = $this->option( 'spread' );\n\n\t\t// Total counts\n\t\t$totalposts = 0;\n\t\t$total_text = 0;\n\t\t$total_photos = 0;\n\n\t\t$this->result( \"<p>Generating dummy content...</p>\" );\n\n\t\t$post_types = $this->param( 'post_types' );\n\t\tif( !$post_types ) $post_types = array();\n\n\t\t// Get Lorem content for each post type given the options\n\t\tforeach( $post_types as $type ) {\n\t\t\t$lengths = array();\n\n\t\t\t$type_nposts = $this->param( 'post_type_count', $type ); \n\t\t\t$nposts[$type] = is_numeric( $type_nposts ) ? $type_nposts : 0;\n\n\t\t\t$type_nparas = $this->param( 'post_type_paragraphs', $type );\n\t\t\t$nparas[$type] = is_numeric( $type_nparas ) ? $type_nparas : 0;\n\t\t\t\n\t\t\tif($nposts[$type] <= 0 || $nparas[$type] <= 0) $errors[] = \"Invalid parameters for $type\";\n\n\t\t\t$contents = array();\n\t\t\t$lorems[$type] = array();\n\n\t\t\t$type_contents = $this->param( 'post_content', $type );\n\t\t\tif( count( $type_contents ) ) {\n\t\t\t\tforeach( $type_contents as $content ) {\n\t\t\t\t\tif( $content == 'lists' ) $contents = array_merge($contents, array('ul', 'ol', 'dl'));\n\t\t\t\t\telse $contents[] = $content;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$type_lengths = $this->param( 'post_length', $type );\n\t\t\t\n\t\t\tif( count( $type_lengths ) ) {\n\t\t\t\t$num = $nparas[$type];\n\n\t\t\t\twhile($num > 0) {\n\t\t\t\t\tforeach( $type_lengths as $length ) {\n\t\t\t\t\t\t$rand = rand(1, $num - 1);\n\t\t\t\t\t\t$lengths[$length] += $rand;\n\t\t\t\t\t\t$num -= $rand;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$type_post_kind = $this->param( 'post_kind', $type );\n\n\t\t\tif( in_array( 'simple', $type_post_kind ) ) {\n\t\t\t\tif( count($lengths) ) {\n\t\t\t\t\tforeach( $lengths as $size => $count ) {\n\t\t\t\t\t\t$this->result( '<p>Gathering <strong>' . esc_html( $count ) . '</strong> paragraphs of <strong>' . esc_html( $size ) . '</strong> length for <strong>' . esc_html( $type ) . '</strong> posts...</p>' );\n\t\t\t\t\t\t$result = wp_remote_get( 'http://loripsum.net/api/' . $count . '/' . implode( '/', $contents ) . '/' . $size );\n\t\t\t\t\t\t$lorems[$type] = array_merge($lorems[$type], explode(\"\\n\\n\", trim($result['body'])));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif($type == \"page\") {\n \t$this->result( '<p>Gathering <strong>' . esc_html( $numparas ) . '</strong> paragraphs for <strong>' . esc_html( $type ) . '</strong> posts...</p>' );\n \t$result = wp_remote_get( 'http://loripsum.net/api/' . implode( '/', $contents ) . '/' . $nparas[$type] );\n \t$lorems[$type] = explode( \"\\n\\n\", trim( $result['body'] ) );\n \t}\n if($type == \"post\") {\n $this->result( '<p>Gathering <strong>' . esc_html( $numparas ) . '</strong> paragraphs for <strong>' . '</strong> posts...</p>' );\n \t$result = wp_remote_get( 'http://loripsum.net/api/' . implode( '/', $contents ) . '/' . $nparas[$type] );\n \t$lorems[$type] = explode( \"\\n\\n\", trim( $result['body'] ) );\n }\n\t\t\t\t}\n\t\t\t\t$total_text += count( $lorems[$type] );\n\t\t\t}\n\n\t\t\tif( in_array( 'photos', $type_post_kind ) ) {\n\t\t\t\t$nphotos[$type] = $this->param( 'post_type_photos', $type );\n\t\t\t\t$total_photos += $nphotos[$type] * $nposts[$type];\n\t\t\t}\n\n\t\t\t$totalposts += $nposts[$type];\n\t\t\t$types[] = $type;\n\t\t}\n\n\t\tif( $totalposts > 0 ) {\n\t\t\t$this->result( '<p>Gathering <strong>' . esc_html( $totalposts ) . '</strong> tidbits for post titles...</p>' );\n\n\t\t\t$titles = $this->gather($totalposts, 10);\n\t\t}\n\n\t\tif( $total_photos > 0 ) {\n\t\t\tif( $this->option( 'flickrkey' ) ) {\n\t\t\t\t$this->result( '<p>Gathering <strong>' . esc_html( $total_photos ) . '</strong> photos from flickr for post images...</p>' );\n\t\t\t\t\t\n\t\t\t\t$photos = $this->gatherphotos($total_photos);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->result( \"<p>Can't gather photos from flickr because: no flickr app key specified.</p>\" );\n\t\t\t}\n\t\t}\n\n\t\tif( $total_text > 0 ) {\n\t\t\t$this->result( \"<p>Text content generated. Lorem Ipsum generated from <a href='http://loripsum.net/#info'>LorIpsum.net</a>...</p>\\n\" );\n\t\t} else {\n\t\t\t$this->result( \"<p>No post text content generated.</p>\" );\n\t\t}\n\n\t\t// Process and gather taxonomy options\n\t\t$totalterms = 0;\n\t\t$connections = array();\n\t\t$newterms = array();\n\t\t$create_taxonomies = $this->param( 'taxonomies' );\n\t\tif( !$create_taxonomies ) $create_taxonomies = array();\n\n\t\tforeach( $create_taxonomies as $tax ) {\n\t\t\t$nterms = (int) $this->param( 'taxonomy_count', $tax );\n\n\t\t\tif($nterms > 0)\n\t\t\t\t$totalterms += $nterms;\n\t\t\telse $nterms = 0;\n\n\t\t\tif($links <= 0 && $nterms <= 0) {\n\t\t\t\t$errors[] = \"No terms created for taxonomy <strong>$tax</strong>\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t\t$newterms[$tax] = $nterms;\n\t\t}\n\n\t\t$link_make_connections = $this->param( 'make_connections' );\n\t\tif( !$link_make_connections ) $link_make_connections = array();\n\n\t\tforeach( $link_make_connections as $tax ) {\n\t\t\t$links = $this->param( 'connections', $tax );\n\n\t\t\tif($links > 0) {\n\t\t\t\t$connections[$tax] = array();\n\t\t\t\t$connect_tax_types = $this->param( 'connect_type', $tax );\n\t\t\t\tif( empty( $connect_tax_types ) )\n\t\t\t\t\t$connect_tax_types = $this->post_types();\n\t\t\t\telse\n\t\t\t\t\t$connect_tax_types = $connect_tax_types;\n\n\t\t\t\tforeach( $connect_tax_types as $type ) \n\t\t\t\t\t$connections[$tax][$type] = $links;\n\t\t\t}\n\t\t}\n\n\t\tif( $totalterms > 0 )\t {\n\t\t\t$this->result( \"<p>Gathering <strong>$totalterms</strong> tidbits for taxonomy terms...</p>\" );\n\n\t\t\t$terms = $this->gather( $totalterms, -3 );\n\t\t}\n\t\t\n\t\tforeach( $types as $type ) {\n\t\t\tunset( $photo );\n\t\t\t\n\t\t\tif($type == \"page\") {\n \t$this->result( \"<p>Generating {$nposts[$type]} <strong>$type</strong> posts...</p>\" );\n }\n if($type == \"post\") {\n \t$this->result( \"<p>Generating {$nposts[$type]} posts...</p>\" );\n }\n\t\t\t$alignments = $this->param( 'photo_align', $type );\n\n\t\t\tif( empty( $alignments ) )\n\t\t\t\t$alignments = array( 'left','right','center','' );\n\n\t\t\t$sizes = array(); \n\n\t\t\t$type_photo_size = $this->param( 'photo_size', $type );\n\t\t\tif( is_array( $type_photo_size ) ) foreach( $type_photo_size as $size ) \n\t\t\t\tif( preg_match( '/^t|m|z$/', $size ) ) $sizes[] = substr( $size, 0, 1 );\n\n\t\t\tif( empty( $sizes ) ) \n\t\t\t\t$sizes = array( 't', 'm', 'z' );\n\n\t\t\tfor( $i = 0; $i < $nposts[ $type ]; $i++ ) {\n\t\t\t\t$paras = array();\n\t\t\t\t$copy = $lorems[ $type ];\n\t\t\t\t// Generate number of paragraphs specified +- 20%\n\t\t\t\t$num = $nparas[ $type ] + (rand(0, ceil($nparas[ $type ] * .4)) - floor($nparas[ $type ] * .2));\n\t\t\t\tfor( $j = 0; $j < $num; $j++ ) {\n\t\t\t\t\t// Reset copy of $lorems if we've run out of paragraphs\n\t\t\t\t\tif(count($copy) == 0) $copy = $lorems[ $type ];\n\t\t\t\t\t$para = implode('', array_splice($copy, rand(0, count($copy) - 1), 1));\n\t\t\t\t\t$paras[] = $para;\n\t\t\t\t}\n\t\t\t\tif( isset( $photos ) && !empty( $photos ) && $nphotos[$type] > 0 ) {\n\t\t\t\t\t$copy = $photos;\n\t\t\t\t\t$num = $nphotos[$type] + (rand(0, ceil($nphotos[$type] * .4)) - floor($nphotos[$type] * .2));\n\t\t\t\t\t\n\t\t\t\t\tfor($j = 0; $j < $num; $j++) {\n\t\t\t\t\t\t$photo = implode('', array_splice($copy, mt_rand(0, count($copy) - 1), 1));\n\t\t\t\t\t\t$photo = sprintf( $photo, $sizes[(int)mt_rand(0,count($sizes)-1)] );\n\t\t\t\t\t\t$align = $alignments[(int)mt_rand(0,count($alignments)-1)];\n\t\t\t\t\t\tif( $align ) $align = 'class=\"align' . esc_attr( $align ) . '\"';\n\t\t\t\t\t\tarray_splice( $paras, rand( 0, count( $paras ) - 1 ), 0, array( '<img $align src=\"' . esc_attr( $photo ) . '\" />' ) );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$title = implode('', array_splice($titles, rand(0, count($titles) - 1), 1));\n\t\t\t\tif( $title ) {\n\t\t\t\t\t$post_data = array(\n\t\t\t\t\t\t'post_title' => $title,\n\t\t\t\t\t\t'post_type' => $type,\n\t\t\t\t\t\t'post_content' => implode(\"\\n\\n\", $paras),\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_author' => 1,\n\t\t\t\t\t\t'post_date' => date('Y-m-d H:i:s', time() - (mt_rand()/mt_getrandmax())*(60*60*24*30*$months))\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$post_ID = wp_insert_post( $post_data );\n\t\t\t\t\t\n\t\t\t\t\tupdate_post_meta( $post_ID, $this->meta_key_dummy, 1 );\n\t\t\n\t\t\t\t\t$post = get_post( $post_ID );\n\t\t\t\t\t\n\t\t\t\t\tif( $post ) {\n\t\t\t\t\t\t$result_message = '<a target=\"postPreview\" href=\"' . get_permalink( $post->ID ) . '\">Post ID #'. esc_html( $post->ID ) . ': ' . esc_html( $post->post_title ) . '</a> <strong>' . esc_html( $type ) . '</strong> #' . esc_html( $i + 1 ) . ' (' . esc_html( $num ) . ' paragraphs)';\n\n\t\t\t\t\t\tif( isset( $photo ) && $this->param( 'photo_featured', $type ) ) {\n\t\t\t\t\t\t\t$attachment_id = $this->sideload( $photo, $post );\n\n\t\t\t\t\t\t\tif( is_wp_error( $attachment_id ) || !$attachment_id ) {\n\t\t\t\t\t\t\t\t$result_message .= ', failed to download featured image at URL <em>' . esc_url( $photo ) . '</em>: ' . esc_html( $attachment_id->get_error_message() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_ID, '_thumbnail_id', $attachment_id );\n\t\t\t\t\t\t\t\t$result_message .= ', featured image: ' . esc_url( $photo ) . ', attachment #' . esc_html( $attachment_id );\n\t\t\t\t\t\t\t\tupdate_post_meta( $attachment_id, $this->meta_key_dummy, 1 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->result( '<p><a href=\"#post-$post->ID\" onclick=\"preview($post->ID)\">' . $result_message . ' (preview)</a></p>' );\n\t\t\t\t\t\t$this->result( '<div id=\"' . esc_attr( \"post-$post->ID\" ) . '\" style=\"height: 0; overflow: hidden\">' . apply_filters( 'the_content', $post->post_content ) . '</div>' );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->result( \"<p>Stupid! I couldn't come up with a title!!</p>\" );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t$created_terms = get_option( 'oomph_dummy_terms' );\n\n\t\tif( !$created_terms ) $created_terms = array();\n\n\t\tforeach( $newterms as $tax => $count ) {\n\t\t\t$this->result( '<p>Creating <strong>' . esc_html( $count ) . '</strong> terms for taxonomy <strong>' . esc_html( $tax ) . '</strong></p>' );\n\t\t\t$created_terms[ $tax ] = array();\n\t\t\t$this->result( '<ul class=\"term-list\">' );\n\t\t\tfor($i = 0; $i < $count; $i++ ) {\n\t\t\t\t$term = implode('', array_splice($terms, mt_rand(0, count($terms) - 1), 1));\n\t\t\t\t$result = wp_insert_term( $term, $tax ); \n\t\t\t\t\n\t\t\t\t// Since there's no taxonomy meta, we've got to save all of the created terms\n\t\t\t\t// into an options field\n\t\t\t\tif( !is_wp_error( $result ) )\n\t\t\t\t\t$created_terms[ $tax ][] = $result['term_id'];\n\n\t\t\t\t$this->result( '<li>' . esc_html( $term ) . '</li>' );\n\t\t\t}\n\t\t\t$this->result( '</ul>' );\n\t\t}\n\n\t\tupdate_option( 'oomph_dummy_terms', $created_terms );\n\n\t\tforeach( $connections as $tax => $types ) {\n\t\t\t$terms = get_terms( $tax, array( 'hide_empty' => false, 'exclude' => $this->param( 'ignore_default', $tax ) ? 1 : 0 ) );\n\n\t\t\tforeach( $types as $type => $count ) {\n\t\t\t\t$this->result( '<p>Creating <strong>' . esc_html( $count ) . '</strong> connections from taxonomy <strong>' . esc_html( $tax ) . '</strong> to <strong>' . esc_html( $type ) . '</strong> posts...</p>' );\n\n\t\t\t\t$post_query = \"post_type=$type&orderby=rand&posts_per_page=-1\";\n\n\t\t\t\t$reset = false;\n\t\t\t\t// Special case for categories: Only assign new categories to posts in Uncategorized, or ID 1\n\t\t\t\tif( $type == 'post' && $tax == 'category' ) {\n\t\t\t\t\t$reset = true;\n\t\t\t\t\t$post_query .= '&category=1';\n\t\t\t\t}\n\n\t\t\t\t$posts = get_posts( $post_query );\n\n\t\t\t\t$this->result( \"<ol>\" );\n\t\t\t\tforeach($posts as $post) {\n\t\t\t\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\t\t\t\t$term = array_slice( $terms, mt_rand( 0, count( $terms ) ) - 1, 1 );\n\t\t\t\t\t\t$this->result( \"<li>({$post->ID}) {$post->post_name} -> ({$term[0]->term_id}) {$term[0]->name}</li>\\n\" );\n\t\t\t\t\t\twp_set_object_terms( $post->ID, (int)$term[0]->term_id, $tax, !($reset && $i == 0) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->result( \"</ol>\" );\n\t\t\t}\n\t\t}\n\n\t\tif( isset( $errors ) && count( $errors ) ) print_r( $errors );\n\n\t\t$this->result( \"<h3>Done!</h3>\" );\n\t\t$this->result( \"<p>Enjoy your new dummy content!</p>\" );\n\n\t\tif( $this->async ) \n\t\t\t$this->dummy_content_count();\n\t}",
"public function buildPost($content);",
"public static function renderPosts($posts){\n\n $template = \"\";\n\n foreach($posts as $post){\n\n $template .= \"\n <div class='post-preview'>\n <h2 class='post-title'>$post[title]</h2>\n <div>\n <img src='$post[image]' alt='$post[title]' class='img-fluid'>\n </div>\n <div class='post-subtitle'>$post[text]</div>\n <p class='post-meta'>\n Posted by <a href='#'>$post[author]</a>\n </p>\n </div>\n <hr />\";\n }\n \n echo $template;\n\n }",
"public function buildHTML() {\n\n\t\t// Load the header\n\t\tinclude 'templates/header.php';\n\n\t\t// Load the content\n\t\t$this->contentHTML();\n\n\t\t// Load the footer\n\t\tinclude 'templates/footer.php';\n\n\t}",
"public function make(PostInterface $post)\n {\n $settings = $this->dispatch(new GetSettings());\n\n\n $content = [\n 'footer' => ($post->getCategory()) ? $post->getCategory()->footer : ''\n ];\n\n if (isset($settings['sidebar']) && $settings['sidebar']) {\n $sidebar = $this->dispatch(new BuildSidebar());\n }\n\n $post->setResponse($this->response->view('module::posts/posts', compact('post','settings','sidebar','content')));\n }",
"public function posts()\n\t{\n\t\t$this -> template = 'default_1';\n\t\t$url = $this -> basepath();\n\n\t\t$posts = \\App\\App::getInstance() -> getTable('postsManager');\n\t\t$posts = $posts -> getPosts();\n\t\t$categories = \\App\\App::getInstance() -> getTable('categoriesManager');\n\t\t$categories = $categories -> getCategories();\n\t\t$this -> page('posts/posts', compact('posts', 'categories', 'url'));\n\t}",
"public function render() {\n\t\t$this -> post = front()->registry()->get('post')-> getArray();\n\t\t$this -> request = front()->registry()->get('request', 'variables', '0');\n\t\t$this -> variables = front() -> registry() -> get('request', 'variables') -> getArray();\n\t\t$this -> get = front() -> registry() -> get('get') -> getArray();\n\t\t$this->dept = $this->Dept()-> getAll();\n\t\t$this->staff = $this->Staff()-> getAll();\n\t\t$this->article = $this->Article()-> getAll();\n\t\t\n\t\tif (isset($this -> post)) {\n\t\t\t$this -> _setErrors();\n\t\t\t//-> post validation\n\n\t\t\tif (empty($this -> _errors)) {\n\t\t\t\t$this -> _process();\n\t\t\t\t//-> post processing\n\t\t\t}\n\t\t}\n\n\t\t$this -> _body['depts'] = $this->dept;\n\t\t$this -> _body['staffs'] = $this->staff;\n\t\t$this -> _body['articles'] = $this->article;\n\t\t$this -> _body['error'] = $this -> _errors;\n\t\treturn $this -> _page();\n\t}",
"function meta_html($post)\n {\n $view = new Xby2BaseView(get_post_meta($post->ID));\n $view->addInput('text', 'link-label', 'Label: ', 'label', 'regular-text');\n $view->addInput('text', 'link-link', 'Link: ', 'link', 'large-text');\n $view->addInput('text', 'link-priority', 'Priority: ', 'priority', 'regular-text');\n $view->displayForm();\n }",
"public function getPrebuildTemplates()\n {\n if (isset($_POST) && !empty($_POST) && count($_POST) > 0) {\n $posts = json_decode(stripslashes($_POST['posts']));\n if (count($posts) > 0) {\n foreach ($posts as $a) {\n echo file_get_contents($_POST['url'] . $a->url);\n }\n }\n }\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 }",
"function postShow($str='', $tID = 0, $codeName = ''){\n\t#$myID = (int)$_GET['id']; #get post ID\n\t#$tID = (int)$_GET['tID']; #get thread ID\n\t$tID = 2; #temp value of thread for dev purpose, must ultimately come from query string\n\t$pID = (int)$_GET['id']; #get post ID\n\n\t#sql call for tags\n\t$sqlTags = \"SELECT CharID AS CharacterID, Codename, FirstName, LastName FROM ma_Characters;\";\n\t#sql for post data\n\t$sqlPost = \"SELECT PostID, ThreadID, UserID, CharID, PostType, PostApproval, PostRating, PostVisible, PostFrom,\n\t PostFeaturing, PostPhaseOfDay, PostWeather, PostLocation, PostContent, PostNotes, PostSummary, PostTags,\n\t DatePostLock, DatePostPost, DatePullPost, LastEditor, DateCreated, DateAssigned, LastUpdated\n\t FROM ma_Posts\n\n\t WHERE PostID = $pID;\";\n\n\t#BEGIN post construction\n\t$str='\n\t<!-- END sidebar -->\n\t<!-- BEGIN content -->\n\t<div class=\"col-md-9 pull-right\">';\n\n\n\t\t#reference images for pager\n\t\t$prev = '<span class=\"glyphicon glyphicon-backward\"></span>';\n\t\t$next = '<span class=\"glyphicon glyphicon-forward\"></span>';\n\n\t\t# Create instance of new 'pager' class\n\t\t$myPager = new Pager(2,'',$prev,$next,'');\n\t\t$sql = $myPager->loadSQL($sqlPost); #load SQL, add offset\n\n\t\t# connection comes first in mysqli (improved) function\n\t\t$result = mysqli_query(IDB::conn(),$sqlPost) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR));\n\t\tif (mysqli_num_rows($result) > 0)//at least one record!\n\t\t{#records exist - process\n\n\t\t\t/*\n\t\t\tif($myPager->showTotal()==1){$itemz = \"post\";}else{$itemz = \"posts\";} //deal with plural\n\t\t\t$str .= ' <div align=\"center\">We have ' . $myPager->showTotal() . ' ' . $itemz . '!</div>';\n\t\t\t*/\n\n\t\t\t\t#build $str post by post\n\t\t\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t\t\t{# process each row\n\t\t\t\t\t#config post variables\n\t\t\t\t\t$hID\t\t\t\t= (int)$row['UserID'];\n\t\t\t\t\t$tID \t\t\t\t= (int)$row['ThreadID'];\n\n\t\t\t\t\t$charID\t\t\t\t\t\t= (int)$row['CharID'];\n\n\t\t\t\t\t#format post id to 4 places\n\t\t\t\t\t$pID \t\t\t\t= (int)$row['PostID'];\n\t\t\t\t\t$pFormattedID \t\t= str_pad($pID, 4, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t#format time post updated\n\t\t\t\t\t$lastUpdate = date_create($row['LastUpdated']);\n\t\t\t\t\t$LastUpdate = date_format($lastUpdate, 'Y-m-d H:i:s a');\n\n\t\t\t\t\t$pLocation = $row['PostLocation'];\n\t\t\t\t\t$pWeather = $row['PostWeather'];\n\t\t\t\t\t$pContent = dbOut($row['PostContent']);\n\t\t\t\t\t$pNotes \t = dbOut($row['PostNotes']);\n\n\t\t\t\t\t#get char ids for tags\n\t\t\t\t\t$postTags \t\t\t\t= $row['PostTags'];\n\n\t\t\t\t\t#make OOP SEE: http://php.net/manual/en/datetime.settime.php\n\t\t\t\t\t$format = 'Y-m-d H:i:s';\n\t\t\t\t\t$gTime = strtotime('2016-09-03 14:55:24');\n\n\t\t\t\t\t$pSummary = dbOut($row['PostSummary']);\n\n\n\t\t\t\t\t$str .= '<div class=\"row\">\n\t\t\t\t\t\t<div class=\"col-sm-2\">';\n\n\t\t\t\t\t\t$str .= mk_PolyThumb($charID) . '</div>'; #gets thumbnail of featured character with detailed tooltip\n\n\t\t\t\t\t#get the post content - the actual meat of the post\n\t\t\t\t\t$str .= '<div class=\"col-sm-7\" style=\"\">\n\t\t\t\t\t\t\t<p><strong>' . $codeName . ' » </strong> ' . nl2br($postContent) . '</p>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<!-- END innercontent -->\n\t\t\t\t\t\t<!-- BEGIN post details -->\n\t\t\t\t\t\t<div class=\"col-sm-3 small\">\n\t\t\t\t\t\t\t<div class=\"well\">\n\t\t\t\t\t\t\t\t<p><strong>Message '\n\t\t\t\t\t\t\t\t\t. $pFormattedID . '» </strong> <br /> [ <a href=\"'\n\t\t\t\t\t\t\t\t\t. VIRTUAL_PATH . 'threads/index.php?act=postEdit&postID='\n\t\t\t\t\t\t\t\t\t. $pID . '\">Edit</a> | <a href=\"'\n\t\t\t\t\t\t\t\t\t. VIRTUAL_PATH . 'threads/index.php?act=postTrash&postID='\n\t\t\t\t\t\t\t\t\t. $pID . '\">Remove</a> ]</p>\n\n\t\t\t\t\t\t\t\t<p><strong>Updated » </strong> ' . $LastUpdate . '</p>\n\t\t\t\t\t\t\t\t<p>' . get_hDetails($hID, $pID) . '<p>'; #returns a handler detail link\n\n\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 // ** IF SET SHOW **//\n\t\t\t\t\t\t\t\t###########################################################\n\t\t\t\t\t\t\t\techo '<p><strong>From » </strong>[ #XXXX ]</p>\n\t\t\t\t\t\t\t\t<p><strong>Where » </strong> ' . $pLocation . ' </p>\n\t\t\t\t\t\t\t\t<p><strong>Weather » </strong> ' . $pWeather . ' </p>\n\t\t\t\t\t\t\t\t<p><strong>When » </strong> ' . $gTime = date($format, $gTime) . ' </p>\n\t\t\t\t\t\t\t\t<p><strong>Notes » </strong> ' . nl2br($pNotes) . ' </p>\n\t\t\t\t\t\t\t\t<p><strong>Summary » </strong> ' . nl2br($pSummary) . ' </p>';\n\n\n\t\t\t\t\t\t\t\techo '<p>tages: '. get_pTags($pTags) . '</p>';\n\n\t\t\t\t\t\t\techo '</div><!-- END post details -->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\n\t\t\t\t} #END main while loop\n\n\t\t\t\t$str .= $myPager->showNAV(); # show paging nav, only if enough records\n\n\t\t\t\t@mysqli_free_result($result);\n\n\t\t\t}else{#no records\n\t\t\t\t$str .= \"<div align=center>Currently no posts. You should do </div>\";\n\t\t\t}\n\n\n\t\t\t$str .= '<p>(b1-not if first / b2-if last post only/b3-not if last)</p>\n\t\t\t<br />\n\t\t\t<p>\n\t\t\t\t<a href=\"#\" class=\"btn btn-primary btn-xs\">Prior Post (ID-1)</a>\n\t\t\t\t<a href=\"index.php?act=postAdd&threadId=' . $tID . '\" class=\"btn btn-primary btn-xs\">Add/INSERT Post</a>\n\t\t\t\t<a href=\"#\" class=\"btn btn-primary btn-xs\">Next Post (ID+1)</a>\n\t\t\t</p>\n\t\t</div><!-- END post/content -->\n\t<!-- START footer-->\n\t';\n\n\treturn $str;\n}",
"protected function render()\n {\n $settings = $this->get_settings_for_display();\n\n $posts = get_posts(\n array(\n 'post_type' => 'post',\n 'numberposts' => $settings['posts'],\n 'orderby' => 'date',\n )\n );\n\n include PLUGIN_DIR . '/templates/widgets/recent-posts.php';\n }",
"public function post($post_id)\n\t{\n\t\t$check = DB::select(\"SELECT COUNT(*) as count FROM blog WHERE id = '\".explode('-',$post_id)[0].\"'\")[0];\n\t\tif ($check->count == 0){\n\t\t\tabort(404);\n\t\t}\n\t\t$post = DB::select(\"SELECT * FROM blog WHERE id = '\".explode('-',$post_id)[0].\"'\")[0];\n\t\tDB::update(\"UPDATE blog SET visits = visits+1 WHERE id = '\".$post->id.\"'\");\n\t\t$title = $post->title;\n\t\t$desc = mb_substr($post->content,0,75);\n\t\t$header = $this->header(translate($post->title),$desc,false,true,url('/assets/blog/'.$post->images));\n\t\t// Get blocs of the page builder\n\t\t$blocs = DB::select(\"SELECT * FROM blocs WHERE area = 'post' ORDER BY o ASC\");\n\t\t$footer = $this->footer();\n\t\treturn view('post')->with(compact('header','post','blocs','footer'));\n\t}",
"function get_post_embed_html($width, $height, $post = \\null)\n {\n }",
"function post($number = 0) {\n // Check input\n if((int)$number > 0) {\n $post_num = (int)$number;\n } else {\n redirect('/home/', 'refresh');\n }\n // Load posts model\n $this->load->model('Post');\n // Pull post from database\n $array_posts = $this->Post->get_post(\"home\", $post_num);\n // Setup all the data to be shown on the webpage\n $data = array('page_content' => 'post ' . $post_num,\n 'page_title' => 'PORT8080.NET',\n 'page_title_sub' => 'A mish mash of crap from the days of my life...',\n 'array_posts' => $array_posts);\n // Open the page\n $this->load->view('page_header', $data);\n // Load the title block\n $this->load->view('page_body_header', $data);\n // Load the main page\n $this->load->view('home/page_body_blog', $data);\n // Load the menu sidebar\n $this->load->view('home/page_body_sidebar', $data);\n // Close the page\n $this->load->view('page_body_footer', $data);\n }",
"public function generate()\n {\n # Build teh Header\n $this->buildHeader();\n\n # Switch the Views\n switch ($this->view) {\n case 'day':\n $this->buildBodyDay();\n break;\n case 'week':\n $this->buildBodyWeek();\n break;\n default:\n $this->buildBody();\n break;\n }\n # return thr string\n return $this->html;\n }",
"function blog($numPage = 1){\n\t\t//$this->traitementFormHeader();\n\t\t$this->infosDetail[\"numPage\"] = $numPage;\n\t\treturn $this->construireHtml([\"header\", \"section-blog\", \"footer\"]);\n\t}",
"public function afficherPost(){\r\n\t\t\t$gab = new Template(\"./\");\r\n\t\t\t$gab->set_filenames(array(\"body\" => \"template.post.html\"));\t\r\n\t\t\t$gab->assign_vars(array(\"user\" => $this->user));\r\n\t\t\t$gab->assign_vars(array(\"title\" => $this->title_post));\r\n\t\t\t$gab->assign_vars(array(\"text\" => $this->text_post));\r\n\t\t\t$gab->assign_vars(array(\"date\" => $this->date_post));\r\n\t\t\t$gab->assign_vars(array(\"id_post\" => $this->id_post));\r\n\t\t\t$gab->assign_vars(array(\"count_like\" => $this->count_like));\r\n\t\t\t$gab->assign_vars(array(\"count_answer\" => $this->count_answer));\r\n\t\t\t$gab->assign_vars(array(\"like_button\" => $this->like_button));\r\n\t\t\t$gab->assign_vars(array(\"like_value\" => $this->like_value));\r\n\t\t\t$gab->pparse(\"body\");\r\n\t\t}",
"public function display($post);",
"abstract protected function view_generatePageContent();",
"public function build_menu_page() {\n\n\t\t\t$tabindex = 0;\n\t\t\t$temp = array();\n\t\t\t$hidden = array();\n\t\t\t$this->data = get_option($this->slug.'_fields');\n\t\t\t\n\t\t\t$output = '';\n\t\t\t$output .= '<!-- wrap starts -->'.\"\\n\";\n\t\t\t$output .= \"\\t\".'<div class=\"wrap\">'.\"\\n\";\n\n\t\t\t$output .= '<h1>'.$this->options['title'].'</h1>'.\"\\n\";\n\n\t\t\t$output .= \"\\t\".'<form method=\"post\" action=\"'.$_SERVER['REQUEST_URI'].'\" enctype=\"multipart/form-data\">'.\"\\n\\n\";\n\n\t\t\tforeach ($this->data as $section => $fields) {\n\n\t\t\t\t$output .= \"\\t\".'<h2 class=\"title\" id=\"'.sanitize_title($section).'\">'.$section.'</h2>'.\"\\n\\n\";\n\n\t\t\t\t$output .= \"\\t\".'<table class=\"form-table theme-form-table\">'.\"\\n\";\n\t\t\t\t$output .= \"\\t\".'<tbody>'.\"\\n\";\n\n\t\t\t\tforeach ($fields as $id => $field) {\n\n\t\t\t\t\tif ($field['type'] != 'hidden') {\n\n\t\t\t\t\t\t$tabindex += 1;\n\t\t\t\t\t\t$temp += array($field['label'] => isset($field['value']) ? $field['value'] : '');\n\t\t\t\t\t\t$value = isset($_POST['updating']) ? Save::save_page($this->slug, $field) : Save::set_default_value($this->slug, $temp, $field);\n\n\t\t\t\t\t\t$description = (isset($field['description']) && !empty($field['description'])) ? '<span class=\"description\" id=\"'.Field::get_label_name($field['label']).'-info\">'.$field['description'].'</span>' : '';\n\t\t\t\t\t\t$toggle = (isset($field['description']) && !empty($field['description'])) ? '<a class=\"toggle\" data-toggle=\"form-description\" data-target=\"'.Field::get_label_name($field['label']).'-info\" title=\"'.__('Show info.', 'admin translation').'\">'.__('[+] Info', 'admin translation').'</a>' : '';\n\n\t\t\t\t\t\t$output .= \"\\t\".'<tr valign=\"top\">'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<th class=\"scope-one\" scope=\"row\"><label'.Field::get_label_error($field['label']).' for=\"'.Field::get_label_name($field['label']).'\">'.$field['name'].' <cite></cite></label></th>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td class=\"scope-two\">'.Field::get_field($this->slug, $field, $value).'<div class=\"field-info\">'.$description.'</div></td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td class=\"scope-three\">'.$toggle.'</td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'<td> </td>'.\"\\n\";\n\t\t\t\t\t\t$output .= \"\\t\".'</tr>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tarray_push($hidden, $field);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$output .= \"\\t\".'</tbody>'.\"\\n\";\n\t\t\t\t$output .= \"\\t\".'</table>'.\"\\n\\n\";\n\t\t\t\t$output .= \"\\t\".'<hr />'.\"\\n\\n\";\n\t\t\t}\n\n\t\t\t$output .= isset($_REQUEST['page']) ? \"\\t\".wp_nonce_field($_REQUEST['page']).\"\\n\" : '';\n\n\t\t\tforeach ($hidden as $id => $field) {\n\n\t\t\t\t$temp += array($field['label'] => isset($field['value']) ? $field['value'] : '');\n\t\t\t\t$value = isset($_POST['updating']) ? Save::save_page($this->slug, $field) : Save::set_default_value($this->slug, $temp, $field);\n\t\t\t\t\n\t\t\t\t$output .= Field::get_field($this->slug, $field, $value);\n\t\t\t}\n\t\t\t\n\t\t\t$output .= \"\\t\".'<input type=\"hidden\" id=\"updating\" name=\"updating\" value=\"1\" />'.\"\\n\";\n\t\t\t$output .= \"\\t\".'<p class=\"submit\"><input type=\"submit\" name=\"submit\" id=\"submit\" class=\"button button-primary\" value=\"'.__('Save Changes', 'admin translation').'\" /></p>'.\"\\n\";\n\t\t\t$output .= \"\\t\".'</form>'.\"\\n\";\n\n\t\t\t$output .= \"\\t\".'</div>'.\"\\n\";\n\t\t\t$output .= '<!-- wrap ends -->'.\"\\n\\n\";\n\n\t\t\t$output .= Field::get_form_feedback();\n\t\t\t\n\t\t\tValidation::reset_error();\n\n\t\t\techo $output;\n\t\t}"
] |
[
"0.696",
"0.6860179",
"0.6852585",
"0.6847191",
"0.67278755",
"0.66660607",
"0.6567037",
"0.6318268",
"0.6306781",
"0.6289134",
"0.6282355",
"0.62683606",
"0.62245166",
"0.6149113",
"0.6144237",
"0.6138769",
"0.6101573",
"0.6088951",
"0.60771894",
"0.60653156",
"0.6046471",
"0.60152936",
"0.6009144",
"0.600418",
"0.59889305",
"0.5984263",
"0.59802645",
"0.59799355",
"0.59648126",
"0.5963955"
] |
0.7005251
|
0
|
Return the HTML for the Publised Date and Last Updated section.
|
public function get_sidebar_dates(){
$html = '<tr class="wm-widget-sub-title"><td>Published:</td></tr><tr class="wm-widget-info"><td>';
$html .= get_the_date() . '</td></tr>';
if( strtotime( get_the_date() ) < strtotime( get_the_modified_date() ) ){
$html .= '<tr class="wm-widget-sub-title"><td>Last Updated:</td></tr><tr class="wm-widget-info"><td>';
$html .= get_the_modified_date() . '</td></tr>';
}
return $html;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPubDate()\n {\n return $this->_pubDate;\n }",
"public function get_updated_html()\n {\n }",
"function getPubDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_PUBDATE);\n\t}",
"function getPubDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_PUBDATE);\n\t}",
"function timeSincePublish($pub_date){\r\n\t\t\t$now_date = date('U');\r\n\t\t\t$since_date = $now_date - $pub_date;\r\n\t\t\t$since_hours = floor($since_date / 60 / 60);\r\n\t\t\t$since_days = floor($since_hours / 24);\r\n\t\t\r\n\t\t\t?><span style=\"display:none;\"><?php echo $pub_date; ?></span><?php\r\n\t\t\r\n\t\t\tif($since_hours<1 && $since_days<1){\r\n\t\t\t?><em>recently</em><?php\r\n\t\t\t}elseif($since_hours>=1 && $since_days<1){\r\n\t\t\t?><em><?=$since_hours?> hour<?= ($since_hours>1 ? 's':''); ?> ago</em><?php\r\n\t\t\t}elseif($since_hours>1 && $since_days>=1){\r\n\t\t\t?><em><?= ($since_days==1 ? 'yesterday':$since_days.' days ago'); ?></em><?php\r\n\t\t\t}\r\n\t\t}",
"public static function getPubDate()\n {\n return self::$pubDate;\n }",
"public function getDatePubli()\r\n {\r\n return $this->datePubli;\r\n }",
"function newsdot_posted_on() {\n\t\tif ( get_theme_mod( 'newsdot_show_post_date', true ) ) :\n\t\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t\t}\n\n\t\t\t$time_string = sprintf(\n\t\t\t\t$time_string,\n\t\t\t\tesc_attr( get_the_date( DATE_W3C ) ),\n\t\t\t\tesc_html( get_the_date() ),\n\t\t\t\tesc_attr( get_the_modified_date( DATE_W3C ) ),\n\t\t\t\tesc_html( get_the_modified_date() )\n\t\t\t);\n\n\t\t\t?>\n\n\t\t\t<span class=\"posted-on\">\n\t\t\t\t<i class=\"far fa-calendar\"></i>\n\t\t\t\t<a href=\"<?php echo esc_url( get_permalink() ); ?>\" rel=\"bookmark\"><?php echo $time_string; ?></a>\n\t\t\t</span>\n\n\t\t\t<?php\n\t\tendif;\n\t}",
"function newsdot_posted_on_single() {\n\t\tif ( get_theme_mod( 'newsdot_show_post_date', true ) ) :\n\t\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t\t$time_string_updated = '<time class=\"updated single-updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t\t}\n\n\t\t\t$time_string = sprintf(\n\t\t\t\t$time_string,\n\t\t\t\tesc_attr( get_the_date( DATE_W3C ) ),\n\t\t\t\tesc_html( get_the_date() ),\n\t\t\t\tesc_attr( get_the_modified_date( DATE_W3C ) ),\n\t\t\t\tesc_html( get_the_modified_date() )\n\t\t\t);\n\n\t\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t\t$time_string_updated = sprintf(\n\t\t\t\t\t$time_string_updated,\n\t\t\t\t\tesc_attr( get_the_date( DATE_W3C ) ),\n\t\t\t\t\tesc_html( get_the_date() ),\n\t\t\t\t\tesc_attr( get_the_modified_date( DATE_W3C ) ),\n\t\t\t\t\tesc_html( get_the_modified_date() )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t?>\n\n\t\t\t<span class=\"posted-on\">\n\t\t\t\t<span><?php esc_html_e( 'Published On: ', 'newsdot' ); ?></span>\n\t\t\t\t<a href=\"<?php echo esc_url( get_permalink() ); ?>\" rel=\"bookmark\"><?php echo $time_string; ?></a>\n\t\t\t\t<?php if ( get_theme_mod( 'newsdot_show_updated_date_single', true ) && ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) ) : ?>\n\t\t\t\t\t<span class=\"ml-12\"><?php esc_html_e( 'Last Updated On: ', 'newsdot' ); ?></span>\n\t\t\t\t\t<a href=\"<?php echo esc_url( get_permalink() ); ?>\" rel=\"bookmark\"><?php echo $time_string_updated; ?></a>\n\t\t\t\t<?php endif; ?>\n\t\t\t</span>\n\n\t\t\t<?php\n\t\tendif;\n\t}",
"public function getDatePublished() {\n\t\treturn date(\"d/m/Y\", strtotime($this->datePublished));\n\t}",
"private function getPublishedDate(): string\n {\n if ($this->context->get('is_term')) {\n return '';\n }\n\n if (!$this->context->get('date')) {\n return '';\n }\n\n return $this->formatIso8601($this->augmented($this->context->get('date')), false);\n }",
"public function getPublishedTime()\n {\n $this->initialRequest();\n if (isset($this->item['snippet']['publishedAt'])) {\n return date('Y-m-d H:i:s', strtotime($this->item['snippet']['publishedAt']));\n }\n else {\n $this->onApiBadInterpretation(\"snippet.publishedAt not found\");\n }\n }",
"public function _getDatePublish()\n {\n return $this->_getArticleDataVal('pubDate');\n }",
"public function getPublish_date() {\n return $this->publish_date;\n }",
"public function getPublishedAt()\n {\n return $this->published_at;\n }",
"function accouk_display_post_last_updated() {\n\n $show_last_updated = array(\n 'web',\n 'ecommerce',\n 'development'\n );\n\n global $main_category;\n\n if(!in_array($main_category['slug'], $show_last_updated))\n return;\n\n if(get_the_date('d-m-Y') === get_the_modified_date('d-m-Y'))\n return;\n\n echo '<div class=\"last-updated-date\">Last updated '; the_modified_date(); echo '</div>';\n\n}",
"public function getPublicationDate()\n {\n return $this->publicationDate;\n }",
"public function getDatePublished() {\n\t\t\treturn $this->date_published;\n\t\t}",
"public function getPublishedAt()\n {\n return $this->publishedAt;\n }",
"public function getPublishedAt()\n {\n return $this->publishedAt;\n }",
"function yeti_entry_meta() {\n echo '<p class=\"byline\"><time class=\"updated\" datetime=\"'. get_the_time('c') .'\" pubdate>'. sprintf(__('Posted on %s at %s.', 'yeti'), get_the_time('l, F jS, Y'), get_the_time()) .'</time></p>';\n //echo '<p class=\"byline author\">'. __('Written by', 'reverie') .' <a href=\"'. get_author_posts_url(get_the_author_meta('ID')) .'\" rel=\"author\" class=\"fn\">'. get_the_author() .'</a></p>';\n}",
"public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }",
"function dx_write_deploy_date() {\n\n\t// And some inline style. Its not needed to hook it in wp_head at all for just 4-5 properties.\n\t$style = \"position:fixed; bottom:0; right:0; display: block; padding: 0px 2px; font-family: 'Courier New'; font-size: 10px; margin: 0; background: black; color: white;line-height:1em\";\n\n // Print the end result\n if(isset($_COOKIE['dx_deploy_timer_cooke'])) {\n\t\techo '<p class=\"deploy-date\" style=\"'.$style.'\">Deployed: '.$_COOKIE['dx_deploy_timer_cooke'].' GMT +0</p>';\n\t} else {\n\t\t$cur_date = get_date_mod();\n\t\techo '<p class=\"deploy-date\" style=\"'.$style.'; background: blue\">Deployed: '.$cur_date.' GMT +0 (Cookies updated)</p>';\n\t}\n}",
"function display() {\n\t\t$events = $this->events;\n\t\tif (!$events) return '';\n\t\t$olddate = '';\n\t\t$displaystring .= '<div class=\"gw-post\">';\n\n\t\tforeach($events as $event) {\n\t\t\t$start = $event['starttime'];\n\t\t\t// check for new dates\n\t\t\t$newdate = date('l, n/j/y', $start);\n\t\t\tif (strcmp($newdate, $olddate)) {\n\t\t\t\t// $newdate != $olddate\n\t\t\t\t$displaystring .= '<div class=\"gw-date-wrap\"><div class=\"gw-date\">' . $newdate . '</div></div>';\n\t\t\t\t$olddate = $newdate;\n\t\t\t}\n\t\t\tif ($event['isfeatured']) {\n\t\t\t $displaystring .= '<div class=\"gw-featured\">';\n\t\t\t}\n\t\t\tif ($event['post_link']) {\n\t\t\t $displaystring .= '<a href=\"'.$event['post_link'].'\">';\n\t\t\t}\n\t\t\t$displaystring .= '<div class=\"gw-event ' . $event['tag'] . '\">';\n\t\t\t$displaystring .= '<span class=\"gw-bullet\"> </span><div class=\"gw-time\">' . date('g:i a', $start) . '</div>';\n\t\t\t$displaystring .= '<div class=\"gw-title\">' . $event['title'];\n\t\t\tif ($event['location']) {\n\t\t\t\t$displaystring .= ' @ ' . $event['location'] . $this->displayMap($event['address']);\n\t\t\t}\n\t\t\t$displaystring .= '</div>'; //close .gw-title\n\t\t\t$displaystring .= '</div>'; // close .gw-event \n\t\t\tif ($event['post_link']) {\n\t\t\t $displaystring .= '</a>';\n\t\t\t}\n\t\t\tif ($event['isfeatured']) {\n\t\t\t $displaystring .= '</div>';\n\t\t\t}\n\t\t\t\n\n\t\t} // end foreach\n\t\t\n\t\t$displaystring .= '</div>'; // close .textwidget\n\t\treturn $displaystring;\n\t}",
"protected function getLastPublishDate(): array {\n $lastPublishDate = $this->t('Not available');\n if ($this->node()->isNew()) {\n $lastPublishDate = $this->t('Not saved yet');\n }\n else {\n $revision = $this->nodeRevisionManager->loadLatestPublishedRevision($this->node());\n if (NULL !== $revision) {\n $lastPublishDate = $this->dateFormatter->format($revision->getChangedTime(), 'tieto_date');\n }\n }\n\n return [\n '#type' => 'container',\n '#weight' => 0,\n '#attributes' => [\n 'class' => [\n 'node-meta--last-publish-date',\n ],\n ],\n 'label' => [\n '#type' => 'html_tag',\n '#tag' => 'label',\n '#attributes' => [\n 'class' => [\n 'actions-info-label',\n 'actions-info--last-publish-date--label',\n ],\n ],\n '#value' => $this->t('Last publish date'),\n ],\n 'value' => [\n '#type' => 'html_tag',\n '#tag' => 'span',\n '#attributes' => [\n 'class' => [\n 'actions-info-value',\n 'actions-info--last-publish-date--value',\n ],\n ],\n '#value' => $lastPublishDate,\n ],\n ];\n }",
"function smart_foundation_posted_on() {\n\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time>';\n\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t$time_string .= '<time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t}\n\n\t$time_string = sprintf( $time_string,\n\t\tesc_attr( get_the_date( 'c' ) ),\n\t\tesc_html( get_the_date() ),\n\t\tesc_attr( get_the_modified_date( 'c' ) ),\n\t\tesc_html( get_the_modified_date() )\n\t);\n\n\tprintf( __( '<span class=\"posted-on\">Posted on %1$s</span><span class=\"byline\"> by %2$s</span>', 'smart_foundation' ),\n\t\tsprintf( '<a href=\"%1$s\" rel=\"bookmark\">%2$s</a>',\n\t\t\tesc_url( get_permalink() ),\n\t\t\t$time_string\n\t\t),\n\t\tsprintf( '<span class=\"author\"><a class=\"url fn n\" href=\"%1$s\">%2$s</a></span>',\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_html( get_the_author() )\n\t\t)\n\t);\n}",
"public function getPublishedAt()\n {\n return $this->_publishedAt;\n }",
"public function getPublishTime()\n {\n return $this->publish_time;\n }",
"function pixelgrade_posted_on() {\n\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t}\n\n\t\t$time_string = sprintf(\n\t\t\t$time_string,\n\t\t\tesc_attr( get_the_date( 'c' ) ),\n\t\t\tesc_html( get_the_date() ),\n\t\t\tesc_attr( get_the_modified_date( 'c' ) ),\n\t\t\tesc_html( get_the_modified_date() )\n\t\t);\n\n\t\tprintf( '<span class=\"byline\"> <span class=\"by\">%1$s</span> <span class=\"author vcard\"><a class=\"url fn n\" href=\"%2$s\">%3$s</a></span></span><span class=\"posted-on\"><a href=\"%4$s\" rel=\"bookmark\">%5$s</a></span>',\n\t\t\tesc_html_x( 'by', 'post author', '__components_txtd' ),\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_html( get_the_author() ),\n\t\t\tesc_url( get_permalink() ),\n\t\t\twp_kses( $time_string, array( 'time' => array( 'class' => true, 'datetime' => true, ) ) )\n\t\t);\n\n\t}",
"function getDatePublished()\n {\n $datePublished = $this->get('schema:datePublished');\n return $datePublished;\n }"
] |
[
"0.64712936",
"0.6393054",
"0.6385944",
"0.6385944",
"0.63327026",
"0.6280578",
"0.62043846",
"0.6195692",
"0.6190153",
"0.61880004",
"0.6065353",
"0.60268784",
"0.60168475",
"0.5989355",
"0.5976707",
"0.59322137",
"0.5905851",
"0.5892158",
"0.5871088",
"0.5871088",
"0.58509034",
"0.58485186",
"0.5841742",
"0.5841416",
"0.5831292",
"0.58312106",
"0.58244294",
"0.5820848",
"0.58071226",
"0.5803166"
] |
0.6677661
|
0
|
Returns a new instance of a question type object from a given type.
|
public static function create($type, $array)
{
switch ($type) {
case "mcq":
return new QuestionMcq($array);
break;
case "mrq":
return new QuestionMrq($array);
break;
case "text":
return new QuestionText($array);
break;
case "textlong":
return new QuestionTextLong($array);
break;
default:
throw new Exception("QuestionFactory_ClassNotFoundException");
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function create($question, $type = ObjectFactory::TEXT_QUESTION) {\n $questionObj = $this->objectFactory->createQuestion($type);\n $questionObj->setQuestion($question);\n $this->poll->addItem($questionObj);\n return $questionObj;\n\t}",
"public function create($question, $type = ObjectFactory::TEXT_QUESTION)\n\t{\n\t\t// echo $type;\n\t\t$newQuestion = $this->objectFactory->createQuestion($type);\n\t\t// if ($type == ObjectFactory::SINGLE_CHOICE_QUESTION) echo \"single\";\n\t\t// echo $question;\n\t\t$newQuestion->setQuestion($question);\n\t\t$this->questions[$newQuestion->getId()] = $newQuestion;\n\t\treturn $newQuestion;\n\t}",
"public function setTypeQuestion($typeQuestion)\n {\n $this->typeQuestion = $typeQuestion;\n\n return $this;\n }",
"public static function get_new($type) {\n // Get type name\n if (!$type) {\n $type = 'general';\n }\n if (!preg_match('~^[a-z][a-z0-9_]*$~', $type)) {\n throw new coding_exception(\"Invalid forum type name: $type\");\n }\n $classname = 'forumngtype_' . $type;\n\n // Require library\n global $CFG;\n require_once(dirname(__FILE__) . \"/$type/$classname.php\");\n\n // Create and return type object\n return new $classname;\n }",
"public function make($type);",
"public static function get_type($type = \"Posts\") {\r\n\t\t$_type = \"\\\\ESWP\\\\MyTypes\\\\\".\"$type\";\r\n\t\treturn new $_type();\r\n\t}",
"public function make($type)\n {\n if ($instance = array_get($this->resolved, $type)) {\n return $instance;\n }\n\n return $this->build($type);\n }",
"private function make_answer_obj( $type, $args = array() ) {\n\n\t\t\tswitch ( $type ) {\n\n\t\t\t\tcase 'single':\n\t\t\t\tcase 'multiple':\n\t\t\t\t\t$object = new ReflectionClass( LDLMS_Base_Answer_Type::class );\n\t\t\t\t\treturn $object->newInstanceArgs( $args );\n\n\t\t\t\tcase 'sort_answer':\n\t\t\t\tcase 'matrix_sort_answer':\n\t\t\t\t\t$object = new ReflectionClass( LDLMS_Sort_Answer::class );\n\t\t\t\t\treturn $object->newInstanceArgs( $args );\n\n\t\t\t\tcase 'assessment_answer':\n\t\t\t\t\t$object = new ReflectionClass( LDLMS_Assessment_Answer::class );\n\t\t\t\t\treturn $object->newInstanceArgs( $args );\n\n\t\t\t\tcase 'cloze_answer':\n\t\t\t\t\t$object = new ReflectionClass( LDLMS_Cloze_Answer::class );\n\t\t\t\t\treturn $object->newInstanceArgs( $args );\n\n\t\t\t\tcase 'free_answer':\n\t\t\t\t\t$object = new ReflectionClass( LDLMS_Free_Answer::class );\n\t\t\t\t\treturn $object->newInstanceArgs( $args );\n\n\t\t\t\tcase 'essay':\n\t\t\t\t\t$object = new ReflectionClass( LDLMS_Essay_Answer::class );\n\t\t\t\t\treturn $object->newInstanceArgs( $args );\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception( __( 'Invalid question type supplied', 'learndash' ), 404 );\n\t\t\t}\n\t\t}",
"public function setType(string $type): self;",
"public function setType(string $type): self;",
"public static function build($type) {\n $product = $type;\n if (class_exists($product)) {\n return new $product();\n }\n else {\n throw new Exception(\"Invalid product type given.\");\n }\n }",
"public static function create($type)\n\t{\n\t\tif (empty($type) || 0 === strpos($type, 'text/html')) {\n\t\t\treturn new HttpGetRequest;\n\t\t}\n\n\t\tif (0 === strpos($type, 'application/json')) {\n\t\t\treturn new HttpJsonRequest;\n\t\t}\n\n\t\treturn new HttpPostRequest;\n\t}",
"public static function createFromType($type)\n\t{\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase self::POINT: $obj = new SpatialPoint(); break;\n\t\t\tcase self::LINE_STRING: $obj = new SpatialLineString(); break;\n\t\t\tcase self::POLYGON: $obj = new SpatialPolygon(); break;\n\t\t\tcase self::MULTI_POINT: $obj = new SpatialMultiPoint(); break;\n\t\t\tcase self::MULTI_LINE_STRING: $obj = new SpatialMultiLineString(); break;\n\t\t\tcase self::MULTI_POLYGON: $obj = new SpatialMultiPolygon(); break;\n\t\t\tcase self::GEOMETRY_COLLECTION: $obj = new SpatialGeometryCollection(); break;\n\t\t\tdefault: throw new Exception(\"Spatial type {$type} was not found\");\n\t\t}\n\n\t\treturn $obj;\n\t}",
"public function type($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"public function type($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"public static function create($type = NULL) {\n if ($type) {\n $cname = \"BMAttack\" . ucfirst(strtolower($type));\n if (class_exists($cname)) {\n return $cname::create();\n } else {\n return NULL;\n }\n }\n\n $class = get_called_class();\n return new $class;\n }",
"public function withType($type)\n {\n $this->type = $type;\n return $this;\n }",
"private function setType($type)\n {\n if (is_string($type)) {\n $this->type = $type;\n }\n\n return $this;\n }",
"public function type($type)\n {\n $this->is_type = $type;\n return $this;\n }",
"function &_instanciateQuestion($question_id) \n\t{\n\t\tif ($question_id < 1) return FALSE;\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\tif (strlen($question_type) == 0) return FALSE;\n\t\tSurveyQuestion::_includeClass($question_type);\n\t\t$question = new $question_type();\n\t\t$question->loadFromDb($question_id);\n\t\treturn $question;\n }",
"public static function factory($type)\n\t{\n\t\t$class = 'MHTTPD_'.ucfirst($type);\n\t\treturn new $class;\n\t}",
"public static function getInstance(string $type)\n\t{\n\t\t$instance = new static();\n\t\t$instance->type = $type;\n\t\t$instance->loadConfig();\n\t\treturn $instance;\n\t}",
"public function setType($type)\n\n {\n\n $this->type = $type;\n\n\n\n return $this;\n\n }",
"public function type()\n {\n return $this->hasOne('App\\Type', 'question_type');\n }",
"protected function setType($type)\n {\n $this->type = $type;\n return $this;\n }",
"public function type(string $type): self\r\n {\r\n $this->type = $type;\r\n return $this;\r\n }",
"public function getQuestiontype()\n {\n return $this->hasOne(QuestionType::className(), ['id' => 'question_type_id']);\n }",
"static function make($type)\n {\n $scraper = null;\n\n switch ($type) {\n case 'ElAderezo':\n $scraper = new ScraperElAderezo;\n break; \n case 'GastronomiaYCia':\n $scraper = new ScraperGastronomiaYCia;\n break;\n case 'UtensiliosDeCocina':\n $scraper = new ScraperUtensiliosDeCocina;\n break;\n } \n return $scraper;\n }",
"public function setType($type): self\n {\n $this->type = $type;\n\n return $this;\n }",
"public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }"
] |
[
"0.71917206",
"0.7169161",
"0.6743878",
"0.6612354",
"0.65161306",
"0.64408576",
"0.6431556",
"0.63544756",
"0.6207042",
"0.6207042",
"0.61765534",
"0.6045034",
"0.59302336",
"0.58876675",
"0.58876675",
"0.5881977",
"0.583725",
"0.57928276",
"0.57760805",
"0.57624876",
"0.5757491",
"0.5729714",
"0.57272375",
"0.5726815",
"0.5720642",
"0.5720045",
"0.5704968",
"0.56974226",
"0.56950295",
"0.56766254"
] |
0.7591309
|
0
|
authenticate() defined by Zend_Auth_Adapter_Interface. This method is called to attempt an authenication. Previous to this call, this adapter would have already been configured with all nessissary information to successfully connect to a database table and attempt to find a record matching the provided identity.
|
public function authenticate()
{
$model = new Default_Model_User();
$result = false;
foreach ($model->getAll() as $key => $user) {
if ($user['handle'] == $this->_identity && $user['password'] == $this->_credential) {
$result = (object)$user;
}
}
$code = Zend_Auth_Result::FAILURE;
$messages = array();
if ($result === false || $result->active === 0) {
$code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;
$messages[] = 'A record with the supplied identity could not be found.';
} elseif ($this->_credential !== $result->password) {
$code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
$messages[] = 'Supplied credential is invalid.';
} else {
unset($result->password);
$this->_resultRow = $result;
$code = Zend_Auth_Result::SUCCESS;
$messages[] = 'Authentication successful.';
}
return new Zend_Auth_Result($code, $this->_identity, $messages);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function authenticate()\n {\n $this->_authenticateSetup();\n $dbSelect = $this->_authenticateCreateSelect();\n $resultIdentities = $this->_authenticateQuerySelect($dbSelect);\n $authResult = $this->_authenticateValidateResultset($resultIdentities);\n if ($authResult instanceof Zend_Auth_Result) {\n return $authResult;\n }\n \n $authResult = $this->_authenticateValidateResult(\n array_shift($resultIdentities)\n );\n return $authResult;\n }",
"public function authenticate(AuthenticationInterface $authAdapter);",
"protected function _authenticateSetup()\n {\n $exception = null;\n\n if ($this->_tableName == '') {\n $exception = 'A table must be supplied for the ' . __CLASS__\n . ' authentication adapter.';\n } else if ($this->_identityColumn == '') {\n $exception = 'An identity column must be supplied for the '\n . __CLASS__ . ' authentication adapter.';\n } else if ($this->_credentialColumn == '') {\n $exception = 'A credential column must be supplied for the '\n . __CLASS__ . ' authentication adapter.';\n } else if ($this->_identity == '') {\n $exception = 'A value for the identity was not provided prior ' \n . 'to authentication with ' . __CLASS__ . '.';\n } else if ($this->_credential === null) {\n $exception = 'A credential value was not provided prior to ' \n . 'authentication with ' . __CLASS__ . '.';\n }\n\n if (null !== $exception) {\n /**\n * @see Zend_Auth_Adapter_Exception\n */\n throw new Zend_Auth_Adapter_Exception($exception);\n }\n \n $this->_authenticateResultInfo = array(\n 'code' => Zend_Auth_Result::FAILURE,\n 'identity' => $this->_identity,\n 'messages' => array()\n );\n \n return true;\n }",
"public function authenticate(IAuthentication $auth) ;",
"public function authenticate()\n {\n $codeError = Zend_Auth_Result::FAILURE;\n\n $userRow = DbTable_User::getInstance()->fetchRow(\n array('Login = ?' => $this->getUsername())\n );\n\n if (!$userRow) {\n return new Zend_Auth_Result($codeError, null, array('Authentication error'));\n }\n\n $hashedPassword = Vtx_Util_String::hashMe(\n $this->getPassword(), $userRow->getSalt()\n );\n\n if ($hashedPassword['sha'] != $userRow->getKeypass()) {\n return new Zend_Auth_Result($codeError, null, array('Authentication error'));\n }\n\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $userRow, array());\n }",
"public function authenticate()\n {\n $core = Zend_Controller_Front::getInstance()->getParam(\"bootstrap\")->getResource(\"core\");\n /* @var $response Adsolut_Http_Response */\n $response = $core->get($this->endpoint, \n array(\n 'email' => $this->username,\n 'password' => $this->password));\n $result = Zend_Auth_Result::FAILURE;\n if (!$response->hasErrors()) {\n $result = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND;\n $data = $response->getData();\n if (!empty($data)) {\n $result = Zend_Auth_Result::SUCCESS;\n }\n } \n return new Zend_Auth_Result($result, $response->getData());\n }",
"public function authenticate(\\Zend_Auth_Adapter_Interface $adapter)\n {\n $result = $adapter->authenticate();\n $identity = $result->getIdentity();\n if(NULL === $identity) {\n return $result;\n }\n if(get_class($identity) !== 'TBS\\Auth\\Identity\\Generic' &&\n !is_subclass_of($identity, 'TBS\\Auth\\Identity\\Generic')) {\n throw new \\Exception('Not a valid identity');\n }\n \n $currentIdentity = $this->getIdentity();\n \n if(false === $currentIdentity \n || get_class($currentIdentity) !== 'TBS\\Auth\\Identity\\Container') \n {\n $currentIdentity = new Auth\\Identity\\Container();\n }\n $currentIdentity->add($result->getIdentity());\n \n if ($this->hasIdentity()) {\n $this->clearIdentity();\n }\n \n if ($result->isValid()) {\n $this->getStorage()->write($currentIdentity);\n }\n \n return $result;\n }",
"public function authenticate()\n\t{\n\t\tif ($this->hasErrors())\n return; // There are errors already\n\t\t\n $identity = $this->getIdentity();\n if ($identity->ok)\n return; // Authenticate successfully\n \n if (!YII_DEBUG) {\n $this->addError('password','Incorrect email or password.');\n\n } else {\n switch ($identity->errorCode) {\n case UserIdentity::ERROR_USERNAME_INVALID:\n $this->addError('email', 'Invalid email.');\n break;\n\n case UserIdentity::ERROR_PASSWORD_INVALID:\n $this->addError('email', 'Invalid password.');\n break;\n\n default:\n $this->addError('password', 'Unknown UserIdenitity error.');\n break;\n }\n }\n\t}",
"protected function _authenticateSetup()\n {\n $exception = null;\n \n if ($this->_rest === null) {\n $exception = 'A REST location was not set.';\n } elseif ($this->_identityColumn == '') {\n $exception = 'An identity column must be supplied for the Etd_Auth_Adapter authentication adapter.';\n } elseif ($this->_credentialColumn == '') {\n $exception = 'A credential column must be supplied for the Etd_Auth_Adapter authentication adapter.';\n } elseif ($this->_identity == '') {\n $exception = 'A value for the identity was not provided prior to authentication with Etd_Auth_Adapter.';\n } elseif ($this->_credential === null) {\n $exception = 'A credential value was not provided prior to authentication with Etd_Auth_Adapter.';\n }\n\n if (null !== $exception) {\n /**\n * @see Zend_Auth_Adapter_Exception\n */\n require_once 'Zend/Auth/Adapter/Exception.php';\n throw new Zend_Auth_Adapter_Exception($exception);\n }\n \n $this->_authenticateResultInfo = array(\n 'code' => Zend_Auth_Result::FAILURE,\n 'identity' => $this->_identity,\n 'messages' => array()\n );\n \n return true;\n }",
"public function invoke()\n {\n $this->authenticationManager->authenticate();\n }",
"public function authenticate()\n {\n $concat = $this->_password.self::getSalt();\n\n $sql = \"SELECT\n id\n FROM account\n WHERE\n email = '{$this->_email}'\n AND password = MD5(CONCAT(hash, '{$concat}'))\";\n\n $user = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne($sql);\n \n // check to make sure the email address and password match\n if (!$user) {\n $error = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;\n return new Zend_Auth_Result($error, 0);\n }\n\n $account = Js_Query::create()->from('account')->where('id = ?', $user['id'])->fetchOne();\n \n // return a valid login\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $account);\n }",
"public function authenticate();",
"public function authenticate();",
"public function authenticate();",
"public function authenticate()\n\t{\n\t\t$this->record = User::model()->findByAttributes(\n\t\t\tarray(\"username\" => $this->username)\n\t\t);\n\t\t\n\t\t// controleer record\n\t\tif($this->record === null){\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t}else if($this->record->password !== User::encrypt($this->password)){\n\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t}else{\n\t\t\t$this->_id = $this->record->id;\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t}\n\t\t\n\t\treturn !$this->errorCode;\n\t}",
"public function authenticate() {\n\n $ldap = Yii::app()->ldap;\n\n $result = $ldap->authenticate($this->username, $this->password);\n $ldapUserInfo = $ldap->user()->infoCollection($this->username, array(\"mail\", \"displayname\"));\n\n\n if (!$result) {\n $this->errorCode = self::ERROR_USERNAME_INVALID;\n } else {\n\n $this->setState('fullname', $ldapUserInfo->displayname);\n $this->setState('email', $ldapUserInfo->mail);\n\n $dbUser = Users::model()->findByAttributes(array('ldap' => $this->username));\n if (!$dbUser) {\n $dbUser = new Users();\n $dbUser->ldap = $this->username;\n $dbUser->full_name = $ldapUserInfo->displayname;\n $dbUser->pass = $this->password;\n $dbUser->mail = $ldapUserInfo->mail;\n $dbUser->salt = 'f';\n $dbUser->url = 'f';\n $dbUser->create = time();\n\n $dbUser->save();\n //print_r($dbUser);\n }\n \n $this->_id = $dbUser->primaryKey;\n\n $this->errorCode = self::ERROR_NONE;\n \n }\n\n\n return !$this->errorCode;\n }",
"public function authenticate()\n {\n try\n \t{\n \t\t$user = AdminUser::authenticate($this->_username, $this->_password);\n \t\t$result = new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $user, array());\n \t\treturn $result;\n \t}\n catch (Exception $e)\n {\n \tswitch ($e->getMessage())\n \t{\n \t\tcase AdminUser::WRONG_PW:\n \t\tcase AdminUser::NOT_FOUND:\n \t\t\treturn new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, null, array());\n \t\t\tbreak;\n \t}\n\n throw $e;\n }\n }",
"public function authenticate() {\n // Try to fetch the user from the database using the model\n \n \t$class=new Admin_Model_ContentMapper();\n \t\n \t$dbAdapter = $class->getDbTable()->getAdapter();\n \t$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);\n \t$auth=Zend_Auth::getIdentity();\n \t\n \t$class=new Admin_Model_ContentMapper();\n \t$user=$class->execQuery(\"select id_espacepro,status from \".DBPREFIX.\"espacepro where pass=?\", array($this->password),1);\n \t\n \t// Do we have a valid user?\n \tif (!$user||(int)$user->status!==1)return false;\n \t\n \tif(!$auth->hasIdentity()):\n \t\n \t$authAdapter->setTableName( DBPREFIX.'espacepro')\n \t->setIdentityColumn('pass')\n \t->setCredentialColumn('pass');\n \t$authAdapter->setIdentity($this->password)->setCredential($this->password);\n \t \n \t$auth=Zend_Auth::getInstance();\n \t \n \t$result=$auth->authenticate($authAdapter);\n \tendif;\n \t\n \t\n \t$data=$auth->getStorage()->read();\n \t\n \t$data->zonepro=md5($user->id_espacepro);\n \t$auth->getStorage()->write($data);\n \t\n \tvar_dump($auth->getIdentity());\n \t\n \tdie();\n \t\n // Initialize return values\n $code = Zend_Auth_Result::FAILURE;\n $identity = null;\n $messages = array();\n\t\t\n $class=new Admin_Model_ContentMapper();\n $user=$class->execQuery(\"select id_espacepro,status from \".DBPREFIX.\"espacepro where pass=?\", array($this->password),1);\n \n // Do we have a valid user?\n if (!$user||(int)$user->status!==1){\n $messages[] = 'Authentication error';\n \n } else {\n \t \t\n \t\t$code = Zend_Auth_Result::SUCCESS;\n \t\t$identity = $user;\n \t\n }\n\n return new Zend_Auth_Result($code, array(\"id_espacepro\"=>md5($user->id_espacepro)), $messages);\n }",
"public function authenticate()\n {\n $credential = $this->getCredential();\n $identity = $this->getIdentity();\n $userObject = $this->getUserObject();\n\n $bcrypt = new Bcrypt();\n $bcrypt->setCost(14);\n\n if (!$bcrypt->verify($this->getCredential(),$userObject->getPassword())) {\n // Password does not match\n return false;\n }\n\n $this->updateIdentity($userObject);\n\n return $this->getAuthResult(AuthenticationResult::SUCCESS, $userObject->getEmail());\n }",
"public function authenticate() {\n $id = $this->_id;\n if (!empty($id)) {\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n /* login() is never returns on success */\n if (!$this->_check_immediate) {\n if (!$consumer->login($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n } else {\n if (!$consumer->check($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n } else {\n $params = (isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD']=='POST') ? $_POST: $_GET;\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n if ($consumer->verify(\n $params,\n $id,\n $this->_extensions)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::SUCCESS,\n $id,\n [\"Authentication successful\"]);\n } else {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n }",
"function authenticate() {}",
"public function authenticate() {\n $user = Zebu_User::createInstance($this->username);\n if($user && $this->passhash == $user->passhash){\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS,$this->username);\n }\n return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,$this->username);\n }",
"public function authenticate() {\n if ($this->email == null || $this->password == null) {\n return new Result(Result::FAILURE);\n }\n $UserMapper = $this->getServiceLocator()->get(\"Profond\\Mapper\\User\");\n $UserMapper->setServiceLocator($this->getServiceLocator());\n $User = $UserMapper->getOneUserByEmail($this->email);\n if ($User != null) {\n if ($this->password == $User->getPassword()) {\n return new Result(Result::SUCCESS, $User);\n } else {\n return new Result(Result::FAILURE_CREDENTIAL_INVALID, null);\n }\n } else {\n return new result(Result::FAILURE_IDENTITY_NOT_FOUND, null);\n }\n }",
"public function authenticate()\n\t{\n\n\t\t$username = strtolower($this->username);\n\t\t/** @var $user User */\n\t\t$user = User::model()->with('roles')->find('LOWER(use_username)=?', array($username));\n\t\tif ($user === null) {\n\t\t\t$this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\t} else {\n\t\t\tif (!$user->validatePassword($this->password)) {\n\t\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\t\t} else {\n\t\t\t\t$this->_id = $user->use_id;\n\t\t\t\t$this->username = $user->use_fname;\n\t\t\t\t$this->_branchId = $user->use_branch;\n\t\t\t\t$this->_scope = $user->use_scope;\n\t\t\t\t$this->_roles = $user->roles;\n\n\t\t\t\t$this->userData = serialize($user);\n\n\t\t\t\tYii::app()->user->setState(\"fullname\", $user->getFullName());\n\n\t\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t\t\t$this->loadSessionForOldLogin($user);\n\t\t\t}\n\t\t}\n\t\tLoginLog::model()->log($this, $user);\n\t\treturn $this->errorCode == self::ERROR_NONE;\n\t}",
"public function authenticate()\n {\n if (!isset($_SERVER['PHP_AUTH_DIGEST']) || empty($_SERVER['PHP_AUTH_DIGEST'])) {\n\t\t\t//error_log(\"...\".$_SERVER['PHP_AUTH_DIGEST'].\"...\");\n\t\t\terror_log(\"Not Authorized\");\n\t\t\t$e = new Exception('Authentication required.', self::ERROR_DIGEST_MISSING, null);\n $this->handleError($e);\n }\n \n $data = $this->_parseDigest();\n\t\t\n\t\tif (!$data) {\n\t\t\t$e = new Exception('Invalid authorization digest.', self::ERROR_DIGEST_INVALID, null);\n $this->handleError($e); \n }\n\t\tif ($data['username']==\"anonymous\" || $data['username']==\"\") {\n\t\t\tZend_Registry::set('userID', -1);\n\t\t\treturn true;\n\t\t} else if (strpos($data['username'],\"uuid_\")===0) {\n\t\t\tZend_Registry::set('userID', $data['username']);\n\t\t\treturn true;\n\t\t}\n // Make sure the user exists.\n \n $knownUserData = mysql_query(\"SELECT * FROM `accounts` WHERE `username`='\".mysql_real_escape_string($data['username']).\"' OR `email`='\".mysql_real_escape_string($data['username']).\"'\") or die(mysql_error());\n //if (!isset($this->_users[$data['username']])) {\n if (mysql_num_rows($knownUserData)!==1) { \n\t\t\t$e = new Exception('Invalid credentials', self::ERROR_CREDENTIALS_INVALID, null);\n throw $e;\n }\n\t\t\n\t\t$knownUserData = mysql_fetch_assoc($knownUserData);\n\t\t// Save the username so we can use it for access control checks\n // in other scripts.\n Zend_Registry::set('username', $data['username']);\n \n // Generate the server response.\n $password = $knownUserData['lastKnownPassword']; //$this->_users[$data['username']];\n\t\tZend_Registry::set('userID', $knownUserData['userID']);\n\t\tZend_Registry::set('userIDEncrypted', $knownUserData['userIDEncrypted']);\n\t\t//check password & username against thinklg.com data\n\t\t\n\t\t\n $HA1 = md5($data['username'] . ':' . self::AUTH_REALM . ':' . $password);\n\t\t$HA2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']);\n\t\t$valid_response = md5(\n $HA1 // hash 1\n . ':' // separator\n . $data['nonce'] // nonce\n . ':' // separator\n . $data['nc'] // nonce count \n . ':' // separator\n . $data['cnonce'] // client nonce\n . ':' // separator\n . $data['qop'] // quality of protection\n . ':' // separator\n . $HA2 // hash 2\n );\n // Compare the server response to the client response.\n if ( $data['response'] != $valid_response ) {\n // The username is ok, but the password is wrong.\n $e = new Exception('Invalid credentials.', self::ERROR_CREDENTIALS_INVALID, null);\n throw $e;\n }\n }",
"public function authenticate()\r\n\t{\r\n\t\t//$record=User::model()->findByAttributes(array('username'=>$this->username));\t\t\r\n\t\t$email=$this->username;\r\n\t\t\r\n\t\t$query=mysql_query(\"SELECT email, username, password, status FROM tbl_users WHERE email='$email' and oauth_provider='DReview'\") or die(mysql_error());\r\n\t\t$users = mysql_fetch_array($query);\t\t\r\n\t\t\r\n\t\tif($users[\"email\"] != $this->username)\r\n\t\t{\r\n\t\t\t$this->errorCode=self::ERROR_USERNAME_INVALID;\r\n\t\t}\r\n\t\telseif($users[\"status\"] != \"ACTIVE\")\r\n\t\t{\r\n\t\t\t$this->errorCode=self::ERROR_STATUS_INACTIVE;\r\n\t\t}\t\t\r\n\t\telseif($users[\"password\"] != $this->password)\r\n\t\t{\r\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\r\n\t\t}\t\t\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->errorCode=self::ERROR_NONE;\t\r\n\t\t\t$this->_id = $users;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"public function authenticate(TechDivision_Model_Interfaces_Container $container)\n {\n // initialize the Zend_Auth instance\n $auth = Zend_Auth::getInstance();\n // set the storage to a non persistent instance, because\n // the system user is storend in the web session\n $auth->setStorage(\n new Zend_Auth_Storage_NonPersistent()\n );\n // initialize the authentication Adapters\n $this->_getLdapAdapter($container);\n $this->_getDatabaseAdapter($container);\n // execute one Adapter after another and try to authenticate\n for ($i = 0; $i < sizeof($this->_adapters); $i++) {\n try {\n // run authentication with the found Adapter\n $result = $auth->authenticate($this->_adapters[$i]);\n // log the results\n foreach ($result->getMessages() as $message) {\n $this->_getLogger()->error($message, __LINE__);\n }\n // check the result of the Adapter's authentication method\n if ($result->getCode() === Zend_Auth_Result::SUCCESS) {\n // log a successfull authentication process\n self::_getLogger()->error(\n \t\"SUCCESS: authenticated \" . $this->getUsername()->stringValue() . \"\\n\",\n __LINE__\n );\n // load the system user data\n $this->load(\n $result->getIdentity()->getPrimaryKey()\n );\n // return if authentication was successfull\n return;\n }\n }\n // catch the authentication exception \n catch (Zend_Auth_Adapter_Exception $zaae) {\n // log the exception\n self::_getLogger()->error($zaae->__toString());\n // initialize a new Zend_Auth_Result instance\n\t\t\t\t// load the message\n $message = $zaae->getMessage();\n\t\t\t\t// check if the message is an array\n if(!is_array($message)) {\n \t$message = array($message);\n }\n\t\t\t\t// initialize the authentication result\n $result = new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $this,\n $message\n );\n // continue with the next Adapter\n continue;\n }\n }\n // if authentication can't be validated, throw an apropriate exception\n switch ($result->getCode()) {\n // if no user with the passed username could be found\n case Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND:\n throw new TDProject_Core_Common_Exceptions_InvalidUsernameException(\n \t\t'Invalid username ' . $this->getUsername()\n );\n break;\n // if more than ONE user was found (usually not possible)\n case Zend_Auth_Result::FAILURE_IDENTITY_AMBIGUOUS:\n throw new TDProject_Core_Common_Exceptions_InvalidUsernameException(\n \t\t'Ambigous username ' . $this->getUsername()\n );\n break;\n // if username and password doesn't match\n case Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID:\n \tthrow new TDProject_Core_Common_Exceptions_InvalidPasswordException(\n \t'Invalid password'\n );\n break;\n // for all other failures\n default:\n throw new Zend_Auth_Exception(\n implode('; ', $result->getMessages()),\n $result->getCode()\n );\n }\n }",
"public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}",
"public function authenticate()\n\t{\n\t\t$record = JokerUsers::model()->findByAttributes(array('email' => $this->email));\n\t\tif ($record === null) $this->errorCode = self::ERROR_USERNAME_INVALID;\n\t\telse if ($record->password !== md5($this->password))\n\t\t\t\t$this->errorCode = self::ERROR_PASSWORD_INVALID;\n\t\telse if (!$record->enabled) $this->errorCode = self::ERROR_NOT_ENABLED;\n\t\telse\n\t\t{\n\t\t\t$this->_id = $record->id;\n\t\t\t$this->setState('id', $record->id);\n\t\t\t$this->setState('email', $record->email);\n\t\t\t$this->setState('enabled', $record->enabled);\n\t\t\t$this->errorCode = self::ERROR_NONE;\n\t\t}\n\t\treturn !$this->errorCode;\n\t}",
"public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n // check if a user is already logged\n if ($auth->hasIdentity()) {\n $this->_helper->FlashMessenger('It seems you are already logged into the system ');\n return $this->_redirect('/account');\n }\n\n // if the user is not logged, the do the logging\n // $openid_identifier will be set when users 'clicks' on the account provider\n $openid_identifier = $this->getRequest()->getParam('openid_identifier', null);\n\n // $openid_mode will be set after first query to the openid provider\n $openid_mode = $this->getRequest()->getParam('openid_mode', null);\n\n // this one will be set by facebook connect\n $code = $this->getRequest()->getParam('code', null);\n\n // while this one will be set by twitter\n $oauth_token = $this->getRequest()->getParam('oauth_token', null);\n\n\n // do the first query to an authentication provider\n if ($openid_identifier) {\n\n if ('https://www.twitter.com' == $openid_identifier) {\n $adapter = $this->_getTwitterAdapter();\n } else if ('https://www.facebook.com' == $openid_identifier) {\n $adapter = $this->_getFacebookAdapter();\n } else {\n // for openid\n $adapter = $this->_getOpenIdAdapter($openid_identifier);\n\n // specify what to grab from the provider and what extension to use\n // for this purpose\n $toFetch = $this->_keys->openid->tofetch->toArray();\n\n // for google and yahoo use AtributeExchange Extension\n if ('https://www.google.com/accounts/o8/id' == $openid_identifier || 'http://me.yahoo.com/' == $openid_identifier) {\n $ext = $this->_getOpenIdExt('ax', $toFetch);\n\n } else {\n $ext = $this->_getOpenIdExt('sreg', $toFetch);\n }\n\n $adapter->setExtensions($ext);\n Zend_Registry::get('log')->info('Class is :' . get_class($adapter));\n }\n\n // here a user is redirect to the provider for login\n $result = $auth->authenticate($adapter);\n\n Zend_Registry::get('log')->info(get_class($result));\n\n // the following two lines should never be executed unless the redirection faild.\n $this->_helper->FlashMessenger('Redirection faild');\n return $this->_redirect('/index/index');\n } else if ($openid_mode || $code || $oauth_token) {\n // this will be exectued after provider redirected the user back to us\n\n if ($code) {\n // for facebook\n $adapter = $this->_getFacebookAdapter();\n } else if ($oauth_token) {\n // for twitter\n $adapter = $this->_getTwitterAdapter()->setQueryData($_GET);\n } else {\n // for openid \n $adapter = $this->_getOpenIdAdapter(null);\n\n // specify what to grab from the provider and what extension to use\n // for this purpose\n $ext = null;\n \n $toFetch = $this->_keys->openid->tofetch->toArray();\n \n // for google and yahoo use AtributeExchange Extension\n if (isset($_GET['openid_ns_ext1']) || isset($_GET['openid_ns_ax'])) {\n $ext = $this->_getOpenIdExt('ax', $toFetch);\n } else if (isset($_GET['openid_ns_sreg'])) {\n $ext = $this->_getOpenIdExt('sreg', $toFetch);\n }\n\n if ($ext) {\n $ext->parseResponse($_GET);\n $adapter->setExtensions($ext);\n }\n }\n\n $result = $auth->authenticate($adapter);\n\n // Successful auth back from the OpenId provider.\n if ($result->isValid()) {\n $toStore = array('identity' => $auth->getIdentity());\n\n if (isset($ext) && $ext) {\n // for openId\n $toStore['properties'] = $ext->getProperties();\n } else if ($code) {\n // for facebook\n $msgs = $result->getMessages();\n $toStore['properties'] = (array) $msgs['user'];\n\n } else if ($oauth_token) {\n // for twitter\n $identity = $result->getIdentity();\n // get user info\n $twitterUserData = (array) $adapter->verifyCredentials();\n $toStore = array('identity' => $identity['user_id']);\n if (isset($twitterUserData['status'])) {\n $twitterUserData['status'] = (array) $twitterUserData['status'];\n }\n $toStore['properties'] = $twitterUserData;\n }\n $email = isset($toStore['properties']['email']) ? $toStore['properties']['email'] : 'dummy';\n\n /** @var $rep ZFStarter\\Entity\\Repository\\PersonRepository */\n $rep = $this->entityManager->getRepository('ZFStarter\\Entity\\Person');\n\n /** @var $person ZFStarter\\Entity\\Person */\n $person = $rep->findOneBy(array('openid'=> $email));\n\n if ($person instanceof ZFStarter\\Entity\\Person) {\n // They have an account\n \\Zend_Registry::get('log')->debug(__METHOD__ . \"\\nRole should be actor but is ...\" . $person->getRoleId());\n\n\n $auth->getStorage()->write($person->toArray());\n\n $this->_helper->FlashMessenger('Successful authentication');\n return $this->_redirect('/account/index');\n } else {\n\n $auth->getStorage()->write(array(\n 'role' => 'person',\n 'email' => $email,\n 'openid' => $email,\n ));\n\n // Redirect to create account \n $r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $r->gotoSimple('create', 'account', null, array('email' => $email));\n\n }\n\n\n } else {\n $this->_helper->FlashMessenger('Failed authentication');\n $this->_helper->FlashMessenger($result->getMessages());\n return $this->_redirect('/index/index');\n }\n }\n }"
] |
[
"0.6969083",
"0.6710203",
"0.6708551",
"0.6550886",
"0.6537283",
"0.64760303",
"0.64458686",
"0.64238024",
"0.6359017",
"0.63240236",
"0.62919205",
"0.62486994",
"0.62486994",
"0.62486994",
"0.6218585",
"0.62089896",
"0.6206417",
"0.6186223",
"0.61703235",
"0.616732",
"0.6155187",
"0.61469066",
"0.6132896",
"0.61272836",
"0.6124931",
"0.6112332",
"0.61077327",
"0.6104704",
"0.60664713",
"0.60182565"
] |
0.6817031
|
1
|
Returns the attribute with all replacements done.
|
public function doReplacements($attribute) {
$value = $this->getAttribute($attribute);
if ($placeholders = $this->getPlaceholders($attribute)) {
$value = $this->processReplacements($value, $placeholders);
}
return $value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAttrString(){\n\t\t$this->attrString = '';\n\t\tif(is_array($this->attr))\n\t\t\tarray_walk($this->attr, array($this, 'attrToString')); \n\t}",
"public function attr() {\n\t\treturn utils::attr($this->attr, func_get_args());\n\t}",
"protected function getCastsReplace()\n {\n $attributes = $this->data['casts'] ?: [];\n\n if ( ! count($attributes)) return '';\n\n // align assignment signs by longest attribute\n $longestLength = 0;\n\n foreach ($attributes as $attribute => $type) {\n\n if (strlen($attribute) > $longestLength) {\n $longestLength = strlen($attribute);\n }\n }\n\n $replace = $this->tab() . \"protected \\$casts = [\\n\";\n\n foreach ($attributes as $attribute => $type) {\n\n // fake date_timestamp 'type'\n if ($type == 'date_timestamp') {\n $type = 'date';\n }\n\n $replace .= $this->tab(2)\n . \"'\" . str_pad($attribute . \"'\", $longestLength + 1)\n . \" => '\" . $type . \"',\\n\";\n }\n\n $replace .= $this->tab() . \"];\\n\\n\";\n\n return $replace;\n }",
"protected function mergeTranslationsWithAttributes()\n\t{\n\t\t$this->attributes = array_merge($this->attributes, $this->translatedAttributes);\n\t}",
"public static function mergeAttr(){\n\t\t$all_attr = func_get_args();\n\t\t$all_attr = array_filter($all_attr);\n\t\tforeach($all_attr as $x=>$attr){\n\t\t\tif(is_string($attr))parse_str($attr, $all_attr[$x]);\n\t\t}\n\t\treturn call_user_func_array('array_replace', $all_attr);\n\t}",
"public function backupOriginalAttributes()\n {\n $this->backup_original = $this->getRawOriginal() ?: [];\n\n return $this->getOriginal();\n }",
"public function overlayUserdefinedHtmlAttributeValues() {}",
"public function getMutatedAttributes()\n {\n $mutAt = $this->cacheMutatedAttributes2($this);\n\n return $mutAt;\n }",
"public function overlayFixedHtmlAttributeValues() {}",
"protected function setRegexAttributes()\n {\n $find = '#{([a-z][a-zA-Z0-9_]*)}#';\n $attributes = $this->route->attributes;\n $newAttributes = [];\n preg_match_all($find, $this->regex, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $name = $match[1];\n $subpattern = $this->getSubpattern($name);\n $this->regex = str_replace(\"{{$name}}\", $subpattern, $this->regex);\n if (! isset($attributes[$name])) {\n $newAttributes[$name] = null;\n }\n }\n $this->route->attributes($newAttributes);\n }",
"public function getDirtyValueOfAttribute($attributeName);",
"function _convert_attribute($match) {\n\t\treturn str_replace(array('>', '<', '\\\\'), array('>', '<', '\\\\\\\\'), $match [0]);\n\t}",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }",
"protected function getValueAttribute() {}",
"public function safeAttributes()\n {\n return $this->attributes();\n }",
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class])) {\n static::cacheMutatedAttributes($class);\n }\n\n return static::$mutatorCache[$class];\n }",
"public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }",
"protected function updatedAt(): Attribute\n {\n return new Attribute(\n get: fn ($value) => Carbon::parse($value)->format('Y-m-d H:i'),\n );\n }",
"public function getModifiedValue(): string\n {\n\t\treturn $this->applyModifiers((string) $this->value);\n\t}",
"public function raw()\n {\n return $this->attr_raw;\n }",
"public function separateTranslationsFromAttributes(): array\n\t{\n\t\t$attributes = collect($this->attributes);\n\n\t\t// Extract the translated values\n\t\t$translatables = $attributes->only($this->translatable);\n\t\t$this->translatedAttributes = $translatables->toArray();\n\n\t\t// Keep only the non-translatable attributes\n\t\t$this->attributes = $attributes->forget($this->translatable)->toArray();\n\n\t\treturn $this->translatedAttributes;\n\t}",
"public function toAttribute()\n {\n }",
"#[Pure]\n public function withAttribute(string $foo): string\n {\n return $foo;\n }",
"public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }",
"public function getAttributes() {}",
"public function getAttributes() {}",
"public function getAttributes(){ }",
"protected function getAttributesAsString() {\n\t\t\n\t\t$String = '';\n\t\tforeach ( $this->attributes as $Name => $Value )\n\t\t\t$String .= \"$Name=\\\"$Value\\\" \";\n\t\t\n\t\tif ( $this->Debug )\n\t\t\tDebugger::echoMessage( get_class() . '::getAttributesAsString() String=' .$String);\t\n\t\treturn $this->replaceSpecialChars( $String );\n\t\t\n\t}",
"public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }",
"function concat_attr() {\n $str = \"\";\n if ($this->other_attr != NULL) {\n foreach($this->other_attr as $field => $value) {\n $str .= $field.'=\"'.$value.'\" ';\n }\n }\n return $str;\n }"
] |
[
"0.5743681",
"0.5655223",
"0.55948234",
"0.55928123",
"0.5558738",
"0.55425805",
"0.5514665",
"0.5509155",
"0.54673594",
"0.5403531",
"0.5394539",
"0.5391221",
"0.5360741",
"0.53424686",
"0.53411573",
"0.5336208",
"0.53360975",
"0.53283817",
"0.5325147",
"0.532394",
"0.53053397",
"0.5274994",
"0.52740437",
"0.52713835",
"0.52709746",
"0.52698994",
"0.52626294",
"0.52614355",
"0.5255012",
"0.524847"
] |
0.63747996
|
0
|
Returns an array of placeholders that should be replaced for the given attribute.
|
public function getPlaceholders($attribute) {
$placeholders = array_get($this->getAllPlaceholders(), $attribute);
if ($placeholders == '*') {
$placeholders = array_keys($this->getAllReplacements());
$this->placeholdersCache[$attribute] = $placeholders;
}
return $placeholders;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function preparedPlaceholders(): array\n {\n $placeholders = [];\n foreach ($this->placeholders() as $placeholder => $var) {\n $placeholders['{{' . $placeholder . '}}'] = strpos($var, '--') !== 0 \n ? $this->arg($var) \n : $this->opt(substr($var, 0, 2));\n }\n\n return $placeholders;\n }",
"public function getPlaceholders(): array\n {\n return $this->placeholders;\n }",
"protected function getAllPlaceholders() {\n\t\tif (!is_array($this->placeholdersCache)) {\n\t\t\t$modelPlaceholders = Config::get('replaceable.' . get_called_class() . '.attributes', []);\n\t\t\t$globalPlaceholders = Config::get('replaceable.*.attributes', []);\n\t\t\t$this->placeholdersCache = array_merge($globalPlaceholders, $modelPlaceholders);\n\t\t}\n\n\t\treturn $this->placeholdersCache;\n\t}",
"public function doReplacements($attribute) {\n\n\t\t$value = $this->getAttribute($attribute);\n\n\t\tif ($placeholders = $this->getPlaceholders($attribute)) {\n\t\t\t$value = $this->processReplacements($value, $placeholders);\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function getPlaceholders();",
"abstract protected function placeholders(): array;",
"public function listPlaceHolders(): array\n {\n $find = !!preg_match_all('/\\{(\\w+?)\\}/', $this->pattern, $matches);\n if (!$find) {\n return [];\n }\n return $matches[1];\n }",
"public function provideValidReplacementNames()\n {\n return [\n ['firstname'], // original faker property\n ['lastname'], // original faker property\n ];\n }",
"protected function replacements(): array\n {\n return [\n 'modelSingularCapitalized' => $this->modelSingularCapitalized(),\n 'values' => $this->values(),\n 'buttons' => $this->buttons(),\n ];\n }",
"public function GetPlaceholders();",
"public function provideValidReplacementIds()\n {\n return [\n [FakerReplacer::PREFIX.'firstname'], // original faker property\n [FakerReplacer::PREFIX.'lastname'], // original faker property\n ];\n }",
"public function GetPlaceholders()\n\t{\n\t\treturn $this->m_aPlaceholders;\n\t}",
"public function getPlaceholder()\n\t{\n\t\treturn $this->placeholder_array;\n\t}",
"public static function getStringInfoFromAttributeName(string $attribute_name): array\n {\n return [\n 'string_name' => $string_name = str_after($attribute_name, '_with_'),\n 'string_value' => ($string_value = collect(static::getAllowedStrings())->get($string_name, returnClosure(''))),\n 'attribute_name' => str_before($attribute_name, '_with_'),\n 'allowed' => !is_null($string_value)\n ];\n }",
"function fixAttributes(&$template,$attribute) {\n\tif ( ! is_array($template[$attribute]) ) return;\n\tif ( $template[$attribute]['@attributes'] ) {\n\t\t$template[$attribute][0]['@attributes'] = $template[$attribute]['@attributes'];\n\t\tif ( $template[$attribute]['value'])\n\t\t\t$template[$attribute][0]['value'] = $template[$attribute]['value'];\n\n\t\tunset($template[$attribute]['@attributes']);\n\t\tunset($template[$attribute]['value']);\n\t}\n\n\tif ( $template[$attribute] ) {\n\t\tforeach ($template[$attribute] as $tempArray) {\n\t\t\t$tempArray2[] = $tempArray['value'] ? array('@attributes'=>$tempArray['@attributes'],'@value'=>$tempArray['value']) : array('@attributes'=>$tempArray['@attributes']);\n\t\t}\n\t\t$template[$attribute] = $tempArray2;\n\t}\n}",
"protected function _prepareValues($attr)\n {\n $data = parent::_prepareValues($attr);\n $data = array_merge(\n $data, [\n 'is_visible' => $this->_getValue($attr, 'visible', 1),\n 'is_system' => $this->_getValue($attr, 'system', 1),\n 'input_filter' => $this->_getValue($attr, 'input_filter', null),\n 'multiline_count' => $this->_getValue($attr, 'multiline_count', 0),\n 'validate_rules' => $this->_getValue($attr, 'validate_rules', null),\n 'data_model' => $this->_getValue($attr, 'data', null),\n 'sort_order' => $this->_getValue($attr, 'position', 0)\n ]\n );\n\n return $data;\n }",
"public function getFieldReplacements(): array\n {\n return $this->field_replacements;\n }",
"protected function replacements(): array\n {\n return [\n 'useModel' => $this->useModel(),\n 'modelClass' => $this->modelClass(),\n 'useSeeder' => $this->useSeeder(),\n 'seed' => $this->seed(),\n ];\n }",
"public function getPlaceholderList($text)\n {\n $vars = array();\n\n $matches = array();\n if (preg_match_all(Varien_Filter_Template::CONSTRUCTION_PATTERN, $text, $matches, PREG_SET_ORDER))\n {\n foreach($matches as $index => $construction) {\n\n $match = $construction[0];\n $directiveType = $construction[1];\n $variableName = $construction[2];\n\n $callback = array($this, $directiveType.'Directive');\n\n if(!is_callable($callback)) {\n continue;\n }\n\n $tokenizer = new Varien_Filter_Template_Tokenizer_Variable();\n $tokenizer->setString($variableName);\n $params = $tokenizer->tokenize();\n\n if (!$this->containsMethod($params)) {\n\n if (in_array($directiveType, array('var'))) {\n $vars[] = trim($variableName);\n }\n\n $vars = array_merge($vars, $this->getVariableNamesOf($variableName));\n }\n }\n }\n\n // Every variable just one time\n $vars = array_unique($vars);\n\n // dispatch event with found vars\n Mage::dispatchEvent('mk_mailpreview_found_mail_preview_vars', array(\n 'sender' => $this,\n 'vars' => $vars\n ));\n\n return $vars;\n }",
"function i18n_get_inserts() {\n\t\t\t$attributes = $this->i18n_quoted_attributes();\n\n\t\t\t$inserts = array();\n\t\t\tforeach($attributes as $locale => $fields) {\n\t\t\t\tforeach($fields as $key => $value) {\n\t\t\t\t\t$inserts[$locale][$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $inserts;\n\t\t}",
"public function separateTranslationsFromAttributes(): array\n\t{\n\t\t$attributes = collect($this->attributes);\n\n\t\t// Extract the translated values\n\t\t$translatables = $attributes->only($this->translatable);\n\t\t$this->translatedAttributes = $translatables->toArray();\n\n\t\t// Keep only the non-translatable attributes\n\t\t$this->attributes = $attributes->forget($this->translatable)->toArray();\n\n\t\treturn $this->translatedAttributes;\n\t}",
"private function getReplacements()\n {\n return [\n '/* {{ host }} */' => $this->getBackendHost(),\n '/* {{ port }} */' => $this->getBackendPort(),\n '/* {{ ips }} */' => $this->getTransformedAccessList(),\n '/* {{ design_exceptions_code }} */' => $this->getRegexForDesignExceptions(),\n // http headers get transformed by php `X-Forwarded-Proto: https`\n // becomes $SERVER['HTTP_X_FORWARDED_PROTO'] = 'https'\n // Apache and Nginx drop all headers with underlines by default.\n '/* {{ ssl_offloaded_header }} */' => str_replace('_', '-', $this->getSslOffloadedHeader()),\n '/* {{ grace_period }} */' => $this->getGracePeriod(),\n ];\n }",
"public function pluck(string $attribute): array;",
"protected function getReplacement(string $stub): array\n {\n $replacements = $this->pluginRepository->config('stubs.replacements');\n\n if (! isset($replacements[$stub])) {\n return [];\n }\n\n $keys = $replacements[$stub];\n\n $replaces = [];\n\n if ($stub === 'json' || $stub === 'composer') {\n if (in_array('PROVIDER_NAMESPACE', $keys, true) === false) {\n $keys[] = 'PROVIDER_NAMESPACE';\n }\n }\n foreach ($keys as $key) {\n if (method_exists($this, $method = 'get'.ucfirst(Str::studly(strtolower($key))).'Replacement')) {\n $replaces[$key] = $this->$method();\n } else {\n $replaces[$key] = null;\n }\n }\n\n return $replaces;\n }",
"private function getRegexFlagPattern($attribute)\n {\n $mapAttrFlagPattern = [\n 'district_id' => self::REGEX_FLAG_DISTRICT,\n 'municipality_id' => self::REGEX_FLAG_MUNICIPALITY,\n 'typology' => self::REGEX_FLAG_TYPOLOGY,\n 'land_registry_id' => self::REGEX_FLAG_LANDREGISTRY,\n ];\n\n return $mapAttrFlagPattern[$attribute];\n }",
"protected function getFilledPlaceholders(array $placeholders = [], array $params = [])\n {\n $filled = [];\n\n foreach ($placeholders as $placeholder) {\n $key = sprintf('{{ %s }}', $placeholder);\n $filled[$key] = isset($params[$placeholder]) ? $params[$placeholder] : '';\n }\n\n return $filled;\n }",
"public function placeholderArgs() {\r\n $url = Url::fromUri('internal:/examples/menu-example/placeholder-argument/3343/display');\r\n $link = Link::fromTextAndUrl($this->t('examples/menu-example/placeholder-argument/3343/display'), $url)->toString();\r\n return [\r\n '#markup' => $this->t('Demonstrate placeholders by visiting @link', ['@link' => $link]),\r\n ];\r\n }",
"public function attributes(): array\n {\n return [\n $this->attributePrefix.'target' => $this->target(),\n $this->attributePrefix.'filterByType' => $this->filterByType,\n ];\n }",
"public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }",
"public function replace()\n {\n $data = $this->data;\n $rules = $this->rules;\n\n array_walk($rules, function(&$rule) use ($data)\n {\n preg_match_all('/\\{(.*?)\\}/', $rule, $matches);\n\n foreach($matches[0] as $key => $placeholder)\n {\n if(isset($data[$matches[1][$key]]))\n {\n $rule = str_replace($placeholder, $data[$matches[1][$key]], $rule);\n }\n }\n });\n\n return $rules;\n }"
] |
[
"0.64113945",
"0.6238869",
"0.6179997",
"0.61313057",
"0.5947015",
"0.5838302",
"0.56937784",
"0.5659289",
"0.5588449",
"0.5523605",
"0.54995155",
"0.5364709",
"0.53527945",
"0.5303889",
"0.5249378",
"0.52315205",
"0.52257085",
"0.51491827",
"0.5148841",
"0.5096799",
"0.50843513",
"0.5054271",
"0.50272435",
"0.49857754",
"0.49837106",
"0.4950739",
"0.49501866",
"0.4948783",
"0.49415344",
"0.49381658"
] |
0.7437464
|
0
|
Get the attribute=>placeholders array for this model.
|
protected function getAllPlaceholders() {
if (!is_array($this->placeholdersCache)) {
$modelPlaceholders = Config::get('replaceable.' . get_called_class() . '.attributes', []);
$globalPlaceholders = Config::get('replaceable.*.attributes', []);
$this->placeholdersCache = array_merge($globalPlaceholders, $modelPlaceholders);
}
return $this->placeholdersCache;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPlaceholders(): array\n {\n return $this->placeholders;\n }",
"public function getPlaceholders();",
"protected function preparedPlaceholders(): array\n {\n $placeholders = [];\n foreach ($this->placeholders() as $placeholder => $var) {\n $placeholders['{{' . $placeholder . '}}'] = strpos($var, '--') !== 0 \n ? $this->arg($var) \n : $this->opt(substr($var, 0, 2));\n }\n\n return $placeholders;\n }",
"public function getPlaceholders($attribute) {\n\n\t\t$placeholders = array_get($this->getAllPlaceholders(), $attribute);\n\t\tif ($placeholders == '*') {\n\t\t\t$placeholders = array_keys($this->getAllReplacements());\n\t\t\t$this->placeholdersCache[$attribute] = $placeholders;\n\t\t}\n\n\t\treturn $placeholders;\n\t}",
"public function GetPlaceholders()\n\t{\n\t\treturn $this->m_aPlaceholders;\n\t}",
"public function getBindValues();",
"public function getPlaceholder()\n\t{\n\t\treturn $this->placeholder_array;\n\t}",
"public function listPlaceHolders(): array\n {\n $find = !!preg_match_all('/\\{(\\w+?)\\}/', $this->pattern, $matches);\n if (!$find) {\n return [];\n }\n return $matches[1];\n }",
"public function attributes()\n {\n return collect(array_keys($this->rules()))\n ->mapWithKeys(function ($key) {\n return [$key => str_replace(['.', '_'], ' ', $key)];\n })\n ->toArray();\n }",
"public function attributes(): array\n {\n return [\n $this->attributePrefix.'target' => $this->target(),\n $this->attributePrefix.'filterByType' => $this->filterByType,\n ];\n }",
"public function attributesDataProvider()\n {\n return [\n [\n [\n 'value1' => 123,\n 'value2' => 'string',\n ],\n ['value1'],\n ['value1'],\n [\n 'value1' => 123,\n ],\n ],\n [\n [\n 'value1' => 456,\n 'value2' => 'text',\n 'value3' => true,\n ],\n ['value1', 'value3'],\n ['value1', 'value3'],\n [\n 'value1' => 456,\n 'value3' => true,\n ],\n ],\n [\n [\n 'value1' => 'text',\n 'value2' => 789,\n 'value3' => false,\n ],\n ['value1', 'value2', 'value3'],\n ['value1', 'value2', 'value3'],\n [\n 'value1' => 'text',\n 'value2' => 789,\n 'value3' => false,\n ],\n ],\n ];\n }",
"function i18n_get_inserts() {\n\t\t\t$attributes = $this->i18n_quoted_attributes();\n\n\t\t\t$inserts = array();\n\t\t\tforeach($attributes as $locale => $fields) {\n\t\t\t\tforeach($fields as $key => $value) {\n\t\t\t\t\t$inserts[$locale][$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $inserts;\n\t\t}",
"public function GetPlaceholders();",
"protected function getAttr()\r\n\t{\r\n\t\treturn array( 'maxLength', 'width', 'searchMethod', 'searchRangeValues' );\r\n\t}",
"protected function attributes(): array\n {\n try {\n $attributes = [];\n $i = 0;\n foreach (static::$db_columns as $column) {\n $attributes[$column] = $this->$column;\n $i++;\n }\n return $attributes;\n } catch (Exception $e) {\n die(\"Error \" . $e);\n }\n }",
"public function attributes()\n {\n return [\n 'data.months' => 'months',\n 'data.days.1.check' => 'day',\n 'data.days.2.check' => 'day',\n 'data.days.3.check' => 'day',\n 'data.days.4.check' => 'day',\n 'data.days.5.check' => 'day',\n 'data.days.6.check' => 'day',\n 'data.days.7.check' => 'day',\n 'data.days.*.*.from' => 'from',\n 'data.days.*.*.to' => 'to',\n ];\n }",
"public function getAttributes()\n {\n return array_merge(\n $this->attributes,\n [\n 'args' => $this->args(),\n 'type' => $this->type(),\n 'resolve' => $this->getResolver(),\n ]\n );\n }",
"public function getAll()\n {\n $valueArray = [];\n\n foreach(self::$validAttributes as $attribute) {\n $valueArray[$attribute] = $this->$attribute;\n }\n\n return $valueArray;\n }",
"protected function attributes() {\n\t\t$attributes = array();\n\t\tforeach (self::$db_fields as $field) {\n\t\t\tif (property_exists($this, $field)) {\n\t\t\t\t$attributes[$field] = $this->$field;\n\t\t\t}\n\t\t}\n\t\treturn $attributes;\n\t}",
"public function getBindVars(): array\n {\n return $this->container->getAll();\n }",
"public function toArray()\n {\n return ['before' => __('Before Attribute Text'),\n 'after' => __('After Attribute Text')\n ];\n }",
"public function getPlaceholders(): PlaceholderList\n {\n return new PlaceholderList($this->placeholders);\n }",
"protected function attributes() {\n $attributes = array();\n foreach(static::$db_fields as $field) {\n if(property_exists($this, $field)) {\n $attributes[$field] = $this->$field;\n }\n }\n return $attributes;\n }",
"public function attributes()\n {\n return [\n 'name' => 'nombre',\n 'last_name' => 'apellido',\n 'num_id' => 'cédula',\n 'email' => 'correo',\n 'birthdate' => 'fecha',\n 'sex' => 'sexo',\n 'place_birthdate' => 'lugar de nacimiento',\n 'blood_group' => 'grupo sanguineo',\n 'phone_person' => 'telefono personal',\n 'location_home' => 'lugar donde vive',\n 'phone_home' => 'telefono de casa',\n 'location_work' => 'lugar de trabajo ',\n 'phone_work' => 'telefono de trabajo',\n 'profession' => 'profesión',\n 'current_occupation' => 'ocupación',\n 'observation' => 'observación',\n ];\n }",
"public function attributes(): array\n {\n return [\n //\n ];\n }",
"public function attributes(): array\n {\n return [\n //\n ];\n }",
"public function getGroupedBindings() {\n return [\n 'fields' => $this->getBindings(),\n 'where' => $this->getWhere()->getBindings(),\n 'having' => $this->getHaving()->getBindings()\n ];\n }",
"public function attributes()\n {\n return [\n ];\n }",
"public function toArray() {\n $attrs = $this->_private_attributes;\n $result = array();\n foreach ($attrs as $key => $attr) {\n if (method_exists($this, \"get\" . underscore_to_camel_case($key, true))) {\n eval('$result[\"' . $key . '\"] = $this->get' . underscore_to_camel_case($key, true) . '();');\n } else {\n $result[$key] = $attr;\n }\n }\n return $result;\n }",
"public function getRequiredAttributes()\n {\n return [\n $this->attributePrefix.'chunk' => $this->getType(),\n $this->attributePrefix.'slot-name' => $this->slotname,\n $this->attributePrefix.'slot-template' => $this->template,\n $this->attributePrefix.'page' => $this->page->getId(),\n $this->attributePrefix.'chunk-id' => $this->getId(),\n $this->attributePrefix.'has-content' => $this->hasContent(),\n ];\n }"
] |
[
"0.73024267",
"0.63581324",
"0.62972516",
"0.6289107",
"0.6261235",
"0.6061663",
"0.6015741",
"0.5858576",
"0.5858091",
"0.5849457",
"0.5818723",
"0.57967",
"0.5720385",
"0.5706505",
"0.5662698",
"0.56374025",
"0.56259274",
"0.56223655",
"0.5614927",
"0.5610826",
"0.5606831",
"0.5594038",
"0.55908614",
"0.55898213",
"0.55817884",
"0.55817884",
"0.5574877",
"0.5570102",
"0.5565245",
"0.5564603"
] |
0.73366445
|
0
|
Get the replacement value for a given placeholder
|
protected function getReplacementValue($placeholder) {
if (array_key_exists($placeholder, $this->replacementValuesCache)) {
return $this->replacementValuesCache[$placeholder];
}
$value = array_get($this->getAllReplacements(), $placeholder);
if (is_callable($value)) {
$value = call_user_func($value, $this);
}
$this->replacementValuesCache[$placeholder] = $value;
return $value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function GetReplacement($placeholder)\n {\n if (isset($this->texts[$placeholder]))\n {\n return $this->texts[$placeholder];\n }\n return $this->phpTranslator->GetReplacement($placeholder);\n }",
"public function getPlaceholder();",
"public function getPlaceholder()\n\t{\n\t\treturn $this->_placeholder;\n\t}",
"public function getPlaceholder()\n\t{\n\t\treturn $this->_placeholder;\n\t}",
"public function getPlaceholder()\n {\n return $this->_placeholder;\n }",
"public function getPlaceholder(): string\n {\n return $this->placeholder;\n }",
"public function getPlaceholder()\n\t{\n\t\treturn $this->placeholder_array;\n\t}",
"private function resolveReplacement(Mailcode_Parser_Safeguard_Formatter_Location $location) : string\n {\n if($location->requiresAdjustment())\n {\n return $this->getReplaceString($location);\n }\n\n return $location->getPlaceholder()->getNormalizedText();\n }",
"protected function replaceId($replacement, string $subject, string $placeholder = '{serviceId}'): string\n {\n return str_replace($placeholder, $replacement, $subject);\n }",
"protected function replacePlaceholdersCb($matches)\n {\n $strPlaceholder = $matches[0];\n $strSparqlVariable = array_search(\n $strPlaceholder,\n $this->arTmpPlaceholders\n );\n $strDbPlaceholder = $this->dbConn->Param($strSparqlVariable);\n $this->arTmpVariablePositions[] = $strSparqlVariable;\n\n return $strDbPlaceholder;\n }",
"public function placeholder(string $placeholder)\n {\n return $this->attribute('placeholder', $placeholder);\n }",
"public function getPlaceholderType()\n {\n return $this->placeholder_type;\n }",
"public static function getPlaceholderSuffix()\r\n {\r\n return self::$placeholderSuffix;\r\n }",
"protected function replacePlaceholdersWithVariablesCb($matches)\n {\n $strPlaceholder = $matches[0];\n $strSparqlVariable = array_search(\n $strPlaceholder,\n $this->arTmpPlaceholders\n );\n return $this->dbConn->qstr(\n self::replacePrefix(\n $this->arTmpVariableValues[$strSparqlVariable],\n $this->arPrefixes\n )\n );\n }",
"public function getPlaceholder($languageCode);",
"public function get_placeholder($field_section = null)\n\t{\n\t\tif (array_key_exists($field_section, $this->placeholder))\n\t\t\treturn $this->placeholder[$field_section];\n\t}",
"private function replaceExactValue($value)\n {\n return $this->exactReplacements[$value];\n }",
"private function retrieve_id() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$replacement = $this->args->ID;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function setPlaceholder($placeholder);",
"protected function rawPlaceholder($replace) : string\n {\n return str_replace('#', $replace, '@__raw_block_#__@');\n }",
"public static function getPlaceholderPrefix()\r\n {\r\n return self::$placeholderPrefix;\r\n }",
"private function retrieve_focuskw() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$focus_kw = WPSEO_Meta::get_value( 'focuskw', $this->args->ID );\n\t\t\tif ( $focus_kw !== '' ) {\n\t\t\t\t$replacement = $focus_kw;\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"private function retrieve_searchphrase() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$search = get_query_var( 's' );\n\t\t\tif ( $search !== '' ) {\n\t\t\t\t$replacement = esc_html( $search );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"private function retrieve_pt_single() {\n\t\t$replacement = null;\n\n\t\t$name = $this->determine_pt_names( 'single' );\n\t\tif ( isset( $name ) && $name !== '' ) {\n\t\t\t$replacement = $name;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getPlaceholder(string $identifier): Placeholder\n {\n if ($this->hasPlaceholder($identifier)) {\n return $this->placeholders[$identifier];\n }\n\n throw BlockException::noPlaceholder($identifier);\n }",
"protected function replaceVariable($matches) {\n\t\tif (preg_match(\"/^\\d+$/\", $matches[1])) {\n\t\t\t$id = (int)$matches[1];\n\t\t\t$data = $this->simu->getDataById($id);\n\t\t} else {\n\t\t\t$name = $matches[1];\n\t\t\t$data = $this->simu->getDataByName($name);\n\t\t}\n\t\tif ($data === null) {\n\t\t\treturn $matches[0];\n\t\t}\n\t\tif ($matches[2] == 'L') {\n\t\t\t$value = $data->getChoiceLabel();\n\t\t\tif ($data->getType() == 'multichoice') {\n\t\t\t\t$value = implode(',', $value);\n\t\t\t}\n\t\t\treturn $value;\n\t\t} else {\n\t\t\t$value = $data->getValue();\n\t\t\tswitch ($data->getType()) {\n\t\t\t\tcase 'money':\n\t\t\t\t\t$value = NumberFunction::formatNumber((float)$value, 2, $this->simu->getDecimalPoint(), $this->simu->getGroupingSeparator(), $this->simu->getGroupingSize());\n\t\t\t\tcase 'percent':\n\t\t\t\tcase 'number':\n\t\t\t\t\t$value = str_replace('.', $this->simu->getDecimalPoint(), $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'multichoice':\n\t\t\t\t\t$value = implode(',', $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'text':\n\t\t\t\t\tif (preg_match('/^https?\\:\\/\\//', $value)) {\n\t\t\t\t\t\tif (preg_match('/(jpg|jpeg|gif|png|svg)$/i', $value)) {\n\t\t\t\t\t\t\t$value = '<img src=\"'.$value.'\" alt=\"'.$value.'\">';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$value = '<a href=\"'.$value.'\">'.$value.'</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif (preg_match('/^data\\:image\\//', $value)) {\n\t\t\t\t\t\t$value = '<img src=\"'.$value.'\" alt=\"*\">';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t}",
"public function getGitTagPlaceholder()\n {\n if (isset($this->raw->{'git-tag'})) {\n return $this->raw->{'git-tag'};\n }\n\n return null;\n }",
"public function getVarHolder()\n {\n return $this->var_holder;\n }",
"public function getReplacementText();",
"function yy_r209(){ $this->_retvalue = new Stmt\\VariablePlaceholder($this->yystack[$this->yyidx + 0]->minor); }"
] |
[
"0.75451463",
"0.6964015",
"0.6785272",
"0.6785272",
"0.67500484",
"0.6726901",
"0.6337455",
"0.59207726",
"0.5911548",
"0.58798647",
"0.58527297",
"0.5771997",
"0.57652986",
"0.57361174",
"0.57252425",
"0.5645024",
"0.56378925",
"0.56235844",
"0.55310726",
"0.54720587",
"0.5471769",
"0.5456699",
"0.5452456",
"0.5435536",
"0.5388401",
"0.5384149",
"0.5383139",
"0.5378203",
"0.53679156",
"0.5346429"
] |
0.80661523
|
0
|
Create database table for Genesis consumers
|
protected static function createConsumersDbTable()
{
global $db;
$db->Execute(
'CREATE TABLE IF NOT EXISTS `' .
TABLE_EMERCHANTPAY_CHECKOUT_CONSUMERS . '` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL,
`customer_email` varchar(255) NOT NULL,
`consumer_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `customer_email` (`customer_email`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
COMMENT=\'Tokenization consumers in Genesis\';'
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function createDatabaseStructure() {}",
"public function create()\n {\n $db = XenForo_Application::get('db');\n $db->query('CREATE TABLE `' . self::DB_TABLE . '`\n (`threema_id` CHAR(8) NOT NULL PRIMARY KEY,\n `public_key` CHAR(64) NOT NULL)\n ');\n }",
"private function createConfigsTable()\n {\n $fields = array(\n 'id' => array('type' => 'int', 'constraint' => '10', 'unsigned' => true, 'auto_increment' => true),\n 'site_id' => array('type' => 'int', 'constraint' => '10', 'unsigned' => true),\n 'client_id' => array('type' => 'varchar', 'constraint' => '250'),\n 'client_secret' => array('type' => 'varchar', 'constraint' => '250'),\n 'api_endpoint' => array('type' => 'varchar', 'constraint' => '1000', 'null' => true),\n 'log_searches' => array('type' => 'tinyint', 'constraint' => '10', 'unsigned' => true),\n );\n\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', true);\n\n ee()->dbforge->create_table('rets_rabbit_v2_configs');\n }",
"private function make_db() {\n ee()->load->dbforge();\n $fields = array(\n 'id' => array('type' => 'varchar', 'constraint' => '32'),\n 'access' => array('type' => 'integer', 'constraint' => '10', 'unsigned' => true),\n 'data' => array('type' => 'text')\n );\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', true);\n ee()->dbforge->create_table($this->table_name);\n\n return true;\n }",
"private function createServersTable()\n {\n $fields = array(\n 'id' => array('type' => 'int', 'constraint' => '10', 'unsigned' => true, 'auto_increment' => true),\n 'site_id' => array('type' => 'int', 'constraint' => '10', 'unsigned' => true),\n 'short_code' => array('type' => 'varchar', 'constraint' => '250', 'null' => true),\n 'server_id' => array('type' => 'int', 'constraint' => '10', 'unsigned' => true, 'default' => 0),\n 'is_default' => array('type' => 'int', 'constraint' => '10', 'unsigned' => true, 'default' => 0),\n 'name' => array('type' => 'varchar', 'constraint' => '250', 'null' => true),\n );\n\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', true);\n\n ee()->dbforge->create_table('rets_rabbit_v2_servers');\n }",
"public function generateDatabase()\n {\n $this->generateUserTable();\n $this->generateEmployerTable();\n $this->generateCandidateTable();\n $this->generateGuidTable();\n $this->generateWorkExperienceTable();\n $this->generateShortListTable();\n $this->generateQualTypeTable();\n $this->generateQualLevelTable();\n $this->generateQualificationsTable();\n $this->generateFieldTable();\n $this->generateSubFieldTable();\n $this->generateSkillTable();\n $this->generatePreferencesTable();\n }",
"function create_ROMP_settings_Db_table(){\n\t\tob_start();\n\t\t$table_name = $this->wpdb->prefix . 'romp_settings';\n \t$charset_collate = $this->wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\t\t`romp_crm_id` TEXT NOT NULL ,\n\t\t\t\t`romp_cf_link` TEXT NOT NULL\n\t\t\t) $charset_collate;\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $sql );\n\t}",
"function createDBTables() {\n $installer = new TrelloInstaller();\n return $installer->install();\n }",
"public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}",
"private static function createNotificationTable() {\n\n global $wpdb;\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n // creates notification in database if not exists\n $table = $wpdb->prefix . \"notification\";\n $charset_collate = $wpdb->get_charset_collate();\n $sql = \"CREATE TABLE IF NOT EXISTS $table (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `title` text NOT NULL,\n `content` text NOT NULL,\n `image` text NOT NULL,\n `is_deleted` BOOLEAN NOT NULL DEFAULT FALSE,\n `created_date` int(11) NOT NULL,\n `update_date` int(11) NOT NULL,\n PRIMARY KEY (`id`)\n ) $charset_collate;\";\n dbDelta($sql);\n\n $table = $wpdb->prefix . \"notification_queue\";\n $charset_collate = $wpdb->get_charset_collate();\n $sql = \"CREATE TABLE IF NOT EXISTS $table (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `notification_id` int(11) NOT NULL,\n `title` text NOT NULL,\n `content` text NOT NULL,\n `image` text NOT NULL,\n `token_id` int(11) NOT NULL,\n `is_sent` BOOLEAN NOT NULL DEFAULT FALSE,\n `is_read` BOOLEAN NOT NULL DEFAULT FALSE,\n `created_date` int(11) NOT NULL,\n PRIMARY KEY (`id`)\n ) $charset_collate;\";\n dbDelta($sql);\n\n\n }",
"public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}",
"public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}",
"private function createDBTables(){\n\t\tif (!$this['db']->getSchemaManager()->tablesExist('bookings')){\n\t\t\t$this['db']->executeQuery(\"CREATE TABLE bookings (\n\t\t\t\tid INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tfirstName VARCHAR(40) NOT NULL,\n\t\t\t\tlastName VARCHAR(40) NOT NULL,\n\t\t\t\tphone VARCHAR(10) NOT NULL,\n\t\t\t\temail VARCHAR(20) DEFAULT NULL,\n\t\t\t\tbirthday DATE NOT NULL,\n\t\t\t\tstartDate DATE NOT NULL,\n\t\t\t\tendDate DATE NOT NULL,\n\t\t\t\tarrivalTime TIME DEFAULT NULL,\n\t\t\t\tadditionalInformation TEXT,\n\t\t\t\tnrOfPeople INT NOT NULL,\n\t\t\t\tpayingMethod VARCHAR(10) NOT NULL\n\t\t\t\t);\");\n\t\t}\n\t}",
"function create_civ_db() {\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'civ_slider';\n\n\t$sql = \"create table $table_name(\n id INT NOT NULL AUTO_INCREMENT, \n PRIMARY KEY(id),\n post_id int,\n img_order INT)\";\n\n\t$wpdb->query(\n\t\t'create table $table_name(\n\t id INT NOT NULL AUTO_INCREMENT, \n\t PRIMARY KEY(id),\n\t post_id int,\n\t img_order INT)' \n\t);\n}",
"private function createDBTable() {\n\t\tglobal $wpdb;\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '\" . $this->debug_table . \"'\" ) !== $this->debug_table ) {\n\t\t\t$sql = 'CREATE TABLE `' . $this->debug_table . '` (\n\t\t\t\t`id` INT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t`timestamp` TIMESTAMP NOT NULL,\n\t\t\t\t`blog` INT(9) NOT NULL,\n\t\t\t\t`message` text NOT NULL\n\t\t\t);';\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\tdbDelta( $sql );\n\t\t}\n\t}",
"public static function generateDatabase()\n\t{\n\t\t$entities\t=\tself::getEntities();\n\t\t$query\t\t=\tself::$current_db->query('SHOW TABLES');\n\t\t$tables\t\t=\tarray();\n\n\t\twhile($table = $query->fetch(\\PDO::FETCH_NUM))\n\t\t\t$tables[]\t=\tstrtolower($table[0]);\n\n\t\tforeach($entities as $entity)\n\t\t{\n\t\t\tif( ! in_array(strtolower($entity::getTableName()), $tables))\n\t\t\t\t$entity::createTable();\n\t\t\telse\n\t\t\t\t$entity::updateTable();\n\t\t}\n\t}",
"function createClientTableSeeder()\n {\n $data = [\n \"uuid\" => $uuid = uniqid('client-',true),\n \"name\" => \"Admin\",\n \"type\" => \"admin\",\n \"is_blocked\" => \"0\",\n ];\n $result = (new dbConnection())->insertIntoTable(\"auth_clients\", $data);\n return $result;\n }",
"function mikado_create_db_tables() {\n\tinclude_once (WP_PLUGIN_DIR . '/mikado/lib/install-db.php');\t\t\t\n\tmikado_install_db();\n}",
"private static function create_tables() {\n\t\t// phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.sqliteRemoved -- False positive.\n\t\tself::$dbo = new \\SQLite3( WP_CLI_SNAPSHOT_DB );\n\n\t\t// Create snapshots table.\n\t\t$snapshots_table_query = 'CREATE TABLE IF NOT EXISTS snapshots (\n\t\t\tid INTEGER,\n\t\t\tname VARCHAR,\n\t\t\tcreated_at DATETIME,\n\t\t\tbackup_type INTEGER DEFAULT 0,\n\t\t\tbackup_zip_size VARCHAR,\n\t\t\tPRIMARY KEY (id)\n\t\t);';\n\t\tself::$dbo->exec( $snapshots_table_query );\n\n\t\t// Create snapshot_extra_info table.\n\t\t$extra_info_table_query = 'CREATE TABLE IF NOT EXISTS snapshot_extra_info (\n\t\t\tid INTEGER,\n\t\t\tinfo_key VARCHAR,\n\t\t\tinfo_value VARCHAR,\n\t\t\tsnapshot_id INTEGER,\n\t\t\tPRIMARY KEY (id)\n\t\t);';\n\t\tself::$dbo->exec( $extra_info_table_query );\n\n\t\t// Create storage_credentials table.\n\t\t$storage_credentials_table_query = 'CREATE TABLE IF NOT EXISTS snapshot_storage_credentials (\n\t\t\tid INTEGER,\n\t\t\tstorage_service VARCHAR,\n\t\t\tinfo_key VARCHAR,\n\t\t\tinfo_value VARCHAR,\n\t\t\tPRIMARY KEY (id)\n\t\t);';\n\t\tself::$dbo->exec( $storage_credentials_table_query );\n\n\t}",
"public function registerDb() {\n global $wpdb;\n\n $charset_collate = $wpdb->get_charset_collate();\n $table_name = $wpdb->prefix . \"items_bookmark\";\n \n $createTable = \"CREATE TABLE IF NOT EXISTS $table_name (\n user_id INTEGER NOT NULL,\n response_id int,\n utterance_id int,\n PRIMARY KEY (user_id)\n ) $charset_collate;\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta($createTable);\n }",
"public function create_table_config(){\n $sql = \" CREATE TABLE IF NOT EXISTS {$this->table_config} (\n `id` varchar(100),\n `day` varchar(50) DEFAULT NULL,\n `range` varchar(50) DEFAULT NULL,\n `qty` smallint DEFAULT 0,\n `type` varchar(50) DEFAULT NULL,\n `order` smallint DEFAULT 0,\n PRIMARY KEY (`id`)\n )\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }",
"private function createDatabase($version = 0) {\n\t\t$sql = 'CREATE TABLE IF NOT EXISTS '.$this->tablePrefix.UserAgentThemeSwitcherData::USERAGENTS_TABLE.' (';\n\t\t$sql .= '`id` INT NOT NULL AUTO_INCREMENT,';\n\t\t$sql .= '`useragent` VARCHAR(255) NOT NULL,';\n\t\t$sql .= 'PRIMARY KEY (`id`)';\n\t\t$sql .= ') ENGINE=MYISAM;';\n\t\t$this->connection->get_results($sql);\n\n\t\t$sql = 'CREATE TABLE IF NOT EXISTS '.$this->tablePrefix.UserAgentThemeSwitcherData::BROWSERS_TABLE.' (';\n\t\t$sql .= '`code` varchar(20) NOT NULL,';\n\t\t$sql .= '`theme` varchar(50) DEFAULT NULL,';\n\t\t$sql .= 'PRIMARY KEY (`code`)';\n\t\t$sql .= ') ENGINE=MyISAM;';\n\t\t$this->connection->get_results($sql);\n\n\t\tadd_option(UserAgentThemeSwitcherData::DEBUG_KEY, 'false');\n\t\tadd_option(UserAgentThemeSwitcherData::VERSION_KEY, $version);\n\t}",
"public function createTable()\n {\n $table = self::$table_name;\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `communication_usage_id` INT(11) NOT NULL AUTO_INCREMENT,\n `communication_usage_name` VARCHAR(32) NOT NULL DEFAULT '',\n `communication_usage_description` VARCHAR(255) NOT NULL DEFAULT '',\n PRIMARY KEY (`communication_usage_id`),\n UNIQUE (`communication_usage_name`)\n )\n COMMENT='The communication usage definition table'\n ENGINE=InnoDB\n AUTO_INCREMENT=1\n DEFAULT CHARSET=utf8\n COLLATE='utf8_general_ci'\nEOD;\n try {\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Created table 'contact_communication_usage'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }",
"public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }",
"public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }",
"protected function generateTable(){\n\t\t$columns = $this->getConfig()->getColumns();\n\t\t$columns['magento_entity_id'] = array('type' => 'int');\n\n\t\t$sql = 'CREATE TABLE ' . $this->_table . '(';\n\n\t\tforeach ($columns as $name => $params) {\n\t\t\t$type = $this->getConfig()->getTypeForDatabase($params['type'], $name);\n\t\t\t$value = isset($params['default']) ? $params['default'] : 'NULL';\n\t\t\tif ($value != 'NULL') {\n\t\t\t\t$value = 'DEFAULT ' . $value;\n\t\t\t}\n\t\t\t$primary = isset($params['primary']) && $params['primary'] ? ' PRIMARY KEY' : '';\n\n\t\t\t$sql .= \"\\n\" . $name . \" \" . $type . \" \" . $value . $primary . \",\";\n\t\t}\n\t\t$sql = substr($sql, 0, -1) . ') ENGINE=InnoDB DEFAULT CHARSET=utf8;' . \"\\n\";\n\n\t\treturn $sql;\n\t}",
"public function __construct(){\n \n $this->create_tables();\n \n }",
"function create_table()\n {\n $this->load->dbforge();\n \n /* Specify the table schema */\n $fields = array(\n 'id' => array(\n 'type' => 'INT',\n 'constraint' => 5,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'message' => array(\n 'type' => 'TEXT'\n ),\n 'sender' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 50\n ),\n 'receiver' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 50\n ),\n 'time' => array(\n 'type' => 'INT'\n ),\n 'status' => array(\n 'type' => 'ENUM',\n 'constraint' => array('UNREAD','READ')\n\n )\n );\n \n /* Add the field before creating the table */\n $this->dbforge->add_field($fields);\n \n \n /* Specify the primary key to the 'id' field */\n $this->dbforge->add_key('id', TRUE);\n \n \n /* Create the table (if it doesn't already exist) */\n $this->dbforge->create_table('Chats', TRUE);\n }",
"function fgcf_table_install() {\n global $wpdb;\n $sql = \"CREATE TABLE \" . Fgcf::$table_name . \" (\n\t id mediumint(9) NOT NULL AUTO_INCREMENT,\n\t user_name VARCHAR(255) NOT NULL,\n\t user_email VARCHAR(255) NOT NULL,\n\t user_message TEXT NOT NULL,\n\t UNIQUE KEY id (id)\n\t);\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }",
"public function setUpDatabase()\n\t{\n\t\t$schemes = new Schemes;\n\t\t$schemes->createRequestTable();\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Osuagwu',\n\t 'last_name' => 'Emeka',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Lagos, Nigeria',\n\t 'sex' => 'Male',\n\t ]);\n\n\t Customer::create([\n\t 'email' => '[email protected]',\n\t 'first_name' => 'Mustafa',\n\t 'last_name' => 'Ozyurt',\n\t 'phone_number' => \"09095685594\",\n\t 'image' => 'https://github.com/rakit/validation',\n\t 'location' => 'Berlin, Germany',\n\t 'sex' => 'Male',\n\t ]);\n\t}"
] |
[
"0.6813986",
"0.67879766",
"0.6774321",
"0.6663597",
"0.65212095",
"0.6457117",
"0.6431111",
"0.63883066",
"0.6378652",
"0.6363745",
"0.62243336",
"0.621194",
"0.62028563",
"0.6186105",
"0.61833113",
"0.6182795",
"0.6169286",
"0.61677396",
"0.6159433",
"0.6158371",
"0.61580896",
"0.6151122",
"0.6143174",
"0.6139472",
"0.6131633",
"0.61222994",
"0.61062145",
"0.60924935",
"0.6075233",
"0.6054355"
] |
0.7688224
|
0
|
Add modules settings to ZenCart configuration table
|
protected static function addModuleConfigurationsToDb()
{
static::_addMainConfigurationEntries();
static::_addCredentialsConfigurationEntries();
static::_addTransactionsConfigurationEntries();
static::_addWpfConfigurationEntries();
static::_addOrderConfigurationEntries();
static::_addThreedsOptions();
static::_addScaExemptionOptions();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getModuleConfig() {\n $this->data['config_value'] = array_merge($this->helper_setting->getSetting($this->module_code),$this->helper_setting->getSetting('module_'.$this->module_code));\n }",
"public function updateModuleFile() {\n\t\t$module = Yii::app()->db->createCommand(\"SELECT * FROM {$this->_moduleTableName} WHERE enabled=1\")->queryAll();\n\n\t\tif(count($module) > 0) {\n\t\t\t$config = \"<?php \\n\";\n\t\t\t$config .= \"return array(\\n\\t'modules' => array(\\n\";\n\t\t\t$i = 1;\n\t\t\tforeach($module as $val) {\n\t\t\t\tif($i !== count($module))\n\t\t\t\t\t$config .= \"\\t\\t'\" . $val['name'] . \"',\\n\";\n\t\t\t\telse\n\t\t\t\t\t$config .= \"\\t\\t'\" . $val['name'] . \"'\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$config .= \"\\t),\\n);\";\n\n\t\t}else {\n\t\t\t$config = \"<?php \\n\";\n\t\t\t$config .= \"return array(\\n\\t'modules' => array(\\n\";\n\t\t\t$config .= \"\\t),\\n);\";\n\t\t}\n\n\t\t$fileHandle = @fopen(Yii::getPathOfAlias('application.config').'/module_addon.php', 'w');\n\t\t@fwrite($fileHandle, $config, strlen($config));\n\t\t@fclose($fileHandle);\n\t}",
"public function configure_module() {\n\n\t\t$module = $this->request->get('module', null);\n\t\t$config = $this->getModuleConfiguration($module);\n\t\tif ($config === null) $config = array();\n\n\t\tExtJSResponse::put('config', $config);\n\t\tExtJSResponse::answer();\n\t}",
"function install() {\n global $db;\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paymentech Module', 'MODULE_PAYMENT_PAYMENTECH_STATUS', 'True', 'Do you want to accept Paymentech payments?', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PAYMENTECH_TESTMODE', 'Test', 'Transaction mode used for processing orders.', '6', '0', 'cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (Test Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a test account. This is only used when in testing mode.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (USD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have USD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (CAD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a CAD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bin Number', 'MODULE_PAYMENT_PAYMENTECH_BIN', '000002', 'Bin Number assigned by Paymentech.', '6', '0', now())\"); \n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Terminal ID', 'MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID', '001', 'Most are 001. Only change if instructed by Paymentech', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE', 'Authorize/Capture', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'cfg_select_option(array(\\'Authorize\\', \\'Authorize/Capture\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Request CVV Number', 'MODULE_PAYMENT_PAYMENTECH_USE_CVV', 'True', 'Do you want to ask the customer for the card\\'s CVV number', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYMENTECH_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Currencies Accepted', 'MODULE_PAYMENT_PAYMENTECH_CURRENCIES', 'USD only', 'Accept Canadian dollars, US dollars, or both? If you have a Merchant ID set up for both then the currency will matched appropriately.', '6', '0', 'cfg_select_option(array(\\'CAD only\\', \\'USD only\\', \\'CAD and USD\\'), ', now())\");\n }",
"public function set_config_settings()\r\n\t{\t\r\n\t\t// Check the config table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('config'))\r\n\t\t{\r\n\t\t\tif ($config_data = $this->get_database_config_data())\r\n\t\t\t{\r\n\t\t\t\t// Loop through all the returned defaults and convert the database column names to cart session names.\r\n\t\t\t\tforeach($this->flexi->cart_database['configuration']['columns'] as $column_name => $column_alias)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (isset($config_data[$column_alias]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$config_data[$column_name] = $config_data[$column_alias];\r\n\t\t\t\t\t\tunset($config_data[$column_alias]);\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\t// Config file hard-coded settings.\r\n\t\t$config_defaults = $this->flexi->cart_defaults['configuration'];\r\n\r\n\t\t// Loop through the config hard-coded default settings and apply them to any config settings without a value from the database lookup.\r\n\t\tforeach($config_defaults as $setting_name => $setting_value)\r\n\t\t{\r\n\t\t\tif (! isset($config_data[$setting_name]))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$setting_name] = $config_defaults[$setting_name];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Group non boolean config value types together.\r\n\t\t$non_boolean_columns = array('order_number_prefix', 'order_number_suffix', 'weight_type', 'minimum_order', 'reward_point_multiplier', 'reward_voucher_multiplier', \r\n\t\t\t'reward_point_to_voucher_ratio', 'reward_point_days_pending', 'reward_point_days_valid', 'reward_voucher_days_valid', 'quantity_decimals', 'weight_decimals');\r\n\t\t\r\n\t\t// Ensure the data is stored in the correct format type.\r\n\t\tforeach($config_data as $column => $value)\r\n\t\t{\r\n\t\t\t// Ensure non boolean values are stored as their entered value.\r\n\t\t\tif (in_array($column, $non_boolean_columns))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (string)$config_data[$column];\r\n\t\t\t}\r\n\t\t\t// All others are saved as boolean.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (bool)$config_data[$column];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set configuration data to cart session settings.\r\n\t\t$this->flexi->cart_contents['settings']['configuration'] = $config_data;\r\n\r\n\t\t// Set an empty cart id and order number placeholder.\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['cart_data_id'] = FALSE;\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['order_number'] = FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}",
"private static function _addMainConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable emerchantpay Checkout Module',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . \"',\n 'true',\n 'Do you want to process payments via emerchantpay''s Genesis Gateway?',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Title',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CHECKOUT_PAGE_TITLE'\n ) . \"',\n 'Pay safely with emerchantpay Checkout',\n 'This name will be displayed on the checkout page', '6', '4',\n 'emp_zfg_draw_input(null, ', now())\"\n );\n }",
"function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Nochex Module', 'MODULE_PAYMENT_NOCHEX_STATUS', 'True', 'Do you want to accept Nochex payments?', '6', '44', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Nochex Email Address', 'MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS','\".STORE_OWNER_EMAIL_ADDRESS.\"', 'Registered email address for your Nochex account.<br />NOTE: This must match <strong>EXACTLY </strong>the registered email address on your Nochex account.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Nochex Account Type', 'MODULE_PAYMENT_NOCHEX_ACCOUNT_TYPE', 'Seller', 'Please select the type of Nochex account you are accepting payments with.', '6', '44', 'zen_cfg_select_option(array(\\'Seller\\',\\'Merchant\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_NOCHEX_MERCHANT_ID', '', 'For Nochex Merchant account holders, allows you to accept payments using a different merchant ID. Has no effect on Seller accounts.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_NOCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '44', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_NOCHEX_PROCESSING_STATUS_ID', '\" . DEFAULT_ORDERS_STATUS_ID . \"', 'Set the status of orders made with this payment module that are not yet completed to this value<br />(\\'Pending\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', '2', 'Set the status of orders made with this payment module that have completed payment to this value<br />(\\'Processing\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '44', now())\");\r\n\r\n // Nochex testing options go here\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_NOCHEX_APC_DEBUG', 'Off', 'Enable debug logging? <br />NOTE: This can REALLY clutter your email inbox!<br />Logging goes to the /includes/modules/payment/nochex_apc/logs folder<br />Email goes to the store-owner address.<strong>Leave OFF for normal operation.</strong>', '6', '44', 'zen_cfg_select_option(array(\\'Off\\',\\'Log File\\',\\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Status Live/Testing', 'MODULE_PAYMENT_NOCHEX_TESTING', 'Live', 'Set Nochex module to Live or Test. In Test mode no money is transferred.', '6', '44', 'zen_cfg_select_option(array(\\'Live\\', \\'Test\\'), ', now())\");\r\n\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_INSTALLED');\r\n }",
"public function install_module_register()\n {\n $this->EE->db->insert('modules', array(\n 'has_cp_backend' => 'y',\n 'has_publish_fields' => 'n',\n 'module_name' => ucfirst($this->get_package_name()),\n 'module_version' => $this->get_package_version()\n ));\n }",
"function installConfigurationModule(){\n $query=\"CREATE TABLE `configuracion` (\n `id_configuracion` int(11) NOT NULL auto_increment,\n `nombre` varchar(50) NOT NULL,\n `valor` blob,\n `estado` int(11) NOT NULL,\n `tipo` int(11) NOT NULL default '0',\n `metadata` blob,\n `descripcion` varchar(150) NOT NULL,\n PRIMARY KEY (`id_configuracion`),\n UNIQUE KEY `nombre` (`nombre`)\n ) ENGINE=InnoDB;\";\n\n if(!createTable($query,\"configuracion\")) return false;\n installAudDataObject('configuracion');\n return upgradeConfigurationModule();\n}",
"public function setModules()\n\t{\n \t//Zend_Registry::set('modules', $modules->getList());\n\t}",
"public function actionGenerateModuleConfig()\n {\n $detectedModules = $this->actionDetectModules();\n\n $modules = Module::model()->findAll(new CDbCriteria(array(\n 'order' => 'name',\n 'condition' => 'enabled = true',\n )));\n $config = array();\n foreach ($modules as $module) {\n if (!isset($detectedModules[$module->name])) continue;\n $config[$module->name] = array(\n 'class' => $detectedModules[$module->name]\n );\n }\n $str = \"<?php\\nreturn \" . var_export($config, true) . \"\\n?>\";\n file_put_contents(Yii::getPathOfAlias('runtime.cache') . '/modules.php', $str);\n }",
"function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net (eCheck) Module', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS', 'True', 'Do you want to accept eCheck payments via Authorize.net?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login ID', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN', 'testing', 'The API Login ID used for the Authorize.net service', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY', 'Test', 'Transaction Key used for encrypting TP data<br />(See your Authorizenet Account->Security Settings->API Login ID and Transaction Key for details.)', '6', '0', now(), 'zen_cfg_password_display')\"); \r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('MD5 Hash', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH', '*Set A Hash Value at AuthNet Admin*', 'Encryption key used for validating received transaction data (MAX 20 CHARACTERS)', '6', '0', now(), 'zen_cfg_password_display')\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'zen_cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE', 'Authorize', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'zen_cfg_select_option(array(\\'Authorize\\', \\'Authorize+Capture\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Database Storage', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA', 'True', 'Do you want to save the gateway communications data to the database?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net email a receipt to the customer?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT', 'False', 'Should Authorize.Net email a receipt to the merchant?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID', '1', 'Set the status of orders made with this payment module to this value', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING', 'Off', 'Would you like to enable debug mode? A complete detailed log of failed transactions may be emailed to the store owner.', '6', '0', 'zen_cfg_select_option(array(\\'Off\\', \\'Log File\\', \\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Wells Fargo SecureSource Merchant', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED', 'False', 'Are you a Wells Fargo SecureSource merchant? eCheck transactions will collect additional information from customers. Set to True only if your account has been configured to use Wells Fargo SecureSource.', '6', '0', 'zen_cfg_select_option(array(\\'False\\', \\'True\\'), ', now())\");\r\n }",
"public function database($module = 'core')\n {\n if (function_exists('get_instance')) {\n $CI =& get_instance();\n\n $CI->load->model('settings/settings_model');\n $settings = $CI->settings_model->find_all_by('module', $module);\n\n if (!is_array($settings) && count($settings) > 0)\n return false;\n\n foreach ($settings as $key => $value) {\n $CI->config->set_item($key, $value);\n }\n\n }\n }",
"public function installKeTabel() {\n\t\t$countModulesFile = count($this->getModulesDirOnDisk());\n\t\t$toBeInstalled = array();\n\n\t\tif($countModulesFile > $this->getTotalModuleFromDb()) {\n\t\t\t$cacheModule = file(Yii::getPathOfAlias('application.config').'/cache_module.php');\n\t\t\t$installedModule = $this->getModulesDirOnDisk();\n\t\t\t$toBeInstalled = array();\n\t\t\t$caches = array();\n\t\t\tforeach($cacheModule as $val) {\n\t\t\t\t$caches[] = trim(strtolower($val));\n\t\t\t}\n\n\t\t\t// Cari nama modul yang belum masuk database.\n\t\t\tif(count($cacheModule) == 0 || count($cacheModule) < 1) {\n\t\t\t\tif($installedModule) {\n\t\t\t\t\tforeach($installedModule as $val) {\n\t\t\t\t\t\t$toBeInstalled[] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}else {\n\t\t\t\tif($installedModule) {\n\t\t\t\t\tforeach($installedModule as $val) {\n\t\t\t\t\t\t$val = trim($val);\n\t\t\t\t\t\tif(!in_array(strtolower($val), $caches)) {\n\t\t\t\t\t\t\t$toBeInstalled[] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = \"INSERT INTO {$this->_moduleTableName}(id, name, enabled) VALUES\";\n\t\t\t$id = $this->getIdMax('id', 'swt_com_modules');\n\t\t\tfor($i = 0; $i < count($toBeInstalled); $i++) {\n\t\t\t\tif(isset(Yii::app()->getModule($toBeInstalled[$i])->active))\n\t\t\t\t\t$active = Yii::app()->getModule($toBeInstalled[$i])->active;\n\t\t\t\telse\n\t\t\t\t\t$active = 0;\n\n\t\t\t\t$desc = Yii::app()->getModule($toBeInstalled[$i])->description;\n\n\t\t\t\tif($i == (count($toBeInstalled) - 1)) {\n\t\t\t\t\t$sql .= '(' . $id . ', \"' . $toBeInstalled[$i] . '\", ' . $active . ')';\n\t\t\t\t}else\n\t\t\t\t\t$sql .= '(' . $id . ', \"' . $toBeInstalled[$i] . '\", ' . $active . '),';\n\n\t\t\t\t$id++;\n\t\t\t}\n\n\t\t\t//Check if module already inserted to table.\n\t\t\t$conn = Yii::app()->db;\n\n\t\t\tif(count($toBeInstalled) > 0) {\n\t\t\t\t$result = $conn->createCommand($sql)->execute();\n\t\t\t\tif($result)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"protected function setEngineModules()\n {\n $mods = ModulesModel::getEnabled();\n if ($mods) {\n foreach ($mods as $module) {\n $this->setModules(array($module->name => array(\n 'access' => $module->access\n )\n ));\n }\n }\n }",
"public function install() {\n\t\t$this->load->model('design/layout');\n\t\t$this->load->model('setting/setting');\n\n\t\t$settings = array();\n\n\t\t// Add a module for every possible layout, in the content_bottom position\n\t\tforeach ($this->model_design_layout->getLayouts() as $layout) {\n\t\t\t$settings['basket_capture_module'][] = array(\n\t\t\t\t'layout_id' => $layout['layout_id'],\n\t\t\t\t'position' => 'content_bottom',\n\t\t\t\t'status' => '1',\n\t\t\t\t'sort_order' => '1',\n\t\t\t);\n\t\t}\n\n\t\t// Save the settings\n\t\t$this->model_setting_setting->editSetting('basket_capture', $settings);\t\t\n\t}",
"protected function addToConfig()\n {\n $path = $this->getConfigPath();\n $config = require($path);\n if (isset($config[$this->moduleId])) {\n if (\\Yii::$app->controller->confirm('Rewrite exist config?')) {\n $config[$this->moduleId] = $this->getConfigArray();\n echo 'Module config was rewrote' . PHP_EOL;\n }\n } else {\n $config[$this->moduleId] = $this->getConfigArray();\n }\n\n\n $this->writeArrayToFile($this->getConfigPath(), $config);\n }",
"public function initModulesKeys() {\n $this->data['module_keys'] = array(\n 'status',\n 'allow_guest',\n 'custom_css',\n 'limit_seller',\n 'allow_seller',\n 'notify_admin',\n 'email_subject',\n 'email_text',\n 'email_notification',\n 'email_notification_subject',\n 'email_accept_subject',\n 'email_accept_text',\n 'custom_css_email_accept',\n 'email_reject_subject',\n 'email_reject_text',\n 'custom_css_email_reject',\n 'registered_request',\n 'unregistered_request',\n 'coupon_name',\n 'coupon_validity'\n );\n }",
"function install() {\n global $db;\n $payments = $this->checkpayments();\n foreach ($payments as $payment){\n $id_result = tep_db_query(\"SELECT configuration_id FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_\".$payment.\"_MODE'\");\n $id = tep_db_fetch_array($id_result);\n if (is_array($id)){\n $display_result = tep_db_query(\"SELECT configuration_id FROM \". TABLE_CONFIGURATION .\" WHERE configuration_key='MODULE_PAYMENT_CGP_\".$payment.\"_CHECKOUT_DISPLAY'\");\n $display = tep_db_fetch_array($display_result);\n if ($display == false){\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Checkout display mode', 'MODULE_PAYMENT_CGP_\" . strtoupper($payment) . \"_CHECKOUT_DISPLAY', 'Text', 'Set checkout display mode', '6', '21','tep_cfg_select_option(array(\\'Text\\', \\'Logo\\', \\'Text and Logo\\'), ', now())\");\n }\n }\n }\n $domain_name = constant(\"HTTP_SERVER\");\n if (! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {\n $domain_name .= constant(\"DIR_WS_CATALOG\");\n } else {\n $domain_name .= constant(\"DIR_WS_CATALOG\");\n }\n \n $cgp_control = $domain_name . 'ext/modules/payment/cgp/cgp.php';\n \n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CGP Module', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_STATUS', 'True', 'Do you want to accept \" . constant(\"MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_TEXT_TITLE\") . \" payments?', '6', '21', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Test/Live Mode', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_MODE', 'Test', 'Set test or live mode', '6', '21','tep_cfg_select_option(array(\\'Test\\', \\'Live\\'), ', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Site ID', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_SITEID', '', 'Assigned Site ID by CardGate', '6', '22', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Hash key', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_KEYCODE', '', 'Security hash code from CardGate back-office', '6', '23', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Gateway language', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_LANGUAGE', 'en', 'Default gateway language', '6', '24', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Payment in progress status', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ORDER_INITIAL_STATUS_ID', '0', 'Set the status of orders when customers are being redirected to the gateway', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Payment complete status', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ORDER_PAID_STATUS_ID', '0', 'Set the status of orders when a payment was successful', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Payment failed/canceled status', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ORDER_FAILED_STATUS_ID', '0', 'Set the status of orders when a payment has failed or been canceled', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '9', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())\");\n \n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Checkout display mode', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_CHECKOUT_DISPLAY', 'Text', 'Set checkout display mode', '6', '21','tep_cfg_select_option(array(\\'Text\\', \\'Logo\\', \\'Text and Logo\\'), ', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0' , now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Drop table on deinstall', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_DROP_TABLE', 'False', 'Drop the `CGP_orders_table` on deinstall of this module. ONLY DO THIS IF ALL THE ORDERS HAVE BEEN PROCESSED AND YOU ARE INSTALLING A NEWER VERSION OF THIS MODULE. AFFECTS ALL CGP MODULES!', '6', '0', 'tep_cfg_select_option(array(\\'False\\', \\'True\\'), ', now())\");\n @tep_db_query(\"INSERT INTO \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Control URL', 'MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_REMEMBER', '', 'Set the Control URL in your Card Gate Merchant back-office to: <br><b>\" . $cgp_control . \"</b>', '6', '0',true, now())\");\n \n $query = 'CREATE TABLE IF NOT EXISTS `CGP_orders_table` (' . 'ref_id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,' . 'date_ordered datetime NOT NULL,' . 'module VARCHAR(32) NOT NULL,' . 'customer_id INT(11) NOT NULL DEFAULT 0,' . 'orderstr TEXT NOT NULL,' . 'amount INT(11) NOT NULL DEFAULT 0,' . 'status INT(11) NOT NULL DEFAULT 0,' . 'transaction_id VARCHAR(32) NOT NULL DEFAULT 0,' . 'is_test INT(11) NOT NULL DEFAULT 0,' . 'order_id INT(11) NOT NULL' . ')';\n \n tep_db_query($query);\n \n // make sure order status exist\n $pm_status = array();\n $pm_status[0] = array(\n '1000',\n 'Payment complete'\n );\n $pm_status[1] = array(\n '1001',\n 'Payment cancelled'\n );\n \n for ($i = 0; $i < count($pm_status); $i ++) {\n $language_result = tep_db_query('SELECT languages_id FROM ' . TABLE_LANGUAGES);\n while ($languages = tep_db_fetch_array($language_result)) {\n $language_id = $languages['languages_id'];\n $sql = 'SELECT orders_status_id FROM ' . TABLE_ORDERS_STATUS . ' WHERE orders_status_id = ' . $pm_status[$i][0] . ' and language_id = ' . $language_id;\n $status_result = tep_db_query($sql);\n $id = tep_db_fetch_array($status_result);\n if ($id['orders_status_id'] != $pm_status[$i][0]) {\n tep_db_query('INSERT INTO ' . TABLE_ORDERS_STATUS . ' (orders_status_id, language_id, orders_status_name) VALUES (' . $pm_status[$i][0] . ',' . $language_id . ',\"' . $pm_status[$i][1] . '\")');\n }\n }\n }\n }",
"function install(){\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Activar módulo Pagosonline', 'MODULE_PAYMENT_PAYCO_STATUS', 'True', 'Quiere aceptar pagos usando Payco?', '6', '3', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Id Usuario', 'MODULE_PAYMENT_PAYCO_ID_COM', '', 'Codigo de usuario (usuarioId) proporcionado por Payco', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Llave secreta', 'MODULE_PAYMENT_PAYCO_ID_SEED', '', 'Clave de encriptación proporcionada por Payco', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('URL de la pasarela de pago', 'MODULE_PAYMENT_PAYCO_URL', 'https://secure2.payco.co/payment.php', 'Direccion en internet de la pasarela de pago', '6', '4', now())\");\n\t \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Prueba', 'MODULE_PAYMENT_PAYCO_PRUEBA', '1', 'Prueba es la variable para poner su carrito en modo de pruebas, si quiere hacer transacciones en modo de pruebas debe ingresar 1 y si si quiere estar en produccion debe dejarlo en o', '6', '4', now())\");\n \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Orden de aparicion.', 'MODULE_PAYMENT_PAYCO_SORT_ORDER', '0', 'Orden de aparicion. Numero menor es mostrado antes que los mayores.', '6', '0', now())\");\n\n tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Zona de pago', 'MODULE_PAYMENT_PAYCO_ZONE', '0', 'Si selecciona una zona, este módulo sólo estará disponible en esa zona.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\n\t \n\t tep_db_query(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Estado del pedido', 'MODULE_PAYMENT_PAYCO_ORDER_STATUS_ID', '0', 'Seleccione el estado del pedido un vez procesado con este módulo', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n \n\t}",
"protected function _config(){\n parent::_config();\n Raxan::loadLangFile(\"info-module\");\n $this->mnuItem = \"RQHIST\";\n }",
"private static function _addCredentialsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Username',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('USERNAME') . \"',\n '', 'Enter your Username, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Password',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('PASSWORD') . \"',\n '', 'Enter your Password, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Live Mode',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('ENVIRONMENT') . \"',\n 'false', 'If disabled, transactions are going through our Staging \" .\n \"(Test) server, NO MONEY ARE BEING TRANSFERRED', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }",
"private static function _addTransactionsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n $transaction_types\n = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getTransactionsList()\n );\n\n $placeholder = ['none' => 'No specific Bank in use'];\n $availableBankCodes\n = $placeholder + EmpCheckoutSettings::getAvailableBankCodes();\n $bank_codes\n = EMerchantPayCommon::buildSettingsDropDownOptions(\n $availableBankCodes\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Transaction Types',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'TRANSACTION_TYPES'\n ) . \"',\n '\" . \\Genesis\\API\\Constants\\Transaction\\Types::SALE . \"',\n 'What transaction type should we use upon purchase?', '6', '0',\n 'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, \" .\n \"{$transaction_types}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Bank codes for Online banking',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'BANK_CODES'\n ) . \"',\n 'none',\n 'Select Bank code(s) for Online banking transaction.', '6', '0',\n 'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, \" .\n \"{$bank_codes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Partial Capture',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_PARTIAL_CAPTURE'\n ) . \"',\n 'true', 'Use this option to allow / deny Partial Capture Transactions',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Partial Refund',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_PARTIAL_REFUND'\n ) . \"',\n 'true', 'Use this option to allow / deny Partial Refund Transactions',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Cancel Transaction',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_VOID_TRANSACTIONS'\n ) . \"',\n 'true', 'Use this option to allow / deny Cancel Transactions', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }",
"function install_settings()\n\t{\n\t\t//-----------------------------------------\n\t\t// Get DB\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( INS_KERNEL_PATH . 'class_db_' . $this->install->saved_data['sql_driver'] . '.php' );\t\t\n\t\t\n\t\t$this->install->ipsclass->init_db_connection( $this->install->saved_data['db_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_user'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pass'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_host'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pre'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->ipsclass->vars['mysql_codepage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['sql_driver'] );\t\n\t\t//-----------------------------------------\n\t\t// Install settings\n\t\t//-----------------------------------------\n\t\n\t\t$output[] = \"Добавление настроек...\";\n\t\t$xml = new class_xml();\n\t\t$xml->lite_parser = 1;\n\t\t\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/settings.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\n\t\t//-----------------------------------------\n\t\t// Known settings\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( substr( $this->install->saved_data['install_url'], -1 ) == '/' )\n\t\t{\n\t\t\t$this->install->saved_data['install_url'] = substr( $this->install->saved_data['install_url'], 0, -1 );\n\t\t}\n\t\t\n\t\t$_urls = parse_url( $this->install->saved_data['install_url'] );\n\t\t\n\t\t$known = array( 'email_in' => $this->install->saved_data['admin_email'],\n\t\t\t\t\t\t 'email_out' => $this->install->saved_data['admin_email'],\n\t\t\t\t\t\t 'base_dir' => $this->install->saved_data['install_dir'],\n\t\t\t\t\t\t 'upload_dir' => $this->install->saved_data['install_dir'] . '/uploads',\n\t\t\t\t\t\t 'upload_url' => $this->install->saved_data['install_url'] . '/uploads',\n\t\t\t\t\t\t 'search_sql_method' => $this->install->ipsclass->DB->sql_can_fulltext() ? 'ftext' : 'man',\n\t\t\t\t\t\t //'cookie_domain' => $_urls['host'] != 'localhost' ? '.' . preg_replace( \"#^(?:.+?\\.)?([a-z0-9\\-]{3,})\\.(([a-z]{2,4})(\\.([a-z]{2}))?|museum)$#is\", \"\\\\1.\\\\2\", $_urls['host'] ) : '',\n\t\t\t\t\t );\n\t\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// Parse\n\t\t//-----------------------------------------\n\n\t\t$fields = array( 'conf_title' , 'conf_description', 'conf_group' , 'conf_type' , 'conf_key' , 'conf_default',\n\t\t\t\t\t\t 'conf_extra' , 'conf_evalphp' , 'conf_protected', 'conf_position', 'conf_start_group', 'conf_end_group',\n\t\t\t\t\t\t 'conf_help_key', 'conf_add_cache' , 'conf_title_keyword' );\n\n\t\t$setting_fields = array( 'conf_title_keyword', 'conf_title_title', 'conf_title_desc', 'conf_title_noshow', 'conf_title_module' );\n\n\t\t//-----------------------------------------\n\t\t// Fix up...\n\t\t//-----------------------------------------\n \n\t\tif ( ! is_array( $xml->xml_array['settingexport']['settinggroup']['setting'][0] ) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Ensure [0] is populated\n\t\t\t//-----------------------------------------\n\n\t\t\t$tmp = $xml->xml_array['settingexport']['settinggroup']['setting'];\n\n\t\t\tunset($xml->xml_array['settingexport']['settinggroup']['setting']);\n\n\t\t\t$xml->xml_array['settingexport']['settinggroup']['setting'][0] = $tmp;\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Loop through and sort out settings...\n\t\t//-----------------------------------------\n\n\t\tforeach( $xml->xml_array['settingexport']['settinggroup']['setting'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is setting?\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( ! $entry['conf_is_title']['VALUE'] )\n\t\t\t{\n\t\t\t\tforeach( $fields as $f )\n\t\t\t\t{\n\t\t\t\t\t$newrow[$f] = $entry[ $f ]['VALUE'];\n\t\t\t\t}\n\n\t\t\t\t$new_settings[] = $newrow;\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Is title?\n\t\t\t//-----------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach( $setting_fields as $f )\n\t\t\t\t{\n\t\t\t\t\t$newrow[$f] = $entry[ $f ]['VALUE'];\n\t\t\t\t}\n\n\t\t\t\t$new_titles[] = $newrow;\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Sort out titles...\n\t\t//-----------------------------------------\n\n\t\tif ( is_array( $new_titles ) and count( $new_titles ) )\n\t\t{\n\t\t\tforeach( $new_titles as $idx => $data )\n\t\t\t{\n\t\t\t\tif ( $data['conf_title_title'] AND $data['conf_title_keyword'] )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Get ID based on key\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$save = array( 'conf_title_title' => $data['conf_title_title'],\n\t\t\t\t\t\t\t\t 'conf_title_desc' => $data['conf_title_desc'],\n\t\t\t\t\t\t\t\t 'conf_title_keyword' => $data['conf_title_keyword'],\n\t\t\t\t\t\t\t\t 'conf_title_noshow' => $data['conf_title_noshow'],\n\t\t\t\t\t\t\t\t 'conf_title_module' => $data['conf_title_module'] );\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Insert first\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$this->install->ipsclass->DB->do_insert( 'conf_settings_titles', $save );\n\n\t\t\t\t\t$conf_id = $this->install->ipsclass->DB->get_insert_id();\n\t\t\t\t\t$save['conf_title_id'] = $conf_id;\n\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// Update settings cache\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$setting_groups_by_key[ $save['conf_title_keyword'] ] = $save;\n\t\t\t\t\t$setting_groups[ $save['conf_title_id'] ] = $save;\n\n\t\t\t\t\t$need_update[] = $conf_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Sort out settings\n\t\t//-----------------------------------------\n\n\t\tif ( is_array( $new_settings ) and count( $new_settings ) )\n\t\t{\n\t\t\tforeach( $new_settings as $idx => $data )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Insert known\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tif ( in_array( $data['conf_key'], array_keys( $known ) ) )\n\t\t\t\t{\n\t\t\t\t\t$data['conf_value'] = $known[ $data['conf_key'] ];\n\t\t\t\t\t#$data['conf_default'] = $known[ $data['conf_key'] ];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['conf_value'] = '';\n\t\t\t\t}\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Now assign to the correct ID based on\n\t\t\t\t// our title keyword...\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\t$data['conf_group'] = $setting_groups_by_key[ $data['conf_title_keyword'] ]['conf_title_id'];\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Remove from array\n\t\t\t\t//-----------------------------------------\n\n\t\t\t\tunset( $data['conf_title_keyword'] );\n\n\t\t\t\t$this->install->ipsclass->DB->do_insert( 'conf_settings', $data );\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Update group counts...\n\t\t//-----------------------------------------\n\n\t\tif ( count( $need_update ) )\n\t\t{\n\t\t\tforeach( $need_update as $i => $idx )\n\t\t\t{\n\t\t\t\t$conf = $this->install->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count', 'from' => 'conf_settings', 'where' => 'conf_group='.$idx ) );\n\n\t\t\t\t$count = intval($conf['count']);\n\n\t\t\t\t$this->install->ipsclass->DB->do_update( 'conf_settings_titles', array( 'conf_title_count' => $count ), 'conf_title_id='.$idx );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->install->template->append( $this->install->template->install_page_refresh( $output ) );\n\t\t$this->install->template->next_action = '?p=install&sub=acpperms';\n\t\t$this->install->template->hide_next = 1;\n\t}",
"public function __construct()\n {\n config(['frontend.module' => $this->table ]);\n }",
"function install() {\n\t\t$config ['username'] = '';\n\t\t$config ['password'] = '';\n\t\t;\n\t\t$config ['signature'] = '';\n\t\t$config ['currency'] = 'EUR'; // default\n\t\t\n\n\t\t$config ['SANDBOX'] = true;\n\t\t\n\t\t$config ['enabled'] = \"0\";\n\t\t\n\t\t//not normally user configurable\n\t\t$config ['return_url'] = \"\";\n\t\t$config ['cancel_url'] = \"\";\n\t\t\n\t\t$this->CI->Settings_model->save_settings ( 'bnp_parisbas', $config );\n\t}",
"function install_core_config() {\n $db = DB::getInstance();\n $site_config = array(\n 'name' => Sanitize::checkPlain($_POST['name']),\n 'slogan' => Sanitize::checkPlain($_POST['slogan']),\n 'lang' => Session::get('lang'),\n 'theme' => 'core'\n );\n $sql = \"INSERT INTO `config` (`property`, `contents`) VALUES \"\n . \"('?', '?'),\"\n . \"('?', '?'),\"\n . \"('?', '?'),\"\n . \"('?', '?'),\";\n if(!$db->query($sql, array('site_name', $site_config['name'], 'site_slogan', $site_config['slogan'], 'site_language', $site_config['lang'], 'site_theme', $site_config['theme']))->error()) {\n return true;\n }\n else {\n //Return error\n System::addMessage('error', rt('The website could not be configured. Please make sure that you have entered all the information correctly and that you have supplied a database username and password with sufficient permissions to make changes in the database'));\n }\n return false;\n}",
"private static function _addOrderConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Default Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the default status of orders made with this payment module\" .\n \" to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Failed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'FAILED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of failed orders made with this payment module to\" .\n \" this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Processed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'PROCESSED_ORDER_STATUS_ID'\n ) . \"',\n '2', 'Set the status of processed orders made with this payment \" .\n \"module to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Refunded Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'REFUNDED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of refunded orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Canceled Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CANCELED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of canceled orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n }",
"public function install_module_entries_table()\n {\n $this->EE->load->dbforge();\n\n $this->EE->dbforge->add_field(array(\n 'log_entry_id' => array(\n 'auto_increment' => TRUE,\n 'constraint' => 10,\n 'type' => 'INT',\n 'unsigned' => TRUE\n ),\n 'site_id' => array(\n 'constraint' => 5,\n 'type' => 'INT',\n 'unsigned' => TRUE\n ),\n 'addon_name' => array(\n 'constraint' => 50,\n 'type' => 'VARCHAR'\n ),\n 'admin_emails' => array(\n 'type' => 'MEDIUMTEXT'\n ),\n 'date' => array(\n 'constraint' => 10,\n 'type' => 'INT',\n 'unsigned' => TRUE\n ),\n 'notify_admin' => array(\n 'constraint' => 1,\n 'default' => 'n',\n 'type' => 'CHAR'\n ),\n 'type' => array(\n 'constraint' => 10,\n 'type' => 'VARCHAR'\n ),\n 'message' => array(\n 'type' => 'TEXT'\n ),\n 'extended_data' => array(\n 'type' => 'TEXT'\n )\n ));\n\n $this->EE->dbforge->add_key('log_entry_id', TRUE);\n $this->EE->dbforge->add_key('addon_name');\n $this->EE->dbforge->create_table('omnilog_entries', TRUE);\n }",
"public function getModuleConfiguration();"
] |
[
"0.6795552",
"0.6567651",
"0.6541905",
"0.6502597",
"0.64680785",
"0.6438933",
"0.64385194",
"0.63848305",
"0.6356",
"0.63506526",
"0.63158846",
"0.626857",
"0.6251879",
"0.622227",
"0.61562586",
"0.61420506",
"0.6107641",
"0.6080995",
"0.60755223",
"0.6074327",
"0.6071657",
"0.6063731",
"0.60421157",
"0.60267025",
"0.60239947",
"0.59934026",
"0.59554815",
"0.5919001",
"0.59082216",
"0.5908119"
] |
0.7484395
|
0
|
Inserts config entries for status, title
|
private static function _addMainConfigurationEntries()
{
global $db;
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Enable emerchantpay Checkout Module',
'" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . "',
'true',
'Do you want to process payments via emerchantpay''s Genesis Gateway?',
'6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Checkout Title',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'CHECKOUT_PAGE_TITLE'
) . "',
'Pay safely with emerchantpay Checkout',
'This name will be displayed on the checkout page', '6', '4',
'emp_zfg_draw_input(null, ', now())"
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = '';\r\n }\r\n $response = Configuration::updateValue($this->name . '_TITLE', $title);\r\n $response &= Configuration::updateValue($this->name . '_MAXITEM', 5);\r\n $response &= Configuration::updateValue($this->name . '_MINITEM', 2);\r\n $response &= Configuration::updateValue($this->name . '_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue($this->name . '_AUTOSCROLLDELAY', 5000);\r\n $response &= Configuration::updateValue($this->name . '_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue($this->name . '_PAGINATION', 0);\r\n $response &= Configuration::updateValue($this->name . '_NAVIGATION', 0);\r\n $response &= Configuration::updateValue($this->name . '_MANTITLE', 0);\r\n\r\n return $response;\r\n }",
"private static function _addOrderConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Default Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the default status of orders made with this payment module\" .\n \" to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Failed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'FAILED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of failed orders made with this payment module to\" .\n \" this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Processed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'PROCESSED_ORDER_STATUS_ID'\n ) . \"',\n '2', 'Set the status of processed orders made with this payment \" .\n \"module to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Refunded Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'REFUNDED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of refunded orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Canceled Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CANCELED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of canceled orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n }",
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\t\t\t\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Specials products';\r\n }\r\n $response = Configuration::updateValue('FIELD_SPECIALPLS_NBR', 6);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_VERTICAL', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MAXITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MEDIUMITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLLDELAY', 4000);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_NAVIGATION', 0);\r\n\r\n return $response;\r\n }",
"private function runConfig()\n {\n $configs = [\n [\n 'name' => 'sub_title',\n 'alias_name' => 'SubTitle',\n 'value' => 'SubTitle',\n ],\n [\n 'name' => 'title',\n 'alias_name' => 'Title',\n 'value' => 'Title',\n ],\n ];\n\n foreach ($configs as $config) {\n factory(Config::class)->create($config);\n }\n }",
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Featured product';\r\n }\r\n $response = Configuration::updateValue('FIELD_FEATUREDPSL_NBR', 8);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_CAT', (int)Context::getContext()->shop->getCategory());\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_VERTICAL', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MAXITEM', 4);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MEDIUMITEM', 2);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_AUTOSCROLLDELAY', 5000);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_NAVIGATION', 1);\r\n\r\n return $response;\r\n }",
"protected function initTitles() {\n\t\t$title \t = \"\";\n\t\t\n\t\tif(isset($this->config['titles']['title']))\n\t\t \t$title = $this->config['titles']['title'];\n\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['title']))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['title'];\n\t\t \t\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()]))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()];\n\t\t \t\n\t\t$this->layout->setTitle($title);\n\t}",
"private static function print_log_configs() {\n\t//--\n\tglobal $configs;\n\t//--\n\t$log = '<div class=\"smartframework_debugbar_status smartframework_debugbar_status_head\"><font size=\"4\"><b>Application :: CONFIGURATION Log</b></font></div>';\n\t//-- vars\n\t$log .= '<div class=\"smartframework_debugbar_status smartframework_debugbar_status_highlight\" style=\"width:450px;\"><b>App CONFIG VARIABLES</b></div>';\n\t$arr = (array) $configs;\n\tksort($arr);\n\t$i=0;\n\t$j=0;\n\tforeach((array)$arr as $key => $val) {\n\t\t//--\n\t\t$i++;\n\t\t//--\n\t\t$log .= '<table cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">';\n\t\t$log .= '<tr valign=\"top\" title=\"#'.$i.'\"><td width=\"195\"><div class=\"smartframework_debugbar_inforow\">';\n\t\t$log .= '<b>'.Smart::escape_html((string)$key).'</b>';\n\t\t$log .= '</div></td><td><div class=\"smartframework_debugbar_inforow\">';\n\t\tif(is_array($val)) {\n\t\t\t$log .= '<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" style=\"font-size:13px;\">';\n\t\t\t$j=0;\n\t\t\tforeach($val as $k => $v) {\n\t\t\t\t$j++;\n\t\t\t\tif($j % 2) {\n\t\t\t\t\t$color = '#FFFFFF';\n\t\t\t\t} else {\n\t\t\t\t\t$color = '#FAFAFA';\n\t\t\t\t} //end if else\n\t\t\t\t$log .= '<tr bgcolor=\"'.$color.'\" valign=\"top\" title=\"#'.$i.'.'.$j.'\"><td width=\"290\"><b>'.Smart::escape_html((string)$k).'</b></td><td>'.SmartMarkersTemplating::prepare_nosyntax_html_template(Smart::nl_2_br(Smart::escape_html(self::print_value_by_type($v))), true).'</td></tr>';\n\t\t\t} //end foreach\n\t\t\t$log .= '</table>';\n\t\t} else {\n\t\t\t$log .= '<pre>'.SmartMarkersTemplating::prepare_nosyntax_html_template(Smart::escape_html((string)$val), true).'</pre>';\n\t\t} //end if else\n\t\t$log .= '</div></td></tr>';\n\t\t$log .= '</table>';\n\t\t//--\n\t} //end while\n\t//-- constants\n\t$log .= '<div class=\"smartframework_debugbar_status smartframework_debugbar_status_highlight\" style=\"width:450px;\"><b>App SETTING CONSTANTS</b></div>';\n\t$arr = (array) get_defined_constants(true);\n\t$arr = (array) $arr['user'];\n\tksort($arr);\n\t$i=0;\n\t$j=0;\n\tforeach((array)$arr as $key => $val) {\n\t\t//--\n\t\t$i++;\n\t\t//--\n\t\tif(((string)$key == 'SMART_FRAMEWORK_CHMOD_DIRS') OR ((string)$key == 'SMART_FRAMEWORK_CHMOD_FILES')) {\n\t\t\tif(is_numeric($val)) {\n\t\t\t\t$val = (string) '0'.@decoct($val).' (octal)';\n\t\t\t} else {\n\t\t\t\t$val = (string) $val.' (!!! Warning, Invalid ... Must be OCTAL !!!)';\n\t\t\t} //end if\n\t\t} //end if\n\t\t//--\n\t\t$log .= '<table cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">';\n\t\t$log .= '<tr valign=\"top\" title=\"#'.$i.'\"><td width=\"375\"><div class=\"smartframework_debugbar_inforow\"><b>'.Smart::escape_html((string)$key).'</b></div></td><td><div class=\"smartframework_debugbar_inforow\">'.SmartMarkersTemplating::prepare_nosyntax_html_template(Smart::nl_2_br(Smart::escape_html(self::print_value_by_type($val))), true).'</div></td></tr>';\n\t\t$log .= '</table>';\n\t\t//--\n\t} //end while\n\t//--\n\treturn $log;\n\t//--\n}",
"private function deployConfig()\n {\n $config = \\SmConfig::$configTable;\n $currentConfig = $this->_db->fetchAll('config');\n\n foreach ($config as $k => $v) {\n $exists = false;\n foreach ($currentConfig as $c) {\n if ($c['c_name'] == $k) {\n $exists = true;\n break;\n }\n }\n if (!$exists) {\n $this->_db->insert('config', ['c_name' => $k, 'c_value' => $v]);\n }\n }\n }",
"public function run()\n {\n $statuses = [\n ['name' => 'On track', 'value' => 'on-track', 'color' => '#00423f', 'bg' => '#00d4c8'],\n ['name' => 'At risk', 'value' => 'at-risk', 'color' => '#574500', 'bg' => '#ffd100'],\n ['name' => 'On track', 'value' => 'off-track', 'color' => '#fff', 'bg' => '#fb5779'],\n ];\n\n Status::insert($statuses);\n }",
"function addStatusManage($title = 'status', array $options = array()){\n\t\t$View = $this->_View();\n\t\t$this->Html->script('CakeGrid.changeStatus',array('inline' => false));\n\t\t\n\t\t$defaults = array(\n\t\t\t'editable' => false,\n\t\t\t'type' \t => 'string',\n\t\t\t'element' => false,\n\t\t\t'linkable' => false,\n\t\t\t'total' => false,\n\t\t\t'status' => true,\n\t\t\t'fieldName' => 'status',\n\t\t\t'primaryKey' => 'id'\n\t\t);\n\t\t$options = array_merge($defaults, $options);\n\t\t\n\t\t$titleSlug = Inflector::slug($title);\n\n\t\t$models = current($View->request->params['models']);\n\t\t$curentModel = $models['className'];\n\t\t$valuePath = '/' . $curentModel . '/' . $options['fieldName'];\n\t\t\n\t\t$this->__columns[$titleSlug] = array(\n\t\t\t'title' => $title,\n\t\t\t'valuePath' => $valuePath,\n\t\t\t'options' => $options\n\t\t);\n\t\t\n\t\tif($options['total'] == true){\n\t\t\t$this->__totals[$title] = 0;\n\t\t}\n\t\t\n\t\t#make status action\n\t\t$name = 'status';\n\t\t$url = array(\n\t\t\t'controller' => $View->request->params['controller'],\n\t\t\t'action' => 'changeStatus'\n\t\t);\n\t\t$trailingParams = array(\n\t\t\t'/' . $curentModel . '/' . $options['primaryKey'],\n\t\t\t'/' . $curentModel . '/' . $options['fieldName']\n\t\t);\n\t\t$options = array('escape'=> false);\n\t\tif($this->mainTitleSlug == null){\n\t\t\t$this->addAction($name, $url, $trailingParams, $options);\n\t\t}\n\t\telse{\n\t\t\t$this->addCommonAction($name, $url, $trailingParams, $options);\n\t\t}\n\t\treturn $titleSlug;\n\t}",
"function updateConfig() {\n global $db;\n global $lang;\n\n if(configEnabled() == true) {\n if($res = $db->query(\"INSERT IGNORE INTO `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` (`id`, `key`, `val`) VALUES \".getKeys())) {\n return \"Updated\";\n } else {\n return \"Cannot insert rows. Error: \".$db->error;\n }\n } else {\n return \"Config never been initialized\";\n }\n }",
"private function setUpStatusAndMessageSuccess()\n {\n $this->status = config('constants.status.OK');\n $this->message = config('constants.message.OK');\n }",
"public function onBeforeWrite()\n {\n /** @var SiteConfig $siteconfig */\n $siteconfig = SiteConfig::current_site_config();\n if (!$siteconfig->Title) {\n $siteconfig->Title = $this->Title;\n $siteconfig->Tagline = $this->Tagline;\n $siteconfig->write();\n }\n\n parent::onBeforeWrite();\n }",
"function addCommonStatusManage(/*$title = 'status',*/ array $options = array()){\n\t\t$title = 'status';\n\t\t$View = $this->_View();\n\t\t$this->Html->script('CakeGrid.changeStatus',array('inline' => false));\n\t\t\n\t\t$defaults = array(\n\t\t\t'editable' => false,\n\t\t\t'type' \t => 'string',\n\t\t\t'element' => false,\n\t\t\t'linkable' => false,\n\t\t\t'total' => false,\n\t\t\t'status' => true,\n\t\t\t'fieldName' => 'status',\n\t\t\t'primaryKey' => 'id'\n\t\t);\n\t\t$options = array_merge($defaults, $options);\n\n\t\t$models = current($View->request->params['models']);\n\t\t$curentModel = $models['className'];\n\t\t$valuePath['/' . $curentModel . '/' . $options['fieldName']] = $title;\n\t\t$valuePath['type'] = 'commonValue';\n\t\t$valuePath['separator'] = $options['separator'];\n\t\t$oldValuePath = isset($this->__columns[$this->mainTitleSlug]['commonValue']) && $this->__columns[$this->mainTitleSlug]['commonValue']['valuePath'] != null ? $this->__columns[$this->mainTitleSlug]['commonValue']['valuePath'] : array();\n\t\t$vPath = array_merge($oldValuePath,$valuePath);\n\t\t$this->__columns[$this->mainTitleSlug]['commonValue']['valuePath'] = $vPath;\n\t\t\n\t\t#make status action\n\t\t$name = 'status';\n\t\t$url = array(\n\t\t\t'controller' => $View->request->params['controller'],\n\t\t\t'action' => 'changeStatus'\n\t\t);\n\t\t$trailingParams = array(\n\t\t\t'/' . $curentModel . '/' . $options['primaryKey'],\n\t\t\t'/' . $curentModel . '/' . $options['fieldName']\n\t\t);\n\t\t$options = array('escape'=> false);\n\t\tif($this->mainTitleSlug == null){\n\t\t\t$this->addAction($name, $url, $trailingParams, $options);\n\t\t}\n\t\telse{\n\t\t\t$this->addCommonAction($name, $url, $trailingParams, $options);\n\t\t}\n\t\treturn $this->mainTitleSlug;\n\t}",
"protected function _config(){\n parent::_config();\n Raxan::loadLangFile(\"info-module\");\n $this->mnuItem = \"RQHIST\";\n }",
"public function run()\n {\n Status::insert($this->statusLists);\n }",
"private static function _addCredentialsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Username',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('USERNAME') . \"',\n '', 'Enter your Username, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Password',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('PASSWORD') . \"',\n '', 'Enter your Password, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Live Mode',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('ENVIRONMENT') . \"',\n 'false', 'If disabled, transactions are going through our Staging \" .\n \"(Test) server, NO MONEY ARE BEING TRANSFERRED', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }",
"private function setup() {\n sfContext::createInstance($this->configuration);\n\n $this->status = TaskStatus::getTaskStatus($this);\n\n $this->logger = new sfFileLogger(\n sfContext::getInstance()->getEventDispatcher(),\n array('file' => './log/tasks/'.get_class($this).'.log'));\n\n if(false === $this->status) {\n $this->log(\"Status row in Database does not exist\");\n $this->status = new TaskStatus();\n $this->status->task_name = get_class($this);\n $this->status->save();\n }\n\n $this->status->description = substr($this->briefDescription, 0, 120);\n\n $this->log(\"Task was executed via cronjob.\");\n }",
"public function addStatus($status);",
"private static function _addWpfConfigurationEntries()\n {\n global $db;\n\n $sortOrderAttributes = \"array(''maxlength'' => ''3'')\";\n $languages = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getAvailableCheckoutLanguages()\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Page Language',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('LANGUAGE') . \"',\n 'en', 'What language (localization) should we have on the Checkout?.',\n '6', '0', 'emp_zfg_select_drop_down_single({$languages},', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('WPF Tokenization',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'WPF_TOKENIZATION'\n ) . \"',\n 'false', 'Enable WPF Tokenization', '6', '3', 'emp_zfg_draw_toggle(',\n 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Sort order of display.',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('SORT_ORDER') . \"',\n '0', 'Sort order of display. Lowest is displayed first.', '6', '0',\n 'emp_zfg_draw_number_input({$sortOrderAttributes}, ', now())\"\n );\n }",
"public function mergeTemplateVars()\n {\n $title = $this->data[IrhpPermitType::DATA_KEY]['name']['description'];\n\n $this->templateVarsConfig['generic']['browserTitle'] = $title;\n $this->templateVarsConfig['generic']['title'] = $title;\n\n parent::mergeTemplateVars();\n }",
"public function run()\n {\n DB::table('sitesettings')->insert([\n [\n 'namesetting' => 'Company_name',\n 'value' => 'Company name',\n 'status' => 0\n ],\n [\n 'namesetting' => 'logo',\n 'value' => 'twitter.jpg',\n 'status' => 1\n ],\n [\n 'namesetting' => 'address',\n 'value' => 'Company address',\n 'status' => 0\n ],\n [\n 'namesetting' => 'phone',\n 'value' => '001684849309',\n 'status' => 0\n ]\n ]);\n }",
"function prepConfig() {\n\n global $db;\n global $lang;\n\n if($report = $db->query(\"CREATE DATABASE IF NOT EXISTS \".$lang[\"config_db_name\"].\"\")) {\n\n // Generate safety table\n if($report = $db->query(\"CREATE TABLE IF NOT EXISTS `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` ( `id` INT(6) NOT NULL AUTO_INCREMENT, `key` VARCHAR(100) NOT NULL, UNIQUE (`key`), `val` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;\")) {\n\n return \"Ready\";\n\n } else {\n\n return \"Failed to create table. Error: \".$db->error;\n\n }\n\n } else {\n\n return \"Failed to create database. Error: \".$db->error;\n\n }\n\n }",
"public function run()\n {\n SystemList::insert([\n [\n 'list_name' => 'person_status',\n 'list_item_namespace' => 'active',\n 'list_item_label' => 'Active',\n 'created_at' => now(),\n 'updated_at' => now()\n ],\n [\n 'list_name' => 'person_status',\n 'list_item_namespace' => 'archived',\n 'list_item_label' => 'Archived',\n 'created_at' => now(),\n 'updated_at' => now()\n ]\n ]);\n }",
"public function createBookConfig()\n {\n $bookConfig = $this->twig->render('config.yml.twig', [\n 'title' => $this->config->title,\n 'author' => $this->config->author,\n 'entries' => $this->entries\n ]);\n file_put_contents($this->docPath.DIRECTORY_SEPARATOR.'config.yml', $bookConfig);\n }",
"public function run()\n\t{\n\t\t\\DB::table('configures')->delete();\n \n\t\t\\DB::table('configures')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'cname' => 'Title Site',\n\t\t\t\t'ckey' => 'title_site',\n\t\t\t\t'cvalue' => 'Digital Printing and Wide Format Printing',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-07-15 09:01:20',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 2,\n\t\t\t\t'cname' => 'Meta Description',\n\t\t\t\t'ckey' => 'meta_description',\n\t\t\t\t'cvalue' => 'Specialty digital printer, we focus on unique display graphic solution.',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-07-15 09:01:27',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 3,\n\t\t\t\t'cname' => 'Main Logo',\n\t\t\t\t'ckey' => 'main_logo',\n\t\t\t\t'cvalue' => 'assets/images/logos/logo.14-07-15.png',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-07-15 08:56:14',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 4,\n\t\t\t\t'cname' => 'VI Format',\n\t\t\t\t'ckey' => 'vi_format',\n\t\t\t\t'cvalue' => '2',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 3,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-21 09:24:48',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 5,\n\t\t\t\t'cname' => 'Instagram App ID',\n\t\t\t\t'ckey' => 'instagram_app_id',\n\t\t\t\t'cvalue' => 'f6b31259ea3d4f8489da2e137cec4c34',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'id' => 6,\n\t\t\t\t'cname' => 'Skydrive App ID',\n\t\t\t\t'ckey' => 'skydrive_app_id',\n\t\t\t\t'cvalue' => '0000000040149c21',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'id' => 7,\n\t\t\t\t'cname' => 'Google Drive App ID',\n\t\t\t\t'ckey' => 'googledrive_app_id',\n\t\t\t\t'cvalue' => '542866151209-h64bq9qnogf0e51b7rir1cuni1pnlc8j.apps.googleusercontent.com',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'id' => 8,\n\t\t\t\t'cname' => 'Dropbox App ID',\n\t\t\t\t'ckey' => 'dropbox_app_id',\n\t\t\t\t'cvalue' => '4h5nj85dysuxe3s',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'id' => 9,\n\t\t\t\t'cname' => 'Flickr App Secret',\n\t\t\t\t'ckey' => 'flickr_app_secret',\n\t\t\t\t'cvalue' => '58db44a1386f0b4e',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t9 => \n\t\t\tarray (\n\t\t\t\t'id' => 10,\n\t\t\t\t'cname' => 'Flickr App ID',\n\t\t\t\t'ckey' => 'flickr_app_id',\n\t\t\t\t'cvalue' => '24fdd4da6151132517c7d4572c29d1f0',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t10 => \n\t\t\tarray (\n\t\t\t\t'id' => 11,\n\t\t\t\t'cname' => 'Facebook APP ID',\n\t\t\t\t'ckey' => 'facebook_app_id',\n\t\t\t\t'cvalue' => '1601264390104375',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-04-17 10:27:04',\n\t\t\t\t'updated_at' => '2015-04-17 10:27:04',\n\t\t\t),\n\t\t\t11 => \n\t\t\tarray (\n\t\t\t\t'id' => 12,\n\t\t\t\t'cname' => 'Google Drive Email',\n\t\t\t\t'ckey' => 'google_drive_email',\n\t\t\t\t'cvalue' => '590750925671-qkiep6bvosvpmeespk2sjls8177bsbe9@developer.gserviceaccount.com',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-05-31 00:54:43',\n\t\t\t\t'updated_at' => '2015-05-31 00:54:43',\n\t\t\t),\n\t\t\t12 => \n\t\t\tarray (\n\t\t\t\t'id' => 13,\n\t\t\t\t'cname' => 'Google Drive Key File',\n\t\t\t\t'ckey' => 'google_drive_key_file',\n\t\t\t\t'cvalue' => '/var/www/vi/app/files/google_drive_key_file.p12',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-05-31 00:56:36',\n\t\t\t\t'updated_at' => '2015-05-31 00:56:36',\n\t\t\t),\n\t\t\t13 => \n\t\t\tarray (\n\t\t\t\t'id' => 14,\n\t\t\t\t'cname' => 'System Margin',\n\t\t\t\t'ckey' => 'margin',\n\t\t\t\t'cvalue' => '20',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-06-02 23:00:03',\n\t\t\t\t'updated_at' => '2015-06-02 23:06:47',\n\t\t\t),\n\t\t\t14 => \n\t\t\tarray (\n\t\t\t\t'id' => 15,\n\t\t\t\t'cname' => 'Background 1',\n\t\t\t\t'ckey' => 'background',\n\t\t\t\t'cvalue' => 'http://vi.anvyonline.com/assets/images/background-1b6c4998efbc1045452e47dc9e15dd99.jpg',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-06-16 04:13:04',\n\t\t\t\t'updated_at' => '2015-06-16 04:13:04',\n\t\t\t),\n\t\t\t15 => \n\t\t\tarray (\n\t\t\t\t'id' => 16,\n\t\t\t\t'cname' => 'Background 2',\n\t\t\t\t'ckey' => 'background',\n\t\t\t\t'cvalue' => 'http://vi.anvyonline.com/assets/images/background-f6884f3c1217a3d2c1aa33eff175681f.jpg',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-06-16 04:13:39',\n\t\t\t\t'updated_at' => '2015-06-16 04:13:39',\n\t\t\t),\n\t\t\t16 => \n\t\t\tarray (\n\t\t\t\t'id' => 17,\n\t\t\t\t'cname' => 'Google Analytic ID',\n\t\t\t\t'ckey' => 'google_analytic_id',\n\t\t\t\t'cvalue' => 'UA-62240241-2',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-06-24 01:06:02',\n\t\t\t\t'updated_at' => '2015-06-24 01:06:02',\n\t\t\t),\n\t\t\t17 => \n\t\t\tarray (\n\t\t\t\t'id' => 18,\n\t\t\t\t'cname' => '',\n\t\t\t\t'ckey' => 'home_header_title',\n\t\t\t\t'cvalue' => 'Large Format Specialty Printer',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-07 15:53:08',\n\t\t\t\t'updated_at' => '2015-07-23 22:47:33',\n\t\t\t),\n\t\t\t18 => \n\t\t\tarray (\n\t\t\t\t'id' => 19,\n\t\t\t\t'cname' => '',\n\t\t\t\t'ckey' => 'home_header_description',\n\t\t\t\t'cvalue' => 'Welcome to Anvy Digital Imaging Inc.',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-07 15:53:08',\n\t\t\t\t'updated_at' => '2015-07-24 11:52:54',\n\t\t\t),\n\t\t\t19 => \n\t\t\tarray (\n\t\t\t\t'id' => 20,\n\t\t\t\t'cname' => '',\n\t\t\t\t'ckey' => 'home_main_title',\n\t\t\t\t'cvalue' => 'Create something beautiful',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-07 15:53:09',\n\t\t\t\t'updated_at' => '2015-07-07 16:02:01',\n\t\t\t),\n\t\t\t20 => \n\t\t\tarray (\n\t\t\t\t'id' => 21,\n\t\t\t\t'cname' => '',\n\t\t\t\t'ckey' => 'home_main_description',\n\t\t\t\t'cvalue' => 'Give cherished moments the love and attention they deserve',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-07 15:53:09',\n\t\t\t\t'updated_at' => '2015-07-07 16:02:01',\n\t\t\t),\n\t\t\t21 => \n\t\t\tarray (\n\t\t\t\t'id' => 22,\n\t\t\t\t'cname' => '',\n\t\t\t\t'ckey' => 'home_footer_title',\n\t\t\t\t'cvalue' => 'Let's be friends!',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-07 15:53:09',\n\t\t\t\t'updated_at' => '2015-07-07 16:02:01',\n\t\t\t),\n\t\t\t22 => \n\t\t\tarray (\n\t\t\t\t'id' => 23,\n\t\t\t\t'cname' => '',\n\t\t\t\t'ckey' => 'home_footer_description',\n\t\t\t\t'cvalue' => 'For exclusive offers, up to the minute news and more',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-07 15:53:09',\n\t\t\t\t'updated_at' => '2015-07-07 16:02:01',\n\t\t\t),\n\t\t\t23 => \n\t\t\tarray (\n\t\t\t\t'id' => 24,\n\t\t\t\t'cname' => 'Google Map Link',\n\t\t\t\t'ckey' => 'google_map_link',\n\t\t\t\t'cvalue' => 'https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d5015.090301114683!2d-113.98509010154422!3d51.061485941854784!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0000000000000000%3A0x9c66042789ce65f4!2sAnvy+Digital+Imaging!5e0!3m2!1sen!2sca!4v1414011757410',\n\t\t\t\t'cdescription' => NULL,\n\t\t\t\t'active' => 1,\n\t\t\t\t'created_by' => 0,\n\t\t\t\t'updated_by' => 0,\n\t\t\t\t'created_at' => '2015-07-13 13:42:44',\n\t\t\t\t'updated_at' => '2015-07-13 13:42:44',\n\t\t\t),\n\t\t));\n\t}",
"public function run()\n {\n foreach (config('consts.common.SHIPMENT_STATUSES') as $shipmentStatus) {\n ShipmentStatus::create([\n 'shipment_status_name' => $shipmentStatus['value'],\n ]);\n }\n }",
"function _add_section( $data=array() )\n\t{\n\t\t$section = array();\n\t\t\n\t\t$section['conf_title_title'] = $data['conf_title_title']['VALUE'];\n\t\t$section['conf_title_desc'] = $data['conf_title_desc']['VALUE'];\n\t\t$section['conf_title_count'] = 0;\n\t\t$section['conf_title_noshow'] = $data['conf_title_noshow']['VALUE'];\n\t\t$section['conf_title_keyword'] = $data['conf_title_keyword']['VALUE'];\n\t\t$section['conf_title_module'] = $data['conf_title_module']['VALUE'];\n\t\t\n\t\t$this->ipsclass->DB->do_insert( 'conf_settings_titles', $section );\n\t\t\n\t\treturn $this->ipsclass->DB->get_insert_id();\n\t}",
"function newConfigOptions() {\n $insert = $this->utility->db->execute(\"INSERT INTO \" . TABLE_PREFIX . \"config_options (name, module, type, value) VALUES \n ('last_frequently_activity', 'system', 'system', 'N;'),\n ('last_hourly_activity', 'system', 'system', 'N;'),\n ('last_daily_activity', 'system', 'system', 'N;')\n \");\n \t\n \t if(is_error($insert)) {\n \t return $insert->getMessage();\n \t } // if\n \t\n \treturn true;\n }",
"function cemhub_insert_new_entry_of_webform_config($webform_config) {\n db_insert('cemhub_forms_config')\n ->fields($webform_config)\n ->execute();\n}"
] |
[
"0.6162093",
"0.61011076",
"0.576295",
"0.5723982",
"0.5535113",
"0.5385953",
"0.538253",
"0.5341595",
"0.5309819",
"0.53096545",
"0.53041756",
"0.5283982",
"0.52715796",
"0.52648944",
"0.5214371",
"0.51915854",
"0.5159859",
"0.51503414",
"0.51419914",
"0.5135813",
"0.5095516",
"0.50939447",
"0.5078758",
"0.5078269",
"0.5062713",
"0.5062126",
"0.50469613",
"0.5044995",
"0.5035905",
"0.5032297"
] |
0.6314706
|
0
|
Inserts config entries for username, password, environment
|
private static function _addCredentialsConfigurationEntries()
{
global $db;
$requiredOptionsAttributes = static::_getRequiredOptionsAttributes();
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Genesis API Username',
'" . EmpCheckoutSettings::getCompleteSettingKey('USERNAME') . "',
'', 'Enter your Username, required for accessing the Genesis Gateway',
'6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Genesis API Password',
'" . EmpCheckoutSettings::getCompleteSettingKey('PASSWORD') . "',
'', 'Enter your Password, required for accessing the Genesis Gateway',
'6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Live Mode',
'" . EmpCheckoutSettings::getCompleteSettingKey('ENVIRONMENT') . "',
'false', 'If disabled, transactions are going through our Staging " .
"(Test) server, NO MONEY ARE BEING TRANSFERRED', '6', '3',
'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())"
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerConfigurations()\n {\n try {\n\n $auth = file_get_contents(config_path('auth.php'));\n\n $data_map = $this->parseName();\n\n /********** Guards **********/\n\n $guards = file_get_contents($this->stub_path . '/config/guards.stub');\n\n // compile stub...\n $guards = strtr($guards, $data_map);\n\n $guards_bait = \"'guards' => [\";\n\n $auth = str_replace($guards_bait, $guards_bait . $guards, $auth);\n\n /********** Providers **********/\n\n $providers = file_get_contents($this->stub_path . '/config/providers.stub');\n\n // compile stub...\n $providers = strtr($providers, $data_map);\n\n $providers_bait = \"'providers' => [\";\n\n $auth = str_replace($providers_bait, $providers_bait . $providers, $auth);\n\n /********** Passwords **********/\n\n $passwords = file_get_contents($this->stub_path . '/config/passwords.stub');\n\n // compile stub...\n $passwords = strtr($passwords, $data_map);\n\n $passwords_bait = \"'passwords' => [\";\n\n $auth = str_replace($passwords_bait, $passwords_bait . $passwords, $auth);\n\n // Overwrite config file\n file_put_contents(config_path('auth.php'), $auth);\n\n } catch (Exception $ex) {\n throw new \\RuntimeException($ex->getMessage());\n }\n }",
"public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }",
"private function init_config() {\n set_config('siteadmins', '');\n set_config('siteguest', '');\n set_config('defaultuserroleid', '');\n set_config('defaultfrontpageroleid', '');\n }",
"function process_config( $config ) {\n \n // clean form data\n $config->hosts = array_map( 'trim', $config->hosts );\n $config->hosts = array_filter( $config->hosts );\n \n $config->roles = array_intersect_key( $config->roles, $config->hosts );\n \n $config->hosts = array_values( $config->hosts );\n $config->roles = array_values( $config->roles );\n \n $config->roles = array_map('trim', $config->roles );\n \n // set defaults\n $config = $this->set_defaults( $config );\n \n // delete previous hosts and roles configuration from db\n foreach ( range(0, 9) as $i ) {\n unset_config('host'.$i, 'auth/imap_plus');\n unset_config('role'.$i, 'auth/imap_plus');\n }\n \n // save to db\n foreach ( $config->hosts as $key=>$val ) {\n set_config( 'host'.$key, $val, 'auth/imap_plus' );\n set_config( 'role'.$key, $config->roles[$key], 'auth/imap_plus' );\n }\n \n set_config('type', $config->type, 'auth/imap_plus');\n set_config('port', $config->port, 'auth/imap_plus');\n set_config('changepasswordurl', $config->changepasswordurl, 'auth/imap_plus');\n \n return true;\n }",
"private function write_config_data()\n\t{\n\t\t$captcha_url = '{base_url}images/captchas/';\n\n\t\tforeach (array('avatar_path', 'photo_path', 'signature_img_path', 'pm_path', 'captcha_path', 'theme_folder_path') as $path)\n\t\t{\n\t\t\t$prefix = ($path != 'theme_folder_path') ? $this->root_theme_path : '';\n\t\t\t$this->userdata[$path] = rtrim(realpath($prefix.$this->userdata[$path]), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\t\t\t$this->userdata[$path] = str_replace($this->base_path, '{base_path}', $this->userdata[$path]);\n\t\t}\n\n\t\t$config = array(\n\t\t\t'db_port' => $this->userdata['db_port'],\n\t\t\t'db_hostname' => $this->userdata['db_hostname'],\n\t\t\t'db_username' => $this->userdata['db_username'],\n\t\t\t'db_password' => $this->userdata['db_password'],\n\t\t\t'db_database' => $this->userdata['db_name'],\n\t\t\t'db_dbprefix' => $this->getDbPrefix(),\n\t\t\t'db_char_set' => $this->userdata['db_char_set'],\n\t\t\t'db_collat' => $this->userdata['db_collat'],\n\t\t\t'app_version' => $this->userdata['app_version'],\n\t\t\t'debug' => '1',\n\t\t\t'site_index' => $this->userdata['site_index'],\n\t\t\t'site_label' => $this->userdata['site_label'],\n\t\t\t'base_path' => $this->base_path,\n\t\t\t'base_url' => $this->userdata['site_url'],\n\t\t\t'cp_url' => str_replace($this->userdata['site_url'], '{base_url}', $this->userdata['cp_url']),\n\t\t\t'site_url' => '{base_url}',\n\t\t\t'theme_folder_url' => '{base_url}themes/',\n\t\t\t'webmaster_email' => $this->userdata['email_address'],\n\t\t\t'webmaster_name' => '',\n\t\t\t'channel_nomenclature' => 'channel',\n\t\t\t'max_caches' => '150',\n\t\t\t'cache_driver' => 'file',\n\t\t\t'captcha_url' => $captcha_url,\n\t\t\t'captcha_path' => $this->userdata['captcha_path'],\n\t\t\t'captcha_font' => 'y',\n\t\t\t'captcha_rand' => 'y',\n\t\t\t'captcha_require_members' => 'n',\n\t\t\t'require_captcha' => 'n',\n\t\t\t'enable_sql_caching' => 'n',\n\t\t\t'force_query_string' => 'n',\n\t\t\t'show_profiler' => 'n',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'cookie_domain' => '',\n\t\t\t'cookie_path' => '/',\n\t\t\t'cookie_prefix' => '',\n\t\t\t'website_session_type' => 'c',\n\t\t\t'cp_session_type' => 'c',\n\t\t\t'cookie_httponly' => 'y',\n\t\t\t'allow_username_change' => 'y',\n\t\t\t'allow_multi_logins' => 'y',\n\t\t\t'password_lockout' => 'y',\n\t\t\t'password_lockout_interval' => '1',\n\t\t\t'require_ip_for_login' => 'y',\n\t\t\t'require_ip_for_posting' => 'y',\n\t\t\t'require_secure_passwords' => 'n',\n\t\t\t'allow_dictionary_pw' => 'y',\n\t\t\t'name_of_dictionary_file' => '',\n\t\t\t'xss_clean_uploads' => 'y',\n\t\t\t'redirect_method' => $this->userdata['redirect_method'],\n\t\t\t'deft_lang' => $this->userdata['deft_lang'],\n\t\t\t'xml_lang' => 'en',\n\t\t\t'send_headers' => 'y',\n\t\t\t'gzip_output' => 'n',\n\t\t\t'is_system_on' => 'y',\n\t\t\t'allow_extensions' => 'y',\n\t\t\t'date_format' => '%n/%j/%Y',\n\t\t\t'time_format' => '12',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'server_offset' => '',\n\t\t\t'default_site_timezone' => date_default_timezone_get(),\n\t\t\t'mail_protocol' => 'mail',\n\t\t\t'email_newline' => '\\n', // single-quoted for portability\n\t\t\t'smtp_server' => '',\n\t\t\t'smtp_username' => '',\n\t\t\t'smtp_password' => '',\n\t\t\t'email_smtp_crypto' => 'ssl',\n\t\t\t'email_debug' => 'n',\n\t\t\t'email_charset' => 'utf-8',\n\t\t\t'email_batchmode' => 'n',\n\t\t\t'email_batch_size' => '',\n\t\t\t'mail_format' => 'plain',\n\t\t\t'word_wrap' => 'y',\n\t\t\t'email_console_timelock' => '5',\n\t\t\t'log_email_console_msgs' => 'y',\n\t\t\t'log_search_terms' => 'y',\n\t\t\t'un_min_len' => '4',\n\t\t\t'pw_min_len' => '5',\n\t\t\t'allow_member_registration' => 'n',\n\t\t\t'allow_member_localization' => 'y',\n\t\t\t'req_mbr_activation' => 'email',\n\t\t\t'new_member_notification' => 'n',\n\t\t\t'mbr_notification_emails' => '',\n\t\t\t'require_terms_of_service' => 'y',\n\t\t\t'default_member_group' => '5',\n\t\t\t'profile_trigger' => 'member',\n\t\t\t'member_theme' => 'default',\n\t\t\t'enable_avatars' => 'y',\n\t\t\t'allow_avatar_uploads' => 'n',\n\t\t\t'avatar_url' => '{base_url}'.$this->userdata['avatar_url'],\n\t\t\t'avatar_path' => $this->userdata['avatar_path'],\n\t\t\t'avatar_max_width' => '100',\n\t\t\t'avatar_max_height' => '100',\n\t\t\t'avatar_max_kb' => '50',\n\t\t\t'enable_photos' => 'n',\n\t\t\t'photo_url' => '{base_url}'.$this->userdata['photo_url'],\n\t\t\t'photo_path' => $this->userdata['photo_path'],\n\t\t\t'photo_max_width' => '100',\n\t\t\t'photo_max_height' => '100',\n\t\t\t'photo_max_kb' => '50',\n\t\t\t'allow_signatures' => 'y',\n\t\t\t'sig_maxlength' => '500',\n\t\t\t'sig_allow_img_hotlink' => 'n',\n\t\t\t'sig_allow_img_upload' => 'n',\n\t\t\t'sig_img_url' => '{base_url}'.$this->userdata['signature_img_url'],\n\t\t\t'sig_img_path' => $this->userdata['signature_img_path'],\n\t\t\t'sig_img_max_width' => '480',\n\t\t\t'sig_img_max_height' => '80',\n\t\t\t'sig_img_max_kb' => '30',\n\t\t\t'prv_msg_enabled' => 'y',\n\t\t\t'prv_msg_allow_attachments' => 'y',\n\t\t\t'prv_msg_upload_path' => $this->userdata['pm_path'],\n\t\t\t'prv_msg_max_attachments' => '3',\n\t\t\t'prv_msg_attach_maxsize' => '250',\n\t\t\t'prv_msg_attach_total' => '100',\n\t\t\t'prv_msg_html_format' => 'safe',\n\t\t\t'prv_msg_auto_links' => 'y',\n\t\t\t'prv_msg_max_chars' => '6000',\n\t\t\t'enable_template_routes' => 'y',\n\t\t\t'strict_urls' => 'y',\n\t\t\t'site_404' => '',\n\t\t\t'save_tmpl_revisions' => 'n',\n\t\t\t'max_tmpl_revisions' => '5',\n\t\t\t'save_tmpl_files' => 'y',\n\t\t\t'deny_duplicate_data' => 'y',\n\t\t\t'redirect_submitted_links' => 'n',\n\t\t\t'enable_censoring' => 'n',\n\t\t\t'censored_words' => '',\n\t\t\t'censor_replacement' => '',\n\t\t\t'banned_ips' => '',\n\t\t\t'banned_emails' => '',\n\t\t\t'banned_usernames' => '',\n\t\t\t'banned_screen_names' => '',\n\t\t\t'ban_action' => 'restrict',\n\t\t\t'ban_message' => 'This site is currently unavailable',\n\t\t\t'ban_destination' => 'http://www.yahoo.com/',\n\t\t\t'enable_emoticons' => 'y',\n\t\t\t'emoticon_url' => '{base_url}'.'images/smileys/',\n\t\t\t'recount_batch_total' => '1000',\n\t\t\t'image_resize_protocol' => 'gd2',\n\t\t\t'image_library_path' => '',\n\t\t\t'thumbnail_prefix' => 'thumb',\n\t\t\t'word_separator' => 'dash',\n\t\t\t'use_category_name' => 'n',\n\t\t\t'reserved_category_word' => 'category',\n\t\t\t'auto_convert_high_ascii' => 'n',\n\t\t\t'new_posts_clear_caches' => 'y',\n\t\t\t'auto_assign_cat_parents' => 'y',\n\t\t\t'new_version_check' => 'y',\n\t\t\t'enable_throttling' => 'n',\n\t\t\t'banish_masked_ips' => 'y',\n\t\t\t'max_page_loads' => '10',\n\t\t\t'time_interval' => '8',\n\t\t\t'lockout_time' => '30',\n\t\t\t'banishment_type' => 'message',\n\t\t\t'banishment_url' => '',\n\t\t\t'banishment_message' => 'You have exceeded the allowed page load frequency.',\n\t\t\t'enable_search_log' => 'y',\n\t\t\t'max_logged_searches' => '500',\n\t\t\t'memberlist_order_by' => \"member_id\",\n\t\t\t'memberlist_sort_order' => \"desc\",\n\t\t\t'memberlist_row_limit' => \"20\",\n\t\t\t'is_site_on' => 'y',\n\t\t\t'theme_folder_path' => $this->userdata['theme_folder_path'],\n\t\t);\n\n\t\t// Default Administration Prefs\n\t\t$admin_default = array(\n\t\t\t'site_index',\n\t\t\t'base_url',\n\t\t\t'base_path',\n\t\t\t'cp_url',\n\t\t\t'site_url',\n\t\t\t'theme_folder_url',\n\t\t\t'webmaster_email',\n\t\t\t'webmaster_name',\n\t\t\t'channel_nomenclature',\n\t\t\t'max_caches',\n\t\t\t'captcha_url',\n\t\t\t'captcha_path',\n\t\t\t'captcha_font',\n\t\t\t'captcha_rand',\n\t\t\t'captcha_require_members',\n\t\t\t'require_captcha',\n\t\t\t'enable_sql_caching',\n\t\t\t'force_query_string',\n\t\t\t'show_profiler',\n\t\t\t'include_seconds',\n\t\t\t'cookie_domain',\n\t\t\t'cookie_path',\n\t\t\t'website_session_type',\n\t\t\t'cp_session_type',\n\t\t\t'allow_username_change',\n\t\t\t'allow_multi_logins',\n\t\t\t'password_lockout',\n\t\t\t'password_lockout_interval',\n\t\t\t'require_ip_for_login',\n\t\t\t'require_ip_for_posting',\n\t\t\t'require_secure_passwords',\n\t\t\t'allow_dictionary_pw',\n\t\t\t'name_of_dictionary_file',\n\t\t\t'xss_clean_uploads',\n\t\t\t'redirect_method',\n\t\t\t'deft_lang',\n\t\t\t'xml_lang',\n\t\t\t'send_headers',\n\t\t\t'gzip_output',\n\t\t\t'date_format',\n\t\t\t'time_format',\n\t\t\t'include_seconds',\n\t\t\t'server_offset',\n\t\t\t'default_site_timezone',\n\t\t\t'mail_protocol',\n\t\t\t'email_newline',\n\t\t\t'smtp_server',\n\t\t\t'smtp_username',\n\t\t\t'smtp_password',\n\t\t\t'email_smtp_crypto',\n\t\t\t'email_debug',\n\t\t\t'email_charset',\n\t\t\t'email_batchmode',\n\t\t\t'email_batch_size',\n\t\t\t'mail_format',\n\t\t\t'word_wrap',\n\t\t\t'email_console_timelock',\n\t\t\t'log_email_console_msgs',\n\t\t\t'log_search_terms',\n\t\t\t'deny_duplicate_data',\n\t\t\t'redirect_submitted_links',\n\t\t\t'enable_censoring',\n\t\t\t'censored_words',\n\t\t\t'censor_replacement',\n\t\t\t'banned_ips',\n\t\t\t'banned_emails',\n\t\t\t'banned_usernames',\n\t\t\t'banned_screen_names',\n\t\t\t'ban_action',\n\t\t\t'ban_message',\n\t\t\t'ban_destination',\n\t\t\t'enable_emoticons',\n\t\t\t'emoticon_url',\n\t\t\t'recount_batch_total',\n\t\t\t'new_version_check',\n\t\t\t'enable_throttling',\n\t\t\t'banish_masked_ips',\n\t\t\t'max_page_loads',\n\t\t\t'time_interval',\n\t\t\t'lockout_time',\n\t\t\t'banishment_type',\n\t\t\t'banishment_url',\n\t\t\t'banishment_message',\n\t\t\t'enable_search_log',\n\t\t\t'max_logged_searches',\n\t\t\t'theme_folder_path',\n\t\t\t'is_site_on'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($admin_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_system_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Members Prefs\n\t\t$member_default = array(\n\t\t\t'un_min_len',\n\t\t\t'pw_min_len',\n\t\t\t'allow_member_registration',\n\t\t\t'allow_member_localization',\n\t\t\t'req_mbr_activation',\n\t\t\t'new_member_notification',\n\t\t\t'mbr_notification_emails',\n\t\t\t'require_terms_of_service',\n\t\t\t'default_member_group',\n\t\t\t'profile_trigger',\n\t\t\t'member_theme',\n\t\t\t'enable_avatars',\n\t\t\t'allow_avatar_uploads',\n\t\t\t'avatar_url',\n\t\t\t'avatar_path',\n\t\t\t'avatar_max_width',\n\t\t\t'avatar_max_height',\n\t\t\t'avatar_max_kb',\n\t\t\t'enable_photos',\n\t\t\t'photo_url',\n\t\t\t'photo_path',\n\t\t\t'photo_max_width',\n\t\t\t'photo_max_height',\n\t\t\t'photo_max_kb',\n\t\t\t'allow_signatures',\n\t\t\t'sig_maxlength',\n\t\t\t'sig_allow_img_hotlink',\n\t\t\t'sig_allow_img_upload',\n\t\t\t'sig_img_url',\n\t\t\t'sig_img_path',\n\t\t\t'sig_img_max_width',\n\t\t\t'sig_img_max_height',\n\t\t\t'sig_img_max_kb',\n\t\t\t'prv_msg_enabled',\n\t\t\t'prv_msg_allow_attachments',\n\t\t\t'prv_msg_upload_path',\n\t\t\t'prv_msg_max_attachments',\n\t\t\t'prv_msg_attach_maxsize',\n\t\t\t'prv_msg_attach_total',\n\t\t\t'prv_msg_html_format',\n\t\t\t'prv_msg_auto_links',\n\t\t\t'prv_msg_max_chars',\n\t\t\t'memberlist_order_by',\n\t\t\t'memberlist_sort_order',\n\t\t\t'memberlist_row_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($member_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_member_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Templates Prefs\n\t\t$template_default = array(\n\t\t\t'enable_template_routes',\n\t\t\t'strict_urls',\n\t\t\t'site_404',\n\t\t\t'save_tmpl_revisions',\n\t\t\t'max_tmpl_revisions',\n\t\t);\n\t\t$site_prefs = array();\n\n\t\tforeach($template_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_template_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Channels Prefs\n\t\t$channel_default = array(\n\t\t\t'image_resize_protocol',\n\t\t\t'image_library_path',\n\t\t\t'thumbnail_prefix',\n\t\t\t'word_separator',\n\t\t\t'use_category_name',\n\t\t\t'reserved_category_word',\n\t\t\t'auto_convert_high_ascii',\n\t\t\t'new_posts_clear_caches',\n\t\t\t'auto_assign_cat_parents',\n\t\t\t'enable_comments',\n\t\t\t'comment_word_censoring',\n\t\t\t'comment_moderation_override',\n\t\t\t'comment_edit_time_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($channel_default as $value)\n\t\t{\n\t\t\tif (isset($config[$value]))\n\t\t\t{\n\t\t\t\t$site_prefs[$value] = $config[$value];\n\t\t\t}\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_channel_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Remove Site Prefs from Config\n\t\tforeach(array_merge($admin_default, $member_default, $template_default, $channel_default) as $value)\n\t\t{\n\t\t\tunset($config[$value]);\n\t\t}\n\n\t\t// Write the config file data\n\t\t$this->write_config_from_template($config);\n\n\t\treturn TRUE;\n\t}",
"public function cfg_setup()\n\t{\n\t\t$this->cfg = AppConfig::get()[\"app\"];\n\t\t$this->cfg[\"app_name\"] = $this->cfg[\"name\"];\n\n\t}",
"public function run()\n {\n DB::table('config')->insert([\n \t'address'=>'Kathamandu',\n \t'facebook'=>'www.facebbok.com',\n \t'twitter' =>'www.twitter.com',\n \t'about_desc'=>'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed doeiusmod\n\t\t\t\t tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',\n\t\t\t'mail'=>'mail.com',\n\t\t\t'gplus' => 'gplus.com'\n \t]);\n }",
"private function deployConfig()\n {\n $config = \\SmConfig::$configTable;\n $currentConfig = $this->_db->fetchAll('config');\n\n foreach ($config as $k => $v) {\n $exists = false;\n foreach ($currentConfig as $c) {\n if ($c['c_name'] == $k) {\n $exists = true;\n break;\n }\n }\n if (!$exists) {\n $this->_db->insert('config', ['c_name' => $k, 'c_value' => $v]);\n }\n }\n }",
"public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }",
"private static function _addMainConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable emerchantpay Checkout Module',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . \"',\n 'true',\n 'Do you want to process payments via emerchantpay''s Genesis Gateway?',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Title',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CHECKOUT_PAGE_TITLE'\n ) . \"',\n 'Pay safely with emerchantpay Checkout',\n 'This name will be displayed on the checkout page', '6', '4',\n 'emp_zfg_draw_input(null, ', now())\"\n );\n }",
"public function createConfig()\n\t{\n\t}",
"function install_core_config() {\n $db = DB::getInstance();\n $site_config = array(\n 'name' => Sanitize::checkPlain($_POST['name']),\n 'slogan' => Sanitize::checkPlain($_POST['slogan']),\n 'lang' => Session::get('lang'),\n 'theme' => 'core'\n );\n $sql = \"INSERT INTO `config` (`property`, `contents`) VALUES \"\n . \"('?', '?'),\"\n . \"('?', '?'),\"\n . \"('?', '?'),\"\n . \"('?', '?'),\";\n if(!$db->query($sql, array('site_name', $site_config['name'], 'site_slogan', $site_config['slogan'], 'site_language', $site_config['lang'], 'site_theme', $site_config['theme']))->error()) {\n return true;\n }\n else {\n //Return error\n System::addMessage('error', rt('The website could not be configured. Please make sure that you have entered all the information correctly and that you have supplied a database username and password with sufficient permissions to make changes in the database'));\n }\n return false;\n}",
"private function configure()\n {\n\n $QryStr = \"SELECT SENDER, PORT,HOST, USER_ID,PASSWRD, EMAIL FROM SYSSETTINGS\";\n try {\n $stmt = $this->dbh->dbConn->prepare($QryStr);\n $stmt->execute();\n\n $result = $stmt->fetch(\\PDO::FETCH_OBJ);\n\n $this->sender = $result->sender;\n $this->port = $result->port;\n $this->host = $result->host;\n $this->user_id = $result->user_id;\n $this->password = $result->password;\n $this->sender_mail = $result->email;\n } catch (\\PDOException $ex) {\n $ex->getMessage();\n }\n }",
"private function getCrendentials()\n {\n $db = parse_ini_file('db.ini');\n $this->username = $db['user'];\n $this->password = $db['password'];\n $this->host = $db['host'];\n $this->dbname = $db['dbname'];\n }",
"public function init_credentials()\n\t{\n\t\tif($this->get_session('admin') != null)\n\t\t{\n\t\t\t$this->credentials['admin'] \t\t\t= $this->get_session('admin');\n\t\t\t$this->credentials['grupo_admin'] \t\t= $this->get_session('admin_grupo');\n\t\t\t$this->credentials['permissoes_admin'] \t= $this->get_session('admin_permissoes');\n\t\t\t\n\t\t\t$this->credentials['workspace_id'] \t\t= $this->get_session('workspace_id');\n\t\t\t$this->credentials['workspace_nome']\t= $this->get_session('workspace_nome');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->credentials = null;\n\t\t}\n\t}",
"private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }",
"function initializeDemo()\n {\n $sql = \"DROP TABLE IF EXISTS config; DROP TABLE IF EXISTS secureconfig;\";\n try {\n $db = Base_Database::getConnection();\n $db->exec($sql);\n } catch (PDOException $e) {\n error_log('Initialize Base_Config failed: ' . $e->getMessage());\n die(\"An error occurred creating the configuration tables\");\n }\n self::initialize();\n $sql = \"\n INSERT IGNORE INTO `config` (`key`, `value`) VALUES ('eventName', 'A Demo CFM Instance'), ('eventUrl', 'http://cfm2.pagekite.me'), ('hashTag', '#cfm2');\n INSERT IGNORE INTO `secureconfig` (`key`, `value`) VALUES ('salt', 'salt');\n \";\n try {\n $db = Base_Database::getConnection();\n $db->exec($sql);\n } catch (PDOException $e) {\n error_log('Initialize Base_Config failed: ' . $e->getMessage());\n die(\"An error occurred creating the configuration tables\");\n }\n }",
"protected function setup_config() {\n\t\t\t// TODO: Implement setup_config() method.\n\t\t}",
"function configure() {\n\t\t\n\t\tif (!file_exists(APP . 'config/database.php')) {\n\t\t\t$this->redirect('/install/');\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\t\t\t\n\t\t\t\n\t\t\t$this->Area = ClassRegistry::init('Area');\n\t\t\t$this->Content = ClassRegistry::init('Content');\n\t\t\t$this->User = ClassRegistry::init('User');\n\t\t\t\n\t\t\tif ($this->Area->saveAll($this->data, array('validate' => 'first'))) {\t\t\n\t\t\t\t// mark as installed\n\t\t\t\t$this->Session->setFlash(__('Successfully configured system', true));\n\t\t\t\t$file = new File(APP . 'config/INSTALLED');\n\t\t\t\t$file->write(time());\n\t\t\t\t\n\t\t\t\t// create initital user\n\t\t\t\t$this->data['User']['area_id'] = $this->Area->id;\n\t\t\t\t// @TODO validate data\n\t\t\t\t$this->User->save($this->data['User'], false);\n\t\t\t\t$this->User->saveField('user_id', $this->User->id);\n\t\t\t\t\n\t\t\t\t// update area\n\t\t\t\t$this->Area->saveField('user_id', $this->User->id);\n\t\t\t\t$this->Area->Url->saveField('user_id', $this->User->id);\n\t\t\t\t\n\t\t\t\t$this->redirect('/');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Failed to configure system', true));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->data['Url'][0]['url'] = Router::url('/', true);\n\t\t}\n\t}",
"private function set_up_connection(){\n $string = file_get_contents('/../../settings.json', true);\n //Create json iterator\n $jsonIterator = new RecursiveIteratorIterator(new RecursiveArrayIterator(json_decode($string, TRUE)), RecursiveIteratorIterator::SELF_FIRST);\n //Read iterator for each key found\n foreach($jsonIterator as $key => $val ) {\n if(is_array($val)) {\n //to-do as we find new arrays\n $this->db = $key;\n }else{\n //to-do as we find final values\n if($key == \"name\"){\n $this->dbname = $val;\n }else if($key == \"user\"){\n $this->user = $val;\n }else if($key == \"pass\"){\n $this->pass = $val;\n }else{\n $this->server = $val;\n }\n }\n }\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 fillConfigurations()\n {\n if (config('database.connections.mysql_dump') === null) {\n throw new ConfigIsNotProperlyDefinedException('[database.connections.mysql_dump]');\n }\n\n $this->newConfigName = 'mysql_dump';\n $this->oldDbName = env('DB_DATABASE', null);\n $this->newDbName = env('DB_DUMP_DATABASE', null);\n $this->user = env('DB_USERNAME', null);\n $this->password = env('DB_PASSWORD', null);\n\n if ($this->oldDbName === null\n || $this->newDbName === null\n || $this->user === null\n || $this->password === null) {\n throw new EnvFileIsNotProperlyDefinedException('[DB_DATABASE, DB_DUMP_DATABASE, DB_USERNAME, DB_PASSWORD]');\n }\n }",
"public function run()\n {\n Config::create(['igdb_key' => '1234test']);\n }",
"function initialize()\n {\n if (isset($this->key)) {\n $key = common_config('contextio', 'key');\n if (empty($key)) {\n Config::save(\n 'contextio',\n 'key',\n $this->key\n );\n }\n }\n\n if (isset($this->secret)) {\n $secret = common_config('contextio', 'secret');\n if (empty($secret)) {\n Config::save('contextio', 'secret', $this->secret);\n }\n }\n }",
"protected function setUp()\n\t{\n\t\t$this->username = getenv('DBUSER') ? getenv('DBUSER') : NULL;\n\t\t$this->password = getenv('DBPASS') ? getenv('DBPASS') : NULL;\n\t\tparent::setUp();\n\t}",
"function setup_db_config($configuration){\n // or the user is admin user\n if(_is_db_configured($configuration)){\n _is_admin_or_return($configuration);\n }\n\n // get and validate user input\n $data = json_decode(file_get_contents('php://input'));\n \n $host = parse_url($data->db_server, PHP_URL_HOST);\n if(!isset($host)){\n return Status::errorStatus('no proper hostname specified');\n }\n $port = parse_url($data->db_server, PHP_URL_PORT);\n if(!isset($port)){\n return Status::errorStatus('no port specified');\n }\n if(!preg_match('/^[a-zA-Z0-9-_\\.\\:\\]\\[]+:[0-9]+$/', $data->db_server)){\n return Status::errorStatus('only [ip|hostname]:[port] format supported for database host');\n }\n if(!isset($data->db_name) || !preg_match('/^[a-zA-Z0-9-_]+$/', $data->db_name)){\n return Status::errorStatus('invalid database name');\n }\n if(!isset($data->db_user) || !preg_match('/^[a-zA-Z0-9-_]+$/', $data->db_user)){\n return Status::errorStatus('invalid database user');\n }\n if(!isset($data->db_password) || preg_match('/\\s+/', $data->db_password)){\n return Status::errorStatus('invalid database password (containing spaces)');\n }\n\n // verify that connection works\n $new_config = new Configuration();\n $new_config->db_server = $data->db_server;\n $new_config->db_name = $data->db_name;\n $new_config->db_user = $data->db_user;\n $new_config->db_password = $data->db_password;\n $db = new DBAccess($new_config);\n if(!$db->connect()){\n return Status::errorStatus('DB access not working with the provided settings. Please check for typos, make sure that the database is reachable and that your username and password are correct.');\n }\n\n // check whether tables already exist\n $query = 'SHOW TABLES LIKE \"configuration\"';\n $res = $db->fetch_data_hash($query, 0);\n if(!$res){\n // if the table does not exist, we setup the database\n // setup a new database\n if(!file_exists(\"../config/db/schema.sql\") || !$db->apply_sql_file(\"../config/db/schema.sql\")){\n return Status::errorStatus(\"DB scheme could not be applied to database, please check server error logs\");\n }\n }\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $configuration->config_file_variables['db_server'] = $data->db_server;\n $configuration->config_file_variables['db_name'] = $data->db_name;\n $configuration->config_file_variables['db_user'] = $data->db_user;\n $configuration->config_file_variables['db_password'] = $data->db_password;\n if(_write_config_file($configuration->config_file_variables)){\n return Status::successStatus(\"configuration applied and database setup\");\n }\n return Status::errorStatus(\"db could not be configured\");\n }",
"private function loadConfig(){\n $DB = DB::pass();\n $conf = $DB->loadConfig();\n if ( count($conf) > 0 ){\n foreach($conf as $c){\n $this->config->set($c['cluster'] . \".\" . $c['name'],$c['value']);\n }\n } else {\n throw new SystemException(\"No database configuration\");\n }\n }",
"function initialize()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `config` (`key` varchar(255) NOT NULL, `value` text NOT NULL, PRIMARY KEY (`key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n CREATE TABLE IF NOT EXISTS `secureconfig` (`key` varchar(255) NOT NULL, `value` text NOT NULL, PRIMARY KEY (`key`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n \";\n try {\n $db = Base_Database::getConnection();\n $db->exec($sql);\n } catch (PDOException $e) {\n error_log('Initialize Base_Config failed: ' . $e->getMessage());\n die(\"An error occurred creating the configuration tables\");\n }\n }",
"public function setUp()\r\n {\r\n $this->config += [\r\n 'http_errors' => false,\r\n 'timeout' => 10.0,\r\n 'base_uri' => $this->description->getBaseUri(),\r\n 'apiKey' => 'XXX',\r\n 'projectId' => 000,\r\n ];\r\n }",
"public function run()\n {\n DB::table('configurations')->insert([\n 'id' => 1,\n 'user_id' => 1,\n 'software_id' => 1,\n 'name' => 'Test configuration',\n 'content' => 'test',\n 'filename' => 'filename',\n 'path' => 'path'\n ]);\n }"
] |
[
"0.6192933",
"0.60301536",
"0.5992723",
"0.5840403",
"0.5818765",
"0.57883453",
"0.5719295",
"0.57186174",
"0.57121885",
"0.568543",
"0.56287396",
"0.562755",
"0.5613842",
"0.5604391",
"0.5603093",
"0.55873203",
"0.5576959",
"0.55710256",
"0.55680454",
"0.556736",
"0.55528337",
"0.5535843",
"0.55348575",
"0.547272",
"0.546305",
"0.5451451",
"0.5437768",
"0.5432794",
"0.54320085",
"0.5429407"
] |
0.7253543
|
0
|
Inserts config entries for transaction_types, allow_partial_capture, allow_void, allow_partial_refund
|
private static function _addTransactionsConfigurationEntries()
{
global $db;
$requiredOptionsAttributes = static::_getRequiredOptionsAttributes();
$transaction_types
= EMerchantPayCommon::buildSettingsDropDownOptions(
EmpCheckoutSettings::getTransactionsList()
);
$placeholder = ['none' => 'No specific Bank in use'];
$availableBankCodes
= $placeholder + EmpCheckoutSettings::getAvailableBankCodes();
$bank_codes
= EMerchantPayCommon::buildSettingsDropDownOptions(
$availableBankCodes
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Transaction Types',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'TRANSACTION_TYPES'
) . "',
'" . \Genesis\API\Constants\Transaction\Types::SALE . "',
'What transaction type should we use upon purchase?', '6', '0',
'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, " .
"{$transaction_types}, ', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Bank codes for Online banking',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'BANK_CODES'
) . "',
'none',
'Select Bank code(s) for Online banking transaction.', '6', '0',
'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, " .
"{$bank_codes}, ', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Partial Capture',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'ALLOW_PARTIAL_CAPTURE'
) . "',
'true', 'Use this option to allow / deny Partial Capture Transactions',
'6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Partial Refund',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'ALLOW_PARTIAL_REFUND'
) . "',
'true', 'Use this option to allow / deny Partial Refund Transactions',
'6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Cancel Transaction',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'ALLOW_VOID_TRANSACTIONS'
) . "',
'true', 'Use this option to allow / deny Cancel Transactions', '6', '3',
'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())"
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private static function _addMainConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable emerchantpay Checkout Module',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . \"',\n 'true',\n 'Do you want to process payments via emerchantpay''s Genesis Gateway?',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Title',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CHECKOUT_PAGE_TITLE'\n ) . \"',\n 'Pay safely with emerchantpay Checkout',\n 'This name will be displayed on the checkout page', '6', '4',\n 'emp_zfg_draw_input(null, ', now())\"\n );\n }",
"private static function _addCredentialsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Username',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('USERNAME') . \"',\n '', 'Enter your Username, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Password',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('PASSWORD') . \"',\n '', 'Enter your Password, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Live Mode',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('ENVIRONMENT') . \"',\n 'false', 'If disabled, transactions are going through our Staging \" .\n \"(Test) server, NO MONEY ARE BEING TRANSFERRED', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }",
"private static function _addOrderConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Default Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the default status of orders made with this payment module\" .\n \" to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Failed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'FAILED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of failed orders made with this payment module to\" .\n \" this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Processed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'PROCESSED_ORDER_STATUS_ID'\n ) . \"',\n '2', 'Set the status of processed orders made with this payment \" .\n \"module to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Refunded Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'REFUNDED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of refunded orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Canceled Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CANCELED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of canceled orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n }",
"protected function _add_config_to_request($params)\n\t{\t\n\t\t$params['MODE']\t\t\t= ($this->_api_settings->test_mode) ? 'TEST': 'LIVE';\n\t\t$params['ACCOUNT_ID']\t= $this->_api_settings->login;\n\t\t$params['TRANS_TYPE']\t= $this->_api_method;\n\t\t$params['PAYMENT_TYPE']\t= 'CREDIT';\n\t\t\n\t\tif( ! empty($this->_api_settings->user_id) )\n\t\t{\n\t\t\t$params['USER_ID'] = $this->_api_settings->user_id;\n\t\t}\n\t\t\n\t\t$params['TAMPER_PROOF_SEAL'] = $this->_build_tamper_proof_seal($params);\n\t\t\n\t\treturn $params;\n\t}",
"protected function RTEtsConfigParams() {}",
"private static function _addWpfConfigurationEntries()\n {\n global $db;\n\n $sortOrderAttributes = \"array(''maxlength'' => ''3'')\";\n $languages = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getAvailableCheckoutLanguages()\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Page Language',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('LANGUAGE') . \"',\n 'en', 'What language (localization) should we have on the Checkout?.',\n '6', '0', 'emp_zfg_select_drop_down_single({$languages},', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('WPF Tokenization',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'WPF_TOKENIZATION'\n ) . \"',\n 'false', 'Enable WPF Tokenization', '6', '3', 'emp_zfg_draw_toggle(',\n 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Sort order of display.',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('SORT_ORDER') . \"',\n '0', 'Sort order of display. Lowest is displayed first.', '6', '0',\n 'emp_zfg_draw_number_input({$sortOrderAttributes}, ', now())\"\n );\n }",
"public function add_config(){\n\t\t$this->onlyGroup(1);\n\t\t$config_types=$this->getConfigTypes();\n\t\t\n\t\tif(!empty($this->request->data)){\n\t\t\n\t\t\t// $user_id=$this->UserAuth->getUserId();\n\t\t\t$user_id=1;\n\t\t\t$this->Configuration->create();\n\t\t\t$this->request->data['Configuration']['user_id']=$user_id;\n\t\t\t$this->Configuration->save($this->request->data);\n\t\t\t\n\t\t\t$this->Session->setFlash(__('Configuracion creada exitosamente'));\n\t\t\treturn $this->redirect(array('action' => 'ver_configuraciones'));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$this->set(compact('config_types'));\n\t}",
"protected function initConfiguration(){\n $settings = array(\n 'user' => 'bitshok',\n 'widget_id' => '355763562850942976',\n 'tweets_limit' => 3,\n 'follow_btn' => 'on'\n );\n Configuration::updateValue($this->name.'_settings', serialize($settings));\n }",
"private function createConfiguration()\n {\n $this->createVrpayecommercePluginConfig();\n $this->Form();\n }",
"private function addInsuranceOptionsForCarriers(): void\n {\n $this->carrierConfigurationTable = Table::withPrefix(Table::TABLE_CARRIER_CONFIGURATION);\n $configName = Constant::INSURANCE_CONFIGURATION_NAME;\n\n $query = <<<SQL\nSELECT DISTINCT id_carrier, name, value FROM $this->carrierConfigurationTable WHERE name LIKE '%$configName'\nSQL;\n $records = new Collection($this->db->executeS($query));\n\n foreach ($records as $record) {\n $carrierId = (int) $record['id_carrier'];\n $maxAmount = '1' === $record['value']\n ? 500\n : 0;\n\n $this->insertOption($carrierId, Constant::INSURANCE_CONFIGURATION_FROM_PRICE, '0');\n $this->insertOption($carrierId, 'return_' . Constant::INSURANCE_CONFIGURATION_FROM_PRICE, '0');\n\n $this->insertOption($carrierId, Constant::INSURANCE_CONFIGURATION_MAX_AMOUNT, (string) $maxAmount);\n $this->insertOption($carrierId, 'return_' . Constant::INSURANCE_CONFIGURATION_MAX_AMOUNT, (string) $maxAmount);\n }\n }",
"protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }",
"function tagConfig() {\n\n global $SM_siteManager;\n\n // template tag\n // requires NAME tag\n if ($this->attributes['NAME']) {\n $this->templateName = $this->attributes['NAME'];\n }\n else {\n // warning -- type not found, ignore\n $this->debugLog(\"warning: SM tag type INCLUDE had no NAME parameter\");\n return;\n }\n\n // now load that template and stick it in the new area\n $tpt = $SM_siteManager->loadTemplate($this->templateName);\n if (is_object($tpt)) {\n\n // yes! convert it into a template and add it in\n $this->tptPointer = $tpt;\n\n }\n else { \n // if it wasn't an object (ie, the template failed to load)\n // it will be ignored by the template\n $this->debugLog(\"warning: SM tag type INCLUDE, file name ($templateName) failed to load, ignoring\");\n }\n\n }",
"function instance_allow_config()\r\n\t\t{\r\n\t\t\r\n\t\t}",
"public function add_configuration() {\n\t\tENDA_Woocommerce_Bundle_Shipping::display_configuration_layer();\n\t\texit();\n\t}",
"function addFields($config)\n {\n global $TSFE,$LANG;\n $this->storagePid = $this->getStorageFolderPid();\n // print_r($this->storagePid);\n if(!empty($this->storagePid)) {\n $sql = \"AND pid=$this->storagePid\";\n }else{\n $sql = '';\n }\n\n $optionList = array();\n // exec_SELECTquery\n // $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, \"SELECT uid,cat FROM tx_sbdownloader_cat WHERE hidden=0 AND deleted=0 $sql\");\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\"uid,cat\", \"tx_sbdownloader_cat\", \"hidden=0 AND deleted=0 $sql\");\n\n $optionList[0] = array(0 => 'all', 1 => 0);\n $i = 1;\n // while($row = mysql_fetch_object($res)){\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n $optionList[$i] = array(0 => $row['cat'], 1 => $row['uid']);\n $i++;\n }\n\n $config['items'] = array_merge($config['items'], $optionList);\n\n return $config;\n }",
"public function set_config_settings()\r\n\t{\t\r\n\t\t// Check the config table exists in the config file and is enabled.\r\n\t\tif ($this->get_enabled_status('config'))\r\n\t\t{\r\n\t\t\tif ($config_data = $this->get_database_config_data())\r\n\t\t\t{\r\n\t\t\t\t// Loop through all the returned defaults and convert the database column names to cart session names.\r\n\t\t\t\tforeach($this->flexi->cart_database['configuration']['columns'] as $column_name => $column_alias)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (isset($config_data[$column_alias]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$config_data[$column_name] = $config_data[$column_alias];\r\n\t\t\t\t\t\tunset($config_data[$column_alias]);\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\t// Config file hard-coded settings.\r\n\t\t$config_defaults = $this->flexi->cart_defaults['configuration'];\r\n\r\n\t\t// Loop through the config hard-coded default settings and apply them to any config settings without a value from the database lookup.\r\n\t\tforeach($config_defaults as $setting_name => $setting_value)\r\n\t\t{\r\n\t\t\tif (! isset($config_data[$setting_name]))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$setting_name] = $config_defaults[$setting_name];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Group non boolean config value types together.\r\n\t\t$non_boolean_columns = array('order_number_prefix', 'order_number_suffix', 'weight_type', 'minimum_order', 'reward_point_multiplier', 'reward_voucher_multiplier', \r\n\t\t\t'reward_point_to_voucher_ratio', 'reward_point_days_pending', 'reward_point_days_valid', 'reward_voucher_days_valid', 'quantity_decimals', 'weight_decimals');\r\n\t\t\r\n\t\t// Ensure the data is stored in the correct format type.\r\n\t\tforeach($config_data as $column => $value)\r\n\t\t{\r\n\t\t\t// Ensure non boolean values are stored as their entered value.\r\n\t\t\tif (in_array($column, $non_boolean_columns))\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (string)$config_data[$column];\r\n\t\t\t}\r\n\t\t\t// All others are saved as boolean.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$config_data[$column] = (bool)$config_data[$column];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set configuration data to cart session settings.\r\n\t\t$this->flexi->cart_contents['settings']['configuration'] = $config_data;\r\n\r\n\t\t// Set an empty cart id and order number placeholder.\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['cart_data_id'] = FALSE;\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['order_number'] = FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}",
"function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net (eCheck) Module', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS', 'True', 'Do you want to accept eCheck payments via Authorize.net?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login ID', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN', 'testing', 'The API Login ID used for the Authorize.net service', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY', 'Test', 'Transaction Key used for encrypting TP data<br />(See your Authorizenet Account->Security Settings->API Login ID and Transaction Key for details.)', '6', '0', now(), 'zen_cfg_password_display')\"); \r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('MD5 Hash', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH', '*Set A Hash Value at AuthNet Admin*', 'Encryption key used for validating received transaction data (MAX 20 CHARACTERS)', '6', '0', now(), 'zen_cfg_password_display')\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'zen_cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE', 'Authorize', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'zen_cfg_select_option(array(\\'Authorize\\', \\'Authorize+Capture\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Database Storage', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA', 'True', 'Do you want to save the gateway communications data to the database?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net email a receipt to the customer?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT', 'False', 'Should Authorize.Net email a receipt to the merchant?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID', '1', 'Set the status of orders made with this payment module to this value', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING', 'Off', 'Would you like to enable debug mode? A complete detailed log of failed transactions may be emailed to the store owner.', '6', '0', 'zen_cfg_select_option(array(\\'Off\\', \\'Log File\\', \\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Wells Fargo SecureSource Merchant', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED', 'False', 'Are you a Wells Fargo SecureSource merchant? eCheck transactions will collect additional information from customers. Set to True only if your account has been configured to use Wells Fargo SecureSource.', '6', '0', 'zen_cfg_select_option(array(\\'False\\', \\'True\\'), ', now())\");\r\n }",
"protected function applyConfig(): void\n {\n foreach (['to', 'from', 'sender', 'replyTo'] as $method) {\n if (isset($this->account[$method])) {\n foreach ((array) $this->account[$method] as $email => $name) {\n if (is_int($email)) {\n $email = $name;\n $name = null;\n }\n call_user_func_array([$this, $method], [$email,$name]);\n }\n }\n }\n if (isset($this->account['bcc'])) {\n foreach ((array) $this->account['bcc'] as $email => $name) {\n if (is_int($email)) {\n $email = $name;\n $name = null;\n }\n $this->addBcc($email, $name);\n }\n }\n\n if (isset($this->account['cc'])) {\n foreach ((array) $this->account['cc'] as $email => $name) {\n if (is_int($email)) {\n $email = $name;\n $name = null;\n }\n $this->addCc($email, $name);\n }\n }\n }",
"static private function setSpecialConfigValuesFor($accountId) {\r\n\t\tif ($accountId <= 0) {\r\n\t\t\tError::getInstance()->addError('AccountID for special config-values not set.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Register all consts for new user, uses self::$NEW_REGISTERED_ID\r\n\t\tinclude FRONTEND_PATH.'system/register.consts.php';\r\n\r\n\t\t$DB = DB::getInstance();\r\n\r\n\t\t$data = $DB->query('SELECT id FROM '.PREFIX.'sport WHERE accountid=\"'.$accountId.'\" AND name=\"Laufen\" LIMIT 1')->fetch();\r\n\t\tConfigValue::update('MAINSPORT', $data['id'], $accountId);\r\n\t\tConfigValue::update('RUNNINGSPORT', $data['id'], $accountId);\r\n\t\t$DB->exec('UPDATE `'.PREFIX.'type` SET `sportid`=\"'.$data['id'].'\" WHERE `accountid`=\"'.$accountId.'\" LIMIT 1', false);\r\n\r\n\t\t$data = $DB->query('SELECT id FROM '.PREFIX.'type WHERE accountid=\"'.$accountId.'\" AND name=\"Wettkampf\" LIMIT 1')->fetch();\r\n\t\tConfigValue::update('WK_TYPID', $data['id'], $accountId);\r\n\r\n\t\t$data = $DB->query('SELECT id FROM '.PREFIX.'type WHERE accountid=\"'.$accountId.'\" AND name=\"Langer Lauf\" LIMIT 1')->fetch();\r\n\t\tConfigValue::update('LL_TYPID', $data['id'], $accountId);\r\n\t}",
"function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Nochex Module', 'MODULE_PAYMENT_NOCHEX_STATUS', 'True', 'Do you want to accept Nochex payments?', '6', '44', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Nochex Email Address', 'MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS','\".STORE_OWNER_EMAIL_ADDRESS.\"', 'Registered email address for your Nochex account.<br />NOTE: This must match <strong>EXACTLY </strong>the registered email address on your Nochex account.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Nochex Account Type', 'MODULE_PAYMENT_NOCHEX_ACCOUNT_TYPE', 'Seller', 'Please select the type of Nochex account you are accepting payments with.', '6', '44', 'zen_cfg_select_option(array(\\'Seller\\',\\'Merchant\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_NOCHEX_MERCHANT_ID', '', 'For Nochex Merchant account holders, allows you to accept payments using a different merchant ID. Has no effect on Seller accounts.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_NOCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '44', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_NOCHEX_PROCESSING_STATUS_ID', '\" . DEFAULT_ORDERS_STATUS_ID . \"', 'Set the status of orders made with this payment module that are not yet completed to this value<br />(\\'Pending\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', '2', 'Set the status of orders made with this payment module that have completed payment to this value<br />(\\'Processing\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '44', now())\");\r\n\r\n // Nochex testing options go here\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_NOCHEX_APC_DEBUG', 'Off', 'Enable debug logging? <br />NOTE: This can REALLY clutter your email inbox!<br />Logging goes to the /includes/modules/payment/nochex_apc/logs folder<br />Email goes to the store-owner address.<strong>Leave OFF for normal operation.</strong>', '6', '44', 'zen_cfg_select_option(array(\\'Off\\',\\'Log File\\',\\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Status Live/Testing', 'MODULE_PAYMENT_NOCHEX_TESTING', 'Live', 'Set Nochex module to Live or Test. In Test mode no money is transferred.', '6', '44', 'zen_cfg_select_option(array(\\'Live\\', \\'Test\\'), ', now())\");\r\n\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_INSTALLED');\r\n }",
"function chawa_db_transactions_install() {\n\tglobal $wpdb;\n\tglobal $chawa_table_ver_transactions;\n\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$sql = \"CREATE TABLE $table_name (\n\t\ttransaction_id varchar(50) DEFAULT 'chawa_000000000000000000000000' NOT NULL,\n\t\ttransaction_type varchar(50) NOT NULL,\n\t\ttransaction_status varchar(50) NOT NULL,\n\t\tsource_id varchar(50) NOT NULL,\n\t\tsource_status varchar(50) NOT NULL,\n\t\tcharge_id varchar(50) NOT NULL,\n\t\tcharge_status varchar(50) NOT NULL,\n\t\tuser_id mediumint(9) NOT NULL,\n\t\tamount varchar(50) NOT NULL,\n\t\trecurring BOOLEAN,\n\t\ttime datetime NOT NULL,\n\t\tPRIMARY KEY (transaction_id)\n\t) $charset_collate;\";\n\n\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\tdbDelta($sql);\n\n\tadd_option('chawa_table_ver_transactions', $chawa_table_ver_transactions);\n}",
"public function getConfigurationExample() {\n\t\treturn '\nstorage = tce\nstorage {\n\tdontUpdateFields = password\n\tdontUsePidForKeyField = 0\n\t\n\t# only update existing records but dont create new ones\n\t# dontAllowInserts = 1\n\t\n\t# needed for ordering records in TYPO3\n\t// moveAfterField = myFunnyFieldWithUIDofpreviousRecord\n\t\n\t# if set to 1, deleted records will be reactivated when they get imported again\n\treactivateDeletedRecords = 0\n}';\n\t}",
"public function configure()\n {\n if ($this->getTestMode()) {\n $this->braintree->config->environment('sandbox');\n } else {\n $this->braintree->config->environment('production');\n }\n\n // Set the keys\n $this->braintree->config->merchantId($this->getMerchantId());\n $this->braintree->config->publicKey($this->getPublicKey());\n $this->braintree->config->privateKey($this->getPrivateKey());\n }",
"function setUpPayments() {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n try {\n DB::execute(\"CREATE TABLE \" . TABLE_PREFIX . \"payment_gateways (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'ApplicationObject',\n raw_additional_properties longtext,\n is_default tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n INDEX type (type)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE \" . TABLE_PREFIX . \"payments (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'ApplicationObject',\n parent_type varchar(50) DEFAULT NULL,\n parent_id int unsigned NULL DEFAULT NULL,\n amount decimal(12, 3) DEFAULT 0,\n currency_id int(5) NULL DEFAULT NULL,\n gateway_type varchar(50) DEFAULT NULL,\n gateway_id int(10) unsigned NULL DEFAULT NULL,\n status enum('Paid', 'Pending', 'Deleted', 'Canceled') DEFAULT NULL,\n reason enum('Fraud', 'Refund', 'Other') DEFAULT NULL,\n reason_text text,\n created_by_id int(10) unsigned NULL DEFAULT NULL,\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n paid_on date DEFAULT NULL,\n comment text,\n raw_additional_properties longtext,\n PRIMARY KEY (id),\n INDEX type (type),\n INDEX parent (parent_type, parent_id),\n INDEX created_by_id (created_by_id),\n INDEX currency_id (currency_id),\n INDEX status (status),\n INDEX created_on (created_on),\n INDEX paid_on (paid_on)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?)', 'allow_payments', 'payments', serialize(false));\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?)', 'allow_payments_for_invoice', 'payments', serialize(true));\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }",
"public function ccpa_banner_configuration() {\n\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\techo esc_html( 'You do not have sufficient permissions to access this page.' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->save_banner_settings();\n\t\t$this->save_banner_behavior_settings();\n\t\t$this->save_settings();\n\t\t$this->cookiepro_ccpc_button_floatings = get_option( 'CookieProCCPAButtonFloatings' );\n\t\t$this->banner_settings_constant = array(\n\t\t\t'constant' => $this->get_constant_data_array(),\n\t\t\t'field' => $this->get_banner_setting_data_as_array(),\n\t\t\t'behavior' => $this->get_banner_behaviors_setting_data_as_array(),\n\t\t\t'Floating' => $this->cookiepro_ccpc_button_floatings,\n\t\t\t'publishstatus' => $this->display_status(),\n\t\t);\n\t\tinclude_once WP_PLUGIN_DIR . '/' . $this->plugin->name . '/views/settings.php';\n\t}",
"function getConfigArray()\t{\r\n\r\n\t\t\t# Keep the existing content of this function.\r\n\t\tparent::getConfigArray();\r\n\r\n\t\t# Check if the User Statistic feature is enabled in Setup.\r\n\t\tif ($this->config['config']['tx_feuserloginsystem.']['enableUserStatistics']) {\r\n\t\t # Do only write in statistic database table if a user is logged in!\r\n\t\t\tif ($this->loginUser)\t{\r\n\t\t\t\tif (t3lib_div::GPvar(\"logintype\") == 'login')\t{\r\n\t\t\t\t\t$this->feuserloginsystem_addUserStatisticEntry();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->feuserloginsystem_updateUserStatisticEntry();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"function install() {\n global $db;\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paymentech Module', 'MODULE_PAYMENT_PAYMENTECH_STATUS', 'True', 'Do you want to accept Paymentech payments?', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PAYMENTECH_TESTMODE', 'Test', 'Transaction mode used for processing orders.', '6', '0', 'cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (Test Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a test account. This is only used when in testing mode.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (USD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have USD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (CAD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a CAD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bin Number', 'MODULE_PAYMENT_PAYMENTECH_BIN', '000002', 'Bin Number assigned by Paymentech.', '6', '0', now())\"); \n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Terminal ID', 'MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID', '001', 'Most are 001. Only change if instructed by Paymentech', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE', 'Authorize/Capture', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'cfg_select_option(array(\\'Authorize\\', \\'Authorize/Capture\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Request CVV Number', 'MODULE_PAYMENT_PAYMENTECH_USE_CVV', 'True', 'Do you want to ask the customer for the card\\'s CVV number', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYMENTECH_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Currencies Accepted', 'MODULE_PAYMENT_PAYMENTECH_CURRENCIES', 'USD only', 'Accept Canadian dollars, US dollars, or both? If you have a Merchant ID set up for both then the currency will matched appropriately.', '6', '0', 'cfg_select_option(array(\\'CAD only\\', \\'USD only\\', \\'CAD and USD\\'), ', now())\");\n }",
"public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }",
"public static function authorizeTransaction($transaction) {\n\t\t\tif (!array_key_exists($transaction['type'], self::$transactionMap)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$transaction['type'] = self::$transactionMap[$transaction['type']];\n\t\t\t}\n\t\t\t// set transaction values\n\t\t\t$authnet_values = array(\n\t\t\t\t'x_test_request' => authorize::$testMode ? 'TRUE' : 'FALSE',\n\t\t\t\t'x_login' => $transaction['login'],\n\t\t\t\t'x_version' => \"3.1\",\n\t\t\t\t'x_delim_char' => self::$deliminator,\n\t\t\t\t'x_delim_data' => 'TRUE',\n\t\t\t\t'x_url' => 'FALSE',\n\t\t\t\t'x_type' => $transaction['type'],\n\t\t\t\t'x_method' => $transaction['method'],\n\t\t\t\t'x_tran_key' => $transaction['key'],\n\t\t\t\t'x_relay_response' => 'FALSE',\n\t\t\t\t'x_cust_id' => $transaction['customer_id'],\n\t\t\t\t'x_invoice_num' => $transaction['invoice_num'],\n\t\t\t\t'x_description' => $transaction['description'],\n\t\t\t\t'x_card_num' => $transaction['card_num'],\n\t\t\t\t'x_exp_date' => $transaction['exp_month'].'/'.$transaction['exp_year'],\n\t\t\t\t'x_card_code' => $transaction['card_code'],\n\t\t\t\t'x_amount' => $transaction['amount'],\n\t\t\t\t'x_first_name' => $transaction['first_name'],\n\t\t\t\t'x_last_name' => $transaction['last_name'],\n\t\t\t\t'x_address' => $transaction['address'],\n\t\t\t\t'x_city' => $transaction['city'],\n\t\t\t\t'x_state' => $transaction['state'],\n\t\t\t\t'x_zip' => $transaction['zip'],\n\t\t\t\t'x_country' => $transaction['country'],\n\t\t\t\t'x_recurring_billing' => 'NO',\n\t\t\t\t'x_bank_aba_code' => $transaction['bank_aba_code'],\n\t\t\t\t'x_bank_acct_num' => $transaction['bank_acct_num'],\n\t\t\t\t'x_bank_acct_type' => $transaction['bank_acct_type'],\n\t\t\t\t'x_bank_name' => $transaction['bank_name'],\n\t\t\t\t'x_bank_acct_name' => $transaction['bank_acct_name']\n\t\t\t);\n\t\t\t// prepare post\n\t\t\t$fields = '';\n\t\t\tforeach ($authnet_values as $key => $val) {\n\t\t\t\t$fields .= $key.'='.urlencode($val).'&';\n\t\t\t}\n\t\t\t$ch = curl_init($transaction['host']); // URL of gateway for cURL to post to\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // set to return response data instead of TRUE(1)\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, '& ')); // use HTTP POST to send form data\n\t\t\t$response = curl_exec($ch); // execute post and get response\n\t\t\tcurl_close ($ch); // close stream\n\t\t\t$responseArray = explode(self::$deliminator, $response);\n\t\t\t$return = array();\n\t\t\t$return['responseCode'] = $responseArray[0];\n\t\t\t$return['responseText'] = isset(self::$responseMap[$responseArray[0]]) ? self::$responseMap[$responseArray[0]] : 'Error';\n\t\t\t$return['subCode'] = $responseArray[1];\n\t\t\t$return['reasonCode'] = $responseArray[2];\n\t\t\t$return['reasonText'] = $responseArray[3];\n\t\t\t$return['approvalCode'] = $responseArray[4];\n\t\t\t$return['avsCode'] = $responseArray[5];\n\t\t\t$return['avsResponse'] = isset(self::$avsMap[$responseArray[5]]) ? self::$avsMap[$responseArray[5]] : 'NO VALUE RETURNED';\n\t\t\t$return['transactionID'] = $responseArray[6];\n\t\t\t$return['invoiceNumber'] = $responseArray[7];\n\t\t\t$return['description'] = $responseArray[8];\n\t\t\t$return['amount'] = $responseArray[9];\n\t\t\t$return['method'] = $responseArray[10];\n\t\t\t$return['type'] = $responseArray[11];\n\t\t\t$return['memberID'] = $responseArray[12];\n\t\t\t$return['cvvCode'] = $responseArray[38];\n\t\t\t$return['cvvResponse'] = isset(self::$cvvMap[$responseArray[38]]) ? self::$cvvMap[$responseArray[38]] : 'NO VALUE RETURNED';\n\t\t\t$md5verify = $transaction['hashKey'].$transaction['login'].$responseArray[7].$responseArray[10];\n\t\t\t$verification = md5($md5verify);\n\t\t\t$securityHash = strtolower($responseArray[37]);\n\t\t\tif ($verification === $securityHash) {\n\t\t\t\t$return['error'] = false;\n\t\t\t} else {\n\t\t\t\t$return['error'] = 'Security hash does not match: '.$securityHash;\n\t\t\t\ttrigger_error('Security hash does not match in transaction response for member '.$transaction['member_id'].', invoice '.$transaction['invoice_number'], E_USER_WARNING);\n\t\t\t}\n\t\t\treturn $return;\n\t\t}",
"public function preProcess() {\n $config = CRM_Core_Config::singleton();\n \n parent::preProcess();\n $this->assign('confirm_text', CRM_Utils_Array::value('confirm_text', $this->_values));\n $this->assign('confirm_footer', CRM_Utils_Array::value('confirm_footer', $this->_values));\n $this->_params['amount'] = $this->get('default_amount_hidden');\n // we use this here to incorporate any changes made by folks in hooks\n $this->_params['currencyID'] = $config->defaultCurrency;\n $this->_params = $this->controller->exportValues('Main');\n \n $this->_params['is_draft'] = $this->get('is_draft');\n\n $this->_params['ip_address'] = $_SERVER['REMOTE_ADDR'];\n // hack for safari\n if ($this->_params['ip_address'] == '::1') {\n $this->_params['ip_address'] = '127.0.0.1';\n }\n $this->_params['amount'] = $this->get('default_amount');\n \n if (isset($this->_params['amount'])) {\n $this->_params['currencyID'] = $config->defaultCurrency;\n }\n\n // if onbehalf-of-organization\n if (CRM_Utils_Array::value('hidden_onbehalf_profile', $this->_params)) {\n if (CRM_Utils_Array::value('org_option', $this->_params) &&\n CRM_Utils_Array::value('organization_id', $this->_params)\n ) {\n if (CRM_Utils_Array::value('onbehalfof_id', $this->_params)) {\n $this->_params['organization_id'] = $this->_params['onbehalfof_id'];\n }\n }\n\n $this->_params['organization_name'] = $this->_params['onbehalf']['organization_name'];\n $addressBlocks = array(\n 'street_address', 'city', 'state_province',\n 'postal_code', 'country', 'supplemental_address_1',\n 'supplemental_address_2', 'supplemental_address_3',\n 'postal_code_suffix', 'geo_code_1', 'geo_code_2', 'address_name',\n );\n\n $blocks = array('email', 'phone', 'im', 'url', 'openid');\n foreach ($this->_params['onbehalf'] as $loc => $value) {\n $field = $typeId = NULL;\n if (strstr($loc, '-')) {\n list($field, $locType) = explode('-', $loc);\n }\n\n if (in_array($field, $addressBlocks)) {\n if ($locType == 'Primary') {\n $defaultLocationType = CRM_Core_BAO_LocationType::getDefault();\n $locType = $defaultLocationType->id;\n }\n\n if ($field == 'country') {\n $value = CRM_Core_PseudoConstant::countryIsoCode($value);\n }\n elseif ($field == 'state_province') {\n $value = CRM_Core_PseudoConstant::stateProvinceAbbreviation($value);\n }\n\n $isPrimary = 1;\n if (isset($this->_params['onbehalf_location']['address'])\n && count($this->_params['onbehalf_location']['address']) > 0) {\n $isPrimary = 0;\n }\n\n $this->_params['onbehalf_location']['address'][$locType][$field] = $value;\n if (!CRM_Utils_Array::value('is_primary', $this->_params['onbehalf_location']['address'][$locType])) {\n $this->_params['onbehalf_location']['address'][$locType]['is_primary'] = $isPrimary;\n }\n $this->_params['onbehalf_location']['address'][$locType]['location_type_id'] = $locType;\n }\n elseif (in_array($field, $blocks)) {\n if (!$typeId || is_numeric($typeId)) {\n $blockName = $fieldName = $field;\n $locationType = 'location_type_id';\n if ( $locType == 'Primary' ) {\n $defaultLocationType = CRM_Core_BAO_LocationType::getDefault();\n $locationValue = $defaultLocationType->id;\n }\n else {\n $locationValue = $locType;\n }\n $locTypeId = '';\n $phoneExtField = array();\n\n if ($field == 'url') {\n $blockName = 'website';\n $locationType = 'website_type_id';\n $locationValue = CRM_Utils_Array::value(\"{$loc}-website_type_id\", $this->_params['onbehalf']);\n }\n elseif ($field == 'im') {\n $fieldName = 'name';\n $locTypeId = 'provider_id';\n $typeId = $this->_params['onbehalf'][\"{$loc}-provider_id\"];\n }\n elseif ($field == 'phone') {\n list($field, $locType, $typeId) = explode('-', $loc);\n $locTypeId = 'phone_type_id';\n\n //check if extension field exists\n $extField = str_replace('phone','phone_ext', $loc);\n if (isset($this->_params['onbehalf'][$extField])) {\n $phoneExtField = array('phone_ext' => $this->_params['onbehalf'][$extField]);\n }\n }\n\n $isPrimary = 1;\n if ( isset ($this->_params['onbehalf_location'][$blockName] )\n && count( $this->_params['onbehalf_location'][$blockName] ) > 0 ) {\n $isPrimary = 0;\n }\n if ($locationValue) {\n $blockValues = array(\n $fieldName => $value,\n $locationType => $locationValue,\n 'is_primary' => $isPrimary,\n );\n\n if ($locTypeId) {\n $blockValues = array_merge($blockValues, array($locTypeId => $typeId));\n }\n if (!empty($phoneExtField)) {\n $blockValues = array_merge($blockValues, $phoneExtField);\n }\n\n $this->_params['onbehalf_location'][$blockName][] = $blockValues;\n }\n }\n }\n elseif (strstr($loc, 'custom')) {\n if ($value && isset($this->_params['onbehalf'][\"{$loc}_id\"])) {\n $value = $this->_params['onbehalf'][\"{$loc}_id\"];\n }\n $this->_params['onbehalf_location'][\"{$loc}\"] = $value;\n }\n else {\n if ($loc == 'contact_sub_type') {\n $this->_params['onbehalf_location'][$loc] = $value;\n }\n else {\n $this->_params['onbehalf_location'][$field] = $value;\n }\n }\n }\n }\n elseif (CRM_Utils_Array::value('is_for_organization', $this->_values)) {\n // no on behalf of an organization, CRM-5519\n // so reset loc blocks from main params.\n foreach (array(\n 'phone', 'email', 'address') as $blk) {\n if (isset($this->_params[$blk])) {\n unset($this->_params[$blk]);\n }\n }\n }\n $this->set('params', $this->_params);\n }"
] |
[
"0.61269504",
"0.58333105",
"0.5556471",
"0.5550534",
"0.52697796",
"0.52531683",
"0.52213556",
"0.5143226",
"0.5116422",
"0.50987995",
"0.50721496",
"0.5034265",
"0.5024309",
"0.50169027",
"0.5012393",
"0.49929717",
"0.4976588",
"0.49742806",
"0.49343672",
"0.49339312",
"0.4928704",
"0.49260807",
"0.49092278",
"0.49002856",
"0.48946005",
"0.48894066",
"0.4887728",
"0.4879425",
"0.48769397",
"0.48743904"
] |
0.7316787
|
0
|
Inserts config entries for language, wpf_tokenization, sort_order
|
private static function _addWpfConfigurationEntries()
{
global $db;
$sortOrderAttributes = "array(''maxlength'' => ''3'')";
$languages = EMerchantPayCommon::buildSettingsDropDownOptions(
EmpCheckoutSettings::getAvailableCheckoutLanguages()
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Checkout Page Language',
'" . EmpCheckoutSettings::getCompleteSettingKey('LANGUAGE') . "',
'en', 'What language (localization) should we have on the Checkout?.',
'6', '0', 'emp_zfg_select_drop_down_single({$languages},', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('WPF Tokenization',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'WPF_TOKENIZATION'
) . "',
'false', 'Enable WPF Tokenization', '6', '3', 'emp_zfg_draw_toggle(',
'emp_zfg_get_toggle_value', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Sort order of display.',
'" . EmpCheckoutSettings::getCompleteSettingKey('SORT_ORDER') . "',
'0', 'Sort order of display. Lowest is displayed first.', '6', '0',
'emp_zfg_draw_number_input({$sortOrderAttributes}, ', now())"
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private static function _addMainConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable emerchantpay Checkout Module',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . \"',\n 'true',\n 'Do you want to process payments via emerchantpay''s Genesis Gateway?',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Title',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CHECKOUT_PAGE_TITLE'\n ) . \"',\n 'Pay safely with emerchantpay Checkout',\n 'This name will be displayed on the checkout page', '6', '4',\n 'emp_zfg_draw_input(null, ', now())\"\n );\n }",
"protected function _initConfig()\n {\n parent::_initConfig();\n $this->_mergeConfig(array(\n 'get_descriptions' => false, // true to get descriptions for text sections\n ));\n }",
"function plugin_initconfig_crowdtranslator( )\n{\n global $_CROWDTRANSLATOR_CONF, $_CROWDTRANSLATOR_DEFAULT;\n if ( is_array( $_CROWDTRANSLATOR_CONF ) && ( count( $_CROWDTRANSLATOR_CONF ) > 1 ) ) {\n $_CROWDTRANSLATOR_DEFAULT = array_merge( $_CROWDTRANSLATOR_DEFAULT, $_CROWDTRANSLATOR_CONF );\n }\n $me = 'crowdtranslator';\n $c = config::get_instance();\n if ( !$c->group_exists( $me ) ) {\n $c->add( 'sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, $me, 0 );\n $c->add( 'tab_main', NULL, 'tab', 0, 0, NULL, 0, true, $me, 0 );\n $c->add( 'fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, $me, 0 );\n // The below two lines add two settings to Geeklog's config UI\n $c->add( 'enabled', $_CROWDTRANSLATOR_DEFAULT[ 'enabled' ], 'select', 0, 0, 0, 10, true, $me, 0 ); // This adds a drop-down box\n }\n return true;\n}",
"public function hookConfig()\n {\n set_option('collection_tree_alpha_order', $_POST['collection_tree_alpha_order']);\n }",
"public function registerConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/language-switcher.php', 'language-switcher');\n }",
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = '';\r\n }\r\n $response = Configuration::updateValue($this->name . '_TITLE', $title);\r\n $response &= Configuration::updateValue($this->name . '_MAXITEM', 5);\r\n $response &= Configuration::updateValue($this->name . '_MINITEM', 2);\r\n $response &= Configuration::updateValue($this->name . '_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue($this->name . '_AUTOSCROLLDELAY', 5000);\r\n $response &= Configuration::updateValue($this->name . '_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue($this->name . '_PAGINATION', 0);\r\n $response &= Configuration::updateValue($this->name . '_NAVIGATION', 0);\r\n $response &= Configuration::updateValue($this->name . '_MANTITLE', 0);\r\n\r\n return $response;\r\n }",
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\t\t\t\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Specials products';\r\n }\r\n $response = Configuration::updateValue('FIELD_SPECIALPLS_NBR', 6);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_VERTICAL', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MAXITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MEDIUMITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLLDELAY', 4000);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_NAVIGATION', 0);\r\n\r\n return $response;\r\n }",
"private static function _addOrderConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Default Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the default status of orders made with this payment module\" .\n \" to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Failed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'FAILED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of failed orders made with this payment module to\" .\n \" this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Processed Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'PROCESSED_ORDER_STATUS_ID'\n ) . \"',\n '2', 'Set the status of processed orders made with this payment \" .\n \"module to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Refunded Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'REFUNDED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of refunded orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Set Canceled Order Status',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CANCELED_ORDER_STATUS_ID'\n ) . \"',\n '1', 'Set the status of canceled orders made with this payment module',\n '6', '0', 'emp_zfg_pull_down_order_statuses(',\n 'zen_get_order_status_name', now())\"\n );\n }",
"public function init()\n {\n\n $this->addWPConfigs();\n $this->addSPLConfigs();\n $this->addControllerConfigs();\n $this->addFieldGroupConfigs();\n $this->addFieldConfigs();\n $this->addImageSizeConfigs();\n $this->addLayoutConfigs();\n $this->addModelConfigs();\n $this->addPostTypeConfigs();\n $this->addTaxonomyConfigs();\n $this->addTemplateFunctionConfigs();\n $this->addHookableConfigs();\n $this->addSearchConfigs();\n $this->addBaseThemeConfigs();\n\n }",
"protected function generateLanguagesConfig()\n {\n $phpConfDir = $this->behavior->getTable()->getGeneratorConfig()->getBuildProperties()['behaviorCrudablePhpconfDir'];\n $languagesFilename = sprintf(\"%s/languages-conf.php\", rtrim($phpConfDir, '/'));\n\n if (!file_exists($languagesFilename)) {\n $fs = new Filesystem();\n $fs->touch($languagesFilename);\n }\n\n $languagesString = str_replace(' ', '', $this->behavior->getTable()->getGeneratorConfig()->getBuildProperties()['behaviorCrudableLanguages']);\n $languagesConf = explode(';', $languagesString);\n\n $languagesConf = array_map(function($value) {\n return array(\n 'locale' => $value,\n 'filename' => sprintf(\"trans-%s.yml\", $value),\n );\n }, $languagesConf);\n\n // write the controllers configuration file\n file_put_contents(\n $languagesFilename,\n sprintf(\"<?php\\nreturn %s;\\n\", var_export($languagesConf, true))\n );\n }",
"public function init()\n {\n parent::init();\n //$this->_properties = $this->_privateConfig->properties->toArray();\n $this->_syncModelUri = $this->_privateConfig->syncModelUri;\n\n // Translation hack in order to enable the plugin to translate...\n $translate = OntoWiki::getInstance()->translate;\n $translate->addTranslation(\n $this->_pluginRoot . 'languages',\n null,\n array('scan' => Zend_Translate::LOCALE_FILENAME)\n );\n $translate->setLocale(OntoWiki::getInstance()->config->languages->locale);\n }",
"public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }",
"protected static function setLanguageKeys() {}",
"protected function addWPConfigs()\n {\n\n $this[\"databaseAdapter\"] = function () {\n return $GLOBALS['wpdb'];\n };\n\n $this[\"query\"] = $this->factory(\n function () {\n return new \\WP_Query();\n }\n );\n\n }",
"protected function addConfiguration()\n {\n $this['config'] = $this->share(\n function () {\n $user_config_file = (file_exists('phpdoc.xml'))\n ? 'phpdoc.xml'\n : 'phpdoc.dist.xml';\n\n return \\Zend\\Config\\Factory::fromFiles(\n array(\n __DIR__.'/../../data/phpdoc.tpl.xml',\n $user_config_file\n ), true\n );\n }\n );\n }",
"function configure() {\n\t\tif($GLOBALS['TSFE']->config['config']['locale_all'])\n\t\t\tsetlocale(LC_ALL, $GLOBALS['TSFE']->config['config']['locale_all']);\n\n $this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t}",
"function ks_wysiwyg_configs() {\n $configs = array();\n\n // add config: Full\n $configs['Full'] = array(\n 'toolbars' => array(\n 1 => array('formatselect', 'bold', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'link', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv'),\n\t\t\t2 => array('strikethrough', 'hr', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help')\n )\n );\n\n // add config: Standard\n $configs['Standard'] = array(\n 'toolbars' => array(\n 1 => array('formatselect', 'bold', 'italic', 'underline', 'strikethrough', 'blockquote', 'bullist', 'numlist', 'link', 'hr', 'undo', 'redo', 'removeformat', 'fullscreen')\n ),\n 'formats' => array(\n 'p' => 'Text',\n 'h2' => 'Heading 2',\n 'h3' => 'Heading 3',\n 'h4' => 'Heading 4',\n 'h5' => 'Heading 5'\n ),\n 'elements' => array(\n 'p' => array(),\n 'h2' => array(),\n 'h3' => array(),\n 'h4' => array(),\n 'h5' => array(),\n 'strong' => array(\n 'synonyms' => array('b')\n ),\n 'em' => array(\n 'synonyms' => array('i')\n ),\n 'span' => array(\n 'styles' => array('text-decoration')\n ),\n 'del' => array(\n 'synonyms' => array('s')\n ),\n 'blockquote' => array(),\n 'ul' => array(),\n 'ol' => array(),\n 'li' => array(),\n 'a' => array(\n 'attributes' => array('href', 'target', 'rel')\n ),\n 'hr' => array(),\n 'br' => array()\n ),\n 'media_elements' => array(\n 'img' => array(\n 'attributes' => array('src', 'alt', 'width', 'height', 'class', 'title', 'data-mce-src')\n ),\n 'div' => array(\n 'attributes' => array('!class<mceTemp')\n ),\n 'dl' => array(\n 'attributes' => array('id', '!class', 'data-mce-style'),\n 'styles' => array('width')\n ),\n 'dt' => array(\n 'attributes' => array('!class<wp-caption-dt')\n ),\n 'dd' => array(\n 'attributes' => array('!class<wp-caption-dd')\n )\n )\n );\n\n // add config: Standard (No Headings)\n $configs['Standard (No Headings)'] = array(\n 'toolbars' => array(\n 1 => array('bold', 'italic', 'underline', 'strikethrough', 'blockquote', 'bullist', 'numlist', 'link', 'hr', 'undo', 'redo', 'removeformat', 'fullscreen')\n ),\n 'elements' => array(\n 'p' => array(),\n 'strong' => array(\n 'synonyms' => array('b')\n ),\n 'em' => array(\n 'synonyms' => array('i')\n ),\n 'span' => array(\n 'styles' => array('text-decoration')\n ),\n 'del' => array(\n 'synonyms' => array('s')\n ),\n 'blockquote' => array(),\n 'ul' => array(),\n 'ol' => array(),\n 'li' => array(),\n 'a' => array(\n 'attributes' => array('href', 'target', 'rel')\n ),\n 'hr' => array(),\n 'br' => array()\n ),\n 'media_elements' => array(\n 'img' => array(\n 'attributes' => array('src', 'alt', 'width', 'height', 'class', 'title', 'data-mce-src')\n ),\n 'div' => array(\n 'attributes' => array('!class<mceTemp')\n ),\n 'dl' => array(\n 'attributes' => array('id', '!class', 'data-mce-style'),\n 'styles' => array('width')\n ),\n 'dt' => array(\n 'attributes' => array('!class<wp-caption-dt')\n ),\n 'dd' => array(\n 'attributes' => array('!class<wp-caption-dd')\n )\n )\n );\n\n // add config: Minimal\n $configs['Minimal'] = array(\n 'toolbars' => array(\n 1 => array('bold' , 'italic', 'link')\n ),\n 'elements' => array(\n 'p' => array(),\n 'strong' => array(\n 'synonyms' => array('b')\n ),\n 'em' => array(\n 'synonyms' => array('i')\n ),\n 'a' => array(\n 'attributes' => array('href', 'target', 'rel')\n ),\n 'br' => array()\n )\n );\n \n // add config: Minimal (No Links)\n $configs['Minimal (No Links)'] = array(\n 'toolbars' => array(\n 1 => array('bold' , 'italic')\n ),\n 'elements' => array(\n 'p' => array(),\n 'strong' => array(\n 'synonyms' => array('b')\n ),\n 'em' => array(\n 'synonyms' => array('i')\n ),\n 'br' => array()\n )\n );\n\n\n // process configs\n $processed_configs = array();\n foreach ($configs as $config_name => $config_data) {\n $processed_data = array();\n\n // add (unsanitzed) name to data\n $processed_data['label'] = $config_name;\n\n // add toolbars to data\n $processed_data['toolbars'] = $config_data['toolbars'];\n\n // generate block_formats string\n if (isset($config_data['formats'])) {\n $formats_list = array();\n foreach ($config_data['formats'] as $format_tag => $format_label) {\n $formats_list[] = $format_label . '=' . $format_tag;\n }\n\n $processed_data['formats'] = implode(';', $formats_list);\n }\n\n // generate valid_styles array\n if (isset($config_data['elements']) || isset($config_data['global_styles'])) {\n $styles_list = array();\n \n if (isset($config_data['global_styles'])) {\n $styles_list['*'] = implode(',', $config_data['global_styles']);\n }\n if (isset($config_data['elements'])) {\n foreach ($config_data['elements'] as $element_tag => $element_options) {\n if (isset($element_options['styles'])) {\n $styles_list[$element_tag] = implode(',', $element_options['styles']);\n }\n }\n }\n\n if ($styles_list) {\n $processed_data['styles'] = $styles_list;\n }\n }\n\n // generate valid_styles array for when media is allowed\n if (isset($config_data['media_elements'])) {\n $styles_list = array();\n\n if (isset($config_data['elements'])) {\n $config_data['media_elements'] = array_merge($config_data['elements'], $config_data['media_elements']);\n }\n\n if (isset($config_data['global_styles'])) {\n $styles_list['*'] = implode(',', $config_data['global_styles']);\n }\n foreach ($config_data['media_elements'] as $element_tag => $element_options) {\n if (isset($element_options['styles'])) {\n $styles_list[$element_tag] = implode(',', $element_options['styles']);\n }\n }\n\n if ($styles_list) {\n $processed_data['styles_with_media'] = $styles_list;\n }\n }\n\n // generate valid_elements string\n if (isset($config_data['elements'])) {\n $elements_list = array();\n\n if (isset($processed_data['styles'])) {\n $elements_list[] = '@[style]'; // ensure that the style attribute is allowed if there are valid styles specified (this has to be first in the list)\n }\n foreach ($config_data['elements'] as $element_tag => $element_options) {\n $element_attribute_string = '';\n if (isset($element_options['attributes'])) {\n $element_attribute_string = '[' . implode('|', $element_options['attributes']) . ']';\n }\n\n if (isset($element_options['synonyms'])) {\n foreach ($element_options['synonyms'] as $synonym) {\n $elements_list[] = $element_tag . '/' . $synonym . $element_attribute_string;\n }\n } else {\n $elements_list[] = $element_tag . $element_attribute_string;\n }\n }\n\n $processed_data['elements'] = implode(',', $elements_list);\n }\n\n // generate valid_elements string for when media is allowed\n if (isset($config_data['media_elements'])) {\n $elements_list = array();\n\n if (isset($config_data['elements'])) {\n $config_data['media_elements'] = array_merge($config_data['elements'], $config_data['media_elements']);\n }\n\n if (isset($processed_data['styles_with_media']) || isset($processed_data['styles'])) {\n $elements_list[] = '@[style]'; // ensure that the style attribute is allowed if there are valid styles specified (this has to be first in the list)\n }\n foreach ($config_data['media_elements'] as $element_tag => $element_options) {\n $element_attribute_string = '';\n if (isset($element_options['attributes'])) {\n $element_attribute_string = '[' . implode('|', $element_options['attributes']) . ']';\n }\n\n if (isset($element_options['synonyms'])) {\n foreach ($element_options['synonyms'] as $synonym) {\n $elements_list[] = $element_tag . '/' . $synonym . $element_attribute_string;\n }\n } else {\n $elements_list[] = $element_tag . $element_attribute_string;\n }\n }\n\n $processed_data['elements_with_media'] = implode(',', $elements_list);\n }\n\n // add processed data to array\n $processed_configs[str_replace( '-', '_', sanitize_title($config_name))] = $processed_data;\n }\n\n return $processed_configs;\n}",
"public static function init(){\n self::$language = config::getMainIni('language');\n\n $system_lang = array();\n $db = new db();\n $system_language = $db->select(\n 'language',\n 'language',\n config::$vars['coscms_main']['language']\n );\n\n // create system lanugage for all modules\n if (!empty($system_language)){\n foreach($system_language as $key => $val){\n $module_lang = unserialize($val['translation']);\n $system_lang+= $module_lang;\n }\n } \n self::$dict = $system_lang;\n }",
"function addFields($config)\n {\n global $TSFE,$LANG;\n $this->storagePid = $this->getStorageFolderPid();\n // print_r($this->storagePid);\n if(!empty($this->storagePid)) {\n $sql = \"AND pid=$this->storagePid\";\n }else{\n $sql = '';\n }\n\n $optionList = array();\n // exec_SELECTquery\n // $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, \"SELECT uid,cat FROM tx_sbdownloader_cat WHERE hidden=0 AND deleted=0 $sql\");\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\"uid,cat\", \"tx_sbdownloader_cat\", \"hidden=0 AND deleted=0 $sql\");\n\n $optionList[0] = array(0 => 'all', 1 => 0);\n $i = 1;\n // while($row = mysql_fetch_object($res)){\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n $optionList[$i] = array(0 => $row['cat'], 1 => $row['uid']);\n $i++;\n }\n\n $config['items'] = array_merge($config['items'], $optionList);\n\n return $config;\n }",
"protected function _config(){\n parent::_config();\n Raxan::loadLangFile(\"info-module\");\n $this->mnuItem = \"RQHIST\";\n }",
"public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }",
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Featured product';\r\n }\r\n $response = Configuration::updateValue('FIELD_FEATUREDPSL_NBR', 8);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_CAT', (int)Context::getContext()->shop->getCategory());\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_VERTICAL', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MAXITEM', 4);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MEDIUMITEM', 2);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_AUTOSCROLLDELAY', 5000);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_FEATUREDPSL_NAVIGATION', 1);\r\n\r\n return $response;\r\n }",
"protected function getConfigForm()\n {\n // TODO : add default blog text per lang ?\n $employees = Employee::getEmployeesByProfile(\n 1,\n true\n );\n $default_snippet = array(\n array(\n 'snippet' => 'Article',\n 'name' => $this->l('Simple article')\n ),\n array(\n 'snippet' => 'NewsArticle',\n 'name' => $this->l('News article')\n ),\n );\n $layouts = array(\n array(\n 'layout' => 'layouts/layout-full-width.tpl',\n 'name' => $this->l('Full width')\n ),\n array(\n 'layout' => 'layouts/layout-left-column.tpl',\n 'name' => $this->l('Left column')\n ),\n array(\n 'layout' => 'layouts/layout-right-column.tpl',\n 'name' => $this->l('Right column')\n ),\n array(\n 'layout' => 'layouts/layout-both-columns.tpl',\n 'name' => $this->l('Both columns')\n ),\n );\n $trash_days = array(\n array(\n 'id_trash' => 0,\n 'name' => $this->l('Do not empty trash')\n ),\n array(\n 'id_trash' => 1,\n 'name' => $this->l('One day')\n ),\n array(\n 'id_trash' => 2,\n 'name' => $this->l('Two days')\n ),\n array(\n 'id_trash' => 3,\n 'name' => $this->l('Three days')\n ),\n array(\n 'id_trash' => 4,\n 'name' => $this->l('Four days')\n ),\n array(\n 'id_trash' => 5,\n 'name' => $this->l('Five days')\n ),\n array(\n 'id_trash' => 6,\n 'name' => $this->l('Six days')\n ),\n array(\n 'id_trash' => 7,\n 'name' => $this->l('One week')\n ),\n );\n $css_files = array(\n array(\n 'id_file' => 'default',\n 'name' => $this->l('default.css file')\n ),\n array(\n 'id_file' => 'red',\n 'name' => $this->l('red.css file')\n ),\n array(\n 'id_file' => 'green',\n 'name' => $this->l('green.css file')\n ),\n array(\n 'id_file' => 'yellow',\n 'name' => $this->l('yellow.css file')\n ),\n array(\n 'id_file' => 'white',\n 'name' => $this->l('white.css file')\n ),\n );\n $post_status = array(\n array(\n 'id_status' => 'draft',\n 'name' => $this->l('draft')\n ),\n array(\n 'id_status' => 'pending',\n 'name' => $this->l('pending')\n ),\n array(\n 'id_status' => 'published',\n 'name' => $this->l('published')\n ),\n array(\n 'id_status' => 'trash',\n 'name' => $this->l('trash')\n ),\n array(\n 'id_status' => 'planned',\n 'name' => $this->l('planned')\n ),\n );\n $form_fields = [];\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog default Settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->l('Blog base route'),\n 'name' => 'EVERPSBLOG_ROUTE',\n 'desc' => $this->l('Leaving empty will set \"blog\"'),\n 'hint' => $this->l('Use a keyword associated to your shop'),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post content excerpt'),\n 'name' => 'EVERPSBLOG_EXCERPT',\n 'desc' => $this->l('Post excerpt length for content on listing'),\n 'hint' => $this->l('Please set post content excerpt'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Post title length'),\n 'name' => 'EVERPSBLOG_TITLE_LENGTH',\n 'desc' => $this->l('Post title length for content on listing'),\n 'hint' => $this->l('Please set post title length'),\n 'required' => true,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Extends TinyMCE on blog management ?'),\n 'desc' => $this->l('Set yes to extends TinyMCE on blog management pages'),\n 'hint' => $this->l('Else TinyMCE will be default'),\n 'required' => false,\n 'name' => 'EVERBLOG_TINYMCE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post views count ?'),\n 'desc' => $this->l('Set yes to show views count'),\n 'hint' => $this->l('Else will only be shown on admin'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_POST_COUNT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show post on homepage ?'),\n 'desc' => $this->l('Set yes to show posts on homepage'),\n 'hint' => $this->l('Else posts won\\'t be shown on homepage'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_HOME',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for home'),\n 'name' => 'EVERPSBLOG_HOME_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Number of posts for product'),\n 'name' => 'EVERPSBLOG_PRODUCT_NBR',\n 'desc' => $this->l('Leaving empty will set 4 posts'),\n 'hint' => $this->l('Posts are 4 per row'),\n 'required' => true,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Posts per page'),\n 'name' => 'EVERPSBLOG_PAGINATION',\n 'desc' => $this->l('Leaving empty will set 10 posts per page'),\n 'hint' => $this->l('Will add pagination'),\n 'required' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Admin email'),\n 'desc' => $this->l('Will receive new comments notification by email'),\n 'hint' => $this->l('You can set a new account on your shop'),\n 'required' => true,\n 'name' => 'EVERBLOG_ADMIN_EMAIL',\n 'options' => array(\n 'query' => $employees,\n 'id' => 'id_employee',\n 'name' => 'email'\n )\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow comments on posts ?'),\n 'desc' => $this->l('Set yes to allow comments'),\n 'hint' => $this->l('You can check them before publishing'),\n 'required' => false,\n 'name' => 'EVERBLOG_ALLOW_COMMENTS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Check comments on posts before they are published ?'),\n 'desc' => $this->l('Set yes to check comments before publishing'),\n 'hint' => $this->l('In order to avoid spam'),\n 'required' => false,\n 'name' => 'EVERBLOG_CHECK_COMMENTS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Allow only registered customers to comment ?'),\n 'desc' => $this->l('Set yes to allow only registered customers to comment'),\n 'hint' => $this->l('Else everyone will be able to comment'),\n 'required' => false,\n 'name' => 'EVERBLOG_ONLY_LOGGED_COMMENT',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Empty trash'),\n 'desc' => $this->l('Please choose auto empty trash in days'),\n 'hint' => $this->l('Will auto delete trashed posts on CRON task'),\n 'required' => true,\n 'name' => 'EVERBLOG_EMPTY_TRASH',\n 'options' => array(\n 'query' => $trash_days,\n 'id' => 'id_trash',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Default blog SEO title'),\n 'name' => 'EVERBLOG_TITLE',\n 'desc' => $this->l('Max 65 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog SEO meta description'),\n 'name' => 'EVERBLOG_META_DESC',\n 'desc' => $this->l('Max 165 characters for SEO'),\n 'hint' => $this->l('Will impact SEO'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog type'),\n 'desc' => $this->l('Will be used for structured metadatas'),\n 'hint' => $this->l('Select blog type depending on your posts'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TYPE',\n 'options' => array(\n 'query' => $default_snippet,\n 'id' => 'snippet',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog top text'),\n 'name' => 'EVERBLOG_TOP_TEXT',\n 'desc' => $this->l('Will be shown on blog top default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Default blog bottom text'),\n 'name' => 'EVERBLOG_BOTTOM_TEXT',\n 'desc' => $this->l('Will be shown on blog bottom default page'),\n 'hint' => $this->l('Explain your blog purpose'),\n 'cols' => 36,\n 'rows' => 4,\n 'lang' => true,\n 'autoload_rte' => true\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Use RSS feed ?'),\n 'desc' => $this->l('Will add a link to RSS feed on blog and each tag, category, author'),\n 'hint' => $this->l('Else feed wont be used'),\n 'required' => false,\n 'name' => 'EVERBLOG_RSS',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show author ?'),\n 'desc' => $this->l('Will show author name and avatar on posts'),\n 'hint' => $this->l('Else author name and avatar will be hidden'),\n 'required' => false,\n 'name' => 'EVERBLOG_SHOW_AUTHOR',\n 'is_bool' => false,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned users'),\n 'name' => 'EVERBLOG_BANNED_USERS',\n 'desc' => $this->l('Add banned users typing their emails, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Banned IP'),\n 'name' => 'EVERBLOG_BANNED_IP',\n 'desc' => $this->l('Add banned users typing their IP addresses, one per line'),\n 'hint' => $this->l('Unwanted users won\\'t be able to post comments'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show parent categories list on left/right columns ?'),\n 'desc' => $this->l('Set yes show a list of all parent categories on left or right columns'),\n 'hint' => $this->l('Will show ordered parent categories on left/right columns'),\n 'name' => 'EVERBLOG_CATEG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show tags list on left/right columns ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Set yes show a tags cloud on left or right columns'),\n 'required' => false,\n 'name' => 'EVERBLOG_TAG_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show archives list on left/right columns ?'),\n 'desc' => $this->l('Set yes show links for monthly posts on left or right columns'),\n 'hint' => $this->l('Will show yearly and monthly posts'),\n 'required' => false,\n 'name' => 'EVERBLOG_ARCHIVE_COLUMNS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show related posts on products pages ?'),\n 'desc' => $this->l('Set yes show related posts on product pages footer'),\n 'hint' => $this->l('Will show related posts on product page footer'),\n 'required' => false,\n 'name' => 'EVERBLOG_RELATED_POST',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on categories ?'),\n 'desc' => $this->l('Set yes to show each category featured image'),\n 'hint' => $this->l('Else category featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_CAT',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Show featured images on tags ?'),\n 'desc' => $this->l('Set yes to show each tag featured image'),\n 'hint' => $this->l('Else tag featured image won\\'t be shown'),\n 'name' => 'EVERBLOG_SHOW_FEAT_TAG',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Activate cool CSS animations ?'),\n 'desc' => $this->l('Set yes to activate cool stuff'),\n 'hint' => $this->l('Will add animations on posts, images, etc'),\n 'name' => 'EVERBLOG_ANIMATE',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable Fancybox'),\n 'hint' => $this->l('Set no if your theme already uses it'),\n 'desc' => $this->l('Use Fancybox for popups on post images'),\n 'name' => 'EVERBLOG_FANCYBOX',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Enabled')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('Disabled')\n )\n ),\n ),\n array(\n 'type' => 'text',\n 'label' => $this->l('Featured category on blog default page'),\n 'name' => 'EVERBLOG_CAT_FEATURED',\n 'desc' => $this->l('Featured category'),\n 'hint' => $this->l('Will show category products on blog page'),\n 'cols' => 36,\n 'rows' => 4,\n ),\n ),\n 'buttons' => array(\n 'generateBlogSitemap' => array(\n 'name' => 'submitGenerateBlogSitemap',\n 'type' => 'submit',\n 'class' => 'btn btn-default pull-right',\n 'icon' => 'process-icon-refresh',\n 'title' => $this->l('Generate sitemaps')\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Blog layout settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default blog layout'),\n 'desc' => $this->l('Will add or remove columns from blog page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_BLOG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post layout'),\n 'desc' => $this->l('Will add or remove columns from post page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_POST_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default category layout'),\n 'desc' => $this->l('Will add or remove columns from category page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_CAT_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default author layout'),\n 'desc' => $this->l('Will add or remove columns from author page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_AUTHOR_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n array(\n 'type' => 'select',\n 'label' => $this->l('Default tag layout'),\n 'desc' => $this->l('Will add or remove columns from tag page'),\n 'hint' => $this->l('You can add or remove modules from Prestashop positions'),\n 'required' => true,\n 'name' => 'EVERPSBLOG_TAG_LAYOUT',\n 'options' => array(\n 'query' => $layouts,\n 'id' => 'layout',\n 'name' => 'name'\n )\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('WordPress XML import settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Default post state on XML import'),\n 'desc' => $this->l('Will set default post state on XML import'),\n 'hint' => $this->l('Please select default post state on XML file import'),\n 'required' => true,\n 'name' => 'EVERBLOG_IMPORT_POST_STATE',\n 'options' => array(\n 'query' => $post_status,\n 'id' => 'id_status',\n 'name' => 'name',\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress authors'),\n 'hint' => $this->l('Else no authors will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress categories'),\n 'hint' => $this->l('Else no categories will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Import WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to import WordPress tags'),\n 'hint' => $this->l('Else no tags will be imported'),\n 'required' => false,\n 'name' => 'EVERBLOG_IMPORT_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress authors from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress authors'),\n 'hint' => $this->l('Else no authors will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_AUTHORS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress categories from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress categories'),\n 'hint' => $this->l('Else no categories will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_CATS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'switch',\n 'label' => $this->l('Enable WordPress tags from xml file ?'),\n 'desc' => $this->l('Set yes to enable WordPress tags'),\n 'hint' => $this->l('Else no tags will be enabled'),\n 'required' => false,\n 'name' => 'EVERBLOG_ENABLE_TAGS',\n 'is_bool' => true,\n 'values' => array(\n array(\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')\n ),\n array(\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')\n )\n ),\n ),\n array(\n 'type' => 'file',\n 'label' => $this->l('Import WordPress XML file'),\n 'desc' => $this->l('Import WordPress XML posts file'),\n 'hint' => $this->l('Will import posts from WordPress XML file'),\n 'name' => 'wordpress_xml',\n 'required' => false\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save and import'),\n ),\n )\n );\n $form_fields[] = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Design settings'),\n 'icon' => 'icon-smile',\n ),\n 'input' => array(\n array(\n 'type' => 'select',\n 'label' => $this->l('Custom CSS file'),\n 'desc' => $this->l('You can change here default CSS file'),\n 'hint' => $this->l('By changing CSS file, you will change blog colors'),\n 'required' => true,\n 'name' => 'EVERBLOG_CSS_FILE',\n 'options' => array(\n 'query' => $css_files,\n 'id' => 'id_file',\n 'name' => 'name',\n ),\n 'lang' => false,\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->l('Custom CSS for blog'),\n 'desc' => $this->l('Add here your custom CSS rules'),\n 'hint' => $this->l('Webdesigners here can manage CSS rules for blog'),\n 'name' => 'EVERBLOG_CSS',\n ),\n ),\n 'submit' => array(\n 'name' => 'submit',\n 'title' => $this->l('Save'),\n ),\n )\n );\n return $form_fields;\n }",
"protected function registerConfigs()\n {\n // Append or overwrite configs\n #config(['test' => 'hi']);\n\n // Merge configs\n #$this->mergeConfigFrom(__DIR__.'/../Config/parser.php', 'mrcore.parser');\n }",
"private function saveTranslateConfig(){\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$lang_id \t= JRequest::getInt( 'lang_id',0 );\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$language = $model->getTable('JFLanguage');\t\t\r\n\t\t$language->load($lang_id);\r\n\r\n\t\tif (is_null($lang_id) || !isset($language->id) || $language->id<=0){\r\n\t\t\tdie( 'Invalid Language Id' );\r\n\t\t}\r\n\t\t\r\n\t\t$data = array();\r\n\t\tforeach ($_REQUEST as $key=>$val) {\r\n\t\t\tif (strpos($key,\"trans_\")===0){\r\n\t\t\t\t$key = str_replace(\"trans_\",\"\",$key);\r\n\t\t\t\tif (ini_get('magic_quotes_gpc')) {\r\n \t\t $val = stripslashes($val);\r\n \t\t} \r\n \t\t$data[$key]=$val;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$registry = new JRegistry();\r\n\t\t$registry->loadArray($data);\r\n\t\t$language->params = $registry->toString();\r\n\r\n\t\t$language->store();\r\n\t\tJFactory::getApplication()->redirect(\"index.php?option=com_joomfish&task=languages.show\",JText::_( 'LANGUAGES_SAVED' ));\r\n\t}",
"protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }",
"private function _init() {\r\n $config = array(\r\n 'gettext_locale_dir' => $this->CI->config->item('gettext_locale_dir'),\r\n 'gettext_text_domain' => $this->CI->config->item('gettext_text_domain'),\r\n 'gettext_catalog_codeset' => $this->CI->config->item('gettext_catalog_codeset'),\r\n 'gettext_locale' => $this->CI->config->item('gettext_locale'),\r\n 'gettext_nocache' => $this->CI->config->item('gettext_nocache'),\r\n );\r\n \r\n if ($this->CI->config->item('language') != $this->CI->config->item('default_language') || config_item('default_iso') != config_item('lang')) {\r\n if ($this->CI->config->item('gettext_nocache')) {\r\n $this->_bind_gettext_nocache($config);\r\n } else {\r\n $this->_bind_gettext($config);\r\n }\r\n }\r\n // Gettext locale\r\n setlocale(LC_ALL, $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n putenv(\"LC_ALL=\" . $config['gettext_locale']);\r\n putenv('LANG=' . $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n putenv('LANGUAGE=' . $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n }",
"private function loadConfig()\n {\n $this->category->config = [];\n $this->loadMeta('admins', 'array');\n $this->loadMeta('members', 'array');\n $this->loadMeta('template');\n $this->loadMeta('category', 'array');\n //$this->loadMetaCategory();\n $this->loadInitScript();\n }",
"public function translateConfig(){\r\n\t\t$document = JFactory::getDocument();\r\n\r\n\t\t$viewType\t= $document->getType();\r\n\t\t$viewName\t= JRequest::getCmd( 'view', $this->getName() );\r\n\t\t$viewLayout\t= JRequest::getCmd( 'layout', 'translateconfig' );\r\n\t\t$lang_id = JRequest::getVar( 'lang_id', null, 'request', 'int' );\r\n\t\t\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\r\n\t\t// Set the layout\r\n\t\t$this->view->setLayout($viewLayout);\r\n\r\n\t\t// load the current config parameters from the language\r\n\t\t/*\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$this->view->setModel($model, true);\r\n\t\t$this->view->language = $model->getTable('JFLanguage');\t\t\r\n\t\t$this->view->language->load($lang_id);\r\n\r\n\t\tif (isset($this->view->language) && isset($this->view->language->params) ){\r\n\t\t\t$this->view->translations = new JRegistry( $this->view->language->params);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->view->translations = new JRegistry();\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t$this->view->translations = new JRegistry();\r\n\t\t$current = JRequest::getVar('current', '', 'request', 'string');\r\n\t\tif($current != null) {\r\n\t\t\t$this->view->translations = new JRegistry($current);\r\n\t\t}\r\n\t\t\r\n\r\n\t\t// Default Text handled 'manually'\r\n\t\t$config = JComponentHelper::getParams( 'com_joomfish' );\r\n\t\t$this->view->defaulttext = $config->getValue(\"defaultText\");\t\t\r\n\t\t$this->view->trans_defaulttext = $this->view->translations->get(\"defaulttext\",\"\");\r\n\t\t\r\n\t\t// Set the config detials for translation in the view\r\n\t\t$elementfolder =JPath::clean( JPATH_ADMINISTRATOR . '/components/com_joomfish/contentelements' );\r\n\t\tinclude($elementfolder.DS.\"language.config.php\");\r\n\t\t$this->view->jf_siteconfig=$jf_siteconfig;\r\n\r\n\t\t// Need to load com_config language strings!\r\n\t\t$lang = JFactory::getLanguage();\r\n\t\t$lang->load( 'com_config' );\r\n\r\n\t\t$jconf = new JConfig();\r\n\t\t$this->view->jconf = $jconf;\r\n\t\t\r\n\t\t$this->view->translateConfig();\r\n\t\t\r\n\t}",
"private function readKeywordsConfig(){\r\t\tif(empty($this->langService) || $this->langService->IsDefaultSelected()){\r\t\t\tif($this->CI->config->item(\"zt_site_keywords\")){\r\t\t\t\t$keywords = $this->CI->config->item(\"zt_site_keywords\");\r\t\t\t\t$this->head->AddKeywords($keywords);\r\t\t\t}\r\t\t} else {\r\t\t\tif($this->CI->config->item(\"zt_site_keywords_\" . $this->langService->GetLangCode())){\r\t\t\t\t$keywords = $this->CI->config->item(\"zt_site_keywords_\" . $this->langService->GetLangCode());\r\t\t\t\tif(empty($keywords)){\r\t\t\t\t\t$keywords = $this->CI->config->item(\"zt_site_keywords\");\r\t\t\t\t}\r\t\t\t\t$this->head->AddKeywords($keywords);\r\t\t\t}\r\t\t}\r\r\n\t}"
] |
[
"0.5971666",
"0.59684277",
"0.59624267",
"0.58107924",
"0.5737971",
"0.5709296",
"0.5692135",
"0.56334156",
"0.5570551",
"0.5466724",
"0.5458865",
"0.5419843",
"0.540301",
"0.538617",
"0.53855747",
"0.537613",
"0.5372202",
"0.533795",
"0.53343517",
"0.5325362",
"0.5294666",
"0.5276536",
"0.5251333",
"0.52474433",
"0.52373046",
"0.523104",
"0.52229214",
"0.52193254",
"0.5201563",
"0.520091"
] |
0.68076825
|
0
|
Inserts config entries for order_status_id, failed_order_status_id, processed_order_status_id, refunded_order_status_id, cancelled_order_status_id
|
private static function _addOrderConfigurationEntries()
{
global $db;
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Set Default Order Status',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'ORDER_STATUS_ID'
) . "',
'1', 'Set the default status of orders made with this payment module" .
" to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',
'zen_get_order_status_name', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Set Failed Order Status',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'FAILED_ORDER_STATUS_ID'
) . "',
'1', 'Set the status of failed orders made with this payment module to" .
" this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',
'zen_get_order_status_name', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Set Processed Order Status',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'PROCESSED_ORDER_STATUS_ID'
) . "',
'2', 'Set the status of processed orders made with this payment " .
"module to this value', '6', '0', 'emp_zfg_pull_down_order_statuses(',
'zen_get_order_status_name', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Set Refunded Order Status',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'REFUNDED_ORDER_STATUS_ID'
) . "',
'1', 'Set the status of refunded orders made with this payment module',
'6', '0', 'emp_zfg_pull_down_order_statuses(',
'zen_get_order_status_name', now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, use_function, date_added)
values
('Set Canceled Order Status',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'CANCELED_ORDER_STATUS_ID'
) . "',
'1', 'Set the status of canceled orders made with this payment module',
'6', '0', 'emp_zfg_pull_down_order_statuses(',
'zen_get_order_status_name', now())"
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private static function _addMainConfigurationEntries()\n {\n global $db;\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable emerchantpay Checkout Module',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('STATUS') . \"',\n 'true',\n 'Do you want to process payments via emerchantpay''s Genesis Gateway?',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Title',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'CHECKOUT_PAGE_TITLE'\n ) . \"',\n 'Pay safely with emerchantpay Checkout',\n 'This name will be displayed on the checkout page', '6', '4',\n 'emp_zfg_draw_input(null, ', now())\"\n );\n }",
"private static function _addCredentialsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Username',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('USERNAME') . \"',\n '', 'Enter your Username, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Genesis API Password',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('PASSWORD') . \"',\n '', 'Enter your Password, required for accessing the Genesis Gateway',\n '6', '4', 'emp_zfg_draw_input({$requiredOptionsAttributes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Live Mode',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('ENVIRONMENT') . \"',\n 'false', 'If disabled, transactions are going through our Staging \" .\n \"(Test) server, NO MONEY ARE BEING TRANSFERRED', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }",
"function after_process() {\r\n global $insert_id, $db;\r\n $sql = \"insert into \" . TABLE_ORDERS_STATUS_HISTORY . \" (comments, orders_id, orders_status_id, date_added) values (:orderComments, :orderID, :orderStatus, now() )\";\r\n $sql = $db->bindVars($sql, ':orderComments', 'eCheck payment. AUTH: ' . $this->auth_code . '. TransID: ' . $this->transaction_id . '.', 'string');\r\n $sql = $db->bindVars($sql, ':orderID', $insert_id, 'integer');\r\n $sql = $db->bindVars($sql, ':orderStatus', $this->order_status, 'integer');\r\n $db->Execute($sql);\r\n return false;\r\n }",
"public function add_order_history ($order_id, $status, $customer_notified = 0)\n\t{\n\t\ttep_db_query(\"\n\t\t\tINSERT INTO orders_status_history (orders_id, orders_status_id, comments, date_added, customer_notified)\n\t\t\tVALUES ('\" . tep_db_input($order_id) . \"', '\" . static::get_status_id($status) . \"', '\" . static::$STATUS_MESSAGES[$status] . \"', now(), \".($customer_notified >= 1 ? 1 : 0).\")\n\t\t\");\n\t}",
"private static function _addTransactionsConfigurationEntries()\n {\n global $db;\n\n $requiredOptionsAttributes = static::_getRequiredOptionsAttributes();\n $transaction_types\n = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getTransactionsList()\n );\n\n $placeholder = ['none' => 'No specific Bank in use'];\n $availableBankCodes\n = $placeholder + EmpCheckoutSettings::getAvailableBankCodes();\n $bank_codes\n = EMerchantPayCommon::buildSettingsDropDownOptions(\n $availableBankCodes\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Transaction Types',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'TRANSACTION_TYPES'\n ) . \"',\n '\" . \\Genesis\\API\\Constants\\Transaction\\Types::SALE . \"',\n 'What transaction type should we use upon purchase?', '6', '0',\n 'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, \" .\n \"{$transaction_types}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Bank codes for Online banking',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'BANK_CODES'\n ) . \"',\n 'none',\n 'Select Bank code(s) for Online banking transaction.', '6', '0',\n 'emp_zfg_select_drop_down_multiple({$requiredOptionsAttributes}, \" .\n \"{$bank_codes}, ', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Partial Capture',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_PARTIAL_CAPTURE'\n ) . \"',\n 'true', 'Use this option to allow / deny Partial Capture Transactions',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Partial Refund',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_PARTIAL_REFUND'\n ) . \"',\n 'true', 'Use this option to allow / deny Partial Refund Transactions',\n '6', '3', 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Cancel Transaction',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'ALLOW_VOID_TRANSACTIONS'\n ) . \"',\n 'true', 'Use this option to allow / deny Cancel Transactions', '6', '3',\n 'emp_zfg_draw_toggle(', 'emp_zfg_get_toggle_value', now())\"\n );\n }",
"public static function addOrderStatus(OrderStatus $orderStatus)\n {\n $orderstatus_add_query = \"INSERT INTO TiffinHouseDb.OrderStatus (itemId, orderId, ExpDate, currDate, isActive)\n VALUES (:itemId,:orderId,:expDate,:currDate,:isActive)\";\n try {\n self::$db->query($orderstatus_add_query);\n self::$db->bind(':itemId', $orderStatus->getItemId());\n self::$db->bind(':orderId', $orderStatus->getOrderId());\n self::$db->bind(':expDate', $orderStatus->getExpDate());\n self::$db->bind(':currDate', $orderStatus->getCurrDate());\n self::$db->bind(':isActive', $orderStatus->getIsActive());\n self::$db->execute();\n } catch (PDOException $err) {\n echo \"<script> console.log('Error : '\" . $err->getMessage() . \")<script>\";\n }\n }",
"protected function _setDefaultOrderStatuses() {\n $completedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('completed_order_status'));\n $failedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('cancelled_order_status'));\n $partialRefundedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('partial_refunded_order_status'));\n $refundedOrderStatusId = $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->getOrderStatusByName($this->language->get('refunded_order_status'));\n\n if ($completedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_completed_status_id', $completedOrderStatusId, $this->config->get('config_store_id'));\n }\n if ($failedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_failed_status_id', $failedOrderStatusId, $this->config->get('config_store_id'));\n }\n if ($partialRefundedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_partial_refunded_status_id', $partialRefundedOrderStatusId, $this->config->get('config_store_id'));\n }\n if ($refundedOrderStatusId) {\n $this->registry->get('model_extension_payment_' . $this->_getPaymentMethodCode())->addSettingValue('payment_'.$this->_getPaymentMethodCode(), 'payment_'.$this->_getPaymentMethodCode().'_order_refunded_status_id', $refundedOrderStatusId, $this->config->get('config_store_id'));\n }\n $this->cache->delete(\"order_status.\" . (int)$this->config->get('config_language_id'));\n }",
"public function log ($transaction_id, $status, $order_id)\n\t{\n\t\t// See if we should update an existing order or insert a new one.\n\t\t$query = tep_db_query(\"SELECT status FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE payment_id = '\" . tep_db_input($transaction_id) . \"' AND status = 'paid'\");\n\t\t$rows = tep_db_fetch_array($query);\n\n\t\tif ($rows > 0)\n\t\t{\n\t\t\ttep_db_query(\"UPDATE \" . self::DB_PAYMENTS_TABLE . \" SET status = '\" . tep_db_input($status) . \"' WHERE payment_id = '\" . tep_db_input($transaction_id) . \"' AND osc_order_id = '\" . tep_db_input($order_id) . \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttep_db_query(\"INSERT INTO \" . self::DB_PAYMENTS_TABLE . \" (payment_id, status, osc_order_id) VALUES('\" . tep_db_input($transaction_id) . \"', '\" . tep_db_input($status) . \"', '\" . tep_db_input($order_id) . \"')\");\n\t\t}\n\t}",
"function cb_wc_add_status( $wc_statuses_arr ) {\n\t$new_statuses_arr = array();\n\n\t// Add new order status after payment pending.\n\tforeach ( $wc_statuses_arr as $id => $label ) {\n\t\t$new_statuses_arr[ $id ] = $label;\n\n\t\tif ( 'wc-pending' === $id ) { // after \"Payment Pending\" status.\n\t\t\t$new_statuses_arr['wc-blockchainpending'] = __( 'Blockchain Pending', 'coinbase' );\n\t\t}\n\t}\n\n\treturn $new_statuses_arr;\n}",
"function fn_order_status_history_change_order_status($status_to, $status_from, $order_info, $force_notification, $order_statuses, $place_order) {\n\n db_query(\"INSERT INTO ?:order_status_history values (\". $order_info['order_id'] . \",\". Tygh::$app['session']['auth']['user_id'] . \", '\".$status_to.\"' , '\".$status_from.\"', \" . time() .\")\");\n\n return true;\n}",
"function ostAddOrderStatus($name, $sort_order, $color, $bold, $italic){\r\n\r\n\t$name_inj = LanguagesManager::sql_prepareFieldInsert('status_name', $name);\r\n\tdb_phquery(\"INSERT ?#ORDER_STATUSES_TABLE ({$name_inj['fields']}, sort_order, color, bold, italic) VALUES({$name_inj['values']},?,?,?,?)\", $sort_order, $color, $bold, $italic);\r\n\treturn db_insert_id();\r\n}",
"function wisync_order_complete( $order_id, $status ) {\n\n\tglobal $wpdb;\n\t// Set the table name we're using\n\t$table_name = $wpdb->prefix . 'wisync';\n\n\t// Get the order using the order_id\n\t$order = new WC_Order( $order_id );\n\n\t// Get the order data out of the object as an associative array\n\t$order_data = $order->get_data();\n\n\t// Make an array to store the order data we need for i.LEVEL\n\t$order_array = array();\n\n\t// Set the Customer_id (Customer id)\n\t$order_array['Customer_id'] = $order->get_customer_id();\n\t// Set the Warehouse_id (Warehouse id indicates the warehouse from which the stock for the order should be taken. Default 0 for main warehouse. Use multiplewarehouse resource (if active on your system) for details of available warehouses.)\n\t$order_array['Warehouse_id'] = 0;\n\t// Set the Order_Ref (Order reference can be passed in. If passed it will be used with the Order_Source to check uniqueness)\n\t$order_array['Order_Ref'] = $order_data['order_key'];\n\t// Set the Order_source (Order source)\n\t// $order_array['Order_Source'] = get_site_url();\n\t$order_array['Order_Source'] = 'WooCommerce';\n\t// Set the Order_Date (Creation date of the order)\n\t// $order_array['Order_Date'] = $order->get_date_completed()->format('Y-m-d H:i:s');\n\t$order_array['Order_Date'] = $order->get_date_completed();\n\t// Set the Marketplace_Status (Web/marketplace order status)\n\t$order_array['Marketplace_Status'] = $order->get_status();\n\t// Set the Name (Delivery customer name)\n\t$order_array['Name'] = $order->get_shipping_first_name() .' '. $order->get_shipping_last_name();\n\t// Set the Address1 (Delivery address line 1)\n\t$order_array['Address1'] = $order->get_shipping_address_1();\n\t// Set the Address2 (Delivery address line 2)\n\t$order_array['Address2'] = $order->get_shipping_address_2();\n\t// Set the Town (Delivery address line 3)\n\t$order_array['Town'] = $order->get_shipping_city();\n\t// Set the County (Delivery address line 4)\n\t$order_array['County'] = $order->get_shipping_state();\n\t// Set the Postcode (Delivery postcode)\n\t$order_array['Postcode'] = $order->get_shipping_postcode();\n\t// Set the Gross (Total order value including Taxes and delivery)\n\t$order_array['Gross'] = floatval( $order->get_subtotal() );\n\t// $order_array['Gross'] = floatval( $order->get_total() - $order->get_shipping_total() );\n\t// Set the VAT (Total VAT value for the order)\n\t$order_array['VAT'] = floatval( $order->get_total_tax() );\n\t// Set the VAT_Code (VAT code)\n\t$order_array['VAT_Code'] = $order->get_taxes();\n\t// Set the currency (Order currency code)\n\t$order_array['Currency'] = $order->get_currency();\n\t// Set the Country (Delivery address country code)\n\t$order_array['Country_Code'] = $order->get_shipping_country();\n\n\t/*---------------------*/\n\t/*-- Handle Customer --*/\n\t/*---------------------*/\n\n\t// Get the customer's billing details in the order\n\t$order_array['RetailCustomer']['Forename'] = $order->get_billing_first_name();\n\t$order_array['RetailCustomer']['Surname'] = $order->get_billing_last_name();\n\t$order_array['RetailCustomer']['Company_Name'] = $order->get_billing_company();\n\t$order_array['RetailCustomer']['Address1'] = $order->get_billing_address_1();\n\t$order_array['RetailCustomer']['Address2'] = $order->get_billing_address_2();\n\t$order_array['RetailCustomer']['Town'] = $order->get_billing_city();\n\t$order_array['RetailCustomer']['County'] = $order->get_billing_state();\n\t$order_array['RetailCustomer']['Country_Code'] = $order->get_billing_country();\n\t$order_array['RetailCustomer']['Postcode'] = $order->get_billing_postcode();\n\t$order_array['RetailCustomer']['Telephone'] = $order->get_billing_phone();\n\t$order_array['RetailCustomer']['Email'] = $order->get_billing_email();\n\t$order_array['RetailCustomer']['Comments'] = $order->get_customer_note();\n\t$order_array['RetailCustomer']['Accounts_Ref'] = $order->get_transaction_id();\n\n\t/*------------------*/\n\t/*-- Handle Items --*/\n\t/*------------------*/\n\n\t// Make an array to store order items\n\t$items_array = array();\n\n\t// Get the items in the order\n\t$items = $order->get_items();\n\n\tforeach ( $items as $item ) {\n\n\t\t// Pass the item to be converted into a JSON object\n\t\t$item_json = build_array_of_ordered_items( $item );\n\n\t\t// Push the json object to the items_array\n\t\tarray_push( $items_array, $item_json);\n\n\t}\n\n\t// Add the items array to the order array\n\t$order_array['Items'] = $items_array;\n\n\t// JSON encode the order_array\n\t$order_json = json_encode($order_array);\n\n\t// Query the database to get API login details\n\t$login = $wpdb->get_row( \"SELECT * FROM $table_name WHERE id = 1\", ARRAY_A );\n\n\t$order_upload = post_order( $login, $order_json );\n\n\tif ( $order_upload ) {\n\n\t\twisync_admin_notice__success( 'Order recorded at i.LEVEL' );\n\n\t}\n\n}",
"public function run()\n {\n DB::table('orders')->insert([\n [\n 'code' => 'O0001',\n 'customer_id' => '2',\n 'name' => 'Nguyen Van B',\n 'address' => '123 aaa Ho Chi Minh',\n 'phone' => '123456789',\n 'email' => '[email protected]',\n 'order_status' => '1',\n 'payment_status' => '5',\n 'shipping_status' => '7',\n 'note' => null,\n ],\n [\n 'code' => 'O0002',\n 'customer_id' => '2',\n 'name' => 'Nguyen Van B',\n 'address' => '123 aaa Ho Chi Minh',\n 'phone' => '123456789',\n 'email' => '[email protected]',\n 'order_status' => '1',\n 'payment_status' => '4',\n 'shipping_status' => '6',\n 'note' => null,\n ],\n [\n 'code' => 'O0003',\n 'customer_id' => '3',\n 'name' => 'Nguyen Van C',\n 'address' => '123 aaa Ho Chi Minh',\n 'phone' => '123456789',\n 'email' => '[email protected]',\n 'order_status' => '1',\n 'payment_status' => '5',\n 'shipping_status' => '6',\n 'note' => null,\n ],\n [\n 'code' => 'O0004',\n 'customer_id' => '3',\n 'name' => 'Nguyen Van C',\n 'address' => '123 aaa Ho Chi Minh',\n 'phone' => '123456789',\n 'email' => '[email protected]',\n 'order_status' => '2',\n 'payment_status' => null,\n 'shipping_status' => null,\n 'note' => 'Internet Problem',\n ],\n [\n 'code' => 'O0005',\n 'customer_id' => '3',\n 'name' => 'Nguyen Van C',\n 'address' => '123 aaa Ho Chi Minh',\n 'phone' => '123456789',\n 'email' => '[email protected]',\n 'order_status' => '3',\n 'payment_status' => null,\n 'shipping_status' => null,\n 'note' => 'Duplicate Order O0003',\n ],\n [\n 'code' => 'O0006',\n 'customer_id' => null,\n 'name' => 'Nguyen Van D',\n 'address' => '1234 aaa Ho Chi Minh',\n 'phone' => '1223456789',\n 'email' => '[email protected]',\n 'order_status' => '1',\n 'payment_status' => '5',\n 'shipping_status' => '7',\n 'note' => 'Guest',\n ],\n ]);\n }",
"private function createPaymentStatus()\n {\n $this->deletePaymentStatus();\n $sql = \"INSERT INTO s_core_states (id, name, description, position, mail,`group`) VALUES\n (1750,'in_review','In Review',1750,1,'payment'),\n (1751,'pre_authorization_of_payment','Pre-Authorization of Payment',1751,1,'payment'),\n (1752,'payment_accepted','Payment Accepted',1752,1,'payment'),\n (1753,'refund','Refund',1753,1,'payment')\";\n Shopware()->Db()->query($sql);\n $sql = \"INSERT INTO s_core_snippets (namespace, shopID, localeID, name, value) VALUES\n ('backend/static/payment_status', 1, 1, 'in_review', 'In Review'),\n ('backend/static/payment_status', 1, 2, 'in_review', 'In Review'),\n ('backend/static/payment_status', 1, 1, 'pre_authorization_of_payment', 'Pre-Authorization of Payment'),\n ('backend/static/payment_status', 1, 2, 'pre_authorization_of_payment', 'Pre-Authorization of Payment'),\n ('backend/static/payment_status', 1, 1, 'payment_accepted', 'Payment Accepted'),\n ('backend/static/payment_status', 1, 2, 'payment_accepted', 'Payment Accepted'),\n ('backend/static/payment_status', 1, 1, 'refund', 'Refund'),\n ('backend/static/payment_status', 1, 2, 'refund', 'Refund')\";\n Shopware()->Db()->query($sql);\n }",
"protected function _updateAuthorizedOrders()\n {\n $aProcessed = $this->_processOrderStates(\n \"SELECT OXID, OXORDERNR FROM oxorder\n WHERE BESTITAMAZONORDERREFERENCEID != ''\n AND BESTITAMAZONAUTHORIZATIONID != ''\n AND OXTRANSSTATUS = 'AMZ-Authorize-Pending'\",\n 'getAuthorizationDetails'\n );\n\n $this->_oLogger->info(\n 'Fetched orders and processed',\n array('orderNumbers' => array_keys($aProcessed))\n );\n\n foreach ($aProcessed as $sOrderNumber => $oData) {\n if (isset($oData->GetAuthorizationDetailsResult->AuthorizationDetails->AuthorizationStatus->State)) {\n $sState = $oData->GetAuthorizationDetailsResult\n ->AuthorizationDetails\n ->AuthorizationStatus->State;\n $this->_addToMessages(\"Authorized Order #{$sOrderNumber} - Status updated to: {$sState}<br/>\");\n }\n }\n }",
"public function createOrderStatusesAction()\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$ostatuses = $em->getRepository('UekStoreBundle:OrderStatus')->findAll();\n\t\tif (count($ostatuses) == 0)\n\t\t{\n\t\t\t$status_list = [\n\t\t\t\t\t['id' => OrderStatus::IN_PROGRESS, 'name' => 'In progress'],\n\t\t\t\t\t['id' => OrderStatus::PAID, 'name' => 'Paid']\t];\n\t\t\t\n\t\t\tforeach ($status_list as $status)\n\t\t\t{\n\t\t\t\t$ostatus = new OrderStatus();\n\t\t\t\t$ostatus->setId($status['id']);\n\t\t\t\t$ostatus->setName($status['name']);\n\t\t\t\t$em->persist($ostatus);\n\t\t\t}\n\t\t\t\n\t\t\t$em->flush();\n\t\t}\n\t\t\n\t\treturn $this->redirect($this->generateUrl('uek_homepage'));\n\t}",
"public function add_valid_order_statuses( $statuses, $order ) {\n\t\t$payment_method = $order->get_payment_method();\n\t\tif ( in_array( $payment_method, WC_Swedbank_Plugin::PAYMENT_METHODS, true ) ) {\n\t\t\t$statuses = array_merge(\n\t\t\t\t$statuses,\n\t\t\t\tarray(\n\t\t\t\t\t'processing',\n\t\t\t\t\t'completed',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn $statuses;\n\t}",
"public function run()\n {\n $defaultStatus = ['處理中', '已確認', '已完成', '已取消'];\n foreach ($defaultStatus as $status) {\n OrderStatus::create([\n 'name' => $status\n ]);\n }\n }",
"protected function addToOrdersTables($nextpay, $status, $trans_id, $order_id)\n {\n $order = Order::create([\n 'user_id' => auth()->user()->id ?? null,\n 'gateway' => config('payment.gateway', 'digijoo'),\n 'status' => $nextpay->verify_request(),\n 'trans_id' => $trans_id,\n 'card_number' => $order_id,\n 'ip' => \\request()->ip(),\n 'payment_date' => now(),\n 'price' => getNumbers()->get('newSubtotal'),\n 'discount' => getNumbers()->get('discount'),\n 'discount_code' => getNumbers()->get('code'),\n 'tax' => getNumbers()->get('newTax'),\n 'total' => getNumbers()->get('newTotal'),\n 'error' => $status,\n ]);\n\n // Insert into order_product table\n foreach (Cart::content() as $item) {\n OrderProduct::create([\n 'order_id' => $order->id,\n 'product_id' => $item->model->id,\n 'quantity' => $item->qty,\n ]);\n }\n\n return $order;\n }",
"public function update(ScannerRequest $request){\n $request['trackingNumber'] = explode(\",\", $request->trackingNumber);\n $orders = Order::whereIn('tracking_number',$request->trackingNumber)->get();\n if(count($orders) == 0){\n Session::flash('error', \"Invalid Tracking number/s no orders found\");\n goto end;\n }\n $count = 0;\n try {\n DB::beginTransaction();\n foreach ($orders as $order){\n if($request->status == 'Received'){\n /*\n * only change the status to received\n * log the status\n * connect the agent with the order\n * connect the office with the order\n */\n $this->registerStatus($request,$order,'---','---');\n $order->status = $request->status;\n $order->agent_id = auth()->user()->id;\n $order->office_id = auth()->user()->office->id;\n $order->save();\n }\n elseif($request->status == 'Incorrect Phone'){\n /*\n * only change the status to received\n * log the status\n * connect the agent with the order\n * connect the office with the order\n */\n $this->registerStatus($request,$order,'Waiting for updated phone','Waiting for updated phone');\n $order->status = $request->status;\n $order->agent_id = auth()->user()->id;\n $order->office_id = auth()->user()->office->id;\n $order->save();\n }\n elseif($request->status == 'Incorrect Address'){\n /*\n * only change the status to received\n * log the status\n * connect the agent with the order\n * connect the office with the order\n */\n $this->registerStatus($request,$order,'Waiting for updated Address','Waiting for updated Address');\n $order->status = $request->status;\n $order->agent_id = auth()->user()->id;\n $order->office_id = auth()->user()->office->id;\n $order->save();\n }\n elseif($request->status == 'Out for delivery'){\n $agent = Agent::select('id','name')->where('type','=','Delivery Agent')->where('id',$request->delivery_id)->first();\n $this->registerStatus(\n $request,\n $order,\n 'With Agent '.$agent->name,\n 'Agent will deliver you the order soon'\n );\n $order->status = $request->status;\n $order->agent_id = auth()->user()->id;\n $order->office_id = auth()->user()->office->id;\n $order->delivery_agent_id = $agent->id;\n $order->save();\n }\n elseif($request->status == 'Transfer To'){\n /*\n * find the office\n * register the new status\n * change the status\n */\n $office = Office::select('name')->where('id',$request->office_id)->first();\n $this->registerStatus(\n $request,\n $order,\n 'From '.auth()->user()->office->name.' to '.$office->name,\n 'From '.auth()->user()->office->name.' to '.$office->name\n );\n $order->status = $request->status;\n $order->agent_id = auth()->user()->id;\n $order->office_id = auth()->user()->office->id;\n $order->save();\n }\n elseif($request->status == 'Back to shipper'){\n $agent = Agent::select('id','name')->where('type','=','Pickup Agent')->where('id',$request->pickup_id)->first();\n $this->registerStatus(\n $request,\n $order,\n 'By Agent '.$agent->name,\n 'Agent will deliver you the order soon'\n );\n $order->status = $request->status;\n $order->agent_id = auth()->user()->id;\n $order->office_id = auth()->user()->office->id;\n $order->pickup_agent_id = $agent->id;\n $order->save();\n }\n $count++;\n }\n }catch (\\Exception $e) {\n Session::flash('error', \"Sorry, failed to update orders status please try again!\");\n DB::rollBack();\n goto end;\n }\n DB::commit();\n Session::flash('success', $count.\" Orders Status Updated Successfully\");\n end:\n return redirect()->back();\n\n }",
"public function submitOrder(){\n try {\n $query = \"INSERT INTO `order`\n (`CustomerID`, `Date`, `Status`,`Total`) \n VALUES (?,?,'Pending',?)\"; // Create the query\n $query = $this->stmt->prepare($query);\n $date = date('Y-m-d H:i:s');\n $query->bind_param(\"ssd\",$this->customerId, $date, $this->total);\n $query->execute();\n $orderId = $query->insert_id;\n if($orderId){\n $this->orderId = $orderId; // Set the orderId property\n $this->insertItems();\n }\n $query->close();\n return $this->orderId;\n } catch (Exception $th) {\n exit($th->getMessage());\n }\n }",
"public function wc_new_order( $order_id ) {\n\n\t\tadd_post_meta( $order_id, 'decred_amount', WC()->session->get( 'decred_amount' ) );\n\n\t\tadd_post_meta( $order_id, 'decred_refund_address', WC()->session->get( 'decred_refund_address' ) );\n\n\t\tadd_post_meta( $order_id, 'decred_payment_address', $this->get_payment_address( $order_id ) );\n\n\t\tif ( ! wp_next_scheduled( 'decred_order_status_updater' ) ) {\n\t\t\twp_schedule_event( time(), 'decred_schedule', 'decred_order_status_updater' );\n\t\t}\n\n\t}",
"public function add_order($order_status_id, $order_number, $order_date, $receipt_number)\n\t{\n\t\t//$order_number = $this->create_order_number();\n\t\t\n\t\t$data = array(\n\t\t\t\t'order_date'=>date('Y-m-d', $order_date),\n\t\t\t\t'order_number'=>$order_number,\n\t\t\t\t'receipt_number'=>$receipt_number,\n\t\t\t\t'customer_id'=>$this->session->userdata('customer_id'),\n\t\t\t\t'order_status_id'=>$order_status_id,\n\t\t\t\t'order_created'=>date('Y-m-d H:i:s')\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('orders', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function insert_receive_order($received_order_info, $order_id) \n {\n \n $log = new Log('po-' . date('Y-m-d') . '.log');\n $user_id = $received_order_info['order_by_user_id'];\n $this->load->model('user/user');\n $this->load->model('setting/store');\n $orderby=$this->model_user_user->getUser($received_order_info['order_by_user_id']);\n \n $store_mobile = $orderby['username'];\n $otp = rand(1000, 9999);\n \n $updatedata=array(\n 'order_sup_send'=>new MongoDate(strtotime($received_order_info['order_receive_date'])),\n 'receive_bit'=>(int)0,\n 'status'=>(int)2,\n 'pending_bit'=>(int)0,\n 'approved_by'=>(int)$received_order_info['approved_by'],\n 'pre_supplier_bit'=>(int)1,\n 'driver_otp'=>(int)$otp,\n 'driver_mobile'=>(int)$store_mobile,\n 'po_product.received_products'=>(int)0,\n 'po_product.supplier_quantity'=>(int)$received_order_info['supplier_quantity'],\n 'po_receive_details.supplier_id'=>(int)$received_order_info['supplier_id'],\n 'po_receive_details.supplier_quantity'=>(int)$received_order_info['supplier_quantity']\n );\n $this->db->query('update','oc_po_order',array('id'=>(int)$order_id),$updatedata);\n \n $log->write($updatedata);\n $updatedata2=array(\n 'supplier_id'=>(int)$received_order_info['supplier_id'],\n 'supplier_quantity'=>(int)$received_order_info['supplier_quantity']\n );\n $this->db->query('update','oc_po_receive_details',array('order_id'=>(int)$order_id),$updatedata2);\n \n $updatedata3=array('received_products'=>(int)0);\n $this->db->query('update','oc_po_product',array('order_id'=>(int)$order_id),$updatedata3);\n \n $this->load->library('trans');\n $trans = new trans($this->registry);\n\n $filter_data = array(\n 'user_id' => $user_id,\n 'order_id' => $order_id,\n 'store_mobile' => $store_mobile,\n 'otp' => $otp\n );\n\n $this->load->library('sms');\n $sms = new sms($this->registry);\n $sms->sendsms($store_mobile, \"35\", $filter_data);\n return $otp;\n }",
"public function update_order_status(){\n if (!$this->input->is_ajax_request()) {\n exit('No direct script access allowed');\n } else {\n $order_id = $this->input->post('order_id');\n $order_dtls_id = $this->input->post('order_dtls_id');\n $order_status = $this->input->post('order_status');\n \n if($order_id && $order_dtls_id && $order_status){\n $status_update = $this->cm->update('user_order_details', ['order_id'=> $order_id, 'id'=> $order_dtls_id], [\n 'status' => $order_status\n ]);\n if($status_update){\n $this->cm->insert('user_order_logs', [\n 'order_id' => $order_id,\n 'order_details_id' => $order_dtls_id,\n 'status' => $order_status\n ]);\n \n /*\n SELECT o.order_no,p.name,ps.name size,pc.name color,od.quantity,od.sell_price,od.discount_percentage,od.discount_price,od.remarks,od.status\n FROM user_order_details od\n join user_orders o on od.order_id = o.id\n join products p on od.product_id = p.id\n join product_variations pv on p.id = pv.product_id\n join product_sizes ps on pv.size_id = ps.id\n join product_colors pc on pv.color_id = pc.id\n WHERE od.id = 1 and od.order_id = 1\n */\n /*\n Order details\n */\n $oJoin[] = ['table' => 'user_orders o', 'on' => 'od.order_id = o.id', 'type' => 'inner'];\n $oJoin[] = ['table' => 'products p', 'on' => 'od.product_id = p.id', 'type' => 'inner'];\n $oJoin[] = ['table' => 'product_variations pv', 'on' => 'p.id = pv.product_id', 'type' => 'inner'];\n $oJoin[] = ['table' => 'product_sizes ps', 'on' => 'pv.size_id = ps.id', 'type' => 'inner'];\n $oJoin[] = ['table' => 'product_colors pc', 'on' => 'pv.color_id = pc.id', 'type' => 'inner'];\n $oJoin[] = ['table' => 'users u', 'on' => 'o.user_id = u.id', 'type' => 'inner'];\n $order_details = $this->cm->select_row('user_order_details od', ['od.id'=> $order_dtls_id, 'od.order_id'=> $order_id], 'o.order_no,p.name,ps.name size,pc.name color,od.quantity,od.sell_price,od.discount_percentage,od.discount_price,od.status,u.name user_name,u.email user_email', $oJoin);\n //Order status dropdown option\n $order_status_option = '<option value=\"\">Update status</option>';\n if($order_status == 1){\n //order confirm mail sent to user\n if($order_details){\n if($order_details['discount_percentage'] > 0){ \n $discount_price = $order_details['sell_price']- (($order_details['sell_price'] * $order_details['discount_percentage']) / 100); \n } else {\n $discount_price = $order_details['sell_price'];\n }\n \n $mail_subject = 'Your order for '.$order_details['name'].' has been successfully receive';\n $message = '<p>Hi <b>'.$order_details['user_name'].'</b></p>';\n $message .= \"<p>Your order has been successfully receive</p>\";\n $message .= \"<p></p><p>Order ID: <b>\".$order_details['order_no'].\"</b></p>\";\n $message .= \"<p></p><p>Item: \".$order_details['name'].\"</p>\"; \n $message .= \"<p>Size: \".$order_details['size'].\"</p>\"; \n $message .= \"<p>Color: \".$order_details['color'].\"</p>\"; \n $message .= \"<p>Qty: \".$order_details['quantity'].\"</p>\"; \n $message .= \"<p>Amount payable on delivery: <b>£\".number_format($discount_price, 2).\"</b></p>\"; \n $message .= \"<p></p><p>Thank you for shopping with Shorolafashion</p>\"; \n $this->cm->send_email($order_details['user_email'], siteSettingsData()['site_sender_email'],'','', $mail_subject, $message,'','','');\n } \n //dropdown option\n $order_status_option .= '<option value=\"2\">Out for delivery</option>';\n $order_status_option .= '<option value=\"4\">Order Cancel</option>';\n }elseif($order_status == 2){\n //order out for delivery mail sent to user\n if($order_details){\n if($order_details['discount_percentage'] > 0){ \n $discount_price = $order_details['sell_price']- (($order_details['sell_price'] * $order_details['discount_percentage']) / 100); \n } else {\n $discount_price = $order_details['sell_price'];\n }\n \n $mail_subject = 'Out for Delivery '.$order_details['name'].' with Order ID '.$order_details['order_no'];\n $message = '<p>Hi <b>'.$order_details['user_name'].'</b></p>';\n $message .= \"<p></p><p>Item: \".$order_details['name'].\"</p>\"; \n $message .= \"<p>Size: \".$order_details['size'].\"</p>\"; \n $message .= \"<p>Color: \".$order_details['color'].\"</p>\"; \n $message .= \"<p>Qty: \".$order_details['quantity'].\"</p>\"; \n $message .= \"<p>Amount payable on delivery: <b>£\".number_format($discount_price, 2).\"</b></p>\"; \n $this->cm->send_email($order_details['user_email'], siteSettingsData()['site_sender_email'],'','', $mail_subject, $message,'','','');\n } \n //dropdown option\n $order_status_option .= '<option value=\"3\">Order Delivered</option>';\n $order_status_option .= '<option value=\"4\">Order Cancel</option>';\n } elseif($order_status == 3){\n //order delivered mail sent to user\n if($order_details){\n if($order_details['discount_percentage'] > 0){ \n $discount_price = $order_details['sell_price']- (($order_details['sell_price'] * $order_details['discount_percentage']) / 100); \n } else {\n $discount_price = $order_details['sell_price'];\n }\n \n $mail_subject = 'Delivered '.$order_details['name'].' with Order ID '.$order_details['order_no'];\n $message = '<p>Hi <b>'.$order_details['user_name'].'</b></p>';\n $message .= \"<p></p><p>Item: \".$order_details['name'].\"</p>\"; \n $message .= \"<p>Size: \".$order_details['size'].\"</p>\"; \n $message .= \"<p>Color: \".$order_details['color'].\"</p>\"; \n $this->cm->send_email($order_details['user_email'], siteSettingsData()['site_sender_email'],'','', $mail_subject, $message,'','','');\n } \n //dropdown option\n $order_status_option .= '<option value=\"7\">Closed</option>';\n } elseif($order_status == 6){\n $order_status_option .= '<option value=\"7\">Closed</option>';\n }\n \n echo json_encode(['success'=> true, 'message'=> 'Successfully Change Order Status', 'html'=> $order_status_option]);\n }\n }\n }\n }",
"public function run()\n {\n DB::table('order_statuses')->insert([[\n \"name\" => \"unpaid_and_unconfirmed\",\n ],[\n \"name\" => \"paid_and_unconfirmed\",\n ],[\n \"name\" => \"unpaid_and_confirmed\",\n ],[\n \"name\" => \"paid_and_confirmed\",\n ],[\n \"name\" => \"out_for_delivery\",\n ],[\n \"name\" => \"delivered\",\n ],[\n \"name\" => \"cancelled\",\n ],[\n \"name\" => \"refunded\",\n ]]);\n }",
"private static function _addWpfConfigurationEntries()\n {\n global $db;\n\n $sortOrderAttributes = \"array(''maxlength'' => ''3'')\";\n $languages = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getAvailableCheckoutLanguages()\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Checkout Page Language',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('LANGUAGE') . \"',\n 'en', 'What language (localization) should we have on the Checkout?.',\n '6', '0', 'emp_zfg_select_drop_down_single({$languages},', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('WPF Tokenization',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'WPF_TOKENIZATION'\n ) . \"',\n 'false', 'Enable WPF Tokenization', '6', '3', 'emp_zfg_draw_toggle(',\n 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('Sort order of display.',\n '\" . EmpCheckoutSettings::getCompleteSettingKey('SORT_ORDER') . \"',\n '0', 'Sort order of display. Lowest is displayed first.', '6', '0',\n 'emp_zfg_draw_number_input({$sortOrderAttributes}, ', now())\"\n );\n }",
"public static function insert_new_commission( $orders = array() )\n\t{\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $orders ) ) return false;\n\n\t\t$table = $wpdb->prefix . \"pv_commission\";\n\n\t\t// Insert the time and default status 'due'\n\t\tforeach ( $orders as $key => $order ) {\n\t\t\t$orders[ $key ][ 'time' ] = $order['time'];\n\t\t\t$orders[ $key ][ 'status' ] = ( $order['total_due'] == 0 ) ? 'paid' : 'due';\n\t\t}\n\n\t\tforeach ( $orders as $key => $order ) {\n\t\t\t$where = array(\n\t\t\t\t'order_id' => $order[ 'order_id' ],\n\t\t\t\t'product_id' => $order[ 'product_id' ],\n\t\t\t\t'vendor_id' => $order[ 'vendor_id' ],\n\t\t\t\t'qty' => $order[ 'qty' ],\n\t\t\t);\n\t\t\t// Is the commission already paid? \n\t\t\t$count = TGS_Commission::check_commission_status( $order, 'paid' ); \n\n\t\t\tif ( $count == 0 ) { \n\t\t\t\t$update = $wpdb->update( $table, $order, $where );\n\t\t\t\tif ( !$update ) $insert = $wpdb->insert( $table, $order );\n\t\t\t}\n\n\t\t}\n\n\t\tdo_action( 'tgs_commissions_inserted', $orders );\n\t}",
"public function updateOrderStatus($orders = 0, $order_id = 0, $order_status = 0)\n {\n $total = 1;\n if (empty($orders)) {\n $orders = array();\n\n $orderslist = vRequest::getVar('orders', array());\n $total = 0;\n // Get the list of orders in post to update\n foreach ($orderslist as $key => $order) {\n if ($orderslist[$key]['order_status'] !== $orderslist[$key]['current_order_status']) {\n $orders[$key] = $orderslist[$key];\n $total++;\n }\n }\n }\n\n if (!is_array($orders)) {\n $orders = array($orders);\n }\n\n /* Process the orders to update */\n $updated = 0;\n $error = 0;\n if ($orders) {\n // $notify = vRequest::getVar('customer_notified', array()); // ???\n // $comments = vRequest::getVar('comments', array()); // ???\n foreach ($orders as $virtuemart_order_id => $order) {\n if ($order_id > 0) $virtuemart_order_id = $order_id;\n $this->useDefaultEmailOrderStatus = false;\n if ($this->updateStatusForOneOrder($virtuemart_order_id, $order, true)) {\n $updated++;\n } else {\n $error++;\n }\n }\n }\n $result = array('updated' => $updated, 'error' => $error, 'total' => $total);\n return $result;\n }",
"protected static function addOrderProcessing($orderId, $statusName)\n\t{\n\t\t$allowStatuses = Config\\Option::get(\"sale\", \"p2p_status_list\", \"\");\n\t\t$allowCollecting = Config\\Option::get(\"sale\", \"p2p_allow_collect_data\");\n\t\tif ($allowStatuses != '')\n\t\t\t$allowStatuses = unserialize($allowStatuses, ['allowed_classes' => false]);\n\t\telse\n\t\t\t$allowStatuses = array();\n\n\t\tif ($allowCollecting == \"Y\" && !empty($allowStatuses) && is_array($allowStatuses) && in_array($statusName, $allowStatuses))\n\t\t{\n\t\t\t$orderInformation = Sale\\OrderProcessingTable::getList(\n\t\t\t\tarray(\n\t\t\t\t\t\"filter\" => array(\"ORDER_ID\" => (int)$orderId),\n\t\t\t\t\t\"limit\" => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$result = $orderInformation->fetch();\n\t\t\tif (!$result)\n\t\t\t\tSale\\OrderProcessingTable::add(array(\"ORDER_ID\" => (int)$orderId));\n\t\t}\n\t}"
] |
[
"0.60852534",
"0.58835953",
"0.5790473",
"0.5764193",
"0.5697433",
"0.5629259",
"0.54216975",
"0.5367605",
"0.5322644",
"0.5310043",
"0.52481705",
"0.51725143",
"0.51683676",
"0.5168082",
"0.51510036",
"0.51454395",
"0.5096997",
"0.50779575",
"0.5034748",
"0.5031383",
"0.50312364",
"0.5026678",
"0.5015305",
"0.49767277",
"0.49487057",
"0.4936442",
"0.49334767",
"0.49172407",
"0.49137956",
"0.49099886"
] |
0.7781346
|
0
|
Insert SCA excemption options into DB
|
private static function _addScaExemptionOptions()
{
global $db;
$scaExemptionOptions = EMerchantPayCommon::buildSettingsDropDownOptions(
[
ScaExemptions::EXEMPTION_LOW_RISK => 'Low risk',
ScaExemptions::EXEMPTION_LOW_VALUE => 'Low value',
]
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('SCA Exemption',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'SCA_EXEMPTION'
) . "', '" . ScaExemptions::EXEMPTION_LOW_RISK . "',
'Exemption for the Strong Customer Authentication.',
'6', '5', 'emp_zfg_select_drop_down_single({$scaExemptionOptions},',
now())"
);
$db->Execute(
'insert into ' . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order,
set_function, date_added)
values
('Exemption Amount',
'" . EmpCheckoutSettings::getCompleteSettingKey(
'SCA_EXEMPTION_AMOUNT'
) . "',
'100', 'Exemption Amount determinate if the SCA Exemption should
be included in the request to the Gateway.',
'6', '6', 'emp_zfg_draw_input(null, ', now())"
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function insert($sid,$options)\r\n\t{\t\t\r\n\t\t$data=array();\r\n\t\t//$data['created']=date(\"U\");\r\n\t\t//$data['changed']=date(\"U\");\r\n\t\t\r\n\t\tforeach($options as $key=>$value)\r\n\t\t{\r\n\t\t\tif (in_array($key,$this->db_fields) )\r\n\t\t\t{\r\n\t\t\t\t$data[$key]=$value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$data['sid']=$sid;\r\n\t\t\r\n\t\t$result=$this->db->insert('data_files', $data);\r\n\r\n\t\tif ($result===false)\r\n\t\t{\r\n\t\t\tthrow new MY_Exception($this->db->_error_message());\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->db->insert_id();\r\n\t}",
"function insert()\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n if (function_exists('apc_clear_cache')) {\r\n apc_clear_cache('user');\r\n }\r\n\r\n if (@$_POST[\"sek_simple_used\"]) {\r\n $sek_simple_used = 'TRUE';\r\n } else {\r\n $sek_simple_used = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_bulkchange\"]) {\r\n $sek_bulkchange = 'TRUE';\r\n } else {\r\n $sek_bulkchange = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_adv_visible\"]) {\r\n $sek_adv_visible = 'TRUE';\r\n } else {\r\n $sek_adv_visible = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_myfez_visible\"]) {\r\n $sek_myfez_visible = 'TRUE';\r\n } else {\r\n $sek_myfez_visible = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_faceting\"]) {\r\n $sek_faceting = 'TRUE';\r\n } else {\r\n $sek_faceting = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_cardinality\"] == '1') {\r\n $sek_cardinality = 'TRUE';\r\n } else {\r\n $sek_cardinality = 'FALSE';\r\n }\r\n if (@$_POST[\"sek_relationship\"] == '1') {\r\n $sek_relationship = 'TRUE';\r\n } else {\r\n $sek_relationship = 'FALSE';\r\n }\r\n\r\n\r\n $sekIncrId = Search_Key::getNextIncrId(APP_PID_NAMESPACE);\r\n $sek_id = APP_PID_NAMESPACE . '_' . $sekIncrId;\r\n\r\n $stmt = \"INSERT INTO\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n (\r\n sek_id,\r\n sek_namespace,\r\n sek_incr_id,\r\n sek_title,\r\n sek_desc,\r\n\t\t\t\t\tsek_alt_title,\r\n\t\t\t\t\tsek_meta_header,\r\n\t\t\t\t\tsek_simple_used,\r\n\t\t\t\t\tsek_bulkchange,\r\n\t\t\t\t\tsek_adv_visible,\r\n\t\t\t\t\tsek_myfez_visible,\r\n\t\t\t\t\tsek_faceting,\";\r\n if (is_numeric($_POST[\"sek_order\"])) {\r\n $stmt .= \" sek_order, \";\r\n }\r\n if (is_numeric($_POST[\"sek_relationship\"])) {\r\n $stmt .= \" sek_relationship, \";\r\n }\r\n if (is_numeric($_POST[\"sek_cardinality\"])) {\r\n $stmt .= \" sek_cardinality, \";\r\n }\r\n\r\n $stmt .= \"\r\n\t\t\t\t\tsek_data_type,\r\n\t\t\t\t\tsek_html_input,\r\n\t\t\t\t\tsek_fez_variable,\r\n\t\t\t\t\tsek_lookup_function,\r\n\t\t\t\t\tsek_lookup_id_function,\r\n\t\t\t\t\tsek_suggest_function,\r\n\t\t\t\t\tsek_comment_function,\r\n\t\t\t\t\tsek_derived_function,\r\n\t\t\t\t\tsek_smarty_variable \";\r\n if (is_numeric($_POST[\"sek_cvo_id\"])) {\r\n $stmt .= \" ,sek_cvo_id \";\r\n }\r\n $stmt .= \"\r\n ) VALUES (\r\n \" . $db->quote($sek_id) . \",\r\n \" . $db->quote(APP_PID_NAMESPACE) . \",\r\n \" . $db->quote($sekIncrId, 'INTEGER') . \",\r\n \" . $db->quote($_POST[\"sek_title\"]) . \",\r\n \" . $db->quote($_POST[\"sek_desc\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_alt_title\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_meta_header\"]) . \",\r\n\t\t\t\t\t\" . $sek_simple_used . \",\r\n\t\t\t\t\t\" . $sek_bulkchange . \",\r\n\t\t\t\t\t\" . $sek_adv_visible . \",\r\n\t\t\t\t\t\" . $sek_myfez_visible . \",\r\n\t\t \" . $sek_faceting . \",\";\r\n if (is_numeric($_POST[\"sek_order\"])) {\r\n $stmt .= $_POST[\"sek_order\"] . \",\";\r\n }\r\n if (is_numeric($_POST[\"sek_relationship\"])) {\r\n $stmt .= $sek_relationship . \",\";\r\n }\r\n if (is_numeric($_POST[\"sek_cardinality\"])) {\r\n $stmt .= $sek_cardinality . \",\";\r\n }\r\n\r\n $stmt .= \"\r\n \" . $db->quote($_POST[\"sek_data_type\"]) . \",\r\n \" . $db->quote($_POST[\"field_type\"]) . \",\r\n \" . $db->quote($_POST[\"sek_fez_variable\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_lookup_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_lookup_id_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_suggest_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_comment_function\"]) . \",\r\n\t\t\t\t\t\" . $db->quote($_POST[\"sek_derived_function\"]) . \",\r\n \" . $db->quote($_POST[\"sek_smarty_variable\"]);\r\n if (is_numeric($_POST[\"sek_cvo_id\"])) {\r\n $stmt .= \",\" . $db->quote($_POST[\"sek_cvo_id\"], 'INTEGER');\r\n }\r\n $stmt .= \")\";\r\n\r\n try {\r\n $db->exec($stmt);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return -1;\r\n }\r\n\r\n if (function_exists('apc_clear_cache')) {\r\n apc_clear_cache('user');\r\n }\r\n\r\n if ($_POST['create_sql']) {\r\n\r\n if ($_POST[\"sek_relationship\"] == 1) {\r\n // no longer need to get sek_id - as it is pre-got before the insert\r\n //\t $sek_id = $GLOBALS[\"db_api\"]->dbh->getLastInsertId(APP_TABLE_PREFIX . \"search_key\", 'sek_id');\r\n return Search_Key::createSearchKeyDB($sek_id);\r\n\r\n } elseif ($_POST[\"sek_relationship\"] == 0) {\r\n\r\n include_once(APP_INC_PATH . 'class.bgp_create_searchkey.php');\r\n // no longer need to get sek_id - as it is pre-got before the insert\r\n //\t $sek_id = $GLOBALS[\"db_api\"]->dbh->getLastInsertId(APP_TABLE_PREFIX . \"search_key\", 'sek_id');\r\n\r\n /*\r\n * Because the alter might take a while, run in\r\n * a background process\r\n */\r\n $bgp = new BackgroundProcess_Create_SearchKey();\r\n $bgp->register(serialize(array('sek_id' => $sek_id)), Auth::getUserID());\r\n Session::setMessage('The column is being created as a background process (see My Fez to follow progress)');\r\n return 1;\r\n }\r\n }\r\n }",
"function insert() {\n\t \t$sql = \"INSERT INTO evs_database.evs_key_component (kcp_key_component_detail_en, kcp_key_component_detail_th, kcp_cpn_id)\n\t \t\t\tVALUES(?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id));\n\t\n\t }",
"function m_verifyInsert()\n\t{\n\t\t$this->errMsg=\"\";\n\n\t\tif(empty($this->request['subject']))\n\t\t{\n\t\t\t$this->err=1;\n\t\t\t$this->errMsg=MSG_SUBJECT_EMPTY.\"<br>\";\n\t\t}\n\t\t\n\t\tif(!empty($this->request['sid']))\n\t\t{\n\t\t\t#VALIDATING EXISTING OPTION TITLE\n\t\t\t$this->obDb->query = \"SELECT iMailid_PK FROM \".EMAILS.\" where vSid = '\".$this->request['sid'].\"'\";\n\t\t\t$row_code = $this->obDb->fetchQuery();\n\t\t\tif($this->obDb->record_count != 0)\n\t\t\t{\n\t\t\t\t$this->err=1;\n\t\t\t\t$this->errMsg.=MSG_SID_EXIST.\"<br>\";\n\t\t\t}\n\t\t}\n\t\treturn $this->err;\n\t}",
"protected function fijarSentenciaInsert(){}",
"public function insert_question_and_option()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_operator_auth();\n\t\t$CI->load->model('operator/Questions');\t\t\n\t\t$CI->Questions->question_and_option_entry();\n\t\t\n\t\t$this->session->set_userdata(array('message'=>display('successfully_added_question')));\n\n\t\tredirect(base_url('operator/Oquestion/add_question_form'));\n\t}",
"public function insert(array $options);",
"public function insertOption($data);",
"public function addOption()\n {\n try {\n $this->validate();\n DB::beginTransaction();\n if ($this->option !== \"\") {\n $this->assessment->options()->create([\n 'option' => $this->option,\n ]);\n }\n $this->option = \"\";\n } catch (\\Throwable $th) {\n DB::rollback();\n session()->flash('error', $th->getMessage());\n }\n DB::commit();\n $this->emitSelf('render');\n }",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"public function saveConfig() {\n\t\tif(!$this->_configTitle) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configDatabase) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configTable) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configCreditsCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserColId) throw new Exception(lang('error_4'));\n\t\t\n\t\t$data = array(\n\t\t\t'title' => $this->_configTitle,\n\t\t\t'database' => $this->_configDatabase,\n\t\t\t'table' => $this->_configTable,\n\t\t\t'creditscol' => $this->_configCreditsCol,\n\t\t\t'usercol' => $this->_configUserCol,\n\t\t\t'usercolid' => $this->_configUserColId,\n\t\t\t'checkonline' => $this->_configCheckOnline,\n\t\t\t'display' => $this->_configDisplay,\n\t\t\t'phrase' => $this->_configPhrase\n\t\t);\n\t\t\n\t\t$query = \"INSERT INTO \"._WE_CREDITSYS_.\" \"\n\t\t\t. \"(config_title, config_database, config_table, config_credits_col, config_user_col, config_user_col_id, config_checkonline, config_display, config_phrase) \"\n\t\t\t. \"VALUES \"\n\t\t\t. \"(:title, :database, :table, :creditscol, :usercol, :usercolid, :checkonline, :display, :phrase)\";\n\t\t\n\t\t$saveConfig = $this->db->query($query, $data);\n\t\tif(!$saveConfig) throw new Exception(lang('error_140'));\n\t}",
"function emb_save_options() {\n\t}",
"function newConfigOptions() {\n $insert = $this->utility->db->execute(\"INSERT INTO \" . TABLE_PREFIX . \"config_options (name, module, type, value) VALUES \n ('last_frequently_activity', 'system', 'system', 'N;'),\n ('last_hourly_activity', 'system', 'system', 'N;'),\n ('last_daily_activity', 'system', 'system', 'N;')\n \");\n \t\n \t if(is_error($insert)) {\n \t return $insert->getMessage();\n \t } // if\n \t\n \treturn true;\n }",
"protected function storeInstrumentOptionIntoDatabase( &$instrument_option, &$old_instrument_option_ids ) {\n\t\t$sql = \"SHOW COLUMNS FROM `\".DB_PREFIX.\"instrument_option` LIKE 'value'\";\n\t\t$query = $this->db->query( $sql );\n\t\t$exist_po_value = ($query->num_rows > 0) ? true : false;\n\n\t\t// DB query for storing the instrument option\n\t\t$instrument_id = $instrument_option['instrument_id'];\n\t\t$option_id = $instrument_option['option_id'];\n\t\t$option_value = $instrument_option['option_value'];\n\t\t$required = $instrument_option['required'];\n\t\t$required = ((strtoupper($required)==\"TRUE\") || (strtoupper($required)==\"YES\") || (strtoupper($required)==\"ENABLED\")) ? 1 : 0;\n\t\tif (isset($old_instrument_option_ids[$instrument_id][$option_id])) {\n\t\t\t$instrument_option_id = $old_instrument_option_ids[$instrument_id][$option_id];\n\t\t\tif ($exist_po_value) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"instrument_option` (`instrument_option_id`,`instrument_id`,`option_id`,`value`,`required` ) VALUES \"; \n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"instrument_option` (`instrument_option_id`,`instrument_id`,`option_id`,`option_value`,`required` ) VALUES \"; \n\t\t\t}\n\t\t\t$sql .= \"($instrument_option_id,$instrument_id,$option_id,'\".$this->db->escape($option_value).\"',$required)\";\n\t\t\t$this->db->query($sql);\n\t\t\tunset($old_instrument_option_ids[$instrument_id][$option_id]);\n\t\t} else {\n\t\t\tif ($exist_po_value) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"instrument_option` (`instrument_id`,`option_id`,`value`,`required` ) VALUES \"; \n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"instrument_option` (`instrument_id`,`option_id`,`option_value`,`required` ) VALUES \"; \n\t\t\t}\n\t\t\t$sql .= \"($instrument_id,$option_id,'\".$this->db->escape($option_value).\"',$required)\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}",
"private function insertSettings()\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\tforeach ($this->getSettings() as $s => $set)\r\n\t\t{\r\n\t\t\t$ilDB->manipulate(\"INSERT INTO adm_set_templ_value \".\r\n\t\t\t\t\"(template_id, setting, value, hide) VALUES (\".\r\n\t\t\t\t$ilDB->quote($this->getId(), \"integer\").\",\".\r\n\t\t\t\t$ilDB->quote($s, \"text\").\",\".\r\n\t\t\t\t$ilDB->quote($set[\"value\"], \"text\").\",\".\r\n\t\t\t\t$ilDB->quote($set[\"hide\"], \"integer\").\r\n\t\t\t\t\")\");\r\n\t\t}\r\n\t}",
"public function insert($opt) {\n\t\t\t\n\t\t\t$statement = $this->buildInsert($opt);\n\t\t\t$pdoStatement = $this->prepare($statement);\n\t\t\t$this->__bindValues($pdoStatement);\n\t\t\t\n\t\t\t//$pdoStatement->execute();\n\t\t\t$pdoStatement->closeCursor();\n\t\t\t$this->__reset();\n\t\t}",
"public function setcreatecompetence(){\n\n\n\n\n global $conn;\n\n\n $stmt = $conn->prepare(\"insert into competences(`competence`,`end`) value (?,?)\");\n $stmt->bind_param(\"ss\",$this->competence,$this->end);\n $stmt->execute();\n $stmt->close();\n\n\n\n\n\n }",
"private function setMailOptionsValuesByDB()\n\t{\n\t\tglobal $ilUser, $ilSetting;\t\t\n\t\t\n\t\trequire_once 'Services/Mail/classes/class.ilMailOptions.php';\n\t\t$mailOptions = new ilMailOptions($ilUser->getId());\n\t\t\n\t\t$data = array(\n\t\t\t'linebreak' => $mailOptions->getLinebreak(),\n\t\t\t'signature' => $mailOptions->getSignature(),\n\t\t\t'cronjob_notification' => $mailOptions->getCronjobNotification()\n\t\t);\n\t\t\n\t\tif($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')\n\t\t{\t\t\n\t\t\t$data['incoming_type'] = $mailOptions->getIncomingType();\n\t\t}\n\t\t\n\t\t$this->form->setValuesByArray($data);\n\t}",
"function set_eventos_fe($SCTECIAA,$SCTEPDC,$SCTETDOC,$SCTFECEM,$SCTESERI,$SCTECORR,$responseCode,$responseContent,$SCTESUCA){\n\t\t\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t\t\t$codcia=$this->session->userdata('codcia'); \n\t\t\t\t$f= gmdate(\"d-m-Y\", time() - 18000);\n\t\t\t\t$dd=substr($f, 0,2);\n\t\t\t\t$dm=substr($f, 3,2);\n\t\t\t\t$da=substr($f, 6,4);\n\t\t\t\t$fecha=$da.$dm.$dd;\n\t\t\t\t$hh= gmdate(\"H-i-s\", time() - 18000);\n\t\t\t\t$h=substr($hh, 0,2);\n\t\t\t\t$m=substr($hh, 3,2);\n\t\t\t\t$s=substr($hh, 6,2);\n\t\t\t\t$hora=$h.$m.$s;\n\t\t\t\t$sql = \"insert into LIBPRDDAT.SNT_ANEXO (SACODCIA,SACODSUC,SANROINT,SANROSER,SANROCOR,SATIPDOC,SACODRPT,SAMSGRPT,SASTS,SAUSR,SAFECREG,SAHORREG)values('\".$SCTECIAA.\"','\".$SCTESUCA.\"','\".$SCTEPDC.\"','\".$SCTESERI.\"','\".$SCTECORR.\"','\".$SCTETDOC.\"','\".$responseCode.\"','\".$responseContent.\"','A','MMUSRSCD','\".$fecha.\"','\".$hora.\"')\";\t\n\t\t\t\t$res = odbc_exec($dbconect, $sql) or die(\"<p>\" . odbc_errormsg());\n\t\t\t\tif (!$res):$res = 0;\n\t\t\t\t\telse: $res = 1;\n\t\t\t\t\tendif;\t\t\t\t\n\t\t\t\t\treturn $res;\t\t\t\n\t\t\t\t}",
"public function insert_entry()\r\n\t{\r\n\t\t$this->db->insert(\"email_workflow\", $this);\r\n\t}",
"public function save()\n {\n parent::save();\n\n $myConfig = $this->getConfig();\n $soxId = $this->getEditObjectId();\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n\n // #918 S\n // checkbox handling\n $aParams['oxshops__oxactive'] = (isset($aParams['oxshops__oxactive']) && $aParams['oxshops__oxactive'] == true) ? 1 : 0;\n $aParams['oxshops__oxproductive'] = (isset($aParams['oxshops__oxproductive']) && $aParams['oxshops__oxproductive'] == true) ? 1 : 0;\n\n $isubjlang = oxRegistry::getConfig()->getRequestParameter(\"subjlang\");\n $iLang = ($isubjlang && $isubjlang > 0) ? $isubjlang : 0;\n\n /** @var oxShop $oShop */\n $oShop = oxNew(\"oxshop\");\n if ($soxId != \"-1\") {\n $oShop->loadInLang($iLang, $soxId);\n } else {\n $aParams['oxshops__oxid'] = null;\n }\n\n if ($aParams['oxshops__oxsmtp']) {\n $aParams['oxshops__oxsmtp'] = trim($aParams['oxshops__oxsmtp']);\n }\n\n $oShop->setLanguage(0);\n $oShop->assign($aParams);\n $oShop->setLanguage($iLang);\n\n if (($sNewSMPTPass = oxRegistry::getConfig()->getRequestParameter(\"oxsmtppwd\"))) {\n $oShop->oxshops__oxsmtppwd->setValue($sNewSMPTPass == '-' ? \"\" : $sNewSMPTPass);\n }\n\n\n try {\n $oShop->save();\n } catch (oxException $e) {\n\n return;\n }\n\n $this->_aViewData[\"updatelist\"] = \"1\";\n\n\n oxRegistry::getSession()->setVariable(\"actshop\", $soxId);\n }",
"function add($options = array())\n\t{\n\t\tif ( ! $this->_required($this->required_fields, $options))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$this->_set_editable_fields($this->primary_table);\n\t\t\n\t\t$this->_validate_options_exist($options);\n\n// \t\t$default = array(\n// \t\t\t'date_created' => date($this->config->item('log_date_format')),\n// \t\t\t'date_modified' => date($this->config->item('log_date_format'))\n// \t\t);\n// \t\t$options = $this->_default($default, $options);\n\t\t\n\t\t// qualification (make sure that we're not allowing the site to insert data that it shouldn't)\n\t\tforeach ($this->fields as $field) \n\t\t{\n\t\t\tif (isset($options[$field]))\n\t\t\t{\n\t\t\t\t$this->db->set($field, $options[$field]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->db->insert($this->primary_table);\n\n\t\tif ($query)\n\t\t{\n\t\t\tif ($this->no_primary_key == FALSE)\n\t\t\t{\n\t\t\t\treturn $this->db->insert_id();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}",
"public function add($survey_type=0,$code='',$title='',$theme='',$intro='',$start='2013-01-01',$end='2013-01-01',$skip_text='Skip',$skip_quota=0,$agreement_text='',$is_all=0,$method=0,$guide='',$term='')\r\n\t{\r\n\t\t$by = $this->session->userdata('nik');\r\n\t\t$query=\"INSERT INTO GES_M_kuesioner\r\n\t\t\t\t\t ([survey_type_id]\r\n\t\t\t\t\t ,[kuesioner_code]\r\n\t\t\t\t\t ,[title]\r\n\t\t\t\t\t ,[theme]\r\n\t\t\t\t\t ,[introduction]\r\n\t\t\t\t\t ,[start_time]\r\n\t\t\t\t\t ,[end_time]\r\n\t\t\t\t\t ,[abstain_text]\r\n\t\t\t\t\t ,[skip_quota]\r\n\t\t\t\t\t ,[agreement_text]\r\n\t\t\t\t\t ,[contract_active]\r\n\t\t\t\t\t ,[contract_min_years]\r\n\t\t\t\t\t ,[contract_min_months]\r\n\t\t\t\t\t ,[contract_min_days]\r\n\t\t\t\t\t ,[contract_max_years]\r\n\t\t\t\t\t ,[contract_max_months]\r\n\t\t\t\t\t ,[contract_max_days]\r\n\t\t\t\t\t ,[permanent_active]\r\n\t\t\t\t\t ,[permanent_min_years]\r\n\t\t\t\t\t ,[permanent_min_months]\r\n\t\t\t\t\t ,[permanent_min_days]\r\n\t\t\t\t\t ,[permanent_max_years]\r\n\t\t\t\t\t ,[permanent_max_months]\r\n\t\t\t\t\t ,[permanent_max_days]\r\n\t\t\t\t\t ,[position_min_years]\r\n\t\t\t\t\t ,[position_min_months]\r\n\t\t\t\t\t ,[position_min_days]\r\n\t\t\t\t\t ,[position_max_years]\r\n\t\t\t\t\t ,[position_max_months]\r\n\t\t\t\t\t ,[position_max_days]\r\n\t\t\t\t\t ,[insert_by]\r\n\t\t\t\t\t ,[insert_on]\r\n\t\t\t\t\t ,[update_by]\r\n\t\t\t\t\t ,[update_on]\r\n\t\t\t\t\t ,[is_active]\r\n\t\t\t\t\t ,[is_all]\r\n\t\t\t\t\t ,[method]\r\n\t\t\t\t\t ,[guide]\r\n\t\t\t\t\t ,[term])\r\n\t\t VALUES\r\n\t\t\t\t\t ($survey_type\r\n\t\t\t\t\t ,'$code'\r\n\t\t\t\t\t ,'$title'\r\n\t\t\t\t\t ,'$theme'\r\n\t\t\t\t\t ,'$intro'\r\n\t\t\t\t\t ,'$start'\r\n\t\t\t\t\t ,'$end'\r\n\t\t\t\t\t ,'$skip_text'\r\n\t\t\t\t\t ,$skip_quota\r\n\t\t\t\t\t ,'$agreement_text'\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,99\r\n\t\t\t\t\t ,11\r\n\t\t\t\t\t ,29\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,99\r\n\t\t\t\t\t ,11\r\n\t\t\t\t\t ,29\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,0\r\n\t\t\t\t\t ,99\r\n\t\t\t\t\t ,11\r\n\t\t\t\t\t ,29\r\n\t\t\t\t\t ,'$by'\r\n\t\t\t\t\t ,GETDATE()\r\n\t\t\t\t\t ,'$by'\r\n\t\t\t\t\t ,GETDATE()\r\n\t\t\t\t\t ,1\r\n\t\t\t\t\t ,$is_all\r\n\t\t\t\t\t ,$method\r\n\t\t\t\t\t ,'$guide'\r\n\t\t\t\t\t ,'$term')\";\r\n\t\treturn $this->survey->query($query);\r\n\t}",
"public function save_question_options(&$options) {\n $formdata = $this->_form;\n if (isset($formdata->taskfiledraftid)) {\n // Special handling for proforma import (interim solution):\n // rename draftid property.\n throw new moodle_exception('your qformat_proforma plugin is outdated, please upgrade!');\n $formdata->task = $formdata->taskfiledraftid;\n $formdata->modelsol = $formdata->modelsolid;\n $formdata->download = $formdata->downloadid;\n $formdata->template = $formdata->templateid;\n }\n parent::save_question_options($options);\n }",
"private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}",
"private function initContactInsertArgs() {\n $this->esitWScontact = new Api\\esitWScontact();\n $this->esitWScontactAddress = new Api\\esitWScontactAddress();\n $this->esitWScontactAttribute = new Api\\esitWScontactAttribute();\n // Defaults should be opt-out for data protection, according to best\n // practices. All boolean.\n // $doNotContact, $doNotMail, $doNotPhone, $doNotEmail, $doNotSMS, $mailThirdParty, $emailThirdParty, $phoneThirdParty, $dmEmailOptIn, $dmMailOptIn\n $this->esitWScontactDataProtection = new Api\\esitWScontactDataProtection(FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);\n }",
"function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }",
"private function insert_entry_qual()\n {\n global $DB;\n $params = $this->get_params();\n $this->id = $DB->insert_record('subject', $params);\n }",
"function InlineInsert() {\n\t\tglobal $Language, $objForm, $gsFormError;\n\t\t$this->LoadOldRecord(); // Load old recordset\n\t\t$objForm->Index = 0;\n\t\t$this->LoadFormValues(); // Get form values\n\n\t\t// Validate form\n\t\tif (!$this->ValidateForm()) {\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t\treturn;\n\t\t}\n\t\t$this->SendEmail = TRUE; // Send email on add success\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\n\t\t\tif ($this->getSuccessMessage() == \"\")\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\n\t\t} else { // Add failed\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t}\n\t}",
"public function addnewclaimquestion(){\n\tif(isset($this->getData['opertaors']) && !empty($this->getData['opertaors'])){\n\t $operators = commonfunction::implod_array($this->getData['opertaors']);\n\t}\n\telse{\n\t $operators = '';\n \t}\n\tif($this->getData['question_type']=='file'){\n\t $file_upload = 1;\n\t}else{\n\t $file_upload = 0;\n\t}\n\t$question_options ='';\n\tif($this->getData['question_type']=='select' || $this->getData['question_type']=='radio'){\n\t foreach($this->getData['questionoption'] as $key=>$que_option){\n\t\t$que_value = $this->getData['questionvalue'][$key];\n\t\t$question_options .= $que_option.'|'.$que_value.';';\n\t }\n\t}\n\tif(isset($this->getData['subquestion_a']) && $this->getData['subquestion_a']!=''){\n\t $sub_question = isset($this->getData['subquestion_a'])?$this->getData['subquestion_a']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option_a'])?$this->getData['subquestion_option_a']:'';\n\t}else{\n\t $sub_question = isset($this->getData['subquestion'])?$this->getData['subquestion']:'';\n\t $sub_que_option = isset($this->getData['subquestion_option'])?$this->getData['subquestion_option']:'';\n\t}\n\t$lastinserted_id = $this->insertInToTable(CLAIM_QUESTIONS, array(array('sub_question'=>$sub_question,'sub_question_option'=>$sub_que_option,'question_type'=>$this->getData['question_type'],'question'=>$this->getData['question'],'question_options'=>$question_options,'operators'=>$operators,'file_upload'=>$file_upload,'status'=>$this->getData['claim_status'],'created_by'=>$this->Useconfig['user_id'],'created_ip'=>commonfunction::loggedinIP())));\n\treturn $lastinserted_id;\n }"
] |
[
"0.5957162",
"0.5784983",
"0.57098675",
"0.5693861",
"0.56616783",
"0.56560963",
"0.5646666",
"0.5631879",
"0.5587516",
"0.5569107",
"0.55462843",
"0.55458677",
"0.54923123",
"0.5455348",
"0.5396054",
"0.5364374",
"0.5361202",
"0.5353874",
"0.5351959",
"0.53234184",
"0.5322673",
"0.5315397",
"0.5306372",
"0.53062373",
"0.5298312",
"0.5284796",
"0.5269968",
"0.5269393",
"0.5260448",
"0.52522504"
] |
0.70559186
|
0
|
Test new logger proxy with file alias
|
public function testNewWithAliasFile()
{
$fileLoggerMock = $this->getMockBuilder(File::class)
->disableOriginalConstructor()
->getMock();
$fileLoggerMock->expects($this->once())
->method('log');
$fileLoggerFactoryMock = $this->getMockBuilder(FileFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
$fileLoggerFactoryMock->expects($this->once())
->method('create')
->willReturn($fileLoggerMock);
$quietLoggerMock = $this->getMockBuilder(Quiet::class)
->disableOriginalConstructor()
->getMock();
$quietLoggerMock->expects($this->never())
->method('log');
$quietLoggerFactoryMock = $this->getMockBuilder(QuietFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
$this->loggerProxy = $this->objectManager->getObject(
LoggerProxy::class,
[
'fileFactory' => $fileLoggerFactoryMock,
'quietFactory' => $quietLoggerFactoryMock,
'loggerAlias' => LoggerProxy::LOGGER_ALIAS_FILE,
]
);
$this->loggerProxy->log('test');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testNewWithAliasDisabled()\n {\n $fileLoggerMock = $this->getMockBuilder(File::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $fileLoggerMock->expects($this->never())\n ->method('log');\n\n $fileLoggerFactoryMock = $this->getMockBuilder(FileFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n\n $quietLoggerMock = $this->getMockBuilder(Quiet::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $quietLoggerMock->expects($this->once())\n ->method('log');\n\n $quietLoggerFactoryMock = $this->getMockBuilder(QuietFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n\n $quietLoggerFactoryMock->expects($this->once())\n ->method('create')\n ->willReturn($quietLoggerMock);\n\n $this->loggerProxy = $this->objectManager->getObject(\n LoggerProxy::class,\n [\n 'fileFactory' => $fileLoggerFactoryMock,\n 'quietFactory' => $quietLoggerFactoryMock,\n 'loggerAlias' => LoggerProxy::LOGGER_ALIAS_DISABLED,\n ]\n );\n\n $this->loggerProxy->log('test');\n }",
"public function testLoggerFileLog()\n {\n $logger = $this->getMockBuilder('Cake\\Log\\Engine\\FileLog')->setMethods(['log'])->getMock();\n\n $message = json_encode([\n 'method' => 'GET',\n 'path' => '_stats',\n 'data' => []\n ], JSON_PRETTY_PRINT);\n\n $logger->expects($this->once())->method('log')->with(\n $this->equalTo('debug'),\n $this->equalTo($message)\n );\n\n Log::setConfig('elasticsearch', $logger);\n\n $connection = ConnectionManager::get('test');\n $connection->logQueries(true);\n $result = $connection->request('_stats');\n $connection->logQueries(false);\n\n $this->assertNotEmpty($result);\n }",
"abstract public function load_logger();",
"public function testSetLogger() {\n $file_name = getLogFileName();\n $message = 'The sky is the daily bread of the eyes.';\n setOutputDestination($file_name);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertFalse(strpos($output, $message) !== false);\n Terminus::setLogger(['debug' => true, 'format' => 'json']);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertTrue(strpos($output, $message) !== false);\n resetOutputDestination($file_name);\n }",
"function make_file_logger() {\n\t\t\n\t\t$path = owa_coreAPI::getSetting('base', 'error_log_file');\n\t\t//instantiate a a log file\n\t\t$conf = array('name' => 'debug_log', 'file_path' => $path);\n\t\t$this->loggers['file'] = owa_coreAPI::supportClassFactory( 'base', 'logFile', $conf );\n\t}",
"protected function createMockedLoggerAndLogManager() {}",
"abstract function test_log($name, $pwd);",
"protected function openLogFile() {}",
"public function testCustomLogCreation()\n {\n $logName = 'test.log';\n\n // if the file was previously created, delete it\n if (file_exists(LOG_PATH . '/' . $logName)) {\n unlink(LOG_PATH . '/' . $logName);\n }\n\n // the test\n $this->logMessage('this is a test', $logName);\n\n // asserts\n $this->assertTrue(file_exists(LOG_PATH . '/' . get_class($this) . '.log'));\n $this->assertGreaterThan(0, filesize(LOG_PATH . '/' . get_class($this) . '.log'));\n }",
"public function testSetUpLoggerName()\n\t{\t\n\t\t$this->__Log->setupLogger('log_name',new \\Monolog\\Handler\\TestHandler());\n\t\t$logger = $this->__Log->getLogger('log_name');\n\n\t\t$this->assertInternalType('object',$logger);\n\t}",
"private function lopen() {\n $log_file_default = '/var/log/pmta/pmta-bounce-handler.log';\n // define log file from lfile method or use previously set default\n $lfile = $this->log_file ? $this->log_file : $log_file_default;\n // open log file for writing only and place file pointer at the end of the file\n // (if the file does not exist, try to create it)\n // First try to write to configured log-file\n if ($this->debug == 0) {\n\t $this->fp = fopen($lfile, 'a') or $lfile = 'pmta-bounce-handler.log';\n\t }\n\n if ($this->debug == 0 && is_null($this->fp)) {\n\t $this->fp = fopen($lfile, 'a') or exit(\"Can't open $lfile!\");\n\t }\n }",
"public function getLogFile() {}",
"public function getLogger();",
"public function getLogger();",
"protected function log_manager() {\n\t\treturn tribe( 'logger' );\n\t}",
"private function lopen() {\n\t\t// in case of Windows set default log file\n\t\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n\t\t\t$log_file_default = dirname(__FILE__).'/log/default_logfile.txt';\n\t\t}\n\t\t// set default log file for Linux and other systems\n\t\telse {\n\t\t\t$log_file_default = dirname(__FILE__).'/log/default_logfile.txt';\n\t\t}\n\t\t// define log file from lfile method or use previously set default\n\t\t$lfile = $this->log_file ? $this->log_file : $log_file_default;\n\t\t// open log file for writing only and place file pointer at the end of the file\n\t\t// (if the file does not exist, try to create it)\n\t\t$this->fp = fopen($lfile, 'a') or exit(\"Can't open $lfile!\");\n\t}",
"protected function logfile_init() { \n if ($this->LOGGING) { \n $this->FILE_HANDLER = fopen($this->LOGFILE,'a') ; \n $this->debug(); \n } \n }",
"private function lopen() {\n // in case of Windows set default log file\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n $log_file_default = 'c:/php/logfile.txt';\n }\n // set default log file for Linux and other systems\n else {\n $log_file_default = '/tmp/logfile.txt';\n }\n // define log file from lfile method or use previously set default\n $lfile = $this->log_file ? $this->log_file : $log_file_default;\n // open log file for writing only and place file pointer at the end of the file\n // (if the file does not exist, try to create it)\n $this->fp = fopen($lfile, 'a') or exit(\"Can't open $lfile!\");\n }",
"private function lopen() {\n // in case of Windows set default log file\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n $log_file_default = 'c:/php/logfile.txt';\n }\n // set default log file for Linux and other systems\n else {\n $log_file_default = '/tmp/logfile.txt';\n }\n // define log file from lfile method or use previously set default\n $lfile = $this->log_file ? $this->log_file : $log_file_default;\n // open log file for writing only and place file pointer at the end of the file\n // (if the file does not exist, try to create it)\n $this->fp = fopen($lfile, 'a') or exit(\"Can't open $lfile!\");\n }",
"public function logFilePath();",
"public function testGetLogger()\n\t{\t\t\n\t\t$this->__Log->setupLogger('testing',new \\Monolog\\Handler\\TestHandler());\n\t\t$logger = $this->__Log->getLogger('testing');\n\t\t$loggerTest = new \\Monolog\\Logger('testing');\n\t\t$loggerTest->pushHandler(new \\Monolog\\Handler\\TestHandler());\n\n\t\t$this->assertEquals($loggerTest,$logger);\n\t}",
"public function testFailSetFilename()\n {\n $logger = new \\Arch\\Logger\\File();\n $logger->setFilename(NULL);\n }",
"public function testGetLoggerFailed()\n\t{\t\n\t\t$logger = $this->__Log->getLogger('testing');\n\t\t$this->assertFalse($logger);\n\t}",
"abstract protected function getLogger(): Logger;",
"public function testFilenameSetCorrectly()\n {\n $property = $this->logger_reflection->getProperty('filename');\n $property->setAccessible(TRUE);\n\n $this->assertEquals($this->filename, $property->getValue($this->logger));\n }",
"protected function createLogFile() {}",
"private function _setUpLogger(&$logger = null)\n\t{\n\t\tstatic $_names = array();\n\n\t\tif (!$logger)\n\t\t{\n\t\t\t$logger = (object) array(\n\t\t\t\t'namespace' => 'com_flexicontent.filemanager.uploader',\n\t\t\t\t'filename' => 'mediadata_log.php',\n\t\t\t\t'detailed_log' => false,\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($_names[$logger->namespace]))\n\t\t{\n\t\t\t$_names[$logger->namespace] = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tjimport('joomla.log.log');\n\t\tJLog::addLogger(\n\t\t\tarray(\n\t\t\t\t'text_file' => $logger->filename, // Sets the target log file\n\t\t\t\t'text_entry_format' => '{DATE} {TIME} {PRIORITY} {MESSAGE}' // Sets the format of each line\n\t\t\t),\n\t\t\tJLog::ALL, // Sets messages of all log levels to be sent to the file\n\t\t\tarray($logger->namespace) // category of logged messages\n\t\t);\n\t}",
"public static function getLogger();",
"public function testSetsLoggerWhenLoggable()\n {\n /** @var ExecutableTask|\\PHPUnit_Framework_MockObject_MockObject $task */\n $task = $this->getMockBuilder(ExecutableTask::class)\n ->disableOriginalConstructor()\n ->getMock();\n $task->expects($this->once())\n ->method('setLogger');\n $definition = new Definition();\n $definition->addTask(new TaskAlias('alias'), $task);\n $runner = new Runner(\n new Resolver($definition),\n $this->getMockForAbstractClass(LoggerInterface::class)\n );\n $this->assertTrue($runner->run(new TaskAlias('alias')));\n }",
"public function testLoggerExists()\n\t{\t\t\n\t\t$this->__Log->setupLogger('test1',new \\Monolog\\Handler\\TestHandler());\n\t\t$this->assertTrue($this->__Log->isLoggerExists('test1'));\n\t\t$this->assertFalse($this->__Log->isLoggerExists('test3'));\n\t}"
] |
[
"0.6807457",
"0.6320224",
"0.61939615",
"0.61733806",
"0.6108104",
"0.60279363",
"0.60259795",
"0.5907541",
"0.5859419",
"0.57915556",
"0.5727617",
"0.56713635",
"0.5669221",
"0.5669221",
"0.56400275",
"0.56295323",
"0.56190765",
"0.56182075",
"0.56182075",
"0.56116146",
"0.5599513",
"0.55849713",
"0.55591017",
"0.55474645",
"0.5534114",
"0.55322695",
"0.55082446",
"0.5459323",
"0.54546297",
"0.5430347"
] |
0.7993968
|
0
|
Test new logger proxy with disabled alias
|
public function testNewWithAliasDisabled()
{
$fileLoggerMock = $this->getMockBuilder(File::class)
->disableOriginalConstructor()
->getMock();
$fileLoggerMock->expects($this->never())
->method('log');
$fileLoggerFactoryMock = $this->getMockBuilder(FileFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
$quietLoggerMock = $this->getMockBuilder(Quiet::class)
->disableOriginalConstructor()
->getMock();
$quietLoggerMock->expects($this->once())
->method('log');
$quietLoggerFactoryMock = $this->getMockBuilder(QuietFactory::class)
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
$quietLoggerFactoryMock->expects($this->once())
->method('create')
->willReturn($quietLoggerMock);
$this->loggerProxy = $this->objectManager->getObject(
LoggerProxy::class,
[
'fileFactory' => $fileLoggerFactoryMock,
'quietFactory' => $quietLoggerFactoryMock,
'loggerAlias' => LoggerProxy::LOGGER_ALIAS_DISABLED,
]
);
$this->loggerProxy->log('test');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testNewWithAliasFile()\n {\n $fileLoggerMock = $this->getMockBuilder(File::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $fileLoggerMock->expects($this->once())\n ->method('log');\n\n $fileLoggerFactoryMock = $this->getMockBuilder(FileFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n\n $fileLoggerFactoryMock->expects($this->once())\n ->method('create')\n ->willReturn($fileLoggerMock);\n\n $quietLoggerMock = $this->getMockBuilder(Quiet::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $quietLoggerMock->expects($this->never())\n ->method('log');\n\n $quietLoggerFactoryMock = $this->getMockBuilder(QuietFactory::class)\n ->disableOriginalConstructor()\n ->setMethods(['create'])\n ->getMock();\n\n $this->loggerProxy = $this->objectManager->getObject(\n LoggerProxy::class,\n [\n 'fileFactory' => $fileLoggerFactoryMock,\n 'quietFactory' => $quietLoggerFactoryMock,\n 'loggerAlias' => LoggerProxy::LOGGER_ALIAS_FILE,\n ]\n );\n\n $this->loggerProxy->log('test');\n }",
"protected function createMockedLoggerAndLogManager() {}",
"public function testGetLoggerFailed()\n\t{\t\n\t\t$logger = $this->__Log->getLogger('testing');\n\t\t$this->assertFalse($logger);\n\t}",
"public function testSetLogger() {\n $file_name = getLogFileName();\n $message = 'The sky is the daily bread of the eyes.';\n setOutputDestination($file_name);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertFalse(strpos($output, $message) !== false);\n Terminus::setLogger(['debug' => true, 'format' => 'json']);\n Terminus::getLogger()->debug($message);\n $output = retrieveOutput($file_name);\n $this->assertTrue(strpos($output, $message) !== false);\n resetOutputDestination($file_name);\n }",
"public function testSetUpLoggerName()\n\t{\t\n\t\t$this->__Log->setupLogger('log_name',new \\Monolog\\Handler\\TestHandler());\n\t\t$logger = $this->__Log->getLogger('log_name');\n\n\t\t$this->assertInternalType('object',$logger);\n\t}",
"public function testGeneralMethods()\n {\n $logger = $this->lh->getLogger();\n $this->assertInstanceOf('Psr\\Log\\NullLogger', $logger);\n }",
"abstract protected function getLogger(): Logger;",
"protected function log_manager() {\n\t\treturn tribe( 'logger' );\n\t}",
"public function testLoggerExists()\n\t{\t\t\n\t\t$this->__Log->setupLogger('test1',new \\Monolog\\Handler\\TestHandler());\n\t\t$this->assertTrue($this->__Log->isLoggerExists('test1'));\n\t\t$this->assertFalse($this->__Log->isLoggerExists('test3'));\n\t}",
"abstract public function load_logger();",
"public function testGetLogger()\n\t{\t\t\n\t\t$this->__Log->setupLogger('testing',new \\Monolog\\Handler\\TestHandler());\n\t\t$logger = $this->__Log->getLogger('testing');\n\t\t$loggerTest = new \\Monolog\\Logger('testing');\n\t\t$loggerTest->pushHandler(new \\Monolog\\Handler\\TestHandler());\n\n\t\t$this->assertEquals($loggerTest,$logger);\n\t}",
"public function getLogger();",
"public function getLogger();",
"abstract function test_log($name, $pwd);",
"public function testRollbarLoggerEnabled(): void\n {\n Rollbar::init([\n 'access_token' => $this->getTestAccessToken(),\n 'environment' => 'testing-php',\n \"enabled\" => true,\n 'verbose_logger' => $this->verboseLogger,\n ]);\n\n Rollbar::log(Level::WARNING, \"Testing PHP Notifier\");\n\n $this->assertVerboseLogsConsecutive(\n ['level' => LogLevel::INFO, 'messageRegEx' => 'Attempting to log: \\[warning\\] Testing PHP Notifier'],\n ['level' => LogLevel::INFO, 'messageRegEx' => 'Occurrence'],\n );\n }",
"protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }",
"public function testSetsLoggerWhenLoggable()\n {\n /** @var ExecutableTask|\\PHPUnit_Framework_MockObject_MockObject $task */\n $task = $this->getMockBuilder(ExecutableTask::class)\n ->disableOriginalConstructor()\n ->getMock();\n $task->expects($this->once())\n ->method('setLogger');\n $definition = new Definition();\n $definition->addTask(new TaskAlias('alias'), $task);\n $runner = new Runner(\n new Resolver($definition),\n $this->getMockForAbstractClass(LoggerInterface::class)\n );\n $this->assertTrue($runner->run(new TaskAlias('alias')));\n }",
"public function getLogger(){ return $this->_logger; }",
"public function testImportingLoggerFailure() {\n\t\tCakeLog::config('fail', array());\n\t}",
"protected function getMockLogger()\n {\n return $this->getMock('\\Psr\\Log\\LoggerInterface', array(), array(), '', false);\n }",
"public static function getLogger();",
"function createLogHelper($className) {\n // TODO: Bring startLogger and pauseLogger static calls to here\n if (strstr($className, '__ref')) {\n return;\n }\n\n // XXX: Expensive call (hell, hasn't stopped me yet)\n if (DEBUG == true) {\n $dbg = debug_backtrace();\n $lineNumber = $dbg[1]['line'];\n $fileName = $dbg[1]['file'];\n debugMsg(\"Intercepting new $className on line $lineNumber of $fileName\");\n }\n\n $destClassName = \"__ref\".$className;\n \n // Get a list of methods to be transplanted from original class\n $srcOriginal = sourceArray($className);\n\n\n // \n injectMethodLogger($className, $srcOriginal);\n\n // Create a '__ref' prefixed class that resembles the old one\n // Possible replacement? class_alias($className, $destClassName);\n //transplantMethods($destClassName, $srcOriginal);\n\n // Bind the logging __call() method to the class with the original name.\n // Each call will be dispatched to the '__ref' prefixed object.\n // Additionally, remove all the original methods so that __call() is invoked.\n //setLoggerMethods($className, $destClassName, $srcOriginal);\n debugMsg(\"Creating new $className object\\n\");\n}",
"private function initLogger()\n {\n $objectManager = ObjectManager::getInstance();\n if ($this->klevuLoggerFQCN && !($this->logger instanceof $this->klevuLoggerFQCN)) {\n $this->logger = $objectManager->get($this->klevuLoggerFQCN);\n }\n\n if (!($this->logger instanceof LoggerInterface)) {\n $this->logger = $objectManager->get(LoggerInterface::class);\n }\n }",
"public function testRollbarLoggerCheckIgnored(): void\n {\n Rollbar::init([\n 'access_token' => $this->getTestAccessToken(),\n 'environment' => 'testing-php',\n 'verbose_logger' => $this->verboseLogger,\n 'check_ignore' => function () {\n return true;\n },\n ]);\n Rollbar::log(LogLevel::WARNING, \"Testing PHP Notifier\");\n $this->assertVerboseLogContains('Occurrence ignored', LogLevel::INFO);\n }",
"public function testLoggerIsPassedCorrectly()\n {\n $property = $this->reflection->getProperty('logger');\n $property->setAccessible(TRUE);\n\n $value = $property->getValue($this->class);\n\n $this->assertInstanceOf('Psr\\Log\\LoggerInterface', $value);\n $this->assertSame($this->logger, $value);\n }",
"public function getLoggerAware()\n {\n $aware = new LoggerAware();\n return $aware;\n }",
"public function testRollbarLoggerDisabled(): void\n {\n Rollbar::init([\n 'access_token' => $this->getTestAccessToken(),\n 'environment' => 'testing-php',\n \"enabled\" => false,\n 'verbose_logger' => $this->verboseLogger,\n ]);\n\n Rollbar::log(Level::WARNING, \"Testing PHP Notifier\");\n $this->assertVerboseLogContains('Rollbar is disabled', LogLevel::NOTICE);\n }",
"public function setLogger($logger);",
"public function testLogger(): void\n {\n $loggerMock = $this->createMock(LoggerInterface::class);\n\n $loggerMock->expects(self::once())\n ->method('log')\n ->with(LoggerInterface::FATAL, 'Log log', []);\n\n $subject = new TransitLogger();\n\n $this->assertInstanceOf(TransitLogger::class, $subject);\n\n $subject->addLogger($loggerMock);\n $subject->log(LoggerInterface::FATAL, 'Log log', []);\n }",
"public function create($target, stubLogger $logger);"
] |
[
"0.6817267",
"0.6340983",
"0.6194736",
"0.6058536",
"0.59999746",
"0.59881026",
"0.5763673",
"0.5745972",
"0.5678427",
"0.5667807",
"0.55932224",
"0.55564564",
"0.55564564",
"0.55023426",
"0.54778075",
"0.54631275",
"0.5459134",
"0.5457615",
"0.5419458",
"0.535569",
"0.53518325",
"0.53388274",
"0.529456",
"0.5293578",
"0.5258044",
"0.5242921",
"0.5238798",
"0.52075076",
"0.5200809",
"0.51969254"
] |
0.7963278
|
0
|
Load resource for detail page.
|
private function loadResourceForDetailPage()
{
$this->data['css'][] = asset('/assets/css/Dss/Priority/detail.css');
$this->data['js'][] = asset('/assets/js/Dss/Priority/detail.js');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function detail(){\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$record = $this->modelGetRecord($id);\n\t\t\t//load view\n\t\t\tinclude \"Views/BlogsDetailView.php\";\n\t\t}",
"public function loadForView();",
"public function show(Detail $detail)\n {\n return new DetailResource($detail);\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load() { }",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);",
"public function load($id);"
] |
[
"0.6378958",
"0.60984",
"0.6044795",
"0.60240823",
"0.60236454",
"0.6023597",
"0.6023597",
"0.6023597",
"0.5966942",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746",
"0.5910746"
] |
0.7897725
|
0
|
/ Funcion que calcula el tipo de profesor del formulario 5, se compara el vector del formulario con el de la consulta SQL de la tabla profesor, y se ejecuta distancia euclidiana para obtener el punto mas cercano
|
function adivinarTipoProfesor($array_A){
$arrayA = $this->transformarDatosProfesor($array_A);
$datos=new ManejoDatos();
$array = new stdClass();
$array_profesores=$datos->getProfesores();
foreach ($array_profesores as $elemento) {
$elemento = array($elemento['A'], $elemento['B'], $elemento['C'], $elemento['D'],$elemento['E'],
$elemento['F'],$elemento['G'],$elemento['H'],$elemento['Class']);
$arrayB=$this->transformarDatosProfesor($elemento);
$temporal = $this->distanciaEuclidiana($arrayA, $arrayB);
if ($temporal < $this->distancia) {
$this->distancia = $temporal;
$this->temporal = $elemento['8'];
}
}
return $this->temporal;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getTipoPerfilVen()\r\n\t {\r\n\t \tif($this->aletaVenA == 0){\r\n\t \t\treturn 'Perfil 7 x 15';\r\n\t \t}else{\r\n\t \t\treturn 'Perfil 10.1 x 12';\r\n\t \t}\r\n\t }",
"function calcular_promedio($materias) {\n $sum_notas_uv = 0;\n $sum_uv = 0;\n $resultado = 0;\n\n foreach($materias as $clave => $valor) {\n for ($i=0; $i < count($valor); $i++) { \n $nota = $valor[1];\n $uv = $valor[2];\n\n $sum_notas_uv += $nota * $uv;\n $sum_uv += $uv;\n }\n }\n\n // validar que $sum_uv != 0\n\n $resultado = $sum_notas_uv / $sum_uv;\n return round($resultado, 0);\n}",
"function gr_tipo5($_idrespuesta,$valor){\n \n $tableRpta=$this->_tablerpta;\n if(empty($_idrespuesta) and isset($valor)){\n $g_sql=\"INSERT INTO $tableRpta ([[ra_entero]],[[id_conjunto_respuesta]],[[id_pregunta]],[[id_tpregunta]],[[id_capitulo]],[[id_formato]],[[id_conjunto_pregunta]],[[id_version]],[[id_junta]]) VALUES (:valor, :idconjrpta, :idpregunta, :idtpregunta, :idcapitulo, :idformato,:idconjprta,:idversion,:idjunta)\";\n }else if(!empty($_idrespuesta) and isset($valor)){\n $g_sql=\"UPDATE $tableRpta SET [[ra_entero]] = :valor,[[id_conjunto_respuesta]] = :idconjrpta,[[id_pregunta]] = :idpregunta ,[[id_tpregunta]] = :idtpregunta,[[id_capitulo]] = :idcapitulo,[[id_formato]] = :idformato,[[id_conjunto_pregunta]] = :idconjprta,[[id_version]] = :idversion, [[id_junta]] = :idjunta WHERE [[id_respuesta]] = \".$_idrespuesta;\n }else{\n $g_sql=\"\";\n } \n \n /*Guardando $_valor para tipo entero se realiza el cambio por si el entero trae\n separadores de miles */\n $_valor=str_replace(\",\",\"\",$valor);\n $_valor=str_replace(\".\",\"\",$_valor);\n \n if (is_numeric($_valor)) { \n return [$g_sql,$_valor];\n }else{\n return [$g_sql,NULL];\n } \n \n \n }",
"function f_obj($individu){\n\t\t$cluster = count($individu); //menghitung jumlah cluster berdasarkan individu\n\t\t$target = 10;\n\t\t$hasil = 0;\n\t\tfor ($i=0; $i < $cluster; $i++) { \n\t\t\t$hasil += $individu[$i];\n\t\t}\n\n\t\t$evaluasi = abs($hasil - $target);\n\t\treturn $evaluasi; //nilai fitness masih 0-10\n\t}",
"public function intensidad(){\n if($this->PP03F < 35 && $this->PP03G == 1 && $this->PP03H == 1)\n {\n return 1;\n }\n if($this->caracteristicas->CH06 >= 10 && $this->PP03G == 1 && $this->PP01E == 5)\n {\n return 2;\n }\n if( $this->PP03F > 40)\n {\n return 3;\n }\n if($this->PP01E == 5)\n {\n return 4;\n }\n}",
"function valorLlamada($tipo)\n{\n if ($tipo == \"internacional\")\n {\n return 2;\n }\n else if ($tipo == \"larga\")\n {\n return 0.75;\n }\n\n return 0.2; // corta\n}",
"function mejor_promedio($vector){\n echo \"<hr> ############# Mejor promedio #############\";\n $promedio=0;\n $cadena;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n if($n>$promedio){\n $promedio=$n;\n $cadena = \"<br>\".$c.\" -->Promedio: \".$n;\n }\n }\n }\n echo $cadena;\n }",
"static public function mdlCalcularUtilidad5($tabla){\r\n\r\n\t\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla set utilidad5 = ((precioUnitario5-precioCompra5)/precioUnitario5)*100 where idPedido = :idPedido and serie = :serie\");\r\n\r\n\t\t\t$stmt -> bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t\t$stmt -> bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\r\n\t\t\tif ($stmt -> execute()) {\r\n\r\n\t\t\t\treturn \"ok\";\r\n\r\n\t\t\t}else {\r\n\r\n\t\t\t\treturn \"error\";\r\n\r\n\t\t\t}\r\n\t\t\t$stmt -> close();\r\n\r\n\t\t\t$stmt = null;\r\n\r\n\r\n\t}",
"function gr_tipo6($_idrespuesta,$valor){\n \n $tableRpta=$this->_tablerpta;\n \n \n \n if(empty($_idrespuesta) and isset($valor)){\n $g_sql=\"INSERT INTO $tableRpta ([[ra_decimal]],[[id_conjunto_respuesta]],[[id_pregunta]],[[id_tpregunta]],[[id_capitulo]],[[id_formato]],[[id_conjunto_pregunta]],[[id_version]],[[id_junta]]) VALUES (:valor, :idconjrpta, :idpregunta, :idtpregunta, :idcapitulo, :idformato,:idconjprta,:idversion,:idjunta)\";\n }else if(!empty($_idrespuesta) and isset($valor)){\n $g_sql=\"UPDATE $tableRpta SET [[ra_decimal]] = :valor,[[id_conjunto_respuesta]] = :idconjrpta,[[id_pregunta]] = :idpregunta ,[[id_tpregunta]] = :idtpregunta,[[id_capitulo]] = :idcapitulo,[[id_formato]] = :idformato,[[id_conjunto_pregunta]] = :idconjprta,[[id_version]] = :idversion, [[id_junta]] = :idjunta WHERE [[id_respuesta]] = \".$_idrespuesta;\n }else{\n $g_sql=\"\";\n } \n \n /*Quitando separadores de miles \",\"*/\n $_valor=str_replace(\",\",\"\",$valor);\n \n if (is_numeric($_valor)) { \n return [$g_sql,$_valor];\n }else{\n return [$g_sql,NULL];\n } \n \n \n \n }",
"function promedios_por_materia($vector){\n echo \"<hr> ############# Promedios por materia #############\";\n $calificacion1=0;\n $calificacion2=0;\n $calificacion3=0;\n $calificacion4=0;\n $calificacion5=0;\n $calificacion6=0;\n foreach ($vector as $key => $value) {\n $calificacion1=$calificacion1+$vector[$key][0];\n $calificacion2=$calificacion2+$vector[$key][1];\n $calificacion3=$calificacion3+$vector[$key][2];\n $calificacion4=$calificacion4+$vector[$key][3];\n $calificacion5=$calificacion5+$vector[$key][4];\n $calificacion6=$calificacion6+$vector[$key][5];\n }\n $prom=$calificacion1/10;\n echo \"<br> Promedio materia 1: \".$prom;\n $prom=$calificacion2/10;\n echo \"<br> Promedio materia 2: \".$prom;\n $prom=$calificacion3/10;\n echo \"<br> Promedio materia 3: \".$prom;\n $prom=$calificacion4/10;\n echo \"<br> Promedio materia 4: \".$prom;\n $prom=$calificacion5/10;\n echo \"<br> Promedio materia 5: \".$prom;\n $prom=$calificacion6/10;\n echo \"<br> Promedio materia 6: \".$prom;\n }",
"static public function mdlCalcularUtilidad2($tabla){\r\n\r\n\t\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla set utilidad2 = ((precioUnitario2-precioCompra2)/precioUnitario2)*100 where idPedido = :idPedido and serie = :serie\");\r\n\r\n\t\t\t$stmt -> bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t\t$stmt->bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\r\n\t\t\tif ($stmt -> execute()) {\r\n\r\n\t\t\t\treturn \"ok\";\r\n\r\n\t\t\t}else {\r\n\r\n\t\t\t\treturn \"error\";\r\n\r\n\t\t\t}\r\n\t\t\t$stmt -> close();\r\n\r\n\t\t\t$stmt = null;\r\n\r\n\r\n\t}",
"function promedio_por_alumno($vector){\n $promedios_alumnos=array();\n foreach ($vector as $key => $value) {\n $promedio=0;\n foreach ($value as $c) {\n $promedio=$promedio+$c;\n }\n $promedio=$promedio/6;\n $alumno=array($key=>$promedio);\n array_push($promedios_alumnos,$alumno);\n }\n return $promedios_alumnos;\n }",
"function compara_valores($id_restauro)\n{\n global $db,$msg_dest;\n \n $sql_fixo=\"SELECT a.material_tecnica as mat,a.altura_interna as alt,largura_interna as larg,altura_externa as imp_alt,largura_externa as imp_larg\n\t\t\tFROM moldura AS a, restauro AS b WHERE a.moldura=b.moldura AND b.restauro='$id_restauro'\";\n $db->query($sql_fixo);\n $res=$db->dados();\n $conteudo1=array($res['mat'],$res['alt'],$res['larg'],$res['imp_alt'],$res['imp_larg']);\n $conteudo2=array($_REQUEST['tecnica'],formata_valor(trim($_REQUEST['altura_obra'])),formata_valor(trim($_REQUEST['largura_obra'])),formata_valor(trim($_REQUEST['altura_imagem'])),formata_valor(trim($_REQUEST['largura_imagem'])));\n ///\n $sql_usu=\"SELECT responsavel, tecnico from colecao where nome = '$_REQUEST[colecao]'\";\n $db->query($sql_usu);\n $usu_destino=$db->dados(); \n $usu_responsavel=$usu_destino['responsavel'];\n $usu_tecnico=$usu_destino['tecnico'];\n ///\n reset($conteudo1);\n reset($conteudo2);\n $msg=array();\n reset($msg);\n $msg_dest='';\n if($conteudo1[0]!=$conteudo2[0]){\n $msg[]='Técnica original:'.$conteudo1[0].' - Técnica atual:'.$conteudo2[0]. '\\n';}\n if($conteudo1[1]!=$conteudo2[1]){\n $msg[]='Altura original:'.$conteudo1[1].'cm - Altura atual:'.$conteudo2[1].' cm \\n';}\n if($conteudo1[2]!=$conteudo2[2]){\n $msg[]='Largura original:'.$conteudo1[2].' cm - Largura atual:'.$conteudo2[2].' cm \\n';}\n if($conteudo1[3]!=$conteudo2[3]){\n $msg[]='Altura da Imagem original:'.$conteudo1[3].' cm - Altura da Imagem atual:'.$conteudo2[3].' cm \\n';}\n if($conteudo1[4]!=$conteudo2[4]){\n $msg[]='Largura da Imagem original:'.$conteudo1[4].' cm - Largura da Imagem atual:'.$conteudo2[4].' cm \\n ';}\n\nif(count($msg)>0) // Se houver mudanças......\n{\n for($i=0;$i<count($msg);$i++){ \n $msg_dest.=$msg[$i];}\n}\n\nif ($usu_responsavel!='') {\n\n\tif($msg_dest!='')\n\t{\n \t\t$texto.='Modificações de catalogação na Ficha de Restauro\\n';\n \t\t$texto.='Nº DE REGISTRO:'.$_REQUEST['pNum_registro']. '- Objeto: '.$_REQUEST['nome_objeto']. '- Sequencial:'.$_REQUEST['seq_restauro'].'\\n';\n \t\t$texto.='TÍTULO:'.$_REQUEST['titulo'].'\\n';\n \t\t$texto.='ALTERAÇÕES:\\n';\n \t\t$texto.=$msg_dest;\n \t\t$dataInc= date(\"Y-m-d\");\n \t\t$assunto='Ficha de Restauro-Nº de registro:'.$_REQUEST['pNum_registro'].'';\n \t\t$sql= \"INSERT INTO agenda(assunto,texto,data_aviso,eh_lida,data_inclusao,usuario_origem,usuario) \n \t\tvalues('$assunto','$texto',now(),'0','$dataInc','$_SESSION[susuario]','$usu_responsavel')\";\n \t\t$db->query($sql);\n\t\tif ($usu_responsavel <> $usu_tecnico) {\n\t \t\t$sql= \"INSERT INTO agenda(assunto,texto,data_aviso,eh_lida,data_inclusao,usuario_origem,usuario) \n \t\tvalues('$assunto','$texto',now(),'0','$dataInc','$_SESSION[susuario]','$usu_tecnico')\";\n\t \t\t$db->query($sql);\n\t\t}\n \t}\n} \n}",
"function DIFERENCIA_SUELDO_BASICO($_ARGS) {\r\n\t$_PARAMETROS = PARAMETROS();\t\r\n\t$sum_diferencia = 0;\r\n\t\r\n\t//\tObtengo el sueldo basico mensual...\r\n\t$sql = \"SELECT\r\n\t\t\t\t ns.SueldoPromedio AS SueldoBasico \r\n\t\t\tFROM \r\n\t\t\t\t rh_empleadonivelacion en \r\n\t\t\t\t INNER JOIN rh_puestos p ON (en.CodCargo = p.CodCargo) \r\n\t\t\t\t INNER JOIN rh_nivelsalarial ns ON (p.CategoriaCargo = ns.CategoriaCargo AND p.Grado = ns.Grado) \r\n\t\t\tWHERE \r\n\t\t\t\t en.CodOrganismo = '\".$_ARGS['ORGANISMO'].\"' AND \r\n\t\t\t\t --\ten.CodTipoNom = '\".$_ARGS['NOMINA'].\"' AND \r\n\t\t\t\t en.CodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND \r\n\t\t\t\t en.TipoAccion <> 'ET' AND \r\n\t\t\t\t en.FechaHasta = '0000-00-00'\r\n\t\t\tORDER BY en.Fecha\";\r\n\t$query_sueldo = mysql_query($sql) or die ($sql.mysql_error());\r\n\tif (mysql_num_rows($query_sueldo) != 0) $field_sueldo = mysql_fetch_array($query_sueldo);\r\n\t\t\r\n\t$sql = \"SELECT\r\n\t\t\t\t en.Fecha, \r\n\t\t\t\t en.FechaHasta, \r\n\t\t\t\t ns.SueldoPromedio AS SueldoTemporal \r\n\t\t\tFROM \r\n\t\t\t\t rh_empleadonivelacion en \r\n\t\t\t\t INNER JOIN rh_puestos p ON (en.CodCargo = p.CodCargo) \r\n\t\t\t\t INNER JOIN rh_nivelsalarial ns ON (p.CategoriaCargo = ns.CategoriaCargo AND p.Grado = ns.Grado) \r\n\t\t\tWHERE \r\n\t\t\t\t en.CodOrganismo = '\".$_ARGS['ORGANISMO'].\"' AND \r\n\t\t\t\t --\ten.CodTipoNom = '\".$_ARGS['NOMINA'].\"' AND \r\n\t\t\t\t en.CodPersona = '\".$_ARGS['TRABAJADOR'].\"' AND \r\n\t\t\t\t en.TipoAccion = 'ET' AND \r\n\t\t\t\t ((en.FechaHasta = '0000-00-00' AND en.Fecha <= '\".$_ARGS['HASTA'].\"') OR \r\n\t\t\t\t ('\".$_ARGS['DESDE'].\"' >= en.Fecha AND \r\n\t\t\t\t '\".$_ARGS['DESDE'].\"' <= en.FechaHasta) OR \r\n\t\t\t\t (en.Fecha >= '\".$_ARGS['DESDE'].\"' AND \r\n\t\t\t\t en.Fecha <= '\".$_ARGS['HASTA'].\"')) \r\n\t\t\tORDER BY en.Fecha\";\r\n\t$query_nivelaciones = mysql_query($sql) or die ($sql.mysql_error());\r\n\twhile ($field_nivelaciones = mysql_fetch_array($query_nivelaciones)) {\r\n\t\tif ($field_nivelaciones['Fecha'] < $_ARGS['DESDE']) $desde = $_ARGS['DESDE'];\r\n\t\telse $desde = $field_nivelaciones['Fecha'];\r\n\t\t##\r\n\t\tif ($field_nivelaciones['FechaHasta'] == \"0000-00-00\" || $field_nivelaciones['FechaHasta'] > $_ARGS['HASTA']) $hasta = $_ARGS['HASTA'];\r\n\t\telse $hasta = $field_nivelaciones['FechaHasta'];\r\n\t\t##\r\n\t\t$dias = DIAS_FECHA($desde, $hasta);\r\n\t\t##\r\n\t\t$Diferencia = $field_nivelaciones['SueldoTemporal'] - $field_sueldo['SueldoBasico'];\r\n\t\t$Diario = $Diferencia / $_PARAMETROS['MAXDIASMES'];\r\n\t\t$monto = $Diario * $dias;\r\n\t\t##\r\n\t\t$sum_diferencia += $monto;\r\n\t}\r\n\treturn $sum_diferencia;\r\n}",
"function adivinarSexo($array_A){\n $datos=new ManejoDatos();\n $arrayBD =$datos->getEstiloSexoPromedioRecinto();\n if($array_A[0]=='DIVERGENTE'){\n $estilo=4;\n }\n if($array_A[0]=='CONVERGENTE'){\n $estilo=3;\n }\n if($array_A[0]=='ACOMODADOR'){\n $estilo=2;\n }\n if($array_A[0]=='ASIMILADOR'){\n $estilo=1;\n }\n $arrayA = array( $estilo, $array_A[1],($array_A[2] == \"Paraiso\" ? 1 : 2));\n foreach ($arrayBD as $elemento) {\n if($elemento['Estilo']=='DIVERGENTE'){\n $estiloBD=4;\n }\n if($elemento['Estilo']=='CONVERGENTE'){\n $estiloBD=3;\n }\n if($elemento['Estilo']=='ACOMODADOR'){\n $estiloBD=2;\n }\n if($elemento['Estilo']=='ASIMILADOR'){\n $estiloBD=1;\n }\n $arrayB = array($estiloBD, $elemento['Promedio'], $elemento['Recinto'] == \"Paraiso\" ? 1 : 2);\n $temporal = $this->distanciaEuclidiana($arrayA, $arrayB);\n if ($temporal < $this->distancia) {\n $this->distancia = $temporal;\n $this->temporal = $elemento['Sexo'];\n }\n }\n if($this->temporal=='M'){\n $this->temporal=\"Masculino\";\n return $this->temporal;\n }\n if($this->temporal=='F'){\n $this->temporal=\"Femenino\";\n return $this->temporal;\n }\n }",
"public function consultaDevuelta($valorTotal, $efectivo)\n{\n $efectivo=$this->filtroNumerico($this->normalizacionDeCaracteres($efectivo));\n $valorTotal=$this->filtroNumerico($this->normalizacionDeCaracteres($valorTotal));\n\n $devolver=$efectivo-$valorTotal;\n if ($devolver>0) {\n # code...\n return $devolver;\n }\n else\n {\n return 0;\n }\n\n\n}",
"function valore_costo_trasporto_ordine_user($id_ordine,$id_user){\r\n $valore_globale_attuale_netto_qarr = valore_totale_ordine_qarr($id_ordine);\r\n $valore_personale_attuale_netto_qarr = valore_arrivato_netto_ordine_user($id_ordine,$id_user);\r\n $percentuale_mio_ordine = ($valore_personale_attuale_netto_qarr / $valore_globale_attuale_netto_qarr) *100;\r\n $costo_globale_trasporto = valore_trasporto($id_ordine,100);\r\n $costo_trasporto = ($costo_globale_trasporto / 100) * $percentuale_mio_ordine;\r\n return (float)$costo_trasporto;\r\n}",
"function grade_ultimascompras($con, $codestabelec, $codproduto, $limit = 5){\r\n\tif(is_array($codestabelec)){\r\n\t\t$codestabelec = implode(\", \", $codestabelec);\r\n\t}\r\n\r\n\t$grid = new Grid();\r\n\t$grid->setheader(array(\"Data\", \"Nota Fiscal\", \"Fornecedor\", \"Quantidade\", \"Preço\"));\r\n\t$grid->setcolumnsalign(array(\"center\", \"center\", \"left\", \"right\", \"right\"));\r\n\t$grid->setcolumnswidth(array(\"18%\", \"16%\", \"30%\", \"18%\", \"18%\"));\r\n\r\n\t$query = \"SELECT * FROM \";\r\n\t$query .= \"((SELECT notafiscal.dtentrega, notafiscal.numnotafis, notafiscal.serie, COALESCE(fornecedor.razaosocial, estabelecimento_parceiro.nome) AS fornecedor, \";\r\n\t$query .= \" (itnotafiscal.quantidade * itnotafiscal.qtdeunidade) AS quantidade, \";\r\n\t$query .= \" (CASE WHEN itnotafiscal.quantidade = 0 OR itnotafiscal.qtdeunidade = 0 THEN 0 ELSE (itnotafiscal.totalliquido / (itnotafiscal.quantidade * itnotafiscal.qtdeunidade)) END) AS preco, \";\r\n\t$query .= \" estabelecimento_origem.cor \";\r\n\t$query .= \" FROM itnotafiscal \";\r\n\t$query .= \" INNER JOIN notafiscal ON (itnotafiscal.idnotafiscal = notafiscal.idnotafiscal) \";\r\n\t$query .= \" LEFT JOIN fornecedor ON (notafiscal.codparceiro = fornecedor.codfornec AND notafiscal.operacao IN ('CP','PR')) \";\r\n\t$query .= \" LEFT JOIN estabelecimento AS estabelecimento_parceiro ON (notafiscal.codparceiro = estabelecimento_parceiro.codestabelec AND notafiscal.operacao = 'TE') \";\r\n\t$query .= \" LEFT JOIN estabelecimento AS estabelecimento_origem ON (notafiscal.codestabelec = estabelecimento_origem.codestabelec) \";\r\n\t$query .= \" WHERE (notafiscal.operacao IN ('CP','TE') \";\r\n\t$query .= \" OR notafiscal.operacao = (CASE WHEN param('NOTAFISCAL','PRODRURALIGUALCOMPRA') = 'S' THEN 'PR' ELSE '' END)::bpchar) \";\r\n\tif(strlen($codestabelec) > 0){\r\n\t\t$query .= \"\t AND notafiscal.codestabelec IN (\".$codestabelec.\") \";\r\n\t}\r\n\t$query .= \"\t AND itnotafiscal.codproduto = \".$codproduto.\" \";\r\n\t$query .= \" ORDER BY notafiscal.dtentrega DESC \";\r\n\t$query .= \" LIMIT {$limit} \";\r\n\t$query .= \") UNION ALL (\";\r\n\t$query .= \" SELECT pedido.dtentrega, pedido.numpedido AS numnotafis, 'PED' AS serie, COALESCE(fornecedor.razaosocial, estabelecimento_parceiro.nome) AS fornecedor, \";\r\n\t$query .= \" (itpedido.quantidade * itpedido.qtdeunidade) AS quantidade, \";\r\n\t$query .= \" (CASE WHEN itpedido.quantidade = 0 OR itpedido.qtdeunidade = 0 THEN 0 ELSE (itpedido.totalliquido / (itpedido.quantidade * itpedido.qtdeunidade)) END) AS preco, \";\r\n\t$query .= \" estabelecimento_origem.cor \";\r\n\t$query .= \" FROM itpedido \";\r\n\t$query .= \" INNER JOIN pedido ON (itpedido.codestabelec = pedido.codestabelec AND itpedido.numpedido = pedido.numpedido) \";\r\n\t$query .= \" LEFT JOIN fornecedor ON (pedido.codparceiro = fornecedor.codfornec AND pedido.operacao IN ('CP','PR')) \";\r\n\t$query .= \" LEFT JOIN estabelecimento AS estabelecimento_parceiro ON (pedido.codparceiro = estabelecimento_parceiro.codestabelec AND pedido.operacao = 'TE') \";\r\n\t$query .= \" LEFT JOIN estabelecimento AS estabelecimento_origem ON (pedido.codestabelec = estabelecimento_origem.codestabelec) \";\r\n\t$query .= \" WHERE pedido.operacao IN ('CP','TE','PR') AND itpedido.status = 'P' AND pedido.status = 'P' \";\r\n\tif(strlen($codestabelec) > 0){\r\n\t\t$query .= \"\t AND pedido.codestabelec IN (\".$codestabelec.\") \";\r\n\t}\r\n\t$query .= \"\t AND itpedido.codproduto = \".$codproduto.\" \";\r\n\t$query .= \" ORDER BY pedido.dtentrega DESC \";\r\n\t$query .= \" LIMIT {$limit} )) AS tmp \";\r\n\t$query .= \"ORDER BY dtentrega DESC \";\r\n\r\n\t$res = $con->query($query);\r\n\t$arr = $res->fetchAll(2);\r\n\r\n\tforeach($arr as $row){\r\n\t\t$grid->addrow(array(\r\n\t\t\tconvert_date($row[\"dtentrega\"], \"Y-m-d\", \"d/m/Y\"),\r\n\t\t\t$row[\"numnotafis\"].\"-\".$row[\"serie\"],\r\n\t\t\t$row[\"fornecedor\"],\r\n\t\t\tnumber_format($row[\"quantidade\"], 4, \",\", \".\"),\r\n\t\t\tnumber_format($row[\"preco\"], 2, \",\", \".\")\r\n\t\t), null, null, \"cor='{$row[\"cor\"]}'\");\r\n\t}\r\n\treturn $grid->draw();\r\n}",
"static public function mdlCalcularUtilidad4($tabla){\r\n\r\n\t\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla set utilidad4 = ((precioUnitario4-precioCompra4)/precioUnitario4)*100 where idPedido = :idPedido and serie = :serie\");\r\n\r\n\t\t\t$stmt -> bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t\t$stmt -> bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\r\n\t\t\tif ($stmt -> execute()) {\r\n\r\n\t\t\t\treturn \"ok\";\r\n\r\n\t\t\t}else {\r\n\r\n\t\t\t\treturn \"error\";\r\n\r\n\t\t\t}\r\n\t\t\t$stmt -> close();\r\n\r\n\t\t\t$stmt = null;\r\n\r\n\r\n\t}",
"function calcularCostoPublicidad ($tipo, $cantCaract) {\n // Verifico el tipo de publicidad\n $costo = -1;\n if ($tipo == \"negro\") {\n if ($cantCaract > 0 && $cantCaract <= 300) {\n $costo = 556.50;\n } elseif ($cantCaract > 300 && $cantCaract <= 500) {\n $costo = 950;\n } elseif ($cantCaract > 500) {\n $costo = 2300;\n }\n } elseif ($tipo == \"color\") {\n if ($cantCaract > 0 && $cantCaract <= 300) {\n $costo = 556.50 * 1.1;\n } elseif ($cantCaract > 300 && $cantCaract <= 500) {\n $costo = 950 * 1.1;\n } elseif ($cantCaract > 500) {\n $costo = 2300 * 1.1;\n }\n }\n return $costo;\n}",
"function valore_costo_gestione_ordine_user($id_ordine,$id_user){\r\n $valore_globale_attuale_netto_qarr = valore_totale_ordine_qarr($id_ordine);\r\n $valore_personale_attuale_netto_qarr = valore_arrivato_netto_ordine_user($id_ordine,$id_user);\r\n $percentuale_mio_ordine = ($valore_personale_attuale_netto_qarr / $valore_globale_attuale_netto_qarr) *100;\r\n $costo_globale_gestione = valore_gestione($id_ordine,100);\r\n $costo_gestione = ($costo_globale_gestione / 100) * $percentuale_mio_ordine;\r\n return (float)$costo_gestione;\r\n}",
"function get_convocatoria_actual($tipo){\n $actual=date('Y-m-d');\n $anio_actual= date(\"Y\", strtotime($actual));\n switch ($tipo) {\n case 3:$id_tipo=1;//3 es reco\n break;\n default:$id_tipo=2;\n break;\n }\n $sql=\"select id_conv from convocatoria_proyectos \"\n //. \" where anio=$anio_actual and id_tipo=$id_tipo\";\n .\" where fec_inicio<='\".$actual.\"' and fec_fin >='\".$actual.\"'\"\n . \" and id_tipo=$id_tipo\";\n $resul=toba::db('designa')->consultar($sql);\n if(count($resul)>0){\n return $resul[0]['id_conv'];\n }else \n return null;\n }",
"function alumnos_mayores_al_promedio_general($promedio,$vector){\n echo \"<hr> ############# Promedios mayores al promedio general #############\";\n $cont=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n if($n>$promedio){\n $cont=$cont+1;\n echo \"<br>\".$c.\" -->Promedio: \".$n;\n }\n }\n }\n echo \"<br> Total: \".$cont;\n\n }",
"public function categoriaInactivos(){\n if($this->nolaboral->V21_M >= 1)\n {\n return 1;\n }\n if($this->nolaboral->V8_M == 1 && $this->nolaboral->V9_M == 1 && $this->nolaboral->V10_M == 1)\n {\n return 2;\n }\n if($this->caracteristicas->CH10 == 1 && $this->PP01E == 2)\n {\n return 3;\n }\n if($this->PP01E == 2)\n {\n return 4;\n }\n if($this->caracteristicas->CH06 < 6)\n {\n return 5;\n }\n if($this->discapacidad())\n {\n return 6;\n }\n\n}",
"function getRatiosPrudentiels($list_agence) {\n\n global $dbHandler;\n global $global_monnaie,$global_id_agence;\n\n $db = $dbHandler->openConnection();\n $DATA['limitation_prets_dirigeants'] = 0;\n $DATA['limitation_risque_membre'] = 0;\n $DATA['taux_transformation'] = 0;\n $DATA['total_epargne'] = 0;\n foreach($list_agence as $key_id_ag =>$value) {\n // Parcours des agences\n setGlobalIdAgence($key_id_ag);\n // Encours brut\n $sql = \"SELECT SUM(calculeCV(solde_cap, devise, '$global_monnaie')) FROM ad_etr, ad_dcr, adsys_produit_credit WHERE ad_etr.id_ag=$global_id_agence AND ad_etr.id_ag=ad_dcr.id_ag AND ad_dcr.id_ag=adsys_produit_credit.id_ag AND ad_etr.id_doss = ad_dcr.id_doss AND ad_dcr.id_prod = adsys_produit_credit.id AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15)\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $encours_brut = $row[0];\n\n // Encours max\n $sql = \"SELECT MAX(somme) FROM (SELECT SUM(calculeCV(solde_cap, devise, '$global_monnaie')) AS somme FROM ad_etr, ad_dcr, adsys_produit_credit WHERE ad_etr.id_ag=$global_id_agence AND ad_etr.id_ag=ad_dcr.id_ag AND ad_dcr.id_ag=adsys_produit_credit.id_ag AND ad_etr.id_doss = ad_dcr.id_doss AND ad_dcr.id_prod = adsys_produit_credit.id AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) GROUP BY ad_etr.id_doss) AS encours\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $encours_max = $row[0];\n\n // Encours dirigeants\n $sql = \"SELECT SUM(calculeCV(solde_cap, devise, '$global_monnaie')) FROM ad_etr, ad_dcr, adsys_produit_credit, ad_cli WHERE ad_etr.id_ag=$global_id_agence AND ad_etr.id_ag=ad_dcr.id_ag AND ad_dcr.id_ag=adsys_produit_credit.id_ag AND adsys_produit_credit.id_ag=ad_cli.id_ag AND ad_etr.id_doss = ad_dcr.id_doss AND ad_dcr.id_prod = adsys_produit_credit.id AND ad_dcr.id_client = ad_cli.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.qualite = 4\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $encours_dirigeants = $row[0];\n\n // Total épargne\n $sql = \"SELECT SUM(calculeCV(solde, devise, '$global_monnaie')) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_prod <> 2 AND id_prod <> 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n $row = $result->fetchrow();\n $total_epargne = $row[0];\n\n // Tableau de données\n if ($total_epargne == NULL) {\n $DATA['limitation_prets_dirigeants'] = NULL;\n $DATA['limitation_risque_membre'] = NULL;\n $DATA['taux_transformation'] = NULL;\n $DATA['total_epargne'] = NULL;\n } else {\n $DATA['limitation_prets_dirigeants'] += $encours_dirigeants / $total_epargne;\n $DATA['limitation_risque_membre'] += $encours_max / $total_epargne;\n $DATA['taux_transformation'] += $encours_brut / $total_epargne;\n $DATA['total_epargne'] += $total_epargne;\n }\n }\n $dbHandler->closeConnection(true);\n\n return $DATA;\n}",
"function tipoCampo($result, $indice){\n\t // echo \"<br><br>\".mysql_field_type($result, $indice);\n\t\treturn mysql_field_type($result, $indice);\t\n\t}",
"function valore_totale_mio_ordine_lordo($idu,$usr){\r\n$mio_o = valore_totale_mio_ordine($idu,$usr);\r\n//echo \"mio=\".$mio_o.\"<br>\";\r\n\r\n$vto = valore_totale_ordine_qarr($idu);\r\n\r\n//echo \"vto=\".$vto.\"<br>\"; \r\nif ($vto>0){ \r\n$perc = (float)($mio_o/$vto)*100;\r\n\r\n$tras = valore_trasporto($idu,$perc);\r\n//echo \"perc=\".$perc.\"<br>\";\r\n//echo \"tras=\".$tras.\"<br>\"; \r\n$gest =valore_gestione($idu,$perc);\r\n//echo \"perc=\".$perc.\"<br>\"; \r\n//echo $perc;\r\nreturn (float)round($mio_o + $tras + $gest,4);\r\n}else{\r\nreturn \"\"; \r\n\t\r\n}\r\n}",
"public function generarCodigoTipoUsuario() {\n $pdo = Database::connect();\n $sql = \"select max(ID_TIPO_USU) as cod from INV_TAB_TIPO_USUARIO\";\n $consulta = $pdo->prepare($sql);\n $consulta->execute();\n $res = $consulta->fetch(PDO::FETCH_ASSOC);\n $nuevoCod = '';\n if ($res['cod'] == NULL) {\n $nuevoCod = 'TUSU-0001';\n } else { \n $rest= ((substr($res['cod'], -4))+1).''; // Separacion de la parte numerica TUSU-0023 --> 23\n // Ciclo que completa el codigo segun lo retornado para completar los 9 caracteres \n // TUSU-00 --> 67, TUSU-0 --> 786\n if($rest >1 && $rest <=9){\n $nuevoCod = 'TUSU-000'.$rest;\n }else{\n if($rest >=10 && $rest <=99){\n $nuevoCod = 'TUSU-00'.$rest;\n }else{\n if($rest >=100 && $rest <=999){\n $nuevoCod = 'TUSU-0'.$rest;\n }else{\n $nuevoCod = 'TUSU-'.$rest; \n } \n } \n }\n }\n Database::disconnect();\n return $nuevoCod; // RETORNO DEL NUEVO CODIGO DE TIPO USUARIO\n }",
"protected function tipoUbicacion() {\n $where = ' WHERE id_ubi = ' . $this->cargaIdUbicacion();\n $dao = new PGDAO();\n $registro = $this->leeDBArray($dao->execSql($this->DATOSUBICAZP . $where));\n $tipo = $registro[0]['tipo_ubi'];\n return trim(strtoupper($tipo));\n }",
"public function store_facture_honoraire_parrainage(Compromis $compromis, Filleul $filleul)\n{\n\n $parrain_id = $filleul->parrain_id ; \n $pourcentage_parrain = $filleul->pourcentage; \n \n $tva = Tva::coefficient_tva();\n $parrain = User::where('id',$parrain_id)->first();\n // On vérifie si filleul est le porteur d'affaire\n if($compromis->user_id == $filleul->user_id){\n // sil y'a partage\n if($compromis->agent_id == null ){\n $pourcentage_partage = 1;\n }else{\n $pourcentage_partage = $compromis->pourcentage_agent/100;\n }\n \n \n \n // On determine les montants ttc et ht du parrain \n $montant_ht = round ( ($compromis->frais_agence() * $pourcentage_partage * $pourcentage_parrain/100 )/Tva::coefficient_tva(),2);\n $montant_ttc = round($montant_ht*$tva,2);\n \n // on determine les droits de parrainage du parrain pour chacun de ses filleuls\n $result = Filleul::droitParrainage($parrain->id, $filleul->user_id, $compromis->id);\n\n // On vérifie que le parrain n'a pas dépassé le plafond de comm sur son filleul \n\n if($result['ca_comm_parr'] >= $filleul->user->contrat->seuil_comm ){\n $montant_ht = 0;\n $montant_ttc = 0;\n }\n else{\n if( $result['ca_comm_parr'] + $montant_ht > $filleul->user->contrat->seuil_comm ){\n $montant_ht = $filleul->user->contrat->seuil_comm - $result['ca_comm_parr'];\n $montant_ttc = $montant_ht*$tva;\n\n }\n } \n \n \n \n \n \n \n // On fait la facture du parrain de celui qui a crée l'affaire\n if($compromis->facture_honoraire_parrainage_cree == false ){\n $tva = Tva::coefficient_tva();\n\n\n\n $facture = Facture::create([\n \"numero\"=> null,\n \"user_id\"=> $parrain->id,\n \"filleul_id\"=> $filleul->user_id,\n \"compromis_id\"=> $compromis->id,\n \"type\"=> \"parrainage\",\n \"encaissee\"=> false,\n \"montant_ht\"=> round ($montant_ht ,2),\n \"montant_ttc\"=> round( $montant_ttc,2),\n ]);\n // dd($facture);\n // on incremente le chiffre d'affaire du parrain\n $parrain->chiffre_affaire += $facture->montant_ttc ; \n $parrain->update(); \n \n $compromis->facture_honoraire_parrainage_cree = true;\n $compromis->update();\n }\n // On vérifie si filleul est le partage\n }elseif($compromis->agent_id == $filleul->user_id){\n // On fait la facture du parrain du partage\n if($compromis->facture_honoraire_parrainage_partage_cree == false ){\n \n \n $pourcentage_partage = (100 - $compromis->pourcentage_agent)/100;\n \n $tva = Tva::coefficient_tva();\n \n // On determine les montants ttc et ht du parrain \n $montant_ht = round ( ($compromis->frais_agence() * $pourcentage_partage * $pourcentage_parrain/100 )/Tva::coefficient_tva(),2);\n $montant_ttc = round($montant_ht*$tva,2);\n \n // on determine les droits de parrainage du parrain pour chacun de ses filleuls\n $result = Filleul::droitParrainage($parrain->id, $filleul->user_id, $compromis->id);\n \n // On vérifie que le parrain n'a pas dépassé le plafond de comm sur son filleul \n \n if($result['ca_comm_parr'] >= $filleul->user->contrat->seuil_comm ){\n $montant_ht = 0;\n $montant_ttc = 0;\n }\n else{\n if( $result['ca_comm_parr'] + $montant_ht > $filleul->user->contrat->seuil_comm ){\n $montant_ht = $filleul->user->contrat->seuil_comm - $result['ca_comm_parr'];\n $montant_ttc = $montant_ht*$tva;\n \n }\n } \n \n \n \n $facture = Facture::create([\n \"numero\"=> null,\n \"user_id\"=> $parrain->id,\n \"filleul_id\"=> $filleul->user_id,\n \"compromis_id\"=> $compromis->id,\n \"type\"=> \"parrainage_partage\",\n \"encaissee\"=> false,\n \"montant_ht\"=> round ($montant_ht,2),\n \"montant_ttc\"=> round( $montant_ttc,2),\n ]);\n // dd($facture);\n // on incremente le chiffre d'affaire du parrain\n // $parrain->chiffre_affaire += $facture->montant_ttc ; \n // $parrain->update(); \n \n $compromis->facture_honoraire_parrainage_partage_cree = true;\n $compromis->update();\n }\n }\n\n \n\n // On fait la facture du parrain de celui qui ne porte pas l'affaire (le partage)\n // facture_honoraire_parrainage_partage_cree\n \n}"
] |
[
"0.56431574",
"0.55595076",
"0.5524337",
"0.55122524",
"0.54430443",
"0.54414475",
"0.5433013",
"0.5431331",
"0.53535557",
"0.534708",
"0.52851045",
"0.52786314",
"0.5275264",
"0.5262434",
"0.52112865",
"0.5210085",
"0.52068645",
"0.5205547",
"0.519467",
"0.5185007",
"0.5183552",
"0.51747525",
"0.51716423",
"0.5170399",
"0.51544434",
"0.5139547",
"0.5136177",
"0.5125898",
"0.5125526",
"0.51228887"
] |
0.580394
|
0
|
Save all given pairs
|
public function save(array $pairs, $key = null);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function save(iterable $toSave): void;",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"abstract protected function doPairs();",
"public function saveMultiple(array $keysAndValues): void\n {\n foreach ($keysAndValues as $key => $value) {\n $this->save($key, $value);\n }\n }",
"public function saveAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->saveAll();\n }\n }\n }\n }\n $this->save();\n }",
"public function saveParams()\r\n\t{\r\n\t\tforeach ($this->param_names as $param_name)\r\n\t\t{\r\n\t\t\t$funcname = 'get'.$param_name;\r\n\t\t\tif (_PS_VERSION_ < '1.5')\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname());\r\n\t\t\telse\r\n\t\t\t\tConfiguration::updateValue('CERTISSIM_'.Tools::strtoupper($param_name), $this->$funcname(), false, null, $this->getIdshop());\r\n\t\t}\r\n\t}",
"public function saveAll() {\n\t\t$originalCaret = $this->caret;\n\t\tforeach($this as $key => $row) {\n\t\t\t$this->save();\n\t\t}\n\t\t$this->caret = $originalCaret;\n\t}",
"private function save_interests(){\r\n $db = new Database();\r\n $sql = \"delete from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n\r\n foreach($this->interests as $interest){\r\n $sql = \"insert into \" . Person::PERSON_INTEREST_TABLE . \" (person_id, interest_id) values (:person_id, :interest_id)\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->bindParam(':interest_id', $interest->id);\r\n $stm->execute();\r\n }\r\n $pi_stm = \"\";\r\n }",
"private function save(): void\n {\n foreach ($this->dataToSave as $file => $data) {\n $this->langFilesManager->fillKeys($file, $data);\n }\n }",
"function persistAll() ;",
"public function save(array $data);",
"public function saveAll(iterable $post): void;",
"public function save()\n {\n // Save each initialised region\n foreach ($this->regions as $key => $region) {\n $region->save();\n unset($this->regions[$key]);\n }\n }",
"public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}",
"private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }",
"public function saveDetails() \n {\n $bindingId = $this->bindingId;\n $bookList = $this->bookList;\n $scanList = $this->scanList;\n $provenanceList = $this->provenanceList;\n $bindingLanguageList = $this->bindingLanguageList;\n return Database::getInstance()->doTransaction(function() use ($bindingId, $bookList, $scanList, \n $provenanceList, $bindingLanguageList)\n {\n // Save the book list.\n $bookList->setValue('bindingId', $bindingId);\n $bookList->save();\n \n // Load all book details.\n foreach($bookList as $book)\n {\n $book->loadDetails(); \n }\n \n // Save the scan list.\n $scanList->setValue('bindingId', $bindingId);\n $scanList->save();\n \n // Save the provenance list.\n $provenanceList->setValue('bindingId', $bindingId);\n $provenanceList->save();\n \n // Save the language list.\n $bindingLanguageList->setValue('bindingId', $bindingId);\n $bindingLanguageList->save();\n });\n }",
"public function saveMany(array $data): void\n {\n DB::transaction(function () use ($data) {\n foreach ($data as $value) {\n $this->repo->save($value);\n }\n });\n }",
"public function save()\n {\n $pdo = $this->getDbConnection();\n $valuesRow = $this->prepareValuesRow();\n\n $pdo->exec(\"REPLACE INTO {$this->dbTable} (`key`, `value`) VALUES {$valuesRow}\");\n }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function setMultiple( $pairs, $expires = null, array $tags = [] )\n\t{\n\t\t$this->getObject()->setMultiple( $pairs, $expires, $tags );\n\t}",
"protected function saveInfoValues() {\r\n\t\tif(is_a($this->infoValueCollection, 'tx_ptgsaconfmgm_infoValueCollection')) {\r\n\t\t\t\r\n\t\t\tif($this->tableName=='tx_ptconference_domain_model_persdata') {\r\n\t\t\t\t$persArticleUid = $this->rowUid;\r\n\t\t\t\t$relArticleUid = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$persArticleUid = $this->get_persdata();\r\n\t\t\t\t$relArticleUid = $this->rowUid;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tforeach($this->infoValueCollection as $infoValue) {\r\n\t\t\t\t$infoValue->set_persdata($persArticleUid);\r\n\t\t\t\t$infoValue->set_relarticle($relArticleUid);\r\n\t\t\t\t$infoValue->save();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private function save() {\n\t\t// Nur speichern, wenn nötig, also, wenn sich was geändert hat, also\n\t\t// wenn recompute gemacht wurde\n\t\tif ($this->need_recompute) {\n\t\t\tquery(\n\t\t\t\t\"INSERT INTO computed_maps SET world_id={$this->world_id}, \".\n\t\t\t\t\t\"map_id={$this->id}, \".\n\t\t\t\t\t\"time_computed=\".Time::get_t_now().\", \".\n\t\t\t\t\t\"insert_finished=0\"\n\t\t\t);\n\t\t\t$this->last_compute_id =\n\t\t\t\tmysql_result(query(\"SELECT LAST_INSERT_ID()\"),0);\n\t\t\t$this->last_compute_time = Time::get_t_now();\n\n\t\t\t$this->computed_map_data->save($this->last_compute_id);\n\t\t\t$this->computed_buildings_data->save($this->last_compute_id);\n\t\t\t$this->computed_tribes_data->save($this->last_compute_id);\n\t\t\t$this->computed_sector_data->save($this->last_compute_id);\n\t\t\t$this->moving_tribes_data->save();\n\n\t\t\t// TODO: ROLLBACK ON FAILURE\n\n\t\t\tquery(\n\t\t\t\t'UPDATE computed_maps SET insert_finished=1 '.\n\t\t\t\t'WHERE world_id='.$this->world_id.' AND map_id='.$this->id.' '.\n\t\t\t\t\t'AND compute_id='.$this->last_compute_id\n\t\t\t);\n\t\t}\n\t}",
"public function save(array $data = array());",
"public function save()\n {\n $newPackage = [];\n foreach ($this->data as $key => $value){\n if(!isset($this->map[$key]))\n continue;\n $keyMapper = $this->map[$key];\n if(is_subclass_of($value, self::class)){\n $value->save();\n continue;\n }elseif (is_array($value)){\n foreach ($this->data as $model){\n if(is_subclass_of($value, self::class)){\n $model->save();\n }\n }\n }\n $newPackage[$keyMapper] = $value;\n }\n if(isset($this->data['id']) && $this->data['id'])\n $this->db->update($this->table, $newPackage, $this->data['id'], $this->key );\n else\n $this->db->insert($this->table, $newPackage);\n }",
"public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }",
"public function save(array $data)\n {\n }"
] |
[
"0.6184971",
"0.61299485",
"0.5992638",
"0.5966917",
"0.58953214",
"0.58752024",
"0.5843981",
"0.57670194",
"0.55970913",
"0.5565765",
"0.5554117",
"0.54298544",
"0.54282063",
"0.5426447",
"0.5416545",
"0.5374369",
"0.5361146",
"0.534888",
"0.53238934",
"0.53238934",
"0.53238934",
"0.53238934",
"0.53238934",
"0.5303178",
"0.52996385",
"0.52875483",
"0.52599907",
"0.52533996",
"0.52531564",
"0.524711"
] |
0.7648275
|
0
|
Store a newly created restaurant in storage.
|
public function store(CreateRestaurantRequest $request)
{
$rookie = Restaurant::orderBy('id','desc')->first();
$request = $this->saveFiles($request);
$input = $request->all();
if ($rookie == null) {
$number = 1;
}else{
$alias = explode('-',$rookie->alias);
if(isset($alias[1])){
$number = $alias[1]+1;
}else{
$number =1;
}
}
$input['alias'] = 'list-'.$number;
$restaurant = Restaurant::create($input);
return redirect()->route('admin.restaurant.image',$restaurant->id);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function store(CreateRestaurantRequest $request)\n {\n $hash = bin2hex(random_bytes(25));\n $res = Restaurant::create([\n 'name' => $request->input('name'),\n 'country_id' => $request->input('country'),\n 'city_id' => $request->input('city'),\n 'type_food' => $request->input('type_food'),\n 'number' => $request->input('phone'),\n 'description' => $request->input('description'),\n 'approved' => '0',\n 'manager_number' => $request->input('manager_number'),\n 'manager_email' => $request->input('manager_email'),\n 'menu' => $this->saveImage($request->file('menu'), 'images/res-images/menu'),\n 'map_url' => $request->input('location')\n ]);\n $res->appsDelivery()->create(['mrsool' => $request->input('mrsool'), 'logmaty' => $request->input('logmaty'), 'hungerStation' => $request->input('hungerStation'), 'jahiz' => $request->input('jahiz'), 'careemNow' => $request->input('careemNow')]);\n $res->contract()->create(['hash' => $hash , 'approve_at\t' => NULL , 'signed_name' => NULL]);\n return redirect()->to(route('restaurant.index'))->with(['success' => \"Added Restaurant $request->name Successfully\"]);\n }",
"public function store(StoreRestaurantRequest $request)\n {\n $restaurant = new Restaurant;\n $restaurant->name = $request->input('name');\n $restaurant->state = $request->input('state');\n $restaurant->city = $request->input('city');\n $restaurant->suburb = $request->input('suburb');\n $restaurant->post_code = $request->input('post_code');\n $restaurant->business_type = $request->input('business_type');\n $restaurant->address = $request->input('address');\n $restaurant->phone_number = $request->input('phone_number');\n $restaurant->email = $request->input('email');\n $restaurant->status = $request->input('status');\n $restaurant->capacity = $request->input('capacity');\n $restaurant->description = $request->input('description');\n \n if($request->hasFile('logo')) {\n $image = request()->file('logo');\n $name = $restaurant->id . '_' . $restaurant->email . '_logo' . '.' . $image->getClientOriginalExtension();\n $folder = '/uploads/restaurant/logo';\n $filePath = $this->uploadOne($image, $folder, $name);\n $restaurant->logo = $filePath;\n $restaurant->save();\n }\n $restaurant->save();\n\n $user = new RestaurantUser;\n $user->fullname = $request->input('fullname');\n $user->password = Hash::make($request->password);\n $user->phone_number = $request->input('phone_number');\n $user->email = $request->input('email');\n\n $restaurant->user()->save($user);\n\n return new RestaurantResource($restaurant);\n }",
"public function store(Request $request,Restaurant $restaurant )\n {\n $data = $request -> all();\n \n $request -> validate($this->dishValidationArray);\n $newDish = new Dish();\n $newDish->restaurant_id = $restaurant->id;\n $slug = Str::slug($data['name'],\"-\") .\"-\".$restaurant->id;\n $data[\"slug\"] = $slug;\n //upload file\n if(array_key_exists('img', $data)){\n //sta salvando il percorso relativo del file\n $data['img'] = Storage::put('dish_imgs', $data['img']);\n }\n if(array_key_exists('gluten_free', $data) && $data['gluten_free']== 'on' ){\n $data['gluten_free'] = 1;\n }\n if(array_key_exists('vegetarian', $data) && $data['vegetarian']== 'on' ){\n $data['vegetarian'] = 1;\n }\n if(array_key_exists('vegan', $data) && $data['vegan']== 'on' ){\n $data['vegan'] = 1;\n }\n if(array_key_exists('availability', $data) && $data['availability']== 'on' ){\n $data['availability'] = 1;\n }else{\n $data['availability'] = 0;\n }\n $newDish-> fill($data);\n $newDish -> save();\n\n return redirect() -> route('admin.dishes.index', $restaurant->id);\n }",
"public function store()\n\t{\n\t\tif( !$this->validator->passes() )\n\t\t{\n\t\t\treturn Redirect::back()->withInput()->withErrors($this->validator->errors);\n\t\t}\n\t\t\n\t\t$foodEntry = $this->foodEntry->create(Input::all());\n\n\t\treturn Redirect::back()\n\t\t->with('success', 'Entry added successfully');\n\t}",
"public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n tray::updateOrCreate([\n// 'agency_id' => $this->agency_id,\n// 'state_id' => $this->state_id,\n 'name' => $this->name,\n 'logo' => $this->logo,\n 'email' => $this->email,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'address' => $this->address,\n 'facebook' => $this->facebook,\n 'instagram' => $this->instagram,\n 'youtube' => $this->youtube,\n 'viber' => $this->viber,\n 'whatsapp' => $this->whatsapp,\n 'url' => $this->url,\n ]);\n $this->exampleModal = false;\n session()->flash('message',\n $this->tray_id ? 'Tray Updated Successfully.' : 'Tray Created Successfully.');\n\n $this->resetInputFields();\n }",
"public function store() {\n \n }",
"public function store(Request $request)\n {\n \n if(array_key_exists('take_away',$request->all())){\n if($request->take_away === \"on\"){\n $request->merge(['take_away' => true]);\n }\n }\n \n if(array_key_exists('free_delivery',$request->all())){\n if($request->free_delivery === \"on\"){\n $request->merge(['free_delivery' => true]);\n }\n }\n\n $data = $request->all();\n\n $restaurantTypes = array();\n\n if(array_key_exists('restaurant-types', $data)){\n foreach ($data['restaurant-types'] as $value) {\n $restaurantType = RestaurantType::where('name',$value)->firstOrFail();\n $restaurantTypes[] = $restaurantType->id;\n }\n }\n \n\n $request->validate($this->validationArray);\n\n $data['slug'] = Str::of($data['name'])->slug();\n\n if(array_key_exists('img_path', $data)){\n $data['img_path'] = Storage::put('restaurant_image', $data['img_path']);\n }\n\n $newRestaurant = new Restaurant();\n $newRestaurant->fill($data);\n $newRestaurant->user_id = Auth::id();\n\n $newAddress = new Address();\n $newAddress->address = $data['address'];\n $newAddress->city = $data['city'];\n $newAddress->zip_code = $data['zip_code'];\n $newAddress->province = $data['province'];\n $newAddress->country = $data['country'];\n $newAddress->save();\n $newRestaurant->address_id = $newAddress->id;\n $newRestaurant->save();\n \n if(array_key_exists('restaurant-types',$data)){\n $newRestaurant->restaurantTypes()->attach($restaurantTypes);\n }\n return redirect()->route('owner.restaurants.show', $newRestaurant)->with('created', \"Il ristorante $newRestaurant->name è stato creato con successo\");\n }",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store(Request $request){\n\n $request->validate([\n 'title' => 'required',\n 'customers' => 'required',\n 'employees' => 'required',\n ]);\n\n $restaurant = new Restaurant();\n // can be used for seeing the insides of the incoming request\n // var_dump($request->all()); die();\n $restaurant->fill($request->all());\n $restaurant->save();\n return redirect()->route('restaurant.index');\n }",
"public function store();",
"public function store();",
"public function store();",
"public function store(Request $request) {\n\n $this->validate(request(), [\n 'name' => 'required',\n 'username' => 'required',\n 'password' => 'required',\n 'address' => 'required',\n 'status' => 'required',\n 'contact' => 'required',\n 'photo' => 'mimes:jpeg,jpg,png|max:10000'\n ]);\n\n if ($request->hasFile('photo')) {\n $file_name_with_ext = $request->file('photo')->getClientOriginalName();\n $file = pathinfo($file_name_with_ext, PATHINFO_FILENAME);\n $extension = $request->file('photo')->getClientOriginalExtension();\n $file_name = $file . '_' . time() . '.' . $extension;\n $path = $request->file('photo')->move('images/restaurant', $file_name);\n } else {\n $file_name = 'noimage.jpg';\n }\n\n $address = $request->address; \n $apiKey = 'AIzaSyAztLRM2c-6I3w681cHGtNQgjLVzmIQdt0'; \n // Get JSON results from this request\n $geo = file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($address).'&sensor=false&key='.$apiKey);\n $geo = json_decode($geo, true); // Convert the JSON to an array\n\n $latitude = $geo['results'][0]['geometry']['location']['lat']; // Latitude\n $longitude = $geo['results'][0]['geometry']['location']['lng']; // Longitude\n $restaurant = new Restaurant;\n $restaurant->name = $request->name;\n $restaurant->username = $request->username;\n $restaurant->password = Hash::make($request->password);\n $restaurant->address = $address;\n $restaurant->status = $request->status;\n $restaurant->photo = $file_name;\n $restaurant->latitude = $latitude;\n $restaurant->longitude = $longitude;\n $restaurant->contact = $request->contact;\n $restaurant->url = bin2hex(random_bytes(6));\n $restaurant->save();\n $resturant_setting = new Setting;\n $resturant_setting->meta_tag = 'restaurant';\n $resturant_setting->meta_label = 'Accept Delivery By Machine';\n $resturant_setting->meta_key = 'delivery_by_machine';\n \n $resturant_setting->meta_input = 'checkbox';\n $resturant_setting->meta_value = 'no';\n $resturant_setting->restaurant_url = WebHelper::get_restaurant_url($restaurant->id);\n $resturant_setting->save();\n Session::flash('success', 'Restaurant added successfully!');\n return redirect()->route('restaurants.index');\n }",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] |
[
"0.73562443",
"0.69846964",
"0.68687344",
"0.6811879",
"0.6702052",
"0.65909207",
"0.65842867",
"0.65394694",
"0.65394694",
"0.65394694",
"0.6533022",
"0.6525358",
"0.6525358",
"0.6525358",
"0.650872",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855",
"0.64960855"
] |
0.737121
|
0
|
/ db_disconnect Disconnect from the database.
|
function db_disconnect()
{
global $dbh;
if (!isset($dbh))
// Already disconnected.
return;
$dbh->close();
$dbh = NULL;
return;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function db_disconnect()\n\t{\n\t\tpg_close($this->db_connection);\n\t}",
"public function disconnect()\n {\n \t//$GLOBALS['log']->debug('Calling DBManager::disconnect()');\n $close = $this->backendFunctions['close'];\n if(isset($this->database)){\n $this->freeResult();\n if ( is_resource($this->database) || is_object($this->database) )\n\t\t\t\t$close($this->database);\n unset($this->database);\n }\n }",
"private function _disconnect()\n {\n //\tDisconnect\n $this->_db->conn = null;\n $this->_db->clear();\n }",
"abstract protected function dbDisconnect();",
"public function disconnect()\n {\n $this->db->dispose();\n }",
"public function disconnect() {\n $this->db = null;\n }",
"public function disconnectDatabase()\n {\n $this->database->close();\n $this->database = null;\n }",
"public function disconnect() {\n $this->db = null;\n }",
"function dbdisconnect($db_conn){\n\t$db_conn->close();\n}",
"function disconnect(){\n\t\t$this->dbconn = null;\n\t\t$this->logger->info('RECOLIN DB DB disconnected successfully');\n\t}",
"public function disconnect() {\n if (isset($this->database))\n @$this->database->close();\n }",
"public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}",
"public function disconnect() {\n if (isset($this->dbCon) && $this->dbCon) {\n //$this->dbCon = null;\n }\n }",
"function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}",
"protected function disconnect()\n {\n $this->conn_queries = 0;\n @$this->dbh->close();\n }",
"public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}",
"function disconnect_from_db () {\n\tglobal $conn;\n\t$conn = null;\n}",
"function db_disconnect() {\n\n\tmysqli_close();\n}",
"private function _disconnect()\n\t{\n\t\t// you can't close a persistent connection, so don't bother disconnecting\n\t\tif ($this->_persistent === true)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (is_resource($this->_connection) === true)\n\t\t{\n\t\t\tif (mysql_close($this->_connection) === false)\n\t\t\t{\n\t\t\t\tthrow new DbDatabaseException('',\n\t\t\t\t\tDatabaseException::CONNECTION_INVALID);\n\t\t\t}\n\t\t}\n\t\t// clear the connection string\n\t\tunset($this->_connection);\n\t\t$this->_connection = null;\n\t}",
"public function shutdown()\n {\n if ($this->db) {\n $db->disconnect();\n }\n }",
"function disconnect()\n\t{\n\t\tswitch($this->dbtype)\n\t\t{\n\t\t\tcase 'mysql':\n\t\t\t\t@mysql_close($this->handle);\n\t\t\t\tbreak;\n\n\t\t\tcase 'mysqli':\n\t\t\t\t@mysqli_close($this->handle);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function disconnectDb($db)\n{\n return mysqli_close($db);\n}",
"public function disconnect()\n{\n\treturn db2_close($this->dbh);\n}",
"function sql_disconnect(&$dbh=NULL) {\n global $SQL_DBH;\n if (is_null($dbh)) $SQL_DBH = NULL;\n else $dbh = NULL;\n }",
"function disconnect() {\n\t\tmysql_close();\n\t}",
"function dbDisconnect($conn) {\n mysqli_close($conn);\n }",
"function db_disconnect($link) // Colorize: green\n { // Colorize: green\n $link->close(); // Colorize: green\n }",
"public static function disconnect() {\n mysqli_close(self::$link);\n }",
"function Disconnect()\n {\n //SQL::CleanOverhead();\n mysql_close($this->LinkID);\n #$mysqli->close;\n }",
"public function disconnect()\n\t\t{\tif (isset($this->link))\n\t\t\t\t$mysql_close($this->link);\n\n\t\t\tunset($this->link);\n\t\t}"
] |
[
"0.8022694",
"0.7944768",
"0.7857464",
"0.78175557",
"0.7707932",
"0.75994205",
"0.7583037",
"0.7565794",
"0.7537013",
"0.75369",
"0.7500902",
"0.7466556",
"0.73440886",
"0.7240682",
"0.721185",
"0.72073096",
"0.7180985",
"0.71451515",
"0.71189743",
"0.7022725",
"0.6973118",
"0.6961014",
"0.687231",
"0.68376726",
"0.682688",
"0.6816432",
"0.6792334",
"0.67329925",
"0.6690625",
"0.6678141"
] |
0.80149233
|
1
|
/ db_get_feeds Return a list of all feeds. If $inactive is true, fetch inactive feeds as well.
|
function db_get_feeds($inactive = FALSE)
{
global $STALE_DAYS;
$dbh = db_connect();
$query = sprintf(<<<EOT
SELECT *,
UNIX_TIMESTAMP(last_update) as unix_last_update,
IF(DATEDIFF(NOW(),
IFNULL(last_update, '1970-01-01')) > %d, 1, 0) as stale
FROM feeds
EOT
,
$STALE_DAYS);
if (!$inactive)
$query .= "\nWHERE active";
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
$retval = array();
while ($row = $result->fetch_assoc())
{
$row['active'] = $row['active'] ? TRUE : FALSE;
# Make sure 'active' is properly boolean
$retval[$row['id']] = $row;
}
// Also look up any entries in group_members: tell us which
// groups a feed is in.
$query = "SELECT * FROM `group_members`";
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
while (list($member, $parent) = $result->fetch_row())
{
if (!isset($retval[$member]))
continue;
$retval[$member]['groups'][] = $parent;
}
return $retval;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFeeds() {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('feed', 'getAll');\t\t\n\t\t$stm->execute();\n\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$feeds = array();\n\t\twhile($row = $stm->fetchObject()) {\n\t\t\t$feeds[] = $row;\n\t\t}\n\t\treturn $feeds;\n\t}",
"public function getFeeds()\n {\n\n return $this->getFeedMapper()->findByAndOrderBy(array(), array('updated_at' => 'DESC'));\n }",
"public function ddl_feeds()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"SELECT feed_id, \r\n\t\t\t\t\t\t\tfeed_name,\r\n\t\t\t\t\t\t\tfeed_type \r\n\t\t\t\t\t\tFROM feeds\";\r\n\t\t\t\t$result = mysqli_query($link, $query) or die(mysqli_error($link));\r\n\t\t\t\t$feeds = array();\r\n\t\t\t\t$arr_feed = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($result)) {\r\n\t\t\t\t\t\t$feeds['feed_id'] = $row[0];\r\n\t\t\t\t\t\t$feeds['feed_name'] = $row[1];\r\n\t\t\t\t\t\t$feeds['feed_type'] = $row[2];\r\n\t\t\t\t\t\t$arr_feed[] = $feeds;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $arr_feed;\r\n\t\t}",
"function refreshAllFeeds(){\n $conn = new Sgbd();\n $feeds = $conn->selectFromDB(\"all\", \"feeds\", array(\"*\"), array());\n foreach($feeds as $feed){\n self::refreshFeed($feed['id']);\n }\n }",
"Function GetVisibleFeed(){\n\t\t$database=DatabaseName();\n\t\t$query=\"SELECT * FROM `feeds` WHERE `FeedShow` = 1 ORDER BY `FeedID` DESC\";\n\t\tif($result = mysql_query($query)){\n\t\t\t$num_of_rows=mysql_num_rows($result);\n\t\t\tfor($i=0;$i<$num_of_rows;$i++){\n\t\t\t\t$Feeds[$i][0]=mysql_result($result,$i,'FeedID');\n\t\t\t\t$Feeds[$i][1]=mysql_result($result,$i,'FeedTitle');\n\t\t\t\t$Feeds[$i][2]=mysql_result($result,$i,'FeedAuthor');\n\t\t\t\t$Feeds[$i][3]=mysql_result($result,$i,'FeedDate');\n\t\t\t\t$Feeds[$i][4]=mysql_result($result,$i,'FeedContant');\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $Feeds;\n\t\t}\t\n\t}",
"function forum_rss_feeds() {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging('DISABLED (admin variables)');\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging('DISABLED (module configuration)');\n //It's working so we start...\n } else {\n //Iterate over all forums\n if ($forums = get_records(\"forum\")) {\n foreach ($forums as $forum) {\n if (!empty($forum->rsstype) && !empty($forum->rssarticles) && $status) {\n\n $filename = rss_file_name('forum', $forum); // RSS file\n\n //First let's make sure there is work to do by checking existing files\n if (file_exists($filename)) {\n if ($lastmodified = filemtime($filename)) {\n if (!forum_rss_newstuff($forum, $lastmodified)) {\n continue;\n }\n }\n }\n\n //Ignore hidden forums\n if (!instance_is_visible('forum',$forum)) {\n if (file_exists($filename)) {\n @unlink($filename);\n }\n continue;\n }\n\n mtrace(\"Updating RSS feed for \".format_string($forum->name,true).\", ID: $forum->id\");\n\n //Get the XML contents\n $result = forum_rss_feed($forum);\n //Save the XML contents to file\n if (!empty($result)) {\n $status = rss_save_file(\"forum\",$forum,$result);\n }\n if (debugging()) {\n if (empty($result)) {\n echo \"ID: $forum->id-> (empty) \";\n } else {\n if (!empty($status)) {\n echo \"ID: $forum->id-> OK \";\n } else {\n echo \"ID: $forum->id-> FAIL \";\n }\n }\n }\n }\n }\n }\n }\n return $status;\n }",
"public function getFeeds()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('feeds');\n }",
"public function get_rss_blogs_lists()\n\t{\t\t\n\t\t$conditions = 'blog.publish_status = 1 and blog.blog_status = 1';\t\t\t\n\t\t$result = $this->db->from(\"blog\")\n\t\t\t\t\t->join(\"category\",\"category.category_id\",\"blog.category_id\")\n\t\t\t\t\t->where($conditions)\t\t\t\t\t\t\t\t\n\t\t\t\t\t->orderby(\"blog.blog_id\", \"DESC\")\t\t\t\t\t\n\t\t\t\t\t->get();\t\t\t\t\t\t\t\n\t\treturn $result;\n\t}",
"public function listFeeds()\n {\n $feeds = cachedFeedData::where('deleted_at', null)->get();\n\n foreach($feeds as $index => $feed) {\n $feeds[$index]['raw_json'] = json_decode($feeds[$index]['raw_json'], true);\n }\n\n return response()->json($feeds);\n }",
"function populate_feeds($db, $inst_pdomain, $rss_feeds)\n\t{\n\t\t$inst_id_select_stmt\t= db_utilities::create_select_single($db, 'institutions', 'inst_id', 'inst_pdomain');\n\t\t$inst_id_select_stmt->execute(array($inst_pdomain));\n\t\t$inst_id_array\t\t= $inst_id_select_stmt->fetch();\n\t\t$inst_id\t\t= $inst_id_array['inst_id'];\n\n\t\tforeach($rss_feeds as $rss_feed)\n\t\t{\n\t\t\tdata_inserter::populate_single_feed($db, $inst_id, $rss_feed);\n\t\t}\n\t}",
"public function apiListAll()\n {\n $feedTypes = DB::table('feeds_feed_types')\n ->select('feeds_feed_types.*','feeds_feed_type_budgeted_amount_per_day.*')\n ->where('name','!=','None')\n ->leftJoin('feeds_feed_type_budgeted_amount_per_day','feeds_feed_type_budgeted_amount_per_day.feed_type_id','=','feeds_feed_types.type_id')\n ->latest()\n ->get();\n\n $feedTypes = $this->toArray($feedTypes);\n\n return $feedTypes;\n }",
"function readFeedList($force=FALSE)\n\t{\n\t\t$sql = e107::getDb();\n\t\t\n\t\tif ($this->validFeedList && !$force)\n\t\t{\n\t\t\treturn;\t\t// Already got list\n\t\t}\n\t\tif($this->useCache) // Cache enabled - try to read from that first\n\t\t{\t\n\t\t\tif (!$force && $temp = e107::getCache()->retrieve(NEWSFEED_LIST_CACHE_TAG))\n\t\t\t{\n\t\t\t\t$this->feedList = e107::unserialize($temp);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$fieldList = '*';\n\t\t\n\t\tif ($this->useCache)\n\t\t{\t// Get all fields except the actual news\n\t\t\t$fieldList = 'newsfeed_id, newsfeed_name, newsfeed_url, newsfeed_timestamp, newsfeed_description, newsfeed_image, newsfeed_active, newsfeed_updateint';\n\t\t}\n\t\t\n\t\tif ($sql->select(\"newsfeed\", $fieldList, '`newsfeed_active` > 0'))\t\t// Read in all the newsfeed info on the first go\n\t\t{\n\t\t\twhile ($row = $sql->fetch())\n\t\t\t{\n\t\t\t\t$nfID = $row['newsfeed_id'];\n\t\t\t\t\n\t\t\t\tif (!empty($row['newsfeed_data']))\n\t\t\t\t{\n\t\t\t\t\t$this->newsList[$nfID]['newsfeed_data'] = $row['newsfeed_data'];\t\t// Pull out the actual news - might as well since we're here\n\t\t\t\t\t\n\t\t\t\t\tunset($row['newsfeed_data']);\t\t\t// Don't keep this in memory twice!\n\t\t\t\t}\n\t\t\t\t$this->newsList[$nfID]['newsfeed_timestamp'] = $row['newsfeed_timestamp'];\n\t\t\t\t\n\t\t\t\t$this->feedList[$nfID] = $row;\t\t\t\t\t\t// Put the rest into the feed data\n\t\t\t}\n\t\t\t$this->validFeedList = TRUE;\n\t\t}\n\t\t\n\t\tif ($this->useCache) // Cache enabled - we need to save some updated info\n\t\t{\n\t\t\t$temp = e107::serialize($this->feedList, FALSE);\n\t\t\te107::getCache()->set(NEWSFEED_LIST_CACHE_TAG,$temp);\n\t\t}\n\t}",
"function get_entries(){\n\t\t $db = $this->db;\n\t\t \n\t\t if(!$this->itemType){\n\t\t\t\t$whereCondition = true;\n\t\t }\n\t\t else{\n\t\t\t\t$whereCondition = \" itemType = '\".$this->itemType.\"' \";\n\t\t }\n\t\t \n\t\t $sql = \"SELECT *\n\t\t\t FROM noid_bindings\n\t\t\t WHERE \".$whereCondition.\"\n\t\t\t ORDER BY ItemUpdated DESC\n\t\t\t LIMIT \".($this->recStart ).\",\".self::entriesPerPage.\"\n\t\t\t \";\n\t\t\t \n\t\t //note: I did check this. Order ItemUpdated by DESC makes the most recently updated item 1st in the feed.\n\t\t \n\t\t $result = $db->fetchAll($sql, 2);\n\t\t\t\t if($result){\n\t\t\t\t$this->feedItems = $result;\n\t\t }\n\t\t else{\n\t\t\t\t$this->feedItems = false;\n\t\t }\n }",
"public function feeds()\n {\n // require authentication\n // check_authentication();\n\n $where = array(\n 'sa.Status = 2'\n );\n\n if (get_post('latest')) {\n $where[] = 'sa.DateCompleted > \"' . date('Y-m-d H:i:s', get_post('latest')) . '\"';\n }\n\n if (get_post('department')) {\n $where[] = 'ss.DepartmentID = \"' . (int) get_post('department') . '\"';\n }\n\n if (get_post('locScope')) {\n $where[] = 'ss.LocationScopeID = \"' . (int) get_post('locScope') . '\"';\n }\n\n if (get_post('keyword')) {\n $keyword = $this->db->escape_like_str(get_post('keyword'));\n $where[] = '(ss.Name LIKE \"%'.$keyword.'%\" OR ss.Description LIKE \"%'.$keyword.'%\")'; \n }\n\n $raw_feeds = $this->mgovdb->getFeeds($where);\n\n $feeds = array();\n $providedCounts = array();\n\n foreach ($raw_feeds as $v) {\n\n $userData = user_account_details($v['ApplicantID'], 'id');\n\n $v['userFullname'] = user_full_name($userData, '');\n $v['userAddress'] = user_full_address($userData);\n $v['userAvatar'] = public_url('assets/profile/') . photo_filename($userData->Photo);\n if ($v['SubDepartmentID']) {\n $v['departmentName'] = lookup_db('Dept_ChildDepartment', 'Name', $v['SubDepartmentID']);\n } else {\n $v['departmentName'] = lookup_db('Dept_Departments', 'Name', $v['DepartmentID']);\n }\n $v['serviceDate'] = date('F d, Y', strtotime($v['DateCompleted']));\n $v['Logo'] = public_url('assets/logo/') . logo_filename($v['Logo']);\n $v['serviceQR'] = public_url('assets/qr/') . get_qr_file($v['ServiceCode'], 4);\n\n $providedCounts[$v['DepartmentID']] = get_department_service_provided($v['DepartmentID'], $providedCounts);\n $v['serviceProvided'] = number_format($providedCounts[$v['DepartmentID']]);\n $v['serviceProvider'] = get_service_providers($v['ServiceID'], true);\n\n $feeds[] = $v;\n\n }\n\n if (count($feeds)) {\n response_json(array(\n 'status' => true,\n 'timestamp' => time(),\n 'data' => $feeds\n ));\n } else {\n response_json(array(\n 'status' => false,\n 'message' => 'No new items found.'\n ));\n }\n\n }",
"function db_get_feed($id)\n{\n\tglobal $STALE_DAYS;\n\n\t$dbh = db_connect();\n\n\t$query = sprintf(<<<EOT\nSELECT\t*,\n\tUNIX_TIMESTAMP(last_update) as unix_last_update,\n\tIF(DATEDIFF(NOW(),\n\t\t IFNULL(last_update, '1970-01-01')) > %d, 1, 0) as stale\nFROM\t`feeds`\nWHERE\tid = %d\nEOT\n\t\t,\n\t\t$STALE_DAYS,\n\t\t$id);\n\t$result = $dbh->query($query);\n\tif ($result->num_rows <= 0)\n\t\t// No matching feeds\n\t\treturn NULL;\n\t$row = $result->fetch_assoc();\n\t$retval = $row;\n\n\t// Also look up any entries in group_members: tell us which\n\t// groups the feed is in.\n\t$retval['groups'] = array();\n\t$query = sprintf(<<<EOT\nSELECT\tparent\nFROM\t`group_members`\nWHERE\tmember=%d\nEOT\n\t\t,\n\t\t$id);\n\t$result = $dbh->query($query);\n\twhile ($row = $result->fetch_row())\n\t{\n\t\t$retval['groups'][] = $row[0];\n\t}\n\n\treturn $retval;\n}",
"function db_get_all_feed_counts()\n{\n\t$dbh = db_connect();\n\n\t/* Get the number of read/unread items in each feed. This uses\n\t * the `counts` table, which is updated by MySQL triggers.\n\t */\n\t$query = <<<EOT\nSELECT\t\tfeed_id AS `feed_id`,\n\t\tnum_read AS `read`,\n\t\ttotal-num_read AS `unread`\nFROM\t\t`counts`\nEOT;\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\t\treturn NULL;\n\t}\n\n\t$retval = array();\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t// XXX - Error-checking\n\t\t$feed_id = $row['feed_id'];\n\t\tunset($row['feed_id']);\n\t\t$retval[$feed_id] = $row;\n\t}\n\n\treturn $retval;\n}",
"public static function getFeeds(&$params)\n\t{\n\t\tself::$lastError=\"\";\n\t\t$client_id = $params->get('client_id', '');\n\t\t$client_secret = $params->get('client_secret', '');\n\t\t$pagename = $params->get('pagename', '');\n\t\t$feedcount = $params->get('feed_count', '5');\n\t\t$width = $params->get('width', '100%');\n\t\t$height = $params->get('height', '');\n\t\t$videowidth = $params->get('videowidth', '');\n\t\tif ($videowidth!='') $videowidth=\" width='$videowidth'\";\n\t\t$videoheight = $params->get('videoheight', '');\n\t\tif ($videoheight!='') $videoheight=\" height='$videoheight'\";\n\t\t\n\t\t$comment_text = $params->get('comment_text', '');\n\t\tif ($comment_text=='') $comment_text=JText::_(\"MOD_HEC_FACEBOOK_FEED_TEMPLATE_COMMENT\");\n\t\t$photo_title_text = $params->get('photo_title_text', '');\n\t\tif ($photo_title_text=='') $photo_title_text=JText::_(\"MOD_HEC_FACEBOOK_FEED_TEMPLATE_PICTURE\");\n\t\t$video_title_text = $params->get('video_title_text', '');\n\t\tif ($video_title_text=='') $video_title_text=JText::_(\"MOD_HEC_FACEBOOK_FEED_TEMPLATE_VIDEO\");\n\t\t$link_title_text = $params->get('link_title_text', '');\n\t\tif ($link_title_text=='') $link_title_text=JText::_(\"MOD_HEC_FACEBOOK_FEED_TEMPLATE_LINK\");\n\t\t$default_title_text = $params->get('default_title_text', '');\n\t\tif ($default_title_text=='') $default_title_text=JText::_(\"MOD_HEC_FACEBOOK_FEED_TEMPLATE_DEFAULT\");\n\t\t\n\t\t$show_events = ($params->get('show_events', '0')=='1');\n\t\t\n\t\t$user = JFactory::getUser();\n\t\t$language = $user->getParam('language', 'fr_FR');\n\t\t$feeds = array();\n\t\t$url = 'https://graph.facebook.com/oauth/access_token?client_id='.$client_id.'&client_secret='.$client_secret.'&grant_type=client_credentials';\n\t\t//$url = 'https://graph.facebook.com/'.$pagename.'/accounts?client_id='.$client_id.'&client_secret='.$client_secret.'&grant_type=client_credentials';\n\t\t$tokenresp = file_get_contents($url);\n\t\tif ($tokenresp)\n\t\t{\n\t\t\t$tokendata=json_decode($tokenresp);\n\t\t\t$token = $tokendata->access_token;\n\t\t\t//$tokenresp=explode('=',$tokenresp);\n\t\t\t//$token=$tokenresp[1];\n\t\t\t// Photos : https://graph.facebook.com/mach78rc/photos?fields=created_time,id,status_type,type,story,message,source,picture,link,name,description,icon,parent_id&access_token=1407222099294113|CmpdVxUxfZTgx4b9Ne9aTtIMrPg\n\t\t\t$url='https://graph.facebook.com/'.$pagename.'/feed?fields=created_time,id,status_type,type,story,message,source,picture,link,name,description,icon,parent_id,attachments&limit='.$feedcount.'&locale=$language&access_token='.$token;\n\t\t\t$payload = file_get_contents($url);\n\t\t\tif (!$payload) \n\t\t\t{\n\t\t\t\tself::$lastError = \"Bad feed answer\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$data = json_decode($payload);\n\t\t\t$n=0;\n\t\t\tforeach($data->data as $e)\n\t\t\t{\n\t\t\t\t$n++;\n\t\t\t\t$remove=false;\n\t\t\t\t$item=new stdClass();\n\t\t\t\t$item->content =\"\";\n\t\t\t\t$item->created_time= DateTime::createFromFormat('Y-m-d\\TH:i:s+O', $e->created_time);\n\t\t\t\t$item->id=$e->id;\n\t\t\t\t$item->link=$e->link;\n\t\t\t\tif (isset($e->message)) { $item->message=ModHECFacebookFeedHelper::addA($e->message) ;\t}\telse\t{ $item->message=\"\";\t}\n\t\t\t\tif (isset($e->description)) { $item->description=ModHECFacebookFeedHelper::addA($e->description);\t}\telse\t{ $item->description=\"\";\t}\n\t\t\t\tswitch ($e->status_type)\n\t\t\t\t{\n\t\t\t\t\tcase 'shared_story':\n\t\t\t\t\t\tswitch($e->type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'photo':\n\t\t\t\t\t\t\t\t$photourl=$e->picture;\n\t\t\t\t\t\t\t\tif (isset($e->attachments))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$media=$e->attachments->data[0]->media;\n\t\t\t\t\t\t\t\t\tif ($media)\n\t\t\t\t\t\t\t\t\t\t$photourl=$media->image->src;\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}\n\t\t\t\t\t\t\t\t$item->title = str_replace(\"{name}\", $e->name, $photo_title_text );\n\t\t\t\t\t\t\t\t$item->content = \"<img src='\".$photourl.\"' class='photo-image' />\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'video':\n\t\t\t\t\t\t\t\t$item->title = str_replace(\"{name}\", $e->name, $video_title_text );\n\t\t\t\t\t\t\t\t$item->content=\"<video id='my-video-\".$n.\"' class='video-js' controls preload='none' $videoheight $videowidth\n\t\t\t\t\t\t\t\t\t\t\tdata-setup='{\\\"language\\\":\\\"fr\\\"}' poster='\".$e->picture.\"'>\n\t\t\t\t\t\t\t\t\t\t\t<source src='\".$e->source.\"' type='video/mp4'>\n\t\t\t\t\t\t\t\t\t\t\t<p class='vjs-no-js'>To view this video please enable JavaScript</p>\n\t\t\t\t\t\t\t\t\t\t</video>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'link':\n\t\t\t\t\t\t\t\t$item->title = str_replace(\"{name}\", $e->name, $link_title_text );\n\t\t\t\t\t\t\t\t$item->content = \"<img src='\".$e->picture.\"' class='link-image' />\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$item->title = str_replace(\"{name}\", $e->name, $default_title_text );\n\t\t\t\t\t\t\t\t$item->content =\"\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'added_photos':\n\t\t\t\t\tcase 'created_event':\n\t\t\t\t\t\t$remove=true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$item->title = $e->story;\n\t\t\t\t\t\t$item->content =\"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($e->type=='event' && !$show_events) $remove=true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (!$remove)\n\t\t\t\t\t$feeds[]=$item;\n\t\t\t}\n\t\t\tself::$lastError = \"OK : \".count($feeds).\" feeds\";\n\t\t\treturn $feeds;\n\t\t}\n\t\telse \n\t\t{\n\t\t\tself::$lastError = \"Error Token\";\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getAllFeeds($objDC)\n\t{\n\t\t$objFeeds = \\PCT\\CustomCatalog\\Models\\FeedModel::findAll();\n\t\tif($objFeeds === null)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$arrReturn = array();\n\t\twhile($objFeeds->next())\n\t\t{\n\t\t\t$arrReturn[ $objFeeds->id ] = $objFeeds->title ?: $objFeeds->alias;\n\t\t}\n\t\n\t\treturn $arrReturn;\n\t}",
"public function getFeeds(){\n $feeds = Feed::query()->get();\n return Response::raw(200,[\"feeds\" => $feeds]);\n }",
"public function get_feed(): array\n {\n $feed_entries = $this->feedRepository->get_full_feed();\n\n $user_id = $this->sessionService->get_active_user_id();\n\n $filled_feed_entries = array();\n\n foreach ($feed_entries as $entry) {\n $filled_feed_entries[] = $this->convert_feed_database_entry_to_feed_entry($entry, $user_id);\n }\n\n return $filled_feed_entries;\n }",
"public function actionGetFacebookFeeds() {\n Yii::app()->user->SiteSessions;\n $feeds = array();\n $json_res = Yii::app()->curl\n ->setOption(CURLOPT_HTTPHEADER, array('Content-type: application/json'))\n ->post(\"https://www.facebook.com/feeds/page.php?id=175377742595349&format=json\", array());\n $json_arr = CJSON::decode($json_res);\n if (!empty($json_arr['entries'])) {\n $feeds = array_slice($json_arr['entries'], 0, 5);\n }\n\n $this->renderPartial(\"//site/_facebook_feeds\", array(\"feeds\" => $feeds));\n }",
"public function index()\n {\n $feeds = Feed::all();\n\n return $feeds;\n }",
"public function getDataBaseFeeds()\n {\n return $this->dataBaseFeeds;\n }",
"public function getRegisteredFeeds(): array\n {\n return array_unique( $this->_feedUrls );\n }",
"function getList($params)\n {\n\n if (trim($params->get('taccount')) == '') {\n return false;\n }\n $rssUrl = \"http://api.twitter.com/1/statuses/user_timeline/\" . $params->get('taccount') . \".rss?count=\" . $params->get('show_limit');\n\n // get RSS parsed object\r\n $options = array();\n $options['rssUrl'] = $rssUrl;\n if ($params->get('enable_cache')) {\n $options['cache_time'] = $params->get('cache_time');\n $options['cache_time'] *= 60;\n } else {\n $options['cache_time'] = null;\n }\n\n $rssDoc = JFactory::getXMLparser('RSS', $options);\n\n if ($rssDoc != false) {\n $items = $rssDoc->get_items();\n return $items;\n } else {\n return false;\n }\n }",
"public static function _return_feeds($feed_uids = array()) {\n\t\n\t$data = array();\n\t\n\tforeach($feed_uids as $service => $id) {\n\t\tswitch($service) {\n\t\t\tcase 'facebook':\n\t\t\t\t$data['facebook'] = 'http://www.facebook.com/feeds/page.php?format=atom10&id=' . $feed_uids['facebook'];\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'flickr':\n\t\t\t\t$data['flickr'] = 'http://api.flickr.com/services/feeds/photos_public.gne?id=' . $feed_uids['flickr'] . '&lang=en-us&format=rss_200';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'twitter':\n\t\t\t\t$data['twitter'] = 'http://twitter.com/statuses/user_timeline/' . $feed_uids['twitter'] . '.rss';\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'youtube':\n\t\t\t\t$data['youtube'] = 'http://gdata.youtube.com/feeds/base/users/' . $feed_uids['youtube'] . '/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile';\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t\treturn $data;\n\t}",
"function forum_rss_feed($forum) {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging(\"DISABLED (admin variables)\");\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging(\"DISABLED (module configuration)\");\n //It's working so we start...\n } else {\n //Check the forum has rss activated\n if (!empty($forum->rsstype) && !empty($forum->rssarticles)) {\n //Depending of the forum->rsstype, we are going to execute, different sqls\n if ($forum->rsstype == 1) { //Discussion RSS\n $items = forum_rss_feed_discussions($forum);\n } else { //Post RSS\n $items = forum_rss_feed_posts($forum);\n\n }\n //Now, if items, we begin building the structure\n if (!empty($items)) {\n //First all rss feeds common headers\n $header = rss_standard_header(strip_tags(format_string($forum->name,true)),\n $CFG->wwwroot.\"/mod/forum/view.php?f=\".$forum->id,\n format_string($forum->intro,true));\n //Now all the rss items\n if (!empty($header)) {\n $articles = rss_add_items($items);\n }\n //Now all rss feeds common footers\n if (!empty($header) && !empty($articles)) {\n $footer = rss_standard_footer();\n }\n //Now, if everything is ok, concatenate it\n if (!empty($header) && !empty($articles) && !empty($footer)) {\n $status = $header.$articles.$footer;\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n }\n }\n return $status;\n }",
"public function getMoreFeedList($company_id, $last_fetched_feed_id, $category){\r\n\t\t$body = \"\";\r\n\t\t//get first and last name of the person who posted this\r\n\t\t$this->load->model(\"general\");\r\n\t\t//$query = $this->db->get_where(\"sc_accounts_feeds\", array(\"company_id\"=>$company_id));\r\n\t\t$query = $this\r\n\t\t\t\t->db\r\n\t\t\t\t->where(\"company_id\", $company_id)\r\n\t\t\t\t->where(\"category\", $category)\r\n\t\t\t\t->order_by(\"id\", \"desc\")\r\n\t\t\t\t->get(\"sc_feeds\", 5, $last_fetched_feed_id);\r\n\r\n\t if ($query->num_rows() > 0){\r\n\t\t\t$results = $query->result();\r\n\t\t\tforeach($results as $row){\r\n\t\t\t\t$date_entered = 0;\r\n\t\t\t\t$user_name = $this->general->getFirstLastName($row->by_uacc_id);\r\n\t\t\t\t$date_entered = $this->general->timeAgo(date('Y-m-d H:i:s', strtotime($row->date_entered.' UTC')));\r\n\t\t\t\t$feed_user_image_name = $this->general->getProfilePictureName($row->by_uacc_id);\r\n\t\t\t\t$feed_user_icon = $this->general->DisplayOtherUserIcon($feed_user_image_name->upro_filename_original);\r\n\r\n\t\t\t\t$body .= '\r\n\t\t\t\t\t\t\t<div class=\"feed-item feed-item-bookmark\">\r\n\t\t\t\t\t\t\t\t<div class=\"feed-icon\">\r\n\t\t\t\t\t\t\t\t\t'.$feed_user_icon.'\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<!-- /.feed-icon -->\r\n\t\t\t\t\t\t\t<div class=\"feed-headline\">\r\n\t\t\t\t\t\t\t\t<span class=\"feed-subject\">' . $user_name->upro_first_name . \" \" . $user_name->upro_last_name . '</span><br/>\r\n\r\n\t\t\t\t\t\t\t\t<i class=\"fa fa-clock-o\"></i> <span class=\"feed-time\">' . $date_entered . '</span>\r\n\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div class=\"feed-content\">' . $row->description . '</div>\r\n\t\t\t\t\t\t\t\t<!-- /.feed-content -->\r\n\t\t\t\t\t\t\t\t<!-- /.feed-actions -->\r\n\t\t\t\t\t\t\t</div>';\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn array($body, $query->num_rows());\r\n\t}",
"public function get_blog_articles()\n {\n unset($this->blogs);\n\n parent::con();\n\n $sql=\"select * from blogs\";\n\n $res=mysql_query($sql);\n \n while ($reg=mysql_fetch_assoc($res))\n {\n $this->blogs[]=$reg;\n }\n return $this->blogs; \n\n mysql_free_result($reg); \n }",
"public function find(array $available_feeds = null, string $feed = null ): array\n {\n $results = [];\n if( $available_feeds == null ){\n $available_feeds = $this->settings;\n }\n\n \n if( $feed !== null && ! isset( $available_feeds[$feed] ) ){\n $this->manageError('The feed '.$feed.' is undefined');\n }\n \n if( $feed !== null ){\n $results[$feed] = $this->formatFeed($this->request($feed, $available_feeds[$feed]));\n } else { \n foreach( $available_feeds as $feed_name => $url ){\n $results[$feed_name] = $this->formatFeed($this->request($feed_name, $available_feeds[$feed_name]));\n }\n }\n \n return $results;\n }"
] |
[
"0.7037932",
"0.6183341",
"0.60998935",
"0.6078244",
"0.60161334",
"0.5915293",
"0.5899484",
"0.5896902",
"0.5717283",
"0.5708423",
"0.5706275",
"0.5701913",
"0.5657658",
"0.5653278",
"0.5645772",
"0.56132054",
"0.557661",
"0.5574838",
"0.5548279",
"0.554763",
"0.55330944",
"0.5515673",
"0.5495892",
"0.54398406",
"0.54166406",
"0.5388467",
"0.538531",
"0.5346485",
"0.53435016",
"0.5341419"
] |
0.80015373
|
0
|
/ db_get_feed_counts Get the number of read/unread articles in a feed, as well as the latest publication time and update time of any article in the feed. Returns an array of the form array( 'read'=> 150, 'unread'=> 12, );
|
function db_get_feed_counts($feed_id)
{
$dbh = db_connect();
/* Get the number of read/unread items */
$query = sprintf(<<<EOT
SELECT num_read AS `read`,
total-num_read AS `unread`
FROM `counts`
WHERE feed_id = %d
EOT
,
$feed_id);
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
$retval = $result->fetch_assoc();
// XXX - Error-checking
return $retval;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function db_get_all_feed_counts()\n{\n\t$dbh = db_connect();\n\n\t/* Get the number of read/unread items in each feed. This uses\n\t * the `counts` table, which is updated by MySQL triggers.\n\t */\n\t$query = <<<EOT\nSELECT\t\tfeed_id AS `feed_id`,\n\t\tnum_read AS `read`,\n\t\ttotal-num_read AS `unread`\nFROM\t\t`counts`\nEOT;\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\t\treturn NULL;\n\t}\n\n\t$retval = array();\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t// XXX - Error-checking\n\t\t$feed_id = $row['feed_id'];\n\t\tunset($row['feed_id']);\n\t\t$retval[$feed_id] = $row;\n\t}\n\n\treturn $retval;\n}",
"function getCounts($messages)\n{\n\t$counter = array(\n\t\t'totalMessages' => 0,\n\t\t'unreadMessages' => 0,\n\t);\n\n\tforeach ($messages as $message)\n\t{\n\t\tif ($message['unread'])\n\t\t\t$counter['unreadMessages']++;\n\t\t$counter['totalMessages']++;\n\t}\n\n\treturn $counter;\n}",
"function messages_count_unread() {\n\t$user_guid = elgg_get_logged_in_user_guid();\n\t$db_prefix = elgg_get_config('dbprefix');\n\n\t// denormalize the md to speed things up.\n\t// seriously, 10 joins if you don't.\n\t$strings = array('toId', $user_guid, 'readYet', 0, 'msg', 1);\n\t$map = array();\n\tforeach ($strings as $string) {\n\t\t$id = get_metastring_id($string);\n\t\t$map[$string] = $id;\n\t}\n\n\t$options = array(\n//\t\t'metadata_name_value_pairs' => array(\n//\t\t\t'toId' => elgg_get_logged_in_user_guid(),\n//\t\t\t'readYet' => 0,\n//\t\t\t'msg' => 1\n//\t\t),\n\t\t'type' => 'object',\n\t\t'subtype' => 'messages',\n\t\t'joins' => array(\n\t\t\t\"JOIN {$db_prefix}metadata msg_toId on e.guid = msg_toId.entity_guid\",\n\t\t\t\"JOIN {$db_prefix}metadata msg_readYet on e.guid = msg_readYet.entity_guid\",\n\t\t\t\"JOIN {$db_prefix}metadata msg_msg on e.guid = msg_msg.entity_guid\",\n\t\t),\n\t\t'wheres' => array(\n\t\t\t\"msg_toId.name_id='{$map['toId']}' AND msg_toId.value_id='{$map[$user_guid]}'\",\n\t\t\t\"msg_readYet.name_id='{$map['readYet']}' AND msg_readYet.value_id='{$map[0]}'\",\n\t\t\t\"msg_msg.name_id='{$map['msg']}' AND msg_msg.value_id='{$map[1]}'\",\n\t\t),\n\t\t'owner_guid' => $user_guid,\n\t\t'count' => true,\n\t\t'site_guids' => false // Message inbox is over all subsites\n\t);\n\n\treturn elgg_get_entities_from_metadata($options);\n}",
"public function getCounter()\n {\n $messages = [\n 'read' => 0,\n 'unread' => 0\n ];\n\n foreach ($this->messages as $message) {\n if ($message->getIsRead()) {\n $messages['read']++;\n } else {\n $messages['unread']++;\n }\n }\n\n return $messages;\n }",
"function get_unread_forcasts_count($user_id)\n\t{\n\t}",
"public function getAllWithPostsCounts();",
"function getCount() {\n $this->putCount();\n //opens countlog.data to read the number of hits\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n return $count;\n }",
"public function getArticleCount()\n {\n return Db::query('\n SELECT * FROM article');\n }",
"public function getNumUnreadAlerts()\n\t{\n\t\t$num = $this->db->simple_select('alerts', 'COUNT(id) AS count', 'uid = '.(int) $this->mybb->user['uid'].' AND unread = 1');\n\t\treturn (int) $this->db->fetch_field($num, 'count');\n\t}",
"public function countItems() {\n\t\t$count = elgg_get_entities([\n\t\t\t'types' => 'object',\n\t\t\t'subtypes' => 'notification',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\treturn $count;\n\t}",
"public function countBlogEntryLikes() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_rating\n\t\t\tWHERE\tobjectName = ?\n\t\t\t\tAND userID <> ?\n\t\t\t\tAND rating NOT IN (?, ?)\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute(array('com.woltlab.wcf.user.blog.entry', 0, 0, 3));\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}",
"public function getCount() {\n return $this->get(self::COUNT);\n }",
"function getDBcounts( )\n{\n\t// \"frequency\" is how often data was collected eg \"Annual\"\n\tglobal $fields, $connect;\n\t$queryreg = mysqli_query($connect, \"\n\t \tSELECT * from counts ORDER BY count DESC\");\n\n\twhile($row = mysqli_fetch_array($queryreg,MYSQLI_ASSOC))\n\t{\n\t\t$fields[$row['field']] = $row['count']; \n\t//\techo \"<BR>\" . $row['field'] . ' = ' . $row['count'];\n\t}\n}",
"protected function getCounts()\n\t{\n\t\tif(!$this->counts)\n\t\t{\n\t\t\tforeach($this->folders as $id)\n\t\t\t{\n\t\t\t\t$this->counts[$id] = Mail::where('folder', '=', $id)->count();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->counts;\n\t}",
"public static function getEventCounts( $args = array() ) {\n\t\t\t_deprecated_function( __METHOD__, '3.10.1' );\n\t\t\tglobal $wpdb;\n\t\t\t$date = date( 'Y-m-d' );\n\t\t\t$defaults = array(\n\t\t\t\t'post_type' => Tribe__Events__Main::POSTTYPE,\n\t\t\t\t'start_date' => tribe_beginning_of_day( $date ),\n\t\t\t\t'end_date' => tribe_end_of_day( $date ),\n\t\t\t\t'display_type' => 'daily',\n\t\t\t\t'hide_upcoming_ids' => null,\n\t\t\t);\n\t\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\t\t$args['posts_per_page'] = - 1;\n\t\t\t$args['fields'] = 'ids';\n\n\t\t\t// remove empty args and sort by key, this increases chance of a cache hit\n\t\t\t$args = array_filter( $args, array( __CLASS__, 'filter_args' ) );\n\t\t\tksort( $args );\n\n\t\t\t$cache = new Tribe__Cache();\n\t\t\t$cache_key = 'daily_counts_and_ids_' . serialize( $args );\n\t\t\t$found = $cache->get( $cache_key, 'save_post' );\n\t\t\tif ( $found ) {\n\n\t\t\t\treturn $found;\n\t\t\t}\n\n\t\t\t$cache_key = 'month_post_ids_' . serialize( $args );\n\t\t\t$found = $cache->get( $cache_key, 'save_post' );\n\t\t\tif ( $found && is_array( $found ) ) {\n\t\t\t\t$post_ids = $found;\n\t\t\t} else {\n\t\t\t\t$post_id_query = new WP_Query();\n\t\t\t\t$post_ids = $post_id_query->query( $args );\n\t\t\t\t$cache->set( $cache_key, $post_ids, Tribe__Cache::NON_PERSISTENT, 'save_post' );\n\t\t\t}\n\n\t\t\t$counts = array();\n\t\t\t$event_ids = array();\n\t\t\tif ( ! empty( $post_ids ) ) {\n\t\t\t\tswitch ( $args['display_type'] ) {\n\t\t\t\t\tcase 'daily':\n\t\t\t\t\tdefault :\n\t\t\t\t\t\t$wp_query = tribe_get_global_query_object();\n\n\t\t\t\t\t\t$output_date_format = '%Y-%m-%d %H:%i:%s';\n\t\t\t\t\t\t$start_date_sql = esc_sql( $post_id_query->query_vars['start_date'] );\n\t\t\t\t\t\t$end_date_sql = esc_sql( $post_id_query->query_vars['end_date'] );\n\t\t\t\t\t\t$sql_ids = esc_sql( implode( ',', array_map( 'intval', $post_ids ) ) );\n\n\t\t\t\t\t\t$raw_counts = $wpdb->get_results( \"\n\t\t\t\t\t\t\tSELECT \ttribe_event_start.post_id as ID,\n\t\t\t\t\t\t\t\t\ttribe_event_start.meta_value as EventStartDate,\n\t\t\t\t\t\t\t\t\tDATE_FORMAT( tribe_event_end_date.meta_value, '{$output_date_format}') as EventEndDate,\n\t\t\t\t\t\t\t\t\t{$wpdb->posts}.menu_order as menu_order\n\t\t\t\t\t\t\tFROM $wpdb->postmeta AS tribe_event_start\n\t\t\t\t\t\t\t\t\tLEFT JOIN $wpdb->posts ON (tribe_event_start.post_id = {$wpdb->posts}.ID)\n\t\t\t\t\t\t\tLEFT JOIN $wpdb->postmeta as tribe_event_end_date ON ( tribe_event_start.post_id = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' )\n\t\t\t\t\t\t\tWHERE tribe_event_start.meta_key = '_EventStartDate'\n\t\t\t\t\t\t\tAND tribe_event_start.post_id IN ( {$sql_ids} )\n\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\ttribe_event_start.meta_value >= '{$start_date_sql}'\n\t\t\t\t\t\t\t\t\tAND tribe_event_start.meta_value <= '{$end_date_sql}'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tOR (\n\t\t\t\t\t\t\t\t\ttribe_event_end_date.meta_value >= '{$start_date_sql}'\n\t\t\t\t\t\t\t\t\tAND tribe_event_end_date.meta_value <= '{$end_date_sql}'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tOR (\n\t\t\t\t\t\t\t\t\ttribe_event_start.meta_value < '{$start_date_sql}'\n\t\t\t\t\t\t\t\t\tAND tribe_event_end_date.meta_value > '{$end_date_sql}'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tORDER BY menu_order ASC, DATE(tribe_event_start.meta_value) ASC, TIME(tribe_event_start.meta_value) ASC;\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$start_date = new DateTime( $post_id_query->query_vars['start_date'] );\n\t\t\t\t\t\t$end_date = new DateTime( $post_id_query->query_vars['end_date'] );\n\t\t\t\t\t\t$days = Tribe__Date_Utils::date_diff( $start_date->format( 'Y-m-d' ), $end_date->format( 'Y-m-d' ) );\n\t\t\t\t\t\t$term_id = isset( $wp_query->query_vars[ Tribe__Events__Main::TAXONOMY ] ) ? $wp_query->query_vars[ Tribe__Events__Main::TAXONOMY ] : null;\n\t\t\t\t\t\t$terms = array();\n\t\t\t\t\t\tif ( is_int( $term_id ) ) {\n\t\t\t\t\t\t\t$terms[0] = $term_id;\n\t\t\t\t\t\t} elseif ( is_string( $term_id ) ) {\n\t\t\t\t\t\t\t$term = get_term_by( 'slug', $term_id, Tribe__Events__Main::TAXONOMY );\n\t\t\t\t\t\t\tif ( $term ) {\n\t\t\t\t\t\t\t\t$terms[0] = $term->term_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! empty( $terms ) && is_tax( Tribe__Events__Main::TAXONOMY ) ) {\n\t\t\t\t\t\t\t$terms = array_merge( $terms, get_term_children( $terms[0], Tribe__Events__Main::TAXONOMY ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor ( $i = 0, $date = $start_date; $i <= $days; $i ++, $date->modify( '+1 day' ) ) {\n\t\t\t\t\t\t\t$formatted_date = $date->format( 'Y-m-d' );\n\t\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t\t\t$_day_event_ids = array();\n\t\t\t\t\t\t\tforeach ( $raw_counts as $record ) {\n\n\t\t\t\t\t\t\t\t$event = new stdClass;\n\t\t\t\t\t\t\t\t$event->EventStartDate = $record->EventStartDate;\n\t\t\t\t\t\t\t\t$event->EventEndDate = $record->EventEndDate;\n\n\t\t\t\t\t\t\t\t$per_day_limit = apply_filters( 'tribe_events_month_day_limit', tribe_get_option( 'monthEventAmount', '3' ) );\n\n\t\t\t\t\t\t\t\tif ( tribe_event_is_on_date( $formatted_date, $event ) ) {\n\t\t\t\t\t\t\t\t\tif ( ! empty ( $terms ) && ! has_term( $terms, Tribe__Events__Main::TAXONOMY, $record->ID ) ) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( count( $_day_event_ids ) < $per_day_limit ) {\n\t\t\t\t\t\t\t\t\t\t$_day_event_ids[] = $record->ID;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$count ++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$event_ids[ $formatted_date ] = $_day_event_ids;\n\t\t\t\t\t\t\t$counts[ $formatted_date ] = $count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// get a unique list of the event IDs that will be displayed, and update all their postmeta and term caches at once\n\t\t\t\t$final_event_ids = call_user_func_array( 'array_merge', $event_ids );\n\t\t\t\t$final_event_ids = array_unique( $final_event_ids );\n\t\t\t\tupdate_object_term_cache( $final_event_ids, Tribe__Events__Main::POSTTYPE );\n\t\t\t\tupdate_postmeta_cache( $final_event_ids );\n\t\t\t}\n\t\t\t// return IDs per day and total counts per day\n\t\t\t$return = array( 'counts' => $counts, 'event_ids' => $event_ids );\n\t\t\t$cache = new Tribe__Cache;\n\t\t\t$cache_key = 'daily_counts_and_ids_' . serialize( $args );\n\t\t\t$cache->set( $cache_key, $return, Tribe__Cache::NON_PERSISTENT, 'save_post' );\n\n\t\t\treturn $return;\n\t\t}",
"function countPosts(){\n\t\t\treturn $this->db->count_all('post');\n\t\t}",
"public static function countArticles()\n {\n $conn = DBConnection::getConnection();\n $count_query = \"SELECT count(*) as total_articles FROM articles\";\n $result = $conn->query($count_query);\n return $result->fetch_assoc()['total_articles'];\n }",
"public function todayPosts(){\n return $this->getModel()->latest('published_at')->published()->today()->count();\n }",
"public function gp_qry_count_article()\n {\n @session::init();\n $v_website_id = session::get('session_website_id');\n $detect = new Mobile_Detect();\n if ($detect->isMobile() && Cookie::get('pc_mode', 0) == 0)\n {\n unset($detect);\n return array();\n }\n else\n {\n $sql = \"Select\n count_approval\n , count_editor\n From (Select\n count(PK_ARTICLE) as 'count_approval'\n From t_ps_article A\n Where C_DEFAULT_WEBSITE = $v_website_id\n And C_STATUS = 2) a\n , (Select\n count(PK_ARTICLE) as 'count_editor'\n From t_ps_article\n Where C_DEFAULT_WEBSITE = $v_website_id\n And C_STATUS = 1) e\";\n }\n return $this->db->getrow($sql);\n }",
"public function getPostCount();",
"function get_facebook_count( $url ) {\n\t$url = urlencode( $url );\n\t$facebook_endpoint = 'http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls='. $url .'&format=json';\n\t$file_data = get_response( $facebook_endpoint );\n\t$json = json_decode( $file_data, true );\n\t$total_fb_count = $json[0]['total_count'];\n\treturn $total_fb_count;\n}",
"public function getCount()\n {\n return (int) $this->connection->select('COUNT([id_thread])')\n ->from($this->tThreads)\n ->where('[id_forum] = %i', $this->forumId)\n ->fetchSingle();\n }",
"public function getEntryCount() {}",
"protected function _get_num_new_forum_posts()\n {\n return $this->connection->query_value_if_there('SELECT COUNT(*) FROM ' . $this->connection->get_table_prefix() . 'posts WHERE dateline>' . strval(time() - 60 * 60 * 24));\n }",
"public abstract function get_counts();",
"public function getCount()\n {\n return $this->data['count'];\n }",
"public function getCount();",
"public function getCount();",
"public function getCount();",
"public static function getNewsSummary()\n {\n $data['all_news'] = DB::table('content_news')->count();\n $data['published'] = DB::table('content_news')\n ->select(DB::raw('count(published) as published'))\n ->where('published', '=', 1)\n ->count();\n \n $data['featured'] = DB::table('content_news')\n ->select(DB::raw('count(`featured`) as featured'))\n ->where('featured', '=', 1)\n ->count();\n return $data;\n }"
] |
[
"0.8199368",
"0.647498",
"0.64559036",
"0.63192385",
"0.6311096",
"0.6269568",
"0.6221642",
"0.61626726",
"0.6144167",
"0.61310774",
"0.612861",
"0.61105424",
"0.61007875",
"0.608797",
"0.60768664",
"0.60723555",
"0.6058455",
"0.60578644",
"0.6037418",
"0.60343236",
"0.6028865",
"0.60201883",
"0.6017506",
"0.6013914",
"0.5999511",
"0.5998996",
"0.59927356",
"0.59927356",
"0.59927356",
"0.59893876"
] |
0.7887889
|
1
|
/ db_get_feed_options Get the options pertaining to a feed. Returns an array of $optionN => $valueN. / XXX $recursive == TRUE ought to check the feed's parent groups for defaults for any option that isn't overridden elsewhere. That is, if the "Washington Post" feed is in group "News", which is in group "All", then options set in "All" can be overriden in "News", and those can in turn be overridden by "Washington Post".
|
function db_get_feed_options($feed_id, $recursive = FALSE)
{
$dbh = db_connect();
$query = sprintf(<<<EOT
SELECT `name` AS `option`,
`value`
FROM `feed_options`
WHERE feed_id = %d
EOT
,
$feed_id);
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
#echo "Got an error: $db_errno: [$db_errmsg]<br/>\n";
return NULL;
}
$retval = array();
while ($row = $result->fetch_assoc())
{
$retval[$row['option']] = $row['value'];
}
#echo "db_get_feed_options($feed_id) returning [", print_r($retval), "]<br/>\n";
return $retval;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getOptions() {\n\n\n\t\t$catId = $this->element['catid'] ? (string) $this->element['catid'] : -1;\n\t\t$db = JFactory::getDBO();\n\n //build the list of categories\n\t\t$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid'\n\t\t. ' FROM #__phocagallery_categories AS a'\n\t\t. ' WHERE a.published = 1'\n\t\t. ' ORDER BY a.ordering';\n\t\t$db->setQuery( $query );\n\t\t$phocagallerys = $db->loadObjectList();\n\n\t\t$tree = array();\n\t\t$text = '';\n\t\t$tree = self::CategoryTreeOption($phocagallerys, $tree, 0, $text, $catId);\n\t\tforeach ($tree as $k=>$v) {\n\t\t\t$tree[$k]->text = substr($v->text, 3); // strip - for root category level\n\t\t}\n\t\tarray_unshift($tree, (object)array('value' => 'all', 'text'=>'- '.JText::_('JALL').' -'));\n\t\treturn $tree;\n\n\t}",
"function tc_get_theme_options ( $option_group = null ) {\r\n //do we have to look in a specific group of option (plugin?)\r\n $option_group = is_null($option_group) ? 'tc_theme_options' : $option_group;\r\n $saved = (array) get_option( $option_group );\r\n $defaults = $this -> default_options;\r\n $__options = wp_parse_args( $saved, $defaults );\r\n //$__options = array_intersect_key( $__options, $defaults );\r\n return $__options;\r\n }",
"public \tfunction\tretrieveOptions() {\n\t\t\t//For each option category.\n\t\t\tforeach($this -> options as $category => $k) {\n\t\t\t\t//For each option. \n\t\t\t\tforeach ($this -> options[$category] as $key => $value) {\n\t\t\t\t\t//Set the option. \n\t\t\t\t\t$this -> options[$category][$key]\t\t=\tget_option($key);\n\t\t\t\t\t\n\t\t\t\t\t//If the option is serialized.\n\t\t\t\t\tif (is_serialized($this -> options[$category][$key])) {\n\t\t\t\t\t\t//Unserialize the option.\n\t\t\t\t\t\t$this -> options[$category][$key]\t=\t \n\t\t\t\t\t\tunserialize($this -> options[$category][$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected\n\tfunction getOptions()\n\t{\n\n\t\t// Initialize variables.\n\t\t$session = Factory::getSession();\n\t\t$options = array();\n\n\t\t// Initialize some field attributes.\n\t\t$extension = $this->element['extension'] ? (string) $this->element['extension'] : (string) $this->element['scope'];\n\t\t$published = (string) $this->element['published'];\n\n\t\t// OLD values\n\t\t// Load the category options for a given extension.\n\t\tif (!empty($extension))\n\t\t{\n\n\t\t\t// Filter over published state or not depending upon if it is present.\n\t\t\tif ($published)\n\t\t\t{\n\t\t\t\t$options = HTMLHelper::_('category.options', $extension, array('filter.published' => explode(',', $published)));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$options = HTMLHelper::_('category.options', $extension);\n\t\t\t}\n\n\t\t\t// Verify permissions. If the action attribute is set, then we scan the options.\n\t\t\tif ($action = (string) $this->element['action'])\n\t\t\t{\n\n\t\t\t\t// Get the current user object.\n\t\t\t\t$user = Factory::getUser();\n\n\t\t\t\t// TODO: Add a preload method to Access so that we can get all the asset rules in one query and cache them.\n\t\t\t\t// eg Access::preload('core.create', 'com_content.category')\n\t\t\t\tforeach ($options as $i => $option)\n\t\t\t\t{\n\t\t\t\t\t// Unset the option if the user isn't authorised for it.\n\t\t\t\t\tif (!$user->authorise($action, $extension . '.category.' . $option->value))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($options[$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFactory::getApplication()->enqueueMessage('500 - ' . Text::_('JLIB_FORM_ERROR_FIELDS_CATEGORY_ERROR_EXTENSION_EMPTY'), 'warning');\n\t\t}\n\n\t\t// if no value exists, try to load a selected filter category from the old category filters\n\t\tif (!$this->value && ($this->form instanceof Form))\n\t\t{\n\t\t\t$context = $this->form->getName();\n\t\t\t$this->value = array();\n\t\t\tfor ($i = 0; $i < 20; $i++)\n\t\t\t{\n\t\t\t\tif ($this->form->getValue(\"catid$i\", \"params\", 0))\n\t\t\t\t{\n\t\t\t\t\t$this->value[] = $this->form->getValue(\"catid$i\", \"params\", 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Merge any additional options in the XML definition.\n\t\t$options = array_merge(parent::getOptions(), $options);\n\n\t\treturn $options;\n\n\t}",
"protected static abstract function getOptions();",
"private function get_options($post){\n\t\t//Build array of user import fields\n\t\t$importFields = array();\n\t\t\n\t\t$fileType = $post['file_type'];\n\t\t$fileFeed = $post['feed'];\n\t\t$filePath = $post['xpath'];\n\t\t\n\t\tif($fileType=='xml'):\n\t\t\t$fileData = file_get_contents($fileFeed);\n\t\t\t\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->loadXML($fileData);\n\t\t\t$xmlArray = $this->xml_to_array($dom);\n\t\t\t\n\t\t\t$importFields = $this->get_xpath($xmlArray, $filePath);\n\t\t\t$importFields = $this->get_keys($importFields);\n\t\t\t\n\t\telseif($fileType=='csv'):\n\t\t\t$row = 1;\n\t\t\tif (($handle = fopen($fileFeed, 'r')) !== FALSE):\n\t\t\t\twhile (($data = fgetcsv($handle, 1000, ',')) !== FALSE):\n\t\t\t\t\t//get first line column names and break\n\t\t\t\t\t$importFields = $data;\n\t\t\t\t\tbreak;\n\t\t\t\tendwhile;\n\t\t\t\t\n\t\t\t\tfclose($handle);\n\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t//create import fields drop down\n\t\t$options = array();\n\t\tforeach($importFields as $field):\n\t\t\t//$options .= '<option vlaue=\"'.$field.'\">'.$field.'</option>';\n\t\t\t$options[$field] = $field;\n\t\tendforeach;\n\t\t\n\t\treturn $options;\n\t}",
"protected function getOptions()\n\t{\n\t\t// Initialize variables.\n\t\t$options = array();\n\n require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php' );\n CFactory::load( 'helpers' , 'event' );\n $model\t\t= CFactory::getModel( 'events' );\n\n $categories = $model->getCategories();\n\n\t\t$options = array();\n $options[] = JHTML::_('select.option', 0, '--');\n\t\tforeach ($categories as $option)\n\t\t{\n\t\t\t$options[] = JHTML::_('select.option', $option->id, $option->name);\n\t\t}\n\n\t\t// Merge any additional options in the XML definition.\n\t\t$options = array_merge(parent::getOptions(), $options);\n\n\t\treturn $options;\n\t}",
"function get_options() {\r\n\t\t\t$set_options = array(\r\n\t\t\t\t'plugin_css' => true, \r\n\t\t\t\t'home' => true,\r\n\t\t\t\t'single' => true,\r\n\t\t\t\t'page' => true,\r\n\t\t\t\t'archive' => true,\r\n\t\t\t\t'search' => true,\r\n\t\t\t\t'feed' => true,\r\n\t\t\t\t'attachment' => true,\r\n\t\t\t\t'tag' => true,\r\n\t\t\t\t'category' => true,\r\n\t\t\t\t'date' => true,\r\n\t\t\t\t'author' => true,\r\n\t\t\t\t'the_content' => true,\r\n\t\t\t\t'the_excerpt' => true,\r\n\t\t\t\t'the_comment' => false,\r\n\t\t\t\t'excluded_cats' => array(),\r\n\t\t\t\t'excluded_ids' => array()\r\n\t\t\t\t);\r\n\t\t\t$options = get_option($this->options_name);\r\n\t\t\tif (!empty($options)) {\r\n\t\t\t\tforeach ($options as $key => $option)\r\n\t\t\t\t\t$set_options[$key] = $option;\r\n\t\t\t}else{\r\n\t\t\t\tupdate_option($this->options_name, $set_options);\r\n\t\t\t}\r\n\t\t\treturn $set_options;\r\n\t\t}",
"public function get_options() {\n\n if( $this->args['database'] === 'transient' ) {\n $this->options = get_transient( $this->unique );\n } else if( $this->args['database'] === 'theme_mod' ) {\n $this->options = get_theme_mod( $this->unique );\n } else if( $this->args['database'] === 'network' ) {\n $this->options = get_site_option( $this->unique );\n } else {\n $this->options = get_option( $this->unique );\n }\n\n if( empty( $this->options ) ) {\n $this->options = array();\n }\n\n return $this->options;\n\n }",
"abstract public function getOptions();",
"public function get_options()\n\t{\n\t\t$options = $this->defaults;\n\t\t$db_option = get_option($this->option_key);\n\n\t\tif ($db_option && is_array($db_option))\n\t\t\tforeach ($options as $k => &$v)\n\t\t\t\tif (array_key_exists($k, $db_option))\n\t\t\t\t\t$v = $db_option[$k];\n\t\tunset($db_option);\n\n\t\t// Also check for global options if in Multi-site\n\t\tif (BWP_PluginBase::is_multisite())\n\t\t{\n\t\t\t$db_option = get_site_option($this->option_key);\n\t\t\tif ($db_option && is_array($db_option))\n\t\t\t{\n\t\t\t\t$temp = array();\n\t\t\t\tforeach ($db_option as $k => $o)\n\t\t\t\t\tif (in_array($k, $this->site_o))\n\t\t\t\t\t\t$temp[$k] = $o;\n\t\t\t\t$options = array_merge($options, $temp);\n\t\t\t}\n\t\t}\n\n\t\treturn $options;\n\t}",
"function getOptions() ;",
"protected function getOptions()\n\t{\n\t\t// Initialize variables.\n\t\t$options = array();\n\n\t\t// Get the parent\n\t\t$parent_id = $this->form->getValue('parent_id', 0);\n\n\t\tif (empty($parent_id))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$db = App::get('db');\n\t\t$query = $db->getQuery();\n\n\t\t$query->select('a.id', 'value')\n\t\t\t->select('a.title', 'text');\n\t\t$query->from('#__menu', 'a');\n\n\t\t$query->where('a.published', '>=', '0');\n\t\t$query->whereEquals('a.parent_id', (int) $parent_id);\n\n\t\tif ($menuType = $this->form->getValue('menutype'))\n\t\t{\n\t\t\t$query->whereEquals('a.menutype', $menuType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->where('a.menutype', '!=', '');\n\t\t}\n\n\t\t$query->order('a.lft', 'asc');\n\n\t\t// Get the options.\n\t\t$db->setQuery($query->toString());\n\n\t\t$options = $db->loadObjectList();\n\n\t\t// Check for a database error.\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tthrow new Exception($db->getErrorMsg(), 500);\n\t\t}\n\n\t\t$options = array_merge(\n\t\t\tarray(array('value' => '-1', 'text' => Lang::txt('COM_MENUS_ITEM_FIELD_ORDERING_VALUE_FIRST'))),\n\t\t\t$options,\n\t\t\tarray(array('value' => '-2', 'text' => Lang::txt('COM_MENUS_ITEM_FIELD_ORDERING_VALUE_LAST')))\n\t\t);\n\n\t\t// Merge any additional options in the XML definition.\n\t\t$options = array_merge(parent::getOptions(), $options);\n\n\t\treturn $options;\n\t}",
"protected function getOptions()\n\t{\n\t\t// Accepted modifiers\n\t\t$hash = md5($this->element);\n\n\t\tif (!isset(static::$options[$hash]))\n\t\t{\n\t\t\tstatic::$options[$hash] = parent::getOptions();\n\n\t\t\t$options = array();\n\t\t\t$limits = $this->defaultLimits;\n\n\t\t\t// Limits manually specified\n\t\t\tif (isset($this->element['limits']))\n\t\t\t{\n\t\t\t\t$limits = explode(',', $this->element['limits']);\n\t\t\t}\n\n\t\t\t// User wants to add custom limits\n\t\t\tif (isset($this->element['append']))\n\t\t\t{\n\t\t\t\t$limits = array_unique(array_merge($limits, explode(',', $this->element['append'])));\n\t\t\t}\n\n\t\t\t// User wants to remove some default limits\n\t\t\tif (isset($this->element['remove']))\n\t\t\t{\n\t\t\t\t$limits = array_diff($limits, explode(',', $this->element['remove']));\n\t\t\t}\n\n\t\t\t// Order the options\n\t\t\tasort($limits);\n\n\t\t\t// Add an option to show all?\n\t\t\t$showAll = isset($this->element['showall']) ? ($this->element['showall'] == \"true\") : true;\n\n\t\t\tif ($showAll)\n\t\t\t{\n\t\t\t\t$limits[] = 0;\n\t\t\t}\n\n\t\t\tif (!empty($limits))\n\t\t\t{\n\t\t\t\tforeach ($limits as $value)\n\t\t\t\t{\n\t\t\t\t\t$options[] = (object) array(\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t'text' => ($value != 0) ? JText::_('J' . $value) : JText::_('JALL')\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tstatic::$options[$hash] = array_merge(static::$options[$hash], $options);\n\t\t\t}\n\t\t}\n\n\t\treturn static::$options[$hash];\n\t}",
"protected function get_feedbacks_as_options() {\n\t\t$options = '';\n\n\t\t// Get the feedbacks' parents' post IDs\n\t\t$feedbacks = get_posts( array(\n\t\t\t'fields' => 'id=>parent',\n\t\t\t'posts_per_page' => 100000,\n\t\t\t'post_type' => 'feedback',\n\t\t\t'post_status' => 'publish',\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\t\t$parents = array_unique( array_values( $feedbacks ) );\n\n\t\t$posts = get_posts( array(\n\t\t\t'orderby' => 'ID',\n\t\t\t'posts_per_page' => 1000,\n\t\t\t'post_type' => 'any',\n\t\t\t'post__in' => array_values( $parents ),\n\t\t\t'suppress_filters' => false,\n\t\t) );\n\n\t\t// creates the string of <option> elements\n\t\tforeach ( $posts as $post ) {\n\t\t\t$options .= sprintf( '<option value=\"%s\">%s</option>', esc_attr( $post->ID ), esc_html( $post->post_title ) );\n\t\t}\n\n\t\treturn $options;\n\t}",
"private function getAllOptions() {\n return $this->config[$this->context];\n }",
"public function init_group_options() {\r\n\t\tif ( ! empty( $this->settings['options'] ) ) {\r\n\r\n\t\t\tif ( is_array( $this->settings['options'] ) ) {\r\n\r\n\t\t\t\tforeach ( $this->settings['options'] as $settings ) {\r\n\r\n\t\t\t\t\tif ( ! apply_filters( 'tf_create_option_continue_' . $this->getOptionNamespace(), true, $settings ) ) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$obj = TitanFrameworkOption::factory( $settings, $this->owner );\r\n\t\t\t\t\t$this->options[] = $obj;\r\n\r\n\t\t\t\t\tdo_action( 'tf_create_option_' . $this->getOptionNamespace(), $obj );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function getAll()\n {\n return $this->options;\n }",
"protected function getRecursiveSelectOptions() {}",
"protected function get_registered_options() {\n\t\t$rest_options = array();\n\n\t\tforeach ( get_registered_settings() as $name => $args ) {\n\t\t\tif ( empty( $args['show_in_rest'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rest_args = array();\n\t\t\tif ( is_array( $args['show_in_rest'] ) ) {\n\t\t\t\t$rest_args = $args['show_in_rest'];\n\t\t\t}\n\n\t\t\t$defaults = array(\n\t\t\t\t'name' => ! empty( $rest_args['name'] ) ? $rest_args['name'] : $name,\n\t\t\t\t'schema' => array(),\n\t\t\t);\n\t\t\t$rest_args = array_merge( $defaults, $rest_args );\n\n\t\t\t$default_schema = array(\n\t\t\t\t'type' => empty( $args['type'] ) ? null : $args['type'],\n\t\t\t\t'description' => empty( $args['description'] ) ? '' : $args['description'],\n\t\t\t\t'default' => isset( $args['default'] ) ? $args['default'] : null,\n\t\t\t);\n\n\t\t\t$rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] );\n\t\t\t$rest_args['option_name'] = $name;\n\n\t\t\t// Skip over settings that don't have a defined type in the schema.\n\t\t\tif ( empty( $rest_args['schema']['type'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Whitelist the supported types for settings, as we don't want invalid types\n\t\t\t// to be updated with arbitrary values that we can't do decent sanitizing for.\n\t\t\tif ( ! in_array( $rest_args['schema']['type'], array( 'number', 'string', 'boolean' ), true ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rest_options[ $rest_args['name'] ] = $rest_args;\n\t\t}\n\n\t\treturn $rest_options;\n\t}",
"public function get_settings() {\n\n\t\t$settings = get_option($this->option_name);\n\n\t\tif ( false === $settings && isset($this->alt_option_name) )\n\t\t\t$settings = get_option($this->alt_option_name);\n\n\t\tif ( !is_array($settings) )\n\t\t\t$settings = array();\n\n\t\tif ( !empty($settings) && !array_key_exists('_multiwidget', $settings) ) {\n\t\t\t// old format, convert if single widget\n\t\t\t$settings = wp_convert_widget_settings($this->id_base, $this->option_name, $settings);\n\t\t}\n\n\t\tunset($settings['_multiwidget'], $settings['__i__']);\n\t\treturn $settings;\n\t}",
"public function getOptions()\n\t{\n\t\t// Initialize variables.\n\t\t$options = array();\n\n\t\t// Initialize some field attributes.\n\t\t$filter = (string)$this->element['filter'];\n\t\t$exclude = (string)$this->element['exclude'];\n\t\t$stripExt = (string)$this->element['stripext'];\n\t\t$hideNone = (string)$this->element['hide_none'];\n\t\t$hideDefault = (string)$this->element['hide_default'];\n\n\t\t// Get the path in which to search for file options.\n\t\t$path = (string)$this->element['directory'];\n\t\tif (!is_dir($path)) {\n\t\t\t$path = ABSPATH . $path;\n\t\t}\n\n\t\t// Prepend some default options based on field attributes.\n\t\tif (!$hideNone) {\n\t\t\t$options[] = GantryHtmlSelect::option('-1', _g(trim((string)'NONE_SELECTED')));\n\t\t}\n\t\tif (!$hideDefault) {\n\t\t\t$options[] = GantryHtmlSelect::option('', _g(trim((string)'USE_DEFAULT')));\n\t\t}\n\n\t\t// Get a list of files in the search path with the given filter.\n\t\t$files = GantryFolder::files($path, $filter);\n\n\t\t// Build the options list from the list of files.\n\t\tif (is_array($files)) {\n\t\t\tforeach ($files as $file) {\n\n\t\t\t\t// Check to see if the file is in the exclude mask.\n\t\t\t\tif ($exclude) {\n\t\t\t\t\tif (preg_match(chr(1) . $exclude . chr(1), $file)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the extension is to be stripped, do it.\n\t\t\t\tif ($stripExt) {\n\t\t\t\t\t$file = GantryFile::stripExt($file);\n\t\t\t\t}\n\n\t\t\t\t$options[] = GantryHtmlSelect::option($file, $file);\n\t\t\t}\n\t\t}\n\n\t\t// Merge any additional options in the XML definition.\n\t\t$options = array_merge(parent::getOptions(), $options);\n\n\t\treturn $options;\n\t}",
"protected function _getOptionSettings()\n {\n // the options to be set\n $options = array();\n \n // find the parents of this class, including this class\n $parents = Solar_Class::parents(get_class($this), true);\n array_shift($parents);\n array_shift($parents);\n \n // get options.php for each parent class, as well as this class\n foreach ($parents as $class) {\n \n $file = str_replace('_', DIRECTORY_SEPARATOR, $class)\n . DIRECTORY_SEPARATOR . 'Info'\n . DIRECTORY_SEPARATOR . 'options.php';\n \n $file = Solar_File::exists($file);\n \n if ($file) {\n $options = array_merge(\n $options, \n (array) include $file\n );\n }\n }\n \n return $options;\n }",
"function getOptions()\n\t{\n\t\t\n\t\treturn $this->getAssoc(Array('id','title')/*, $cond*/);\n\t}",
"public function findAllOptions();",
"protected function get_options()\n\t{}",
"public function hasFeedOptions() {\r\n $this->importCookie();\r\n\r\n if ($this->getOption('enable_feeds')) {\r\n $service = $this->getLinkedService(true); // $refresh := true\r\n return ($service && $this->cookie['can_publish'] && $service->hasFeedOptions());\r\n }\r\n\r\n return false;\r\n }",
"function ffw_port_get_settings() {\n\n $settings = get_option( 'ffw_port_settings' );\n if( empty( $settings ) ) {\n\n // Update old settings with new single option\n\n $general_settings = is_array( get_option( 'ffw_port_settings_general' ) ) ? get_option( 'ffw_port_settings_general' ) : array();\n\n\n $settings = array_merge( $general_settings );\n\n update_option( 'ffw_port_settings', $settings );\n }\n return apply_filters( 'ffw_port_get_settings', $settings );\n}",
"protected function getOptions() {}",
"protected function getOptions() {}"
] |
[
"0.5818352",
"0.5743621",
"0.54734385",
"0.54640824",
"0.5448044",
"0.5433376",
"0.54319006",
"0.5417823",
"0.54036826",
"0.53821206",
"0.5347134",
"0.532356",
"0.53233415",
"0.53209686",
"0.53159463",
"0.53149986",
"0.5258868",
"0.52245814",
"0.5198208",
"0.5178468",
"0.51581705",
"0.5134998",
"0.5134094",
"0.51239914",
"0.51061976",
"0.5101432",
"0.5099116",
"0.50953376",
"0.50855863",
"0.50855863"
] |
0.72023314
|
0
|
XXX db_set_feed_options($feed_id, $options (opt => value ...)
|
function db_set_feed_option($feed_id, $opt, $val)
{
$dbh = db_connect();
$query = <<<EOT
INSERT INTO `feed_options`
(feed_id, name, value)
VALUES (?, ?, ?)
ON DUPLICATE KEY UPDATE
name=?,
value=?
EOT;
$stmt = $dbh->prepare($query);
$stmt->bind_param("dssss",
$feed_id,
$opt, $val,
$opt, $val);
$err = $stmt->execute();
if ($err)
echo "OK (", print_r($err, true), ") errno ", $dbh->errno, ", error [", $dbh->error, "]<br/>\n";
else
echo "<b>Error: ", $dbh->errno, ": \"", $dbh->error;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function yaz_set_option($id, $options)\n{\n}",
"private function setOptions()\n\t{\n\t\t$this->site = ( isset($_POST['site']) ) ? sanitize_text_field($_POST['site']) : null;\n\t\t$this->feed_type = ( isset($_POST['type']) && $_POST['type'] !== 'search' ) ? sanitize_text_field($_POST['type']) : 'search';\n\t\t$this->post_id = ( isset($_POST['id']) ) ? sanitize_text_field($_POST['id']) : null;\n\t\t$this->feed_format = ( isset($_POST['format']) && $_POST['format'] !== 'unformatted' ) ? sanitize_text_field($_POST['format']) : 'unformatted';\n\t}",
"function setOptions (array $options);",
"function add_blog_option($id, $option, $value)\n {\n }",
"abstract public function setOptions($options = array());",
"public function set( $options )\n\t{\n\t\t$options = filter_var_array( $options, array(\n\t\t\t'search' => FILTER_SANITIZE_STRING,\n\t\t\t'show_title' => FILTER_VALIDATE_BOOLEAN,\n\t\t\t'show_description' => FILTER_VALIDATE_BOOLEAN,\n\t\t\t'show_enclosure' => FILTER_VALIDATE_BOOLEAN,\n\t\t\t'link_active' => FILTER_VALIDATE_BOOLEAN,\n\t\t\t'link_target' => FILTER_SANITIZE_STRING,\n\t\t\t'limit' => FILTER_VALIDATE_INT\n\t\t) );\n\t\t\n\t\tif ( strlen( $options[ 'search' ] ) > 0 )\n\t\t{\n\t\t\t$this->url = 'http://bouwproducten.nl/rss.search.php?query=' . $options[ 'search' ];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$this->url = '';\n\t\t}\n\t\t\n\t\t$this->show_title = $options[ 'show_title' ];\n\t\t$this->show_description = $options[ 'show_description' ];\n\t\t$this->show_enclosure = $options[ 'show_enclosure' ];\n\t\t$this->link_active = $options[ 'link_active' ];\n\t\t\n\t\tif ( strlen( $options[ 'link_target' ] ) > 0 )\n\t\t{\n\t\t\t$this->link_target = $options[ 'link_target' ];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->link_target = '_self';\n\t\t}\n\t\t\n\t\tif ( $options[ 'limit' ] > 0 )\n\t\t{\n\t\t\t$this->set_limit( $options[ 'limit' ] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->set_limit( 0 );\n\t\t}\n\t}",
"function db_get_feed_options($feed_id, $recursive = FALSE)\n{\n\t$dbh = db_connect();\n\n\t$query = sprintf(<<<EOT\nSELECT\t`name` AS `option`,\n\t`value`\nFROM\t`feed_options`\nWHERE\tfeed_id = %d\nEOT\n\t ,\n\t $feed_id);\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#echo \"Got an error: $db_errno: [$db_errmsg]<br/>\\n\";\n\t\treturn NULL;\n\t}\n\n\t$retval = array();\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t$retval[$row['option']] = $row['value'];\n\t}\n\n#echo \"db_get_feed_options($feed_id) returning [\", print_r($retval), \"]<br/>\\n\";\n\treturn $retval;\n}",
"abstract public function setOptions($options);",
"public function handler_ava_reset_db_options()\n\t\t{\n\t\t\tupdate_option( $this->opt_key_attachment_urls, array() );\n\t\t}",
"function update_blog_option($id, $option, $value, $deprecated = \\null)\n {\n }",
"function emb_save_options() {\n\t}",
"public function set_options(Array $options);",
"function updateOption($caption,$value,$type,$db) {\r\n//\t$res=mysql_query($sql,$db);\r\n\r\n}",
"public function setOptions($options){\n\n\t}",
"public function set_options() {\n\t\tif ( Kiwi_Social_Share_Helper::get_setting_value( 'click_to_tweet_posttypes', 'all' ) === 'all' ) {\n\t\t\t$this->post_types = 'all';\n\t\t} else {\n\t\t\t$post_types = Kiwi_Social_Share_Helper::get_setting_value( 'click_to_tweet_posttypes_list', array() );\n\t\t\t$this->post_types = array_merge( $this->post_types, $post_types );\n\t\t};\n\t}",
"function bf_update_options() {\r\n\tglobal $bf_options;\r\n\tupdate_option(THEME_ID . '_options', maybe_serialize($bf_options));\r\n}",
"function update_options() {\n\t\tif ( get_current_blog_id() !== $this->options_blog_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdate_option( $this->option_name, $this->options );\n\t}",
"function populate_options(array $options = array())\n {\n }",
"private static function setOptions( $options ){\n\n\t\t$general_options = $options[ WPC_OPTIONS ];\n\t\t$general_options[ 'WPC_VERSION' ] = WPC_VERSION;\n\t\t$general_options_old = get_option( WPC_OPTIONS );\n\n\t\t// make sure the general app settings are kept if they had been set\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_APP_ID ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_APP_ID ] = $general_options_old[ WPC_OPTIONS_APP_ID ];\n\t\t}\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_APP_ADMINS ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_APP_ADMINS ] = $general_options_old[ WPC_OPTIONS_APP_ADMINS ];\n\t\t}\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_IMAGE_URL ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_IMAGE_URL ] = $general_options_old[ WPC_OPTIONS_IMAGE_URL ];\n\t\t}\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_DESCRIPTION ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_DESCRIPTION ] = $general_options_old[ WPC_OPTIONS_DESCRIPTION ];\n\t\t}\n\n\t\tupdate_option( WPC_OPTIONS, $general_options );\n\t\tupdate_option( WPC_OPTIONS_COMMENTS, $options[ WPC_OPTIONS_COMMENTS ] );\n\t\tupdate_option( WPC_OPTIONS_LIKE_BUTTON, $options[ WPC_OPTIONS_LIKE_BUTTON ] );\n\n\t}",
"function my_feeds($query) {\n if ($query->is_feed) {\n //$query->set('cat','-20,-21,-22');\n }\n return $query;\n}",
"function save_options() {\r\n\t\t$this->version = BF_VERSION;\r\n\t\t\r\n\t\t$this->feed_url = (string)$_POST['bf-rss-feed-url'];\r\n\t\t$this->comments_feed_url = (string)$_POST['bf-rss-comments-url'];\r\n\t\t$this->footer_message = (string)($_POST['bf-footer-message']);\r\n\t\t\r\n\t\t$this->featured_cat = (int)$_POST['bf-cat-featured'];\r\n\t\t$this->news_cat = (int)$_POST['bf-cat-news'];\r\n\t\t$this->asides_cat = (int)$_POST['bf-cat-asides'];\r\n\t\t\r\n\t\t$this->home_link = (string)$_POST['bf-nav-home'];\r\n\t\t$this->blog_link = (string)$_POST['bf-nav-blog'];\r\n\t\t$this->single_parent = (string)$_POST['bf-nav-singleparent'];\r\n\t\t$this->topnav_linkcat = (int)$_POST['bf-nav-linkcat'];\r\n\t\t\r\n\t\t$this->display_author = (boolean)$_POST['bf-layout-display-author'];\r\n\r\n\t\t$this->hooks = array();\r\n\t\t$hook_classes = $_POST['bf-hook-cond'];\r\n\t\t$hook_filters = $_POST['bf-hook-filter'];\r\n\t\t$hook_positions = $_POST['bf-hook-position'];\r\n\t\t$hook_codes = $_POST['bf-hook-html'];\r\n\t\t\r\n\t\tfor ( $i = 0; $i < count($hook_positions); $i++ ) {\r\n\t\t\t$this->hooks[] = array(\r\n\t\t\t\t'ID'\t\t=>\t(string)stripslashes($hook_classes[$i]),\r\n\t\t\t\t'filter'\t=>\t$hook_filters[$i],\r\n\t\t\t\t'position'\t=>\t(string)stripslashes($hook_positions[$i]),\r\n\t\t\t\t'code'\t\t=>\t$hook_codes[$i]\r\n\t\t\t);\r\n\t\t}\r\n\t}",
"public function setOptions($options)\n {\n //if some arguments are not set grab defaults and merge\n $options = array_merge($this->defaults, $options);\n\n $this->maxTweets = $options['maxTweets'];\n $this->retweets= $options['include_retweets'];\n $this->style = $options['style'];\n $this->replies = $options['include_replies'];\n $this->cacheTime = $options['caching_intervals'];\n $this->displayImages = $options['display_images'];\n }",
"function yaz_set_option($id, $name, $value)\n{\n}",
"public function setOptions($options = []);",
"private function setMailOptionsValuesByDB()\n\t{\n\t\tglobal $ilUser, $ilSetting;\t\t\n\t\t\n\t\trequire_once 'Services/Mail/classes/class.ilMailOptions.php';\n\t\t$mailOptions = new ilMailOptions($ilUser->getId());\n\t\t\n\t\t$data = array(\n\t\t\t'linebreak' => $mailOptions->getLinebreak(),\n\t\t\t'signature' => $mailOptions->getSignature(),\n\t\t\t'cronjob_notification' => $mailOptions->getCronjobNotification()\n\t\t);\n\t\t\n\t\tif($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')\n\t\t{\t\t\n\t\t\t$data['incoming_type'] = $mailOptions->getIncomingType();\n\t\t}\n\t\t\n\t\t$this->form->setValuesByArray($data);\n\t}",
"function bbps_add_options() {\n\n\t// Default options\n\t$options = array (\n\t//user counts and titles\n\t\t// The default display for topic status we used not resolved as default\n\t\t'_bbps_default_status' => '1',\n\t\t//enable user post count display\n\t\t'_bbps_enable_post_count' => '1',\n\t\t//enable user rank\n\t\t'_bbps_enable_user_rank' => '1',\n\t\t//defaults for who can change the topic status\n\t\t'_bbps_status_permissions' => '',\n\t\t// the reply counts / boundaries for the custom forum poster titles this has no default as the user must set these\n\t\t'_bbps_reply_count' => '',\n\t\t//the status people want to show on their topics.\n\t\t'_bbps_used_status' => '',\n\t\t//give admin and forum moderators the ability to move topics into other forums default = enabled\n\t\t'_bbps_enable_topic_move' => '1',\n\t\t//urgent topics\n\t\t'_bbps_status_permissions_urgent' => '',\n\t\t//do a color change for resolved topics\n\t\t//'_bbps_status_color_change' => '1',\n\t);\n\t// Add default options\n\tforeach ( $options as $key => $value )\n\t\tadd_option( $key, $value );\n\n}",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);",
"public function setOptions(array $options);"
] |
[
"0.63571894",
"0.62994015",
"0.61746854",
"0.6166064",
"0.5989735",
"0.5958023",
"0.5924965",
"0.5913101",
"0.5900655",
"0.5895524",
"0.5864786",
"0.582376",
"0.58052236",
"0.5803467",
"0.57936424",
"0.5771994",
"0.5729715",
"0.5683403",
"0.5672025",
"0.56702244",
"0.56601584",
"0.5650597",
"0.5642903",
"0.5625429",
"0.5595156",
"0.55590117",
"0.5549489",
"0.5549489",
"0.5549489",
"0.5549489"
] |
0.7320748
|
0
|
/ db_get_all_feed_counts Get the number of read/unread articles in all feeds, as well as the last publication and update time for each feed. Returns an array of the form array( 190=> array(// Feed ID 190 'read'=> 150, 'unread'=> 12, ), 191=> array( ... ),// Feed ID 191 ... ); I.e., the same as calling db_get_feed_counts() once for every feed ID.
|
function db_get_all_feed_counts()
{
$dbh = db_connect();
/* Get the number of read/unread items in each feed. This uses
* the `counts` table, which is updated by MySQL triggers.
*/
$query = <<<EOT
SELECT feed_id AS `feed_id`,
num_read AS `read`,
total-num_read AS `unread`
FROM `counts`
EOT;
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
$retval = array();
while ($row = $result->fetch_assoc())
{
// XXX - Error-checking
$feed_id = $row['feed_id'];
unset($row['feed_id']);
$retval[$feed_id] = $row;
}
return $retval;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function db_get_feed_counts($feed_id)\n{\n\t$dbh = db_connect();\n\n\t/* Get the number of read/unread items */\n\t$query = sprintf(<<<EOT\nSELECT\tnum_read AS `read`,\n\ttotal-num_read AS `unread`\nFROM\t`counts`\nWHERE\tfeed_id = %d\nEOT\n\t\t\t ,\n\t\t\t $feed_id);\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\t\treturn NULL;\n\t}\n\t$retval = $result->fetch_assoc();\n\t\t// XXX - Error-checking\n\n\treturn $retval;\n}",
"protected function getCounts()\n\t{\n\t\tif(!$this->counts)\n\t\t{\n\t\t\tforeach($this->folders as $id)\n\t\t\t{\n\t\t\t\t$this->counts[$id] = Mail::where('folder', '=', $id)->count();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->counts;\n\t}",
"public function getAllWithPostsCounts();",
"public function feeds()\n {\n // require authentication\n // check_authentication();\n\n $where = array(\n 'sa.Status = 2'\n );\n\n if (get_post('latest')) {\n $where[] = 'sa.DateCompleted > \"' . date('Y-m-d H:i:s', get_post('latest')) . '\"';\n }\n\n if (get_post('department')) {\n $where[] = 'ss.DepartmentID = \"' . (int) get_post('department') . '\"';\n }\n\n if (get_post('locScope')) {\n $where[] = 'ss.LocationScopeID = \"' . (int) get_post('locScope') . '\"';\n }\n\n if (get_post('keyword')) {\n $keyword = $this->db->escape_like_str(get_post('keyword'));\n $where[] = '(ss.Name LIKE \"%'.$keyword.'%\" OR ss.Description LIKE \"%'.$keyword.'%\")'; \n }\n\n $raw_feeds = $this->mgovdb->getFeeds($where);\n\n $feeds = array();\n $providedCounts = array();\n\n foreach ($raw_feeds as $v) {\n\n $userData = user_account_details($v['ApplicantID'], 'id');\n\n $v['userFullname'] = user_full_name($userData, '');\n $v['userAddress'] = user_full_address($userData);\n $v['userAvatar'] = public_url('assets/profile/') . photo_filename($userData->Photo);\n if ($v['SubDepartmentID']) {\n $v['departmentName'] = lookup_db('Dept_ChildDepartment', 'Name', $v['SubDepartmentID']);\n } else {\n $v['departmentName'] = lookup_db('Dept_Departments', 'Name', $v['DepartmentID']);\n }\n $v['serviceDate'] = date('F d, Y', strtotime($v['DateCompleted']));\n $v['Logo'] = public_url('assets/logo/') . logo_filename($v['Logo']);\n $v['serviceQR'] = public_url('assets/qr/') . get_qr_file($v['ServiceCode'], 4);\n\n $providedCounts[$v['DepartmentID']] = get_department_service_provided($v['DepartmentID'], $providedCounts);\n $v['serviceProvided'] = number_format($providedCounts[$v['DepartmentID']]);\n $v['serviceProvider'] = get_service_providers($v['ServiceID'], true);\n\n $feeds[] = $v;\n\n }\n\n if (count($feeds)) {\n response_json(array(\n 'status' => true,\n 'timestamp' => time(),\n 'data' => $feeds\n ));\n } else {\n response_json(array(\n 'status' => false,\n 'message' => 'No new items found.'\n ));\n }\n\n }",
"function getDBcounts( )\n{\n\t// \"frequency\" is how often data was collected eg \"Annual\"\n\tglobal $fields, $connect;\n\t$queryreg = mysqli_query($connect, \"\n\t \tSELECT * from counts ORDER BY count DESC\");\n\n\twhile($row = mysqli_fetch_array($queryreg,MYSQLI_ASSOC))\n\t{\n\t\t$fields[$row['field']] = $row['count']; \n\t//\techo \"<BR>\" . $row['field'] . ' = ' . $row['count'];\n\t}\n}",
"function fbComments_cacheAllCommentCounts() {\n\tglobal $fbc_options;\n\tfbComments_log('In ' . __FUNCTION__ . '()');\n\n\t$fb = fbComments_getFbApi();\n\t$posts = get_posts(array('numberposts' => -1)); // Retrieve all posts\n\n\tif ($posts) {\n\t\tfbComments_log(sprintf(' Looping through %d posts', count($posts)));\n\t\tforeach ($posts as $post) {\n\t\t\t$xid = $fbc_options['xid'] . \"_post{$post->ID}\";\n\t\t\t$query = array(\n\t\t\t\t'method' => 'fql.query',\n\t\t\t\t'query'\t => 'SELECT count FROM comments_info WHERE app_id=\"' . $fb->getAppId() . '\" AND xid=\"' . $xid . '\"'\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\tfbComments_log(\" Retrieving Facebook comment count for post with xid=$xid\");\n\t\t\t\t$result = $fb->api($query);\n\n\t\t\t\tif ($result) {\n\t\t\t\t\tupdate_option(\"fbComments_commentCount_$xid\", $result[0]['count']);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tfbComments_log(\" FAILED to retrieve Facebook comment count for post with xid=$xid error: $e\");\n\t\t\t}\n\t\t}\n\t}\n}",
"public function count_all($get_deleted = false)\n\t{\n\t\tif ($get_deleted)\n\t\t{\n\t\t\t// Get only the deleted users\n\t\t\t$this->db->where('news_articles.deleted !=', 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->where('news_articles.deleted', 0);\n\t\t}\n\n\t\treturn $this->db->count_all_results('news_articles');\n\t}",
"public function get_counts() {\n\n\t\t$this->counts = [];\n\n\t\t// Base params with applied filters.\n\t\t$base_params = $this->get_filters_query_params();\n\n\t\t$total_params = $base_params;\n\t\tunset( $total_params['status'] );\n\t\t$this->counts['total'] = ( new EmailsCollection( $total_params ) )->get_count();\n\n\t\tforeach ( $this->get_statuses() as $status => $name ) {\n\t\t\t$collection = new EmailsCollection( array_merge( $base_params, [ 'status' => $status ] ) );\n\n\t\t\t$this->counts[ 'status_' . $status ] = $collection->get_count();\n\t\t}\n\n\t\t/**\n\t\t * Filters items counts by various statuses of email log.\n\t\t *\n\t\t * @since 2.7.0\n\t\t *\n\t\t * @param array $counts {\n\t\t * Items counts by statuses.\n\t\t *\n\t\t * @type integer $total Total items count.\n\t\t * @type integer $status_{$status_key} Items count by status.\n\t\t * }\n\t\t */\n\t\t$this->counts = apply_filters( 'wp_mail_smtp_pro_emails_logs_admin_table_get_counts', $this->counts );\n\t}",
"function messages_count_unread() {\n\t$user_guid = elgg_get_logged_in_user_guid();\n\t$db_prefix = elgg_get_config('dbprefix');\n\n\t// denormalize the md to speed things up.\n\t// seriously, 10 joins if you don't.\n\t$strings = array('toId', $user_guid, 'readYet', 0, 'msg', 1);\n\t$map = array();\n\tforeach ($strings as $string) {\n\t\t$id = get_metastring_id($string);\n\t\t$map[$string] = $id;\n\t}\n\n\t$options = array(\n//\t\t'metadata_name_value_pairs' => array(\n//\t\t\t'toId' => elgg_get_logged_in_user_guid(),\n//\t\t\t'readYet' => 0,\n//\t\t\t'msg' => 1\n//\t\t),\n\t\t'type' => 'object',\n\t\t'subtype' => 'messages',\n\t\t'joins' => array(\n\t\t\t\"JOIN {$db_prefix}metadata msg_toId on e.guid = msg_toId.entity_guid\",\n\t\t\t\"JOIN {$db_prefix}metadata msg_readYet on e.guid = msg_readYet.entity_guid\",\n\t\t\t\"JOIN {$db_prefix}metadata msg_msg on e.guid = msg_msg.entity_guid\",\n\t\t),\n\t\t'wheres' => array(\n\t\t\t\"msg_toId.name_id='{$map['toId']}' AND msg_toId.value_id='{$map[$user_guid]}'\",\n\t\t\t\"msg_readYet.name_id='{$map['readYet']}' AND msg_readYet.value_id='{$map[0]}'\",\n\t\t\t\"msg_msg.name_id='{$map['msg']}' AND msg_msg.value_id='{$map[1]}'\",\n\t\t),\n\t\t'owner_guid' => $user_guid,\n\t\t'count' => true,\n\t\t'site_guids' => false // Message inbox is over all subsites\n\t);\n\n\treturn elgg_get_entities_from_metadata($options);\n}",
"public function count_all()\n\t{\n\t\treturn $this->db\n\t\t\t\t\t->count_all_results($this->table);\n\t}",
"function refreshAllFeeds(){\n $conn = new Sgbd();\n $feeds = $conn->selectFromDB(\"all\", \"feeds\", array(\"*\"), array());\n foreach($feeds as $feed){\n self::refreshFeed($feed['id']);\n }\n }",
"public function countAll() {}",
"public function countAll() {}",
"public function countAll() {}",
"public static function getEventCounts( $args = array() ) {\n\t\t\t_deprecated_function( __METHOD__, '3.10.1' );\n\t\t\tglobal $wpdb;\n\t\t\t$date = date( 'Y-m-d' );\n\t\t\t$defaults = array(\n\t\t\t\t'post_type' => Tribe__Events__Main::POSTTYPE,\n\t\t\t\t'start_date' => tribe_beginning_of_day( $date ),\n\t\t\t\t'end_date' => tribe_end_of_day( $date ),\n\t\t\t\t'display_type' => 'daily',\n\t\t\t\t'hide_upcoming_ids' => null,\n\t\t\t);\n\t\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\t\t$args['posts_per_page'] = - 1;\n\t\t\t$args['fields'] = 'ids';\n\n\t\t\t// remove empty args and sort by key, this increases chance of a cache hit\n\t\t\t$args = array_filter( $args, array( __CLASS__, 'filter_args' ) );\n\t\t\tksort( $args );\n\n\t\t\t$cache = new Tribe__Cache();\n\t\t\t$cache_key = 'daily_counts_and_ids_' . serialize( $args );\n\t\t\t$found = $cache->get( $cache_key, 'save_post' );\n\t\t\tif ( $found ) {\n\n\t\t\t\treturn $found;\n\t\t\t}\n\n\t\t\t$cache_key = 'month_post_ids_' . serialize( $args );\n\t\t\t$found = $cache->get( $cache_key, 'save_post' );\n\t\t\tif ( $found && is_array( $found ) ) {\n\t\t\t\t$post_ids = $found;\n\t\t\t} else {\n\t\t\t\t$post_id_query = new WP_Query();\n\t\t\t\t$post_ids = $post_id_query->query( $args );\n\t\t\t\t$cache->set( $cache_key, $post_ids, Tribe__Cache::NON_PERSISTENT, 'save_post' );\n\t\t\t}\n\n\t\t\t$counts = array();\n\t\t\t$event_ids = array();\n\t\t\tif ( ! empty( $post_ids ) ) {\n\t\t\t\tswitch ( $args['display_type'] ) {\n\t\t\t\t\tcase 'daily':\n\t\t\t\t\tdefault :\n\t\t\t\t\t\t$wp_query = tribe_get_global_query_object();\n\n\t\t\t\t\t\t$output_date_format = '%Y-%m-%d %H:%i:%s';\n\t\t\t\t\t\t$start_date_sql = esc_sql( $post_id_query->query_vars['start_date'] );\n\t\t\t\t\t\t$end_date_sql = esc_sql( $post_id_query->query_vars['end_date'] );\n\t\t\t\t\t\t$sql_ids = esc_sql( implode( ',', array_map( 'intval', $post_ids ) ) );\n\n\t\t\t\t\t\t$raw_counts = $wpdb->get_results( \"\n\t\t\t\t\t\t\tSELECT \ttribe_event_start.post_id as ID,\n\t\t\t\t\t\t\t\t\ttribe_event_start.meta_value as EventStartDate,\n\t\t\t\t\t\t\t\t\tDATE_FORMAT( tribe_event_end_date.meta_value, '{$output_date_format}') as EventEndDate,\n\t\t\t\t\t\t\t\t\t{$wpdb->posts}.menu_order as menu_order\n\t\t\t\t\t\t\tFROM $wpdb->postmeta AS tribe_event_start\n\t\t\t\t\t\t\t\t\tLEFT JOIN $wpdb->posts ON (tribe_event_start.post_id = {$wpdb->posts}.ID)\n\t\t\t\t\t\t\tLEFT JOIN $wpdb->postmeta as tribe_event_end_date ON ( tribe_event_start.post_id = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' )\n\t\t\t\t\t\t\tWHERE tribe_event_start.meta_key = '_EventStartDate'\n\t\t\t\t\t\t\tAND tribe_event_start.post_id IN ( {$sql_ids} )\n\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\ttribe_event_start.meta_value >= '{$start_date_sql}'\n\t\t\t\t\t\t\t\t\tAND tribe_event_start.meta_value <= '{$end_date_sql}'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tOR (\n\t\t\t\t\t\t\t\t\ttribe_event_end_date.meta_value >= '{$start_date_sql}'\n\t\t\t\t\t\t\t\t\tAND tribe_event_end_date.meta_value <= '{$end_date_sql}'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tOR (\n\t\t\t\t\t\t\t\t\ttribe_event_start.meta_value < '{$start_date_sql}'\n\t\t\t\t\t\t\t\t\tAND tribe_event_end_date.meta_value > '{$end_date_sql}'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tORDER BY menu_order ASC, DATE(tribe_event_start.meta_value) ASC, TIME(tribe_event_start.meta_value) ASC;\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$start_date = new DateTime( $post_id_query->query_vars['start_date'] );\n\t\t\t\t\t\t$end_date = new DateTime( $post_id_query->query_vars['end_date'] );\n\t\t\t\t\t\t$days = Tribe__Date_Utils::date_diff( $start_date->format( 'Y-m-d' ), $end_date->format( 'Y-m-d' ) );\n\t\t\t\t\t\t$term_id = isset( $wp_query->query_vars[ Tribe__Events__Main::TAXONOMY ] ) ? $wp_query->query_vars[ Tribe__Events__Main::TAXONOMY ] : null;\n\t\t\t\t\t\t$terms = array();\n\t\t\t\t\t\tif ( is_int( $term_id ) ) {\n\t\t\t\t\t\t\t$terms[0] = $term_id;\n\t\t\t\t\t\t} elseif ( is_string( $term_id ) ) {\n\t\t\t\t\t\t\t$term = get_term_by( 'slug', $term_id, Tribe__Events__Main::TAXONOMY );\n\t\t\t\t\t\t\tif ( $term ) {\n\t\t\t\t\t\t\t\t$terms[0] = $term->term_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! empty( $terms ) && is_tax( Tribe__Events__Main::TAXONOMY ) ) {\n\t\t\t\t\t\t\t$terms = array_merge( $terms, get_term_children( $terms[0], Tribe__Events__Main::TAXONOMY ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor ( $i = 0, $date = $start_date; $i <= $days; $i ++, $date->modify( '+1 day' ) ) {\n\t\t\t\t\t\t\t$formatted_date = $date->format( 'Y-m-d' );\n\t\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t\t\t$_day_event_ids = array();\n\t\t\t\t\t\t\tforeach ( $raw_counts as $record ) {\n\n\t\t\t\t\t\t\t\t$event = new stdClass;\n\t\t\t\t\t\t\t\t$event->EventStartDate = $record->EventStartDate;\n\t\t\t\t\t\t\t\t$event->EventEndDate = $record->EventEndDate;\n\n\t\t\t\t\t\t\t\t$per_day_limit = apply_filters( 'tribe_events_month_day_limit', tribe_get_option( 'monthEventAmount', '3' ) );\n\n\t\t\t\t\t\t\t\tif ( tribe_event_is_on_date( $formatted_date, $event ) ) {\n\t\t\t\t\t\t\t\t\tif ( ! empty ( $terms ) && ! has_term( $terms, Tribe__Events__Main::TAXONOMY, $record->ID ) ) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( count( $_day_event_ids ) < $per_day_limit ) {\n\t\t\t\t\t\t\t\t\t\t$_day_event_ids[] = $record->ID;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$count ++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$event_ids[ $formatted_date ] = $_day_event_ids;\n\t\t\t\t\t\t\t$counts[ $formatted_date ] = $count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// get a unique list of the event IDs that will be displayed, and update all their postmeta and term caches at once\n\t\t\t\t$final_event_ids = call_user_func_array( 'array_merge', $event_ids );\n\t\t\t\t$final_event_ids = array_unique( $final_event_ids );\n\t\t\t\tupdate_object_term_cache( $final_event_ids, Tribe__Events__Main::POSTTYPE );\n\t\t\t\tupdate_postmeta_cache( $final_event_ids );\n\t\t\t}\n\t\t\t// return IDs per day and total counts per day\n\t\t\t$return = array( 'counts' => $counts, 'event_ids' => $event_ids );\n\t\t\t$cache = new Tribe__Cache;\n\t\t\t$cache_key = 'daily_counts_and_ids_' . serialize( $args );\n\t\t\t$cache->set( $cache_key, $return, Tribe__Cache::NON_PERSISTENT, 'save_post' );\n\n\t\t\treturn $return;\n\t\t}",
"public function getItems()\n\t{\n\t\t// Get a storage key.\n\t\t$store = $this->getStoreId('getItems');\n\n\t\t// Try to load the data from internal storage.\n\t\tif (!empty($this->cache[$store]))\n\t\t{\n\t\t\treturn $this->cache[$store];\n\t\t}\n\n\t\t// Load the list items.\n\t\t$items = parent::getItems();\n\n\t\t// If empty or an error, just return.\n\t\tif (empty($items))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t// Getting the following metric by joins is WAY TOO SLOW.\n\n\t\t// Get the feeds in the list.\n\t\t$db = $this->getDbo();\n\t\t$feedNames = JArrayHelper::getColumn($items, 'id');\n\n\t\t// Quote the strings.\n\t\t$feedNames = implode(',', array_map(array($db, 'quote'), $feedNames));\n\n\t\t// Get the published feed counts.\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('p.feedname, COUNT(DISTINCT p.id) AS count_published');\n\t\t$query->from($db->quoteName('#__podcastmanager', 'p'));\n\t\t$query->where($db->quoteName('p.published') . ' = 1');\n\t\t$query->where($db->quoteName('p.feedname') . ' IN (' . $feedNames . ')');\n\t\t$query->group('p.feedname');\n\t\t$db->setQuery($query);\n\t\t$countPublished = $db->loadAssocList('feedname', 'count_published');\n\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\t$this->setError($db->getErrorMsg());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the unpublished feed counts.\n\t\t$query->clear('where');\n\t\t$query->where($db->quoteName('p.published') . ' = 0');\n\t\t$query->where($db->quoteName('p.feedname') . ' IN (' . $feedNames . ')');\n\t\t$db->setQuery($query);\n\t\t$countUnpublished = $db->loadAssocList('feedname', 'count_published');\n\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\t$this->setError($db->getErrorMsg());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the trashed feed counts.\n\t\t$query->clear('where');\n\t\t$query->where($db->quoteName('p.published') . ' = -2');\n\t\t$query->where($db->quoteName('p.feedname') . ' IN (' . $feedNames . ')');\n\t\t$db->setQuery($query);\n\t\t$countTrashed = $db->loadAssocList('feedname', 'count_published');\n\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\t$this->setError($db->getErrorMsg());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Inject the values back into the array.\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\t$item->count_published = isset($countPublished[$item->id]) ? $countPublished[$item->id] : 0;\n\t\t\t$item->count_unpublished = isset($countUnpublished[$item->id]) ? $countUnpublished[$item->id] : 0;\n\t\t\t$item->count_trashed = isset($countTrashed[$item->id]) ? $countTrashed[$item->id] : 0;\n\t\t}\n\n\t\t// Add the items to the internal cache.\n\t\t$this->cache[$store] = $items;\n\n\t\treturn $this->cache[$store];\n\t}",
"public function count_all() {\n return $this->db->count_all($this->_table());\n }",
"public abstract function get_counts();",
"function countAll() ;",
"public function get_feed(): array\n {\n $feed_entries = $this->feedRepository->get_full_feed();\n\n $user_id = $this->sessionService->get_active_user_id();\n\n $filled_feed_entries = array();\n\n foreach ($feed_entries as $entry) {\n $filled_feed_entries[] = $this->convert_feed_database_entry_to_feed_entry($entry, $user_id);\n }\n\n return $filled_feed_entries;\n }",
"protected function preloadCountsFromQuery(array $guids) {\n\t\t$count_rows = elgg_get_entities([\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'comment',\n\t\t\t'container_guids' => $guids,\n\t\t\t'selects' => ['e.container_guid', 'COUNT(*) AS cnt'],\n\t\t\t'group_by' => 'e.container_guid',\n\t\t\t'limit' => false,\n\t\t\t'callback' => false,\n\t\t]);\n\t\t\n\t\tforeach ($guids as $guid) {\n\t\t\t$this->data->setCommentsCount($guid, 0);\n\t\t}\n\t\tforeach ($count_rows as $row) {\n\t\t\t$this->data->setCommentsCount($row->container_guid, $row->cnt);\n\t\t}\n\t}",
"public function getCountsList(){\n return $this->_get(6);\n }",
"public function updateall()\n\t{\n\t\t$this->cleanup();\n\n\t\t//get only 15 feeds at a time\n\t\t$feeds = Feed::orderBy('updated_at', 'asc')->take(15)->get();\n\n\t\t$count = 0;\n\n\t\tif (!empty($feeds)) {\n\t\t\tforeach ($feeds as $feed) {\n\t\t\t\t//update feed, see update function\n\t\t\t\t$count = $count + $this->update($feed);\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json([\n\t\t\t'code' => '200',\n\t\t\t'count' => $count,\n\t\t\t'message' => $count . ' new messages have been added to the database',\n\t\t], 200);\n\t}",
"function getCounts($messages)\n{\n\t$counter = array(\n\t\t'totalMessages' => 0,\n\t\t'unreadMessages' => 0,\n\t);\n\n\tforeach ($messages as $message)\n\t{\n\t\tif ($message['unread'])\n\t\t\t$counter['unreadMessages']++;\n\t\t$counter['totalMessages']++;\n\t}\n\n\treturn $counter;\n}",
"public static function _return_feed_uids($feeds = array()) {\n\t\t\n\t\t$data = array(\n\t\t\t'facebook' => substr($feeds['facebook'], strpos($feeds['facebook'], 'id=')+3), \n\t\t\t'flickr' => return_between($feeds['flickr'], 'id=', '&lang', EXCL),\n\t\t\t'twitter' => return_between($feeds['twitter'], 'user_timeline/', '.rss', EXCL),\n\t\t\t'youtube' => return_between($feeds['youtube'], 'users/', '/uploads?', EXCL),\n\t\t);\n\t\t\n\t\treturn $data;\n\t}",
"function countPosts(){\n\t\t\treturn $this->db->count_all('post');\n\t\t}",
"public static function getEventsCount()\n {\n $key_all = self::REPORT_LIST.\"-global-events-all-count\";\n\n if (!Context::instance()->redis_zookeeper)\n Context::instance()->zookeeperInit();\n\n $num = Context::instance()->redis_zookeeper->get($key_all);\n\n if (!$num)\n return 0;\n\n return $num;\n }",
"function get_unread_forcasts_count($user_id)\n\t{\n\t}",
"public function count_all() {\n $this->db->from($this->table);\n return $this->db->count_all_results();\n }",
"public static function countItems(&$items)\n\t{\n\t\t$db = JFactory::getDbo();\n\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\t$item->count_trashed = 0;\n\t\t\t$item->count_archived = 0;\n\t\t\t$item->count_unpublished = 0;\n\t\t\t$item->count_published = 0;\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('state, count(*) AS count')\n\t\t\t\t->from($db->qn('#__bfdownloadmanager'))\n\t\t\t\t->where('catid = ' . (int)$item->id)\n\t\t\t\t->group('state');\n\t\t\t$db->setQuery($query);\n\t\t\t$downloads = $db->loadObjectList();\n\n\t\t\tforeach ($downloads as $download)\n\t\t\t{\n\t\t\t\tif ($download->state == 1)\n\t\t\t\t{\n\t\t\t\t\t$item->count_published = $download->count;\n\t\t\t\t}\n\n\t\t\t\tif ($download->state == 0)\n\t\t\t\t{\n\t\t\t\t\t$item->count_unpublished = $download->count;\n\t\t\t\t}\n\n\t\t\t\tif ($download->state == 2)\n\t\t\t\t{\n\t\t\t\t\t$item->count_archived = $download->count;\n\t\t\t\t}\n\n\t\t\t\tif ($download->state == -2)\n\t\t\t\t{\n\t\t\t\t\t$item->count_trashed = $download->count;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}"
] |
[
"0.77444386",
"0.6344258",
"0.62924606",
"0.6203131",
"0.61769444",
"0.616719",
"0.59681815",
"0.59532994",
"0.59322464",
"0.5931576",
"0.59127015",
"0.588325",
"0.588325",
"0.588325",
"0.58751833",
"0.587322",
"0.5817269",
"0.58164907",
"0.58048266",
"0.5780891",
"0.57691026",
"0.5765404",
"0.57622266",
"0.5758223",
"0.573409",
"0.57325864",
"0.57231706",
"0.5718759",
"0.57150024",
"0.56639254"
] |
0.8846885
|
0
|
/ db_add_feed Add a new feed entry to the database. $feed is an assoc of key => value mappings, keyed by column name. This can be used to set as many or as few columns as desired. For an ordinary subscription, this will typically just include the feed URL. But other fields may be specified if importing an OPML file.
|
function db_add_feed($feed)
{
$dbh = db_connect();
$fields = array(); // Fields we'll be adding
$values = array(); // The fields' values
foreach ($feed as $k => $v)
{
switch ($k)
{
case "title":
case "subtitle":
case "nickname":
case "url":
case "feed_url":
case "description":
case "image":
case "username":
case "passwd":
// These are strings
$fields[] = $k;
$values[] = "'" . $dbh->real_escape_string($v) . "'";
break;
case "last_update":
/* Normally, we ignore the last_update time
* from the feed itself (as opposed to the
* time from the individual items). But in
* this case, since we're adding a new feed,
* having a publisher-supplied value might be
* better than nothing.
*/
/* XXX - Then again, it might not. We could
* just as easily initialize it to now.
*/
// Convert from time_t to SQL date
$fields[] = "last_update";
$values[] = "FROM_UNIXTIME($v)";
break;
default:
// XXX - Complain about unknown field
//echo "Unknown field [$k]<br/>\n";
break;
}
}
$query = "INSERT INTO `feeds` (" .
implode(",", $fields) .
") VALUES (" .
implode(",", $values) .
")";
$stmt = $dbh->prepare($query);
// XXX - Error-checking
$err = $stmt->execute();
if (!$err)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
$stmt->close();
return false;
}
$feed_id = $dbh->insert_id;
$stmt->close();
// XXX - Call user hooks
return $feed_id;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function addFeed($feed) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('feed', 'add');\n\t\t$stm->execute(array(\n\t\t\t':url' => $feed->url,\n\t\t\t':title' => $feed->title,\n\n\t\t\t':type' => (!empty($feed->type))?$feed->type:'F',\n\t\t\t':status' => (!empty($feed->status))?$feed->status:'A',\n\t\t\t':created' => time(),\n\t\t\t':lastUpdated' => 0,\n\t\t\t':lastPolled' => 0,\n\t\t\t':nextPoll' => 0\n\t\t));\n\n\t\tif ($this->_isPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t\treturn true;\n\t}",
"function addFeed($feed,$url,$return=true);",
"public function db_feed($feed_url=null) {\n echo '<div class=\"rss-widget\">';\n if ($feed):\n wp_widget_rss_output(array(\n 'url' => $fee_url,\n 'title' => 'What\\'s up at 10up',\n 'items' => 2,\n 'show_summary' => 1,\n 'show_author' => 0,\n 'show_date' => 1\n ));\n endif;\n echo \"</div>\";\n }",
"public function add_new_feed(){\n\t\tadd_feed( 'wptticsfeeds', array( $this, 'generate_feed' ) );\n\t}",
"public function addFeed()\n {\n $feed = ExternalPlatformFeeds::find()->where([\n 'ad_id' => $this->ad->primaryKey\n ])->one();\n if (!$feed) {\n $feed = new ExternalPlatformFeeds();\n $feed->ad_id = $this->ad->primaryKey;\n $feed->status = ExternalPlatformFeeds::STATUS_PENDING;\n }\n $feed->platform_id = $this->primaryKey;\n $feed->body = $this->getXmlBody();\n if ($feed->validate()) {\n return $feed->save();\n }\n }",
"function add_feed($feedname, $callback)\n {\n }",
"function addFeedData($feedID,$url,$status=true,$update=0);",
"private function maybe_add_feed_id( $feed_id ) {\r\n/*\r\n\t\tif ( empty( $this->instagram_post_id ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tglobal $wpdb;\r\n\t\t$table_name = $wpdb->prefix . SBI_INSTAGRAM_FEEDS_POSTS;\r\n\t\t// the number is removed from the transient name for backwards compatibilty.\r\n\t\t$feed_id_array = explode( '#', $feed_id );\r\n\t\t$feed_id = $feed_id_array[0];\r\n\r\n\t\t$feed_id_match = $wpdb->get_col( $wpdb->prepare( \"SELECT feed_id FROM $table_name WHERE feed_id = %s AND instagram_id = %s\", $feed_id, $this->instagram_post_id ) );\r\n\r\n\t\tif ( ! isset( $feed_id_match[0] ) ) {\r\n\t\t\t$entry_data = array(\r\n\t\t\t\t$this->db_id,\r\n\t\t\t\t\"'\" . esc_sql( $this->instagram_post_id ) . \"'\",\r\n\t\t\t\t\"'\" . esc_sql( $feed_id ) . \"'\"\r\n\t\t\t);\r\n\t\t\t$entry_string = implode( ',',$entry_data );\r\n\t\t\t$error = $wpdb->query( \"INSERT INTO $table_name\r\n \t\t(id,instagram_id,feed_id) VALUES ($entry_string);\" );\r\n\t\t}\r\n*/\r\n\t}",
"function populate_single_feed($db, $inst_id, $rss_feed)\n\t{\n\t\tglobal $last_rss;\n\n\t\tif($rss\t= @$last_rss->get($rss_feed))\n\t\t{\n\t\t\t$feed\t\t\t= data_manipulator::create_feed_from_rss($rss);\n\t\t\tif(!$feed)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$feed['inst_id']\t= $inst_id;\n\n\t\t\t$feed_select_stmt\t= db_utilities::create_select_single($db, 'feeds', 'title_url_hash', 'feed_url');\n\t\t\t$feed_select_stmt->execute(array($feed['feed_url']));\n\t\t\t$feed_hash_array\t= $feed_select_stmt->fetch();\n\n\t\t\tif(!empty($feed_hash_array))\n\t\t\t{\n\t\t\t\t$stored_feed_hash\t= $feed_hash_array['title_url_hash'];\n\t\t\t\tif($stored_feed_hash !== $feed['title_url_hash'])\n\t\t\t\t{\n\t\t\t\t\t$truncated_feed\t\t= array(\n\t\t\t\t\t\t\t\t\t'feed_title'\t\t=> $feed['feed_title'],\n\t\t\t\t\t\t\t\t\t'feed_desc'\t\t=> $feed['feed_desc'],\n\t\t\t\t\t\t\t\t\t'title_url_hash'\t=> $feed['title_url_hash'],\n\t\t\t\t\t\t\t\t\t'inst_id'\t\t=> $feed['inst_id']\n\t\t\t\t\t\t\t\t );\n\n\t\t\t\t\t$feed_update_stmt\t\t= db_utilities::create_update($db, 'feeds', $truncated_feed, 'feed_url');\n\t\t\t\t\t$truncated_feed['feed_url']\t= $feed['feed_url'];\n\n\t\t\t\t\t$feed_update_stmt->execute(array_values($truncated_feed));\n\t\t\t\t\techo 'Modified feed, updated: ', $feed['feed_url'], \"\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo 'Duplicate feed, ignored: ', $feed['feed_url'], \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$feed_insert_stmt\t= db_utilities::create_insert_ignore($db, 'feeds', $feed);\n\t\t\t\t$feed_insert_stmt->execute(array_values($feed));\n\t\t\t\techo 'New feed, added: ', $feed['feed_url'], \"\\n\";\n\t\t\t}\n\n\t\t\tdata_inserter::populate_posts($db, $feed['feed_url'], $rss);\n\t\t}\n\t}",
"public function addAction() {\n\t\t$url = Minz_Request::param('url_rss');\n\n\t\tif ($url === false) {\n\t\t\t// No url, do nothing\n\t\t\tMinz_Request::forward(array(\n\t\t\t\t'c' => 'subscription',\n\t\t\t\t'a' => 'index'\n\t\t\t), true);\n\t\t}\n\n\t\t$feedDAO = FreshRSS_Factory::createFeedDao();\n\t\t$url_redirect = array(\n\t\t\t'c' => 'subscription',\n\t\t\t'a' => 'index',\n\t\t\t'params' => array(),\n\t\t);\n\n\t\t$limits = FreshRSS_Context::$system_conf->limits;\n\t\t$this->view->feeds = $feedDAO->listFeeds();\n\t\tif (count($this->view->feeds) >= $limits['max_feeds']) {\n\t\t\tMinz_Request::bad(_t('feedback.sub.feed.over_max', $limits['max_feeds']),\n\t\t\t $url_redirect);\n\t\t}\n\n\t\tif (Minz_Request::isPost()) {\n\t\t\t$cat = Minz_Request::param('category');\n\t\t\t$new_cat_name = '';\n\t\t\tif ($cat === 'nc') {\n\t\t\t\t// User want to create a new category, new_category parameter\n\t\t\t\t// must exist\n\t\t\t\t$new_cat = Minz_Request::param('new_category');\n\t\t\t\t$new_cat_name = isset($new_cat['name']) ? $new_cat['name'] : '';\n\t\t\t}\n\n\t\t\t// HTTP information are useful if feed is protected behind a\n\t\t\t// HTTP authentication\n\t\t\t$user = trim(Minz_Request::param('http_user', ''));\n\t\t\t$pass = Minz_Request::param('http_pass', '');\n\t\t\t$http_auth = '';\n\t\t\tif ($user != '' && $pass != '') {\t//TODO: Sanitize\n\t\t\t\t$http_auth = $user . ':' . $pass;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$feed = self::addFeed($url, '', $cat, $new_cat_name, $http_auth);\n\t\t\t} catch (FreshRSS_BadUrl_Exception $e) {\n\t\t\t\t// Given url was not a valid url!\n\t\t\t\tMinz_Log::warning($e->getMessage());\n\t\t\t\tMinz_Request::bad(_t('feedback.sub.feed.invalid_url', $url), $url_redirect);\n\t\t\t} catch (FreshRSS_Feed_Exception $e) {\n\t\t\t\t// Something went bad (timeout, server not found, etc.)\n\t\t\t\tMinz_Log::warning($e->getMessage());\n\t\t\t\tMinz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect);\n\t\t\t} catch (Minz_FileNotExistException $e) {\n\t\t\t\t// Cache directory doesn't exist!\n\t\t\t\tMinz_Log::error($e->getMessage());\n\t\t\t\tMinz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect);\n\t\t\t} catch (FreshRSS_AlreadySubscribed_Exception $e) {\n\t\t\t\tMinz_Request::bad(_t('feedback.sub.feed.already_subscribed', $e->feedName()), $url_redirect);\n\t\t\t} catch (FreshRSS_FeedNotAdded_Exception $e) {\n\t\t\t\tMinz_Request::bad(_t('feedback.sub.feed.not_added', $e->feedName()), $url_redirect);\n\t\t\t}\n\n\t\t\t// Entries are in DB, we redirect to feed configuration page.\n\t\t\t$url_redirect['params']['id'] = $feed->id();\n\t\t\tMinz_Request::good(_t('feedback.sub.feed.added', $feed->name()), $url_redirect);\n\t\t} else {\n\t\t\t// GET request: we must ask confirmation to user before adding feed.\n\t\t\tMinz_View::prependTitle(_t('sub.feed.title_add') . ' · ');\n\n\t\t\t$this->catDAO = new FreshRSS_CategoryDAO();\n\t\t\t$this->view->categories = $this->catDAO->listCategories(false);\n\t\t\t$this->view->feed = new FreshRSS_Feed($url);\n\t\t\ttry {\n\t\t\t\t// We try to get more information about the feed.\n\t\t\t\t$this->view->feed->load(true);\n\t\t\t\t$this->view->load_ok = true;\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->view->load_ok = false;\n\t\t\t}\n\n\t\t\t$feed = $feedDAO->searchByUrl($this->view->feed->url());\n\t\t\tif ($feed) {\n\t\t\t\t// Already subscribe so we redirect to the feed configuration page.\n\t\t\t\t$url_redirect['params']['id'] = $feed->id();\n\t\t\t\tMinz_Request::good(_t('feedback.sub.feed.already_subscribed', $feed->name()), $url_redirect);\n\t\t\t}\n\t\t}\n\t}",
"public function addFeedType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_feed_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}",
"private function addFeedOpml($feed_elt, $parent_cat) {\n\t\tif ($parent_cat == null) {\n\t\t\t// This feed has no parent category so we get the default one\n\t\t\t$this->catDAO->checkDefault();\n\t\t\t$default_cat = $this->catDAO->getDefault();\n\t\t\t$parent_cat = $default_cat->name();\n\t\t}\n\n\t\t$cat = $this->catDAO->searchByName($parent_cat);\n\t\tif ($cat == null) {\n\t\t\t// If there is not $cat, it means parent category does not exist in\n\t\t\t// database.\n\t\t\t// If it happens, take the default category.\n\t\t\t$this->catDAO->checkDefault();\n\t\t\t$cat = $this->catDAO->getDefault();\n\t\t}\n\n\t\t// We get different useful information\n\t\t$url = Minz_Helper::htmlspecialchars_utf8($feed_elt['xmlUrl']);\n\t\t$name = Minz_Helper::htmlspecialchars_utf8($feed_elt['text']);\n\t\t$website = '';\n\t\tif (isset($feed_elt['htmlUrl'])) {\n\t\t\t$website = Minz_Helper::htmlspecialchars_utf8($feed_elt['htmlUrl']);\n\t\t}\n\t\t$description = '';\n\t\tif (isset($feed_elt['description'])) {\n\t\t\t$description = Minz_Helper::htmlspecialchars_utf8($feed_elt['description']);\n\t\t}\n\n\t\t$error = false;\n\t\ttry {\n\t\t\t// Create a Feed object and add it in DB\n\t\t\t$feed = new FreshRSS_Feed($url);\n\t\t\t$feed->_category($cat->id());\n\t\t\t$feed->_name($name);\n\t\t\t$feed->_website($website);\n\t\t\t$feed->_description($description);\n\n\t\t\t// Call the extension hook\n\t\t\t$feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed);\n\t\t\tif ($feed != null) {\n\t\t\t\t// addFeedObject checks if feed is already in DB so nothing else to\n\t\t\t\t// check here\n\t\t\t\t$id = $this->feedDAO->addFeedObject($feed);\n\t\t\t\t$error = ($id === false);\n\t\t\t} else {\n\t\t\t\t$error = true;\n\t\t\t}\n\t\t} catch (FreshRSS_Feed_Exception $e) {\n\t\t\tif (FreshRSS_Context::$isCli) {\n\t\t\t\tfwrite(STDERR, 'FreshRSS error during OPML feed import: ' . $e->getMessage() . \"\\n\");\n\t\t\t} else {\n\t\t\t\tMinz_Log::warning($e->getMessage());\n\t\t\t}\n\t\t\t$error = true;\n\t\t}\n\n\t\tif ($error) {\n\t\t\tif (FreshRSS_Context::$isCli) {\n\t\t\t\tfwrite(STDERR, 'FreshRSS error during OPML feed import from URL: ' . $url . ' in category ' . $cat->id() . \"\\n\");\n\t\t\t} else {\n\t\t\t\tMinz_Log::warning('Error during OPML feed import from URL: ' . $url . ' in category ' . $cat->id());\n\t\t\t}\n\t\t}\n\n\t\treturn !$error;\n\t}",
"protected function addItem(\\SimpleXMLElement $element, Feed $feed)\n {\n $item = new GenericItem;\n foreach ($element as $subElement) {\n $method = isset(self::$methodMapping[$subElement->getName()]) ?\n self::$methodMapping[$subElement->getName()] :\n 'setFeed'.ucfirst($subElement->getName());\n\n if ($subElement->getName() == 'author') {\n $item->setFeedAuthor(array('name' => (string)$subElement));\n\n } else if($subElement->getName() == 'pubDate') {\n $date = \\DateTime::createFromFormat(\\DateTime::RSS, (string) $subElement);\n $item->setFeedDate($date);\n\n } else if($subElement->getName() == 'link') {\n $routes = array();\n $routes[0] = array('url' => (string) $subElement);\n $item->setFeedRoutes($routes);\n\n } elseif (count($subElement) === 0) {\n $item->$method((string)$subElement);\n\n } else {\n $item->$method($this->extractParam($subElement));\n }\n }\n\n $feed->add($item);\n }",
"function db_update_feed($feed_id, $feed)\n{\n\t$dbh = db_connect();\n\n\t$feed_opts = db_get_feed_options($feed_id);\n\n\t/* Update information about the feed itself */\n\tdb_update_feed_info($feed_id, $feed);\n\n\t/* Add/replace the items in the database. */\n\tif (!isset($feed['items']) ||\n\t !is_array($feed['items']) ||\n\t count($feed['items']) == 0)\n\t{\n\t\t// XXX - Should delete old items here. But I don't\n\t\t// want to duplicate code.\n\t\t/* Nothing to do. Return count of old/new/updated\n\t\t * items (all zero)\n\t\t */\n\t\treturn array(\"old\" => 0,\n\t\t\t \"new\" => 0,\n\t\t\t \"updated\" => 0);\n\t}\n\n\t$update_counts = array(\n\t\t\"old\"\t\t=> 0,\n\t\t\"new\"\t\t=> 0,\n\t\t\"updated\"\t=> 0,\n\t\t);\n\t\t// Assoc saying how many items were updated, how many\n\t\t// are new, how many were already in the database.\n\n\tforeach ($feed['items'] as $item)\n\t{\n\t\t/* This query may look long and redundant, but\n\t\t * basically it means:\n\t\t *\n\t\t * If this entry doesn't exist yet, create one. If the\n\t\t * entry already exists, update it from the RSS\n\t\t * information.\n\t\t *\n\t\t * The date fields (look for the IFNULL() calls) work\n\t\t * as follows:\n\t\t *\n\t\t * When adding a new item:\n\t\t * If a publication time was given, use that;\n\t\t * otherwise, use the current time.\n\t\t * If an update time was given, use that; otherwise,\n\t\t * use the publication time.\n\t\t *\n\t\t * When updating an existing item: update pub_date and\n\t\t * last_update to what it says in the feed. If it\n\t\t * wasn't specified, leave the existing field\n\t\t * unchanged.\n\t\t * This is useful because a lot of RSS feeds don't\n\t\t * include timestamps. But we don't want articles\n\t\t * bubbling up to the last time the feed was fetched.\n\t\t *\n\t\t * NB: This code does something that may not be\n\t\t * kosher: the line that sets the last_update field\n\t\t * uses the previously-set value for 'pub_date'. I\n\t\t * don't know whether this is portable or robust; it\n\t\t * just seems to work.\n\t\t */\n\t\t/* XXX - Should\n\t\t * INSERT ... (col1, col2, ...) = (value1, value2...)\n\t\t * be changed to\n\t\t * INSERT ... set col1=value1, col2=value2, ...\n\t\t * for readability?\n\t\t */\n\t\t/* XXX - Unfortunately, this sends the summary and\n\t\t * content to the database twice, which might be\n\t\t * undesirable for feeds that typically have long\n\t\t * posts. Is there a way around this?\n\t\t */\n\t\t/* XXX - The following might happen:\n\t\t * - article is published; pub_date = last_update = t0\n\t\t * - user marks it read at t1\n\t\t * - article is updated; pub_date = t0, last_update = t2\n\t\t * There's now new information that the user might\n\t\t * want to see; ought to mark the article as unread.\n\t\t * Then again, the user might not: the update might be\n\t\t * a trivial modification to fix a typo; or it might\n\t\t * be a liveblog of an ongoing, uninteresting event.\n\t\t *\n\t\t * Perhaps a better compromise might be to use only\n\t\t * the most recent of pub_date and last_update as the\n\t\t * sole publication time. \n\t\t */\n\t\t/* Note that \"ON DUPLICATE KEY\" is a MySQL-ism */\n\t\t/* XXX - What with mtime, it's not obvious that \"ON\n\t\t * DUPLICATE KEY\" really does everything we want. It\n\t\t * might be better to do a SELECT by (feed_id, guid),\n\t\t * and then either\n\t\t * a) INSERT (if SELECT doesn't find anything), or\n\t\t * b) figure out what needs to change and UPDATE (if\n\t\t * SELECT finds an existing item).\n\t\t *\n\t\t * This would remove the non-standard \"ON DUPLICATE\n\t\t * KEY\", probably make the code more readable, and\n\t\t * also allow 'mtime' to work properly.\n\t\t */\n\n\t\t$query = <<<EOT\nINSERT INTO\t`items`\n\t\t(feed_id, url, title, summary, content, author, category,\n\t\t comment_url, comment_rss, guid,\n\t\t pub_date,\n\t\t last_update,\n\t\t is_read)\nVALUES\t\t(?, ?, ?, ?, ?, ?, ?,\n\t\t ?, ?, ?,\n\t\t IFNULL(FROM_UNIXTIME(?), NOW()),\n\t\t pub_date,\n\t\t IFNULL(?, FALSE))\nON DUPLICATE KEY UPDATE\n\t\turl=?,\n\t\ttitle=?,\n\t\tsummary=?,\n\t\tcontent=?,\n\t\tauthor=?,\n\t\tcategory=?,\n\t\tcomment_url=?,\n\t\tcomment_rss=?,\n\t\tpub_date=IFNULL(FROM_UNIXTIME(?), pub_date)\nEOT;\n\t\t// XXX - Ought to update mtime iff any of the fields\n\t\t// have changed. Currently, we're setting mtime to\n\t\t// NOW() in any case. This means that the item gets\n\t\t// updated every time we fetch the RSS feed, until the\n\t\t// item drops out of the feed.\n\n\t\t$stmt = $dbh->prepare($query);\n\t\t$dummy_categories = NULL;\t// XXX - Hack until I\n\t\t\t\t\t\t// figure out how to\n\t\t\t\t\t\t// deal with\n\t\t\t\t\t\t// categories\n\n\t\t/* Construct author to store in database */\n\t\tif (isset($item['author_name']))\n\t\t{\n\t\t\t$author = $item['author_name'];\n\n\t\t\tif (isset($item['author_email']))\n\t\t\t{\n\t\t\t\t$author .= \" <$item[author_email]>\";\n\t\t\t}\n\t\t} elseif (isset($item['author_email']))\n\t\t\t$author = \"<$item[author_email]>\";\n\n//echo \"<pre>\\$author [$author]</pre>\\n\";\n\n\t\tswitch ($feed_opts['id-from'])\n\t\t{\n\t\t case \"url\":\n\t\t\t$guid = md5($item['url']);\n\t\t\tbreak;\n\n\t\t case \"title\":\n\t\t\t$guid = md5($item['title']);\n\t\t\tbreak;\n\n\t\t case \"guid\":\n\t\t default:\n\t\t\tif (isset($item['guid']))\n\t\t\t{\n\t\t\t\t$guid = $item['guid'];\n\t\t\t\tif (strlen($guid) > 127)\n\t\t\t\t{\n\t\t\t\t\t# error_log(\"Hashing overly-long guid $guid\");\n\t\t\t\t\t$guid = md5($guid);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// This item doesn't have a GUID, so make one.\n\t\t\t\t// URLs can get arbitrarily long, and all we\n\t\t\t\t// want is something unique, so just use a\n\t\t\t\t// hash of the long URL.\n\t\t\t\t$guid = md5($item['url']);\n\t\t\t}\n\t\t}\n\n\t\t/* Something is quite picky about the value of\n\t\t * is_read. Let's be very careful about setting it.\n\t\t */\n\t\tif (!isset($item['is_read']))\n\t\t\t$item['is_read'] = false;\n\t\t$is_read = 0;\n\t\tswitch ($item['is_read'])\n\t\t{\n\t\t\tcase false:\n\t\t\t\t$is_read = 0;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$is_read = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\nerror_log(\"Unknown value for is_read: [\" . print_r($item['is_read'], true) . \"]\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$stmt->bind_param(\"dsssssssssd\" .\n\t\t\t\t \"ssssssssdi\",\n\t\t\t\t // Values for new items\n\t\t\t\t $feed_id,\n\t\t\t\t $item['url'],\n\t\t\t\t $item['title'],\n\t\t\t\t $item['description'],\n\t\t\t\t $item['content'],\n\t\t\t\t $author,\n\t\t\t\t $dummy_categories,\t// XXX - Deal with categories\n\t\t\t\t $item['comment_url'],\n\t\t\t\t $item['comment_feed'],\n\t\t\t\t $guid,\n\t\t\t\t $item['pub_time'],\n\t\t\t\t $is_read,\n\n\t\t\t\t // Values for updated items\n\t\t\t\t $item['url'],\n\t\t\t\t $item['title'],\n\t\t\t\t $item['description'],\n\t\t\t\t $item['content'],\n\t\t\t\t $author,\n\t\t\t\t $dummy_categories,\t// XXX - Deal with categories\n\t\t\t\t $item['comment_url'],\n\t\t\t\t $item['comment_feed'],\n\t\t\t\t $item['pub_time']\n\t\t\t);\n\t\t$err = $stmt->execute();\n\t\t// XXX - Can count number of affected rows. Apparently\n\t\t//\t0-> duplicate entry (no change)\n\t\t//\t1-> new entry\n\t\t//\t2-> updated entry\n\n\t\t$nrows = $stmt->affected_rows;\n\t\tswitch ($nrows)\n\t\t{\n\t\t case 0:\n\t\t\t$update_counts['old']++;\n\t\t\tbreak;\n\t\t case 1:\n\t\t\t$update_counts['new']++;\n\t\t\tbreak;\n\t\t case 2:\n\t\t\t$update_counts['updated']++;\n\t\t\tbreak;\n\t\t default:\n\t\t\t// This should never happen\n\t\t\t// XXX - Check for this?\n\t\t\tbreak;\n\t\t}\n\n\t\t// XXX - Better error-checking\n\t\tif ($err)\n\t\t\t;// echo \"OK (\", print_r($err), \") errno \", $dbh->errno, \", error [\", $dbh->error, \"]<br/>\\n\";\n\t\telse {\n\t\t\terror_log(\"MySQL error in feed $feed_id: \" .\n\t\t\t\t $dbh->errno . ': \"' .\n\t\t\t\t $dbh->error . '\"');\n\t\t\t// What follows is very ad hoc.\n\t\t\tswitch ($dbh->errno)\n\t\t\t{\n\t\t\t case 1366:\n\t\t\t\tprint_r($item);\n\t\t\t\tbreak;\n\t\t\t case 1406:\n\t\t\t\terror_log(\"guid: \" . $guid);\n\t\t\t\tbreak;\n\t\t\t default:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n//echo \"Affected rows: [\", $stmt->affected_rows, \"]<br/>\\n\";\n\t}\n\n\t// Update feeds.last_update, so we can measure staleness\n\t/* XXX - Edge case: what if the feed is broken (or weird), so\n\t * that currently feeds.last_update == Aug 1 (from the last\n\t * update), but the most recent items.pub_date is Mar 1? Then\n\t * we'd see feeds.last_update go back 4 months, even though\n\t * the most recent post was Aug 1.\n\t *\n\t * Perhaps use\n\t * SET last_update = MAX(last_update, (SELECT ...))\n\t * But then if the feed is empty, then the IFNULL will default\n\t * to NOW(), which is also bad. If the feed is empty, then\n\t * feeds.last_update should remain unchanged. So perhaps\n\t * should default to the epoch.\n\t */\n\t$query = <<<EOT\nUPDATE\t`feeds`\n\tSET\tlast_update = \n\t\t(SELECT\tIFNULL(MAX(items.pub_date), NOW())\n\t\t FROM\titems\n\t\t WHERE\titems.feed_id = feeds.id)\n\tWHERE\tid = ?\nEOT;\n\t$stmt = $dbh->prepare($query);\n\t\t\t// XXX - Error-checking\n\t$err = $stmt->bind_param(\"i\",\n\t\t\t\t $feed_id);\n\t\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t\t// XXX - Error-checking\n\n\t/* Delete old items from database.\n\t * Here, we look up the \"autodelete\" option for the feed in\n\t * question, and delete the items older than that many days.\n\t */\n\t// XXX - This is potentially a problem with\n\t// a) An article that has gone unread n+1 days, and was just\n\t// updated. In this case, you had n days to read it. Cope.\n\t// b) Feeds that don't give dates, such as Perry Bible\n\t// Fellowship. In this case, the feed parser should insert an\n\t// artificial date.\n\t$query = <<<EOT\nDELETE FROM\t`items`\nWHERE\t\tfeed_id = ?\n AND\t\tpub_date < NOW() -\n\t\t INTERVAL get_option(feed_id, \"autodelete\") DAY\nEOT;\n\t$stmt = $dbh->prepare($query);\n\tif ($stmt === FALSE)\n\t{\n\t\t// XXX - Better error-checking\n\t\terror_log(\"prepare error \" . $dbh->errno .\n\t\t\t\": \\\"\" . $dbh->error .\n\t\t\t\"\\\"<br/>\\n\");\n\t}\n\t$err = $stmt->bind_param(\"i\",\n\t\t\t\t $feed_id);\n\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t// XXX - Error-checking\n\n\t/* Return count of new/updated items */\n\treturn $update_counts;\n}",
"public function addNewsfeed($url)\n {\n $this->rssFeed[] = $url;\n }",
"function add_event($settings)\n {\n if(!$this->isLogged)\n $this->login();\n \n if($this->isLogged)\n {\n $_entry = \"<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>\n <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>\n <title type='text'>\".$settings[\"title\"].\"</title>\n <content type='text'>\".$settings[\"content\"].\"</content>\n <author>\n <name>\".$this->email.\"</name>\n <email>\".$this->email.\"</email>\n </author>\n <gd:transparency\n value='http://schemas.google.com/g/2005#event.opaque'>\n </gd:transparency>\n <gd:eventStatus\n value='http://schemas.google.com/g/2005#event.confirmed'>\n </gd:eventStatus>\n <gd:where valueString='\".$settings[\"where\"].\"'></gd:where>\n <gd:when startTime='\".$settings[\"startDay\"].\"T\".$settings[\"startTime\"].\".000Z'\n endTime='\".$settings[\"endDay\"].\"T\".$settings[\"endTime\"].\".000Z'>\n\t<gd:reminder minutes='5' /></gd:when>\n </entry>\";\n $this->prepare_feed_path();\n \n $header = array();\n $this->setMoreHeader(\"MIME-Version: 1.0\");\n //$this->setMoreHeader(\"Accept: text/xml\");\n $this->setMoreHeader(\"Authorization: GoogleLogin auth=\".$this->fAuth);\n $this->setMoreHeader(\"Content-length: \".strlen($_entry));\n $this->setMoreHeader(\"Content-type: application/atom+xml\");\n $this->setMoreHeader(\"Cache-Control: no-cache\");\n $this->setMoreHeader(\"Connection: close \\r\\n\");\n $this->setMoreHeader($_entry);\n\n \n $this->setHost($this->feed_host,80);\n $this->useSSL(false);\n $this->setHandleRedirects(false);\n $status = $this->post($this->feed_path_prepared, null ,null);\n if (302==$status) {\n \t$h = $this->getHeaders();\n\t$new_uri = parse_url($h['location']);\n\t$status =$this->post($new_uri['path'].'?'.$new_uri['query'], null ,null) ;\n\tif(201==$status)\n\t return true;\n\t}\n }\n return false;\n }",
"public function add_entry($entry);",
"public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}",
"public function add($key, $name, $feed, $preview, $status);",
"public function addFeeds($fid, $fdate, $ftime, $pig, $proddate,$qty,$user)\r\n\t\t{\r\n\t\t\t/* \r\n\t\t\t\tThis function inserts new feed intake details of a specific pig.\r\n\t\t\t\tIt also inserts the transaction done by the user in user_transaction table.\r\n\t\t\t*/\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$q = \"SELECT max(ft_id)\r\n\t\t\t\t\tFROM feed_transaction\";\r\n\t\t\t\t$r = mysqli_query($link, $q);\r\n\t\t\t\t$ro = mysqli_fetch_row($r);\r\n\t\t\t\t$max = $ro[0] + 1;\r\n\t\t\t\t$query = \"INSERT INTO feed_transaction(ft_id,quantity,unit,date_given,time_given,pig_id,feed_id,prod_date) \r\n\t\t\t\t\t\tVALUES('\" . $max . \"','\" . $qty . \"','kg','\" . $fdate . \"','\" . $ftime . \"','\" . $pig . \"','\" . $fid . \"','\" . $proddate . \"');\";\r\n\t\t\t\t$this->userTransactionEdit($user,$max,\"feeds\",0,$fid,1,$pig);\r\n\t\t\t\tif ($result = mysqli_query( $link, $query )) {\r\n\t\t \t$data = array(\"success\"=>\"true\",\r\n\t\t \"newId\"=> $link->insert_id);\r\n\t\t\t }else {\r\n\t\t\t $data = array(\"success\"=>\"false\",\r\n\t\t\t \"error\"=>mysqli_error($link));\r\n\t\t\t }\r\n\t\t\t return $data;\r\n\t\t}",
"public function AddFeedAtom($atomLink = '') {\r\n\tif (empty($atomLink)) {\r\n\t if ($this->FeedTitle->offsetExists('link')) {\r\n\t\t$this->FeedAtom->offsetSet('href', $this->FeedTitle->offsetGet('link'));\r\n\t\treturn TRUE;\r\n\t }\r\n\t return FALSE;\r\n\t}\r\n\t$this->FeedAtom->offsetSet('href', $atomLink);\r\n\treturn TRUE;\r\n }",
"function populate_posts($db, $feed_url, $rss)\n\t{\n\t\t$feed_select_stmt\t= db_utilities::create_select_single($db, 'feeds', 'feed_id', 'feed_url');\n\t\t$feed_select_stmt->execute(array($feed_url));\n\t\t$feed_id_array\t\t= $feed_select_stmt->fetch();\n\t\t$feed_id\t\t= $feed_id_array['feed_id'];\n\n\t\tif(!empty($rss['items']))\n\t\t{\n\t\t\tforeach($rss['items'] as $post)\n\t\t\t{\n\t\t\t\tdata_inserter::populate_single_post($db, $feed_id, $post);\n\t\t\t}\n\t\t}\n\t}",
"public function addEntry(DataStreamEntry $entry);",
"public function addEntry($entry) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t// TODO: convert author into authorid\n\t\t$authorId = 0;\n\t\t\n\t\tif ($entry->author) {\n\t\t\t$authorId = $this->_getAuthorId($entry->author);\n\t\t}\n\t\t\n\t\t$stm = $this->_prepareStatement('entry', 'add');\n\t\t$stm->execute(array(\n\t\t\t':url' => $entry->url,\n\t\t\t':title' => $entry->title,\n\t\t\t':id' => $entry->id,\n\t\t\t\n\t\t\t':author_id' => $authorId,\n\t\t\t':summary' => (!empty($entry->summary))?$entry->summary:'',\n\t\t\t':content' => (!empty($entry->content))?$entry->content:'',\n\t\t\t\n\t\t\t':published' => strtotime($entry->published),\n\t\t\t':updated' => (!empty($entry->updated))?strtotime($entry->updated):0\n\n\t\t));\n\n\t\tif ($this->_isPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t\treturn true;\n\t}",
"private function update_feed($feed)\n\t{\n\t\t$feed = intval($feed);\n\n\t\tif ( ! $feed)\n\t\t\tthrow new Exception('Invalid feed id');\n\n\t\t$feed = ORM::factory('Feed', $feed);\n\n\t\tMinion_CLI::write($feed->name . ' updating...');\n\n\t\t$feeds = new Feeds();\n\t\t$feeds->register_callback(function ($msg) { Minion_CLI::write($msg); });\n\t\t$feeds->update_single($feed);\n\t}",
"public function addItem($feedItem)\n {\n $this->items[] = $feedItem;\n }",
"function handleFeed()\n {\n if (isset($this->files['image_file'])\n && is_uploaded_file($this->files['image_file']['tmp_name'])) {\n $this->post['image_data'] = file_get_contents($this->files['image_file']['tmp_name']);\n $this->post['image_type'] = $this->files['image_file']['type'];\n $this->post['image_size'] = $this->files['image_file']['size'];\n }\n\n // Insert or update a Feed/Channel\n if (isset($this->post['id'])) {\n // Update an existing feed.\n $feed = UNL_MediaHub_Feed::getById($this->post['id']);\n $feed->synchronizeWithArray($this->post);\n $feed->save();\n } else {\n // Add a new feed for this user.\n $feed = UNL_MediaHub_Feed::addFeed($this->post, UNL_MediaHub_Manager::getUser());\n }\n $this->redirect('?view=feed&id='.$feed->id);\n }",
"public function insert()\n {\n $postDateGMT = $this->_pubDate;\n $postDateGMT->setTimezone( new Datetimezone( 'GMT' ) );\n\n $post = array\n (\n 'post_content' => $this->_excerpt,\n 'post_date' => $this->_pubDate->format( 'Y-m-d H:i:s' ),\n 'post_date_gmt' => $postDateGMT->format( 'Y-m-d H:i:s' ),\n 'post_parent' => $this->_feedID,\n 'post_status' => 'publish',\n 'post_title' => $this->_title,\n 'post_type' => 'fs_feed_entry'\n );\n\n remove_action( 'save_post', array( 'FS', 'onWPSavePost' ) );\n $postID = wp_insert_post( $post );\n add_action( 'save_post', array( 'FS', 'onWPSavePost' ) );\n\n if( $postID === 0 )\n {\n return false;\n }\n\n add_post_meta( $postID, 'fs_feed_entry_url', $this->_url, true );\n\n return true;\n }",
"public function addFeedName($fname, $ftype,$user)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$q = \"SELECT max(feed_id)\r\n\t\t\t\t\tFROM feeds\";\r\n\t\t\t\t$r = mysqli_query($link, $q);\r\n\t\t\t\t$ro = mysqli_fetch_row($r);\r\n\t\t\t\t$max = $ro[0] + 1;\r\n\t\t\t\t$query = \"INSERT INTO feeds(feed_id,feed_name,feed_type) \r\n\t\t\t\t\t\tVALUES('\" . $max . \"','\" . $fname . \"','\" . $ftype . \"');\";\r\n\t\t\t\tif ($result = mysqli_query( $link, $query )) {\r\n\t\t \t$data = array(\"success\"=>\"true\",\r\n\t\t \"newId\"=> $link->insert_id);\r\n\t\t \t\t$this->userTransactionEdit($user,$max,\"feed name\",0,$fname,1,0);\r\n\t\t\t }else {\r\n\t\t\t $data = array(\"success\"=>\"false\",\r\n\t\t\t \"error\"=>mysqli_error($link));\r\n\t\t\t }\r\n\t\t\t return $data;\r\n\t\t}",
"function get_feed_link($feed = '')\n {\n }"
] |
[
"0.7772843",
"0.6675993",
"0.6673017",
"0.6613043",
"0.6544316",
"0.6524744",
"0.6478651",
"0.6216558",
"0.6043541",
"0.5974395",
"0.57403",
"0.5718662",
"0.56700915",
"0.5610786",
"0.55953276",
"0.55363595",
"0.55282843",
"0.5523012",
"0.55196637",
"0.5516232",
"0.550678",
"0.5497354",
"0.5496115",
"0.54927534",
"0.5420464",
"0.54136336",
"0.534416",
"0.5307597",
"0.52899736",
"0.5282336"
] |
0.7975561
|
0
|
/ db_delete_feed Delete a feed from the database (both feed entry and articles). Returns FALSE in case of error, or TRUE otherwise. XXX Should probably return something more interesting, like an error code.
|
function db_delete_feed($feed_id)
{
$dbh = db_connect();
// XXX - Call any hooks to be run before the feed is deleted
/* First, delete all of the articles in the feed */
$query = "DELETE FROM `items` WHERE feed_id = ?";
$stmt = $dbh->prepare($query);
// XXX - Error-checking
$err = $stmt->bind_param("i", $feed_id);
// XXX - Error-checking
$err = $stmt->execute();
// XXX - Error-checking
$stmt->close();
/* Delete the feed from all groups that it's in. */
$query = "DELETE FROM `group_members` WHERE member = ?";
$stmt = $dbh->prepare($query);
// XXX - Error-checking
$err = $stmt->bind_param("i", $feed_id);
// XXX - Error-checking
$err = $stmt->execute();
// XXX - Error-checking
$stmt->close();
/* Delete the entry for the feed itself. */
$query = "DELETE FROM `feeds` WHERE id = ?";
$stmt = $dbh->prepare($query);
// XXX - Error-checking
$err = $stmt->bind_param("i", $feed_id);
// XXX - Error-checking
$err = $stmt->execute();
// XXX - Error-checking
$stmt->close();
return TRUE;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function deleteFeed($feed) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\tif (is_string($feed)) {\n\t\t\t$stm = $this->_prepareStatement('feed', 'deleteByUrl');\t\t\n\t\t\t$stm->execute(array(\n\t\t\t\t':url' => $feed\n\t\t\t));\n\t\t} else if (!empty($feed->id)) {\n\t\t\t$stm = $this->_prepareStatement('feed', 'deleteById');\t\t\n\t\t\t$stm->execute(array(\n\t\t\t\t':id' => $feed->id\n\t\t\t));\n\t\t}\n\t\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($stm->rowCount()) {\n\t\t\treturn true;\n\t\t}\t\n\t\treturn false;\n\t}",
"function deleteFeed($feedID,$return=true);",
"public function deleteFeed()\n {\n if ($this->ad->isNewRecord) {\n return;\n }\n $feed = ExternalPlatformFeeds::find()->where([\n 'ad_id' => $this->ad->primaryKey\n ])->one();\n if ($feed) {\n return $feed->delete();\n }\n return $feed;\n }",
"function feed_group_delete($feed_group, DatabaseTransaction $transaction = NULL) {\r\n if (!$transaction) {\r\n $transaction = db_transaction();\r\n }\r\n\r\n try {\r\n if (isset($feed_group->fgid)) {\r\n db_delete('feed_user_group')\r\n ->condition('fgid', $feed_group->fgid)\r\n ->execute();\r\n \r\n db_delete('feed_group')\r\n ->condition('fgid', $feed_group->fgid)\r\n ->execute();\r\n }\r\n return TRUE;\r\n }\r\n catch (Exception $e) {\r\n $transaction->rollback();\r\n watchdog_exception('feed', $e);\r\n return FALSE;\r\n }\r\n}",
"function RSS_delete()\n{\n // Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()\n // return arrays but we handle them differently. For pnDBGetConn()\n // we currently just want the first item, which is the official\n // database handle. For pnDBGetTables() we want to keep the entire\n // tables array together for easy reference later on\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n // Create a new data dictionary object\n $dict = NewDataDictionary($dbconn);\n\n // Drop the table - for such a simple command the advantages of separating\n // out the SQL statement from the Execute() command are minimal, but as\n // this has been done elsewhere it makes sense to stick to a single method\n // create the data dictionaries SQL array\n\n\t// This array contains all the ncessary information to execute some sql \n\t// on any of the supported dbms platforms\n $sqlarray = $dict->DropTableSQL($pntable['RSS']);\n\n // Execute the sql that has been created\n $result = $dict->ExecuteSQLArray($sqlarray);\n\n // Check for an error with the database code, and if so set an\n // appropriate error message and return\n if ($result != 2) {\n pnSessionSetVar('errormsg', _DELETETABLEFAILED);\n return false;\n }\n\n // Delete any module variables\n\tpnModDelVar('RSS', 'cachedirectory');\n pnModDelVar('RSS', 'cacheinterval');\n pnModDelVar('RSS', 'itemsperpage');\n pnModDelVar('RSS', 'openinnewwindow');\n pnModDelVar('RSS', 'bold');\n\n // Deletion successful\n return true;\n}",
"public function deleteEntry($entry) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\tif (is_string($entry)) {\n\t\t\t$stm = $this->_prepareStatement('entry', 'deleteByAtomId');\t\t\n\t\t\t$stm->execute(array(\n\t\t\t\t':id' => $entry\n\t\t\t));\n\t\t} else if (!empty($entry->row_id)) {\n\t\t\t$stm = $this->_prepareStatement('entry', 'deleteById');\t\t\n\t\t\t$stm->execute(array(\n\t\t\t\t':row_id' => $entry->row_id\n\t\t\t));\n\t\t}\n\t\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($stm->rowCount()) {\n\t\t\treturn true;\n\t\t}\t\n\t\treturn false;\n\t}",
"public function destroy(Feed $feed)\n {\n\n //$blog = \\DB::table('feeds')->where('id',4);\n $headquote = \\App\\Feed::find(4);\n\n $headquote->delete();\n\n //$result = Feed::find($feed)->delete();\n //return $result;\n return response()->json(\"ok\", 200);\n }",
"public function deleteAction() {\n\t\t$redirect_url = Minz_Request::param('r', false, true);\n\t\tif (!$redirect_url) {\n\t\t\t$redirect_url = array('c' => 'subscription', 'a' => 'index');\n\t\t}\n\t\tif (!Minz_Request::isPost()) {\n\t\t\tMinz_Request::forward($redirect_url, true);\n\t\t}\n\n\t\t$id = Minz_Request::param('id');\n\n\t\tif (self::deleteFeed($id)) {\n\t\t\tMinz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);\n\t\t} else {\n\t\t\tMinz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url);\n\t\t}\n\t}",
"public function deleteFeed($id)\n {\n $name = $this->dataBaseFeedsController->getFeed($id)['image'];\n if ($this->dataBaseFeedsController->deleteFeed($id))\n {\n return $this->deleteImageFile($name);\n }\n return;\n }",
"function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete messages\r\n $db->query( \"DELETE FROM eZForum_Message WHERE ForumID='$this->ID'\" );\r\n\r\n // delete category assignments\r\n $db->query( \"DELETE FROM eZForum_ForumCategoryLink WHERE ForumID='$this->ID'\" );\r\n\r\n // delete the forum\r\n $db->query( \"DELETE FROM eZForum_Forum WHERE ID='$this->ID'\" );\r\n\r\n return true;\r\n }",
"public function delete($siteUrl, $feedpath, $optParams = array())\n {\n $params = array('siteUrl' => $siteUrl, 'feedpath' => $feedpath);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }",
"function deletefeed(){\n if($_SERVER['REQUEST_METHOD'] === 'POST'){\n $post_id=$this->helper->getUriSegment(2);\n $user_id=$_POST['user_id'];\n if(intval($user_id) == 0 || intval($post_id) == 0 ){\n $arr[0]['Result'] = 0;\n\t $arr[0]['MSG'] = 'please send all required data';\n echo json_encode($arr);\n die;\n }\n $details = $this->post->getpost($post_id);\n if(!$details){\n $arr[0]['Result'] = 0;\n\t $arr[0]['MSG'] = 'invalid post id';\n echo json_encode($arr);\n die; \n }\n if($details['author'] != $user_id){\n $arr[0]['Result'] = 0;\n\t $arr[0]['MSG'] = 'You are not authorized to delete this post.';\n echo json_encode($arr);\n die; \n }\n $where = array( 'ID' => $post_id );\n $update=$this->post->delete_post($where);\n\n \t $json[0]['result']=1;\n\t $json[0]['msg']='News deleted successfully';\n\t echo json_encode($json);\n\t die; \n }else{\n $arr[0]['Result'] = 0;\n\t$arr[0]['MSG'] = 'please call required method';\n echo json_encode($arr);\n }\n }",
"public function delete()\n {\n $items = (new Item)->readList('id_feed = ?', [$this->id]);\n foreach ($items as $item) { /** @var Item $item */\n $item->delete();\n }\n\n return parent::delete();\n }",
"public function delete () {\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query($wpdb->prepare(\"\n\t\tDELETE FROM $wpdb->postmeta WHERE meta_key='syndication_feed_id'\n\t\tAND meta_value = '%s'\n\t\t\", $this->id));\n\n\t\t$wpdb->query($wpdb->prepare(\"\n\t\tDELETE FROM $wpdb->links WHERE link_id = %d\n\t\t\", (int) $this->id));\n\n\t\t$this->id = NULL;\n\t}",
"function rssmi_delete_feed_post_admin()\n{\n rssmi_delete_posts_admin();\n}",
"public function delete($data)\n {\n if(!isset($data['id'])) {\n throw new \\Box_Exception('Post id not passed');\n }\n\n $model = $this->di['db']->getExistingModelById('Post', $data['id'], 'News item not found');\n $id = $model->id;\n $this->di['db']->trash($model);\n $this->di['logger']->info('Removed news item #%s', $id);\n return true;\n }",
"function deleteFolder($store, $folderentryid, $entryidlist, $action){\n\t\t\t$binEntryIdList = Array();\n\t\t\t\n\t\t\tforeach($entryidlist as $key => $value){\n\t\t\t\t$binEntryIdList[] = hex2bin($entryidlist[$key][\"entryid\"]);\n\t\t\t}\n\t\t\t\n\t\t\t$sfolder = mapi_msgstore_openentry($store, $folderentryid);\n\n\t\t\tforeach ($binEntryIdList as $key=>$folderlist){\n\t\t\t\tmapi_folder_deletefolder($sfolder, $folderlist, DEL_FOLDERS | DEL_MESSAGES | DELETE_HARD_DELETE);\n\t\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\t\t\t\tif(!$result){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $result;\n\t\t}",
"function delete_post($id)\n{\n $delete_query = 'DELETE FROM ' . TBL_POSTS . ' WHERE `post_id`=' . (int)$id;\n if ($result = mysql_query($delete_query))\n {\n return TRUE;\n }\n\n return FALSE;\n}",
"public function apiDelete($feed_type_id)\n {\n \t\tCache::forget('feed_types');\n \t\tFeedTypes::findOrFail($feed_type_id)->delete();\n DB::table('feeds_feed_type_budgeted_amount_per_day')->where('feed_type_id',$feed_type_id)->delete();\n\n \t\treturn \"deleted\";\n }",
"function delete()\n\t{\n\t\tglobal $ilDB;\n\n\t\t// always call parent delete function first!!\n\t\tif (!parent::delete())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// delete all items\n\t\t$med_items = $this->getItemsArray();\n\t\tforeach ($med_items as $item)\n\t\t{\n\t\t\tinclude_once(\"./Services/News/classes/class.ilNewsItem.php\");\n\t\t\t$news_item = new ilNewsItem($item[\"id\"]);\n\t\t\t$news_item->delete();\n\t\t}\n\t\t\n\t\t$this->deleteOrder();\n\n\t\t// delete record of table il_media_cast_data\n\t\t$query = \"DELETE FROM il_media_cast_data\".\n\t\t\t\" WHERE id = \".$ilDB->quote($this->getId(), \"integer\");\n\t\t$ilDB->manipulate($query);\n\t\t\n\t\treturn true;\n\t}",
"function delete_dj_blog($FormID) {\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"delete from DJBLOG\r\n where DJBlogID='\".$FormID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"function entry_delete($entry_id, $channel_id, $url_title='')\n\t{\n\t\tif ( ! empty($url_title)\n\t\t\t&& (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri']))\n\t\t\t&& (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri'])) )\n\t\t{\n\t\t\n\t\t\t$entry_url = trim($this->settings['channel_url'][$channel_id]['uri'],'/').'/'.$url_title;\n\t\t\n\t\t\t// remove this entry\n\t\t\t$this->EE->db->delete(\n\t\t\t\t'detours',\n\t\t\t\tarray(\n\t\t\t\t\t'new_url' => $entry_url,\n\t\t\t\t\t'site_id' => $this->site_id\n\t\t\t\t)\n\t\t\t);\n\t\t\n\t\t}\n\t\n\t}",
"function delete_bookmark($user, $url) \n{\n $conn = db_connect();\n\n // Delete the bookmark\n if (!$conn->query(\"DELETE FROM bookmarks WHERE username='\".$user.\"' AND url='\".$url.\"'\")) {\n throw new Exception('Bookmark could not be deleted');\n }\n\n return true;\n}",
"function dbDeleteTwitt($db, $id, $login)\r\n {\r\n try\r\n {\r\n $request = 'delete from twitts where id=:id and login=:login';\r\n $statement = $db->prepare($request);\r\n $statement->bindParam(':id', $id, PDO::PARAM_INT);\r\n $statement->bindParam(':login', $login, PDO::PARAM_STR, 20);\r\n $statement->execute();\r\n }\r\n catch (PDOException $exception)\r\n {\r\n error_log('Request error: '.$exception->getMessage());\r\n return false;\r\n }\r\n return true;\r\n }",
"function delete($id)\n {\n if ($this->db->delete('fis_dworkshopseminar_feedbacks', array('wsfeed_id' => $id))) {\n $this->session->set_userdata('typeNotif', 'successDelete');\n return TRUE;\n } else {\n $this->session->set_userdata('typeNotif', 'errorDelete');\n return FALSE;\n }\n }",
"public function delete($uid){\n global $SnickerIndex, $SnickerUsers;\n if(!isset($this->db[$uid])){\n return false;\n }\n $row = $this->db[$uid];\n\n // Remove Index\n if(!$SnickerIndex->delete($uid)){\n return false;\n }\n if(strpos($row[\"author\"], \"guest::\") === 0){\n $SnickerUsers->deleteComment(substr($row[\"author\"], strlen(\"guest::\")), $uid);\n }\n\n // Remove Database Item\n unset($this->db[$uid]);\n if($this->save() !== true){\n Log::set(__METHOD__, \"error-update-db\");\n return false;\n }\n return true;\n }",
"function news_delete( $p_news_id ) {\r\n\t\t$c_news_id = db_prepare_int( $p_news_id );\r\n\r\n\t\t$t_news_table = config_get( 'mantis_news_table' );\r\n\r\n\t\t$query = \"DELETE FROM $t_news_table\r\n\t \t\t WHERE id='$c_news_id'\";\r\n\r\n\t\tdb_query( $query );\r\n\r\n\t\t# db_query() errors on failure so:\r\n\t\treturn true;\r\n\t}",
"function deletePost($blogTitle) {\n $connection = websterAdmin();\n try {\n $sql = 'DELETE FROM blog WHERE blogTitle = :blogTitle';\n $stmt = $connection->prepare($sql);\n $stmt->bindParam(':blogTitle', $blogTitle, PDO::PARAM_STR);\n $stmt->execute();\n $deleteRow = $stmt->rowCount();\n $stmt->closeCursor();\n } catch (PDOException $ex) {\n echo 'sorry your post did not work';\n return FALSE;\n \n }\n return $deleteRow;\n}",
"function RSS_adminapi_delete($args)\n{\n // Get arguments from argument array - all arguments to this function\n // should be obtained from the $args array, getting them from other\n // places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n extract($args);\n\n // Argument check - make sure that all required arguments are present,\n // if not then set an appropriate error message and return\n if (!isset($fid)) {\n pnSessionSetVar('errormsg', _MODARGSERROR);\n return false;\n }\n\n // The user API function is called. This takes the item ID which\n // we obtained from the input and gets us the information on the\n // appropriate item. If the item does not exist we post an appropriate\n // message and return\n $item = pnModAPIFunc('RSS',\n 'user',\n 'get',\n array('fid' => $fid));\n\n if ($item == false) {\n pnSessionSetVar('errormsg', _RSSNOSUCHITEM);\n return false;\n }\n\n // Security check - important to do this as early on as possible to\n // avoid potential security holes or just too much wasted processing.\n // However, in this case we had to wait until we could obtain the item\n // name to complete the instance information so this is the first\n // chance we get to do the check\n if (!pnSecAuthAction(0, 'RSS::Item', \"$item[name]::$fid\", ACCESS_DELETE)) {\n pnSessionSetVar('errormsg', _MODULENOAUTH);\n return false;\n }\n\n // Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()\n // return arrays but we handle them differently. For pnDBGetConn()\n // we currently just want the first item, which is the official\n // database handle. For pnDBGetTables() we want to keep the entire\n // tables array together for easy reference later on\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n // It's good practice to name the table and column definitions you\n // are getting - $table and $column don't cut it in more complex\n // modules\n $RSStable = $pntable['RSS'];\n $RSScolumn = &$pntable['RSS_column'];\n\n // Delete the item - the formatting here is not mandatory, but it does\n // make the SQL statement relatively easy to read. Also, separating\n // out the sql statement from the Execute() command allows for simpler\n // debug operation if it is ever needed\n $sql = \"DELETE FROM $RSStable\n WHERE $RSScolumn[fid] = '\" . (int)pnVarPrepForStore($fid) . \"'\";\n $dbconn->Execute($sql);\n\n // Check for an error with the database code, and if so set an\n // appropriate error message and return\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _DELETEFAILED);\n return false;\n }\n\n // Let any hooks know that we have deleted an item. As this is a\n // delete hook we're not passing any extra info\n pnModCallHooks('item', 'delete', $fid, array('module' => 'RSS'));\n\n // Let the calling process know that we have finished successfully\n return true;\n}",
"function deleteItems($store, $folderentryid, $entryidlist, $action){\n\t\t\t$binEntryIdList = Array();\n\n\t\t\tforeach($entryidlist as $key => $value){\n\t\t\t\t$binEntryIdList[] = hex2bin($entryidlist[$key][\"entryid\"]);\n\t\t\t}\n\t\t\t\n\t\t\t$sfolder = mapi_msgstore_openentry($store, $folderentryid);\n\t\t\tmapi_folder_deletemessages($sfolder, $binEntryIdList, DELETE_HARD_DELETE);\n\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\n\t\t\treturn $result;\n\t\t}"
] |
[
"0.84155524",
"0.7338804",
"0.6876436",
"0.6491917",
"0.641981",
"0.64077777",
"0.6190522",
"0.6165266",
"0.6112514",
"0.61025745",
"0.6099316",
"0.6058969",
"0.6037662",
"0.6029017",
"0.5963832",
"0.5894731",
"0.5830069",
"0.5815766",
"0.5815388",
"0.5801279",
"0.5765843",
"0.57067364",
"0.569174",
"0.56091064",
"0.55990905",
"0.559341",
"0.5586527",
"0.55802053",
"0.55708706",
"0.5560051"
] |
0.8134551
|
1
|
/ db_update_feed_info Update the record for a feed in the 'feeds' table. $feed_id is the ID of the feed to update, and $fields is an assoc containing the fields we care about. The keys are column names. Returns the number of columns updated, or FALSE in case of error.
|
function db_update_feed_info($feed_id, $fields)
{
$dbh = db_connect();
/* Get info about existing feed */
$old = db_get_feed($feed_id);
if ($old === NULL)
// No such feed
return FALSE;
// XXX - some fields are assumed to be HTML and should be
// cleaned up before storing:
// - title (127)
// - subtitle (127)
// - nickname (127)
// - description (127)
if (array_key_exists("title", $fields))
run_hooks("clean-html", array(&$fields['title'], 127));
if (array_key_exists("subtitle", $fields))
run_hooks("clean-html", array(&$fields['subtitle'], 127));
if (array_key_exists("nickname", $fields))
run_hooks("clean-html", array(&$fields['nickname'], 127));
if (array_key_exists("description", $fields))
run_hooks("clean-html", array(&$fields['description'], 127));
/* Go through the fields, and compare them to what's already
* in the database.
*/
// Can't use $stmt->bind_param(), because that takes a
// variable number of arguments, and I don't think PHP has the
// equivalent of Lisp's (apply).
// XXX - Actually, see call_user_func_array()
// Also, some of the fields require special processing anyway:
// it's not a simple mapping from $feed[X] -> database column
// X.
// XXX - Should any of these check to see if the new value is
// empty, and if so, set the column to NULL?
$updates = array(); // Array of changes we're
// going to make, as an array
// of SQL fragments.
/* Plain string fields */
foreach (array('title', 'subtitle', 'nickname', 'url', 'feed_url',
'description', 'username', 'passwd')
as $f)
{
if (array_key_exists($f, $fields) &&
$fields[$f] != $old[$f])
{
if ($fields[$f] === NULL)
$value = "NULL";
else
$value = "'" .
$dbh->real_escape_string($fields[$f]) .
"'";
$updates[] = "$f = $value";
}
}
/* Boolean fields */
if (array_key_exists('active', $fields) &&
((bool) $fields['active'] != (bool) $old['active']))
// Is this feed active?
$updates[] = "active = " .
($fields['active'] ? "TRUE" : "FALSE");
/* Other fields that require special processing */
if (array_key_exists('image', $fields) &&
is_array($fields['image']) &&
array_key_exists('url', $fields['image']) &&
$fields['image']['url'] != $old['image'])
// Image associated with the site
$updates[] = "image = '" .
$dbh->real_escape_string($fields['image']['url']) .
"'";
// XXX - This function is called
// a) when the user changes feed information (like title or URL)
// b) when we update a feed.
// We don't want to change last_update in either of those cases; we
// only want to change last_update when an item with a pub_date newer
// than feeds.last_update comes in.
// So this is commented out until I'm sure this doesn't break
// anything.
// if (array_key_exists('last_update', $fields) &&
// $fields['last_update'] > $old['unix_last_update'])
// // Last update (time_t)
// $updates[] = sprintf("last_update = FROM_UNIXTIME(%ld)", $fields['last_update']);
/* Update the database, if necessary */
if (count($updates) > 0)
{
$query = sprintf("UPDATE `feeds` SET\n%s\nWHERE id=%d",
implode(",\n", $updates),
$feed_id);
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = "Error setting feed information: " .
$dbh->error;
return FALSE;
}
}
return count($updates);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function db_update_feed($feed_id, $feed)\n{\n\t$dbh = db_connect();\n\n\t$feed_opts = db_get_feed_options($feed_id);\n\n\t/* Update information about the feed itself */\n\tdb_update_feed_info($feed_id, $feed);\n\n\t/* Add/replace the items in the database. */\n\tif (!isset($feed['items']) ||\n\t !is_array($feed['items']) ||\n\t count($feed['items']) == 0)\n\t{\n\t\t// XXX - Should delete old items here. But I don't\n\t\t// want to duplicate code.\n\t\t/* Nothing to do. Return count of old/new/updated\n\t\t * items (all zero)\n\t\t */\n\t\treturn array(\"old\" => 0,\n\t\t\t \"new\" => 0,\n\t\t\t \"updated\" => 0);\n\t}\n\n\t$update_counts = array(\n\t\t\"old\"\t\t=> 0,\n\t\t\"new\"\t\t=> 0,\n\t\t\"updated\"\t=> 0,\n\t\t);\n\t\t// Assoc saying how many items were updated, how many\n\t\t// are new, how many were already in the database.\n\n\tforeach ($feed['items'] as $item)\n\t{\n\t\t/* This query may look long and redundant, but\n\t\t * basically it means:\n\t\t *\n\t\t * If this entry doesn't exist yet, create one. If the\n\t\t * entry already exists, update it from the RSS\n\t\t * information.\n\t\t *\n\t\t * The date fields (look for the IFNULL() calls) work\n\t\t * as follows:\n\t\t *\n\t\t * When adding a new item:\n\t\t * If a publication time was given, use that;\n\t\t * otherwise, use the current time.\n\t\t * If an update time was given, use that; otherwise,\n\t\t * use the publication time.\n\t\t *\n\t\t * When updating an existing item: update pub_date and\n\t\t * last_update to what it says in the feed. If it\n\t\t * wasn't specified, leave the existing field\n\t\t * unchanged.\n\t\t * This is useful because a lot of RSS feeds don't\n\t\t * include timestamps. But we don't want articles\n\t\t * bubbling up to the last time the feed was fetched.\n\t\t *\n\t\t * NB: This code does something that may not be\n\t\t * kosher: the line that sets the last_update field\n\t\t * uses the previously-set value for 'pub_date'. I\n\t\t * don't know whether this is portable or robust; it\n\t\t * just seems to work.\n\t\t */\n\t\t/* XXX - Should\n\t\t * INSERT ... (col1, col2, ...) = (value1, value2...)\n\t\t * be changed to\n\t\t * INSERT ... set col1=value1, col2=value2, ...\n\t\t * for readability?\n\t\t */\n\t\t/* XXX - Unfortunately, this sends the summary and\n\t\t * content to the database twice, which might be\n\t\t * undesirable for feeds that typically have long\n\t\t * posts. Is there a way around this?\n\t\t */\n\t\t/* XXX - The following might happen:\n\t\t * - article is published; pub_date = last_update = t0\n\t\t * - user marks it read at t1\n\t\t * - article is updated; pub_date = t0, last_update = t2\n\t\t * There's now new information that the user might\n\t\t * want to see; ought to mark the article as unread.\n\t\t * Then again, the user might not: the update might be\n\t\t * a trivial modification to fix a typo; or it might\n\t\t * be a liveblog of an ongoing, uninteresting event.\n\t\t *\n\t\t * Perhaps a better compromise might be to use only\n\t\t * the most recent of pub_date and last_update as the\n\t\t * sole publication time. \n\t\t */\n\t\t/* Note that \"ON DUPLICATE KEY\" is a MySQL-ism */\n\t\t/* XXX - What with mtime, it's not obvious that \"ON\n\t\t * DUPLICATE KEY\" really does everything we want. It\n\t\t * might be better to do a SELECT by (feed_id, guid),\n\t\t * and then either\n\t\t * a) INSERT (if SELECT doesn't find anything), or\n\t\t * b) figure out what needs to change and UPDATE (if\n\t\t * SELECT finds an existing item).\n\t\t *\n\t\t * This would remove the non-standard \"ON DUPLICATE\n\t\t * KEY\", probably make the code more readable, and\n\t\t * also allow 'mtime' to work properly.\n\t\t */\n\n\t\t$query = <<<EOT\nINSERT INTO\t`items`\n\t\t(feed_id, url, title, summary, content, author, category,\n\t\t comment_url, comment_rss, guid,\n\t\t pub_date,\n\t\t last_update,\n\t\t is_read)\nVALUES\t\t(?, ?, ?, ?, ?, ?, ?,\n\t\t ?, ?, ?,\n\t\t IFNULL(FROM_UNIXTIME(?), NOW()),\n\t\t pub_date,\n\t\t IFNULL(?, FALSE))\nON DUPLICATE KEY UPDATE\n\t\turl=?,\n\t\ttitle=?,\n\t\tsummary=?,\n\t\tcontent=?,\n\t\tauthor=?,\n\t\tcategory=?,\n\t\tcomment_url=?,\n\t\tcomment_rss=?,\n\t\tpub_date=IFNULL(FROM_UNIXTIME(?), pub_date)\nEOT;\n\t\t// XXX - Ought to update mtime iff any of the fields\n\t\t// have changed. Currently, we're setting mtime to\n\t\t// NOW() in any case. This means that the item gets\n\t\t// updated every time we fetch the RSS feed, until the\n\t\t// item drops out of the feed.\n\n\t\t$stmt = $dbh->prepare($query);\n\t\t$dummy_categories = NULL;\t// XXX - Hack until I\n\t\t\t\t\t\t// figure out how to\n\t\t\t\t\t\t// deal with\n\t\t\t\t\t\t// categories\n\n\t\t/* Construct author to store in database */\n\t\tif (isset($item['author_name']))\n\t\t{\n\t\t\t$author = $item['author_name'];\n\n\t\t\tif (isset($item['author_email']))\n\t\t\t{\n\t\t\t\t$author .= \" <$item[author_email]>\";\n\t\t\t}\n\t\t} elseif (isset($item['author_email']))\n\t\t\t$author = \"<$item[author_email]>\";\n\n//echo \"<pre>\\$author [$author]</pre>\\n\";\n\n\t\tswitch ($feed_opts['id-from'])\n\t\t{\n\t\t case \"url\":\n\t\t\t$guid = md5($item['url']);\n\t\t\tbreak;\n\n\t\t case \"title\":\n\t\t\t$guid = md5($item['title']);\n\t\t\tbreak;\n\n\t\t case \"guid\":\n\t\t default:\n\t\t\tif (isset($item['guid']))\n\t\t\t{\n\t\t\t\t$guid = $item['guid'];\n\t\t\t\tif (strlen($guid) > 127)\n\t\t\t\t{\n\t\t\t\t\t# error_log(\"Hashing overly-long guid $guid\");\n\t\t\t\t\t$guid = md5($guid);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// This item doesn't have a GUID, so make one.\n\t\t\t\t// URLs can get arbitrarily long, and all we\n\t\t\t\t// want is something unique, so just use a\n\t\t\t\t// hash of the long URL.\n\t\t\t\t$guid = md5($item['url']);\n\t\t\t}\n\t\t}\n\n\t\t/* Something is quite picky about the value of\n\t\t * is_read. Let's be very careful about setting it.\n\t\t */\n\t\tif (!isset($item['is_read']))\n\t\t\t$item['is_read'] = false;\n\t\t$is_read = 0;\n\t\tswitch ($item['is_read'])\n\t\t{\n\t\t\tcase false:\n\t\t\t\t$is_read = 0;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$is_read = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\nerror_log(\"Unknown value for is_read: [\" . print_r($item['is_read'], true) . \"]\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$stmt->bind_param(\"dsssssssssd\" .\n\t\t\t\t \"ssssssssdi\",\n\t\t\t\t // Values for new items\n\t\t\t\t $feed_id,\n\t\t\t\t $item['url'],\n\t\t\t\t $item['title'],\n\t\t\t\t $item['description'],\n\t\t\t\t $item['content'],\n\t\t\t\t $author,\n\t\t\t\t $dummy_categories,\t// XXX - Deal with categories\n\t\t\t\t $item['comment_url'],\n\t\t\t\t $item['comment_feed'],\n\t\t\t\t $guid,\n\t\t\t\t $item['pub_time'],\n\t\t\t\t $is_read,\n\n\t\t\t\t // Values for updated items\n\t\t\t\t $item['url'],\n\t\t\t\t $item['title'],\n\t\t\t\t $item['description'],\n\t\t\t\t $item['content'],\n\t\t\t\t $author,\n\t\t\t\t $dummy_categories,\t// XXX - Deal with categories\n\t\t\t\t $item['comment_url'],\n\t\t\t\t $item['comment_feed'],\n\t\t\t\t $item['pub_time']\n\t\t\t);\n\t\t$err = $stmt->execute();\n\t\t// XXX - Can count number of affected rows. Apparently\n\t\t//\t0-> duplicate entry (no change)\n\t\t//\t1-> new entry\n\t\t//\t2-> updated entry\n\n\t\t$nrows = $stmt->affected_rows;\n\t\tswitch ($nrows)\n\t\t{\n\t\t case 0:\n\t\t\t$update_counts['old']++;\n\t\t\tbreak;\n\t\t case 1:\n\t\t\t$update_counts['new']++;\n\t\t\tbreak;\n\t\t case 2:\n\t\t\t$update_counts['updated']++;\n\t\t\tbreak;\n\t\t default:\n\t\t\t// This should never happen\n\t\t\t// XXX - Check for this?\n\t\t\tbreak;\n\t\t}\n\n\t\t// XXX - Better error-checking\n\t\tif ($err)\n\t\t\t;// echo \"OK (\", print_r($err), \") errno \", $dbh->errno, \", error [\", $dbh->error, \"]<br/>\\n\";\n\t\telse {\n\t\t\terror_log(\"MySQL error in feed $feed_id: \" .\n\t\t\t\t $dbh->errno . ': \"' .\n\t\t\t\t $dbh->error . '\"');\n\t\t\t// What follows is very ad hoc.\n\t\t\tswitch ($dbh->errno)\n\t\t\t{\n\t\t\t case 1366:\n\t\t\t\tprint_r($item);\n\t\t\t\tbreak;\n\t\t\t case 1406:\n\t\t\t\terror_log(\"guid: \" . $guid);\n\t\t\t\tbreak;\n\t\t\t default:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n//echo \"Affected rows: [\", $stmt->affected_rows, \"]<br/>\\n\";\n\t}\n\n\t// Update feeds.last_update, so we can measure staleness\n\t/* XXX - Edge case: what if the feed is broken (or weird), so\n\t * that currently feeds.last_update == Aug 1 (from the last\n\t * update), but the most recent items.pub_date is Mar 1? Then\n\t * we'd see feeds.last_update go back 4 months, even though\n\t * the most recent post was Aug 1.\n\t *\n\t * Perhaps use\n\t * SET last_update = MAX(last_update, (SELECT ...))\n\t * But then if the feed is empty, then the IFNULL will default\n\t * to NOW(), which is also bad. If the feed is empty, then\n\t * feeds.last_update should remain unchanged. So perhaps\n\t * should default to the epoch.\n\t */\n\t$query = <<<EOT\nUPDATE\t`feeds`\n\tSET\tlast_update = \n\t\t(SELECT\tIFNULL(MAX(items.pub_date), NOW())\n\t\t FROM\titems\n\t\t WHERE\titems.feed_id = feeds.id)\n\tWHERE\tid = ?\nEOT;\n\t$stmt = $dbh->prepare($query);\n\t\t\t// XXX - Error-checking\n\t$err = $stmt->bind_param(\"i\",\n\t\t\t\t $feed_id);\n\t\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t\t// XXX - Error-checking\n\n\t/* Delete old items from database.\n\t * Here, we look up the \"autodelete\" option for the feed in\n\t * question, and delete the items older than that many days.\n\t */\n\t// XXX - This is potentially a problem with\n\t// a) An article that has gone unread n+1 days, and was just\n\t// updated. In this case, you had n days to read it. Cope.\n\t// b) Feeds that don't give dates, such as Perry Bible\n\t// Fellowship. In this case, the feed parser should insert an\n\t// artificial date.\n\t$query = <<<EOT\nDELETE FROM\t`items`\nWHERE\t\tfeed_id = ?\n AND\t\tpub_date < NOW() -\n\t\t INTERVAL get_option(feed_id, \"autodelete\") DAY\nEOT;\n\t$stmt = $dbh->prepare($query);\n\tif ($stmt === FALSE)\n\t{\n\t\t// XXX - Better error-checking\n\t\terror_log(\"prepare error \" . $dbh->errno .\n\t\t\t\": \\\"\" . $dbh->error .\n\t\t\t\"\\\"<br/>\\n\");\n\t}\n\t$err = $stmt->bind_param(\"i\",\n\t\t\t\t $feed_id);\n\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t// XXX - Error-checking\n\n\t/* Return count of new/updated items */\n\treturn $update_counts;\n}",
"public function updateData($fields = array()) { \n\t\t$updates = '';\n\t\tforeach ($fields as $key => $value) {\n\t\t\tif (!empty($updates)) $updates .= ',';\n\t\t\t$updates .= $key.'=';\n\t\t\tif (is_int($value)) $updates .= $value;\n\t\t\telse $updates .= \"'\".escapeString($value).\"'\";\n\t\t}\n\t\t\n\t\tif (!empty($updates)) {\n\t\t\t$sql = \"UPDATE\twcf\".WCF_N.\"_linklist_link\n\t\t\t\tSET\t\".$updates.\"\n\t\t\t\tWHERE\tlinkID = \".$this->linkID;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t}",
"public function updateData($fields = array()) { \n\t\t$updates = '';\n\t\tforeach ($fields as $key => $value) {\n\t\t\tif (!empty($updates)) $updates .= ',';\n\t\t\t$updates .= $key.'=';\n\t\t\tif (is_int($value)) $updates .= $value;\n\t\t\telse $updates .= \"'\".escapeString($value).\"'\";\n\t\t}\n\t\t\n\t\tif (!empty($updates)) {\n\t\t\t$sql = \"UPDATE\twcf\".WCF_N.\"_linklist_category\n\t\t\t\tSET\t\".$updates.\"\n\t\t\t\tWHERE\tcategoryID = \".$this->categoryID;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t}",
"private function update_feed($feed)\n\t{\n\t\t$feed = intval($feed);\n\n\t\tif ( ! $feed)\n\t\t\tthrow new Exception('Invalid feed id');\n\n\t\t$feed = ORM::factory('Feed', $feed);\n\n\t\tMinion_CLI::write($feed->name . ' updating...');\n\n\t\t$feeds = new Feeds();\n\t\t$feeds->register_callback(function ($msg) { Minion_CLI::write($msg); });\n\t\t$feeds->update_single($feed);\n\t}",
"public function updateFeed($feed) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('feed', 'updatePoll');\n\t\t$stm->execute(array(\n\t\t\t':id' => $feed->id,\n\t\t\t':lastUpdated' => $feed->lastUpdated,\n\t\t\t':lastPolled' => $feed->lastPolled\n\t\t));\n\n\t\tif ($this->_isPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t\treturn true;\n\t}",
"public function update( $id, $fields ) {\n if ( $id <= 0 ) {\n return false;\n }\n\n $query = sprintf( \"UPDATE %s SET \", $this->_table );\n foreach( $fields as $field => $value ) {\n $query .= \" {$field} = '{$value}', \";\n }\n $query = substr($query,0,strlen($query)-2);\n $query .= \" WHERE id = \" . $id;\n\n $db = DB::getInstance();\n $count = $db->exec( $query );\n return $count > 0;\n }",
"public function update($table, array $fields);",
"function update($id,$fields_val){\n $count=0;$set='';\n foreach($fields_val as $f => $v){\n $count++;\n $set .= \"$f = '$v'\";\n $set .=($count != count($fields_val))?',':'';\n \n }\n $sql = \"UPDATE {$this -> table} SET {$set} WHERE {$this -> pk} = '{$id}'\";\n $updt = $this -> query($sql);\n return $updt;//returns true on success and false if otherwise\n }",
"public function execUpdate($table, $id, $fields)\r\n {\r\n $x = $this->db->update($table, $id, $fields);\r\n if ($x) {\r\n return true;\r\n }\r\n return false;\r\n }",
"function db_update_group_info($gid, $fields)\n{\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_group($gid);\n\tif ($old === NULL)\n\t\t// No such feed\n\t\treturn FALSE;\n\n\t$new = $old;\n\t$updates = array();\n\t$bind_fmt = \"\";\n\t$bind_values = array();\n\n\tforeach (array('parent', 'name') as $f)\n\t{\n\t\tif (array_key_exists($f, $fields))\n\t\t{\n\t\t\t$new[$f] = $fields[$f];\n\t\t}\n\t}\n\n\t$query = \"UPDATE `groups` SET parent=?, name=? WHERE id=?\";\n\t$stmt = $dbh->prepare($query);\n\t$result = $stmt->bind_param(\"isi\",\n\t\t$new['parent'],\n\t\t$new['name'],\n\t\t$gid);\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$result = $stmt->execute();\n\t$stmt->close();\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}",
"public function updateInfo($id)\r\n\t{\r\n\t\tif(!is_int($id) && $id <= 0) { return false; }\t\r\n\r\n\t\t$query = sprintf('UPDATE informations SET type = \"%s\", title = \"%s\", `text` = \"%s\", mode = \"%s\" \r\n\t\t\tWHERE informationid = \"%s\"', $data['type'], $data['title'], $data['text'], $data['mode'], $id);\r\n\t\t$this->db->query($query);\r\n\r\n\t\t// Get latest id\r\n\t\t$id = $this->db->insert_id();\r\n\r\n\t\tif(is_int($id) && $id > 0) {\r\n\t\t\treturn $id;\r\n\t\t} \r\n\r\n\t\treturn false;\r\n\t}",
"public function update($table, $fieldToCheck, $fields = array())\n {\n $this->setTableFields($table);\n $set = '';\n $x = 1;\n if (count($fields)) {\n $keys = array_keys($fields);\n foreach ($keys as $key) {\n if ($this->checkColumnExists($key)) {\n continue;\n } else {\n unset($fields[$key]);\n }\n }\n }\n foreach($fields as $name => $value) {\n $set .= \"{$name} = ?\";\n if($x < count($fields)) {\n $set .= ', ';\n }\n $x++;\n }\n\n $sql = \"UPDATE {$table} SET {$set} WHERE id = {$fieldToCheck}\";\n\n if (!$this->query($sql, $fields)->error()) {\n return true;\n }\n\n return false;\n }",
"public function update(array $fields)\n\t{\n\t\t// make sure a group id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\t// init the update array\n\t\t$update = array();\n\n\t\t// update name\n\t\tif (array_key_exists('name', $fields) and $fields['name'] != $this->group['name'])\n\t\t{\n\t\t\t// make sure name does not already exist\n\t\t\tif (static::group_exists($fields['name']))\n\t\t\t{\n\t\t\t\tthrow new SentryGroupException(__('sentry::sentry.group_already_exists', array('group' => $fields['name'])));\n\t\t\t}\n\t\t\t$update['name'] = $fields['name'];\n\t\t\tunset($fields['name']);\n\t\t}\n\n\t\tif (array_key_exists('permissions', $fields))\n\t\t{\n\t\t\t$permissions = $this->process_permissions($fields['permissions']);\n\t\t\t$update['permissions'] = json_encode($permissions);\n\t\t\tunset($fields['permissions']);\n\t\t}\n\n\t\tif (empty($update))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$update_group = DB::connection(static::$db_instance)\n\t\t\t->table(static::$table)\n\t\t\t->where('id', '=', $this->group['id'])\n\t\t\t->update($update);\n\n\t\treturn ($update_group) ? true : false;\n\n\t}",
"public function update($table, $fields = null)\n {\n if (!empty($table) and !empty($fields) and is_array($fields)) {\n $where = '';\n $params = false;\n $type = '';\n $value = array();\n\n foreach ($fields as $k => $v) {\n if (empty($set)) {\n $set = $k .\"= ?\";\n } else {\n $set .= \", \".$k .\"= ?\";\n }\n $value[] = $v;\n $type .= substr(gettype($v), 0, 1);\n }\n\n if (self::$where != null) {\n $where = self::$where['clause'];\n $params = self::$where['params'];\n $type .= self::$where['type'];\n }\n\n $sql = \"UPDATE $table SET \".$set.$where;\n\n if (!$stmt = $this->conn->prepare($sql)) {\n return $this->return(false, null, $this->conn->error);\n }\n\n $stmt->bind_param($type, ...$value, ...$params);\n\n if (!$stmt->execute()) {\n return $this->return(false, null, $stmt->error);\n }\n\n if ($stmt->affected_rows < 1) {\n return $this->return(false, null, 'No records have been changed.');\n } else {\n return $this->return(true, 1);\n }\n } else {\n return $this->return(false, null, 'No correct insert data given.');\n }\n }",
"private function update($table, $id, array $data) {\r\n\t\t/* connect to mysql database */\r\n\t\t$this->connect();\r\n\r\n\t\t/* make sure that id is an integer */\r\n\t\tif(!settype($id, \"int\")) {\r\n\t\t\tthrow new Exception(\"Entry id is no integer.\");\r\n\t\t}\r\n\r\n\t\t/* escape special chars in parameters */\r\n\t\t$escapedTable = mysql_real_escape_string($table);\r\n\t\t$escapedData = $this->mysqlRealEscapeArray($data);\r\n\r\n\t\t/* reformat the input array */\r\n\t\t$tmpArray = array();\r\n\t\tforeach($escapedData as $col => $value) {\r\n\t\t\t$tmpArray[] = $col.\"=\".$value;\r\n\t\t}\r\n\t\t/* mysql query to update entry */\r\n\t\t$query = \"UPDATE \".$escapedTable.\" SET \".implode(\", \", $tmpArray).\" WHERE id = '\".$id.\"'\";\r\n\r\n\t\t/* send mysql query to database */\r\n\t\t$result = mysql_query($query);\r\n\t\r\n\t\t/* disconnect from mysql database */\r\n\t\t$this->disconnect();\r\n\t}",
"public function updateById($id, $fields) {\n $model = $this->model->find($id);\n\n if($model) {\n return $model->update($fields);\n }\n }",
"protected function update($table, array $fields, $rowID = null)\n {\n if (!$rowID && $this->exists()) {\n $rowID = $this->data()->id();\n }\n return $this->Db->update($table, $fields);\n }",
"public function update($table, $fields, $id)\n {\n try {\n $st = \"\";\n $counter = 1;\n $total_fields = count($fields);\n foreach ($fields as $key => $value) {\n if ($counter === $total_fields) {\n $set = \"$key=:\" . $key;\n $st = $st . $set;\n } else {\n $set = \"$key=:\" . $key . \",\";\n $st = $st . $set;\n $counter++;\n }\n }\n $sql = \"UPDATE $table SET $st WHERE id=$id\";\n\n $stmt = $this->connect(\"student\")->prepare($sql);\n\n foreach ($fields as $key => $value) {\n $stmt->bindValue(\":\" . $key, $value);\n }\n\n $exec = $stmt->execute();\n if ($exec == true) {\n header(\"location:record.php\");\n }\n } catch (PDOException $e) {\n echo \"Error!!\" . $e->getMessage();\n }\n }",
"public function updateData($fields, $values, $table=\"View_PC_Summary\"){\n\t\t\t//prevede 2 array in ingresso :) \n\t\t\t\n\t\t\t$updateQuery = new Query(); //apro l'oggetto query\n\t\t\t$updateQuery->tables=array($table);\n\t\t\t\n\t\t\t$result = false;\n\t\t\t/*\n\t\t\t* recuperare nomi e tipo dei campi da database\n\t\t\t*/\n\t\t\tif (!$fields || !$values){ // se non sono settati errore\n\t\t\t\treturn false;\n\t\t\t}elseif (is_array($fields) && is_array($values)){\n\t\t\t\t$dataCounter=0;\n\t\t\t\tforeach ($fields as $field){\n\t\t\t\t\t$updateQuery->fields[]=$field;\n\t\t\t\t\t$updateQuery->values[]=$values[$dataCounter];\n\t\t\t\t\t$dataCounter++;\n\t\t\t\t}\n\t\t\t\t$updateQuery->filters=\"id=\".$this->ipg_id;\n\t\t\t\t//$result=$updateQuery->getSQL();\n\t\t\t\tif($updateQuery->DoUpdate()){\n\t\t\t\t\t//$result = true;\n\t\t\t\t}else{\n\t\t\t\t\t//var_dump($updateQuery->values);\n\t\t\t\t\t$result=mysql_error();\n\t\t\t\t\techo $result;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//$result=mysql_error();\n\t\t\t$updateQuery->Close();\n\t\t\treturn $result;\n\t\t}",
"public function update(array $fields) {\n $changeable = array('name' => 1, 'enabled' => 1, 'description' => 1, 'server' => 1, 'options' => 1, 'read_only' => 1);\n $changed = FALSE;\n foreach ($fields as $field => $value) {\n if (isset($changeable[$field]) && $value !== $this->$field) {\n $this->$field = $value;\n $changed = TRUE;\n }\n }\n\n // If there are no new values, just return 0.\n if (!$changed) {\n return 0;\n }\n\n // Reset the index's internal property cache to correctly incorporate new\n // settings.\n $this->resetCaches();\n\n return $this->save();\n }",
"public function update($table, array $fields_arr, $where) {\n }",
"function performSQLUpdate($tableName, $idFieldName, $fields) {\n $conn = $GLOBALS[\"connection\"];\n $sql = \"UPDATE \" . $tableName . \" SET \";\n\n if ($fields <> NULL) {\n foreach ($fields as $key => $value) {\n if (!is_numeric($key) AND $key <> $idFieldName) {\n if ($value <> NULL) {\n $updateClause[] = $key . \"='\" . $value . \"'\";\n } else {\n $updateClause[] = $key . \"=NULL\";\n }\n }\n }\n\n $sql = $sql . implode(\",\", $updateClause);\n }\n $sql = $sql . \" WHERE \" . $idFieldName . \"='\" . $fields[$idFieldName] . \"';\";\n $result = mysqli_query($conn, $sql);\n if (!$result) {\n echo mysqli_error($conn);\n printCallstackAndDie();\n }\n\n return TRUE;\n}",
"public static function update($fields,$id) {\n $data = _escapeArray($fields);\n \n $map = array();\n $map['sponser_name'] = 'name';\n $map['sponser_desc'] = 'description';\n $map['sponser_address'] = 'address';\n $map['sponser_phone'] = 'phone';\n $map['sponser_email'] = 'email';\n $map['school_id'] = 'school_id';\n $map['sponser_link'] = 'link';\n $map['sponser_logo'] = 'logo';\n \n $ds = _bindArray($data,$map);\n $condition = \" id = \".$id;\n return qu('sponsors',$ds,$condition);\n }",
"public function UpdateInfo($table,$fields = array(),$values = array(),$ID_Name,$ID_Value){\r\n \r\n $fields = implode(\" = ?, \",$fields);\r\n $fields .= \" = ?\";\r\n \r\n $stmp = $this->connection->prepare(\"UPDATE $table SET $fields WHERE $ID_Name = ?\");\r\n\r\n array_push($values,$ID_Value);\r\n\r\n $stmp->execute($values);\r\n\r\n return $stmp->rowCount();\r\n\r\n }",
"public function update( $table, $id, $update_data ) {\n\t\t$this->last_error = null;\n\t\t// cleanse the post data.\n\n\t\t$this->fetch($table, $id);\n\t\t$previous_record = $this->get_last_result();\n\n\t\t$new_record = $previous_record;\n\n\t\tforeach ( $update_data as $property => $value ) {\n\n\t\t\tif ( isset( $new_record[$property] ) ){\n\t\t\t\t$new_record[$property] = $value;\n\t\t\t}\n\t\t}\n\n\t\t$this->fetchAll($table);\n\t\t$all = $this->get_last_result();\n\n\t\t$found = false;\n\n\t\tforeach ($all as $key => $row) {\n\t\t\tif ( isset($row['id']) AND intval($row['id']) === $id ) {\n\t\t\t\t$all[$key] = $new_record;\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $found ) {\n\t\t\t$this->commit( $table, $all );\n\t\t} else {\n\t\t\t$this->last_error = 'ID_NOT_FOUND';\n\t\t}\n\t}",
"public function update_entry($entry_id, $data)\n\t{\n\t\t$this->load->model('cartthrob_field_model');\n\t\t\n\t\tif (isset($data['channel_id']))\n\t\t{\n\t\t\t$channel_id = $data['channel_id'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->select('channel_id')\n\t\t\t\t\t ->where('entry_id', $entry_id)\n\t\t\t\t\t ->get('channel_titles');\n\t\t\t\n\t\t\t$channel_id = $query->row('channel_id');\n\t\t\t\n\t\t\t$query->free_result();\n\t\t}\n\t\t\n\t\t$fields = ($channel_id) ? $this->cartthrob_field_model->get_fields_by_channel($channel_id) : array();\n\t\t\n\t\t$title_fields = $this->db->list_fields('channel_titles');\n\t\t\n\t\t$channel_titles = array();\n\t\t\n\t\tforeach ($title_fields as $key)\n\t\t{\n\t\t\tif (isset($data[$key]))\n\t\t\t{\n\t\t\t\t$channel_titles[$key] = $data[$key];\n\t\t\t}\n\t\t}\n\t\t\n \t\t$channel_titles['edit_date'] = date(\"YmdHis\");\n\t\t\n\t\t$this->db->update('channel_titles', $channel_titles, array('entry_id' => $entry_id));\n\t\t\n\t\t\n\t\t$channel_data = array();\n\t\t\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\tif (isset($data['field_id_'.$field['field_id']]))\n\t\t\t{\n\t\t\t\t// accounting for data that's set as an array\n\t\t\t\t$field_data = $data['field_id_'.$field['field_id']];\n\t\t\t\tif (is_array($field_data))\n\t\t\t\t{\n\t\t\t\t\t$field_data = implode('|', $field_data);\n\t\t\t\t}\n\t\t\t\t$data['field_id_'.$field['field_id']] = $field_data;\n\t\t\t\t\n\t\t\t\t$channel_data['field_id_'.$field['field_id']] = $data['field_id_'.$field['field_id']];\n\t\t\t}\n\t\t\telse if (isset($data[$field['field_name']]))\n\t\t\t{\n\t\t\t\t$field_data = (isset($data[$field['field_name']])) ? $data[$field['field_name']] : '';\n\t\t\t\tif (is_array($field_data))\n\t\t\t\t{\n\t\t\t\t\t$field_data = implode('|', $field_data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$channel_data['field_id_'.$field['field_id']] = $field_data; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($channel_data)\n\t\t{\n\t\t\t$this->db->update('channel_data', $channel_data, array('entry_id' => $entry_id));\n\t\t}\n\t\t\n\t\treturn $entry_id;\n\t}",
"static function update_info ($id, $info) {\n $query = \"UPDATE edit SET \";\n $query .= \"info=\\\"{$info}\\\" \";\n $query .= \"WHERE id={$id};\";\n\n if (!$GLOBALS['C']->query($query)) {\n print_query_error();\n return false;\n } else {\n return true;\n }\n }",
"public function update(array $fields)\n {\n $type = Table\\ContentTypes::findById($fields['id']);\n if (isset($type->id)) {\n $contentType = (!empty($fields['content_type_other']) && ($fields['content_type'] == 'other')) ?\n $fields['content_type_other'] : $fields['content_type'];\n\n $type->name = $fields['name'];\n $type->content_type = $contentType;\n $type->strict_publishing = (int)$fields['strict_publishing'];\n $type->open_authoring = (int)$fields['open_authoring'];\n $type->in_date = (int)$fields['in_date'];\n $type->force_ssl = (int)$fields['force_ssl'];\n $type->order = (int)$fields['order'];\n $type->save();\n\n $this->data = array_merge($this->data, $type->getColumns());\n }\n }",
"public function update($colMatch, $fields = array(), $id = null){\n\n\n\n\t\tif(!$id && $this->isLoggedin()){\n\n\t\t\t$id = $this->data()->staff_id;\n\n\t\t}\n\n\n\n\t\tif(!$this->_db->update('users',$colMatch, $fields, $id)){\n\n\t\t\tthrow new Exception('There Was an error Updating.');\n\n\t\t}\n\n\t}",
"public static function doUpdate($params=NULL) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$conn->update(self::TABLE_NAME);\n\t\tif (!is_a($params, 'wgConnector') && isset($params['where'])) {\n\t\t\tif (!isset($params['wherecol'])) $params['wherecol'] = self::PRIMARY_KEY;\n\t\t\t$conn->where($params['wherecol'], $params['where']);\n\t\t\tunset($params['where']);\n\t\t\tunset($params['wherecol']);\n\t\t}\n\t\tif (!empty($params) && is_array($params)) {\n\t\t\tforeach ($params as $key=>$par) {\n\t\t\t\tif (isset(self::$_tableFields[$key])) $conn->set($key, $par);\n\t\t\t\telse throw new WgException(\"Field \".self::TABLE_NAME.\".$key does not exist.\");\n\t\t\t}\n\t\t}\n\t\t$af = (int) DbModel::doAffected($conn, new CampaignDefinitionsModel());\n\t\tif (!(bool) $af) $af = 1;\n\t\treturn (int) $af;\n\t}"
] |
[
"0.6814994",
"0.62724406",
"0.6105806",
"0.60634357",
"0.60186136",
"0.5981311",
"0.5979848",
"0.59338534",
"0.5767079",
"0.5720056",
"0.55803025",
"0.55572236",
"0.550437",
"0.54933697",
"0.5475623",
"0.5431151",
"0.5410018",
"0.53657794",
"0.5352962",
"0.53136426",
"0.52935445",
"0.5287079",
"0.5275493",
"0.5248394",
"0.52416724",
"0.5187853",
"0.51825726",
"0.51808906",
"0.5180581",
"0.5170842"
] |
0.801186
|
0
|
/ db_update_feed Update a feed. $feed_id is the ID of the feed to update, and $feed is a structure containing all the known information and articles in the feed. Returns an assoc with keys "old", "new", and "updated", giving the number of old, new, and updated items, respectively. In case of error, returns FALSE.
|
function db_update_feed($feed_id, $feed)
{
$dbh = db_connect();
$feed_opts = db_get_feed_options($feed_id);
/* Update information about the feed itself */
db_update_feed_info($feed_id, $feed);
/* Add/replace the items in the database. */
if (!isset($feed['items']) ||
!is_array($feed['items']) ||
count($feed['items']) == 0)
{
// XXX - Should delete old items here. But I don't
// want to duplicate code.
/* Nothing to do. Return count of old/new/updated
* items (all zero)
*/
return array("old" => 0,
"new" => 0,
"updated" => 0);
}
$update_counts = array(
"old" => 0,
"new" => 0,
"updated" => 0,
);
// Assoc saying how many items were updated, how many
// are new, how many were already in the database.
foreach ($feed['items'] as $item)
{
/* This query may look long and redundant, but
* basically it means:
*
* If this entry doesn't exist yet, create one. If the
* entry already exists, update it from the RSS
* information.
*
* The date fields (look for the IFNULL() calls) work
* as follows:
*
* When adding a new item:
* If a publication time was given, use that;
* otherwise, use the current time.
* If an update time was given, use that; otherwise,
* use the publication time.
*
* When updating an existing item: update pub_date and
* last_update to what it says in the feed. If it
* wasn't specified, leave the existing field
* unchanged.
* This is useful because a lot of RSS feeds don't
* include timestamps. But we don't want articles
* bubbling up to the last time the feed was fetched.
*
* NB: This code does something that may not be
* kosher: the line that sets the last_update field
* uses the previously-set value for 'pub_date'. I
* don't know whether this is portable or robust; it
* just seems to work.
*/
/* XXX - Should
* INSERT ... (col1, col2, ...) = (value1, value2...)
* be changed to
* INSERT ... set col1=value1, col2=value2, ...
* for readability?
*/
/* XXX - Unfortunately, this sends the summary and
* content to the database twice, which might be
* undesirable for feeds that typically have long
* posts. Is there a way around this?
*/
/* XXX - The following might happen:
* - article is published; pub_date = last_update = t0
* - user marks it read at t1
* - article is updated; pub_date = t0, last_update = t2
* There's now new information that the user might
* want to see; ought to mark the article as unread.
* Then again, the user might not: the update might be
* a trivial modification to fix a typo; or it might
* be a liveblog of an ongoing, uninteresting event.
*
* Perhaps a better compromise might be to use only
* the most recent of pub_date and last_update as the
* sole publication time.
*/
/* Note that "ON DUPLICATE KEY" is a MySQL-ism */
/* XXX - What with mtime, it's not obvious that "ON
* DUPLICATE KEY" really does everything we want. It
* might be better to do a SELECT by (feed_id, guid),
* and then either
* a) INSERT (if SELECT doesn't find anything), or
* b) figure out what needs to change and UPDATE (if
* SELECT finds an existing item).
*
* This would remove the non-standard "ON DUPLICATE
* KEY", probably make the code more readable, and
* also allow 'mtime' to work properly.
*/
$query = <<<EOT
INSERT INTO `items`
(feed_id, url, title, summary, content, author, category,
comment_url, comment_rss, guid,
pub_date,
last_update,
is_read)
VALUES (?, ?, ?, ?, ?, ?, ?,
?, ?, ?,
IFNULL(FROM_UNIXTIME(?), NOW()),
pub_date,
IFNULL(?, FALSE))
ON DUPLICATE KEY UPDATE
url=?,
title=?,
summary=?,
content=?,
author=?,
category=?,
comment_url=?,
comment_rss=?,
pub_date=IFNULL(FROM_UNIXTIME(?), pub_date)
EOT;
// XXX - Ought to update mtime iff any of the fields
// have changed. Currently, we're setting mtime to
// NOW() in any case. This means that the item gets
// updated every time we fetch the RSS feed, until the
// item drops out of the feed.
$stmt = $dbh->prepare($query);
$dummy_categories = NULL; // XXX - Hack until I
// figure out how to
// deal with
// categories
/* Construct author to store in database */
if (isset($item['author_name']))
{
$author = $item['author_name'];
if (isset($item['author_email']))
{
$author .= " <$item[author_email]>";
}
} elseif (isset($item['author_email']))
$author = "<$item[author_email]>";
//echo "<pre>\$author [$author]</pre>\n";
switch ($feed_opts['id-from'])
{
case "url":
$guid = md5($item['url']);
break;
case "title":
$guid = md5($item['title']);
break;
case "guid":
default:
if (isset($item['guid']))
{
$guid = $item['guid'];
if (strlen($guid) > 127)
{
# error_log("Hashing overly-long guid $guid");
$guid = md5($guid);
}
} else {
// This item doesn't have a GUID, so make one.
// URLs can get arbitrarily long, and all we
// want is something unique, so just use a
// hash of the long URL.
$guid = md5($item['url']);
}
}
/* Something is quite picky about the value of
* is_read. Let's be very careful about setting it.
*/
if (!isset($item['is_read']))
$item['is_read'] = false;
$is_read = 0;
switch ($item['is_read'])
{
case false:
$is_read = 0;
break;
case 1:
$is_read = 1;
break;
default:
error_log("Unknown value for is_read: [" . print_r($item['is_read'], true) . "]");
break;
}
$stmt->bind_param("dsssssssssd" .
"ssssssssdi",
// Values for new items
$feed_id,
$item['url'],
$item['title'],
$item['description'],
$item['content'],
$author,
$dummy_categories, // XXX - Deal with categories
$item['comment_url'],
$item['comment_feed'],
$guid,
$item['pub_time'],
$is_read,
// Values for updated items
$item['url'],
$item['title'],
$item['description'],
$item['content'],
$author,
$dummy_categories, // XXX - Deal with categories
$item['comment_url'],
$item['comment_feed'],
$item['pub_time']
);
$err = $stmt->execute();
// XXX - Can count number of affected rows. Apparently
// 0-> duplicate entry (no change)
// 1-> new entry
// 2-> updated entry
$nrows = $stmt->affected_rows;
switch ($nrows)
{
case 0:
$update_counts['old']++;
break;
case 1:
$update_counts['new']++;
break;
case 2:
$update_counts['updated']++;
break;
default:
// This should never happen
// XXX - Check for this?
break;
}
// XXX - Better error-checking
if ($err)
;// echo "OK (", print_r($err), ") errno ", $dbh->errno, ", error [", $dbh->error, "]<br/>\n";
else {
error_log("MySQL error in feed $feed_id: " .
$dbh->errno . ': "' .
$dbh->error . '"');
// What follows is very ad hoc.
switch ($dbh->errno)
{
case 1366:
print_r($item);
break;
case 1406:
error_log("guid: " . $guid);
break;
default:
break;
}
}
//echo "Affected rows: [", $stmt->affected_rows, "]<br/>\n";
}
// Update feeds.last_update, so we can measure staleness
/* XXX - Edge case: what if the feed is broken (or weird), so
* that currently feeds.last_update == Aug 1 (from the last
* update), but the most recent items.pub_date is Mar 1? Then
* we'd see feeds.last_update go back 4 months, even though
* the most recent post was Aug 1.
*
* Perhaps use
* SET last_update = MAX(last_update, (SELECT ...))
* But then if the feed is empty, then the IFNULL will default
* to NOW(), which is also bad. If the feed is empty, then
* feeds.last_update should remain unchanged. So perhaps
* should default to the epoch.
*/
$query = <<<EOT
UPDATE `feeds`
SET last_update =
(SELECT IFNULL(MAX(items.pub_date), NOW())
FROM items
WHERE items.feed_id = feeds.id)
WHERE id = ?
EOT;
$stmt = $dbh->prepare($query);
// XXX - Error-checking
$err = $stmt->bind_param("i",
$feed_id);
// XXX - Error-checking
$err = $stmt->execute();
// XXX - Error-checking
/* Delete old items from database.
* Here, we look up the "autodelete" option for the feed in
* question, and delete the items older than that many days.
*/
// XXX - This is potentially a problem with
// a) An article that has gone unread n+1 days, and was just
// updated. In this case, you had n days to read it. Cope.
// b) Feeds that don't give dates, such as Perry Bible
// Fellowship. In this case, the feed parser should insert an
// artificial date.
$query = <<<EOT
DELETE FROM `items`
WHERE feed_id = ?
AND pub_date < NOW() -
INTERVAL get_option(feed_id, "autodelete") DAY
EOT;
$stmt = $dbh->prepare($query);
if ($stmt === FALSE)
{
// XXX - Better error-checking
error_log("prepare error " . $dbh->errno .
": \"" . $dbh->error .
"\"<br/>\n");
}
$err = $stmt->bind_param("i",
$feed_id);
// XXX - Error-checking
$err = $stmt->execute();
// XXX - Error-checking
/* Return count of new/updated items */
return $update_counts;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function update_feed($feed)\n\t{\n\t\t$feed = intval($feed);\n\n\t\tif ( ! $feed)\n\t\t\tthrow new Exception('Invalid feed id');\n\n\t\t$feed = ORM::factory('Feed', $feed);\n\n\t\tMinion_CLI::write($feed->name . ' updating...');\n\n\t\t$feeds = new Feeds();\n\t\t$feeds->register_callback(function ($msg) { Minion_CLI::write($msg); });\n\t\t$feeds->update_single($feed);\n\t}",
"public function updateFeed($feed) {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('feed', 'updatePoll');\n\t\t$stm->execute(array(\n\t\t\t':id' => $feed->id,\n\t\t\t':lastUpdated' => $feed->lastUpdated,\n\t\t\t':lastPolled' => $feed->lastPolled\n\t\t));\n\n\t\tif ($this->_isPdoError($stm)) {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t\treturn true;\n\t}",
"function db_update_feed_info($feed_id, $fields)\n{\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_feed($feed_id);\n\tif ($old === NULL)\n\t\t// No such feed\n\t\treturn FALSE;\n\n\t// XXX - some fields are assumed to be HTML and should be\n\t// cleaned up before storing:\n\t//\t- title (127)\n\t//\t- subtitle (127)\n\t//\t- nickname (127)\n\t//\t- description (127)\n\tif (array_key_exists(\"title\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['title'], 127));\n\tif (array_key_exists(\"subtitle\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['subtitle'], 127));\n\tif (array_key_exists(\"nickname\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['nickname'], 127));\n\tif (array_key_exists(\"description\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['description'], 127));\n\n\t/* Go through the fields, and compare them to what's already\n\t * in the database.\n\t */\n\t// Can't use $stmt->bind_param(), because that takes a\n\t// variable number of arguments, and I don't think PHP has the\n\t// equivalent of Lisp's (apply).\n\t// XXX - Actually, see call_user_func_array()\n\n\t// Also, some of the fields require special processing anyway:\n\t// it's not a simple mapping from $feed[X] -> database column\n\t// X.\n\n\t// XXX - Should any of these check to see if the new value is\n\t// empty, and if so, set the column to NULL?\n\t$updates = array();\t\t// Array of changes we're\n\t\t\t\t\t// going to make, as an array\n\t\t\t\t\t// of SQL fragments.\n\t/* Plain string fields */\n\tforeach (array('title', 'subtitle', 'nickname', 'url', 'feed_url',\n\t\t 'description', 'username', 'passwd')\n\t\t as $f)\n\t{\n\t\tif (array_key_exists($f, $fields) &&\n\t\t $fields[$f] != $old[$f])\n\t\t{\n\t\t\tif ($fields[$f] === NULL)\n\t\t\t\t$value = \"NULL\";\n\t\t\telse\n\t\t\t\t$value = \"'\" .\n\t\t\t\t\t$dbh->real_escape_string($fields[$f]) .\n\t\t\t\t\t\"'\";\n\t\t\t$updates[] = \"$f = $value\";\n\t\t}\n\t}\n\n\t/* Boolean fields */\n\tif (array_key_exists('active', $fields) &&\n\t ((bool) $fields['active'] != (bool) $old['active']))\n\t\t// Is this feed active?\n\t\t$updates[] = \"active = \" .\n\t\t\t($fields['active'] ? \"TRUE\" : \"FALSE\");\n\n\t/* Other fields that require special processing */\n\tif (array_key_exists('image', $fields) &&\n\t is_array($fields['image']) &&\n\t array_key_exists('url', $fields['image']) &&\n\t $fields['image']['url'] != $old['image'])\n\t\t// Image associated with the site\n\t\t$updates[] = \"image = '\" .\n\t\t\t$dbh->real_escape_string($fields['image']['url']) .\n\t\t\t\"'\";\n\n// XXX - This function is called\n// a) when the user changes feed information (like title or URL)\n// b) when we update a feed.\n// We don't want to change last_update in either of those cases; we\n// only want to change last_update when an item with a pub_date newer\n// than feeds.last_update comes in.\n// So this is commented out until I'm sure this doesn't break\n// anything.\n//\tif (array_key_exists('last_update', $fields) &&\n//\t $fields['last_update'] > $old['unix_last_update'])\n//\t\t// Last update (time_t)\n//\t\t$updates[] = sprintf(\"last_update = FROM_UNIXTIME(%ld)\", $fields['last_update']);\n\n\t/* Update the database, if necessary */\n\tif (count($updates) > 0)\n\t{\n\t\t$query = sprintf(\"UPDATE `feeds` SET\\n%s\\nWHERE id=%d\",\n\t\t\t\t implode(\",\\n\", $updates),\n\t\t\t\t $feed_id);\n\t\t$result = $dbh->query($query);\n\t\tif (!$result)\n\t\t{\n\t\t\tglobal $db_errno;\n\t\t\t$db_errno = $dbh->errno;\n\t\t\tglobal $db_errmsg;\n\t\t\t$db_errmsg = \"Error setting feed information: \" .\n\t\t\t\t$dbh->error;\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\treturn count($updates);\n}",
"function refreshFeed($feed_id){\n $conn = new Sgbd();\n\n $feed = $conn->selectFromDB(\"first\", \"feeds\", array(\"*\"), array(\"id\" => $feed_id));\n //Obtenemos la url y la fecha de actualización del feed\n $url = $feed['url'];\n $updated_at = strtotime($feed['updated_at']);\n\n //Cargamos los articulos\n list($channel, $articles) = self::getArticles($url);\n\n //Los recorremos y guardamos en la base de datos solo los que son más recientes\n //respecto a la fecha de última actualización del Feed\n foreach($articles as $time => $article){\n if(!isset($updated_at) || $time >= $updated_at){\n $conn->insert2DB(\"posts\", array(\"feed_id\" => $feed_id, \"title\" => $article['title'], \"description\" => $article['description'], \"content\" => $article['content'], 'published_at' => gmdate(\"Y-m-d H:i:s\", $time), \"url\" => $article['link']));\n }\n }\n //Actualizamos fecha de la última actualización a la fecha/hora actual\n $conn->updateTableFromDB(\"feeds\", array('updated_at' => gmdate(\"Y-m-d H:i:s\", time())), array(\"id\" => $feed_id));\n }",
"function updateFeed($feedID,$return=true);",
"function logicUpdate($id)\n {\n $id = FilterUtils::sanitizeVar($id, FILTER_VALIDATE_INT);\n\n if ($id === NULL || $id === false) {\n return array(\n 'error' => 'Invalid category id'\n );\n }\n\n $category = $this->categoryDAO->findById($id);\n foreach ($category->getFeeds() as $feed) {\n $this->feedController->update($feed->getId());\n }\n }",
"protected function refreshFeed(Feed $feed)\n {\n $em = $this->getContainer()->get('doctrine');\n $repo = $em->getRepository(Feed::class);\n $feed = $repo->find($feed->getId());\n $feedHandler = $this->getContainer()->get('arthur_hoaro_rss_cruncher_api.feed.handler');\n $items = $feedHandler->refreshFeed(\n $feed,\n $this->getContainer()->get('simplepie')\n );\n\n $validator = $this->getContainer()->get('validator');\n\n foreach ($items as $item) {\n if (count($validator->validate($item)) == 0 ) {\n $this->getContainer()->get('arthur_hoaro_rss_cruncher_api.article.handler')->save($item);\n }\n }\n $feedHandler->updateDateFetch($feed);\n }",
"public function update(Request $request, Feed $feed)\n {\n //$feed = Feed::where('id' , $request-> id)->first();\n\n $feed ->update($request->all());\n $feed ->save();\n return $feed;\n }",
"public function update(FeedEditRequest $request, $id)\n {\n Flash::success( 'Feed was successfully updated.' );\n $this->feedService->updateOrCreate( $request->all() , $id );\n }",
"public static function mm_update()\n {\n // Get the RSS feed from Morning Mail\n $xml = simplexml_load_file( 'http://morningmail.rpi.edu/rss' );\n \n // Begin the transaction\n Database::beginTransaction();\n\n $count = 0;\n foreach( $xml->channel->item as $item )\n {\n // Check for duplicates (no DB-agnostic way\n // to ignore duplicate errors)\n if( self::find( $item->link ) ) continue;\n\n // Parse data and construct Article objects,\n // save them to the DB\n $date = date_create( $item->pubDate );\n $a = new Article( $item->title, strip_tags( $item->description ), \n $date->format( 'Y-m-d H:i:s' ), $item->link );\n // Increment row count\n $count++;\n if( !$a->save() )\n {\n Database::rollBack();\n return false;\n }\n }\n\n // Commit transaction\n Database::commit();\n return $count;\n }",
"function getFeed($feedID, $force = FALSE)\n\t{\n\t\t$tp = e107::getParser();\n\t\t$sql = e107::getDb();\n\t\t$this->readFeedList();\t\t\t\t// Make sure we've got the feed data.\n\t\tif (!isset($this->feedList[$feedID]))\n\t\t{\n\t\t\tif (NEWSFEED_DEBUG) echo \"Invalid feed number: {$feedID}<br />\";\n\t\t\treturn FALSE;\n\t\t}\n\t\t$maxAge = ($this->feedList[$feedID]['newsfeed_updateint']/60);\n\t\tif($maxAge < 1){ $maxAge = 1; }\n\t//\te107::getDebug()->log(\"NewsFeed #\".$feedID.\" MaxAge: \".$maxAge);\n\t\t$cachedData = e107::getCache()->retrieve(NEWSFEED_NEWS_CACHE_TAG.$feedID,$maxAge, true);\n\t\tif(empty($this->newsList[$feedID]['newsfeed_timestamp']) || empty($cachedData) || strpos($this->newsList[$feedID]['newsfeed_data'],'MagpieRSS')) //BC Fix to update newsfeed_data from v1 to v2 spec.\n\t\t{\n\t\t\t$force = true;\n\t\t\t// e107::getDebug()->log(\"NewsFeed Force\");\n\t\t}\n\t\tif($cachedData !== false && $force === false)\n\t\t{\n\t\t\te107::getDebug()->log(\"NewsFeed Cache Used\");\n\t\t\t$this->newsList[$feedID]['newsfeed_data'] = $cachedData;\n\t\t}\n\t\tif ($force === true) // Need to re-read from source - either no cached data yet, or cache expired\n\t\t{\n\t\t\t\te107::getDebug()->log(\"NewsFeed Update: Item #\".$feedID.\" \".NEWSFEED_NEWS_CACHE_TAG);\n\t\t\t\tif (NEWSFEED_DEBUG)\n\t\t\t\t{\n\t\t\t\t\t e107::getLog()->e_log_event(10,debug_backtrace(),\"DEBUG\",\"Newsfeed update\",\"Refresh item: \".$feedID,FALSE,LOG_TO_ROLLING);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\trequire_once(e_HANDLER.'xml_class.php');\n\t\t\t\t$xml = new xmlClass;\n\t\t\t\trequire_once(e_HANDLER.'magpie_rss.php');\n\t\t\t\t\n\t\t\t\t$dbData = array();\t\t// In case we need to update DB\n\t\t\t\t\n\t\t\t\tif($rawData = $xml->getRemoteFile($this->feedList[$feedID]['newsfeed_url'])) // Need to update feed\n\t\t\t\t{\t\n\t\t\t\t\t$rss = new MagpieRSS( $rawData );\n\t\t\t\t\tlist($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode(\"::\", $this->feedList[$feedID]['newsfeed_image']);\n\t\t\t\t\t\n\t\t\t\t\t$temp['channel'] = $rss->channel;\n\t\t\t\t\t\n\t\t\t\t\tif (($newsfeed_showmenu == 0) || ($newsfeed_showmain == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['items'] = $rss->items;\t\t// Unlimited items\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$temp['items'] = array_slice($rss->items, 0, max($newsfeed_showmenu, $newsfeed_showmain));\t\t// Limited items\n\t\t\t\t\t}\n\t\t\t\t\t$newsfeed_des = FALSE;\n\t\t\t\t\t\n\t\t\t\t\tif($this->feedList[$feedID]['newsfeed_description'] == 'default')\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['newsfeed_description'] = 'default';\t\t// This prevents db writes if no better data found\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($rss->channel['description'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$newsfeed_des = $tp -> toDB($rss->channel['description']);\n\t\t\t\t\t\t\t$temp['newsfeed_description'] = $newsfeed_des;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($rss->channel['tagline'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$newsfeed_des = $tp -> toDB($rss -> channel['tagline']);\n\t\t\t\t\t\t\t$temp['newsfeed_description'] = $newsfeed_des;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif ($temp['newsfeed_description'] != $this->feedList[$feedID]['newsfeed_description'])\n\t\t\t\t\t\t{\t// Need to write updated feed name to DB\n\t\t\t\t\t\t\t$this->feedList[$feedID]['newsfeed_description'] = $temp['newsfeed_description'];\n\t\t\t\t\t\t\t$dbData['newsfeed_description'] = $temp['newsfeed_description'];\n\t\t\t\t\t\t\tif ($this->useCache)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\te107::getCache()->clear(NEWSFEED_LIST_CACHE_TAG);\t\t// Clear the newsfeed cache so its re-read next time\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\tif ($newsfeed_image == 'default')\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp['newsfeed_image_link'] = \"<a href='\".$rss->image['link'].\"' rel='external'><img src='\".$rss->image['url'].\"' alt='\".$rss->image['title'].\"' style='vertical-align: middle;' /></a>\";\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$temp['newsfeed_image_link'] = !empty($newsfeed_image) ? \"<img src='\".$newsfeed_image.\"' alt='' />\" : '';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$serializedArray = e107::serialize($temp, false);\n\t\t\t\t\t$now = time();\n\t\t\t\t\t$this->newsList[$feedID]['newsfeed_data'] = $serializedArray;\n\t\t\t\t\t$this->newsList[$feedID]['newsfeed_timestamp'] = $now;\n\t\t\t\t\tif ($this->useCache)\n\t\t\t\t\t{\n\t\t\t\t\t//\te107::getDebug()->log(\"Saving Cache\");\n\t\t\t\t\t\te107::getCache()->set(NEWSFEED_NEWS_CACHE_TAG.$feedID, $serializedArray, true);\n\t\t\t\t\t}\n\t\t\t\t\t$dbData['newsfeed_data'] = $serializedArray;\n\t\t\t\t\t$dbData['newsfeed_timestamp'] = $now;\n\t\t\t\t\t\n\t\t\t\t\tif (count($dbData)) // Only write the feed data to DB if not using cache. Write description if changed\n\t\t\t\t\t{\n\t\t\t\t\t\t$dbData['WHERE'] = \"newsfeed_id=\".$feedID;\n\t\t\t\t\t\tif(FALSE === $sql->update('newsfeed', $dbData))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// e107::getDebug()->log(\"NewsFeed DB Update Failed\");\n\t\t\t\t\t\t\tif (NEWSFEED_DEBUG) echo NFLAN_48.\"<br /><br />\".var_dump($dbData);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tunset($rss);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (NEWSFEED_DEBUG) echo $xml -> error;\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t}\n\t\treturn e107::unserialize($this->newsList[$feedID]['newsfeed_data']);\n\t}",
"function db_delete_feed($feed_id)\n{\n\t$dbh = db_connect();\n\n\t// XXX - Call any hooks to be run before the feed is deleted\n\n\t/* First, delete all of the articles in the feed */\n\t$query = \"DELETE FROM `items` WHERE feed_id = ?\";\n\t$stmt = $dbh->prepare($query);\n\t\t// XXX - Error-checking\n\t$err = $stmt->bind_param(\"i\", $feed_id);\n\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t// XXX - Error-checking\n\t$stmt->close();\n\n\t/* Delete the feed from all groups that it's in. */\n\t$query = \"DELETE FROM `group_members` WHERE member = ?\";\n\t$stmt = $dbh->prepare($query);\n\t\t// XXX - Error-checking\n\t$err = $stmt->bind_param(\"i\", $feed_id);\n\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t// XXX - Error-checking\n\t$stmt->close();\n\n\t/* Delete the entry for the feed itself. */\n\t$query = \"DELETE FROM `feeds` WHERE id = ?\";\n\t$stmt = $dbh->prepare($query);\n\t\t// XXX - Error-checking\n\t$err = $stmt->bind_param(\"i\", $feed_id);\n\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\t\t// XXX - Error-checking\n\t$stmt->close();\n\n\treturn TRUE;\n}",
"public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed)\n {\n if ($item->publishedDate === null) {\n $this->findItemPublishedDate($entry, $item, $feed);\n }\n $item->setUpdatedDate($item->getPublishedDate()); // No updated date in RSS 2.0 specifications\n }",
"public static function updateAllFiltersFacade($feed_id)\n {\n\n /**\n * @Registered Channel filter counter update\n */\n $categoryfilter = new CategoryFilterRepository(new CategoryFilter());\n $channel_categories = $categoryfilter->getChannelCategories($feed_id,true);\n foreach($channel_categories as $filter) {\n RuleCronjobFacade::insertFilters($filter->id,$filter->fk_channel_feed_id,UrlKey::CHANNEL_FEED,$filter,$filter->category_condition,true);\n }\n\n\n /**\n * @regjsterd bol.com filter counter update\n */\n $bol_categories = $categoryfilter->getBolCategories($feed_id,true);\n foreach($bol_categories as $filter) {\n RuleCronjobFacade::insertFilters($filter->id,$filter->fk_bol_id,UrlKey::BOL,$filter,$filter->category_condition,true);\n };\n\n\n }",
"public function update(Request $request, $id)\n {\n $feed = Feed::findOrFail($id); \n $feed ->update($request->all());\n return redirect(\"/\");\n }",
"public function updateFead($url, $id)\n {\n $parser = null;\n $data = $this->getContent($url);\n if (!$data) {\n return;\n }\n $data = $data['data'];\n\n // rss-fead\n if (strpos($data, '<rss')) {\n $parser = new Application_Model_RssParser($data);\n }\n // atom-fead\n else if (strpos($data, '<feed')) {\n $parser = new Application_Model_AtomParser($data);\n }\n // error\n else {\n return;\n }\n\n $parser->setFeadId($id);\n $parser->parseWithMinDate();\n\n $articleRepo = Application_Model_ArticleRepository::getInstance();\n while ($article = $parser->nextArticle()) {\n $articleRepo->addArticle($article);\n }\n }",
"public function updateFeedName($feedid, $feedName, $feedType)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"UPDATE feeds\r\n\t\t\t\t\t\t\tset feed_name = '\" .$feedName. \"',\r\n\t\t\t\t\t\t\t\tfeed_type = '\" .$feedType. \"'\r\n\t\t\t\t\t\tWHERE feed_id = '\" . $feedid. \"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t}",
"public function updateFeeds($fid, $ftid, $user)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query2 = \"SELECT feed_id,pig_id FROM feed_transaction WHERE ft_id='\" . $ftid . \"'\";\r\n\t\t\t\t$result2 = mysqli_query($link, $query2);\r\n\t\t\t\t$row = mysqli_fetch_row($result2);\r\n\t\t\t\t$query = \"UPDATE feed_transaction set feed_id = '\" . $fid . \"'WHERE ft_id = '\" . $ftid . \"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t\t\tif ($result) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->userTransactionEdit($user,$ftid,\"feeds\",$row[0],$fid,2,$row[1]);\r\n\t\t\t\t\t\treturn array(\r\n\t\t\t\t\t\t\t\t'success' => '1'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t\treturn array(\r\n\t\t\t\t\t\t\t\t'success' => '0'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t}",
"function update($data, $id)\n {\n $this->db->where('wsfeed_id', $id); //memasukkan berdasarkan id yg telah ada\n if ($this->db->update('fis_dworkshopseminar_feedbacks', $data)) {\n $this->session->set_userdata('typeNotif', 'successEdited');\n return TRUE;\n } else {\n $this->session->set_userdata('typeNotif', 'errorEdited');\n return FALSE;\n }\n }",
"function wprss_is_feed_source_updating( $id ) {\n // Get the 'updating' meta field\n $is_updating_meta = get_post_meta( $id, 'wprss_feed_is_updating', TRUE );\n\n // Check if the feed has the 'updating' meta field set\n if ( $is_updating_meta === '' ) {\n // If not, then the feed is not updating\n return FALSE;\n }\n\n // Get the limit used for the feed\n $limit = get_post_meta( $id, 'wprss_limit', true );\n if ( $limit === '' || intval( $limit ) <= 0 ) {\n $global_limit = wprss_get_general_setting('limit_feed_items_imported');\n $limit = ( $global_limit === '' || intval( $global_limit ) <= 0 ) ? NULL : $global_limit;\n }\n\n\t\t// Calculate the allowed maximum time, based on the maximum number of items allowed to be\n // imported from this source.\n // If no limit is used, 60s (1min) is used.\n $single_item_time_limit = wprss_get_item_import_time_limit();\n\t\t$allowed_time = $limit === NULL ? 60 : $single_item_time_limit * intval( $limit );\n\n // Calculate how many seconds have passed since the feed last signalled that it is updating\n $diff = time() - $is_updating_meta;\n\n // If the difference is greater than the allowed maximum amount of time, mark the feed as idle.\n\t\tif ( $diff > $allowed_time ) {\n\t\t\twprss_flag_feed_as_idle( $id );\n // Feed is not updating\n\t\t\treturn FALSE;\n\t\t}\n\n // Feed is updating\n\t\treturn TRUE;\n }",
"public function updateall()\n\t{\n\t\t$this->cleanup();\n\n\t\t//get only 15 feeds at a time\n\t\t$feeds = Feed::orderBy('updated_at', 'asc')->take(15)->get();\n\n\t\t$count = 0;\n\n\t\tif (!empty($feeds)) {\n\t\t\tforeach ($feeds as $feed) {\n\t\t\t\t//update feed, see update function\n\t\t\t\t$count = $count + $this->update($feed);\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json([\n\t\t\t'code' => '200',\n\t\t\t'count' => $count,\n\t\t\t'message' => $count . ' new messages have been added to the database',\n\t\t], 200);\n\t}",
"public function update(Request $request, $id)\n {\n //\n $newsfeed_edited = Newsfeed::findOrFail($id);\n $newsfeed_edited->update($request->all());\n return redirect('/newsfeed');\n \n }",
"function db_add_feed($feed)\n{\n\t$dbh = db_connect();\n\n\t$fields = array();\t// Fields we'll be adding\n\t$values = array();\t// The fields' values\n\tforeach ($feed as $k => $v)\n\t{\n\t\tswitch ($k)\n\t\t{\n\t\t case \"title\":\n\t\t case \"subtitle\":\n\t\t case \"nickname\":\n\t\t case \"url\":\n\t\t case \"feed_url\":\n\t\t case \"description\":\n\t\t case \"image\":\n\t\t case \"username\":\n\t\t case \"passwd\":\n\t\t\t// These are strings\n\t\t\t$fields[] = $k;\n\t\t\t$values[] = \"'\" . $dbh->real_escape_string($v) . \"'\";\n\t\t\tbreak;\n\n\t\t case \"last_update\":\n\t\t\t/* Normally, we ignore the last_update time\n\t\t\t * from the feed itself (as opposed to the\n\t\t\t * time from the individual items). But in\n\t\t\t * this case, since we're adding a new feed,\n\t\t\t * having a publisher-supplied value might be\n\t\t\t * better than nothing.\n\t\t\t */\n\t\t\t/* XXX - Then again, it might not. We could\n\t\t\t * just as easily initialize it to now.\n\t\t\t */\n\t\t\t// Convert from time_t to SQL date\n\t\t\t$fields[] = \"last_update\";\n\t\t\t$values[] = \"FROM_UNIXTIME($v)\";\n\t\t\tbreak;\n\n\t\t default:\n\t\t\t// XXX - Complain about unknown field\n//echo \"Unknown field [$k]<br/>\\n\";\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$query = \"INSERT INTO `feeds` (\" .\n\t\timplode(\",\", $fields) .\n\t\t\") VALUES (\" .\n\t\timplode(\",\", $values) .\n\t\t\")\";\n\t$stmt = $dbh->prepare($query);\n\t\t// XXX - Error-checking\n\t$err = $stmt->execute();\n\tif (!$err)\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\t\t$stmt->close();\n\t\treturn false;\n\t}\n\t$feed_id = $dbh->insert_id;\n\t$stmt->close();\n\n\t// XXX - Call user hooks\n\n\treturn $feed_id;\n}",
"function forum_rss_feeds() {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging('DISABLED (admin variables)');\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging('DISABLED (module configuration)');\n //It's working so we start...\n } else {\n //Iterate over all forums\n if ($forums = get_records(\"forum\")) {\n foreach ($forums as $forum) {\n if (!empty($forum->rsstype) && !empty($forum->rssarticles) && $status) {\n\n $filename = rss_file_name('forum', $forum); // RSS file\n\n //First let's make sure there is work to do by checking existing files\n if (file_exists($filename)) {\n if ($lastmodified = filemtime($filename)) {\n if (!forum_rss_newstuff($forum, $lastmodified)) {\n continue;\n }\n }\n }\n\n //Ignore hidden forums\n if (!instance_is_visible('forum',$forum)) {\n if (file_exists($filename)) {\n @unlink($filename);\n }\n continue;\n }\n\n mtrace(\"Updating RSS feed for \".format_string($forum->name,true).\", ID: $forum->id\");\n\n //Get the XML contents\n $result = forum_rss_feed($forum);\n //Save the XML contents to file\n if (!empty($result)) {\n $status = rss_save_file(\"forum\",$forum,$result);\n }\n if (debugging()) {\n if (empty($result)) {\n echo \"ID: $forum->id-> (empty) \";\n } else {\n if (!empty($status)) {\n echo \"ID: $forum->id-> OK \";\n } else {\n echo \"ID: $forum->id-> FAIL \";\n }\n }\n }\n }\n }\n }\n }\n return $status;\n }",
"public static function updateAllRulesFacade($feed_id)\n {\n\n\n /**\n * @Registered Channel rule counter update\n */\n $channel_feed = new ChannelFeedRepository(new ChannelFeed());\n $rules = new RuleRepository(new Rule());\n $channels = $channel_feed->getActiveChannels(true,$feed_id);\n foreach($channels as $channel) {\n $channel_feed_id = $channel->id;\n $channel_type_id = $channel->fk_channel_type_id;\n foreach($rules->getChannelOrdersRules($channel_feed_id,$channel_type_id) as $rule){\n RuleCronjobFacade::insertTmpRules($rule,UrlKey::CHANNEL_FEED,$channel_feed_id,$rule->rule_id,true);\n }\n }\n\n\n /**\n * @Registered Adwords rule counter update\n */\n $adwords_feed_repository = new AdwordsfeedRepository(new Adwordsfeed());\n $adwords_feed = $adwords_feed_repository->getAdwordsFeedFromFeedId($feed_id);\n foreach($adwords_feed as $adwords) {\n\n foreach($rules->getAdwordsOrderRules($adwords->id) as $rule){\n RuleCronjobFacade::insertTmpRules($rule,UrlKey::ADWORDS,$adwords->id,$rule->rule_id,true);\n }\n }\n\n\n\n /**\n * @Registered Bol.com rule counter update\n */\n $bol_repository = new BolFeedRepository(new Bolfeed());\n $bol_feed = $bol_repository->getBolFeed($feed_id,true);\n foreach($bol_feed as $bol) {\n foreach($rules->getBolOrderdRules($bol->id) as $rule){\n RuleCronjobFacade::insertTmpRules($rule,UrlKey::BOL,$bol->id,$rule->rule_id,true);\n }\n }\n\n\n }",
"function updateFeed(){\r\n //Here we go \r\n $check = \"SELECT * FROM `feeds` WHERE `area_id` = :c_area_id ORDER BY `id` DESC\";\r\n $check_stmt = $this->conn->prepare($check);\r\n $check_stmt->bindParam(\":c_area_id\", $this->area_id);\r\n $check_stmt->execute();\r\n $get = $check_stmt->fetch(PDO:: FETCH_ASSOC);\r\n //Converting the DateTime of `created` to Unix time stamp\r\n $created = strtotime($get['created']);\r\n $last_reported_status = $get['light_on'];\r\n $c_user_id = $get['user_id'];\r\n $feed_id = $get['id'];\r\n\r\n $check_status_query = \"SELECT `status` FROM `areas` WHERE `id` = $this->area_id\";\r\n $check_status = $this->conn->prepare($check_status_query);\r\n $check_status->execute();\r\n $fetch_status = $check_status->fetch(PDO:: FETCH_ASSOC);\r\n $area_status = $fetch_status['status'];\r\n // if($area_status == $this->status){\r\n // //300 seconds = 5 minutes\r\n // if($created < $created + 300){\r\n // if($status == $this->light_on){\r\n // $t_name = \"update\";\r\n // }\r\n // }else{\r\n // if($status == $this->light_on){\r\n // $t_name = \"update\";\r\n // }\r\n // }\r\n // }\r\n if($this->light_on == $last_reported_status){\r\n if($created < $created+300){\r\n $query = \"INSERT INTO `update` SET `user` = :user_id, `feed_id` = :feed_id, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":feed_id\", $this->feed_id);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }else{\r\n if($this->light_on != $area_status){\r\n $query = \"INSERT INTO `feeds` SET `user_id` = :user_id, `light_on` = :light_on, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":light_on\", $this->light_on);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }else{\r\n $query = \"INSERT INTO `update` SET `user` = :user_id, `feed_id` = :feed_id, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":feed_id\", $this->feed_id);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }\r\n }\r\n }else{\r\n $query = \"INSERT INTO `feeds` SET `user_id` = :user_id, `light_on` = :light_on, `area_id` = :area_id, `note` = :note\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(\":user_id\", $this->user_id);\r\n $stmt->bindParam(\":light_on\", $this->light_on);\r\n $stmt->bindParam(\":area_id\", $this->area_id);\r\n $stmt->bindParam(\":note\", $this->note);\r\n $stmt->execute();\r\n }\r\n }",
"function RSS_adminapi_update($args)\n{\n // Get arguments from argument array - all arguments to this function\n // should be obtained from the $args array, getting them from other\n // places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n extract($args);\n\n // Argument check - make sure that all required arguments are present,\n // if not then set an appropriate error message and return\n if ((!isset($fid)) ||\n (!isset($feedname)) ||\n (!isset($url))) {\n pnSessionSetVar('errormsg', _MODARGSERROR);\n return false;\n }\n\n // The user API function is called. This takes the item ID which\n // we obtained from the input and gets us the information on the\n // appropriate item. If the item does not exist we post an appropriate\n // message and return\n $item = pnModAPIFunc('RSS',\n 'user',\n 'get',\n array('fid' => $fid));\n\n if ($item == false) {\n pnSessionSetVar('errormsg', _RSSNOSUCHITEM);\n return false;\n }\n\n // Security check - important to do this as early on as possible to\n // avoid potential security holes or just too much wasted processing.\n // However, in this case we had to wait until we could obtain the item\n // name to complete the instance information so this is the first\n // chance we get to do the check\n\n // Note that at this stage we have two sets of item information, the\n // pre-modification and the post-modification. We need to check against\n // both of these to ensure that whoever is doing the modification has\n // suitable permissions to edit the item otherwise people can potentially\n // edit areas to which they do not have suitable access\n if (!pnSecAuthAction(0, 'RSS::Item', \"$item[feedname]::$fid\", ACCESS_EDIT)) {\n pnSessionSetVar('errormsg', _MODULENOAUTH);\n return false;\n }\n if (!pnSecAuthAction(0, 'RSS::Item', \"$feedname::$fid\", ACCESS_EDIT)) {\n pnSessionSetVar('errormsg', _MODULENOAUTH);\n return false;\n }\n\n // check for maximum length to avoid cutting off URLs\n if (strlen($url > 200)) {\n pnSessionSetVar('errormsg', _RSSURLTOOLONG);\n return false;\n }\n\n // Check for a protocol Magpie RSS (more exactly Snoopy) can handle.\n $url_parts = parse_url($url);\n if ($url_parts['scheme'] != 'http' && $url_parts['scheme'] != 'https') {\n pnSessionSetVar('errormsg', _RSSINVALIDPROTOCOL);\n return false;\n }\n\n // Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()\n // return arrays but we handle them differently. For pnDBGetConn()\n // we currently just want the first item, which is the official\n // database handle. For pnDBGetTables() we want to keep the entire\n // tables array together for easy reference later on\n $dbconn =& pnDBGetConn(true);\n $pntable =& pnDBGetTables();\n\n // It's good practice to name the table and column definitions you\n // are getting - $table and $column don't cut it in more complex\n // modules\n $RSStable = $pntable['RSS'];\n $RSScolumn = &$pntable['RSS_column'];\n\n // Update the item - the formatting here is not mandatory, but it does\n // make the SQL statement relatively easy to read. Also, separating\n // out the sql statement from the Execute() command allows for simpler\n // debug operation if it is ever needed\n $sql = \"UPDATE $RSStable\n SET $RSScolumn[name] = '\" . pnVarPrepForStore($feedname) . \"',\n $RSScolumn[url] = '\" . pnVarPrepForStore($url) . \"'\n WHERE $RSScolumn[fid] = '\" . (int)pnVarPrepForStore($fid) . \"'\";\n $dbconn->Execute($sql);\n\n // Check for an error with the database code, and if so set an\n // appropriate error message and return\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _DELETEFAILED);\n return false;\n }\n\n // New hook functions\n pnModCallHooks('item', 'update', $fid, array('module' => 'RSS'));\n\n // Let the calling process know that we have finished successfully\n return true;\n}",
"function addFeedData($feedID,$url,$status=true,$update=0);",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string|max:100',\n 'movie_id' => 'required|integer'\n ]);\n\n if ($validator->fails()) {\n return $this->response(200, [], '', $validator->errors(), [], false);\n }\n\n $input = $request->only(['content', 'movie_id']);\n\n if (empty($this->feedRepo->find($id))) {\n return $this->response(200, [], __('text.not_found', ['model' => 'FeedBack']), [], null, false);\n }\n\n $isExitMovie = $this->movieRepo->find($request->movie_id);\n if (!$isExitMovie) {\n return $this->response(200, [], __('text.not_found', ['model' => 'Movie Id']), [], null, false);\n }\n\n $feedback = $this->feedRepo->update($input, $id);\n return $this->response(200, ['feedback' => new FeedBackResource($feedback)], __('text.update_successfully'));\n }",
"function updateLiveFeedStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n $values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('livefeeds');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Livefeed id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n \n\treturn true;\n}"
] |
[
"0.77389735",
"0.752745",
"0.6933158",
"0.66210425",
"0.65896416",
"0.6463568",
"0.6249352",
"0.61930346",
"0.60374635",
"0.59486765",
"0.5867237",
"0.5810694",
"0.5786903",
"0.57686836",
"0.5749256",
"0.5681383",
"0.5675852",
"0.56702703",
"0.56677085",
"0.56436956",
"0.5610109",
"0.55934495",
"0.5586561",
"0.5571237",
"0.55681914",
"0.5565835",
"0.55491436",
"0.55289125",
"0.5521739",
"0.549722"
] |
0.85930085
|
0
|
/ db_get_items Given a list of item IDs, look up those items.
|
function db_get_items($items)
{
if (is_array($items) && count($items) == 0)
# Degenerate case: no items to fetch.
return array();
$query = <<<EOT
SELECT items.id, items.feed_id, items.url, items.title,
items.summary, items.content,
items.author, items.category,
items.comment_url, items.comment_rss, items.guid,
UNIX_TIMESTAMP(items.pub_date) as `pub_date`,
UNIX_TIMESTAMP(items.last_update) as `last_update`,
IF(is_read, 1, 0) as `is_read`,
UNIX_TIMESTAMP(mtime) as `mtime`
FROM `items`
WHERE id
EOT;
# We assume that $items is either an integer, or an array of integers.
if (is_array($items))
$query .= " in (" . implode(",", $items) . ")";
else
$query .= " = $items";
$dbh = db_connect();
$result = $dbh->query($query);
$retval = array();
while ($row = $result->fetch_assoc())
{
# Make sure is_read is properly converted to boolean.
$row['is_read'] = $row['is_read'] ? TRUE : FALSE;
$row['mtime'] += 0; // Make sure it's an integer.
$retval[] = $row;
}
return $retval;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract protected function get_item_from_db($item_id);",
"function getProductFromArray($itemsIds) {\r\n $strIds = implode($itemsIds, ', ');\r\n $sql = \"SELECT * FROM products WHERE id in ({$strIds})\";\r\n\r\n include '../config/db.php';\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}",
"public function getItemByMultiple($item_data)\n\t{\n\t\t$where = array();\n\t\tif(isset($item_data['it_id'])){\n\t\t\t$where['it_id'] = $item_data['it_id'];\n\t\t}\n\t\tif(isset($item_data['owner_id'])){\n\t\t\t$where['owner_id'] = $item_data['owner_id'];\n\t\t}\n\t\treturn \\ORM::for_table($this->table)->where($where)->find_one();\n\t}",
"function getItemsOfList($listID) {\n\t\tglobal $dbh;\n $stmt = $dbh->prepare('SELECT itemID, content, image, checked\n\t\t\t \t\t\t\t\tFROM ITEM WHERE listID = ?');\n\t\t$stmt->execute(array($listID));\n\t\treturn $stmt->fetchAll();\n\t}",
"public function getItemIds();",
"function getItems($list_id) {\n\n\t\t//fetch all items from the db where the list_id = $list_id\n\t\t$itemsResultSet =\t$this->getDbTable()->fetchAll(\n\t\t\t$this->getDbTable()->select()\n\t\t\t\t->where( 'list_id = ?', $list_id)\n\t\t\t\t->order('order')\n\t\t);\n\t\t\n\t\t//create empty return array\n\t\t$items = array();\n\n\t\t//for each result returned in resultSet create Item object and fill\n\t\tforeach($itemsResultSet as $itemResult) {\n\t\t\t$class = $itemResult->class;\n\t\t\t$item = new\t$class();\n\t\t\t$item->setId($itemResult->id)\n\t\t\t\t->setPosition($itemResult->order)\n\t\t\t\t->setListId($itemResult->list_id)\n\t\t\t\t->setClass($itemResult->class)\n\t\t\t\t->setResourceId($itemResult->resource_id)\n\t\t\t\t->setOrder($itemResult->order)\n\t\t\t\t->setStart($itemResult->start)\n\t\t\t\t->setEnd($itemResult->end)\n\t\t\t\t->setCreated($itemResult->created)\n\t\t\t\t->setUpdated($itemResult->updated)\n\t\t\t\t->setAuthor($itemResult->author);\n\t\t\t//fill with stuff from its item_data table.\n\t\t\t$item->getData();\n\t\t\t$items[$item->getId()] = $item;\n\t\t}\n\n\t\treturn $items;\n\t}",
"function getItems();",
"function getItems();",
"public function loadListItemsByListId() {\n $sql = \"SELECT ListText, ListItemID, ListItemColor, ListItemDone\"\n FROM list_items\n WHERE ListID=(\n SELECT ListID\n FROM lists\n WHERE ListURL=:list\n )\n ORDER BY ListItemPosition\";\n if($stmt = $this->_db->prepare($sql)) {\n $stmt->bindParam(':list', $_GET['list'], PDO::PARAM_STR);\n $stmt->execute();\n $order = 1;\n while($row = $stmt->fetch()) {\n echo $this->formatListItems($row, $order);\n $order;\n }\n $stmt->closeCursor();\n }\n else {\n echo \"<li> Something went wrong. \", $db->error, \"</li>\";\n }",
"function getItems($db, $resource_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $sql = <<< EOD\r\nSELECT i.item_pk, i.item_title, i.item_text, i.item_url, i.max_rating mr, i.step st, i.visible vis, i.sequence seq,\r\n i.created cr, i.updated upd, COUNT(r.user_pk) num, SUM(r.rating) total\r\nFROM {$prefix}item i LEFT OUTER JOIN {$prefix}rating r ON i.item_pk = r.item_pk\r\nWHERE (i.resource_link_pk = :resource_pk)\r\nGROUP BY i.item_pk, i.item_title, i.item_text, i.item_url, i.max_rating, i.step, i.visible, i.sequence, i.created, i.updated\r\nORDER BY i.sequence\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n $query->execute();\r\n\r\n $rows = $query->fetchAll(PDO::FETCH_CLASS, 'Item');\r\n if ($rows === FALSE) {\r\n $rows = array();\r\n }\r\n\r\n return $rows;\r\n\r\n }",
"abstract public function getByItemId($itemId);",
"public function loadItems(array $ids) {\n return $this->datasource()->loadItems($ids);\n }",
"public function lookup($ids, $options = []);",
"function getItems($id)\n{\n\t$elem = $this->elements[$id];\n\tif (!empty($elem['items'])) {\n\t\treturn $elem['items'];\n\t}\n\n\t$items = array();\n\tif ($elem['list']) $items = $this->getLkpList($elem['list']);\n\telseif ($elem['query']) $items = $this->getLkpQuery($elem['query']);\n\telseif ($elem['lookup']) $items = $this->getLkpLookup($elem['lookup']);\n\telseif ($elem['datasource']) $items = $this->getDataSource($elem['datasource']);\n\n\tif ($this->translator) {\n\t\t$items = $this->translator->translateArray($items);\n\t}\n\n\t$this->elements[$id]['items'] = $items;\n\n\treturn $items;\n}",
"function loadItemsInOrders($db2, &$orderList) {\n\t\tif (!$orderList)\n\t\t\treturn;\n\t\tforeach($orderList as &$order) {\n\t\t\t$orderedItems = runDb2SelectQuery($db2,\n\t\t\t\"SELECT * FROM ORDER_ITEMS INNER JOIN ITEMS ON ORDER_ITEMS.SKU=ITEMS.SKU WHERE ORDERNBR = ?\", array($order['ordernbr']));\n\t\t\t$order['items'] = $orderedItems;\n\t\t\terror_log(print_r($order, true));\n\t\t}\n\t}",
"function getItemsBasedOnUser($user_id) {\n $item_query = \"SELECT \n item.id AS item_id,\n item.name AS item_name,\n item.category_id AS category,\n item.fee AS item_fee,\n item.description AS item_description,\n item.pickup_lat AS item_pickup_lat,\n item.pickup_long AS item_pickup_long,\n item.return_lat AS item_return_lat,\n item.return_long AS item_return_long,\n item.date_available AS item_date_available,\n item.borrowed AS item_borrowed,\n item.promoted AS item_promoted,\n item.created AS item_created,\n item.last_updated AS item_last_updated,\n c.name AS categories_name,\n c.image_url AS categories_image_url,\n image.image_link,\n image.cover AS cover_image\n FROM items item, item_images image, categories c\n WHERE item.id = image.item_id \n AND item.user_id = \" . $user_id .\"\n AND c.id = item.category_id\n ORDER BY item.created DESC\";\n\n $go_q = pg_query($item_query);\n $items = array();\n\n $status_query = \"SELECT\n item.id AS item_id,\n bid.date_of_loan AS loan_date,\n bid.duration_of_loan AS loan_duration,\n loan.bid_id AS loan_id\n FROM items item LEFT OUTER JOIN loans loan ON item.id = loan.item_id\n LEFT OUTER JOIN bids bid ON bid.id = loan.bid_id\n WHERE item.user_id = \". $user_id .\"\n ORDER BY item.created DESC\";\n\n $st_q = pg_query($status_query);\n\n while ($fe_q = pg_fetch_assoc($go_q)) {\n $items[$fe_q['item_id']]['id'] = $fe_q['item_id'];\n $items[$fe_q['item_id']]['name'] = $fe_q['item_name'];\n $items[$fe_q['item_id']]['category'] = $fe_q['category'];\n $items[$fe_q['item_id']]['fee'] = $fe_q['item_fee'];\n $items[$fe_q['item_id']]['description'] = $fe_q['item_description'];\n $items[$fe_q['item_id']]['pickup_lat'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['pickup_long'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['return_lat'] = $fe_q['item_return_lat'];\n $items[$fe_q['item_id']]['return_long'] = $fe_q['item_return_long'];\n $items[$fe_q['item_id']]['date_available'] = $fe_q['item_date_available'];\n $items[$fe_q['item_id']]['borrowed'] = $fe_q['item_borrowed'];\n $items[$fe_q['item_id']]['promoted'] = $fe_q['item_promoted'];\n $items[$fe_q['item_id']]['created'] = $fe_q['item_created'];\n $items[$fe_q['item_id']]['last_updated'] = $fe_q['item_last_updated'];\n $items[$fe_q['item_id']]['categories_name'] = $fe_q['categories_name'];\n $items[$fe_q['item_id']]['categories_image_url'] = $fe_q['categories_image_url'];\n $items[$fe_q['item_id']]['username'] = $fe_q['user_username'];\n $items[$fe_q['item_id']]['profile_image_url'] = $fe_q['user_profile_image_url'];\n\n $itemLoan = pg_fetch_assoc($st_q);\n $returnDate = date_add(date_create($itemLoan['loan_date']), date_interval_create_from_date_string($itemLoan['loan_duration'].' days'));\n //var_dump($returnDate);\n if (is_null($itemLoan['loan_id'])) {\n $items[$fe_q['item_id']]['loan_status'] = 'item-available';\n } else if ($returnDate < new DateTime(\"now\")) {\n $items[$fe_q['item_id']]['loan_status'] = 'item-done';\n } else {\n $items[$fe_q['item_id']]['loan_status'] = 'item-loaned';\n }\n\n if ($fe_q['cover_image'] == t) {\n $items[$fe_q['item_id']]['cover_image'] = $fe_q['image_link'];\n } else {\n $items[$fe_q['item_id']]['images'][] = array('image_link' => $fe_q['image_link']);\n }\n }\n\n return $items;\n}",
"function getFromDBForItems(CommonDBTM $item1, CommonDBTM $item2) {\n\n // Check items ID\n if (($item1->getID() < 0) || ($item2->getID() < 0)) {\n return false;\n }\n\n $wheres = array();\n $wheres[] = \"`\".static::$items_id_1.\"` = '\".$item1->getID().\"'\";\n $wheres[] = \"`\".static::$items_id_2.\"` = '\".$item2->getID().\"'\";\n\n // Check item 1 type\n if (preg_match('/^itemtype/', static::$itemtype_1)) {\n $wheres[] = \"`\".static::$itemtype_1.\"` = '\".$item1->getType().\"'\";\n } else if (!is_a($item1, static::$itemtype_1)) {\n return false;\n }\n\n // Check item 1 type\n if (preg_match('/^itemtype/', static::$itemtype_2)) {\n $wheres[] = \"`\".static::$itemtype_2.\"` = '\".$item2->getType().\"'\";\n } else if (!is_a($item2, static::$itemtype_2)) {\n return false;\n }\n return $this->getFromDBByQuery(\"WHERE \".implode(' AND ', $wheres));\n }",
"public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}",
"function readByIds($ids){\r\n\r\n\t$ids_arr = str_repeat('?,', count($ids) - 1) . '?';\r\n\r\n\t// query to select products\r\n\t$query = \"SELECT id, name, price FROM \" . $this->table_name . \" WHERE id IN ({$ids_arr}) ORDER BY name\";\r\n\r\n\t// prepare query statement\r\n\t$stmt = $this->conn->prepare($query);\r\n\r\n\t// execute query\r\n\t$stmt->execute($ids);\r\n\r\n\t// return values from database\r\n\treturn $stmt;\r\n}",
"public static function get_users_in($itemids) {}",
"public function getItemList($refId = null, $entryId = null )\n {\n\n $db = $this->getDb();\n\n $condEntry = '';\n $condAttach = '';\n\n if ($refId) {\n $condAttach = \" item.id_user = {$refId}\";\n } elseif ($entryId) {\n $condEntry = \" item.rowid = {$entryId}\";\n } else {\n return array();\n }\n\n $sql = <<<SQL\nSELECT\n item.rowid as item_id,\n item.address_value as item_address_value,\n item.name as item_name,\n item.use_for_contact as item_use_for_contact,\n item.flag_private as item_flag_private,\n item.description as item_description,\n\n item.id_type as type_id,\n type.name as type_name,\n type.icon as type_icon,\n type.access_key as type_access_key\n\nFROM\n wbfsys_address_item item\n\nLEFT JOIN\n wbfsys_address_item_type type\n on type.rowid = item.id_type\n\nWHERE\n {$condAttach}\n {$condEntry}\nORDER BY\n item.m_time_created desc;\n\nSQL;\n\n if ($entryId) {\n return $db->select($sql)->get();\n } else {\n return $db->select($sql)->getAll();\n }\n\n }",
"public function retrieveItems() {\n $this->all = array();\n $this->_backlog = array();\n $this->_progress = array();\n $this->_done = array();\n $table_name = \"items\";\n $connection = db_connect();\n if ($connection->connect_error) {\n die(\"Connection failed: \" . $connection->connect_error);\n }\n $sql = \"SELECT * FROM $table_name ORDER BY id\";\n $result = @mysqli_query($connection, $sql) or die(mysqli_error($connection));\n while ($row = mysqli_fetch_array($result)) {\n $id = $row['id'];\n $category = $row['category'];\n $text = $row['text'];\n $item = new Item($id, $category, $text);\n array_push($this->all, $item);\n if ($category == 1) {\n array_push($this->_backlog, $item);\n } else if ($category == 2) {\n array_push($this->_progress, $item);\n } else if ($category == 3) {\n array_push($this->_done, $item);\n }\n }\n }",
"static public function getItemIDsFromList($pm_list_name_or_id, $pa_idnos, $pa_options=null) {\n\t\tif(isset($pa_options['dontIncludeSubItems']) && (!isset($pa_options['dont_include_sub_items']) || !$pa_options['dont_include_sub_items'])) { $pa_options['dont_include_sub_items'] = $pa_options['dontIncludeSubItems']; }\n\t \t\n\t\tif (isset($pa_options['dont_include_sub_items']) && $pa_options['dont_include_sub_items']) {\n\t\t\t$pa_options['noChildren'] = true;\n\t\t}\n\t\t$t_list = new ca_lists();\n\t\t$t_item = new ca_list_items();\n\t\t$va_item_ids = array();\n\t\tforeach($pa_idnos as $vs_idno) {\n\t\t\t$vn_item_id = null;\n\t\t\tif (is_numeric($vs_idno)) { \n\t\t\t\t$vn_item_id = (int)$vs_idno; \n\t\t\t} else {\n\t\t\t\t$vn_item_id = (int)$t_list->getItemIDFromList($pm_list_name_or_id, $vs_idno);\n\t\t\t}\n\t\t\t\n\t\t\tif ($vn_item_id && !(isset($pa_options['noChildren']) || $pa_options['noChildren'])) {\n\t\t\t\tif ($qr_children = $t_item->getHierarchy($vn_item_id, array())) {\n\t\t\t\t\twhile($qr_children->nextRow()) {\n\t\t\t\t\t\t$va_item_ids[$qr_children->get('item_id')] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($vn_item_id) {\n\t\t\t\t\t$va_item_ids[$vn_item_id] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn array_keys($va_item_ids);\n\t}",
"public function getByIds(array $ids);",
"public function getItems(array $keys = []);",
"abstract protected function _getItems();",
"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 }",
"function get_all_by_pritem($items, $select = false) {\n\t\tif (!$select) $select = $this->all_field;\n\t\t$this->db->where_in('(PRNO||\\':\\'||PRITEM)', $items, false);\n\t\treturn $this->get(false, $select);\n\t}",
"protected function get_retrieved_ids() {\n $ids = $this->parse_ids($items);\n \n $sidx = $eidx = 0;\n if (is_array($this->page_size)) {\n $sidx = $this->page_size[0];\n $eidx = $this->page_size[1];\n if ($sidx < 0)\n $sidx = 0;\n if ($eidx < $sidx)\n $eidx = $sidx;\n if ($eidx >= count($ids))\n $eidx = count($ids) - 1;\n \n $len = $eidx - $sidx + 1;\n if ($sidx >= count($ids))\n $ids = array();\n else\n $ids = array_slice($ids, $sidx, $len);\n }\n\n list($start_count, $max_count) = $this->get_page_limit($this->page_size);\n $num_to_display = $max_count - $start_count + 1;\n $ids = array_slice($ids, $start_count, $num_to_display);\n\n // This is supposed to come at the end of the retrieval, but I don't know where to put it yet.\n // This is legacy code anyway and is going byebye soon.\n //$output[\"eod\"] = $start_count < $max_count;\n //$output[\"counts\"][\"displayed\"] = $start_count;\n //if (!$output[\"eod\"])\n // $output[\"counts\"][\"displayed\"]--;\n return $ids;\n }",
"public abstract function get_ids();"
] |
[
"0.6743701",
"0.6659752",
"0.6515669",
"0.6487902",
"0.6323967",
"0.6242543",
"0.62152725",
"0.62152725",
"0.61723316",
"0.6148632",
"0.6110131",
"0.5979636",
"0.597885",
"0.5915692",
"0.5903637",
"0.58959043",
"0.5893975",
"0.587851",
"0.5858937",
"0.5851037",
"0.5846206",
"0.5835694",
"0.58317506",
"0.58112776",
"0.5793889",
"0.5782994",
"0.5773167",
"0.5768422",
"0.57641816",
"0.5750223"
] |
0.68687254
|
0
|
/ db_mark_items Mark a set of items as either read or unread. $is_read is a boolean, either true (mark items as read) or false (mark items as unread), and $items is an array of item IDs to mark. XXX Should return status. XXX Would it be better to take an array of item_id => is_read values?
|
function db_mark_items($is_read, $items)
{
if (count($items) < 1)
// Nothing to do
return;
$dbh = db_connect();
// XXX - Would it be better to use a prepared statement, and
// use bind_param() repeatedly to set items' is_read-ness one
// by one?
// Time it and see.
$query = sprintf(<<<EOT
UPDATE `items`
SET is_read=%s,
mtime=NOW()
WHERE id IN(%s)
EOT
,
($is_read ? "TRUE" : "FALSE"),
implode(",", $items));
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = "Error updating feed information: " . $dbh->error;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function actionBulkMarkUnread() {\n\n if (Yii::$app->request->post('selection')) {\n\n $where = ['id' => Yii::$app->request->post('selection', [])];\n $this->modelViaClass::updateAll(['status_read' => $this->modelClass::STATUS_READ_NEW], $where);\n }\n }",
"protected function markRead($id, $userId, $isRead)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_read' => $isRead,\n 'updated_at' => time()\n ], [\n 'user_id' => $userId,\n 'id' => $id\n ])\n ->execute();\n }",
"function mark_all_read() {\n if($this->request->isSubmitted()) {\n $this->logged_user->setLastVisitOn(DateTimeValue::now());\n $save = $this->logged_user->save();\n\n if($save && !is_error($save)) {\n if($this->request->isAsyncCall()) {\n $this->httpOk();\n } else {\n flash_success('All new items are marked as read');\n } // if\n } else {\n $message = lang('Failed to mark new items as read');\n if ($this->request->isAsyncCall()) {\n $this->httpError(HTTP_ERR_OPERATION_FAILED, $message);\n die();\n } else {\n flash_success($message);\n } // if\n } // if\n $this->redirectToReferer(assemble_url('dashboard'));\n } else {\n $this->httpError(HTTP_BAD_REQUEST);\n } // if\n }",
"public function mark_read_by_user($userid)\n\t{\n\t\t$query = $this->db\n\t\t\t\t\t\t->set('is_read', 1)\n\t\t\t\t\t\t->where('user_id', $userid)\n\t\t\t\t\t\t->update('notif_rcpts');\n\n\t\tif($query)\n\t\t{\n\t\t\t$result['status'] = true;\n\t\t\t$result['data'] = \"Marked as read.\";\n\n\t\t\treturn $result;\n\t\t}\n\t\telse return $this->get_db_error();\n\t}",
"public function markAsRead(array $emailIds, $read = true)\n {\n $conversationIds = Email::whereIn('id', $emailIds)\n ->whereCreatedBy(Auth::id())// only current user\n ->pluck('conversation_id')->toArray();\n // read conversations..\n $emails = $this->repo->make()\n ->whereIn('conversation_id', $conversationIds)\n ->update(['is_read' => $read]);\n\n Firebase::updateUserEmailCount(Auth::id());\n }",
"public function actionBulkMarkRead() {\n\n if (Yii::$app->request->post('selection')) {\n\n $where = ['id' => Yii::$app->request->post('selection', [])];\n $this->modelViaClass::updateAll(['status_read' => $this->modelClass::STATUS_READ_OLD], $where);\n }\n }",
"public function markAllRead($userId)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_read' => 1\n ], [\n 'user_id' => $userId,\n 'is_read' => 0\n ])\n ->execute();\n }",
"function markAllUserNotificationsAsRead( $userID ) {\n\tglobal $ftsdb;\n\n\t$result = $ftsdb->update( DBTABLEPREFIX . 'notifications',\n\t\tarray( 'read' => 1 ),\n\t\t\"user_id = :user_id\",\n\t\tarray(\n\t\t\t\":user_id\" => $userID,\n\t\t) );\n\n\treturn $result;\n}",
"function mark_unread()\n\t{\n\t\tif (!isset($this->get['m'])) {\n\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\treturn $this->message($this->lang->pm_personal_msging, $this->lang->pm_no_number);\n\t\t}\n\n\t\t$this->get['m'] = intval($this->get['m']);\n\n\t\t$this->db->query( 'UPDATE %ppmsystem SET pm_read=0 WHERE pm_id=%d AND pm_to=%d', $this->get['m'], $this->user['user_id'] );\n\n\t\treturn $this->message($this->lang->pm_personal_msging, $this->lang->pm_mark_unread);\n\t}",
"public function markAsRead()\n {\n if ($this->auth->alerts_unread) {\n $this->alert->where('user_id', $this->userId)->whereNull('read_at')->update([\n 'read_at' => Carbon\\Carbon::now()\n ]);\n }\n\n $this->alert->where('user_id', $this->userId)->update(['is_marked' => true]);\n }",
"public function markAllAsReadForUser($userId);",
"public function markAllAsReadForUser($userId);",
"public function saveItems(array $items): bool;",
"public function mark_read($args)\n {\n // Security check\n if (!SecurityUtil::checkPermission('InterCom::', '::', ACCESS_READ)) {\n return LogUtil::registerPermissionError();;\n }\n\n if (!isset($args['msg_id']) || !is_numeric($args['msg_id'])) {\n return LogUtil::registerArgsError;\n }\n\n $args['msg_read'] = 1;\n DBUtil::updateObject($args, 'intercom', '', 'msg_id');\n return true;\n }",
"public function markAllRead($userId);",
"public function markItem($itemHash, $starred, $feed = false, $item = false) {\n $save = false;\n $feeds = $this->getFeeds();\n $feedHash = substr($itemHash, 0, 6);\n $items = $this->getItems();\n\n if (isset($items[$itemHash]) && $starred === 0) {\n $save = true;\n unset($items[$itemHash]);\n unset($GLOBALS['starredItems'][$itemHash]);\n if (isset($feeds[$feedHash])){\n unset($feeds[$feedHash]['items'][$itemHash]);\n $feeds[$feedHash]['nbAll']--;\n if ($feeds[$feedHash]['nbAll'] <= 0) {\n unset($feeds[$feedHash]);\n }\n }\n } else if (!isset($items[$itemHash]) && $starred === 1) {\n // didn't exists, want to star it\n $save = true;\n\n $items[$itemHash] = [time(), 0];\n\n if (!isset($feeds[$feedHash])){\n $feed['nbAll'] = 0;\n $feed['items'] = array();\n // remove useless feed information\n unset($feed['timeUpdate']);\n unset($feed['nbUnread']);\n unset($feed['lastUpdate']);\n unset($feed['foldersHash']);\n unset($feed['error']);\n $feeds[$feedHash] = $feed;\n }\n \n $feeds[$feedHash]['items'][$itemHash] = $item;\n $feeds[$feedHash]['nbAll']++;\n\n $GLOBALS['starredItems'][$itemHash] = 1;\n }\n\n if ($save) {\n arsort($items);\n $this->setItems($items);\n $this->setFeeds($feeds);\n }\n\n return $save;\n }",
"function mark_read()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_start');\n\n $read=$this->get_input_vals();\n\n $this->message_model->save_read($read['uid'],$read['mid'],1);\n\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_end');\n\n // success\n exit();\n }",
"public function markRead($alerts = '')\n\t{\n\t\tif (is_array($alerts))\n\t\t{\n\t\t\t$alerts = array_map('intval', $alerts);\n\t\t\t$alerts = \"'\".my_strtolower(implode(\"','\", $alerts)).\"'\";\n\t\t}\n\n\t\treturn $this->db->update_query('alerts', array('unread' => '0'), 'id IN('.$alerts.') AND uid = '.$this->mybb->user['uid']);\n\t}",
"public function markAsRead($notifications);",
"public function markasread()\n { \n if(Session::has('prac_id'))\n {\n $viewer = Practitioner::find(Session::get('prac_id'));\n }\n elseif(Auth::check())\n {\n $viewer = User::find(Auth::user()->id);\n }\n\n $messages = Message::GetMessageById(Input::get('conv_id'))->get();\n\n foreach($messages as $message)\n {\n if($message->receiver_email === $viewer->email)\n {\n if($message->status === 'unread')\n {\n $message->status = 'read';\n $message->save();\n }\n\n } \n }\n\n return $messages;\n }",
"public function MarkAllItemsAsRead($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"function add_mark($userId, $messages, $action)\n\t{\n\t\tlog_message('debug', '_message/add_mark');\n\t\tlog_message('debug', '_message/add_mark:: [1] userId='.$userId.' message='.json_encode($messages).' action='.$action);\n\n\t\t# Mark message as read\n\t\tif($action == 'read'){\n\t\t\t$results = array();\n\t\t\tforeach($messages AS $messageId) array_push($results, $this->_query_reader->run('add_message_status', array('message_id'=>$messageId, 'user_id'=>$userId, 'status'=>'read')));\n\n\t\t\t$result = get_decision($results);\n\t\t}\n\n\t\t# Collect any store in the selected messages and record as the user's favorite\n\t\telse if($action == 'favorite'){\n\t\t\t$messageFavorites = $this->_query_reader->run('extract_favorites_from_messages', array('user_id'=>$userId, 'messages'=>implode(\"','\",$messages) ));\n\n\t\t\tif(!empty($messageFavorites)) $result = server_curl(MYSQL_SERVER_URL, array('__action'=>'add_store_favorites_from_messages', 'return'=>'plain', 'list'=>$messageFavorites));\n\t\t}\n\n\t\tlog_message('debug', '_message/add_mark:: [2] result='.$result);\n\t\treturn array('result'=>(!empty($result) && $result? 'SUCCESS': 'FAIL'));\n\t}",
"public function markRead()\n\t{\n\t\tif(Request::ajax())\n\t\t{\n\t\t\t$ids = Input::get('_ids');\n\t\t\t$user = UserController::getUser(Auth::user());\n\n\t\t\tforeach ($ids as $value)\n\t\t\t{\n\t\t\t\t$message = $user->messages()->find($value);\n\t\t\t\t\n\t\t\t\tif($message->read === false)\n\t\t\t\t{\n\t\t\t\t\t$message->read = true;\n\t\t\t\t\t$message->save();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\treturn Response::json(\"00\");\n\t\t}\n\t}",
"public function action_mark_all_as_read() {\n\t\tif($this->request->param('id')) {\n\t\t\t$sender = ORM::factory(\"User\", $this->request->param('id'));\n\t\t\t$messages = ORM::factory('Message')->where(\"sender\", '=', $sender->id)->find_all();\n\t\t\tforeach ($messages as $message) {\n\t\t\t\t$model = ORM::factory('Message', $message->message_id);\n\t\t\t\ttry {\n\t\t\t\t\t$model->read = 1;\n\t\t\t\t\t$model->save();\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\t$this->_set_msg('Failed to mark as read', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_set_msg(\"All conversations with \" . $sender->personnel_info->personnel_name . ' were marked as Read',\n\t\t\t'success');\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t}",
"function setState( $items, $state )\r\n\t{\r\n\t\tglobal $mainframe;\r\n\t\t$db\t=& $this->getDBO();\r\n\r\n\t\tJTable::addTableDir(JPATH_COM_JPACKAGEDIR);\r\n\t\t$row = & JTable::getInstance('PackageDirPackages', $db);\r\n\r\n\t\tforeach ($items as $id) {\r\n\t\t\t$row->load( $id );\r\n\t\t\t$row->published = $state;\r\n\r\n\t\t\tif (!$row->check()) {\r\n\t\t\t\t$this->setError($row->getError());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (!$row->store()) {\r\n\t\t\t\t$this->setError($row->getError());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function setMulti(array $items, int $expire = 0): array\n {\n // this same request, we get the value we just set\n $success = $this->local->setMulti($items, $expire);\n\n // only attempt to store those that we've set successfully to local\n $successful = array_intersect_key($items, $success);\n if (!empty($successful)) {\n $this->defer->setMulti($successful, $expire);\n }\n\n return $success;\n }",
"public function setNotificationsAsRead() {\n \tif (Auth::check()) {\n \t\tforeach (Auth::user()->unreadNotifications as $notification) {\n \t\t\t$notification->markAsRead();\n \t\t}\n \t\treturn response(null,200);\n \t} else {\n \t\treturn response(null, 403);\n \t}\n }",
"function setItems($items);",
"public function mark_as_read($read_id){\n\n\t\t$this->query(\"UPDATE `messege` SET `view` = 1 WHERE `id` = '$read_id'\");\n\t}",
"public function markAllAsRead()\n {\n if ( $this->hasError() ) return false;\n \n try {\n $this->user->unreadNotifications->markAsRead(); \n } catch ( \\Exception $e ) {\n $this->setError('Could not mark the users notifications as read.', 500);\n return false;\n }\n\n $this->setSuccess('Successfully marked the users notifications as read.', 200);\n \n return true;\n }"
] |
[
"0.6061309",
"0.59479",
"0.594371",
"0.5934722",
"0.5815669",
"0.5790325",
"0.57136",
"0.5672059",
"0.56290174",
"0.56028837",
"0.5565506",
"0.5565506",
"0.5552286",
"0.5537661",
"0.5530963",
"0.55258775",
"0.5424702",
"0.5415392",
"0.54062784",
"0.53756803",
"0.53538954",
"0.53394544",
"0.5300579",
"0.525304",
"0.52484095",
"0.52407444",
"0.5190852",
"0.5157758",
"0.5155268",
"0.5148617"
] |
0.8358273
|
0
|
/ db_feeds_in_group Given a(n integer) gid, return a list of all the feeds that are in that group, including its descendents.
|
function db_feeds_in_group($gid)
{
$groups = db_get_groups();
// XXX - For now, we don't really support nested groups well
// (there's no interface for nesting groups), so just assume
// a flat structure, and return the members.
if (!isset($groups[$gid]))
{
return NULL;
}
$retval = $groups[$gid]['members'];
return $retval;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function db_get_feeds($inactive = FALSE)\n{\n\tglobal $STALE_DAYS;\n\n\t$dbh = db_connect();\n\n\t$query = sprintf(<<<EOT\nSELECT\t*,\n\tUNIX_TIMESTAMP(last_update) as unix_last_update,\n\tIF(DATEDIFF(NOW(),\n\t\t IFNULL(last_update, '1970-01-01')) > %d, 1, 0) as stale\nFROM\tfeeds\nEOT\n\t\t,\n\t\t$STALE_DAYS);\n\tif (!$inactive)\n\t\t$query .= \"\\nWHERE active\";\n\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\n\t$retval = array();\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t$row['active'] = $row['active'] ? TRUE : FALSE;\n\t\t\t# Make sure 'active' is properly boolean\n\t\t$retval[$row['id']] = $row;\n\t}\n\n\t// Also look up any entries in group_members: tell us which\n\t// groups a feed is in.\n\t$query = \"SELECT * FROM `group_members`\";\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\n\twhile (list($member, $parent) = $result->fetch_row())\n\t{\n\t\tif (!isset($retval[$member]))\n\t\t\tcontinue;\n\t\t$retval[$member]['groups'][] = $parent;\n\t}\n\n\treturn $retval;\n}",
"function feed_group_load_all($reload = FALSE) {\r\n $feed_groups = drupal_static(__FUNCTION__);\r\n\r\n if ($reload || !isset($feed_groups)) {\r\n $feed_groups = db_query('SELECT * FROM {feed_group} WHERE 1 = 1')->fetchAllAssoc('fgid');\r\n }\r\n return $feed_groups;\r\n}",
"function db_get_feed($id)\n{\n\tglobal $STALE_DAYS;\n\n\t$dbh = db_connect();\n\n\t$query = sprintf(<<<EOT\nSELECT\t*,\n\tUNIX_TIMESTAMP(last_update) as unix_last_update,\n\tIF(DATEDIFF(NOW(),\n\t\t IFNULL(last_update, '1970-01-01')) > %d, 1, 0) as stale\nFROM\t`feeds`\nWHERE\tid = %d\nEOT\n\t\t,\n\t\t$STALE_DAYS,\n\t\t$id);\n\t$result = $dbh->query($query);\n\tif ($result->num_rows <= 0)\n\t\t// No matching feeds\n\t\treturn NULL;\n\t$row = $result->fetch_assoc();\n\t$retval = $row;\n\n\t// Also look up any entries in group_members: tell us which\n\t// groups the feed is in.\n\t$retval['groups'] = array();\n\t$query = sprintf(<<<EOT\nSELECT\tparent\nFROM\t`group_members`\nWHERE\tmember=%d\nEOT\n\t\t,\n\t\t$id);\n\t$result = $dbh->query($query);\n\twhile ($row = $result->fetch_row())\n\t{\n\t\t$retval['groups'][] = $row[0];\n\t}\n\n\treturn $retval;\n}",
"function feed_group_load($fgid, $reload = FALSE) {\r\n $feed_groups = &drupal_static(__FUNCTION__);\r\n \r\n if (!isset($feed_groups)) {\r\n $feed_groups = array();\r\n }\r\n if ($reload || !isset($feed_groups[$fgid])) {\r\n $feed_groups[$fgid] = db_query('SELECT * FROM {feed_group} WHERE fgid = :fgid', array(':fgid' => $fgid))->fetchObject();\r\n }\r\n return $feed_groups[$fgid];\r\n}",
"function feed_access_feeds($user = NULL) {\r\n if (!$user) {\r\n global $user;\r\n }\r\n $fids = &drupal_static(__FUNCTION__);\r\n \r\n if (!isset($user->uid)) {\r\n return array();\r\n }\r\n if (!isset($fids[$user->uid])) {\r\n $fids[$user->uid] = db_select('feed', 'f')\r\n ->fields('f', array('fid'))\r\n ->condition('f.uid', $user->uid)\r\n ->execute()->fetchAllKeyed(0, 0);\r\n }\r\n return $fids[$user->uid];\r\n}",
"function db_get_group($gid)\n{\n\t$dbh = db_connect();\n\n\t$query = sprintf(\"SELECT * FROM `groups` WHERE id=%d\",\n\t\t\t $gid);\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 = $result->fetch_assoc();\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$query = sprintf(\"SELECT * FROM `group_members` WHERE parent=%d\",\n\t\t\t $gid);\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\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t$retval['members'][] = $row['member'];\n\t}\n\treturn $retval;\n}",
"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}",
"function getEntryIterator($gid=null) {\n if($gid !== null) {\n $gid = (int) $gid;\n }\n else {\n $gid = $this->gid;\n }\n\n //@todo: transfer to a DAO\n $qry = ' SELECT * FROM plugin_phpwiki_group_list'\n .' WHERE group_id='.db_ei($gid)\n .' ORDER BY rank';\n \n $res = db_query($qry);\n\n $weArray = array();\n while($row = db_fetch_array($res)) {\n $we = new PHPWikiEntry();\n $we->setFromRow($row);\n $weArray[] =& $we;\n unset($we);\n }\n\n return new ArrayIterator($weArray);\n }",
"static public function readFeGroupsRecords ()\n {\n $result = false;\n $feGroups = static::fetchFeGroups();\n\n if (!empty($feGroups)) {\n $feGroupList = implode(',', $feGroups);\n $where_clause = 'uid IN (' . $feGroupList . ')';\n $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n '*',\n 'fe_groups',\n $where_clause\n );\n }\n return $result;\n }",
"public static function get_eid_list_group($gid) \n\t\t{\n\t\t\t$event_ids = array();\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('SELECT eid FROM group2event WHERE gid=? AND role>=? ORDER BY mtime DESC LIMIT 1000;');\n\t\t\t$role = Role::Admin;\n\t\t\t$stmt->bind_param('ii', $gid, $role);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result();\n\t\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t\tarray_push($event_ids, $row['eid']);\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t\treturn $event_ids;\n\t\t}",
"public function get_grouplist($inc_global = 0, $pattern = '', $num = 0, $start = 0)\n {\n $return = array();\n $q_r = '';\n $q_l = 'SELECT g.gid, g.name, COUNT(ag.aid) adrcount, g.owner FROM '.$this->Tbl['adb_group'].' g LEFT JOIN '.$this->Tbl['adb_adr_group'].' ag ON ag.gid = g.gid';\n $q_l .= ($inc_global) ? ' WHERE g.owner IN('.$this->uid.',0)' : ' WHERE g.owner='.$this->uid;\n if ($num != 0) {\n $q_r .= ' LIMIT ' . intval($start) . ',' . intval($num);\n }\n $qid = $this->query($q_l . ' GROUP BY g.gid ORDER BY IF(g.`owner`!= 0, 0, 1) ASC, g.`name`' . $q_r);\n while ($line = $this->assoc($qid)) {\n $line['is_shared'] = !empty($this->allShares[$line['gid']]) ? '1' : '0';\n $return[] = $line;\n }\n return $return;\n }",
"public function getGroupsFromDatabase() {\n $db = \\Helper::getDB();\n $db->join('groups g', 'gd.groupId = g.id', 'LEFT');\n $db->where('gd.documentId', $db->escape($this->getId()));\n $groups = $db->get('group_documents gd', NULL, 'g.*');\n $this->groups = array();\n\n // Process all groups\n foreach($groups as $group) {\n $newGroup = new \\Models\\Group($group['id'], $group['name']);\n $this->addGroup($newGroup);\n }\n }",
"public function findByGroup($group_id) {\n $connection = $this->connect();\n\n if (!$connection) {\n return false;\n }\n\n try {\n $sql = \"SELECT DISTINCT `entry`.`entry_id`, `entry`.`name`, `entry`.`first_name`, `entry`.`street`, `entry`.`zip_code`, `entry`.`city_id`, MIN(`entry`.`is_inherited`) AS 'is_inherited'\n FROM\n (SELECT `entry`.*, 0 AS 'is_inherited'\n FROM `entry` INNER JOIN `group_entry` ON `entry`.`entry_id` = `group_entry`.`entry_id`\n WHERE `group_entry`.`group_id` = $group_id\n UNION\n\n SELECT DISTINCT `entry`.*, 1 AS 'is_inherited'\n FROM `entry` INNER JOIN `group_entry` ON `entry`.`entry_id` = `group_entry`.`entry_id`\n INNER JOIN `group_connector` ON `group_entry`.`group_id` = `group_connector`.`parent_group_id`\n WHERE `group_connector`.`child_group_id` = $group_id) AS `entry`\n GROUP BY `entry`.`entry_id`\n ORDER BY `entry`.`is_inherited`, `entry`.`entry_id`\n \";\n\n $query = $connection->prepare($sql); \n $query->execute();\n\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n\n return $result;\n\n } catch(PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n }\n }",
"public function fetchByGroup($group, $limit = 6)\n {\n return $this->prepareResults($this->wallpaperMapper->fetchByGroup($group, $limit));\n }",
"public function getDescendants($idEntry = 0);",
"public static function get_by_group(Group_DO $group){\n \n global $wpdb;\n $collections = array();\n \n $sql = \"SELECT id FROM \" . self::get_table_name() . \" WHERE group_id=\" \n . $group->get_id();\n \n $results = $wpdb->get_results($sql);\n \n foreach( $results as $row ){\n $collections[$row->id] = new Affiliation_Collection_DO($row->id);\n }\n \n return $collections;\n }",
"public function thatAreInGroup($groupId)\n {\n return DateHistory::where('type', 'group_id')\n ->where('value', $groupId)\n ->get()->lists('member_id')->all();\n }",
"static public function fetchFeGroups ()\n {\n $result = [];\n\n if (\n isset($GLOBALS['TSFE']->fe_user) &&\n isset($GLOBALS['TSFE']->fe_user->user) &&\n isset($GLOBALS['TSFE']->fe_user->user['usergroup'])\n ) {\n $result = explode(',', $GLOBALS['TSFE']->fe_user->user['usergroup']); \n }\n return $result;\n }",
"public function getFeeds() {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('feed', 'getAll');\t\t\n\t\t$stm->execute();\n\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$feeds = array();\n\t\twhile($row = $stm->fetchObject()) {\n\t\t\t$feeds[] = $row;\n\t\t}\n\t\treturn $feeds;\n\t}",
"public function get_grouplist($inc_global = 0, $pattern = '', $num = 0, $start = 0)\n {\n $return = array();\n\n $groupsUser = !empty($this->principalId) ? $this->principalId : $this->uid;\n\n $sqlGroupFilter = $this->getGroupAndShareFilter(null, 'g', false);\n if (!empty($sqlGroupFilter)) {\n $sqlGroupFilter = ' OR '.$sqlGroupFilter;\n }\n $query = 'SELECT g.`gid`, g.`name`, g.`type`, g.`owner`, fs.`val` `colour`, g.`rw`, u.username FROM '.$this->Tbl['cal_group'].' g'.\n ' LEFT JOIN '.$this->Tbl['user'].' u ON u.uid=g.owner'.\n ' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=g.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid.\n ' WHERE (g.owner'.($inc_global ? ' IN('.$groupsUser.',0)' : '='.$groupsUser).\n $sqlGroupFilter.')';\n if (!empty($pattern)) {\n $query .= ' AND `name` LIKE \"%'.$this->esc($pattern).'%\"';\n }\n $query .= ' GROUP BY g.gid ORDER BY g.name, g.owner';\n if ($num != 0) {\n $query .= ' LIMIT ' . doubleval($start) . ',' . doubleval($num);\n }\n $qid = $this->query($query);\n while ($line = $this->assoc($qid)) {\n $line['is_shared'] = !empty($this->allShares[$line['gid']]) ? '1' : '0';\n $return[] = $line;\n }\n return $return;\n }",
"public static function getGroupData($gid);",
"function group_get_admin_ids($groupid) {\n return (array)get_column_sql(\"SELECT member\n FROM {group_member}\n WHERE \\\"group\\\" = ?\n AND role = 'admin'\", $groupid);\n}",
"private function ldap_get_group_members_ad($groupfilter) {\n global $CFG;\n\n $ret = array();\n $ldapconnection = $this->ldap_connect();\n if (!$ldapconnection) {\n return $ret;\n }\n\n $queryg = \"(&({$this->config['syncgroupsgroupattribute']}=\" . $this->filter_addslashes(trim($groupfilter)) . \")(objectClass={$this->config['syncgroupsgroupclass']}))\";\n\n // The paging increment\n $size = 999;\n\n $contexts = $this->get_group_contexts();\n\n foreach ($contexts as $context) {\n $context = trim($context);\n if (empty ($context)) {\n continue;\n }\n $start = 0;\n $end = $size;\n $fini = false;\n\n while (!$fini) {\n //page the search by increments of $size\n $attribut = $this->config['syncgroupsmemberattribute'] . \";range=\" . $start . '-' . $end;\n\n if ($this->config[$this->config['syncgroupssearchsub']] == 'yes') {\n $resultg = ldap_search($ldapconnection, $context, $queryg, array($attribut));\n }\n else {\n $resultg = ldap_list($ldapconnection, $context, $queryg, array($attribut));\n }\n\n if ($resultg !== false && ldap_count_entries($ldapconnection, $resultg)) {\n $groupe = ldap_get_entries($ldapconnection, $resultg);\n\n // On the final page, AD returns \"member;range=number-*\" !!!\n if (empty($groupe[0][strtolower($attribut)])) {\n $attribut = $this->config['syncgroupsmemberattribute'] . \";range=\" . $start . '-*';\n $fini = true;\n }\n\n for ($g = 0; $g < (count($groupe[0][strtolower($attribut)]) - 1); $g++) {\n $membre = trim($groupe[0][strtolower($this->config['syncgroupsmemberattribute'])][$g]);\n if (empty($membre)) {\n continue;\n }\n if (!$this->config['syncgroupsmemberattributeisdn']) {\n $ret[] = $membre;\n }\n else {\n //rev 1.2 nested groups\n if ($this->config['syncgroupsnestedgroups'] && ($group_cn = $this->is_ldap_group($membre))) {\n // in case of funny directory where groups are member of groups\n if (array_key_exists($membre,$this->anti_recursion_array)) {\n unset($this->anti_recursion_array[$membre]);\n continue;\n }\n //recursive call\n $this->anti_recursion_array[$membre] = 1;\n $tmp = $this->ldap_get_group_members_ad ($group_cn);\n unset($this->anti_recursion_array[$membre]);\n $ret = array_merge($ret,$tmp);\n }\n else {\n $membre = $this->get_username_from_dn($membre);\n if ($membre) {\n $ret[] = $membre;\n }\n }\n }\n }\n }\n else {\n $fini = true;\n }\n $start = $start + $size;\n $end = $end + $size;\n }\n }\n $this->ldap_close($ldapconnection);\n return $ret;\n }",
"public function selectUserIDsFromGroup($groupID, $everyone)\n {\n $query = \"select uid from appuser_group_link where gid=$1\";\n if (! $everyone) {\n /*\n * Must join with appuser to get only active users.\n *\n * Table names are not necessary in the select or where clause. The field names are\n * unique. However, explicitly using table names (or the alias agl) makes the intent clear.\n */\n $query = \"select agl.uid from appuser_group_link as agl, appuser where gid=$1 and agl.uid=appuser.id and appuser.active\";\n }\n $result = $this->sdb->query($query,\n array($groupID));\n $all = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row['uid']);\n }\n return $all;\n }",
"function cata_getallgroups_treeview(&$ar, $idgroup, $depthlimit, $idgroupstop, $depth=1)\n{\n\n\tglobal $db;\n\t$groups = array();\n\n\t$select = \"SELECT * FROM dims_group WHERE system = 0 ORDER BY label\";\n\t$result = $db->query($select);\n\twhile ($fields = $db->fetchrow($result))\n\t{\n\t\t$groups[$fields['id_group']][$fields['id']] = $fields;\n\t}\n\n\treturn(cata_getallgroupsrec($ar, $groups, $idgroup, $depthlimit, $idgroupstop, $depth));\n}",
"private function getResultsIDs($gid)\n\t{\n\t\t$arr = array();\n\t\t$sid = $_SESSION['uid'];\n\t\t$db = Db::getLink();\n\t\t$stmt = $db->prepare(\n\t\t\t\"SELECT `results`.`id`, `assessment`.`isDraft`\n\t\t\tFROM `results`\n\t\t\tLEFT JOIN `assessment` ON `assessment`.`id` = `results`.`aid`\n\t\t\tWHERE `results`.`sid` = ? AND `assessment`.`moid` IN\n\t\t\t(SELECT `group`.`moid` FROM `group` WHERE `group`.`id` = ?);\"\n\t\t);\n\t\t$stmt->bind_param('ii', $sid, $gid);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($id, $isDraft);\n\t\twhile ($stmt->fetch()) {\n\t\t\tif($isDraft) {\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$arr[$id] = $id;\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}",
"public function getMembers($group_id);",
"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}",
"function &getByGroup( $id )\n {\n $this->dbInit();\n $link_array = array();\n $return_array = array();\n \n $this->Database->array_query( $link_array, \"SELECT ID FROM eZLink_Link WHERE LinkGroup='$id' AND Accepted='Y' ORDER BY Title\" );\n\n for( $i=0; $i < count( $link_array ); $i++ )\n {\n $return_array[] = new eZLink( $link_array[$i][ \"ID\" ] );\n }\n\n\n return $return_array;\n }",
"function fetchAllGroups() {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT\n id,\n name,\n is_default,\n can_delete,\n home_page_id\n FROM \".$db_table_prefix.\"groups\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $id = $r['id'];\n $results[$id] = $r;\n }\n $stmt = null;\n\n return $results;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}"
] |
[
"0.65188277",
"0.6460529",
"0.64511216",
"0.6073584",
"0.59942067",
"0.58752453",
"0.57940614",
"0.56558955",
"0.5587988",
"0.55615884",
"0.5557091",
"0.55240244",
"0.550823",
"0.54978365",
"0.54812676",
"0.54670924",
"0.54343283",
"0.54202896",
"0.53969187",
"0.5367564",
"0.5357152",
"0.5312298",
"0.5273831",
"0.5247945",
"0.5244237",
"0.5208834",
"0.52073157",
"0.52065516",
"0.5204275",
"0.5202664"
] |
0.8108366
|
0
|
/ db_add_group Create a new group. Return its database entry. Default parent is 1, the root group.
|
function db_add_group($name, $parent = -1)
{
$dbh = db_connect();
// Create the group
$query = "INSERT INTO `groups` (parent, name) VALUES (?,?)";
$stmt = $dbh->prepare($query);
$result = $stmt->bind_param("is", $parent, $name);
$result = $stmt->execute();
$stmt->close();
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
// Invert the group ID: auto_increment gives it a positive
// value, but we want a negative one.
$result = $dbh->query("UPDATE groups SET id = -id WHERE id = last_insert_id()");
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
// Fetch the group info so we can return it to the caller.
$result = $dbh->query("SELECT * FROM groups WHERE id = -last_insert_id()");
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
$row = $result->fetch_assoc();
return $row;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createGroupAction() {\n\t\t$this->group->id_parent = isset($this->data['id_parent']) ? $this->data['id_parent'] : null;\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}",
"static function addGroup($group)\n {\n global $db;\n $id = NULL;\n\n // todo delete\n $group['name'] = $group['text'];\n unset($group['text']);\n try {\n $id = $db->insert('boq_group', $group);\n } catch (\\Exception $exception) {\n Log::write($exception, $db->getLastError());\n }\n\n return $id;\n }",
"function add_group(array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->create($data);\n\t}",
"public function addGroupToGroup($id_parent_grp = 0, $id_child_grp = 0)\n\t{\n\t\t// If id values not 0\n\t\tif($id_parent_grp != 0 && $id_child_grp != 0)\n\t\t{\n\t\t\t// Create a new row\n\t\t\t$row = $this->createRow();\n\t\t\t\n\t\t\t// Set id values\n\t\t\t$row->id_parent_grp = $id_parent_grp;\n\t\t\t$row->id_child_grp = $id_child_grp;\n\t\t\t\n\t\t\t// Add row to database\n\t\t\t$row->save();\n\t\t} // end if\n\t}",
"public static function addNewGroup(string $group_name)\n {\n return self::insertGetId(['name' => $group_name]);\n }",
"function db_group_add_member($group, $member)\n{\n\tif ($group == -1)\n\t\t// Silently succeed. Everything is part of -1.\n\t\treturn TRUE;\n\n\t$dbh = db_connect();\n\n\t$query = \"INSERT INTO `group_members` (member, parent) VALUES (?,?)\";\n\t$stmt = $dbh->prepare($query);\n\t$result = $stmt->bind_param(\"ii\", $member, $group);\n\t$result = $stmt->execute();\n\t$stmt->close();\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\t// Success\n\treturn TRUE;\n}",
"public function add() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\t$this['uid'] = $GLOBALS['TYPO3_DB']->sql_insert_id($res);\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addGroup', 'Added Group '.$data['name']);\n\t\t} else {\n\t\t\tthrow new Exception('Error adding group: ' . $data['name']);\n\t\t}\n\t\treturn($this['uid']);\n\t}",
"function group_add_group($parent,$child){\n\n //find the parent group's dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]==NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n //find the child group's dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]==NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $child_dn;\n \n $result=@ldap_mod_add($this->_conn,$parent_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }",
"public function addGroup(Group $group);",
"function &newGroup($name, $parent = GROUP_ROOT)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }",
"function add_group() {\n $this->acl->validate_update();\n\n $where = array(\n 'user_id' => $this->input->post('user_id'),\n 'group_id' => $this->input->post('group_id')\n );\n // Insert or update, to minimize redundancy\n list($flag, $msg) = $this->m_general->insert_update('users_group', $this->input->post(), $where);\n\n return JSONRES($flag, $msg);\n }",
"public function add()\n {\n $group = $this->Groups->newEntity();\n if ($this->request->is('post') && !empty($this->request->data)) {\n $this->Groups->patchEntity($group, $this->request->data);\n if ($this->Groups->save($group)) {\n $this->Flash->success(__d('wasabi_core', 'The group <strong>{0}</strong> has been created.', $this->request->data['name']));\n $this->redirect(['action' => 'index']);\n return;\n } else {\n $this->Flash->error($this->formErrorMessage);\n }\n }\n $this->set('group', $group);\n }",
"public function group_add_group($parent,$child){\n\n // Find the parent group's dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]===NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n // Find the child group's dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]===NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $child_dn;\n \n $result=@ldap_mod_add($this->_conn,$parent_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }",
"public function add_group($data) {\n\t\t$this->db->insert('group', $data);\n\t\treturn ($data['groupUuid']);\t\n\t}",
"function addGroupHandler() {\n global $inputs;\n\n $lastId = insert('group',[\n 'admin_id' => getLogin()['uid'],\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ]);\n\n formatOutput(true, 'add success');\n}",
"function createGroup($_name,$_owner) {\n $group = R::dispense('groups');\n $group->name = $_name;\n $group->owner = $_owner;\n $id = R::store($group);\n \n $groupMembers = R::dispense('groupmembers');\n $groupMembers->member_id = $_SESSION['user_id'];\n $groupMembers->group_id = $id;\n R::store($groupMembers);\n \n return $id;\n}",
"function groups_create_grouping($data) {\n global $CFG;\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n\n $id = insert_record('groupings', $data);\n\n if ($id) {\n //trigger groups events\n $data->id = $id;\n events_trigger('groups_grouping_created', stripslashes_recursive($data));\n }\n\n return $id;\n}",
"public function addGroup($name);",
"public function actionAddGroup()\n {\n echo \"Create an user group ...\\n\";\n $name = trim($this->prompt('Group name (max length 32 varchar):'));\n $desc = trim($this->prompt('Group description (max length 255 varchar):'));\n if ($name && $this->confirm(\"Are your sure to create an user group?\")) {\n if (DIRECTORY_SEPARATOR === '\\\\') {\n $name = iconv('GBK','UTF-8//IGNORE', $name);\n $desc = iconv('GBK','UTF-8//IGNORE', $desc);\n }\n $model = Yii::$app->menuManager->addGroup($name, $desc);\n if ($model->hasErrors()) {\n echo join(',', $model->getFirstErrors()) . \"\\n\";\n return self::EXIT_CODE_ERROR;\n }\n echo \"Success.\\n\";\n return self::EXIT_CODE_NORMAL;\n }\n echo \"Canceled!\\n\";\n return self::EXIT_CODE_NORMAL;\n }",
"function CreateGroup ($name, $description, $grouptype, $parentgroupid, $autocreateapps = 'False') {\n $path = REST_PATH . 'groups.xml';\n \n $name = filter_var($name, FILTER_SANITIZE_STRING);\n $description = filter_var($description, FILTER_SANITIZE_STRING); \n\n // Setup the POST NAME/VALUE pairs\n $postdata = http_build_query(\n array(\n 'Name' => $name,\n 'GroupType' => $grouptype,\n\t'Description' => $description,\n\t'ParentGroupId' => $parentgroupid,\n\t'AutoCreateApplications' => $autocreateapps\n )\n );\n\n // Call Rest API\n $result = CallRestApi($path, $postdata, 'POST');\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n\n // Get the Group ID\n $newGroupId = $xml->Group->Id;\n\n if ($newGroupId == '')\n $newGroupId = -1;\n\n return $newGroupId;\n}",
"function groups_create_group($data, $um=false) {\n global $CFG;\n require_once(\"$CFG->libdir/gdlib.php\");\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n $id = insert_record('groups', $data);\n\n if ($id) {\n $data->id = $id;\n if ($um) {\n //update image\n if (save_profile_image($id, $um, 'groups')) {\n set_field('groups', 'picture', 1, 'id', $id);\n }\n $data->picture = 1;\n }\n\n //trigger groups events\n events_trigger('groups_group_created', stripslashes_recursive($data));\n }\n\n return $id;\n}",
"function CreateGroup(){\n $grpname = \"\"; $grpdesc=\"\";\n extract($_POST);\n $grpid = $this->generateGuid();\n $vs = [$grpname, $grpid, $grpdesc];\n $f = array(\"grpname\", \"grpid\", \"grpdesc\");\n $cg = $this->Insert($this->grptable, $f, $vs);\n return $cg;\n }",
"public function createGroup() {\n\t\t$groupName = Input::get('addGrp');\n\t\ttry{\n\t\t\tProjectHandler::createGroup($groupName);\n\t\t\tProjectHandler::grantUser(Auth::user(), $groupName, Roles::PROJECT_ADMIN);\n\t\t\treturn Redirect::back()\n\t\t\t\t->with('flashSuccess', 'Group <b>'.$groupName.'</b> succesfully created!');\t\t\t\n\t\t} catch(\\Cartalyst\\Sentry\\Groups\\GroupExistsException $e) {\n\t\t\treturn Redirect::back()\n\t\t\t->with('flashError', 'Group <b>'.$groupName.'</b> already exists!');\n\t\t}\n\t}",
"public function add()\n {\n if ($this->request->is('post')) {\n $this->Group->create();\n if ($this->Group->save($this->request->data)) {\n $this->Flash->success(__('The group has been created'));\n\n // redirect to page index\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->error(\n __('The group could not be saved. Please, try again.')\n );\n }\n }",
"function group_create($data) {\n if (!is_array($data)) {\n throw new InvalidArgumentException(\"group_create: data must be an array, see the doc comment for this \"\n . \"function for details on its format\");\n }\n\n if (!isset($data['name'])) {\n throw new InvalidArgumentException(\"group_create: must specify a name for the group\");\n }\n\n if (!isset($data['grouptype']) || !in_array($data['grouptype'], group_get_grouptypes())) {\n throw new InvalidArgumentException(\"group_create: grouptype specified must be an installed grouptype\");\n }\n\n safe_require('grouptype', $data['grouptype']);\n\n if (isset($data['jointype'])) {\n if (!in_array($data['jointype'], call_static_method('GroupType' . $data['grouptype'], 'allowed_join_types'))) {\n throw new InvalidArgumentException(\"group_create: jointype specified is not allowed by the grouptype specified\");\n }\n }\n else {\n throw new InvalidArgumentException(\"group_create: jointype specified must be one of the valid join types\");\n }\n\n if (!isset($data['ctime'])) {\n $data['ctime'] = time();\n }\n $data['ctime'] = db_format_timestamp($data['ctime']);\n\n if (!is_array($data['members']) || count($data['members']) == 0) {\n throw new InvalidArgumentException(\"group_create: at least one member must be specified for adding to the group\");\n }\n\n $data['public'] = (isset($data['public'])) ? intval($data['public']) : 0;\n $data['usersautoadded'] = (isset($data['usersautoadded'])) ? intval($data['usersautoadded']) : 0;\n\n db_begin();\n\n//Start-Anusha\n /*$id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n ),\n 'id',\n true\n );*/\n\t\n\t//Start -Eshwari added courseoutcome\n\t $id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n\t\t\t'outcome' => $data['outcome'],\n\t\t\t'courseoutcome' => $data['courseoutcome'],\n\t\t\t'coursetemplate' => $data['coursetemplate'],\n\t\t\t'courseoffering' => $data['courseoffering'],\n\t\t\t'parent_group' => $data['parent_group'],\n ),\n 'id',\n true\n );\n//End-Anusha\n\n foreach ($data['members'] as $userid => $role) {\n insert_record(\n 'group_member',\n (object) array(\n 'group' => $id,\n 'member' => $userid,\n 'role' => $role,\n 'ctime' => $data['ctime'],\n )\n );\n }\n\n // Copy views for the new group\n $templates = get_column('view_autocreate_grouptype', 'view', 'grouptype', $data['grouptype']);\n $templates = get_records_sql_array(\"\n SELECT v.id, v.title, v.description \n FROM {view} v\n INNER JOIN {view_autocreate_grouptype} vag ON vag.view = v.id\n WHERE vag.grouptype = 'standard'\", array());\n if ($templates) {\n require_once(get_config('libroot') . 'view.php');\n foreach ($templates as $template) {\n list($view) = View::create_from_template(array(\n 'group' => $id,\n 'title' => $template->title,\n 'description' => $template->description,\n ), $template->id);\n $view->set_access(array(array(\n 'type' => 'group',\n 'id' => $id,\n 'startdate' => null,\n 'stopdate' => null,\n 'role' => null\n )));\n }\n }\n\n $data['id'] = $id;\n handle_event('creategroup', $data);\n db_commit();\n\n return $id;\n}",
"public function addGroup($group) {}",
"function gotravel_mikado_add_admin_group($attributes) {\n\t\t$name = '';\n\t\t$title = '';\n\t\t$description = '';\n\t\t$parent = '';\n\n\t\textract($attributes);\n\n\t\tif(!empty($name) && !empty($title) && is_object($parent)) {\n\t\t\t$group = new GoTravelMikadoGroup($title, $description);\n\t\t\t$parent->addChild($name, $group);\n\n\t\t\treturn $group;\n\t\t}\n\n\t\treturn false;\n\t}",
"function createGroup($args) {\n\t\t$this->editGroup($args);\n\t}",
"public function insert() {\r\n // Does the Group object already have an ID?\r\n if ( !is_null( $this->id ) ) trigger_error ( \"Group::insert(): Attempt to insert a Group object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n // Insert the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $sql = \"INSERT INTO \" . DB_PREFIX . \"groups ( title, dashboard, content, themes, files, settings, users, status ) VALUES ( :title, :dashboard, :content, :themes, :files, :settings, :users, :status )\";\r\n\r\n $st = $conn->prepare( $sql );\r\n $st->bindValue( \"title\", $this->title, PDO::PARAM_STR );\r\n $st->bindValue( \"dashboard\", $this->dashboard, PDO::PARAM_INT );\r\n $st->bindValue( \"content\", $this->content, PDO::PARAM_INT );\r\n $st->bindValue( \"themes\", $this->themes, PDO::PARAM_INT );\r\n $st->bindValue( \"files\", $this->files, PDO::PARAM_INT );\r\n $st->bindValue( \"settings\", $this->settings, PDO::PARAM_INT );\r\n $st->bindValue( \"users\", $this->users, PDO::PARAM_INT );\r\n $st->bindValue( \"status\", $this->status, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $this->id = $conn->lastInsertId();\r\n \r\n $conn = null;\r\n \r\n }",
"function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\n\n\t\tif ($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\tredirect(\"auth\", 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create group form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_group', $this->data);\n\t\t}\n\t}"
] |
[
"0.7333033",
"0.71155393",
"0.71035343",
"0.7098037",
"0.6993216",
"0.6892803",
"0.688731",
"0.6825391",
"0.6755447",
"0.674413",
"0.6715426",
"0.66496253",
"0.65994626",
"0.6589905",
"0.649963",
"0.6450131",
"0.64400595",
"0.6435906",
"0.6424764",
"0.64119023",
"0.6387472",
"0.63851154",
"0.63712853",
"0.6345712",
"0.6337247",
"0.6334532",
"0.6325353",
"0.6303145",
"0.6299371",
"0.6276056"
] |
0.82025546
|
0
|
/ db_update_group_info Similar to db_update_feed_info(): $gid is the ID of a group to modify. $fields is an array (hash) of field => new_value pairs.
|
function db_update_group_info($gid, $fields)
{
$dbh = db_connect();
/* Get info about existing feed */
$old = db_get_group($gid);
if ($old === NULL)
// No such feed
return FALSE;
$new = $old;
$updates = array();
$bind_fmt = "";
$bind_values = array();
foreach (array('parent', 'name') as $f)
{
if (array_key_exists($f, $fields))
{
$new[$f] = $fields[$f];
}
}
$query = "UPDATE `groups` SET parent=?, name=? WHERE id=?";
$stmt = $dbh->prepare($query);
$result = $stmt->bind_param("isi",
$new['parent'],
$new['name'],
$gid);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
$result = $stmt->execute();
$stmt->close();
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function update_field_group($field_group)\n {\n }",
"public function update(array $fields)\n\t{\n\t\t// make sure a group id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\t// init the update array\n\t\t$update = array();\n\n\t\t// update name\n\t\tif (array_key_exists('name', $fields) and $fields['name'] != $this->group['name'])\n\t\t{\n\t\t\t// make sure name does not already exist\n\t\t\tif (static::group_exists($fields['name']))\n\t\t\t{\n\t\t\t\tthrow new SentryGroupException(__('sentry::sentry.group_already_exists', array('group' => $fields['name'])));\n\t\t\t}\n\t\t\t$update['name'] = $fields['name'];\n\t\t\tunset($fields['name']);\n\t\t}\n\n\t\tif (array_key_exists('permissions', $fields))\n\t\t{\n\t\t\t$permissions = $this->process_permissions($fields['permissions']);\n\t\t\t$update['permissions'] = json_encode($permissions);\n\t\t\tunset($fields['permissions']);\n\t\t}\n\n\t\tif (empty($update))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$update_group = DB::connection(static::$db_instance)\n\t\t\t->table(static::$table)\n\t\t\t->where('id', '=', $this->group['id'])\n\t\t\t->update($update);\n\n\t\treturn ($update_group) ? true : false;\n\n\t}",
"public function group_data_change($fields)\r\n {\r\n $message = 'Function group_data_change not optimized and should not be called directly in ' .\r\n vB_Types::instance()->getContentTypeTitle($fields['contenttypeid']) .\r\n ' index controller. See vBSphinxSearch_Search_IndexController_Post for example.';\r\n vBSphinxSearch_Core::log_errors($message);\r\n \r\n $this->_content_type_id = $fields['contenttypeid'];\r\n if ($this->_fetch_object_id_list($fields['groupid'], true))\r\n {\r\n return $this->_write_to_queue();\r\n }\r\n return false;\r\n }",
"function acf_update_field_group($field_group)\n{\n}",
"function update($post) {\n\t\tglobal $fmdb, $__FM_CONFIG;\n\t\t\n\t\t/** Validate entries */\n\t\t$post = $this->validatePost($post);\n\t\tif (!is_array($post)) return $post;\n\t\t\n\t\t$exclude = array('submit', 'action', 'group_id', 'AUTHKEY');\n\n\t\t$sql_edit = null;\n\t\t\n\t\tforeach ($post as $key => $data) {\n\t\t\tif (!in_array($key, $exclude)) {\n\t\t\t\t$sql_edit .= $key . \"='\" . sanitize($data) . \"', \";\n\t\t\t}\n\t\t}\n\t\t$sql = rtrim($sql_edit, ', ');\n\t\t\n\t\t// Update the group\n\t\t$old_name = getNameFromID($post['group_id'], 'fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', 'group_', 'group_id', 'group_name');\n\t\t$query = \"UPDATE `fm_{$__FM_CONFIG[$_SESSION['module']]['prefix']}groups` SET $sql WHERE `group_id`={$post['group_id']} AND `account_id`='{$_SESSION['user']['account_id']}'\";\n\t\t$result = $fmdb->query($query);\n\t\t\n\t\tif ($fmdb->sql_errors) {\n\t\t\treturn formatError(_('Could not update the group because a database error occurred.'), 'sql');\n\t\t}\n\t\t\n\t\t/** Return if there are no changes */\n\t\tif (!$fmdb->rows_affected) return true;\n\n//\t\tsetBuildUpdateConfigFlag(getServerSerial($post['group_id'], $_SESSION['module']), 'yes', 'build');\n\t\t\n\t\taddLogEntry(\"Updated {$post['group_type']} group '$old_name' to:\\nName: {$post['group_name']}\\n\" .\n\t\t\t\t\t\"Comment: {$post['group_comment']}\");\n\t\treturn true;\n\t}",
"public function update() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'],'tx_passwordmgr_group'),\n\t\t\t$data\n\t\t);\n\t\t$this->checkAffectedRows('updateGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'updateGroup', 'Update group '.$data['name'].' uid '.$this['uid']);\n\t}",
"function db_update_feed_info($feed_id, $fields)\n{\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_feed($feed_id);\n\tif ($old === NULL)\n\t\t// No such feed\n\t\treturn FALSE;\n\n\t// XXX - some fields are assumed to be HTML and should be\n\t// cleaned up before storing:\n\t//\t- title (127)\n\t//\t- subtitle (127)\n\t//\t- nickname (127)\n\t//\t- description (127)\n\tif (array_key_exists(\"title\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['title'], 127));\n\tif (array_key_exists(\"subtitle\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['subtitle'], 127));\n\tif (array_key_exists(\"nickname\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['nickname'], 127));\n\tif (array_key_exists(\"description\", $fields))\n\t\trun_hooks(\"clean-html\", array(&$fields['description'], 127));\n\n\t/* Go through the fields, and compare them to what's already\n\t * in the database.\n\t */\n\t// Can't use $stmt->bind_param(), because that takes a\n\t// variable number of arguments, and I don't think PHP has the\n\t// equivalent of Lisp's (apply).\n\t// XXX - Actually, see call_user_func_array()\n\n\t// Also, some of the fields require special processing anyway:\n\t// it's not a simple mapping from $feed[X] -> database column\n\t// X.\n\n\t// XXX - Should any of these check to see if the new value is\n\t// empty, and if so, set the column to NULL?\n\t$updates = array();\t\t// Array of changes we're\n\t\t\t\t\t// going to make, as an array\n\t\t\t\t\t// of SQL fragments.\n\t/* Plain string fields */\n\tforeach (array('title', 'subtitle', 'nickname', 'url', 'feed_url',\n\t\t 'description', 'username', 'passwd')\n\t\t as $f)\n\t{\n\t\tif (array_key_exists($f, $fields) &&\n\t\t $fields[$f] != $old[$f])\n\t\t{\n\t\t\tif ($fields[$f] === NULL)\n\t\t\t\t$value = \"NULL\";\n\t\t\telse\n\t\t\t\t$value = \"'\" .\n\t\t\t\t\t$dbh->real_escape_string($fields[$f]) .\n\t\t\t\t\t\"'\";\n\t\t\t$updates[] = \"$f = $value\";\n\t\t}\n\t}\n\n\t/* Boolean fields */\n\tif (array_key_exists('active', $fields) &&\n\t ((bool) $fields['active'] != (bool) $old['active']))\n\t\t// Is this feed active?\n\t\t$updates[] = \"active = \" .\n\t\t\t($fields['active'] ? \"TRUE\" : \"FALSE\");\n\n\t/* Other fields that require special processing */\n\tif (array_key_exists('image', $fields) &&\n\t is_array($fields['image']) &&\n\t array_key_exists('url', $fields['image']) &&\n\t $fields['image']['url'] != $old['image'])\n\t\t// Image associated with the site\n\t\t$updates[] = \"image = '\" .\n\t\t\t$dbh->real_escape_string($fields['image']['url']) .\n\t\t\t\"'\";\n\n// XXX - This function is called\n// a) when the user changes feed information (like title or URL)\n// b) when we update a feed.\n// We don't want to change last_update in either of those cases; we\n// only want to change last_update when an item with a pub_date newer\n// than feeds.last_update comes in.\n// So this is commented out until I'm sure this doesn't break\n// anything.\n//\tif (array_key_exists('last_update', $fields) &&\n//\t $fields['last_update'] > $old['unix_last_update'])\n//\t\t// Last update (time_t)\n//\t\t$updates[] = sprintf(\"last_update = FROM_UNIXTIME(%ld)\", $fields['last_update']);\n\n\t/* Update the database, if necessary */\n\tif (count($updates) > 0)\n\t{\n\t\t$query = sprintf(\"UPDATE `feeds` SET\\n%s\\nWHERE id=%d\",\n\t\t\t\t implode(\",\\n\", $updates),\n\t\t\t\t $feed_id);\n\t\t$result = $dbh->query($query);\n\t\tif (!$result)\n\t\t{\n\t\t\tglobal $db_errno;\n\t\t\t$db_errno = $dbh->errno;\n\t\t\tglobal $db_errmsg;\n\t\t\t$db_errmsg = \"Error setting feed information: \" .\n\t\t\t\t$dbh->error;\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\n\treturn count($updates);\n}",
"function acf_update_field_group( $field_group ) {\n\treturn acf_update_internal_post_type( $field_group, 'acf-field-group' );\n}",
"function update() {\n\t\t$sql = \"UPDATE umgroup \n\t\t\t\tSET\tGpNameT=?, GpNameE=?, GpDesc=?, GpStID=? \n\t\t\t\tWHERE GpID=?\";\t\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID, $this->GpID));\n\n\t}",
"public static function onGroupUpdate($id, $fields)\n {\n static::deleteCacheByTag(static::getCacheTag());\n }",
"function update_group($id, array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->update($id, $data);\n\t}",
"function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_group \n\t \t\t\tSET\tgru_id=?, gru_name=?, gru_head_dept=? \n\t \t\t\tWHERE gru_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->gru_id_new, $this->gru_name, $this->gru_head_dept, $this->gru_id_old));\n\t\t \n\t }",
"public Static function updateUserGroup($gid, $gDesc);",
"function editGroupHandler1() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n ]);\n\n formatOutput(true, 'update success');\n}",
"public function updateData($fields = array()) { \n\t\t$updates = '';\n\t\tforeach ($fields as $key => $value) {\n\t\t\tif (!empty($updates)) $updates .= ',';\n\t\t\t$updates .= $key.'=';\n\t\t\tif (is_int($value)) $updates .= $value;\n\t\t\telse $updates .= \"'\".escapeString($value).\"'\";\n\t\t}\n\t\t\n\t\tif (!empty($updates)) {\n\t\t\t$sql = \"UPDATE\twcf\".WCF_N.\"_linklist_link\n\t\t\t\tSET\t\".$updates.\"\n\t\t\t\tWHERE\tlinkID = \".$this->linkID;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t}",
"function editGroupHandler() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n 'admin_id' => getLogin()['uid']\n ]);\n\n formatOutput(true, 'update success');\n}",
"function updateGroup($groupId, $groupName, $description, $type, $db) {\n strip_tags($groupName);\n strip_tags($description);\n strip_tags($type);\n\n $qString = ('UPDATE groups SET name = :name, description = :description, projectType = :type WHERE id = :groupId');\n $stm = $db -> prepare($qString);\n\n if ($stm -> execute( array(':name' => $groupName, ':description' => $description, ':type' => $type, ':groupId' => $groupId))) {\n if(addToGroup($userId, $db, getGroupId($groupName, $db), true)) {\n echo \"<meta http-equiv='REFRESH' content='0;url=/?page=group'>\";\n } else {\n echo 'couldnt add to group!';\n }\n } else {\n print_r($stm->errorInfo());\n }\n}",
"public function updateData($fields = array()) { \n\t\t$updates = '';\n\t\tforeach ($fields as $key => $value) {\n\t\t\tif (!empty($updates)) $updates .= ',';\n\t\t\t$updates .= $key.'=';\n\t\t\tif (is_int($value)) $updates .= $value;\n\t\t\telse $updates .= \"'\".escapeString($value).\"'\";\n\t\t}\n\t\t\n\t\tif (!empty($updates)) {\n\t\t\t$sql = \"UPDATE\twcf\".WCF_N.\"_linklist_category\n\t\t\t\tSET\t\".$updates.\"\n\t\t\t\tWHERE\tcategoryID = \".$this->categoryID;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t}",
"public static function onAfterGroupUpdate($id, &$fields)\n {\n static::deleteCacheByTag(static::getCacheTag());\n }",
"public function testUpdateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function updateGroup($group)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }",
"function updateObject(&$group) {\n\t\t$returner = $this->update(\n\t\t\t'UPDATE groups\n\t\t\t\tSET\tseq = ?,\n\t\t\t\t\tassoc_type = ?,\n\t\t\t\t\tassoc_id = ?,\n\t\t\t\t\tabout_displayed = ?,\n\t\t\t\t\tcontext = ?,\n\t\t\t\t\tpublish_email = ?\n\t\t\t\tWHERE\tgroup_id = ?',\n\t\t\tarray(\n\t\t\t\t(float) $group->getSequence(),\n\t\t\t\t(int) $group->getAssocType(),\n\t\t\t\t(int) $group->getAssocId(),\n\t\t\t\t(int) $group->getAboutDisplayed(),\n\t\t\t\t(int) $group->getContext(),\n\t\t\t\t(int) $group->getPublishEmail(),\n\t\t\t\t(int) $group->getId()\n\t\t\t)\n\t\t);\n\t\t$this->updateLocaleFields($group);\n\t\treturn $returner;\n\t}",
"public function updateGroup($group_id, array $old_group, array $new_group){\n $this->_errors = array();\n $STH = $this->getHandler();\n $user_id = $this->getUserID();\n \n if ($old_group['members'] != NULL){\n $to_delete = array_diff($old_group['members'], $new_group['members']);\n $to_insert = array_diff($new_group['members'], $old_group['members']);\n } elseif ($old_group['members'] == NULL){\n $to_insert = $new_group['members'];\n $to_delete = NULL;\n } \n \n \n foreach ((array)$to_delete as $index => $to_delete_id){\n $values = array('song_id', '=', ':song_id');\n $where = array(':song_id' => $to_delete_id);\n $STH->delete('groups_lookup', $values, $where);\n }\n \n $name = $new_group['name'];\n $desc = $new_group['desc'];\n $type = $new_group['type'];\n \n $tables = array('groups' => array('group_id', 'group_name', 'group_desc', 'type', 'user_id'),\n 'groups_lookup' => array('group_id', 'song_id', 'user_id')); //List of tables to insert (make sure lookup table is first)\n $groupData = array(':group_id' => $group_id, ':group_name' => $name, ':group_desc' => $desc, ':type' => $type, ':user_id' => $user_id); //IDs and group ids and stuff\n $data['groups'] = $groupData;\n \n foreach ($to_insert as $index => $id){\n $data['groups_lookup'][] = array(':group_id' => $group_id, ':song_id' => $id, ':user_id' => $user_id);\n }\n \n $STH->insert($tables, $data, 'groups', 'group_id', TRUE);\n $STH->getErrors();\n }",
"protected function _updatefields() {}",
"function update_group_members($gid) {\n global $db;\n $total_members = $this->total_members($gid);\n $db->update(tbl($this->gp_tbl), array(\"total_members\"), array($total_members), \" group_id='\" . $gid . \"'\");\n return true;\n }",
"public function update() {\r\n\r\n // Does the Group object have an id?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::update(): Attempt to update a Group object that does not have its ID property set.\", E_USER_ERROR );\r\n \r\n // Update the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $sql = \"UPDATE \" . DB_PREFIX . \"groups SET title = :title, dashboard = :dashboard, content = :content, themes = :themes, files = :files, settings = :settings, users = :users, status = :status WHERE id = :id\";\r\n \r\n $st = $conn->prepare ( $sql );\r\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\r\n $st->bindValue( \":dashboard\", $this->dashboard, PDO::PARAM_INT );\r\n $st->bindValue( \":content\", $this->content, PDO::PARAM_INT );\r\n $st->bindValue( \":themes\", $this->themes, PDO::PARAM_INT );\r\n $st->bindValue( \":files\", $this->files, PDO::PARAM_INT );\r\n $st->bindValue( \":settings\", $this->settings, PDO::PARAM_INT );\r\n $st->bindValue( \":users\", $this->users, PDO::PARAM_INT );\r\n $st->bindValue( \":status\", $this->status, PDO::PARAM_INT );\r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n \r\n }",
"public function update($table, array $fields);",
"function group_info($group_name,$fields=NULL){\n if ($group_name==NULL){ return (false); }\n if (!$this->_bind){ return (false); }\n \n $filter=\"(&(objectCategory=group)(\".$this->_group_cn_identifier.\"=\".$this->ldap_search_encode($group_name).\"))\";\n\n if ($fields==NULL){ $fields=array(\"member\",$this->_group_attribute,\"cn\",\"description\",\"distinguishedname\",\"objectcategory\",$this->_group_cn_identifier); }\n \n $sr=@ldap_search($this->_conn,$this->_base_dn,$filter,$fields);\n if (FALSE === $sr) {\n $this->_warning_message = \"group_info: ldap_search error \".ldap_errno($this->_conn).\": \".ldap_error($this->_conn);\n echo \"DEBUG: \".$this->_warning_message.\"\\n\";\n }\n // Search: (&(objectCategory=group)(cn=gr10000))\n // (&(objectCategory=group)(cn=gr10))\n // PHP Warning: ldap_search(): Search: Critical extension is unavailable in // C:\\data\\projects\\multiotp\\core\\contrib\\MultiotpAdLdap.php on line 591\n // Search: (&(objectCategory=group)(cn=gr10))\n $entries = $this->ldap_get_entries_raw($sr);\n\n // DEBUG\n if (0 == count($entries)) {\n $this->_warning_message = \"group_info: No entry for the specified filter $filter\";\n echo \"DEBUG: \".$this->_warning_message.\"\\n\";\n }\n\n return ($entries);\n }",
"function upgrade_500_field_group($field_group, $ofg)\n {\n }",
"public function testUpdateSupplierGroup()\n {\n }"
] |
[
"0.7035848",
"0.6814215",
"0.6406214",
"0.6326654",
"0.6323059",
"0.6211785",
"0.6112797",
"0.6062063",
"0.6030178",
"0.60196424",
"0.59900963",
"0.59756416",
"0.59624505",
"0.5940567",
"0.59146994",
"0.58836734",
"0.58708286",
"0.5866939",
"0.58225334",
"0.5808281",
"0.5773054",
"0.5757605",
"0.57474834",
"0.5733331",
"0.5707728",
"0.56783825",
"0.5639607",
"0.5565661",
"0.5555575",
"0.5551316"
] |
0.82659125
|
0
|
/ db_group_add_member Add a new member to a group. $member can be positive (a feed ID) or negative (a group ID). XXX Actually, for now, we want the new member to be positive (a feed).
|
function db_group_add_member($group, $member)
{
if ($group == -1)
// Silently succeed. Everything is part of -1.
return TRUE;
$dbh = db_connect();
$query = "INSERT INTO `group_members` (member, parent) VALUES (?,?)";
$stmt = $dbh->prepare($query);
$result = $stmt->bind_param("ii", $member, $group);
$result = $stmt->execute();
$stmt->close();
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
// Success
return TRUE;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function guildMemberAdd(GuildMember $member);",
"public function group_add_member( $args, $assoc_args ) {\n\t\t$r = wp_parse_args( $assoc_args, array(\n\t\t\t'group-id' => null,\n\t\t\t'user-id' => null,\n\t\t\t'role' => 'member',\n\t\t) );\n\n\t\t// Convert --group_id to group ID\n\t\t// @todo this'll be screwed up if the group has a numeric slug\n\t\tif ( ! is_numeric( $r['group-id'] ) ) {\n\t\t\t$group_id = groups_get_id( $r['group-id'] );\n\t\t} else {\n\t\t\t$group_id = $r['group-id'];\n\t\t}\n\n\t\t// Check that group exists\n\t\t$group_obj = groups_get_group( array( 'group_id' => $group_id ) );\n\t\tif ( empty( $group_obj->id ) ) {\n\t\t\tWP_CLI::error( 'No group found by that slug or id.' );\n\t\t}\n\n\t\t// Convert --user_id to user ID\n\t\t// @todo this'll be screwed up if user has a numeric user_login\n\t\t// @todo Have to use user-id because WP_CLI hijocks --user\n\t\tif ( ! is_numeric( $r['user-id'] ) ) {\n\t\t\t$user_id = (int) username_exists( $r['user-id'] );\n\t\t} else {\n\t\t\t$user_id = $r['user-id'];\n\t\t\t$user_obj = new WP_User( $user_id );\n\t\t\t$user_id = $user_obj->ID;\n\t\t}\n\n\t\tif ( empty( $user_id ) ) {\n\t\t\tWP_CLI::error( 'No user found by that username or id' );\n\t\t}\n\n\t\t// Sanitize role\n\t\tif ( ! in_array( $r['role'], array( 'member', 'mod', 'admin' ) ) ) {\n\t\t\t$r['role'] = 'member';\n\t\t}\n\n\t\t$joined = groups_join_group( $group_id, $user_id );\n\n\t\tif ( $joined ) {\n\t\t\tif ( 'member' !== $r['role'] ) {\n\t\t\t\t$the_member = new BP_Groups_Member( $user_id, $group_id );\n\t\t\t\t$member->promote( $r['role'] );\n\t\t\t}\n\n\t\t\t$success = sprintf(\n\t\t\t\t'Added user #%d (%s) to group #%d (%s) as %s',\n\t\t\t\t$user_id,\n\t\t\t\t$user_obj->user_login,\n\t\t\t\t$group_id,\n\t\t\t\t$group_obj->name,\n\t\t\t\t$r['role']\n\t\t\t);\n\t\t\tWP_CLI::success( $success );\n\t\t} else {\n\t\t\tWP_CLI::error( 'Could not add user to group.' );\n\t\t}\n\t}",
"function groups_add_member($groupid, $userid) {\n if (!groups_group_exists($groupid)) {\n return false;\n }\n\n if (groups_is_member($groupid, $userid)) {\n return true;\n }\n\n $member = new object();\n $member->groupid = $groupid;\n $member->userid = $userid;\n $member->timeadded = time();\n\n if (!insert_record('groups_members', $member)) {\n return false;\n }\n\n //update group info\n set_field('groups', 'timemodified', $member->timeadded, 'id', $groupid);\n\n //trigger groups events\n $eventdata = new object();\n $eventdata->groupid = $groupid;\n $eventdata->userid = $userid;\n events_trigger('groups_member_added', $eventdata);\n\n return true;\n}",
"public function addMember($project, $groupName, Google_Service_Computeaccounts_GroupsAddMemberRequest $postBody, $optParams = array())\r\n {\r\n $params = array('project' => $project, 'groupName' => $groupName, 'postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('addMember', array($params), \"Google_Service_Computeaccounts_Operation\");\r\n }",
"function addMemberToGroup($userID, $groupID) {\r\n $sql = $this->db->prepare(\"INSERT INTO GROUPMEMBERS (groupID, UserID) VALUES (:group_id, :user_id)\");\r\n if ($sql->execute(array(\r\n 'group_id' => $groupID,\r\n 'user_id' => $userID,\r\n )))\r\n return true;\r\n return false;\r\n }",
"function check_and_add_to_group($userid, $group_id)\r\n{\r\n if ( !BP_Groups_Member::check_is_member( $userid, $group_id ) ) {\r\n // make sure the user isn't banned from the group!\r\n if ( !groups_is_user_banned( $userid, $group_id ) ) {\r\n // add the group already!\r\n $user_id = $userid;\r\n\r\n if ( groups_check_user_has_invite( $user_id, $group_id ) ) {\r\n groups_delete_invite( $user_id, $group_id );\r\n }\r\n\r\n $new_member = new bp_groups_member;\r\n $new_member->group_id = $group_id;\r\n $new_member->inviter_id = 0;\r\n $new_member->user_id = $user_id;\r\n $new_member->is_admin = 0;\r\n $new_member->user_title = '';\r\n $new_member->date_modified = time();\r\n $new_member->is_confirmed = 1;\r\n\r\n if ( !$new_member->save() ) {\r\n return false;\r\n }\r\n\r\n // Should I add this to the activity stream? left off for now\r\n\r\n /* Modify group meta */\r\n groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );\r\n groups_update_groupmeta( $group_id, 'last_activity', time() );\r\n }\r\n }\r\n\r\n return false;\r\n}",
"public function insert($groupKey, Google_Service_Directory_Member $postBody, $optParams = array())\n {\n $params = array('groupKey' => $groupKey, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_Directory_Member\");\n }",
"function addMember($member)\r\n {\r\n //set to empty image or interests\r\n $image = '';\r\n $interests = \"\";\r\n\r\n $phone = str_replace('-', '', $member->getPhone());\r\n $phone = '('.substr($phone, 0, 3).')'.substr($phone, 3, 3).'-'.substr($phone,6);\r\n\r\n //if the object is a member will loop over the array and set the interests\r\n if ($member instanceof PremiumMember) {\r\n $inDoorInterests = $member->getInDoorInterests();\r\n $outDoorInterests = $member->getOutDoorInterests();\r\n $premium = 1;\r\n\r\n $interests .= \"\";\r\n for ($i = 0; $i < count($inDoorInterests); $i++) {\r\n $interests .= $inDoorInterests[$i] . \", \";\r\n }\r\n //$interests .= \"\";\r\n for ($i = 0; $i < count($outDoorInterests); $i++) {\r\n $interests .= $outDoorInterests[$i] . \", \";\r\n }\r\n\r\n $interests = rtrim($interests,\", \");\r\n\r\n } else {\r\n $premium = 0;\r\n }\r\n\r\n //1. define the query\r\n $sql = \"INSERT INTO Members (fname, lname, age, gender, phone, email, state, seeking, bio, premium, image, interests) \r\n VALUES (:fname, :lname, :age, :gender, :phone, :email, :state, :seeking, :bio, :premium, :image, :interests)\";\r\n\r\n //2. prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. bind parameters\r\n $statement->bindParam(':fname', $member->getFname(), PDO::PARAM_STR);\r\n $statement->bindParam(':lname', $member->getLname(), PDO::PARAM_STR);\r\n $statement->bindParam(':age', $member->getAge(), PDO::PARAM_STR);\r\n $statement->bindParam(':gender', $member->getGender(), PDO::PARAM_STR);\r\n $statement->bindParam(':phone', $phone, PDO::PARAM_STR);\r\n $statement->bindParam(':email', $member->getEmail(), PDO::PARAM_STR);\r\n $statement->bindParam(':state', $member->getState(), PDO::PARAM_STR);\r\n $statement->bindParam(':seeking', $member->getSeeking(), PDO::PARAM_STR);\r\n $statement->bindParam(':bio', $member->getBio(), PDO::PARAM_STR);\r\n $statement->bindParam(':premium', $premium, PDO::PARAM_STR);\r\n $statement->bindParam(':image', $image, PDO::PARAM_STR);\r\n $statement->bindParam(':interests', $interests, PDO::PARAM_STR);\r\n\r\n //4. execute the statement\r\n $success = $statement->execute();\r\n\r\n //5. return the result\r\n return $success;\r\n }",
"function insertMember($member)\r\n {\r\n $sql = \"INSERT INTO member(fname, lname, age, gender, phone, email, state, seeking, bio, premium, image)\r\n VALUES (:fname, :lname, :age, :gender, :phone, :email, :state, :seeking, :bio, :premium, :image)\";\r\n\r\n //2. Prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. Bind the parameter\r\n $statement->bindParam(':fname', $member->getFName());\r\n $statement->bindParam(':lname', $member->getLName());\r\n $statement->bindParam(':age', $member->getAge());\r\n $statement->bindParam(':gender', $member->getGender());\r\n $statement->bindParam(':phone', $member->getPhone());\r\n $statement->bindParam(':email', $member->getEmail());\r\n $statement->bindParam(':state', $member->getState());\r\n $statement->bindParam(':seeking', $member->getSeeking());\r\n $statement->bindParam(':bio', $member->getBio());\r\n $statement->bindParam(':premium', $member->getPremium());\r\n $statement->bindParam(':image', $member->getImageUpload());\r\n\r\n\r\n\r\n //4. Execute the statement\r\n $statement->execute();\r\n\r\n //5. Get the result\r\n $id = $this->_dbh->lastInsertId();\r\n }",
"function addMemberToDb($memberId, $name, $email, $address, $nic, $dob, $gender, $contactNo, $contactNo_extra, $category, $receiptNo, $regDate){\n if ($memberId==\"\" || $name==\"\") {\n return \"nulldata\";\n }\n $con = getConnection();\n // Check if NIC exists\n $id = 0;\n $sql = \"SELECT ID FROM members_tab WHERE NIC = ?;\";\n if ($stmt = mysqli_prepare($con, $sql)) {\n mysqli_stmt_bind_param($stmt, \"s\", $nic);\n mysqli_stmt_execute($stmt); \n mysqli_stmt_bind_result($stmt, $result);\n while(mysqli_stmt_fetch($stmt)) {\n $id = $result;\n }\n mysqli_stmt_close($stmt);\n }\n if ($id != 0) {\n return \"exists\";\n } else {\n // Add data\n $sql = \"INSERT INTO members_tab (membership_no, member_name, email, address, NIC, DoB, gender, contactNo, contactNo_extra, category, receiptNo, dateOfReg) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);\";\n if ($stmt = mysqli_prepare($con, $sql)) {\n mysqli_stmt_bind_param($stmt, \"ssssssssssis\", $memberId, $name, $email, $address, $nic, $dob, $gender, $contactNo, $contactNo_extra, $category, $receiptNo, $regDate);\n mysqli_stmt_execute($stmt); \n mysqli_stmt_close($stmt);\n }\n\n queueEmail($email, 'welcome');\n \n closeConnection($con);\n }\n }",
"protected function OP_addMember($es_id, $member_id, $full_name, $user_id, $color='', $imageUrl='')\n\t{\n\t\t$op = array(\n\t\t\t'optype' => 'AddMember',\n\t\t\t'memberid' => (string) $member_id,\n\t\t\t'timestamp' => self::getTimeStamp(),\n\t\t\t'setProperties' => array(\n\t\t\t\t'fullName' => $full_name,\n\t\t\t\t'color' => $color,\n\t\t\t\t'imageUrl' => $imageUrl,\n\t\t\t\t'uid' => $user_id,\n\t\t\t)\n\t\t);\n\t\t$this->OP_add2Db($op, $es_id);\n\t}",
"public function insertMember($newMember)\r\n {\r\n $fname = $newMember->getFname();\r\n $lname = $newMember->getLname();\r\n $age = $newMember->getAge();\r\n $gender = $newMember->getGender();\r\n $phone = $newMember->getPhone();\r\n $email = $newMember->getEmail();\r\n $state = $newMember->getState();\r\n $seeking = $newMember->getSeeking();\r\n $bio = $newMember->getBio();\r\n $premium =\r\n (is_a($newMember, \"PremiumMember\"))?\r\n \"1\" : \"0\";\r\n $image =\r\n (is_a($newMember, \"PremiumMember\"))?\r\n $newMember->getImage() : \"\";\r\n\r\n $sql = \"INSERT INTO `member` (fname, lname, age, gender, phone, email, \r\n state, seeking, bio, premium, image) \r\n VALUES (:fname, :lname, :age, :gender, :phone, \r\n :email, :state, :seeking, :bio, :premium, :image)\";\r\n $statement = $this->_cnxn->prepare($sql);\r\n $statement->bindParam(\":fname\", $fname);\r\n $statement->bindParam(\":lname\", $lname);\r\n $statement->bindParam(\":age\", $age, PDO::PARAM_INT);\r\n $statement->bindParam(\":gender\", $gender);\r\n $statement->bindParam(\":phone\", $phone);\r\n $statement->bindParam(\":email\", $email);\r\n $statement->bindParam(\":state\", $state);\r\n $statement->bindParam(\":seeking\", $seeking);\r\n $statement->bindParam(\":bio\", $bio);\r\n $statement->bindParam(\":premium\", $premium, PDO::PARAM_INT);\r\n $statement->bindParam(\":image\", $image);\r\n if ($statement->execute()) {\r\n return $this->_cnxn->lastInsertId();\r\n } else {\r\n return null;\r\n }\r\n }",
"public function create(Member $member)\n {\n\n }",
"static function addMember($pid, $uid){\n\n\t\trequire_once 'DBO.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('\n\t\t\t\tINSERT INTO project_group(id_usr, id_proj)\n\t\t\t\tVALUES (:id_usr, :id_proj)');\n\t\t$statement->execute(array(\n\t\t\t\t':id_usr' => $uid,\n\t\t\t\t':id_proj' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public static function addProjectMember($member_id,$project_id,$role_id){\n\t\t$db = DemoDB::getConnection();\n $sql = \"INSERT INTO project_member(member_id,project_id,role_id,added_at) VALUE(:member,:project,:role,:date)\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":member\", $member_id);\n $stmt->bindValue(\":project\", $project_id);\n\t\t$stmt->bindValue(\":role\", $role_id);\n $stmt->bindValue(\":date\",date('Y-m-d H:i:s'));\n $ok = $stmt->execute();\n if (!$ok) {\n\n\t\t\treturn $stmt->errorInfo();\n\t\t}\n\t}",
"public function saveNew(&$member)\n\t{\n\t\t$db_connection = get_db_connection();\n\t\t$name = $member->get_member_name();\n\t\t$member_type = $member->get_member_type();\n\t\t$password = $member->get_member_password();\n\t\t$date = $member->get_date_registered();\n\t\t// $last_login = null; // new member\n\t\t// $last_logoff = null; // new member\n\t\t$first_name = $member->get_first_name();\n\t\t$last_name = $member->get_last_name();\n\t\t$email = $member->get_email();\n\t\t$registration_complete = $member->get_registration_complete();\n\t\t\n\t\t$table = $this->getTableName();\n\t\t\n\t\t$success = true;\n\t\t// The member_id will be auto-generated.\n\t\t$query = \"insert into $table (member_type, member_name, member_password, \n\t\t\t\t\t\tdate_registered, first_name, last_name, email, registration_complete) \n\t\t\t\tvalues('$member_type', '$name', '$password', '$date', \n\t\t\t\t\t\t'$first_name', '$last_name', '$email', '$registration_complete')\";\n\t\t\n\t\t$result = mysqli_query($db_connection, $query);\t\t\t\n\t\t\n\t\tif(!$result)\n\t\t{\n\t\t\t$success = false;\n\t\t\techo '<p>' . mysqli_error($db_connection) . '</p>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// get the newly generated member_id\n\t\t\t$member_id = mysqli_insert_id($db_connection);\n\t\t\t$member->set_member_id($member_id);\n\t\t}\n\t\n\t\tmysqli_close($db_connection);\n\t\treturn $success;\t\t\n\t}",
"function lobby_membersapi_add($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$gid = (int)$args['gid'];\r\n\t$text = $args['text'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_ADDMEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$group = pnModAPIFunc('lobby','groups','get',array('id' => $gid));\r\n \t\t$groupOwner = (($group['uid'] == pnUserGetVar('uid')) || (SecurityUtil::checkPermission('lobby::'.$id, '::', ACCESS_ADMIN)));\r\n\t \tif ($group['id'] != $gid) {\r\n\t \t \t// Something went wrong, groups not existent or something like that\r\n\t \t \tLogUtil::registerError(_LOBBY_GROUP_ADDMEMBER_FAILURE);\r\n\t\t return false;\r\n\t\t} else {\r\n\t\t\t$obj = array(\r\n\t\t\t\t'gid' \t=> $gid, \r\n\t\t\t\t'uid' \t=> $uid,\r\n\t\t\t\t'text'\t=> $text,\r\n\t\t\t\t'date'\t=> date(\"Y-m-d H:i:s\",time())\r\n\t\t\t\t);\r\n\t\t\tif (($group['moderated'] == 1) && ($group['uid'] != $uid)) {\r\n\t\t\t \t// is the member already member or pending?\r\n\t\t\t \t$table = pnDBGetTables();\r\n\t\t\t \t$column_pending = $table['lobby_members_pending_column'];\r\n\t\t\t \t$column_members = $table['lobby_members_column'];\r\n\t\t\t \t$where_pending = $column_pending['uid'].\" = \".$uid.\" AND \".$column_pending['gid'].\" = \".$gid;\r\n\t\t\t \t$where_members = $column_members['uid'].\" = \".$uid.\" AND \".$column_members['gid'].\" = \".$gid;\r\n\t\t\t \t$pending_count = (int)DBUtil::selectObjectCount('lobby_members_pending',$where_pending);\r\n\t\t\t \t$members_count = (int)DBUtil::selectObjectCount('lobby_members',$where_members);\r\n\t\t\t \tif ($pending_count > 0) {\r\n\t\t\t \t \t// if the call was done by the group owner we will move the contact from pending status\r\n\t\t\t \t \tif ($groupOwner) {\r\n\t\t\t \t \t \t// get object, add it into member table and delete delte it from pending table\r\n\t\t\t\t\t\t$pending = DBUtil::selectObject('lobby_members_pending',$where_pending);\r\n\t\t\t\t\t\t$result = DBUtil::deleteObject($pending,'lobby_members_pending');\r\n\t\t\t\t\t\tif (!$result) {\r\n\t\t\t\t\t\t\treturn LogUtil::registerError('_LOBBY_GROUP_PENDING_ACCEPT_ERROR');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($members_count == 0) {\r\n\t\t\t\t\t\t \tif (!$result) {\r\n\t\t\t\t\t\t\t\treturn LogUtil::registerError('_LOBBY_GROUP_PENDING_ACCEPT_ERROR');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_MEMBER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_PENDING);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if ($members_count > 0) {\r\n\t\t\t\t return LogUtil::registerError(_LOBBY_GROUP_ADD_ALREDY_MEMBER);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$result = DBUtil::insertObject($obj,'lobby_members_pending');\r\n\t\t\t\t\tif ($result) {\r\n\t\t\t\t\t\treturn LogUtil::registerStatus(_LOBBY_GROUP_REQUESTSENT);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn LogUtil::registerError(_LOBBY_GROUP_JOINERROR);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t \t// Insert Member now into database\r\n\t\t\t$result = DBUtil::insertObject($obj,'lobby_members');\r\n\t\t\t// Set message\r\n\t\t\tif ($result) {\r\n\t\t\t\tLogUtil::registerStatus(str_replace('%member%',pnUserGetVar('uname', $uid),_LOBBY_GROUPS_MEMBERADDED));\r\n\t\t\t} else {\r\n\t\t\t \tLogUtil::registerError(_LOBBY_GROUPS_ADDERROR);\r\n\t\t\t}\r\n\t\t\t// Send an Email to the user that was added\r\n\t\t\tif ($group['uid'] == $uid) {\r\n\t\t\t\t// ToDo: Email schicken \"wurde hinzugefügt\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"function addGroupMember($mysqli, $groupID, $userID, $isAdmin, $isAccepted){\r\n $mysqli->query('INSERT INTO `group_members` VALUES ('.$groupID.','.$userID.','.$isAdmin.','.$isAccepted.')');\r\n }",
"function insertMember($member, $interests)\n {\n $sql = \"\";\n // define the query\n if($member->membershipType() == 'normal') {\n $sql .= \"INSERT INTO member VALUES(default, :fname, :lname, :age, :gender, :phone, :email,\n :state, :seeking, :bio, 0, :interests, '')\";\n } else {\n $sql .= \"INSERT INTO member VALUES(default, :fname, :lname, :age, :gender, :phone, :email,\n :state, :seeking, :bio, 1, :interests, '')\";\n }\n\n // prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n // bind the parameters\n $statement->bindParam(':fname', $member->getFName());\n $statement->bindParam(':lname', $member->getLName());\n $statement->bindParam(':age', $member->getAge());\n $statement->bindParam(':gender', $member->getGender());\n $statement->bindParam(':phone', $member->getPhone());\n $statement->bindParam(':email', $member->getEmail());\n $statement->bindParam(':state', $member->getState());\n $statement->bindParam(':seeking', $member->getSeeking());\n $statement->bindParam(':bio', $member->getBio());\n $statement->bindParam(':interests', $interests);\n\n // execute statement\n $statement->execute();\n\n return $this->_dbh->lastInsertId();\n }",
"function addToGroup($userId, $db, $group, $leader) {\n if ($group == 0) {\n echo \"<meta http-equiv='REFRESH' content='0;url=createGroup.php'>\";\n return 0;\n }\n $query = ('UPDATE users SET currentGroup = :group, groupLeader = :leader WHERE id = :userId');\n $statement = $db -> prepare($query);\n $statement -> bindValue(':userId', $userId);\n $statement -> bindValue(':group', $group);\n $statement -> bindValue(':leader', $leader);\n\n // execute query and print error message if not\n if (!$statement -> execute()) { return print_r($stm->errorInfo(), true);} else {\n return true;\n }\n}",
"public function add_organiser($memberid){\n $sql = \"INSERT INTO tournamentOrganisers(tournamentID, organiserID) VALUES ($this->id, $memberid)\";\n $result = self::$database->query($sql);\n if (!$result){\n $this->errors[] = \"Insertion of organiser failed. Either member id doesnt exist or member is already an organiser.\";\n }\n }",
"public function add_members() {\n // check if a user + group id exists in membership\n // update that if exists\n // else, add\n // redirect to group id\n\n if (!($this->input->post() || $this->session->has_userdata('curr_group_id'))) {\n $this->_redirect('dashboard/groups');\n exit();\n }\n\n $curr_group_id = $this->session->userdata('curr_group_id');\n \n if ($users = $this->input->post('users')) {\n $this->_add_users($users);\n }\n\n $this->_redirect('dashboard/groups/' . $curr_group_id);\n }",
"public function add($member_id) {\n\t\t$members = $member_id;\n\t\t$this->set(compact('members'));\n\t\t$users = CakeSession::read('Auth.User.id');\n\t\t$this->set(compact('users'));\n\t\t$this->loadModel('Admin');\n\t\t$admins = $this->Admin->find('all', array('conditions' => array('Admin.member_id' => $member_id, 'Admin.active' => true)));\n\t\t$this->set(compact('admins'));\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->Interaction->create();\n\t\t\tif ($this->Interaction->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Interaction successfully added'));\n\t\t\t\treturn $this->redirect(array('controller' => 'members', 'action' => 'view', $member_id));\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Unable to add interaction'));\n\t\t}\n\t}",
"function group_add_user($groupid, $userid, $role=null) {\n $groupid = group_param_groupid($groupid);\n $userid = group_param_userid($userid);\n\n $gm = new StdClass;\n $gm->member = $userid;\n $gm->group = $groupid;\n $gm->ctime = db_format_timestamp(time());\n if (!$role) {\n $role = get_field_sql('SELECT gt.defaultrole FROM {grouptype} gt, {group} g WHERE g.id = ? AND g.grouptype = gt.name', array($groupid));\n }\n $gm->role = $role;\n\n db_begin();\n insert_record('group_member', $gm);\n delete_records('group_member_request', 'group', $groupid, 'member', $userid);\n handle_event('userjoinsgroup', $gm);\n db_commit();\n}",
"function group_add_group($parent,$child){\n\n //find the parent group's dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]==NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n //find the child group's dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]==NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $child_dn;\n \n $result=@ldap_mod_add($this->_conn,$parent_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }",
"function insertMember($member, $namePic)\r\n {\r\n $premium= -1;\r\n // define the query\r\n if($member->memberType() == 'member') {\r\n $premium = 0;\r\n $interests = null;\r\n }\r\n else {\r\n $premium = 1;\r\n $interests = $member->getOutdoorInterests() + $member->getIndoorInterests();\r\n }\r\n\r\n\r\n $sql = \"INSERT INTO member VALUES(default, \r\n :fname, :lname, :age, :gender, :phone, :email,:state, :seeking, :bio, $premium, :interests, :image)\";\r\n\r\n // prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n // bind the parameters\r\n $statement->bindParam(':fname', $member->getFName());\r\n $statement->bindParam(':lname', $member->getLName());\r\n $statement->bindParam(':age', $member->getAge());\r\n $statement->bindParam(':gender', $member->getGender());\r\n $statement->bindParam(':phone', $member->getPhone());\r\n $statement->bindParam(':email', $member->getEmail());\r\n $statement->bindParam(':state', $member->getState());\r\n $statement->bindParam(':seeking', $member->getSeeking());\r\n $statement->bindParam(':bio', $member->getBio());\r\n $statement->bindParam(':interests', $interests);\r\n $statement->bindParam(':image', $namePic);\r\n // execute statement\r\n $statement->execute();\r\n $memID = $this->_dbh->lastInsertId();\r\n\r\n $interestOption = array(\r\n \"tv\" => \"1\",\r\n \"puzzles\" => \"2\",\r\n \"movies\" => \"3\",\r\n \"video games\" => \"4\",\r\n \"board games\" => \"5\",\r\n \"playing cards\" => \"6\",\r\n \"cooking\" => \"7\",\r\n \"reading\" => \"8\",\r\n \"collecting\" => \"9\",\r\n \"climbing\" => \"10\",\r\n \"swimming\" => \"11\",\r\n \"biking\" => \"12\",\r\n \"walking\" => \"13\",\r\n \"hiking\" => \"14\",\r\n\r\n );\r\n\r\n for($i = 0; $i<sizeof($interests);$i++ ){\r\n $sql2 = \"INSERT INTO member_interest VALUES(default, \r\n :member_id, :interest_id, )\";\r\n $val = $interests[$i];\r\n if (array_key_exists($val, $interestOption)) {\r\n $intVal = $interestOption[$val];\r\n }\r\n\r\n // prepare the statement\r\n $statement = $this->_dbh->prepare($sql2);\r\n\r\n $statement->bindParam(':member_id', $memID);\r\n $statement->bindParam(':interest_id', $intVal);\r\n $statement->execute();\r\n }\r\n\r\n }",
"public function addGroupMember($_groupId, $_userId, $_addToList = true)\n {\n $this->checkRight('MANAGE_ACCOUNTS');\n\n $transactionId = TransactionManager::getInstance()->startTransaction(Core::getDb());\n try {\n GroupbaseGroup::getInstance()->addGroupMember($_groupId, $_userId);\n\n if (true === $_addToList && Application::getInstance()->isInstalled('Addressbook') === true) {\n $group = $this->get($_groupId);\n $user = User::getInstance()->getUserById($_userId);\n\n if (! empty($user->contact_id) && ! empty($group->list_id)) {\n if (! ControllerList::getInstance()->exists($group->list_id)) {\n if (Core::isLogLevel(LogLevel::WARN)) Core::getLogger()->warn(__METHOD__ . '::' . __LINE__\n . ' Could not add member to list ' . $group->list_id . ' (it does not exist)');\n } else {\n $aclChecking = ControllerList::getInstance()->doContainerACLChecks(FALSE);\n ControllerList::getInstance()->addListMember($group->list_id, $user->contact_id, false);\n ControllerList::getInstance()->doContainerACLChecks($aclChecking);\n }\n }\n }\n\n $event = new AddGroupMember();\n $event->groupId = $_groupId;\n $event->userId = $_userId;\n Event::fireEvent($event);\n\n TransactionManager::getInstance()->commitTransaction($transactionId);\n $transactionId = null;\n } finally {\n if (null !== $transactionId) {\n TransactionManager::getInstance()->rollBack();\n }\n }\n }",
"public function testCreateGroupMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function memberJoin(Group $group, Member $member, $status = 'In')\n {\n if (!is_object($group) || !is_object($member) || !($member_id = $member->getPKValue()) || !($group_id = $group->getPKValue()))\n {\n return false;\n }\n\n // only bother if member is not already ... a member \n if (!$this->isMember($group, $member, false))\n {\n $this->Status = $this->dao->escape($status);\n $this->IdGroup = $group_id;\n $this->IdMember = $member_id;\n $this->created = date('Y-m-d H:i:s');\n\n return $this->insert();\n }\n else\n {\n return false;\n }\n }",
"public function addGroup(Group $group);"
] |
[
"0.71786904",
"0.71368515",
"0.71260214",
"0.67704207",
"0.6744952",
"0.6735504",
"0.66465414",
"0.6517483",
"0.6492306",
"0.64536256",
"0.6385703",
"0.63480985",
"0.63372576",
"0.6325053",
"0.6271564",
"0.6215303",
"0.6211771",
"0.61547947",
"0.61410517",
"0.60919285",
"0.60549885",
"0.60390794",
"0.59823835",
"0.5935697",
"0.59148586",
"0.5913068",
"0.5868856",
"0.5839406",
"0.5795907",
"0.578524"
] |
0.79522264
|
0
|
/ db_group_remove_member Delete $member from group $gid. Returns TRUE if successful. Otherwise, returns NULL and sets $db_errno and $db_errmsg.
|
function db_group_remove_member($gid, $member)
{
$dbh = db_connect();
$query = sprintf("DELETE FROM `group_members` where member=%d and parent=%d",
$member, $gid);
$result = $dbh->query($query);
if (!$result)
{
global $db_errno;
$db_errno = $dbh->errno;
global $db_errmsg;
$db_errmsg = $dbh->error;
return NULL;
}
return TRUE;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function OP_removeMember ($es_id, $member_id)\n\t{\n\t\t$op = array (\n\t\t\t'optype' => 'RemoveMember',\n\t\t\t'memberid' => (string) $member_id,\n\t\t\t'timestamp' => self::getTimeStamp()\n\t\t);\n\t\treturn $this->OP_add2Db($op, $es_id)?true:false;\n\t}",
"function guildMemberRemove(GuildMember $member);",
"public function removeByMemberId( $memberId )\n\t{\n\t\tif ( empty( $memberId ) )\n\t\t{\n\t\t\ttrigger_error( \"Data missing in \" . __CLASS__ . '::' . __FUNCTION__, E_USER_WARNING );\n\t\t}\n\t\t\n\t\t$where = \"like_app='{$this->_app}' AND like_area='{$this->_area}' AND like_member_id=\" . intval($memberId);\n\t\t\n\t\t/* Get rel ids */\n\t\t$relIds\t= array();\n\t\t\n\t\t$this->DB->build( array( 'select' => 'like_rel_id', 'from' => 'core_like', 'where' => $where ) );\n\t\t$this->DB->execute();\n\t\t\n\t\twhile( $r = $this->DB->fetch() )\n\t\t{\n\t\t\t$relIds[]\t= $r['like_rel_id'];\n\t\t}\n\n\t\t/* Delete likes */\n\t\t$this->DB->delete( 'core_like', $where );\n\t\t\t\t\t\t\t\t\t\n\t\t/* Flag cache as stale */\n\t\t$this->likeCache->isNowStale( $relIds );\n\t\t\n\t\treturn true;\n\t}",
"public function removeMember($project, $groupName, Google_Service_Computeaccounts_GroupsRemoveMemberRequest $postBody, $optParams = array())\r\n {\r\n $params = array('project' => $project, 'groupName' => $groupName, 'postBody' => $postBody);\r\n $params = array_merge($params, $optParams);\r\n return $this->call('removeMember', array($params), \"Google_Service_Computeaccounts_Operation\");\r\n }",
"function groups_remove_member($groupid, $userid) {\n if (!groups_group_exists($groupid)) {\n return false;\n }\n\n if (!groups_is_member($groupid, $userid)) {\n return true;\n }\n\n if (!delete_records('groups_members', 'groupid', $groupid, 'userid', $userid)) {\n return false;\n }\n //update group info\n set_field('groups', 'timemodified', time(), 'id', $groupid);\n\n //trigger groups events\n $eventdata = new object();\n $eventdata->groupid = $groupid;\n $eventdata->userid = $userid;\n events_trigger('groups_member_removed', $eventdata);\n\n return true;\n}",
"function delete_group_members($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_del_grp_mems\"));\n else {\n $db->delete(tbl($this->gp_mem_tbl), array(\"group_id\"), array($gid));\n e(lang(\"mems_deleted\"), \"m\");\n }\n }",
"function lobby_membersapi_del($args)\r\n{\r\n \tprayer($args);\r\n\t$uid = (int)$args['uid'];\r\n\t$gid = (int)$args['gid'];\r\n\tif (!(($uid > 1) && ($gid > 0))) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_DELETE_MEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// Is the user a member of this group?\r\n\t \t$isMember = pnModAPIFunc('lobby','groups','isMember',array('uid' => $uid, 'gid' => $gid));\r\n\t \t$group = pnModAPIFunc('lobby','group','get',array('id' => $gid));\r\n\t \t$isOwner = ($group['uid'] == $uid);\r\n\t \tif (!$isMember) {\r\n\t\t LogUtil::registerError(_LOBBY_USER_NOT_A_MEMBER);\r\n\t\t return false;\r\n\t\t} else if ($isOwner) {\r\n\t\t LogUtil::registerError(_LOBBY_USER_IS_OWNER);\r\n\t\t return false;\r\n\t\t} else {\r\n\t\t \t$table \t\t= pnDBGetTables();\r\n\t\t \t$column\t\t= $table['lobby_members_column'];\r\n\t\t \t$where\t\t= $column['uid'].\" = \".$uid.\" AND \".$column['gid'].\" = \".$gid;\r\n\t\t\treturn DBUtil::deleteWhere('lobby_members',$where);\r\n\t\t}\r\n\t}\r\n}",
"function deleteMemberFromGroup($userID, $groupID) {\r\n $sql = $this->db->prepare(\"DELETE FROM GROUPMEMBERS WHERE groupID=:group_id AND UserID=:user_id\");\r\n $result = $sql->execute(array(\r\n 'group_id' => $groupID,\r\n 'user_id' => $userID,\r\n ));\r\n return $groupID;\r\n }",
"public function memberLeave(Group $group, Member $member)\n {\n if (!is_object($group) || !is_object($member) || !($member_id = $member->getPKValue()) || !($group_id = $group->getPKValue()) || !$this->findByWhere(\"IdMember = '{$member_id}' AND IdGroup = '{$group_id}'\"))\n {\n return false;\n }\n\n return $this->delete();\n }",
"function db_delete_group($gid)\n{\n\tglobal $db_errno;\n\tglobal $db_errmsg;\n\n\tif ($gid == -1)\n\t{\n\t\t// Can't delete \"All\".\n\t\t$db_errno = 0;\t# XXX - Is this kosher?\n\t\t$db_errmsg = \"Can't delete group \\\"All\\\".\";\n\t\treturn FALSE;\n\t}\n\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_group($gid);\n\tif ($old === NULL)\n\t\t// No such feed. I guess we can go home early.\n\t\treturn TRUE;\n\n\t// Move any members of this group to its parent.\n\t// \"IGNORE\" says to ignore records where the operation would\n\t// fail. Thus, if we have\n\t//\t\"New York Times\" in group \"News\"\n\t//\t\"New York Times\" in group \"Politics\"\n\t// \tgroup \"Politics\" in group \"News\"\n\t// we have a feed (New York Times) in both a group (Politics)\n\t// and its parent (News).\n\t//\n\t// If we now delete \"Politics\", we want to move all members of\n\t// Politics up one level. So normally we'd wind up with two\n\t// instances of \"New York Times in News\". \"IGNORE\" says to\n\t// skip those cases. We'll handle them separately, next.\n\t$query = sprintf(\"UPDATE IGNORE `group_members` SET parent=%d WHERE parent=%d\",\n\t\t\t $old['parent'],\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t/* Delete any duplicates */\n\t$query = sprintf(\"DELETE FROM `group_members` WHERE parent=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t/* If this group has any child groups, move them up one level\n\t * as well, into the parent of $gid.\n\t */\n\t$query = sprintf(\"UPDATE `groups` SET parent=%d WHERE parent=%d\",\n\t\t\t $old['parent'],\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t/* Delete this group from `groups` */\n\t$query = sprintf(\"DELETE FROM `groups` WHERE id=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\treturn TRUE;\t\t// Success\n}",
"public function group_del_contact($group,$contact_dn){\n \n // Find the parent dn\n $group_info=$this->group_info($group,array(\"cn\"));\n if ($group_info[0][\"dn\"]===NULL){ return (false); }\n $group_dn=$group_info[0][\"dn\"];\n \n $del=array();\n $del[\"member\"] = $contact_dn;\n \n $result=@ldap_mod_del($this->_conn,$group_dn,$del);\n if ($result==false){ return (false); }\n return (true);\n }",
"public function dele_group($gid = 0)\n {\n $query = 'SELECT 1 FROM '.$this->Tbl['adb_group'].' WHERE gid='.intval($gid).' AND owner='.$this->uid.' LIMIT 1';\n list ($result) = $this->fetchrow($this->query($query));\n if (!$result) {\n return false;\n }\n return $this->query('DELETE FROM '.$this->Tbl['adb_group'].' WHERE gid='.intval($gid))\n && $this->query('DELETE FROM '.$this->Tbl['adb_adr_group'].' WHERE gid='.intval($gid));\n }",
"public function remove($memberid, $membername='')\n {\n if($memberid == \"\"){\n return false;\n }\n else{\n // clean the member name up for logging\n $membername = db::escapechars($membername);\n \n // Delete the member\n $sql = \"DELETE FROM churchmembers WHERE memberID='\".db::escapechars($memberid).\"' LIMIT 1\";\n $result = db::execute($sql);\n // delete the member from groups\n if($result){\n $sql = \"DELETE FROM groupmembers WHERE memberID='\".db::escapechars($memberid).\"'\";\n $result = db::execute($sql);\n // delete the member from family constructs\n if($result){\n $sql = \"DELETE FROM familyconstruct WHERE fromID='\".db::escapechars($memberid).\"' OR toID='\".db::escapechars($memberid).\"'\";\n $result = db::execute($sql);\n if($result){\n $logType = \"Members\";\n $logValue = $_SESSION['Kusername'].\" deleted member $membername from the system\";\n $logArea = \"Members\";\t\t\t\t\n $this->logevent($logType, $logValue, $logArea);\n return true;\n }\n else{\n // failed family construct removal so log and return\n $logType = \"Delete Fail\";\n $logValue = $_SESSION['Kusername'].\" failed process (Family Construct) deleting member $membername \".db::escapechars($sql);\n $logArea = \"Members\";\t\t\t\t\n $this->logerror($logType, $logValue, $logArea);\n return \"<p class=\\\"confirm\\\">Error in removal process - the problem has been logged. Sorry.</p>\";\n }\n }\n else{\n // failed the group members removal so log and return\n $logType = \"Delete Fail\";\n $logValue = $_SESSION['Kusername'].\" failed process (Group Members) deleting member $membername\".db::escapechars($sql);\n $logArea = \"Members\";\t\t\t\t\n $this->logerror($logType, $logValue, $logArea);\n return \"<p class=\\\"confirm\\\">Error in removal process - the problem has been logged. Sorry.</p>\";\n }\n \n }\n else{\n // failed the church members entry so log and return\n $logType = \"Delete Fail\";\n $logValue = $_SESSION['Kusername'].\" failed process (Church Members) deleting member $membername \".db::escapechars($sql);\n $logArea = \"Members\";\t\t\t\t\n $this->logerror($logType, $logValue, $logArea);\n return \"<p class=\\\"confirm\\\">Could not delete this member right now - the problem has been logged. Sorry.</p>\";\n }\n \n }\n \n \n }",
"function group_del_group($parent,$child){\n\n //find the parent dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]==NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n //find the child dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]==NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $del=array();\n $del[\"member\"] = $child_dn;\n \n $result=@ldap_mod_del($this->_conn,$parent_dn,$del);\n if ($result==false){ return (false); }\n return (true);\n }",
"function drop_member($member_id) {\n $this->db->where('member_id',$member_id);\n $this->db->delete('members_tbl');\n }",
"public function destroy($groupId, $memberId)\n\t{\n $this->memberModel->delete($memberId, $groupId);\n\t}",
"public function group_del_group($parent,$child){\n \n // Find the parent dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]===NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n // Find the child dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]===NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $del=array();\n $del[\"member\"] = $child_dn;\n \n $result=@ldap_mod_del($this->_conn,$parent_dn,$del);\n if ($result==false){ return (false); }\n return (true);\n }",
"public function testDeleteGroupMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function destroy(member $member)\n {\n //\n }",
"public function delete(&$group) {\n\t\t/* As of PHP5.3.0, is_a() is no longer deprecated and there is no need to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\t$sql = sprintf(\n\t\t\t\"DELETE FROM %s WHERE groupid = '%u'\",\n\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t(int) $group->getVar('groupid')\n\t\t);\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function delete_member(int $convID, int $memberID) : bool {\n\n\t\t//Get all the messages of member the conversation\n\t\t$messages = $this->getMessages(\n\t\t\t\"WHERE conv_id = ? AND user_id = ?\", \n\t\t\tarray($convID, $memberID));\n\n\t\t//Delete each message\n\t\tforeach($messages as $message){\n\t\t\tif(!$this->delete_message($message))\n\t\t\t\treturn false;\n\t\t}\n\n\t\t//Delete user membership\n\t\tif(!$this->removeMember($convID, $memberID))\n\t\t\treturn false;\n\n\t\t//Success\n\t\treturn true;\n\t}",
"public function dele_group($gid = 0)\n {\n // Am I the owner?\n if ($this->getGroupOwner($gid) != $this->uid) {\n // // If not, I should have write permissions through a share\n // $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $gid);\n // if (empty($perms) || empty($perms['delete'])) {\n // // No, I haven't\n return false;\n // }\n }\n // Cron austragen, wenn vorhanden\n $Cron = new DB_Controller_Cron();\n $Cron->removeJob('calendar', 'remotefolders', $gid);\n // Alle folder settings\n $fSet = new DB_Controller_Foldersetting();\n $fSet->foldersetting_del('calendar', $gid);\n // Löschen\n return ($this->query('DELETE FROM '.$this->Tbl['cal_group'].' WHERE gid='.doubleval($gid))\n && $this->query('ALTER TABLE '.$this->Tbl['cal_group'].' ORDER BY gid'));\n }",
"public function destroy(Member $member)\n {\n $member->delete();\n return 'success';\n }",
"public function deleteMember($memberaddress)\n {\n $this->mailgun()->delete(\"lists/{$this->address}/members/{$memberaddress}\");\n return true;\n }",
"public function removeMember($id, $member_id)\n {\n try\n {\n //carrega projeto\n $project = $this->repository->skipPresenter()->find($id);\n\n //verifica se membro estah no projeto\n if( $this->repository->hasMember($id, $member_id) )\n {\n //Apagar membro\n if($project->members()->detach($member_id))\n {\n return [\n 'error' => false,\n 'message' =>'Member removed.'\n ];\n }\n else\n {\n return [\n 'error' => true,\n 'message' =>'Error ro remove member.'\n ];\n }\n }\n else\n {\n return [\n 'error' => true,\n 'message' =>'this member is not in project.'\n ];\n }\n\n\n } catch (ModelNotFoundException $e) {\n return [\n 'error' => true,\n 'message' =>'Not Found.'\n ];\n } catch (QueryException $e) {\n dd($e);\n $errorMsg = '['.$e->getCode().'] QueryException: Error to remove member!';\n return [\n 'error' => true,\n 'message' => $errorMsg\n ];\n }\n }",
"function group_del_user($group,$user){\n\n //find the parent dn\n $group_info=$this->group_info($group,array(\"cn\"));\n if ($group_info[0][\"dn\"]==NULL){ return (false); }\n $group_dn=$group_info[0][\"dn\"];\n \n //find the child dn\n $user_info=$this->user_info($user,array(\"cn\"));\n if ($user_info[0][\"dn\"]==NULL){ return (false); }\n $user_dn=$user_info[0][\"dn\"];\n\n $del=array();\n $del[\"member\"] = $user_dn;\n \n $result=@ldap_mod_del($this->_conn,$group_dn,$del);\n if ($result==false){ return (false); }\n return (true);\n }",
"public function delete(User $user, groupMember $groupMember)\n {\n $memberIsUser = ($groupMember->user == $user);\n $userOwnsGroup = ($groupMember->group->owner == $user);\n return $memberIsUser || $userOwnsGroup;\n }",
"function delete_group($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_delete_this_grp\"));\n else {\n //Deleting Everything Related To This Group\n $this->delete_group_topics($gid);\n $this->delete_group_videos($gid);\n $this->delete_group_members($gid);\n $db->delete(tbl($this->gp_tbl), array(\"group_id\"), array($gid));\n $this->update_user_total_groups($group['userid']);\n e(lang(\"grp_deleted\"), \"m\");\n }\n }",
"function leave_group($gid, $uid) {\n global $db;\n if (!$this->is_member($uid, $gid))\n e(lang(\"you_not_grp_mem\"));\n elseif ($this->is_owner($gid, $uid))\n e(lang(\"grp_owner_err2\"));\n else {\n $db->delete(tbl($this->gp_mem_tbl), array(\"userid\", \"group_id\"), array($uid, $gid));\n e(lang(\"grp_leave_succ_msg\"), \"m\");\n }\n }",
"function delMemberGroupHandle() {\n global $inputs;\n\n $sql = \"DELETE FROM `member_group` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}"
] |
[
"0.6986197",
"0.6297067",
"0.6242875",
"0.6176342",
"0.61720055",
"0.595862",
"0.5939479",
"0.59043413",
"0.5857205",
"0.58447754",
"0.58157486",
"0.5799575",
"0.5741312",
"0.5675487",
"0.56199783",
"0.5601251",
"0.559207",
"0.55811733",
"0.5576165",
"0.5541627",
"0.5540059",
"0.5535532",
"0.55060095",
"0.5491477",
"0.5451586",
"0.5408411",
"0.5399794",
"0.5392615",
"0.5369166",
"0.5365776"
] |
0.8386489
|
0
|
/ db_mark_url Mark an item as read or unread, given the item's URL. $is_read is a boolean, either true (mark item as read) or false (mark item as unread), and $url is the URL of the article
|
function db_mark_url($is_read, $url)
{
$dbh = db_connect();
echo "Escaped: [", $dbh->real_escape_string("http://foo%20bar/"), "]\n";
return;
$query = sprintf(<<<EOT
UPDATE `items`
SET is_read=?,
mtime=NOW()
WHERE url=?
EOT
);
echo "query [$query]\n";
$stmt = $dbh->prepare($query);
#echo "prepared stmt [$stmt]\n";
$is_read_sql = $is_read ? "TRUE" : "FALSE"; # Needs to be passed by reference
$err =
$stmt->bind_param("ss",
$is_read_sql,
$dbh->real_escape_string($url)
);
echo "bind_param returned [$err]\n";
# XXX - Is this right?
$result = $dbh->query($query);
echo "result [$result]\n";
$err = $stmt->execute();
echo "execute returned [$err]\n";
$nrows = $stmt->affected_rows;
echo "affected rows: [$nrows]\n";
// XXX - This only works with the complete URL. But it should
// also work with internal anchors, both in $url and in the
// database. That is:
// - Strip "#.*" from the end of the URL
// - Strip "#.*" from the URL in the database
// - Compare the two
// (We don't want "foo.html#a" to match "foo.htmlXYZ").
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function db_mark_items($is_read, $items)\n{\n\tif (count($items) < 1)\n\t\t// Nothing to do\n\t\treturn;\n\n\t$dbh = db_connect();\n\n\t// XXX - Would it be better to use a prepared statement, and\n\t// use bind_param() repeatedly to set items' is_read-ness one\n\t// by one?\n\t// Time it and see.\n\t$query = sprintf(<<<EOT\nUPDATE\t`items`\nSET\tis_read=%s,\n\tmtime=NOW()\nWHERE\tid IN(%s)\nEOT\n\t\t\t ,\n\t\t\t ($is_read ? \"TRUE\" : \"FALSE\"),\n\t\t\t implode(\",\", $items));\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 = \"Error updating feed information: \" . $dbh->error;\n\t}\n}",
"protected function markRead($id, $userId, $isRead)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_read' => $isRead,\n 'updated_at' => time()\n ], [\n 'user_id' => $userId,\n 'id' => $id\n ])\n ->execute();\n }",
"public function set_uri ($url) {\n\t\tglobal $wpdb;\n\n\t\tif ($this->found()) :\n\t\t\t// Update link_rss\n\t\t\t$result = $wpdb->query(\"\n\t\t\tUPDATE $wpdb->links\n\t\t\tSET\n\t\t\t\tlink_rss = '\".esc_sql($url).\"'\n\t\t\tWHERE link_id = '\".esc_sql($this->id).\"'\n\t\t\t\");\n\n\t\t\t$ret = ($result ? true : false);\n\t\telse :\n\t\t\t$ret = false;\n\t\tendif;\n\t\treturn $ret;\n\t}",
"public function mark_as_read($read_id){\n\n\t\t$this->query(\"UPDATE `messege` SET `view` = 1 WHERE `id` = '$read_id'\");\n\t}",
"public function GetMarkAllAsReadURL();",
"public function markRead ()\n\t{\n\t\tif (isset($_COOKIE[\"read\"]) && $_COOKIE[\"read\"] == 1)\n\t\t{\n\t\t\t$Statement = $this->Database->prepare(\"UPDATE messages SET unread = 0 WHERE reciever = ?\");\n\t\t\t$Statement->execute(array($this->id));\n\t\t\tsetcookie('read', 0, time()-3600);\n\t\t}\n\t}",
"public function markAsRead()\n {\n if ($this->auth->alerts_unread) {\n $this->alert->where('user_id', $this->userId)->whereNull('read_at')->update([\n 'read_at' => Carbon\\Carbon::now()\n ]);\n }\n\n $this->alert->where('user_id', $this->userId)->update(['is_marked' => true]);\n }",
"public function markAsReadFor($userId, $read = true, array $conditions = [])\n {\n $this\n ->service\n ->markAsReadFor($userId, $this->getId(), $read, $conditions)\n ;\n }",
"public function mark_read_by_user($userid)\n\t{\n\t\t$query = $this->db\n\t\t\t\t\t\t->set('is_read', 1)\n\t\t\t\t\t\t->where('user_id', $userid)\n\t\t\t\t\t\t->update('notif_rcpts');\n\n\t\tif($query)\n\t\t{\n\t\t\t$result['status'] = true;\n\t\t\t$result['data'] = \"Marked as read.\";\n\n\t\t\treturn $result;\n\t\t}\n\t\telse return $this->get_db_error();\n\t}",
"public function markAsRead($id, $userId);",
"public function addEntry ( $uri, $date = NULL, $save = TRUE, $is_url = FALSE )\n {\n if ( !$date )\n $date = date( 'Y-m-d' );\n \n $url = ( $is_url ) ? $uri : $this->pref . $uri; // make full path if it is not yet\n \n if ( ! $this->entryExists( $url ) )\n {\n try\n {\n // create the node and add the data.\n $new_url_node = $this->map->addChild( 'url' );\n $new_url_node->addChild( 'loc', $url );\n $new_url_node->addChild( 'lastmod', $date );\n\n if ( $save )\n $this->save();\n }\n catch (Exception $e)\n {\n Kohana::$log->add( LOG_ERR, $e->getMessage() );\n return FALSE;\n }\n }\n \n return TRUE;\n }",
"function setUrl($url);",
"public function markAsRead($id) {\n $email = $this->find($id);\n if ($email) {\n $email->is_read = 1;\n return $email->save();\n }\n return false;\n }",
"public function request_url(&$url)\n\t{\t\tif($url == 'feed') $this->is_feed = true;\n\t}",
"function for_mark($mark)\n {\n $query = $this\n ->select('url')\n ->where(['link' => $mark->link_id, 'status' => 1])\n ->order_by('created DESC');\n return $query->fetch_one();\n }",
"public function setRead($isRead)\n {\n $this->isRead = $isRead;\n }",
"function set ($url, $rss) {\n $this->ERROR = \"\";\n $cache_file = $this->file_name( $url );\n $fp = @fopen( $cache_file, 'w' );\n \n if ( ! $fp ) {\n $this->error(\n \"Cache unable to open file for writing: $cache_file\"\n );\n return 0;\n }\n \n \n $data = $this->serialize( $rss );\n fwrite( $fp, $data );\n fclose( $fp );\n \n return $cache_file;\n }",
"public function setURL($url);",
"public function setURL($url);",
"private function crawl($url, bool $entryPoint = false): void\n {\n $results = $this->extractor\n ->searchFor(['urls', 'emails'])\n ->at($entryPoint ? $url : $url->name)\n ->get();\n\n foreach (array_unique($results['urls']) as $item) {\n $item = $this->cleanUrl($item);\n\n if ($this->canBeStored($item) && $this->isValidUrl($item) && $this->isNotMediaFile($item) && $this->isInScope($item)) {\n Url::firstOrCreate(['name' => $item, 'search_id' => $this->search->id]);\n }\n }\n\n foreach (array_unique($results['emails']) as $email) {\n if ($this->canBeStored($email) && $this->isValidEmail($email)) {\n Email::firstOrCreate(['name' => $email, 'search_id' => $this->search->id]);\n }\n }\n\n if (! $entryPoint) {\n $url->update(['is_crawled' => true]);\n }\n }",
"public function markItem($itemHash, $starred, $feed = false, $item = false) {\n $save = false;\n $feeds = $this->getFeeds();\n $feedHash = substr($itemHash, 0, 6);\n $items = $this->getItems();\n\n if (isset($items[$itemHash]) && $starred === 0) {\n $save = true;\n unset($items[$itemHash]);\n unset($GLOBALS['starredItems'][$itemHash]);\n if (isset($feeds[$feedHash])){\n unset($feeds[$feedHash]['items'][$itemHash]);\n $feeds[$feedHash]['nbAll']--;\n if ($feeds[$feedHash]['nbAll'] <= 0) {\n unset($feeds[$feedHash]);\n }\n }\n } else if (!isset($items[$itemHash]) && $starred === 1) {\n // didn't exists, want to star it\n $save = true;\n\n $items[$itemHash] = [time(), 0];\n\n if (!isset($feeds[$feedHash])){\n $feed['nbAll'] = 0;\n $feed['items'] = array();\n // remove useless feed information\n unset($feed['timeUpdate']);\n unset($feed['nbUnread']);\n unset($feed['lastUpdate']);\n unset($feed['foldersHash']);\n unset($feed['error']);\n $feeds[$feedHash] = $feed;\n }\n \n $feeds[$feedHash]['items'][$itemHash] = $item;\n $feeds[$feedHash]['nbAll']++;\n\n $GLOBALS['starredItems'][$itemHash] = 1;\n }\n\n if ($save) {\n arsort($items);\n $this->setItems($items);\n $this->setFeeds($feeds);\n }\n\n return $save;\n }",
"public static function set(string $code, string $url = '') : bool\n\t{\n\t\tOption::set(static::MODULE_ID, static::OPTION_ACCESS_NOTIFICATION, $code);\n\t\tOption::set(static::MODULE_ID, static::OPTION_LAST_CHECK_ACCESS_NOTIFICATION, time());\n\t\tOption::set(static::MODULE_ID, static::OPTION_NOTIFICATION_URL, $url);\n\n\t\treturn true;\n\t}",
"public function markAsRead($id, $userId)\n {\n $this->markRead($id, $userId, 1);\n }",
"public function markAllAsReadForUser($userId);",
"public function markAllAsReadForUser($userId);",
"public function markAsRead(array $emailIds, $read = true)\n {\n $conversationIds = Email::whereIn('id', $emailIds)\n ->whereCreatedBy(Auth::id())// only current user\n ->pluck('conversation_id')->toArray();\n // read conversations..\n $emails = $this->repo->make()\n ->whereIn('conversation_id', $conversationIds)\n ->update(['is_read' => $read]);\n\n Firebase::updateUserEmailCount(Auth::id());\n }",
"public function markAllRead($userId)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_read' => 1\n ], [\n 'user_id' => $userId,\n 'is_read' => 0\n ])\n ->execute();\n }",
"public function markRead($user)\n {\n $this->getNotification($user)->markAsRead();\n }",
"public function markRead($messageId) {\n return $this->_post(\n $this->_serverPath['mark'],\n array(\n 'messages' => $messageId,\n 'read' => '1'\n )\n );\n\t}",
"public function setUrl($url);"
] |
[
"0.6225964",
"0.5955626",
"0.5546245",
"0.52453727",
"0.5148621",
"0.507149",
"0.5024667",
"0.49758586",
"0.4974626",
"0.4918926",
"0.48362812",
"0.4796424",
"0.4775749",
"0.4701671",
"0.46826252",
"0.4679461",
"0.4667278",
"0.46416834",
"0.46416834",
"0.46272707",
"0.46226856",
"0.46225742",
"0.46201378",
"0.4613117",
"0.4613117",
"0.4607209",
"0.46069068",
"0.4599663",
"0.45481145",
"0.45450583"
] |
0.64438725
|
0
|
Labels via amazon rekognition
|
private function _labelAmazonRekognition(File $file, $skipFetchIfAlreadyExists)
{
if (
$this->awsCredentials['key'] === '' ||
$this->awsCredentials['secret'] === ''
) {
throw new \Exception('AWS credentials are not set. Could not label the file.');
}
// Check if it's a viable file first. If not, it will throw an exception,
// so it won't continue any execution.
try {
$image = $this->getImage($file);
} catch (\Exception $e) {
throw new \Exception(
'Can not label, because it is not an image. Error: ' .
$e->getMessage()
);
}
$path = $this->getFileDataDir($file) . '/' . $this->getLabelFileName('amazon_rekognition');
$alreadyExists = $skipFetchIfAlreadyExists && file_exists($path);
$result = [];
if ($alreadyExists) {
$result = json_decode(file_get_contents($path), true);
} else {
if ($this->logger) {
$this->logger->debug('Labelling data does not exist. Feching from service ...');
}
$image->widen(1024, function ($constraint) {
$constraint->upsize();
});
$image->heighten(1024, function ($constraint) {
$constraint->upsize();
});
$result = $this->awsRekognitionClient->detectLabels([
'Image' => [
'Bytes' => $image->encode('jpg'),
],
'MinConfidence' => $this->awsRekognitionMinConfidence,
]);
file_put_contents($path, json_encode($result->toArray()));
}
$tags = [];
foreach ($result['Labels'] as $label) {
$this->_labels[] = [
'name' => $label['Name'],
'confidence' => $label['Confidence'],
'meta' => $label,
];
if ($label['Confidence'] >= $this->labellingConfidence) {
$tags[] = $label['Name'];
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function generateLabels();",
"abstract function labels();",
"public function labels()\n {\n }",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel() {}",
"public function getLabel() {}",
"public function getLabels();",
"public function getLabels();",
"public function getLabels();",
"public function generateLabel(generateLabel $request);",
"abstract public function getLabel();",
"public function get_label();",
"public function get_label();",
"public function GetLabel();",
"function wpsl_labels() {\n\n $labels = array(\n 'search',\n 'search_btn',\n 'preloader',\n 'radius',\n 'no_results',\n 'results',\n 'more',\n 'directions',\n 'no_directions',\n 'back',\n 'street_view',\n 'zoom_here',\n 'error',\n 'phone',\n 'fax',\n 'email',\n 'url',\n 'hours',\n 'start',\n 'limit',\n 'category',\n 'category_default'\n );\n\n return $labels;\n}",
"public abstract function label();"
] |
[
"0.64251554",
"0.611238",
"0.60693574",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.60626155",
"0.6035472",
"0.6035472",
"0.59910977",
"0.59910977",
"0.59910977",
"0.59859335",
"0.59278864",
"0.59220636",
"0.59220636",
"0.5872798",
"0.5864932",
"0.5797893"
] |
0.61907315
|
1
|
1) add player to the list of team members
|
function addPlayer ($player) {
$this->members = array_push($this->members,$player);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function addPlayer(Player $player) {\n $this->players[] = $player;\n }",
"public function addTeamPlayed(&$team){\n array_push($this->teamsPlayed, $team);\n $this->numOfOpponents++;\n }",
"abstract protected function putPlayersInDuel(): void;",
"function addPlayer()\n\t{\n\t\t$uid = $_SESSION['uid'];\n\t\t$gid = $_POST['gid'];\n\t\t$ct = $_POST['country'];\n\t\t\n\t\t$query = \"UPDATE games\n\t\t\t\t\tSET players=players+1\n\t\t\t\t\tWHERE gid=$gid;\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$query = \"INSERT INTO in_game(uid, gid, country)\n\t\t\t\t\tVALUES('$uid', $gid, '$ct');\";\n\t\t\t\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$this->addStartUnits($ct, $gid, $uid);\n\t\t\n\t\t$query = \"SELECT *\n\t\t\t\t\tFROM games\n\t\t\t\t\tWHERE gid='$gid';\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$players = mysql_result($result, 0, \"players\");\n\t\t\n\t\tif($players == 7)\n\t\t{\n\t\t\t$date = date(\"Y-m-d H:i:s\", time());\n\t\t\t$date = strtok($date, \" \");\n\t\t\t$year = strtok($date, \"-\");\n\t\t\t$month = strtok(\"-\");\n\t\t\t$day = strtok(\"-\");\n\t\t\t$day = (int)$day + 7;\n\t\t\t$datetime = $year . \"-\" . $month . \"-\" . $day . \" 00:00:00\";\n\t\t\t$query = \"UPDATE games\n\t\t\t\t\t\tSET running=true, deadline='$datetime'\n\t\t\t\t\t\tWHERE gid=$gid;\";\n\t\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t}\n\t}",
"function add_tournament_player($params)\n {\n $data = [];\n foreach($params[\"player_id\"] as $param){\n $data[] = [\n \"tournament_team_id\" => $params[\"tournament_team_id\"], \n \"player_id\" => $param \n ];\n }\n $this->db->insert_batch('tournament_players', $data);\n }",
"function playerAdded($playerName, $numberOfPlayers) {\n\t}",
"private function add_user_to_existing_game()\n {\n\n $number_of_existing_players = intval($this->gameUserCanPlay[\"number_of_players\"]) + 1;\n $this->number_of_players_in_current_user_game = $number_of_existing_players;\n $this->update_multiple_fields($this->games_table_name, [\"number_of_players\" => $number_of_existing_players], \"game_id ='{$this->gameIDUserCanPlay}'\");\n $this->update_multiple_fields($this->users_table_name, [\"game_id_about_to_play\" => $this->gameIDUserCanPlay], \"user_id='{$this->userID}'\");\n $this->game_10_words = $this->fetch_data_from_table($this->games_table_name , 'game_id' , $this->gameIDUserCanPlay)[0][\"words\"];\n $this->game_10_words = json_decode($this->game_10_words);\n\n /* if players are complete game should start */\n if ($number_of_existing_players == $this->config->MaximumNumberOfPlayers) {\n /* tell javascript that the game has started */\n $this->update_record($this->games_table_name, 'started', '1', 'game_id', $this->gameIDUserCanPlay);\n /* update current_game_id for all users in game */\n $this->update_record($this->users_table_name , 'current_game_id' , $this->gameIDUserCanPlay , 'game_id_about_to_play' , $this->gameIDUserCanPlay );\n /* Subtract the amount for all players */\n //$this->update_multiple_fields($this->users_table_name , ['account_balance' => \" account_balance - {$this->amount}\"] , \"game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n /* Make sure all users point is set to 0 immediately game starts and ends*/\n // $this->executeSQL(\"UPDATE {$this->users_table_name} SET account_balance = cast(account_balance as int) - {$this->amount} WHERE game_id_about_to_play = '{$this->gameIDUserCanPlay}'\");\n $this->update_record($this->users_table_name , 'current_point' , 0 , 'game_id_about_to_play' , $this->gameIDUserCanPlay);\n $this->start_time = time() * 1000;\n $this->update_record($this->games_table_name , 'start_time' , $this->start_time , 'game_id' , $this->gameIDUserCanPlay);\n\n $this->showGameChat = true;\n\n }\n\n return true;\n }",
"public function add($team);",
"private function welcome_players()\n\t{\n\t\t$players = $this->players->all(); \n\n\t\t\n\t\t$players_array = array ();\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\t$player['equity'] = $this->players->equity($player['player']);\n\t\t\t$players_array[] = (array) $player;\n\t\t}\n\t\t$this->data['test'] = $players_array; \n\t}",
"function addPlayer($username, $pokemons) {\n\tjoinGame(getOpenGame(), $username);\n\n\t// $_SESSION['pokemon'] = $pokemons;\n\n\t$_SESSION['username'] = $username;\n\t$_SESSION['round'] = 0;\n\t$player_info['username'] = $username;\n\t$player_info['pokemon'] = [];\n\n\t// the plural of pokemon is not actually pokemons, but this way the naming is easier\n\tforeach($pokemons as $pokemon) {\n\t\t$player_info['pokemon'][$pokemon] = resetPokemonVariables(getPokemonInfo($pokemon));\n\t}\n\t$player_info['active_pokemon'] = $pokemons[0];\n\n\n\tif (!isReady('player1')) {\n\t\t$player_info['playernum'] = 'player1';\n\t\twritePlayerData('player1', $player_info);\n\t\t$_SESSION['playernum'] = 'player1';\n\n\t\treturn true;\n\t} elseif (!isReady('player2')) {\n\t\t$player_info['playernum'] = 'player2';\n\t\twritePlayerData('player2', $player_info);\n\t\t$_SESSION['playernum'] = 'player2';\n\n\t\t// second player was added -> start game\n\t\tupdateGamestate([\"round\" => 1]);\n\n\t\treturn true;\n\t} else {\n\t\t// all spaces occupied (for now)\n\t\treturn false;\n\t}\n}",
"public function addMembers(int $projectId, array $params) : void;",
"public function storeplayers(){\n \t$data = file_get_contents(\"https://fantasy.premierleague.com/api/bootstrap-static/\");\n \t$playersJson = json_decode($data);\n \t$players = $playersJson->elements;\n \t$saveCount = 0;\n \t$playerCodes = Players::pluck('code')->toArray();\n \tforeach($players as $player){\n \t\tif (!in_array($player->code, $playerCodes)){\n \t\t\t$savePlayer = new Players();\n \t\t\t$savePlayer->id = $player->id;\n \t\t\t$savePlayer->code = $player->code;\n \t\t\t$savePlayer->first_name = $player->first_name;\n \t\t\t$savePlayer->second_name = $player->second_name;\n \t\t\t$savePlayer->team = $player->team;\n \t\t\t$savePlayer->team_code = $player->team_code;\n \t\t\t$savePlayer->photo = $player->photo;\n \t\t\t$savePlayer->form = $player->form;\n \t\t\t$savePlayer->total_points = $player->total_points;\n \t\t\t$savePlayer->influence = $player->influence;\n \t\t\t$savePlayer->creativity = $player->creativity;\n \t\t\t$savePlayer->threat = $player->threat;\n \t\t\t$savePlayer->ict_index = $player->ict_index;\n \t\t\t$savePlayer->save();\n \t\t\t$saveCount++;\n \t\t}\n \t\tif($saveCount==100){\n \t\t\tbreak;\n \t\t}\n \t}\n }",
"function newPlayer($player) {\n\n\t\t// creates player object ...\n\t\t$player_item = new Player($player);\n\t\tif ($player_item->login == \"\")\n\t\t\t{\n\t\t\t//$this->console(\"New broken Player entered - ignored.\");\n\t\t\treturn;\n\t\t\t}\n\t\t\n\t\tif ($player_item->id == $this->lastloginid)\n\t\t\t{\n\t\t\t//$this->console(\"Dublicated join event - ignored.\");\n\t\t\treturn;\n\t\t\t}\n\t\t$this->lastloginid = $player_item->id;\n\n\t\t// adds a new player to the intern player list ...\n\t\t$this->server->players->addPlayer($player_item);\n\n\t\t// display console message ...\n\t\t$this->console('<< player {1} joined the game [{2}]',\n\t\t\t$player_item->id,\n\t\t\t$player_item->login);\n\n\t\t// send chat message to player ...\n\t\t// format message parameters ...\n\t\t$message = myWelcomeMessage($this, $player_item);\n\n\t\t// replace colors ...\n\t\t$message = $this->formatColors($message);\n\n\t\t// send the message ...\n\t\t$message = str_replace('{br}', \"\\n\", $message);\n\t\tif ($this->settings['welcome_msg_window']) {\n\t\t \tif ($player_item->login)\n\t\t\t\tpopup_msg($player_item->login, $message, 10000);\n\t\t} else {\n\t\t\t$this->client->addCall('ChatSendServerMessageToLogin', array(str_replace(\"\\n\\n\", \"\\n\", $message), $player_item->login));\n\t\t\t$this->client->multiquery();\n\t\t}\n\n\t\t// release a new player connect event ...\n\t\t$this->releaseEvent('onPlayerConnect', $player_item);\n\t}",
"public function addPlayer($playerId,$role) {\n\t\t$this->_players[$playerId] = $role;\n\t}",
"private function addMemberToTeam($teamId, $MemberId, $rolesList)\n {\n \t$em = $this->getDoctrine()->getManager();\n\n $team = $em->getRepository('ProjectManagerUserBundle:Team')->find($teamId);\n $member = $em->getRepository('ProjectManagerUserBundle:User')->find($MemberId);\n\n foreach($rolesList as $key => $role) {\n $role = $em->getRepository('ProjectManagerUserBundle:Role')->find($role->getId());\n $teamMember = new TeamMember();\n $teamMember->setTeam($team);\n $teamMember->setMember($member);\n $teamMember->setRole($role);\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($teamMember);\n }\n $em->flush();\n }",
"public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}",
"private function newMemberSetUp() {\n\t\t$this->infoAlert(\"Welcome! Looks like you're new here, We'll set you up with a default team. Have fun!\");\n\t\t$this->teams[0] = new TeamManagerTeam();\n\n\t\t$userData = $this->getUserData();\n\t\t$fname = $userData['fname'];\n\t\t$lname = $userData['lname'];\n\t\t$phone = $userData['phone'];\n\t\t$email = $userData['email'];\n\t\t$position = \"Manager\";\n\t\t$manager = new TeamManagerMember($fname, $lname, $phone, $email, $position);\n\n\t\t$manager = $this->teams[0]->addMember($manager);\n\n\t\tadd_user_meta( $this->user_id, $this->user_meta_key, $this->teams[0]->id );\n\t}",
"private function generatePlayers() : void\n {\n $indexes = array_rand($this->availablePlayerNames, $this->numOfPlayers);\n \n $firstIndex = $indexes[0];\n $firstName = $this->availablePlayerNames[$firstIndex];\n\n $firstPlayer = new Player();\n $firstPlayer->setName($firstName);\n\n $this->firstPlayer = $firstPlayer;\n $this->curPlayer = $this->firstPlayer;\n\n for ($i=1; $i < count($indexes); $i++) {\n $curIndex = $indexes[$i];\n $curName = $this->availablePlayerNames[$curIndex];\n\n $curPlayer = new Player();\n $curPlayer->setName($curName);\n \n $this->curPlayer->setNext($curPlayer);\n\n $this->curPlayer = $this->curPlayer->getNext();\n }\n }",
"function team_list()\n {\n }",
"public function addNewPlayer($name) {\n $startPosition = $this->getStartPosition();\n // push the player's name onto that position\n array_push($this->dungeon[$startPosition[0]]->row[$startPosition[1]]->col[$startPosition[2]]->players, $name);\n return $startPosition;\n }",
"public function add_member($team_id,$user_id){\n if ($this->CreateTeamModel->add_member($team_id,$user_id)) {\n echo '<script>alert(\"Team Member has been added successfully!\");</script>';\n redirect(base_url().'team/view/'.$team_id);\n } else {\n echo '<script>alert(\"Team Member addition failed!\");</script>';\n redirect(base_url().'team/view/'.$team_id);\n }\n }",
"public function getPlayers();",
"public function getPlayers();",
"public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(77, $players);\n }",
"public function run()\n {\n $role_player = Role::where('name', 'player')->first();\n\n $player_user = new User();\n $player_user->name = 'Mary';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position = \"Sebastopol, CA, USA\";\n $player->date_of_birth = \"2000-12-12\";\n $player->phone_number = \"0879687564\";\n $player->address = \"27 fake str\";\n $player->emergency_name= \"Kevin Smith\";\n $player->emergency_number= \"0869687364\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'Ragin’ Cajuns')->first()->id;\n $player->save();\n\n $player_user = new User();\n $player_user->name = 'Anne';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position = \"Sebastopol, CA, USA\";\n $player->date_of_birth = \"2000-12-12\";\n $player->phone_number = \"0865687564\";\n $player->address = \"25 fake str\";\n $player->emergency_name= \"Linda Smith\";\n $player->emergency_number= \"0863387364\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'Scarlet Raptors')->first()->id;\n $player->save();\n\n $player_user = new User();\n $player_user->name = 'Anne';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position = rand(1, 100) . \"Sebastopol, CA, USA\";\n $player->date_of_birth = \"2000-12-12\";\n $player->phone_number = \"0875689544\";\n $player->address = \"25 fake str\";\n $player->emergency_name= \"Anne Smith\";\n $player->emergency_number= \"0863388864\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'Scarlet Raptors')->first()->id;\n $player->save();\n\n $player_user = new User();\n $player_user->name = 'David';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position =\n $player->date_of_birth =\"1990-11-25\";\n $player->phone_number =\"0879345464\";\n $player->address = rand(1, 100) . \" Main St\";\n $player->emergency_name = \"Keith\";\n $player->emergency_number =\"0865686564\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'Dream Crushers')->first()->id;\n $player->save();\n\n $player_user = new User();\n $player_user->name = 'Jack';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position =\n $player->date_of_birth =\"1980-09-10\";\n $player->phone_number =\"0879745464\";\n $player->address = rand(1, 100) . \" Main St\";\n $player->emergency_name = \"Haley\";\n $player->emergency_number =\"0857887568\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'We Showed Up')->first()->id;\n $player->save();\n\n $player_user = new User();\n $player_user->name = 'Megan';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position =\n $player->date_of_birth =\"2000-10-05\";\n $player->phone_number =\"0870430464\";\n $player->address = rand(1, 100) . \" Main St\";\n $player->emergency_name = \"Mark\";\n $player->emergency_number =\"0869690664\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'Sea Lions')->first()->id;\n $player->save();\n\n $player_user = new User();\n $player_user->name = 'John';\n $player_user->email = '[email protected]';\n $player_user->password = bcrypt('player');\n $player_user->save();\n $player_user->roles()->attach($role_player);\n\n $player = new Player();\n $player->position =\n $player->date_of_birth =\"1999-12-20\";\n $player->phone_number =\"0870430464\";\n $player->address = rand(1, 100) . \" Main St\";\n $player->emergency_name = \"Amy\";\n $player->emergency_number =\"0869690664\";\n $player->user_id = $player_user->id;\n $player->team_id = Team::where('name', 'We Showed Up')->first()->id;\n $player->save();\n\n }",
"protected function addPlayerRank(&$player)\n {\n $id = (int)$player['pid'];\n if ($id == 0)\n {\n $player['rank'] = 0;\n }\n else\n {\n $rows = $this->pdo->query(\"SELECT name, rank FROM player WHERE id={$id} LIMIT 1\");\n if ($row = $rows->fetch())\n {\n $sn = strtolower(trim($player['player']));\n $dn = strtolower(trim($row['name']));\n $player['rank'] = ($dn == $sn) ? (int)$row['rank'] : 0;\n }\n else\n {\n $player['rank'] = 0;\n }\n }\n }",
"public function registerPlayer(Player $player): void\n {\n foreach ($this->players as $key => $value) {\n if ($value->id === null) {\n // Can inject player in non-active slot.\n $this->players[$key] = $player;\n\n break;\n }\n }\n }",
"public function test_list_players()\n {\n $players = $this->btwServer->listPlayers();\n\n $this->assertCount(0, $players);\n }",
"private function onPlayerCreated(Player $player) : void{\n\t\t$rm = new ReflectionMethod(NetworkSession::class, \"onPlayerCreated\");\n\t\t$rm->invoke($this, $player);\n\t\t$this->player_add_resolver->resolve($player);\n\t}",
"public function test_list_players()\n {\n $players = $this->postScriptumServer->listPlayers();\n\n $this->assertCount(77, $players);\n }"
] |
[
"0.6747361",
"0.6694974",
"0.66586375",
"0.6504293",
"0.647288",
"0.643594",
"0.6350118",
"0.6275744",
"0.60907537",
"0.60700125",
"0.5990001",
"0.59389395",
"0.59386134",
"0.5875664",
"0.58647996",
"0.5858573",
"0.5856854",
"0.5855814",
"0.58398795",
"0.58387375",
"0.5833035",
"0.58319515",
"0.58319515",
"0.58157194",
"0.58150357",
"0.58044565",
"0.57944286",
"0.5763671",
"0.5762732",
"0.57579046"
] |
0.8097696
|
0
|
Return only the public value present in the table
|
public function getPublicValues()
{
// filter and sort values
$publicValues = [];
foreach (self::$publicDatatypes as $datatypeId) {
if (isset($this->values[$datatypeId])) {
$publicValues[$datatypeId] = $this->values[$datatypeId];
}
}
return $publicValues;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function findAllPublic(){\n $qb = $this->getMainPublicQb();\n return $qb->getQuery()->getResult();\n }",
"function getPublicPost() {\n return getAll(\"SELECT * FROM posting WHERE status= 'public'\");\n}",
"public function findPublic(): array;",
"private function getIPPublic ()\n {\n $dbs = new DB ( $this->config['database'] );\n $search = $dbs->query(\"SELECT * FROM tbl_client_connection_priv WHERE\n priv_client_id LIKE '\". $this->c .\"%' order by private_rec_date desc limit 1\");\n\t\t\tif ( count ( $search ) ) {\n\t\t\t\t$this->result['id'] = $this->c;\n\t\t\t\t$this->result['real_ip_address'] = $search[0]['real_client_ip'];\n\t\t\t} else\n\t\t\t\t$this->result['data']['result'] = $this->c . \":No usage history found\";\n\t\t\t\n\t\t\t$dbs->CloseConnection ();\n\t\t\treturn;\n\t\t}",
"public function set_public($value) {\r\n $this->public = $value;\r\n data::add(\"public\", $this->public == \"\" ? 1 : $this->public, $this->table_fields);\r\n }",
"function getPublicite($identifiant)\r\n{\r\n\tglobal $pdo;\r\n\t\r\n\t$SQL = \"SELECT * FROM pas_publicite WHERE identifiant = '$identifiant'\";\r\n\t$reponse = $pdo->query($SQL);\r\n\t$req = $reponse->fetch();\r\n\t\r\n\treturn $req['code'];\r\n}",
"public function getViaTableAttributesValue();",
"public static function getVisibleValueToProvider (){\n \t\t$settings = self::where('key', 'visible_value_to_provider')->first();\n\n \t\tif($settings)\n\t\t\treturn $settings->value;\n\t\telse \n\t\t\treturn 0;\n \t}",
"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 isPublic()\n {\n return $this->_public;\n }",
"public function isPrivateValues(): bool;",
"protected function getIsPublicQuery()\n {\n return $this->isPublicQuery;\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 publicUser()\n {\n return $this->state(function (array $attributes) {\n return [\n 'is_public' => 1,\n ];\n });\n }",
"public function isPublic()\n {\n return $this->public;\n }",
"public function getViaTableCondition();",
"protected function LiveTableValue()\n {\n return $this->LiveRawTableValue();\n }",
"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}",
"public function isPublic() {\n\t\treturn $this->public;\n\t}",
"function mdatosPublicaciones(){\n\t\t$conexion = conexionbasedatos();\n\n\t\t$consulta = \"select * from final_publicacion order by FECHA_PUBLICACION desc; \";\n\t\tif ($resultado = $conexion->query($consulta)) {\n\t\t\treturn $resultado;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}",
"function dataGetPublishStatus($p_id)\n {\n $p_id = parent::escape($p_id);\n \n $sql = 'SELECT isactive ';\n $sql .= 'FROM user ';\n $sql .= 'WHERE id = ' . $p_id . ' ';\n \n $result_mysqli = parent::query($sql);\n $result = parent::fetchAllRows($result_mysqli);\n parent::clear($result_mysqli); \n\n return $result; \n }",
"public function scopePublic($query)\n {\n return $query->where('is_public', true);\n }",
"public function scopePublic($query)\n {\n return $this->where('is_public', true);\n }",
"public function getMappedIdFieldExternal()\r\n\t{\r\n\t\t// Query table\r\n\t\t$sql = \"select external_source_field_name from redcap_ddp_mapping \r\n\t\t\t\twhere project_id = \".$this->project_id.\" and is_record_identifier = 1 limit 1\";\r\n\t\t$q = db_query($sql);\t\t\r\n\t\t// Return boolean\r\n\t\treturn (db_num_rows($q) > 0 ? db_result($q, 0) : false);\r\n\t}",
"public function scopePublicId($query, $id)\n {\n return $query->where('public_id',$id);\n }",
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"IDP\" =>$this->IDP);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"public function getPublicacion()\n {\n return $this->hasOne(Publicacion::className(), ['id' => 'id_publicacion']);\n }",
"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 getCpBriefAnreden() {\n $sql=\"select distinct (cp_salutation) from contacts\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n return $rs;\n}",
"public function getAllportariasPublicadasAprovadasEspera() {\r\n $this->db->select('*');\r\n $this->db->from('portaria');\r\n $this->db->where('status', 'Publicada')->or_where('status', 'Aprovada')->or_where('status', 'Espera')->or_where('status', 'Retornada');\r\n $this->db->join('tipo', 'portaria.idTipo = tipo.idTipo');\r\n $query = $this->db->get();\r\n return $query->result();\r\n }"
] |
[
"0.6271382",
"0.60009",
"0.5982593",
"0.5932356",
"0.5858936",
"0.5717186",
"0.571535",
"0.5665002",
"0.560792",
"0.5567621",
"0.549849",
"0.5481085",
"0.54446065",
"0.5423173",
"0.5396899",
"0.538682",
"0.53859985",
"0.53826433",
"0.53788114",
"0.53747267",
"0.5373333",
"0.5371293",
"0.5335402",
"0.53168714",
"0.5310167",
"0.5310013",
"0.5309171",
"0.5300102",
"0.5299593",
"0.5292651"
] |
0.6330177
|
0
|
Checkbox sanitization callback. Sanitization callback for 'checkbox' type controls. This callback sanitizes `$checked` as a boolean value, either TRUE or FALSE.
|
function fastshop_sanitize_checkbox( $checked ) {
return (bool) $checked;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function influencer_sanitize_checkbox( $checked ){\r\n // Boolean check.\r\n return ( ( isset( $checked ) && true == $checked ) ? true : false );\r\n}",
"function themeslug_sanitize_checkbox( $checked ) {\r\n // Boolean check.\r\n return ( ( isset( $checked ) && true == $checked ) ? true : false );\r\n}",
"function store_sanitize_checkbox( $input ) {\n\t if ( $input == 1 ) {\n\t return 1;\n\t } else {\n\t return '';\n\t }\n\t}",
"function taxonomy_meta_box_sanitize_cb_checkboxes($taxonomy, $terms)\n {\n }",
"function checkbox($args = '', $checked = false) {\r\n $defaults = array('name' => '', 'id' => false, 'class' => false, 'group' => '', 'special' => '', 'value' => '', 'label' => false, 'maxlength' => false);\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n\r\n $return = '';\r\n // Get rid of all brackets\r\n if (strpos(\"$name\", '[') || strpos(\"$name\", ']')) {\r\n $replace_variables = array('][', ']', '[');\r\n $class_from_name = $name;\r\n $class_from_name = \"wpi_\" . str_replace($replace_variables, '_', $class_from_name);\r\n } else {\r\n $class_from_name = \"wpi_\" . $name;\r\n }\r\n // Setup Group\r\n $group_string = '';\r\n if ($group) {\r\n if (strpos($group, '|')) {\r\n $group_array = explode(\"|\", $group);\r\n $count = 0;\r\n foreach ($group_array as $group_member) {\r\n $count++;\r\n if ($count == 1) {\r\n $group_string .= \"$group_member\";\r\n } else {\r\n $group_string .= \"[$group_member]\";\r\n }\r\n }\r\n } else {\r\n $group_string = \"$group\";\r\n }\r\n }\r\n // Use $checked to determine if we should check the box\r\n $checked = strtolower($checked);\r\n if ($checked == 'yes' ||\r\n $checked == 'on' ||\r\n $checked == 'true' ||\r\n ($checked == true && $checked != 'false' && $checked != '0')) {\r\n $checked = true;\r\n } else {\r\n $checked = false;\r\n }\r\n $id = ($id ? $id : $class_from_name);\r\n $insert_id = ($id ? \" id='$id' \" : \" id='$class_from_name' \");\r\n $insert_name = ($group_string ? \" name='\" . $group_string . \"[$name]' \" : \" name='$name' \");\r\n $insert_checked = ($checked ? \" checked='checked' \" : \" \");\r\n $insert_value = \" value=\\\"$value\\\" \";\r\n $insert_class = \" class='$class_from_name $class wpi_checkbox' \";\r\n $insert_maxlength = ($maxlength ? \" maxlength='$maxlength' \" : \" \");\r\n // Determine oppositve value\r\n switch ($value) {\r\n case 'yes':\r\n $opposite_value = 'no';\r\n break;\r\n case 'true':\r\n $opposite_value = 'false';\r\n break;\r\n }\r\n // Print label if one is set\r\n if ($label)\r\n $return .= \"<label for='$id'>\";\r\n // Print hidden checkbox\r\n $return .= \"<input type='hidden' value='$opposite_value' $insert_name />\";\r\n // Print checkbox\r\n $return .= \"<input type='checkbox' $insert_name $insert_id $insert_class $insert_checked $insert_maxlength $insert_value $special />\";\r\n if ($label)\r\n $return .= \" $label</label>\";\r\n return $return;\r\n }",
"public static function sanitize_checkbox_input( $field ) {\n\t\treturn ( $field === '1' ) ? '1' : '0';\n\t}",
"public function sanitize_checkbox( $input ) {\n\t\treturn ( 1 == $input ) ? 1 : '';\n\t}",
"function form_checkbox($name='', $value, $checked=NULL, $arrayto='', $override = NULL, $js='', $id='') {\n\n\t$value = html_form_escape($value, $override);\n\n\tif ($arrayto) {\n\t\t$name = $arrayto . \"[\" . $name . \"]\";\n\t}\n\n\tif (!$id) {\n\t\t$id = $name;\n\t}\n\n\tif ($checked) {\n\t\treturn \"<input type=\\\"checkbox\\\" name=\\\"$name\\\" id=\\\"$id\\\" value=\\\"$value\\\" checked $js />\";\n\t} else {\n\t\treturn \"<input type=\\\"checkbox\\\" name=\\\"$name\\\" id=\\\"$id\\\" value=\\\"$value\\\" $js />\";\n\t}\n\n}",
"public function ov_checkbox($name, $checked = false, $value = null){\n $args = func_get_args(); array_shift($args); array_shift($args); array_shift($args);\n $off = $this->echoOff; $this->echoOff = true;\n $chk = $this->generate_input('checkbox', $name, $value, false, $args);\n $chk->setCheckedState($checked);\n $this->echoOff = $off;\n if( !$this->echoOff ) echo $chk;\n return $chk;\n }",
"function get_checked($value)\n{\n\treturn ($value == TRUE) ? 'checked': ''; \n}",
"function rest_sanitize_boolean($value)\n {\n }",
"function checkBoxChecked($chkName, $optional){\n\t\t$checkBoxString = '';\n\t\t$chkText = '';\n\t\t\tif ( $_GET[$chkName->value]== 'on'){\n\t\t\t\t$chkText = 'checked';\n\t\t\t}\n\t\t\t $checkBoxString = $checkBoxString . '<input ' .$chkText. ' type=\"checkbox\" id=\"' .$chkName->value. '\" name=\"' .$chkName->value. '\" class=\"' .$chkName->class. '\" ' . $optional . '>' .$chkName->label. ' ';\n\t\t\n\t\treturn $checkBoxString;\n\t}",
"public function callback_checkbox( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n\n $html_condtions = '';\n\n if ( isset($args['conditions']) && $args['conditions'] === true ) {\n $name_id .= '[value]';\n $value = isset($value['value']) ? $value['value'] : 'off';\n $args['name_id'] .= '[options]';\n $html_condtions = $this->get_field_conditions_modal( $args );\n }\n\n $html = '<fieldset>';\n $html .= sprintf( '<label for=\"wpuf-%1$s\">', $name_id );\n $html .= sprintf( '<input type=\"hidden\" name=\"%1$s\" value=\"off\" />', $name_id );\n $html .= sprintf( '<input type=\"checkbox\" class=\"checkbox\" id=\"wpuf-%1$s\" name=\"%1$s\" value=\"on\" %2$s %3$s/>', $name_id, checked( $value, 'on', false ), $disable );\n $html .= sprintf( '%1$s</label>', $args['desc'] );\n $html .= $html_condtions;\n $html .= '</fieldset>';\n\n echo $html;\n }",
"function checkbox()\n {\n //if (isset($_POST['accept_terms_checkbox']))\n if ($this->input->post('checkbox'))\n {\n return TRUE;\n }\n else\n {\n $error = 'Please read and accept our terms and conditions.';\n $this->form_validation->set_message('checkbox', $error);\n return FALSE;\n }\n }",
"function callback_checkbox(array $args)\n {\n }",
"public function convertCheckboxesToBool()\n\t{\n\t\t$this->convertCheckboxesToBool = true;\n\t}",
"function sanitize_bool( $value, $key, array $data ) {\n\tif ( is_bool( $value ) ) {\n\t\treturn $value;\n\t} elseif ( is_numeric( $value ) ) {\n\t\treturn (bool) $value;\n\t} elseif ( is_string( $value ) ) {\n\t\tif ( in_array( strtolower( $value ), array( 'true', 'on', 'yes' ), true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( strtolower( $value ), array( 'false', 'off', 'no' ), true ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn (bool) $value;\n}",
"public static function checkbox($name, $value = NULL, $checked = FALSE, array $attributes = NULL)\n\t{\n\t\t$attributes['type'] = 'checkbox';\n\n\t\tif ($checked === TRUE)\n\t\t{\n\t\t\t// Make the checkbox active\n\t\t\t$attributes['checked'] = 'checked';\n\t\t}\n\n\t\treturn Form::input($name, $value, $attributes);\n\t}",
"function html_checkbox($variable, $checked='') {\n\n\t$variable .= '_ishtml';\n\n\treturn '<div style=\"padding:3px; width:110px; border: 1px #CCCCCC solid;\">' . form_checkbox($variable, 1, $checked) . \"  <label for=\\\"$variable\\\">Treat as HTML</label></div>\";\n\n}",
"public function checkbox($name, $value = NULL, $checked = FALSE, array $attributes = NULL) {\n $this->load_values($name, $value, $attributes);\n $result = '<li>'.Kohana_Form::checkbox($name, $value, $checked, $attributes);\n // add error span\n if (isset($this->errors[$name])) {\n $result .= '<span class=\"error\">'.ucfirst($this->errors[$name]).'</span>';\n } else if (isset($attributes['info'])) {\n // else add info span\n $result .= '<span class=\"info\">'.$attributes['info'].'</span>';\n }\n $result .= '</li>';\n return $result;\n\t}",
"public static function renderCheckbox();",
"function format_checkbox($p_id, $p_name, $p_checked = false, $p_class = 'input-xs', $p_style = '', $p_prop = ''){\n\treturn \t'<input type=\"checkbox\" id=\"' . $p_id . '\" name=\"' . $p_name . '\" class=\"ace ' . $p_class . '\" style=\"' . $p_style . '\" ' . $p_prop . ' ' . ($p_checked ? ' checked' : '') . '/>';\n}",
"function question_category_form_checkbox($name, $checked) {\n echo '<div><input type=\"hidden\" id=\"' . $name . '_off\" name=\"' . $name . '\" value=\"0\" />';\n echo '<input type=\"checkbox\" id=\"' . $name . '_on\" name=\"' . $name . '\" value=\"1\"';\n if ($checked) {\n echo ' checked=\"checked\"';\n }\n echo ' onchange=\"getElementById(\\'displayoptions\\').submit(); return true;\" />';\n echo '<label for=\"' . $name . '_on\">';\n print_string($name, 'quiz');\n echo \"</label></div>\\n\";\n}",
"public function createCheckBox($name, $value = false, $checked = false, $attr = array())\r\n {\r\n $checked = ($this->getFieldValue($name) !== false && in_array($value, (array)$this->getFieldValue($name)) ? true : ($this->getFieldValue($name) !== false ? false : $checked));\r\n if ($checked == true) {\r\n $attr = array_merge((array)$attr, array('checked' => 'checked'));\r\n }\r\n return $this->input($name, $value, $attr);\r\n }",
"static public function checkbox($name, $options, $checked = \"\", $attrib = \"\")\n {\n $options = (array)($options);\n if(!is_array($options) or empty($options)) return false;\n $string = '';\n $checked = \",$checked,\";\n\n foreach($options as $key => $value)\n {\n $key = str_replace('item', '', $key);\n $string .= \"<span><input type='checkbox' name='{$name}[]' value='$key' \";\n $string .= strpos($checked, \",$key,\") !== false ? \" checked ='checked'\" : \"\";\n $string .= $attrib;\n $string .= \" /> <label>$value</label></span>\\n\";\n }\n return $string;\n }",
"protected function markAsChecked()\n {\n if ($this->isArrayInput()) {\n if (old()) {\n if (old($this->arrayInputBaseName())) {\n $this->addHtmlAttribute('checked', in_array($this->value, old($this->arrayInputBaseName())));\n } else {\n $this->addHtmlAttribute('checked', false);\n }\n } else {\n $this->addHtmlAttribute('checked', $this->checked);\n }\n } else {\n if (old()) {\n if (old($this->name)) {\n $this->addHtmlAttribute('checked', true);\n } else {\n $this->addHtmlAttribute('checked', false);\n }\n } else {\n $this->addHtmlAttribute('checked', $this->checked);\n }\n }\n }",
"protected function markAsChecked()\n {\n if ($this->isArrayInput()) {\n if (old()) {\n if (old($this->arrayInputBaseName())) {\n $this->addHtmlAttribute('checked', in_array($this->value, old($this->arrayInputBaseName())));\n } else {\n $this->addHtmlAttribute('checked', false);\n }\n } else {\n $this->addHtmlAttribute('checked', $this->checked);\n }\n } else {\n if (old()) {\n if (old($this->name)) {\n $this->addHtmlAttribute('checked', true);\n } else {\n $this->addHtmlAttribute('checked', false);\n }\n } else {\n $this->addHtmlAttribute('checked', $this->checked);\n }\n }\n }",
"public function convertirCheckBox($param='') {\n if($param == \"on\" || $param == 1) {\n $param = \"S\";\n } else {\n $param = \"N\";\n }\n return $param;\n }",
"function Sanitizer($data) {\r\n $data = trim($data);\r\n // it'll strip the slashes in the field \r\n $data = stripcslashes($data);\r\n // for special characters in html like < / >\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n{}\r\n\r\nif($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n $name = Sanitizer($_POST['name']);\r\n $email = Sanitizer($_POST['email']);\r\n $message = Sanitizer($_POST['message']);\r\n $subject = Sanitizer($_POST['subject']);\r\n \r\n}\r\n$wholeCheckedInputs = vsprintf(\"these are the inputs from the from\", array($name, $email, $subject, $message));\r\nprint_r($wholeCheckedInputs);\r\n/**\r\n * we can use Php filters like filter_var() / filter_input() <- for a single argument\r\n * or we can even check out multiple arguments using filter_input_array()\r\n */\r\n\r\n}",
"function sb_slideshow_checkbox( $value, $key, $name, $checked = array() ) {\n\treturn '<input type=\"checkbox\" name=\"sb_' . esc_attr( $name ) . '[]\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . (in_array( $value, (array)$checked ) ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}"
] |
[
"0.82508355",
"0.7684473",
"0.68492186",
"0.67999566",
"0.638274",
"0.63167924",
"0.62435895",
"0.6030692",
"0.595566",
"0.5877473",
"0.58745825",
"0.5863358",
"0.586139",
"0.58511573",
"0.58483577",
"0.5838701",
"0.57611823",
"0.5720432",
"0.5665575",
"0.56588966",
"0.56418854",
"0.5626032",
"0.5616253",
"0.56025225",
"0.5601486",
"0.55822444",
"0.55822444",
"0.55754316",
"0.5554912",
"0.55502623"
] |
0.8143649
|
1
|
Get the content background color Accounts for the Fast shop Designer's content background option.
|
function fastshop_get_content_background_color() {
// Set the bg color var based on whether the Fast shop designer has set a content bg color or not.
$content_bg_color = fastshop_sanitize_hex_color( get_theme_mod( 'sd_content_background_color' ) );
$content_frame = get_theme_mod( 'sd_fixed_width' );
// Set the bg color based on the default theme option
$bg_color = str_replace( '#', '', get_theme_mod( 'background_color' ) );
// But if the Fast shop Designer extension is active, and the content frame option is enabled we need that bg color instead
if ( $content_bg_color && 'true' == $content_frame && class_exists( 'Fastshop_Designer' ) ) {
$bg_color = str_replace( '#', '', $content_bg_color );
}
return '#' . $bg_color;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_background_color()\n {\n }",
"public function getBackgroundColor() {}",
"public function getBackgroundColor() {}",
"public function getBackgroundColor() {}",
"public function getBackgroundColor() {\n\t\treturn $this->background_color;\n\t}",
"function pl_bg_color(){\n\t\n\tif( pl_check_color_hash( get_set_color( 'the_bg' ) ) )\n\t\treturn get_set_color( 'the_bg' );\n\telse \n\t\treturn 'FFFFFF';\t\n}",
"public function get_bg_colour() {\n\t\treturn $this->bg_colour;\n\t}",
"public function getBackgroundColor()\n {\n return $this->backgroundColor;\n }",
"public static function getBackgroundColors() {\n\t\treturn array_keys( self::background_colors );\n\t}",
"public function getBackgroundColor() {\n return $this->backgroundColor;\n }",
"public function getBackgroundColors() {\n return array_keys($this->background_colors);\n }",
"public function getBackgroundColors() {\n\t\treturn array_keys($this->background_colors);\n\t}",
"public function getBackgroundColors() {\n\t\treturn array_keys($this->background_colors);\n\t}",
"public function get_customizer_color_vars() {\n\n\t\t$colors = [\n\t\t\t'content' => [\n\t\t\t\t'setting' => 'background_color',\n\t\t\t],\n\t\t\t'header-footer' => [\n\t\t\t\t'setting' => 'header_footer_background_color',\n\t\t\t],\n\t\t];\n\t\treturn $colors;\n\t}",
"public function getBackgroundColors() {\n\t\t\treturn array_keys($this->background_colors);\n\t\t}",
"public function getBackgroundColors(): array\n {\n\t\treturn array_keys($this->backgroundColors);\n\t}",
"public function getBackgroundColors()\n {\n return array_keys($this->_backgroundColors);\n }",
"public function backgroundColorProvider()\n {\n return [[\"#fff\"], [\"#000\"]];\n }",
"public function backgroundColorProvider()\n {\n return [[\"#fff\"], [\"#000\"]];\n }",
"public function getBgImage(){\r\n return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_BG_IMAGE,ScopeInterface::SCOPE_WEBSITE);\r\n }",
"public function contentBackgroundColor($site_id, $page_id)\n {\n return $this->model_page->getAttributeValue($site_id, $page_id, 'background-color');\n }",
"public function getCurrentBackgroundColor() {\n return $currentBackgroundColor;\n }",
"function readBackground() {return $this->_background;}",
"function wpvideocoach_get_introduction_box_background_color()\r\n{\r\n\tglobal $wpvideocoach_introduction_box_background_color;\r\n\tif(empty($wpvideocoach_introduction_box_background_color)){\r\n\t\t$wpvideocoach_introduction_box_background_color = '#FFFFFF';\r\n\t}\r\n\treturn $wpvideocoach_introduction_box_background_color;\r\n}",
"function get_background() {\r\n return $this->db->get($this->table);\r\n\t}",
"public function backgroundColor()\n {\n return '#dddddd';\n }",
"function getBackground() {return $this->readBackground();}",
"function active_tab_background() {\n\t\t\t// Matches field # of register_setting\n\t\t\t$options = get_option( 'subpages_as_tabs_options' );\n?>\n\t\t\t<input id=\"spat_active_tab_background\" name=\"subpages_as_tabs_options[active_tab_background]\" class=\"color_pick\" type=\"color\" size=\"7\" value=\"<?php _e( $options['active_tab_background'] );?>\" />\n<?php\n\t\t}",
"function shell_custom_background(){\r\n\r\n\t\t/* Custom Background */\r\n\t\tadd_theme_support( 'custom-background', array( 'default-color' => 'f9f9f9' ) );\r\n\t}",
"function background_color()\n {\n }"
] |
[
"0.70254475",
"0.69973165",
"0.699618",
"0.699618",
"0.6782205",
"0.66545844",
"0.66256744",
"0.66021687",
"0.6572573",
"0.6533494",
"0.6528644",
"0.650151",
"0.650151",
"0.64933956",
"0.6493204",
"0.6361321",
"0.6345603",
"0.6301156",
"0.6301156",
"0.6273876",
"0.62387085",
"0.6114283",
"0.60803",
"0.60802174",
"0.6073556",
"0.60379475",
"0.6002678",
"0.59818065",
"0.59524274",
"0.5936816"
] |
0.82239056
|
0
|
string FMWarning(string message) displays warnings messages.
|
function FMWarning($message)
{
$trace = "";
foreach ($this->FMDebug as $level) {
$trace .= " > " . $level;
}
error_log ("freemoviecompiler warning: $trace --> $message");
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function warning($message);",
"public function warning($message) {}",
"function display_warning_message($message)\r\n {\r\n Display :: warning_message($message);\r\n }",
"public function warning(string $text);",
"static public function warning($string)\n {\n return new PMA_Message($string, PMA_Message::WARNING);\n }",
"public static function warning() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_WARNING, $args);\n\t}",
"public function warn($message)\n {\n }",
"public function warning(string $message)\n {\n $this->message('warning', $message);\n }",
"function warning($message, array $context = array());",
"public static function warn( $message ){\n return self::add( new Loco_error_Warning($message) );\n }",
"function Print_Warning($message)\r\n{\r\n print (\"<b>\" . $message . \"</b>\\n<br>\");\r\n}",
"public function warning($message)\r\n {\r\n $this->log($message, SF_LOG_WARNING);\r\n }",
"public static function warning( $message, $name = '' ) {\n return self::add( $message, $name, 'warning' );\n }",
"public function warning($message)\n {\n $this->message($message, 'warning');\n }",
"public function warn($msg);",
"public static function warning($message, $context);",
"public function warning($message)\n {\n return $this->render($message, 'warning');\n }",
"public function warning( $message ) {\n\n \\WP_CLI::warning( $message );\n }",
"private static function warn(string $message): void\n {\n echo \"\\033[43m\\033[30m\" . $message . \"\\033[0m\" . PHP_EOL;\n }",
"private function _warning($text){\n echo '[# WARNING] ' . $text . PHP_EOL;\n }",
"public function warning($message)\n {\n $this->log($message, self::WARNING);\n }",
"protected function warning(string $message)\n {\n if (FLOW_SAPITYPE === 'CLI') {\n echo \"\\033[33m\" . $message . \"\\033[0m\" . PHP_EOL;\n }\n }",
"function atkwarning($txt)\n{\n\tatkdebug($txt,DEBUG_WARNING);\n}",
"public function warning($message) {\n\t\t\t$this->log('warning', $message);\n\t\t}",
"public static function warning()\n {\n static::returnCode(static::CODE_WARNING);\n }",
"public static function warning($message)\n {\n return '<div class=\"alert alert-warning\">' . $message . '</div>';\n }",
"public static function warning($message, $context = array()){\n\t\treturn \\Monolog\\Logger::warning($message, $context);\n\t}",
"public function warning($message)\n {\n if ($this->_logLevel>=2) {\n self::log($message, Zend_Log::WARN);\n }\n }",
"public function warning($message)\n {\n $flash = $this->flashtype['warning'];\n $flash['message'] = $message;\n $this->add($flash);\n }",
"public static function warning($message, array $context = array()): string\n {\n /** @noinspection PhpVoidFunctionResultUsedInspection */\n return static::getLogger()->warning($message, $context);\n }"
] |
[
"0.7632834",
"0.74847984",
"0.7384621",
"0.71459967",
"0.70727116",
"0.7017316",
"0.6924566",
"0.68701375",
"0.6862596",
"0.6850394",
"0.6844558",
"0.682769",
"0.6812575",
"0.68119264",
"0.678198",
"0.67233235",
"0.67090976",
"0.66316336",
"0.66175246",
"0.65656525",
"0.65629536",
"0.6539478",
"0.6539053",
"0.6526396",
"0.65258324",
"0.65140903",
"0.6489837",
"0.6469207",
"0.6460222",
"0.6457707"
] |
0.80632114
|
0
|
// // Basic types // // // string packUI8(integer number) converts the given 8bit unsigned integer number into an SWF UI8 atom.
|
function packUI8($number)
{
array_push($this->FMDebug, "packUI8");
if (!(is_numeric($number))) {
$this->FMError("packUI8 argument $number not a number");
}
$number = (int) $number;
$lower_limit = 0;
$upper_limit = 255;
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
$atom = chr($number);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function formatToUInt8($int) {}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public static function bit8(int $data): string\n {\n return pack('C', $data);\n }",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public static function formatToInt8($int) {}",
"public static function formatFromUInt8($byte) {}",
"static function writeInt8($int): string {\n if(\\PHP_INT_SIZE > 4) {\n return \\pack('P', ((int) $int));\n }\n \n if(static::$gmp) {\n $int = \\gmp_init($int);\n \n if(\\gmp_cmp($int, '0') === -1) {\n // 18446744073709551616 is equal to (1 << 64)\n $int = \\gmp_add($int, '18446744073709551616');\n }\n \n return \\gmp_export($int, 1, (\\GMP_LSW_FIRST | \\GMP_LITTLE_ENDIAN));\n }\n \n if(\\bccomp($int, '0') === -1) {\n // 18446744073709551616 is equal to (1 << 64)\n $int = \\bcadd($int, '18446744073709551616');\n }\n \n return \\pack('v', \\bcmod(\\bcdiv($int, '281474976710656'), '65536')).\n \\pack('v', \\bcmod(\\bcdiv($int, '4294967296'), '65536')).\n \\pack('v', \\bcdiv($int, '65536'), '65536').\n \\pack('v', \\bcmod($int, '65536'));\n }",
"public static function formatFromInt8($byte) {}",
"public function appendInt8($value)\n {\n return $this->append(pack(\"c\", $value));\n }",
"function packUBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUBchunk\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647;\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUBchunk argument not a number\");\n\t\t}\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function caractere_utf_8($num) {\n\tif($num<128)\n\t\treturn chr($num);\n\tif($num<2048)\n\t\treturn chr(($num>>6)+192).chr(($num&63)+128);\n\tif($num<65536)\n\t\treturn chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);\n\tif($num<1114112)\n\t\treturn chr($num>>18+240).chr((($num>>12)&63)+128).chr(($num>>6)&63+128). chr($num&63+128);\n\treturn '';\n}",
"public function writeInt8($int) {}",
"function xlsWriteLabel($Row, $Col, $Value ) {\r\n$L = strlen($Value);\r\necho pack(\"ssssss\", 0x204, 8 + $L, $Row, $Col, 0x0, $L);\r\necho $Value;\r\nreturn;\r\n}",
"public function appendUint8($value)\n {\n return $this->append(pack(\"C\", $value));\n }",
"public function writeUInt8($int) {}",
"function readInt8() {\n $strInt = $this->read(8);\n \n if(\\PHP_INT_SIZE > 4) {\n return \\unpack('P', $strInt)[1];\n }\n \n if(static::$gmp) {\n $result = \\gmp_import($strInt, 1, (\\GMP_LSW_FIRST | \\GMP_LITTLE_ENDIAN));\n if($result === false) {\n throw new \\RuntimeException('Unable to convert input into an integer');\n }\n \n if(\\gmp_cmp($result, '9223372036854775808') !== -1) {\n $result = \\gmp_sub($result, '18446744073709551616'); // $result -= (1 << 64)\n }\n \n $result = \\gmp_strval($result);\n } else {\n $result = \\bcadd('0', \\unpack('n', \\substr($strInt, 0, 2))[1]);\n $result = \\bcmul($result, '65536');\n $result = \\bcadd($result, \\unpack('n', \\substr($strInt, 2, 2))[1]);\n $result = \\bcmul($result, '65536');\n $result = \\bcadd($result, \\unpack('n', \\substr($strInt, 4, 2))[1]);\n $result = \\bcmul($result, '65536');\n $result = \\bcadd($result, \\unpack('n', \\substr($strInt, 6, 2))[1]);\n \n // 9223372036854775808 is equal to (1 << 63)\n if(\\bccomp($result, '9223372036854775808') !== -1) {\n $result = \\bcsub($result, '18446744073709551616'); // $result -= (1 << 64)\n }\n }\n \n return $result;\n }",
"function uni2utf8($uniescape)\n\t{\n\t\t$c = \"\";\n\t\t\n\t\t$n = intval(substr($uniescape, -4), 16);\n\t\tif ($n < 0x7F) {// 0000-007F\n\t\t\t$c .= chr($n);\n\t\t} elseif ($n < 0x800) {// 0080-0800\n\t\t\t$c .= chr(0xC0 | ($n / 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t} else {\t\t\t\t// 0800-FFFF\n\t\t\t$c .= chr(0xE0 | (($n / 64) / 64));\n\t\t\t$c .= chr(0x80 | (($n / 64) % 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t}\n\t\treturn $c;\n\t}",
"function toUString();",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"private function packCounter($counter)\n {\n // so we need to pack it down properly.\n $cur_counter = array(0, 0, 0, 0, 0, 0, 0, 0);\n for ($i = 7; $i >= 0; $i--) {\n $cur_counter[$i] = pack('C*', $counter);\n $counter = $counter >> 8;\n }\n\n $bin_counter = implode($cur_counter);\n\n // Pad to 8 chars\n if (strlen($bin_counter) < 8) {\n $bin_counter = str_repeat(chr(0), 8 - strlen($bin_counter)) . $bin_counter;\n }\n\n return $bin_counter;\n }",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"public static function toHex8 ($a) {\n return ($a < 16 ? \"0\" : \"\") . dechex($a);\n }",
"public function readInt8();"
] |
[
"0.73027754",
"0.668872",
"0.668767",
"0.66292155",
"0.6162595",
"0.61515564",
"0.5880507",
"0.57217574",
"0.56901914",
"0.568086",
"0.5564332",
"0.5445998",
"0.5425273",
"0.54229057",
"0.53691953",
"0.533569",
"0.5325789",
"0.52975625",
"0.5279884",
"0.52704346",
"0.5251274",
"0.5248943",
"0.5239758",
"0.52299553",
"0.5180703",
"0.5180703",
"0.5180703",
"0.51733315",
"0.512961",
"0.5066091"
] |
0.8236538
|
0
|
string packUI16(integer number) converts the given 16bit unsigned integer into an SWF UI16 atom.
|
function packUI16($number)
{
array_push($this->FMDebug, "packUI16");
if (!(is_numeric($number))) {
$this->FMError("packUI16 argument not a number");
}
$number = (int) $number;
$lower_limit = 0;
$upper_limit = 65535;
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
$number = sprintf("%04x", $number);
$low_byte = base_convert(substr($number, 2, 2), 16, 10);
$high_byte = base_convert(substr($number, 0, 2), 16, 10);
$atom = chr($low_byte) . chr($high_byte);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function appendUint16($value)\n {\n $s = pack(\"n\", $value);\n return $this->append($s);\n }",
"public function writeInt16($num){ }",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function utf8to16 ( $utf8 ){\n $utf16 = \"\";\n $array= unpack(\"C*\", \"$utf8\");\n $l = count($array);\n $i = 1;\n while ($i <= $l){\n $c1 = $array[$i++];\n $m = ($c1 & 0xE0);\n if ( ($c1 & 0x80) == 0x00 ){\n $u1 = 0;\n $u2 = $c1;\n } else if ( ($c1 & 0xE0) == 0xC0 ){\n $c2 = $array[$i++];\n $u1 = (( $c1 >> 2 ) & 0x07 ) & 0x07;\n $u2 = (( $c1 << 6 ) & 0xC0 ) | ( $c2 & 0x3F );\n } else if ( ($c1 & 0xF0) == 0xE0 ){\n $c2 = $array[$i++];\n $c3 = $array[$i++];\n $u1 = (( $c1 << 4 ) & 0xF0 ) | (( $c2 >> 2 ) & 0x0F );\n $u2 = (( $c2 << 6 ) & 0xC0 ) | ( $c3 & 0x3F );\n }\n $utf16 .= pack(\"CC\", $u1, $u2);\n }\n return $utf16;\n }",
"public static function formatToUInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"function utf16to8 ( $utf16 ){\n $utf8 = \"\";\n $array = unpack(\"C*\", $utf16);\n $l = count($array);\n for ($i = 1 ; $i <= $l ; $i+=2 ){\n $c1 = $array[$i];\n if ( $i+1 <= $l ){ \n $c2 = $array[$i+1];\n } else {\n $c2 = 0;\n }\n $u1 = 0xE0 | (( $c1 >> 4 ) & 0x0f );\n $u2 = 0x80 | (( $c1 << 2 ) & 0x3c ) | (( $c2 >> 6 ) & 0x03 );\n $u3 = 0x80 | (( $c2 ) & 0x3f );\n $utf8 .= pack(\"CCC\", $u1, $u2, $u3);\n }\n return $utf8;\n }",
"public function appendInt16($value)\n {\n $s = pack(\"s\", $value);\n return $this->append(self::$isLittleEndian ? self::swapEndian16($s) : $s);\n }",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function writeUInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function writeUnsignedInt16($num, $endian=null){ }",
"public static function bit16(int $data, $endianness = false): string\n {\n // big-endian\n if (true === $endianness) {\n return pack('n', $data);\n }\n\n // little-endian\n if (false === $endianness) {\n return pack('v', $data);\n }\n\n // machine byte order\n if (null === $endianness) {\n return pack('S', $data);\n }\n }",
"public static function formatFromUInt16($bytes, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public static function swapEndian16($s)\n {\n return $s[1] . $s[0];\n }",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function utf16BeToUnicodePoint($utf16) {}",
"public static function formatFromInt16($bytes, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function readUInt16LE();",
"function utf82utf16($utf8)\n {\n // oh please oh please oh please oh please oh please\n if(function_exists('mb_convert_encoding')) {\n return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');\n }\n\n switch(strlen($utf8)) {\n case 1:\n // this case should never be reached, because we are in ASCII range\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return $utf8;\n\n case 2:\n // return a UTF-16 character from a 2-byte UTF-8 char\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr(0x07 & (ord($utf8{0}) >> 2))\n . chr((0xC0 & (ord($utf8{0}) << 6))\n | (0x3F & ord($utf8{1})));\n\n case 3:\n // return a UTF-16 character from a 3-byte UTF-8 char\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr((0xF0 & (ord($utf8{0}) << 4))\n | (0x0F & (ord($utf8{1}) >> 2)))\n . chr((0xC0 & (ord($utf8{1}) << 6))\n | (0x7F & ord($utf8{2})));\n }\n\n // ignoring UTF-32 for now, sorry\n return '';\n }",
"function readUInt16() {\n $tmp = unpack(\"v\", $this->read(2));\n return $tmp[1];\n }",
"public function readInt16();",
"public static function writeShort($value){\n\t\t\treturn pack(\"n\", $value);\n\t}",
"public function writeInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function readUInt16BE();",
"public function readUInt16();",
"function utf162utf8($utf16)\n {\n if(function_exists('mb_convert_encoding')) {\n return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');\n }\n\n $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});\n\n switch(true) {\n case ((0x7F & $bytes) == $bytes):\n // this case should never be reached, because we are in ASCII range\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr(0x7F & $bytes);\n\n case (0x07FF & $bytes) == $bytes:\n // return a 2-byte UTF-8 character\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr(0xC0 | (($bytes >> 6) & 0x1F))\n . chr(0x80 | ($bytes & 0x3F));\n\n case (0xFFFF & $bytes) == $bytes:\n // return a 3-byte UTF-8 character\n // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n return chr(0xE0 | (($bytes >> 12) & 0x0F))\n . chr(0x80 | (($bytes >> 6) & 0x3F))\n . chr(0x80 | ($bytes & 0x3F));\n }\n\n // ignoring UTF-32 for now, sorry\n return '';\n }",
"public static function toUtf16Be($string, $ignore = false, $translit = false) {}",
"public static function toUtf16Be($string, $ignore = false, $translit = false) {}",
"public static function toUtf16Be($string, $ignore = false, $translit = false) {}"
] |
[
"0.75090146",
"0.68924636",
"0.63067824",
"0.625721",
"0.6145386",
"0.6050858",
"0.6014151",
"0.5984017",
"0.5948436",
"0.5838528",
"0.57271135",
"0.5697654",
"0.5628652",
"0.55853033",
"0.5548654",
"0.5531069",
"0.54685897",
"0.54600495",
"0.544718",
"0.53544295",
"0.5326379",
"0.53240675",
"0.5323077",
"0.5256993",
"0.5254066",
"0.5243099",
"0.52374977",
"0.5227097",
"0.5227097",
"0.5226844"
] |
0.83668506
|
0
|
string packUI32(integer number) converts the given unsigned integer into an SWF UI32 atom and returns it.
|
function packUI32($number)
{
array_push($this->FMDebug, "packUI32");
if (!(is_integer($number))) {
$this->FMError("packUI32 argument not an integer");
}
$lower_limit = 0;
$upper_limit = 2147483647; # the real limit is 4294967295
# but PHP 4 cannot handle such
# large unsigned integers
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
$number = sprintf("%08x", $number);
$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);
$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10);
$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);
$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);
$atom = chr($low_byte_low_word) . chr($high_byte_low_word);
$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function hexEncodeU32 ($a) {\n $b = self::toHex8(self::unsignedRightShift($a, 24));\n $b .= self::toHex8(self::unsignedRightShift($a, 16) & 255);\n $b .= self::toHex8(self::unsignedRightShift($a, 8) & 255);\n return $b . self::toHex8($a & 255);\n }",
"public function appendUint32($value)\n {\n $s = pack(\"N\", $value);\n return $this->append($s);\n }",
"public static function formatToUInt32($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"function uint32ToHex($val) {\n\t\treturn substr(dechex(4294967296 + $val), 1);\n\t}",
"static public function intToMBUInt32(&$out, $i)\n {\n if ($i > 268435455) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n $bytes4 = 128 | Horde_Xml_Wbxml::getBits(4, $i);\n\n $out .= chr($bytes4) . chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 2097151) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n\n $out .= chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 16383) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n\n $out .= chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 127) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n\n $out .= chr($bytes1) . chr($bytes0);\n } else {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n\n $out .= chr($bytes0);\n }\n }",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function appendInt32PackedField($value)\n {\n return $this->append(self::INT32_PACKED_FIELD, $value);\n }",
"public function appendSint32PackedField($value)\n {\n return $this->append(self::SINT32_PACKED_FIELD, $value);\n }",
"public function appendInt32($value)\n {\n $s = pack(\"l\", $value);\n return $this->append(self::$isLittleEndian ? self::swapEndian32($s) : $s);\n }",
"protected final function _encodeSynchsafe32($val)\n {\n return ($val & 0x7f) | ($val & 0x3f80) << 1 |\n ($val & 0x1fc000) << 2 | ($val & 0xfe00000) << 3;\n }",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function utf_32_to_unicode($source) {\n\n\t// mb_string : methode rapide\n\tif (init_mb_string()) {\n\t\t$convmap = array(0x7F, 0xFFFFFF, 0x0, 0xFFFFFF);\n\t\t$source = mb_encode_numericentity($source, $convmap, 'UTF-32LE');\n\t\treturn str_replace(chr(0), '', $source);\n\t}\n\n\t// Sinon methode lente\n\t$texte = '';\n\twhile ($source) {\n\t\t$words = unpack(\"V*\", substr($source, 0, 1024));\n\t\t$source = substr($source, 1024);\n\t\tforeach ($words as $word) {\n\t\t\tif ($word < 128)\n\t\t\t\t$texte .= chr($word);\n\t\t\t// ignorer le BOM - http://www.unicode.org/faq/utf_bom.html\n\t\t\telse if ($word != 65279)\n\t\t\t\t$texte .= '&#'.$word.';';\n\t\t}\n\t}\n\treturn $texte;\n\n}",
"public function getUint32Field()\n {\n $value = $this->get(self::UINT32_FIELD);\n return $value === null ? (integer)$value : $value;\n }",
"function read_uint32(&$payload) {\n $uint32 = \\unpack('N', $payload)[1];\n $payload = \\substr($payload, 4);\n\n return $uint32;\n}",
"static function writeInt3(int $int): string {\n return \\substr(\\pack('V', $int), 0, 3);\n }",
"public static function formatFromUInt32($bytes, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public static function bit32(int $data, $endianness = false): string\n {\n // big-endian\n if (true === $endianness) {\n return pack('N', $data);\n }\n\n // little-endian\n if (false === $endianness) {\n return pack('V', $data);\n }\n\n // machine byte order\n if (null === $endianness) {\n return pack('L', $data);\n }\n }",
"public function pushInt32($int32)\n {\n $mask = 0xff;\n for ($i = 0; $i < 4; $i++) {\n $this->pushByte(($int32 >> ((3 - $i) * 8)) & $mask);\n }\n }",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected final function _decodeSynchsafe32($val)\n {\n return ($val & 0x7f) | ($val & 0x7f00) >> 1 |\n ($val & 0x7f0000) >> 2 | ($val & 0x7f000000) >> 3;\n }",
"public function setUint32Field($value)\n {\n return $this->set(self::UINT32_FIELD, $value);\n }",
"public static function ensure32BitInteger($value) {}",
"public function fixed32($value)\n {\n $bytes = pack('V*', $value);\n $this->write($bytes, 4);\n }",
"function packUBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUBchunk\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647;\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUBchunk argument not a number\");\n\t\t}\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function swfRead_u32($data, &$offset) {\n return ord($data[$offset++]) + ord($data[$offset++]) * 0x100 +\n ord($data[$offset++]) * 0x10000 + ord($data[$offset++]) * 0x1000000;\n}",
"public function readUInt32LE();",
"function readUInt32() {\n $tmp = unpack(\"V\", $this->read(4));\n return $tmp[1];\n }"
] |
[
"0.77007264",
"0.6825383",
"0.64200175",
"0.5882496",
"0.5851778",
"0.5779244",
"0.57064414",
"0.56579167",
"0.5598058",
"0.5578281",
"0.5555086",
"0.5542226",
"0.55076927",
"0.54751426",
"0.54468936",
"0.53709316",
"0.53355104",
"0.5314708",
"0.53113663",
"0.52575433",
"0.52513266",
"0.5201253",
"0.5190689",
"0.5163021",
"0.5157603",
"0.51390177",
"0.5138026",
"0.5137882",
"0.5133975",
"0.5129186"
] |
0.83164203
|
0
|
string packSI8(integer number) converts the given 8bit signed integer into an SWF SI8 atom.
|
function packSI8($number)
{
array_push($this->FMDebug, "packSI8");
if (!(is_numeric($number))) {
$this->FMError("packSI8 argument not a number");
}
$number = (int) $number;
$lower_limit = -127;
$upper_limit = 127;
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
if ($number < 0) {
$number = $upper_limit + 1 + abs($number);
}
$atom = chr($number);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function bit8(int $data): string\n {\n return pack('C', $data);\n }",
"public static function formatToInt8($int) {}",
"public static function formatToUInt8($int) {}",
"public static function formatFromInt8($byte) {}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function writeInt8($int) {}",
"static function writeInt8($int): string {\n if(\\PHP_INT_SIZE > 4) {\n return \\pack('P', ((int) $int));\n }\n \n if(static::$gmp) {\n $int = \\gmp_init($int);\n \n if(\\gmp_cmp($int, '0') === -1) {\n // 18446744073709551616 is equal to (1 << 64)\n $int = \\gmp_add($int, '18446744073709551616');\n }\n \n return \\gmp_export($int, 1, (\\GMP_LSW_FIRST | \\GMP_LITTLE_ENDIAN));\n }\n \n if(\\bccomp($int, '0') === -1) {\n // 18446744073709551616 is equal to (1 << 64)\n $int = \\bcadd($int, '18446744073709551616');\n }\n \n return \\pack('v', \\bcmod(\\bcdiv($int, '281474976710656'), '65536')).\n \\pack('v', \\bcmod(\\bcdiv($int, '4294967296'), '65536')).\n \\pack('v', \\bcdiv($int, '65536'), '65536').\n \\pack('v', \\bcmod($int, '65536'));\n }",
"public function readInt8();",
"public static function toHex8 ($a) {\n return ($a < 16 ? \"0\" : \"\") . dechex($a);\n }",
"public function readInt8BE();",
"function readInt8() {\n $strInt = $this->read(8);\n \n if(\\PHP_INT_SIZE > 4) {\n return \\unpack('P', $strInt)[1];\n }\n \n if(static::$gmp) {\n $result = \\gmp_import($strInt, 1, (\\GMP_LSW_FIRST | \\GMP_LITTLE_ENDIAN));\n if($result === false) {\n throw new \\RuntimeException('Unable to convert input into an integer');\n }\n \n if(\\gmp_cmp($result, '9223372036854775808') !== -1) {\n $result = \\gmp_sub($result, '18446744073709551616'); // $result -= (1 << 64)\n }\n \n $result = \\gmp_strval($result);\n } else {\n $result = \\bcadd('0', \\unpack('n', \\substr($strInt, 0, 2))[1]);\n $result = \\bcmul($result, '65536');\n $result = \\bcadd($result, \\unpack('n', \\substr($strInt, 2, 2))[1]);\n $result = \\bcmul($result, '65536');\n $result = \\bcadd($result, \\unpack('n', \\substr($strInt, 4, 2))[1]);\n $result = \\bcmul($result, '65536');\n $result = \\bcadd($result, \\unpack('n', \\substr($strInt, 6, 2))[1]);\n \n // 9223372036854775808 is equal to (1 << 63)\n if(\\bccomp($result, '9223372036854775808') !== -1) {\n $result = \\bcsub($result, '18446744073709551616'); // $result -= (1 << 64)\n }\n }\n \n return $result;\n }",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"private function packCounter($counter)\n {\n // so we need to pack it down properly.\n $cur_counter = array(0, 0, 0, 0, 0, 0, 0, 0);\n for ($i = 7; $i >= 0; $i--) {\n $cur_counter[$i] = pack('C*', $counter);\n $counter = $counter >> 8;\n }\n\n $bin_counter = implode($cur_counter);\n\n // Pad to 8 chars\n if (strlen($bin_counter) < 8) {\n $bin_counter = str_repeat(chr(0), 8 - strlen($bin_counter)) . $bin_counter;\n }\n\n return $bin_counter;\n }",
"public static function bytesToSI($bytes): string\n {\n if (empty($bytes)) {\n return '0';\n }\n $prefix = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n $base = 1024;\n $class = min((int)log($bytes, $base), count($prefix) - 1);\n return \\Safe\\sprintf('%1.1f', $bytes / pow($base, $class)) . $prefix[$class];\n }",
"public static function formatFromUInt8($byte) {}",
"public function appendInt8($value)\n {\n return $this->append(pack(\"c\", $value));\n }",
"public function setSecondSic8($secondSic8)\n {\n $this->secondSic8 = $secondSic8;\n return $this;\n }",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function readInt8LE();",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function packSBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSBchunk\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSBchunk argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -1073741823;\n\t\t$upper_limit = 1073741823;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($number == -1) {\n\n\t\t\t\t$atom = \"11\";\n\n\t\t\t} else {\n\n\t\t\t\t$atom = decbin($number);\n\t\t\t\t$atom = substr($atom, strpos($atom, \"10\"));\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$atom = \"0\" . decbin($number);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function setSixthSic8($sixthSic8)\n {\n $this->sixthSic8 = $sixthSic8;\n return $this;\n }",
"public function setFifthSic8($fifthSic8)\n {\n $this->fifthSic8 = $fifthSic8;\n return $this;\n }",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}"
] |
[
"0.7156119",
"0.6988512",
"0.6857115",
"0.6778014",
"0.6296224",
"0.6221051",
"0.5903362",
"0.58918166",
"0.57889026",
"0.57490426",
"0.5718275",
"0.5711889",
"0.5590074",
"0.55517876",
"0.55470234",
"0.54804546",
"0.53730446",
"0.5344077",
"0.5304785",
"0.5291882",
"0.5213876",
"0.51842564",
"0.51485074",
"0.5140649",
"0.51326174",
"0.5122579",
"0.51177377",
"0.51132643",
"0.5100029",
"0.5100029"
] |
0.8393893
|
0
|
string packSI16(integer number) converts the given 16bit signed integer into an SWF SI16 atom.
|
function packSI16($number)
{
array_push($this->FMDebug, "packSI16");
if (!(is_numeric($number))) {
$this->FMError("packSI16 argument not a number");
}
$number = (int) $number;
$lower_limit = -32767;
$upper_limit = 32767;
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
if ($number < 0 ) {
$number = $upper_limit + 1 + abs($number);
}
$number = sprintf("%04x", $number);
$low_byte = base_convert(substr($number, 2, 2), 16, 10);
$high_byte = base_convert(substr($number, 0, 2), 16, 10);
$atom = chr($low_byte) . chr($high_byte);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function writeInt16($num){ }",
"public static function swapEndian16($s)\n {\n return $s[1] . $s[0];\n }",
"public function readInt16();",
"public function appendInt16($value)\n {\n $s = pack(\"s\", $value);\n return $this->append(self::$isLittleEndian ? self::swapEndian16($s) : $s);\n }",
"public static function bit16(int $data, $endianness = false): string\n {\n // big-endian\n if (true === $endianness) {\n return pack('n', $data);\n }\n\n // little-endian\n if (false === $endianness) {\n return pack('v', $data);\n }\n\n // machine byte order\n if (null === $endianness) {\n return pack('S', $data);\n }\n }",
"function utf16to8 ( $utf16 ){\n $utf8 = \"\";\n $array = unpack(\"C*\", $utf16);\n $l = count($array);\n for ($i = 1 ; $i <= $l ; $i+=2 ){\n $c1 = $array[$i];\n if ( $i+1 <= $l ){ \n $c2 = $array[$i+1];\n } else {\n $c2 = 0;\n }\n $u1 = 0xE0 | (( $c1 >> 4 ) & 0x0f );\n $u2 = 0x80 | (( $c1 << 2 ) & 0x3c ) | (( $c2 >> 6 ) & 0x03 );\n $u3 = 0x80 | (( $c2 ) & 0x3f );\n $utf8 .= pack(\"CCC\", $u1, $u2, $u3);\n }\n return $utf8;\n }",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function utf8to16 ( $utf8 ){\n $utf16 = \"\";\n $array= unpack(\"C*\", \"$utf8\");\n $l = count($array);\n $i = 1;\n while ($i <= $l){\n $c1 = $array[$i++];\n $m = ($c1 & 0xE0);\n if ( ($c1 & 0x80) == 0x00 ){\n $u1 = 0;\n $u2 = $c1;\n } else if ( ($c1 & 0xE0) == 0xC0 ){\n $c2 = $array[$i++];\n $u1 = (( $c1 >> 2 ) & 0x07 ) & 0x07;\n $u2 = (( $c1 << 6 ) & 0xC0 ) | ( $c2 & 0x3F );\n } else if ( ($c1 & 0xF0) == 0xE0 ){\n $c2 = $array[$i++];\n $c3 = $array[$i++];\n $u1 = (( $c1 << 4 ) & 0xF0 ) | (( $c2 >> 2 ) & 0x0F );\n $u2 = (( $c2 << 6 ) & 0xC0 ) | ( $c3 & 0x3F );\n }\n $utf16 .= pack(\"CC\", $u1, $u2);\n }\n return $utf16;\n }",
"public function readInt16BE();",
"public static function formatFromInt16($bytes, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function writeInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function consumeInt16()\n {\n $s = $this->consume(2);\n list(, $ret) = unpack(\"s\", self::$isLittleEndian ? self::swapEndian16($s) : $s);\n return $ret;\n }",
"public function appendUint16($value)\n {\n $s = pack(\"n\", $value);\n return $this->append($s);\n }",
"public function readInt16LE();",
"public static function formatToInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function writeUnsignedInt16($num, $endian=null){ }",
"public static function formatToUInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public static function writeShort($value){\n\t\t\treturn pack(\"n\", $value);\n\t}",
"function readInt16() {\n $int = $this->readUInt16();\n\n if ($int >= 0x8000) {\n $int -= 0x10000;\n }\n\n return $int;\n }",
"public static function readSignedShort($str){\n\t\tif(PHP_INT_SIZE === 8){\n\t\t\treturn unpack(\"n\", $str)[1] << 48 >> 48;\n\t\t}else{\n\t\t\treturn unpack(\"n\", $str)[1] << 16 >> 16;\n\t\t}\n\t}",
"public static function utf16BeToUnicodePoint($utf16) {}",
"private function _encodeUTF16($string, $compressed = '')\n\t{\n\t\t$result = $string;\n\t\t//if ($this->_defaultEncoding) {\n\t\t//\tif($compressed) {\n\t\t//\t\t$string = $this->_uncompressByteString($string);\n\t\t//\t}\n\t\t//\tswitch ($this->_encoderFunction){\n\t\t//\t\tcase 'iconv' :\n\t\t//\t\t\t$result = iconv('UTF-16LE', $this->_defaultEncoding, $string);\n\t\t//\t\t\tbreak;\n\t\t//\t\tcase 'mb_convert_encoding' :\n\t\t//\t\t\t$result = mb_convert_encoding($string, $this->_defaultEncoding,\n\t\t//\t\t\t\t'UTF-16LE' );\n\t\t//\t\t\tbreak;\n\t\t//\t}\n\t\t//}\n\t\tif($compressed) {\n\t\t\t$string = $this->_uncompressByteString($string);\n \t\t}\n\t\tswitch ($this->_encoderFunction){\n\t\t\tcase 'iconv' :\n\t\t\t\t$result = iconv('UTF-16LE', 'UTF-8', $string);\n\t\t\t\tbreak;\n\t\t\tcase 'mb_convert_encoding' :\n\t\t\t\t$result = mb_convert_encoding($string, 'UTF-8', 'UTF-16LE');\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $result;\n\t}",
"public function writeUInt16($int, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function readInt16($offset = 0)\n {\n $s = $this->read(2, $offset);\n list(, $ret) = unpack(\"s\", self::$isLittleEndian ? self::swapEndian16($s) : $s);\n return $ret;\n }",
"public static function convertNumberToBinaryString(int $number): string\n {\n if ($number > 65535) {\n throw new OutOfRangeException('This is an INT16 conversion, so the maximum is 65535');\n }\n\n return chr($number >> 8) . chr($number & 255);\n }",
"public function readUInt16BE();",
"public static function toUtf16Be($string, $ignore = false, $translit = false) {}"
] |
[
"0.7311523",
"0.6836899",
"0.64777666",
"0.6352272",
"0.62589175",
"0.6019257",
"0.59735477",
"0.5832386",
"0.58107406",
"0.5800375",
"0.57452565",
"0.57412696",
"0.5725539",
"0.5533214",
"0.55128634",
"0.5507564",
"0.54411995",
"0.54395866",
"0.54317635",
"0.5419874",
"0.54172856",
"0.5330179",
"0.52864116",
"0.5231186",
"0.51754767",
"0.51501435",
"0.50551265",
"0.49963215",
"0.4990423",
"0.49764916"
] |
0.85589355
|
0
|
string packSI32(integer number) converts the given 32bit signed integer into an SWF SI32 atom.
|
function packSI32($number)
{
array_push($this->FMDebug, "packSI32");
if (!(is_numeric($number))) {
$this->FMError("packUI32 argument not a number");
}
$lower_limit = -2147483647;
$upper_limit = 2147483647;
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
if ($number < 0) {
$number = $upper_limit + 1 + abs($number);
}
$number = sprintf("%08x", $number);
$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);
$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10);
$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);
$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);
$atom = chr($low_byte_low_word) . chr($high_byte_low_word);
$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected final function _encodeSynchsafe32($val)\n {\n return ($val & 0x7f) | ($val & 0x3f80) << 1 |\n ($val & 0x1fc000) << 2 | ($val & 0xfe00000) << 3;\n }",
"public static function sid32($i64friendID)\n\t{\n\t\t$tmpfriendID = $i64friendID;\n\t\t$iServer = \"1\";\n\t\tif(bcmod($i64friendID, \"2\") == \"0\")\n\t\t{\n\t\t\t$iServer = \"0\";\n\t\t}\n\t\t$tmpfriendID = bcsub($tmpfriendID,$iServer);\n\t\tif(bccomp(\"76561197960265728\",$tmpfriendID) == -1)\n\t\t\t$tmpfriendID = bcsub($tmpfriendID,\"76561197960265728\");\n\t\t$tmpfriendID = bcdiv($tmpfriendID, \"2\");\n\t\treturn (\"STEAM_0:\" . $iServer . \":\" . $tmpfriendID);\n\t}",
"public function sFixed32($value)\n {\n $bytes = pack('l*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n\n $this->write($bytes, 4);\n }",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public static function swapEndian32($s)\n {\n return $s[3] . $s[2] . $s[1] . $s[0];\n }",
"public function pushInt32($int32)\n {\n $mask = 0xff;\n for ($i = 0; $i < 4; $i++) {\n $this->pushByte(($int32 >> ((3 - $i) * 8)) & $mask);\n }\n }",
"public function fixed32($value)\n {\n $bytes = pack('V*', $value);\n $this->write($bytes, 4);\n }",
"public function readInt32();",
"public function getSfixed32Field()\n {\n $value = $this->get(self::SFIXED32_FIELD);\n return $value === null ? (integer)$value : $value;\n }",
"public static function bit32(int $data, $endianness = false): string\n {\n // big-endian\n if (true === $endianness) {\n return pack('N', $data);\n }\n\n // little-endian\n if (false === $endianness) {\n return pack('V', $data);\n }\n\n // machine byte order\n if (null === $endianness) {\n return pack('L', $data);\n }\n }",
"public function appendSint32PackedField($value)\n {\n return $this->append(self::SINT32_PACKED_FIELD, $value);\n }",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function ensure32BitInteger($value) {}",
"public function readInt32BE();",
"public function getSint32Field()\n {\n $value = $this->get(self::SINT32_FIELD);\n return $value === null ? (integer)$value : $value;\n }",
"public function appendInt32($value)\n {\n $s = pack(\"l\", $value);\n return $this->append(self::$isLittleEndian ? self::swapEndian32($s) : $s);\n }",
"public static function formatFromInt32($bytes, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public static function hexEncodeU32 ($a) {\n $b = self::toHex8(self::unsignedRightShift($a, 24));\n $b .= self::toHex8(self::unsignedRightShift($a, 16) & 255);\n $b .= self::toHex8(self::unsignedRightShift($a, 8) & 255);\n return $b . self::toHex8($a & 255);\n }",
"protected final function _decodeSynchsafe32($val)\n {\n return ($val & 0x7f) | ($val & 0x7f00) >> 1 |\n ($val & 0x7f0000) >> 2 | ($val & 0x7f000000) >> 3;\n }",
"static public function intToMBUInt32(&$out, $i)\n {\n if ($i > 268435455) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n $bytes4 = 128 | Horde_Xml_Wbxml::getBits(4, $i);\n\n $out .= chr($bytes4) . chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 2097151) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n\n $out .= chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 16383) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n\n $out .= chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 127) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n\n $out .= chr($bytes1) . chr($bytes0);\n } else {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n\n $out .= chr($bytes0);\n }\n }",
"function packSBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSBchunk\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSBchunk argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -1073741823;\n\t\t$upper_limit = 1073741823;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($number == -1) {\n\n\t\t\t\t$atom = \"11\";\n\n\t\t\t} else {\n\n\t\t\t\t$atom = decbin($number);\n\t\t\t\t$atom = substr($atom, strpos($atom, \"10\"));\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$atom = \"0\" . decbin($number);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"private function encodeSignedNumber($num)\n\t{\n\t\t$sgn_num = $num << 1;\n\t\tif ($num < 0)\n\t\t{\n\t\t\t$sgn_num = ~($sgn_num);\n\t\t}\n\t\treturn $this->encodeNumber($sgn_num);\n\t}",
"public function setSint32Field($value)\n {\n return $this->set(self::SINT32_FIELD, $value);\n }",
"public function readInt32LE();",
"static function writeInt3(int $int): string {\n return \\substr(\\pack('V', $int), 0, 3);\n }",
"public static function readSignedShort($str){\n\t\tif(PHP_INT_SIZE === 8){\n\t\t\treturn unpack(\"n\", $str)[1] << 48 >> 48;\n\t\t}else{\n\t\t\treturn unpack(\"n\", $str)[1] << 16 >> 16;\n\t\t}\n\t}",
"public function writeInt32($num){ }"
] |
[
"0.70710176",
"0.68187785",
"0.62545484",
"0.5929963",
"0.5913817",
"0.5870581",
"0.57838255",
"0.5756805",
"0.56600296",
"0.56382406",
"0.5554322",
"0.5540389",
"0.5507616",
"0.5463177",
"0.5441967",
"0.54022527",
"0.53845555",
"0.53119516",
"0.5294948",
"0.52664095",
"0.52560705",
"0.5220995",
"0.51902336",
"0.51847667",
"0.5159125",
"0.51527995",
"0.5044445",
"0.503312",
"0.50257015",
"0.5011172"
] |
0.8553054
|
0
|
string packFIXED8(float number) converts the given signed floatingpoint number into an SWF FIXED 8.8 atom.
|
function packFIXED8($number)
{
array_push($this->FMDebug, "packFIXED8");
$lower_limit_high_byte = -127;
$upper_limit_high_byte = 127;
$lower_limit_low_byte = 0;
$upper_limit_low_byte = 99;
if (!(is_numeric($number))) {
$this->FMError("packFIXED8 argument not a number");
}
$number = round($number, 2);
$high_byte = intval($number);
if ($high_byte < $lower_limit_high_byte) {
$high_byte = $lower_limit_high_byte;
}
if ($high_byte > $upper_limit_high_byte) {
$high_byte = $upper_limit_high_byte;
}
$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);
$atom = $this->packUI8(intval($low_byte * 256 / 100));
$atom .= $this->packSI8($high_byte);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function readF8le(): float {\n $bits = $this->readU8le();\n return $this->decodeDoublePrecisionFloat($bits);\n }",
"public function readF8be(): float {\n $bits = $this->readU8be();\n return $this->decodeDoublePrecisionFloat($bits);\n }",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public static function formatToFixed($float) {}",
"public static function formatFromFixed($bytes) {}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"static function writeFloat(float $float): string {\n return \\pack('g', $float);\n }",
"private function writeBIFF8CellRangeAddressFixed($range)\n {\n $explodes = explode(':', $range);\n\n // extract first cell, e.g. 'A1'\n $firstCell = $explodes[0];\n\n // extract last cell, e.g. 'B6'\n if (count($explodes) == 1) {\n $lastCell = $firstCell;\n } else {\n $lastCell = $explodes[1];\n }\n\n $firstCellCoordinates = Coordinate::indexesFromString($firstCell); // e.g. [0, 1]\n $lastCellCoordinates = Coordinate::indexesFromString($lastCell); // e.g. [1, 6]\n\n return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, $firstCellCoordinates[0] - 1, $lastCellCoordinates[0] - 1);\n }",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"public static function formatFromInt8($byte) {}",
"public function sFixed32($value)\n {\n $bytes = pack('l*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n\n $this->write($bytes, 4);\n }",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"public function appendFloatPackedField($value)\n {\n return $this->append(self::FLOAT_PACKED_FIELD, $value);\n }",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"public function appendFixed32PackedField($value)\n {\n return $this->append(self::FIXED32_PACKED_FIELD, $value);\n }",
"public static function formatToInt8($int) {}",
"function packFBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFBchunk\");\n\n\t\t$lower_limit_high_word = -16383;\n\t\t$upper_limit_high_word = 16383;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFBchunk argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\tif ($low_word < $lower_limit_low_word) {\n\n\t\t\t$low_word = $lower_limit_low_word;\n\t\t}\n\n\t\tif ($low_word > $upper_limit_low_word) {\n\n\t\t\t$low_word = $upper_limit_low_word;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"1\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"1\" . substr(decbin($high_word), 18);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"0\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"0\" . decbin($high_word);\n\t\t\t}\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = ~$low_word;\n\n\t\t\t\t$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = sprintf(\"%016s\", decbin(intval($low_word * 65536 / 10000)));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $high_word . $low_word;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function fixed32($value)\n {\n $bytes = pack('V*', $value);\n $this->write($bytes, 4);\n }",
"function packUBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUBchunk\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647;\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUBchunk argument not a number\");\n\t\t}\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFEN($xFEN, $row_length = 10)\n{\n\t$xFEN = preg_replace('/\\s+/', '', $xFEN); // remove spaces\n\t$xFEN = preg_replace('/\\//', '', $xFEN); // remove any row separators\n\t$xFEN = trim(chunk_split($xFEN, $row_length, '/'), '/'); // add the row separators\n\t$FEN = preg_replace_callback('/(0+)/', 'pack_replace_callback', $xFEN); // pack the 0s\n\n\treturn $FEN;\n}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public static function formatToUInt8($int) {}",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}"
] |
[
"0.67326564",
"0.6411789",
"0.61985075",
"0.6087186",
"0.5951055",
"0.5747967",
"0.553411",
"0.55337125",
"0.5501005",
"0.5442006",
"0.5328634",
"0.5293013",
"0.5290729",
"0.52799904",
"0.5260869",
"0.52506495",
"0.52092546",
"0.52057785",
"0.52057785",
"0.52057785",
"0.5123199",
"0.50935066",
"0.50922525",
"0.50861216",
"0.5077252",
"0.5050428",
"0.50447184",
"0.5042683",
"0.5039164",
"0.5022634"
] |
0.78312045
|
0
|
string packFIXED16(float number) converts the given signed floatingpoint number into an SWF FIXED 16.16 atom.
|
function packFIXED16($number)
{
array_push($this->FMDebug, "packFIXED16");
$lower_limit_high_word = -32767;
$upper_limit_high_word = 32767;
$lower_limit_low_word = 0;
$upper_limit_low_word = 9999;
if (!(is_numeric($number))) {
$this->FMError("packFIXED16 argument not a number");
}
$number = round($number, 4);
$high_word = intval($number);
if ($high_word < $lower_limit_high_word) {
$high_word = $lower_limit_high_word;
}
if ($high_word > $upper_limit_high_word) {
$high_word = $upper_limit_high_word;
}
$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);
$atom = $this->packUI16(intval($low_word * 65536 / 10000));
$atom .= $this->packSI16($high_word);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public static function writeShort($value){\n\t\t\treturn pack(\"n\", $value);\n\t}",
"public function writeInt16($num){ }",
"public function fixed32($value)\n {\n $bytes = pack('V*', $value);\n $this->write($bytes, 4);\n }",
"public function sFixed32($value)\n {\n $bytes = pack('l*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n\n $this->write($bytes, 4);\n }",
"public static function swapEndian16($s)\n {\n return $s[1] . $s[0];\n }",
"static function writeFloat(float $float): string {\n return \\pack('g', $float);\n }",
"public static function formatFromInt16($bytes, $byteOrder = self::BYTE_ORDER_BIG_ENDIAN) {}",
"public function readInt16BE();",
"public static function formatToFixed($float) {}",
"public function appendFixed32PackedField($value)\n {\n return $this->append(self::FIXED32_PACKED_FIELD, $value);\n }",
"public static function utf16BeToUnicodePoint($utf16) {}",
"function utf16to8 ( $utf16 ){\n $utf8 = \"\";\n $array = unpack(\"C*\", $utf16);\n $l = count($array);\n for ($i = 1 ; $i <= $l ; $i+=2 ){\n $c1 = $array[$i];\n if ( $i+1 <= $l ){ \n $c2 = $array[$i+1];\n } else {\n $c2 = 0;\n }\n $u1 = 0xE0 | (( $c1 >> 4 ) & 0x0f );\n $u2 = 0x80 | (( $c1 << 2 ) & 0x3c ) | (( $c2 >> 6 ) & 0x03 );\n $u3 = 0x80 | (( $c2 ) & 0x3f );\n $utf8 .= pack(\"CCC\", $u1, $u2, $u3);\n }\n return $utf8;\n }",
"function packFBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFBchunk\");\n\n\t\t$lower_limit_high_word = -16383;\n\t\t$upper_limit_high_word = 16383;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFBchunk argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\tif ($low_word < $lower_limit_low_word) {\n\n\t\t\t$low_word = $lower_limit_low_word;\n\t\t}\n\n\t\tif ($low_word > $upper_limit_low_word) {\n\n\t\t\t$low_word = $upper_limit_low_word;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"1\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"1\" . substr(decbin($high_word), 18);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"0\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"0\" . decbin($high_word);\n\t\t\t}\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = ~$low_word;\n\n\t\t\t\t$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = sprintf(\"%016s\", decbin(intval($low_word * 65536 / 10000)));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $high_word . $low_word;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"static function writeDouble(float $float): string {\n return \\pack('e', $float);\n }",
"public function appendFloatPackedField($value)\n {\n return $this->append(self::FLOAT_PACKED_FIELD, $value);\n }",
"public function readInt16();",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function appendUint16($value)\n {\n $s = pack(\"n\", $value);\n return $this->append($s);\n }",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function readUInt16BE();",
"public static function formatFromFixed($bytes) {}",
"function pack_p($value) {\n $first_half = pack('V', $value & 0xffffffff);\n $second_half = pack('V', ($value >> 32) & 0xffffffff);\n\n return $first_half . $second_half;\n}",
"function utf8to16 ( $utf8 ){\n $utf16 = \"\";\n $array= unpack(\"C*\", \"$utf8\");\n $l = count($array);\n $i = 1;\n while ($i <= $l){\n $c1 = $array[$i++];\n $m = ($c1 & 0xE0);\n if ( ($c1 & 0x80) == 0x00 ){\n $u1 = 0;\n $u2 = $c1;\n } else if ( ($c1 & 0xE0) == 0xC0 ){\n $c2 = $array[$i++];\n $u1 = (( $c1 >> 2 ) & 0x07 ) & 0x07;\n $u2 = (( $c1 << 6 ) & 0xC0 ) | ( $c2 & 0x3F );\n } else if ( ($c1 & 0xF0) == 0xE0 ){\n $c2 = $array[$i++];\n $c3 = $array[$i++];\n $u1 = (( $c1 << 4 ) & 0xF0 ) | (( $c2 >> 2 ) & 0x0F );\n $u2 = (( $c2 << 6 ) & 0xC0 ) | ( $c3 & 0x3F );\n }\n $utf16 .= pack(\"CC\", $u1, $u2);\n }\n return $utf16;\n }",
"public static function readSignedShort($str){\n\t\tif(PHP_INT_SIZE === 8){\n\t\t\treturn unpack(\"n\", $str)[1] << 48 >> 48;\n\t\t}else{\n\t\t\treturn unpack(\"n\", $str)[1] << 16 >> 16;\n\t\t}\n\t}",
"public function appendInt16($value)\n {\n $s = pack(\"s\", $value);\n return $this->append(self::$isLittleEndian ? self::swapEndian16($s) : $s);\n }",
"public function readInt16LE();"
] |
[
"0.6995033",
"0.6458245",
"0.57261145",
"0.5593538",
"0.5336306",
"0.52331245",
"0.5233024",
"0.51498574",
"0.50935906",
"0.5059399",
"0.504357",
"0.50319475",
"0.49334785",
"0.49002144",
"0.48982617",
"0.48454872",
"0.4809655",
"0.47553688",
"0.47522",
"0.47485152",
"0.4727236",
"0.47154766",
"0.47111556",
"0.46802852",
"0.46719247",
"0.46672866",
"0.46641713",
"0.46529707",
"0.46167812",
"0.45776764"
] |
0.8071829
|
0
|
string packUBchunk(integer number) converts the given 31bit unsigned integer number into an SWF UB atom.
|
function packUBchunk($number)
{
array_push($this->FMDebug, "packUBchunk");
$lower_limit = 0;
$upper_limit = 2147483647;
if (!(is_numeric($number))) {
$this->FMError("packUBchunk argument not a number");
}
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
$atom = sprintf("%b", $number);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSBchunk\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSBchunk argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -1073741823;\n\t\t$upper_limit = 1073741823;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($number == -1) {\n\n\t\t\t\t$atom = \"11\";\n\n\t\t\t} else {\n\n\t\t\t\t$atom = decbin($number);\n\t\t\t\t$atom = substr($atom, strpos($atom, \"10\"));\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$atom = \"0\" . decbin($number);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFBchunk\");\n\n\t\t$lower_limit_high_word = -16383;\n\t\t$upper_limit_high_word = 16383;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFBchunk argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\tif ($low_word < $lower_limit_low_word) {\n\n\t\t\t$low_word = $lower_limit_low_word;\n\t\t}\n\n\t\tif ($low_word > $upper_limit_low_word) {\n\n\t\t\t$low_word = $upper_limit_low_word;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"1\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"1\" . substr(decbin($high_word), 18);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"0\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"0\" . decbin($high_word);\n\t\t\t}\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = ~$low_word;\n\n\t\t\t\t$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = sprintf(\"%016s\", decbin(intval($low_word * 65536 / 10000)));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $high_word . $low_word;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function buildChunkname(Range $range): string\n {\n $len = strlen($range->getTotal());\n return implode('-', [\n str_pad($range->getStart(), $len, '0', STR_PAD_LEFT),\n str_pad($range->getEnd(), $len, '0', STR_PAD_LEFT),\n ]);\n }",
"private static function calculateUDH($referenceNumber, $numberOfChunks, $chunkNumber)\n {\n return self::UDH_BEGINNING . $referenceNumber . '0' . $numberOfChunks . '0' . $chunkNumber;\n }",
"static public function intToMBUInt32(&$out, $i)\n {\n if ($i > 268435455) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n $bytes4 = 128 | Horde_Xml_Wbxml::getBits(4, $i);\n\n $out .= chr($bytes4) . chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 2097151) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n\n $out .= chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 16383) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n\n $out .= chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 127) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n\n $out .= chr($bytes1) . chr($bytes0);\n } else {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n\n $out .= chr($bytes0);\n }\n }",
"function gmp_export($gmpnumber)\n {\n return hex2bin(gmp_strval($gmpnumber, 16));\n }",
"function packnBits($number, $n)\n\t{\n\t\tarray_push($this->FMDebug, \"packnBits\");\n\n\t if (!(is_numeric($number))) {\n#error_log(\"nBits number: $number\");\n \t $this->FMError(\"packnBits argument (number) not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 32;\n\n\t if (($number < $lower_limit) or ($number > $upper_limit)) {\n\n \t $this->FMError(\"packnBits argument (number) out of range\");\n \t}\n\n\t if (!(is_numeric($n))) {\n\n \t $this->FMError(\"packnBits argument (n) not a number\");\n \t}\n\n\t if ($n < $lower_limit) {\n\n \t $this->FMError(\"packnBits argument (n) out of range\");\n \t}\n\n\t\t$n = (int) $n;\n\n\t\tif ($number > (pow(2, $n) - 1)) {\n\n\t\t\t$this->FMError(\"packnBits cannot pack ($number) in ($n) bits\");\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\t\t$atom = str_repeat(\"0\", ($n - strlen($atom))) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"protected function makeChunkFileName(int $index):string{\n\t\t$file = 'part-'.$this->dzuuid.'-'.$index.$this->partFileExt; // part-UUID-0.part\n\t\t$file = preg_replace(\"([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).])\", '', $file); // Remove anything which isn't a word, whitespace, number, or any of the following caracters -_~,;[]().\n\t\t$file = preg_replace(\"([\\.]{2,})\", '', $file); // // Remove any runs of periods\n\t\treturn $file;\n\t}",
"private function getChunk($chunk_no)\r\n\t{\r\n\t\tif ($chunk_no > $this->icc_chunks) return '';\r\n\r\n\t\t$max_chunk_size = self::MAX_BYTES_IN_MARKER - self::ICC_HEADER_LEN;\r\n\t\t$from = ($chunk_no - 1) * $max_chunk_size;\r\n\t\t$bytes = ($chunk_no < $this->icc_chunks) ? $max_chunk_size : $this->icc_size % $max_chunk_size;\r\n\r\n\t\treturn substr($this->icc_profile, $from, $bytes);\r\n\t}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"private function packedIPAddress($humanReadableIPAddress)\n {\n $result = inet_pton($humanReadableIPAddress);\n\n if ($result == FALSE)\n return $this->packedIPAddress('::0');\n elseif (strlen($result) == 16)\n return $result; // IPv6 native\n else\n return \"\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\" . $result; // IPv4, expanded to IPv6 compatible length\n }",
"public function buid()\n {\n return 'buid-' . ++$this->buid;\n }",
"function _long2str($l){\r\n return pack('N', $l);\r\n }",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}",
"function packSTRING($text)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRING\");\n\n\t\tif (!(is_string($text))) {\n\n\t\t\t$this->FMError(\"packSTRING argument not a string\");\n\t\t}\n\n\t\t$atom = strtr($text, chr(0), \"\") . chr(0);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function modify_number($number){\n //get the part of the string after the first zero\n $num = substr($number,1,strlen($number));\n //chunk the number into groups of threes\n $num_chunked = chunk_split($num,3,' ');\n return ' (0) '.$num_chunked;\n}",
"private function writeBIFF8CellRangeAddressFixed($range)\n {\n $explodes = explode(':', $range);\n\n // extract first cell, e.g. 'A1'\n $firstCell = $explodes[0];\n\n // extract last cell, e.g. 'B6'\n if (count($explodes) == 1) {\n $lastCell = $firstCell;\n } else {\n $lastCell = $explodes[1];\n }\n\n $firstCellCoordinates = Coordinate::indexesFromString($firstCell); // e.g. [0, 1]\n $lastCellCoordinates = Coordinate::indexesFromString($lastCell); // e.g. [1, 6]\n\n return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, $firstCellCoordinates[0] - 1, $lastCellCoordinates[0] - 1);\n }"
] |
[
"0.70770717",
"0.6593358",
"0.62725216",
"0.60242236",
"0.5865199",
"0.5670628",
"0.56308746",
"0.53794986",
"0.5183473",
"0.51237535",
"0.5087013",
"0.50602037",
"0.49330214",
"0.49280718",
"0.4921981",
"0.4777036",
"0.46793237",
"0.46579564",
"0.4640545",
"0.4640545",
"0.4640545",
"0.46238038",
"0.46103695",
"0.45682853",
"0.4563676",
"0.45269215",
"0.4511216",
"0.44815373",
"0.44613394",
"0.44518209"
] |
0.8230983
|
0
|
string packSBchunk(integer number) converts the given 31bit signed integer number into an SWF SB atom.
|
function packSBchunk($number)
{
array_push($this->FMDebug, "packSBchunk");
if (!(is_numeric($number))) {
$this->FMError("packSBchunk argument not a number");
}
$number = (int) $number;
$lower_limit = -1073741823;
$upper_limit = 1073741823;
if ($number < $lower_limit) {
$number = $lower_limit;
}
if ($number > $upper_limit) {
$number = $upper_limit;
}
if ($number < 0) {
if ($number == -1) {
$atom = "11";
} else {
$atom = decbin($number);
$atom = substr($atom, strpos($atom, "10"));
}
} else {
$atom = "0" . decbin($number);
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packUBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUBchunk\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647;\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUBchunk argument not a number\");\n\t\t}\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFBchunk\");\n\n\t\t$lower_limit_high_word = -16383;\n\t\t$upper_limit_high_word = 16383;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFBchunk argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\tif ($low_word < $lower_limit_low_word) {\n\n\t\t\t$low_word = $lower_limit_low_word;\n\t\t}\n\n\t\tif ($low_word > $upper_limit_low_word) {\n\n\t\t\t$low_word = $upper_limit_low_word;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"1\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"1\" . substr(decbin($high_word), 18);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"0\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"0\" . decbin($high_word);\n\t\t\t}\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = ~$low_word;\n\n\t\t\t\t$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = sprintf(\"%016s\", decbin(intval($low_word * 65536 / 10000)));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $high_word . $low_word;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packnBits($number, $n)\n\t{\n\t\tarray_push($this->FMDebug, \"packnBits\");\n\n\t if (!(is_numeric($number))) {\n#error_log(\"nBits number: $number\");\n \t $this->FMError(\"packnBits argument (number) not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 32;\n\n\t if (($number < $lower_limit) or ($number > $upper_limit)) {\n\n \t $this->FMError(\"packnBits argument (number) out of range\");\n \t}\n\n\t if (!(is_numeric($n))) {\n\n \t $this->FMError(\"packnBits argument (n) not a number\");\n \t}\n\n\t if ($n < $lower_limit) {\n\n \t $this->FMError(\"packnBits argument (n) out of range\");\n \t}\n\n\t\t$n = (int) $n;\n\n\t\tif ($number > (pow(2, $n) - 1)) {\n\n\t\t\t$this->FMError(\"packnBits cannot pack ($number) in ($n) bits\");\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\t\t$atom = str_repeat(\"0\", ($n - strlen($atom))) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}",
"function packBitValues($atoms)\n\t{\n\t\tarray_push($this->FMDebug, \"packBitsValues\");\n\n\t\tif (!(is_string($atoms))) {\n\n\t\t\t$this->FMError(\"packBitValues argument not a string\");\n\t\t}\n\n\t\t$atoms = $atoms . str_repeat(\"0\", (int) ((ceil(strlen($atoms) / 8)) * 8 - strlen($atoms)));\n\n\t\t$limit = ceil(strlen($atoms) / 8);\n\n\t\t$bytestream = \"\";\n\n\t\tfor ($n = 0; $n < $limit; $n++) {\n\n\t\t\t$bytestream .= chr(base_convert(substr($atoms, 0, 8), 2, 10));\n\t\t\t$atoms = substr($atoms, 8);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $bytestream;\n\t}",
"public function buildChunkname(Range $range): string\n {\n $len = strlen($range->getTotal());\n return implode('-', [\n str_pad($range->getStart(), $len, '0', STR_PAD_LEFT),\n str_pad($range->getEnd(), $len, '0', STR_PAD_LEFT),\n ]);\n }",
"function xlsBOF() {\n\t\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\n\t\treturn;\n\t\t}",
"static public function intToMBUInt32(&$out, $i)\n {\n if ($i > 268435455) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n $bytes4 = 128 | Horde_Xml_Wbxml::getBits(4, $i);\n\n $out .= chr($bytes4) . chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 2097151) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n\n $out .= chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 16383) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n\n $out .= chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 127) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n\n $out .= chr($bytes1) . chr($bytes0);\n } else {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n\n $out .= chr($bytes0);\n }\n }",
"function packSTRING($text)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRING\");\n\n\t\tif (!(is_string($text))) {\n\n\t\t\t$this->FMError(\"packSTRING argument not a string\");\n\t\t}\n\n\t\t$atom = strtr($text, chr(0), \"\") . chr(0);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function writeShort($value){\n\t\t\treturn pack(\"n\", $value);\n\t}",
"function modify_number($number){\n //get the part of the string after the first zero\n $num = substr($number,1,strlen($number));\n //chunk the number into groups of threes\n $num_chunked = chunk_split($num,3,' ');\n return ' (0) '.$num_chunked;\n}",
"protected static function encodeChunk( &$str, $n ) {\r\n\t\t$charIdx = (int)floor( $n * 5 / 8 );\r\n\t\t$bitOffset = ($n * 5) % 8;\r\n\t\tif( $charIdx >= strlen( $str ) ) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$byte = ord( $str[ $charIdx ] );\r\n\t\tif( $bitOffset <= 3 ) {\r\n\t\t\t//\tread highest ($bitOffset + 5) bits and puth them into $fiveBits\r\n\t\t\t$fiveBits = ( $byte >> ( 3 - $bitOffset ) ) & 31;\r\n\t\t} else {\r\n\t\t\t//\tread 8 - $bitoffset bits from the first byte\r\n\t\t\t$mask = ( 1 << ( 8 - $bitOffset ) ) - 1;\r\n\t\t\t$fiveBits = ( $byte & $mask ) << ( $bitOffset - 3 );\r\n\t\t\tif( $charIdx < strlen( $str ) - 1 ) {\r\n\t\t\t\t// read next ($bitOffset - 3) bits and put them in the lowest bits of $fiveBits\r\n\t\t\t\t$nextByte = ord( $str[ $charIdx + 1 ] );\r\n\t\t\t\t$fiveBits += $nextByte >> ( 8 - ($bitOffset - 3) );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$ret = self::$table[ $fiveBits ];\r\n\t\treturn $ret;\r\n\t}",
"function nSmToBinIp($sn) {\n\n $snb = \"\";\n\n for($i=1;$i<=32;$i++) {\n\n if($i<=$sn) {\n $snb.=\"1\";\n }\n else {\n $snb.=\"0\";\n }\n\n if($i%8==0 && $i<32){\n $snb.=\".\";\n }\n }\n\n return $snb;\n}",
"private function packCounter($counter)\n {\n // so we need to pack it down properly.\n $cur_counter = array(0, 0, 0, 0, 0, 0, 0, 0);\n for ($i = 7; $i >= 0; $i--) {\n $cur_counter[$i] = pack('C*', $counter);\n $counter = $counter >> 8;\n }\n\n $bin_counter = implode($cur_counter);\n\n // Pad to 8 chars\n if (strlen($bin_counter) < 8) {\n $bin_counter = str_repeat(chr(0), 8 - strlen($bin_counter)) . $bin_counter;\n }\n\n return $bin_counter;\n }",
"function gmp_export($gmpnumber)\n {\n return hex2bin(gmp_strval($gmpnumber, 16));\n }",
"protected function makeChunkFileName(int $index):string{\n\t\t$file = 'part-'.$this->dzuuid.'-'.$index.$this->partFileExt; // part-UUID-0.part\n\t\t$file = preg_replace(\"([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).])\", '', $file); // Remove anything which isn't a word, whitespace, number, or any of the following caracters -_~,;[]().\n\t\t$file = preg_replace(\"([\\.]{2,})\", '', $file); // // Remove any runs of periods\n\t\treturn $file;\n\t}"
] |
[
"0.7550703",
"0.7076738",
"0.68079543",
"0.6384921",
"0.6205179",
"0.60553926",
"0.5911258",
"0.58995354",
"0.56933516",
"0.5692255",
"0.55950946",
"0.55783236",
"0.5376508",
"0.53754574",
"0.53754574",
"0.53754574",
"0.53683484",
"0.5222619",
"0.51564884",
"0.51295435",
"0.5116391",
"0.50169724",
"0.49324644",
"0.49046296",
"0.48943758",
"0.48943347",
"0.48851064",
"0.48632926",
"0.4829655",
"0.4726091"
] |
0.8451586
|
0
|
string packFBchunk(float number) converts the given signed floatingpoint number into an SWF FB atom.
|
function packFBchunk($number)
{
array_push($this->FMDebug, "packFBchunk");
$lower_limit_high_word = -16383;
$upper_limit_high_word = 16383;
$lower_limit_low_word = 0;
$upper_limit_low_word = 9999;
if (!(is_numeric($number))) {
$this->FMError("packFBchunk argument not a number");
}
$number = round($number, 4);
$high_word = intval($number);
$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);
if ($high_word < $lower_limit_high_word) {
$high_word = $lower_limit_high_word;
}
if ($high_word > $upper_limit_high_word) {
$high_word = $upper_limit_high_word;
}
if ($low_word < $lower_limit_low_word) {
$low_word = $lower_limit_low_word;
}
if ($low_word > $upper_limit_low_word) {
$low_word = $upper_limit_low_word;
}
if ($number < 0) {
if ($high_word == 0) {
$high_word = "1";
} else {
$high_word = "1" . substr(decbin($high_word), 18);
}
} else {
if ($high_word == 0) {
$high_word = "0";
} else {
$high_word = "0" . decbin($high_word);
}
}
if ($number < 0) {
if ($low_word == 0) {
$low_word = "0000000000000000";
} else {
$low_word = ~$low_word;
$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);
}
} else {
if ($low_word == 0) {
$low_word = "0000000000000000";
} else {
$low_word = sprintf("%016s", decbin(intval($low_word * 65536 / 10000)));
}
}
$atom = $high_word . $low_word;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSBchunk\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSBchunk argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -1073741823;\n\t\t$upper_limit = 1073741823;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($number == -1) {\n\n\t\t\t\t$atom = \"11\";\n\n\t\t\t} else {\n\n\t\t\t\t$atom = decbin($number);\n\t\t\t\t$atom = substr($atom, strpos($atom, \"10\"));\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$atom = \"0\" . decbin($number);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUBchunk\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647;\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUBchunk argument not a number\");\n\t\t}\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"function fizzbuzz($fb) {\n\tif($fb<1 || !is_numeric($fb)){\n\t\treturn \"\";\n\t}else if($fb % 15 == 0){\n\t\treturn \"FizzBuzz\";\n\t}else if($fb % 3 == 0){\n\t\treturn \"Fizz\";\n\t}else if($fb %5 == 0){\n\t\treturn \"Buzz\";\n\t}else{\n\t\treturn $fb;\n\t}\t\n}",
"static function writeFloat(float $float): string {\n return \\pack('g', $float);\n }",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function xlsBOF() {\n\t\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\n\t\treturn;\n\t\t}",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}",
"function packnBits($number, $n)\n\t{\n\t\tarray_push($this->FMDebug, \"packnBits\");\n\n\t if (!(is_numeric($number))) {\n#error_log(\"nBits number: $number\");\n \t $this->FMError(\"packnBits argument (number) not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 32;\n\n\t if (($number < $lower_limit) or ($number > $upper_limit)) {\n\n \t $this->FMError(\"packnBits argument (number) out of range\");\n \t}\n\n\t if (!(is_numeric($n))) {\n\n \t $this->FMError(\"packnBits argument (n) not a number\");\n \t}\n\n\t if ($n < $lower_limit) {\n\n \t $this->FMError(\"packnBits argument (n) out of range\");\n \t}\n\n\t\t$n = (int) $n;\n\n\t\tif ($number > (pow(2, $n) - 1)) {\n\n\t\t\t$this->FMError(\"packnBits cannot pack ($number) in ($n) bits\");\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\t\t$atom = str_repeat(\"0\", ($n - strlen($atom))) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function appendFloatPackedField($value)\n {\n return $this->append(self::FLOAT_PACKED_FIELD, $value);\n }",
"function packFEN($xFEN, $row_length = 10)\n{\n\t$xFEN = preg_replace('/\\s+/', '', $xFEN); // remove spaces\n\t$xFEN = preg_replace('/\\//', '', $xFEN); // remove any row separators\n\t$xFEN = trim(chunk_split($xFEN, $row_length, '/'), '/'); // add the row separators\n\t$FEN = preg_replace_callback('/(0+)/', 'pack_replace_callback', $xFEN); // pack the 0s\n\n\treturn $FEN;\n}",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packBitValues($atoms)\n\t{\n\t\tarray_push($this->FMDebug, \"packBitsValues\");\n\n\t\tif (!(is_string($atoms))) {\n\n\t\t\t$this->FMError(\"packBitValues argument not a string\");\n\t\t}\n\n\t\t$atoms = $atoms . str_repeat(\"0\", (int) ((ceil(strlen($atoms) / 8)) * 8 - strlen($atoms)));\n\n\t\t$limit = ceil(strlen($atoms) / 8);\n\n\t\t$bytestream = \"\";\n\n\t\tfor ($n = 0; $n < $limit; $n++) {\n\n\t\t\t$bytestream .= chr(base_convert(substr($atoms, 0, 8), 2, 10));\n\t\t\t$atoms = substr($atoms, 8);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $bytestream;\n\t}",
"private function formatFNumber($input) {\n $leader = \"f/\"; // input in format f/16; trim \"f/\" leader\n if (strpos($input, $leader) === 0) {\n $input = substr($input, strpos($input, $leader) + strlen($leader));\n }\n\n if (!is_numeric($input)) {\n assert(\"is_numeric('$input') && \\$input = '$input'\");\n return \"\";\n }\n \n if ((int)$input <= 0) {\n assert(\"(int)'$input' > 0 && \\$input = '$input'\");\n return \"\";\n }\n \n return \"ƒ/\".$input;\n }",
"public function appendFloat($value)\n {\n $s = pack(\"f\", $value);\n return $this->append(self::$isLittleEndian ? self::swapEndian32($s) : $s);\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 imageToFramebuffer($img) : string\n {\n $h = imagesy($img);\n $w = imagesx($img);\n $fb = '';\n\n for ($y = 0; $y < $h; $y++) {\n for ($x = 0; $x < $w; $x++) {\n $rgb888 = imagecolorat($img, $x, $y);\n $rgb565 = $this->rgb888ToRgb565($rgb888);\n $fb .= pack(\"v\", $rgb565);\n }\n }\n\n return $fb;\n }",
"private function rebuildInstance( $instance )\n\t{\n\t\t$instanceBin = hex2bin( $instance->header . Helper::pad( 6 ) );\n\t\t$instanceBin .= Helper::floatTuple2Bin( $instance->normal );\n\t\t$instanceBin .= Helper::floatTuple2Bin( $instance->tangent );\n\t\t$instanceBin .= Helper::floatTuple2Bin( $instance->bitangent );\n\t\t$instanceBin .= Helper::floatTuple2Bin( $instance->position, false );\n\t\t$instanceBin .= hex2bin( \"3f800000\" );\n\t\t$instanceBin .= Helper::floatTuple2Bin( $instance->data1 );\n\t\t$instanceBin .= Helper::floatTuple2Bin( $instance->data2, false );\n\t\t$instanceBin .= hex2bin( Helper::pad( 1 ) . $instance->flag );\n\t\t$instanceBin .= Helper::str2bin( $instance->hash );\n\t\t$instanceBin .= Helper::str2bin( $instance->class );\n\t\t$instanceBin .= Helper::str2bin( $instance->render );\n\t\t$instanceBin .= $this->rebuildProperties( $instance->properties );\n\n\t\treturn $instanceBin;\n\t}",
"private function format(float $number) : float\n {\n return number_format($number, self::DIGITS);\n }"
] |
[
"0.663635",
"0.65421677",
"0.5564131",
"0.5553282",
"0.52160203",
"0.5149728",
"0.5018454",
"0.4991707",
"0.4960379",
"0.4960379",
"0.4960379",
"0.4957555",
"0.4929823",
"0.4925302",
"0.48801333",
"0.48610884",
"0.4852673",
"0.4851211",
"0.48110652",
"0.47622344",
"0.4759504",
"0.47215074",
"0.46861207",
"0.46760184",
"0.467532",
"0.46260586",
"0.44681117",
"0.44653547",
"0.44602406",
"0.4448391"
] |
0.73566335
|
0
|
string packnBits(integer number, integer n) converts the given unsigned integer number (the length of the largest bit field) into an SWF n bits long nBits atom.
|
function packnBits($number, $n)
{
array_push($this->FMDebug, "packnBits");
if (!(is_numeric($number))) {
#error_log("nBits number: $number");
$this->FMError("packnBits argument (number) not a number");
}
$number = (int) $number;
$lower_limit = 0;
$upper_limit = 32;
if (($number < $lower_limit) or ($number > $upper_limit)) {
$this->FMError("packnBits argument (number) out of range");
}
if (!(is_numeric($n))) {
$this->FMError("packnBits argument (n) not a number");
}
if ($n < $lower_limit) {
$this->FMError("packnBits argument (n) out of range");
}
$n = (int) $n;
if ($number > (pow(2, $n) - 1)) {
$this->FMError("packnBits cannot pack ($number) in ($n) bits");
}
$atom = sprintf("%b", $number);
$atom = str_repeat("0", ($n - strlen($atom))) . $atom;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packUI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packUI32\");\n\n\t if (!(is_integer($number))) {\n\n \t $this->FMError(\"packUI32 argument not an integer\");\n \t}\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647; \t# the real limit is 4294967295\n\t\t\t\t\t\t# but PHP 4 cannot handle such\n\t\t\t\t\t\t# large unsigned integers \n\n\t if ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n \t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"public function EncodedLen($n){ \n return $n * 2 ;\n }",
"function packUBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUBchunk\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 2147483647;\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUBchunk argument not a number\");\n\t\t}\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSBchunk\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSBchunk argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -1073741823;\n\t\t$upper_limit = 1073741823;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($number == -1) {\n\n\t\t\t\t$atom = \"11\";\n\n\t\t\t} else {\n\n\t\t\t\t$atom = decbin($number);\n\t\t\t\t$atom = substr($atom, strpos($atom, \"10\"));\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$atom = \"0\" . decbin($number);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFBchunk\");\n\n\t\t$lower_limit_high_word = -16383;\n\t\t$upper_limit_high_word = 16383;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFBchunk argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\tif ($low_word < $lower_limit_low_word) {\n\n\t\t\t$low_word = $lower_limit_low_word;\n\t\t}\n\n\t\tif ($low_word > $upper_limit_low_word) {\n\n\t\t\t$low_word = $upper_limit_low_word;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"1\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"1\" . substr(decbin($high_word), 18);\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($high_word == 0) {\n\n\t\t\t\t$high_word = \"0\";\n\n\t\t\t} else {\n\n\t\t\t\t$high_word = \"0\" . decbin($high_word);\n\t\t\t}\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = ~$low_word;\n\n\t\t\t\t$low_word = substr(decbin(intval($low_word * 65536 / 10000)), 16);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ($low_word == 0) {\n\n\t\t\t\t$low_word = \"0000000000000000\";\n\n\t\t\t} else {\n\n\t\t\t\t$low_word = sprintf(\"%016s\", decbin(intval($low_word * 65536 / 10000)));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $high_word . $low_word;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packUI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packUI8 argument $number not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 255;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function int_to_word($n)\r\n\t{\r\n\t\treturn chr($n & 255).chr(($n >> 8) & 255);\r\n\t}",
"function packUI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packUI16\");\n\n \tif (!(is_numeric($number))) {\n\n \t$this->FMError(\"packUI16 argument not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 65535;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function gen_subnet_mask_long($bits) {\n\t$sm = 0;\n\tfor ($i = 0; $i < $bits; $i++) {\n\t\t$sm >>= 1;\n\t\t$sm |= 0x80000000;\n\t}\n\treturn $sm;\n}",
"function swapNibbles($number)\n {\n $swap_nibbles = (($number & 0x0F) << 4 | ($number & 0xF0) >> 4);\n $power = $swap_nibbles;\n echo \"\\n\" . \"Number generated after swapping nibbles is: \" . $swap_nibbles;\n AlgorithmsUtility::checkpower($power);\n }",
"private function _binarize($data, $base, $n)\n {\n if ($base != 16) {\n $data = base_convert($data, $base, 16);\n }\n\n $len = $n * 2;\n $hex = sprintf(\"%0{$len}s\", $data);\n return pack(\"H{$len}\", $hex);\n }",
"function packFIXED8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED8\");\n\n\t\t$lower_limit_high_byte = -127;\n\t\t$upper_limit_high_byte = 127;\n\t\t$lower_limit_low_byte = 0;\n\t\t$upper_limit_low_byte = 99;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED8 argument not a number\");\n \t}\n\n\t\t$number = round($number, 2);\n\n\t\t$high_byte = intval($number);\n\n\t\tif ($high_byte < $lower_limit_high_byte) {\n\n\t\t\t$high_byte = $lower_limit_high_byte;\n\t\t}\n\n\t\tif ($high_byte > $upper_limit_high_byte) {\n\n\t\t\t$high_byte = $upper_limit_high_byte;\n\t\t}\n\n\t\t$low_byte = (int) ((abs($number) - intval(abs($number))) * 100);\n\n\t\t$atom = $this->packUI8(intval($low_byte * 256 / 100));\n\t\t$atom .= $this->packSI8($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected static function encodeChunk( &$str, $n ) {\r\n\t\t$charIdx = (int)floor( $n * 5 / 8 );\r\n\t\t$bitOffset = ($n * 5) % 8;\r\n\t\tif( $charIdx >= strlen( $str ) ) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t$byte = ord( $str[ $charIdx ] );\r\n\t\tif( $bitOffset <= 3 ) {\r\n\t\t\t//\tread highest ($bitOffset + 5) bits and puth them into $fiveBits\r\n\t\t\t$fiveBits = ( $byte >> ( 3 - $bitOffset ) ) & 31;\r\n\t\t} else {\r\n\t\t\t//\tread 8 - $bitoffset bits from the first byte\r\n\t\t\t$mask = ( 1 << ( 8 - $bitOffset ) ) - 1;\r\n\t\t\t$fiveBits = ( $byte & $mask ) << ( $bitOffset - 3 );\r\n\t\t\tif( $charIdx < strlen( $str ) - 1 ) {\r\n\t\t\t\t// read next ($bitOffset - 3) bits and put them in the lowest bits of $fiveBits\r\n\t\t\t\t$nextByte = ord( $str[ $charIdx + 1 ] );\r\n\t\t\t\t$fiveBits += $nextByte >> ( 8 - ($bitOffset - 3) );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$ret = self::$table[ $fiveBits ];\r\n\t\treturn $ret;\r\n\t}",
"function nSmToBinIp($sn) {\n\n $snb = \"\";\n\n for($i=1;$i<=32;$i++) {\n\n if($i<=$sn) {\n $snb.=\"1\";\n }\n else {\n $snb.=\"0\";\n }\n\n if($i%8==0 && $i<32){\n $snb.=\".\";\n }\n }\n\n return $snb;\n}",
"public function writeLongLong($n)\n {\n $this->flushbits();\n $this->_out .= implode(\"\", Writer::chrbytesplit($n, 8));\n }",
"function wolf_share_format_number( $n = 0 ) {\n\n\t$s = array( 'K', 'M', 'G', 'T' );\n\t$out = '';\n\twhile ( $n >= 1000 && count( $s ) > 0) {\n\t\t$n = $n / 1000.0;\n\t\t$out = array_shift( $s );\n\t}\n\treturn round( $n, max( 0, 3 - strlen( (int)$n ) ) ) .\" $out\";\n}",
"static function packInt64($x) {\n if (PHP_INT_SIZE == 8) {\n if (version_compare(PHP_VERSION, '5.6.3', '>=')) {\n return pack('J', $x);\n } else {\n return pack('NN', ($x & 0xFFFFFFFF00000000) >> 32, $x & ($x & 0x00000000FFFFFFFF)); \n }\n } else {\n // 32-bit system\n return \"\\x00\\x00\\x00\\x00\" . pack('N', $x);\n }\n }",
"public static function convertToBytes($number)\n {\n // phpcs:enable Magento2.Functions.StaticFunction\n if (!preg_match('/^(.*\\d)\\h*(\\D)$/', $number, $matches)) {\n throw new \\InvalidArgumentException(\"Number format '{$number}' is not recognized.\");\n }\n $unitSymbol = strtoupper($matches[2]);\n if (false === strpos(self::MEMORY_UNITS, $unitSymbol)) {\n throw new \\InvalidArgumentException(\"The number '{$number}' has an unrecognized unit: '{$unitSymbol}'.\");\n }\n $result = self::_convertToNumber($matches[1]);\n $pow = $unitSymbol ? strpos(self::MEMORY_UNITS, $unitSymbol) : 0;\n $is32Bit = PHP_INT_SIZE == 4;\n if ($is32Bit && $pow >= 4) {\n throw new \\OutOfBoundsException(\"A 32-bit system is unable to process such a number.\");\n }\n if ($unitSymbol) {\n $result *= pow(1024, $pow);\n }\n return (int)$result;\n }",
"static public function intToMBUInt32(&$out, $i)\n {\n if ($i > 268435455) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n $bytes4 = 128 | Horde_Xml_Wbxml::getBits(4, $i);\n\n $out .= chr($bytes4) . chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 2097151) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n $bytes3 = 128 | Horde_Xml_Wbxml::getBits(3, $i);\n\n $out .= chr($bytes3) . chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 16383) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n $bytes2 = 128 | Horde_Xml_Wbxml::getBits(2, $i);\n\n $out .= chr($bytes2) . chr($bytes1) . chr($bytes0);\n } elseif ($i > 127) {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n $bytes1 = 128 | Horde_Xml_Wbxml::getBits(1, $i);\n\n $out .= chr($bytes1) . chr($bytes0);\n } else {\n $bytes0 = 0 | Horde_Xml_Wbxml::getBits(0, $i);\n\n $out .= chr($bytes0);\n }\n }",
"public static function le2be(int $n): int\n {\n $rv = 0;\n\n while ($n) {\n $rv <<= 8;\n $rv |= $n & 0xff;\n $n >>= 8;\n }\n\n return $rv;\n }",
"public function getBits(): int;",
"public function modifierMbyte($num)\n {\n if (strtolower($this->getIsp()) == 'tnc') {\n $kNum = round(ceil($num/10000));\n $mNum = $kNum/100;\n }else{\n $mNum = round($num/pow(1024,2),2);\n }\n return $mNum.\"MB\";\n }",
"function packSI8($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI8\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI8 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -127;\n\t\t$upper_limit = 127;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$atom = chr($number);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function mswTicketNumber($num) {\n global $SETTINGS;\n $zeros = '';\n if ($SETTINGS->minTickDigits>0 && $SETTINGS->minTickDigits>strlen($num)) {\n for ($i=0; $i<$SETTINGS->minTickDigits-strlen($num); $i++) {\n $zeros .= 0;\n }\n }\n return $zeros.$num;\n}",
"function _long2str($l){\r\n return pack('N', $l);\r\n }",
"function pack_p($value) {\n $first_half = pack('V', $value & 0xffffffff);\n $second_half = pack('V', ($value >> 32) & 0xffffffff);\n\n return $first_half . $second_half;\n}",
"public static function be2leStr(int $n, int $len): string\n {\n $rv = '';\n \n for ($pos = 0; $pos < $len; $pos++) {\n $rv .= sprintf('%02x', $n & 0xff);\n $n >>= 8;\n }\n \n return $rv;\n }",
"function packBitValues($atoms)\n\t{\n\t\tarray_push($this->FMDebug, \"packBitsValues\");\n\n\t\tif (!(is_string($atoms))) {\n\n\t\t\t$this->FMError(\"packBitValues argument not a string\");\n\t\t}\n\n\t\t$atoms = $atoms . str_repeat(\"0\", (int) ((ceil(strlen($atoms) / 8)) * 8 - strlen($atoms)));\n\n\t\t$limit = ceil(strlen($atoms) / 8);\n\n\t\t$bytestream = \"\";\n\n\t\tfor ($n = 0; $n < $limit; $n++) {\n\n\t\t\t$bytestream .= chr(base_convert(substr($atoms, 0, 8), 2, 10));\n\t\t\t$atoms = substr($atoms, 8);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $bytestream;\n\t}"
] |
[
"0.5885761",
"0.5774764",
"0.57318264",
"0.5704442",
"0.552058",
"0.5489589",
"0.54482836",
"0.5427916",
"0.5427124",
"0.5390891",
"0.52813727",
"0.5269707",
"0.5197172",
"0.51616627",
"0.5138883",
"0.5118182",
"0.50960344",
"0.50392574",
"0.5022622",
"0.4967014",
"0.49598134",
"0.4944131",
"0.49403125",
"0.4911279",
"0.49086645",
"0.48610434",
"0.4853582",
"0.48504037",
"0.4848784",
"0.48269656"
] |
0.86434275
|
0
|
string packBitValues(string atoms) converts the given string of SWF bit values (atoms) into a bytealigned stream.
|
function packBitValues($atoms)
{
array_push($this->FMDebug, "packBitsValues");
if (!(is_string($atoms))) {
$this->FMError("packBitValues argument not a string");
}
$atoms = $atoms . str_repeat("0", (int) ((ceil(strlen($atoms) / 8)) * 8 - strlen($atoms)));
$limit = ceil(strlen($atoms) / 8);
$bytestream = "";
for ($n = 0; $n < $limit; $n++) {
$bytestream .= chr(base_convert(substr($atoms, 0, 8), 2, 10));
$atoms = substr($atoms, 8);
}
array_pop($this->FMDebug);
return $bytestream;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function packstr( &$out )\n{\n $args = func_num_args();\n for ( $i = 1; $i < $args; $i++ )\n {\n $str = func_get_arg( $i ); \n $out .= pack( 'Ca*', strlen( $str ), $str );\n }\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function packSTRING($text)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRING\");\n\n\t\tif (!(is_string($text))) {\n\n\t\t\t$this->FMError(\"packSTRING argument not a string\");\n\t\t}\n\n\t\t$atom = strtr($text, chr(0), \"\") . chr(0);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}",
"function bstr2bin($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Unpack as a hexadecimal string\r\n\t\t$value = unpack('H*', $input);\r\n\t\t// Output binary representation\r\n\t\t$value = str_split($value[1], 1);\r\n\t\t$bin = '';\r\n\t\tforeach ($value as $v){\r\n\t\t\t$b = str_pad(base_convert($v, 16, 2), 4, '0', STR_PAD_LEFT);\r\n\t\t\t$bin .= $b;\r\n\t\t}\r\n\t\treturn $bin;\r\n\t}",
"public function writeString($bitStr)\n {\n for ($i = 0; $i < strlen($bitStr); $i++) {\n $this->writeBit((bool) $bitStr[$i]);\n }\n }",
"public function quoteBit(?string $bits): string\n {\n if ($bits===null || $bits==='')\n {\n return 'null';\n }\n\n return \"b'\".$this->mysqli->real_escape_string($bits).\"'\";\n }",
"function bin2bstr($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Pack into a string\r\n\t\t$input = str_split($input, 2);\r\n\t\t$str = '';\r\n\t\tforeach ($input as $v){\r\n\t\t\t$str .= base_convert($v, 2, 16);\r\n\t\t}\r\n\t\t$str = pack('H*', $str);\r\n\t\treturn $str;\r\n\t}",
"function hextobin($hexString) \n { \n $length = strlen($hexString); \n $binString=\"\"; \n $count=0; \n while($count<$length) \n { \n $subString =substr($hexString,$count,2); \n $packedString = pack(\"H*\",$subString); \n if ($count==0)\n {\n $binString=$packedString;\n } \n \n else \n {\n $binString.=$packedString;\n } \n \n $count+=2; \n } \n return $binString; \n }",
"function xlsBOF() {\n\t\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\n\t\treturn;\n\t\t}",
"function browseAndStoreBitValues($bits)\n {\n $values = [];\n\n foreach (str_split($bits) as $index => $bit) {\n if ($bit) {\n $values[] = $index + 1;\n }\n }\n\n return $values;\n }",
"public function encode()\n {\n /**\n * 4a - value tag\n * 00 00 - name length\n * 00 0c - value length\n * 6d 65 64 69 61 2d 73 6f 75 72 63 65 - media-source (12 bytes)\n * 44 - member value tag\n * 00 00 - name length\n * 00 08 - member-value-length\n * 65 6e 76 65 6c 6f 70 65 - member value (8 bytes) \n */\n // value tag\n $binary = pack('c', $this->valueTag);\n // name-length 0x0000\n $binary .= $this->nameLength->encode();\n // value-length (value is w)\n $binary .= $this->valueLength->encode();\n // value (member-name)\n $binary .= $this->value->encode();\n // member-value-tag\n $binary .= pack('c', $this->memberValueTag);\n // name-length (value is 0x0000)\n $binary .= $this->nameLength->encode();\n // member-value-length (value is x)\n $binary .= $this->memberValueLength->encode();\n // member-value\n $binary .= $this->memberValue->encode();\n return $binary;\n }",
"public function pack($sig);",
"public static function parseBits($s, $jedec = false) {\n return self::parseBytes($s, $jedec) * 8;\n }",
"function toBin($str){\n $str = (string)$str;\n $l = strlen($str);\n $result = '';\n while($l--){\n $result = str_pad(decbin(ord($str[$l])),8,\"0\",STR_PAD_LEFT).$result;\n }\n return $result;\n }",
"function packSBchunk($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSBchunk\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSBchunk argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -1073741823;\n\t\t$upper_limit = 1073741823;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\tif ($number == -1) {\n\n\t\t\t\t$atom = \"11\";\n\n\t\t\t} else {\n\n\t\t\t\t$atom = decbin($number);\n\t\t\t\t$atom = substr($atom, strpos($atom, \"10\"));\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$atom = \"0\" . decbin($number);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function quoteBinary(?string $value): string\n {\n if ($value===null || $value==='') return 'null';\n\n return '0x'.bin2hex($value);\n }",
"function packSI32($number)\n\t{\t\n\t\tarray_push($this->FMDebug, \"packSI32\");\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packUI32 argument not a number\");\n \t}\n\t\t$lower_limit = -2147483647;\n\t\t$upper_limit = 2147483647;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%08x\", $number);\n\n\t\t$low_byte_low_word = base_convert(substr($number, 6, 2), 16, 10);\n\t\t$high_byte_low_word = base_convert(substr($number, 4, 2), 16, 10); \n\n\t\t$low_byte_high_word = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte_high_word = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte_low_word) . chr($high_byte_low_word);\n\t\t$atom .= chr($low_byte_high_word) . chr($high_byte_high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packnBits($number, $n)\n\t{\n\t\tarray_push($this->FMDebug, \"packnBits\");\n\n\t if (!(is_numeric($number))) {\n#error_log(\"nBits number: $number\");\n \t $this->FMError(\"packnBits argument (number) not a number\");\n \t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 32;\n\n\t if (($number < $lower_limit) or ($number > $upper_limit)) {\n\n \t $this->FMError(\"packnBits argument (number) out of range\");\n \t}\n\n\t if (!(is_numeric($n))) {\n\n \t $this->FMError(\"packnBits argument (n) not a number\");\n \t}\n\n\t if ($n < $lower_limit) {\n\n \t $this->FMError(\"packnBits argument (n) out of range\");\n \t}\n\n\t\t$n = (int) $n;\n\n\t\tif ($number > (pow(2, $n) - 1)) {\n\n\t\t\t$this->FMError(\"packnBits cannot pack ($number) in ($n) bits\");\n\t\t}\n\n\t\t$atom = sprintf(\"%b\", $number);\n\t\t$atom = str_repeat(\"0\", ($n - strlen($atom))) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"private function arrayToBin(\n array $bytes\n ): string {\n return call_user_func_array('pack', array_merge(['c*'], $bytes));\n }",
"protected function _processValue($flag, $value)\n {\n if (is_string($value)) {\n $flag |= self::MEMC_VAL_IS_STRING;\n } elseif (is_long($value)) {\n $flag |= self::MEMC_VAL_IS_LONG;\n } elseif (is_double($value)) {\n $flag |= self::MEMC_VAL_IS_DOUBLE;\n } elseif (is_bool($value)) {\n $flag |= self::MEMC_VAL_IS_BOOL;\n } else {\n $value = serialize($value);\n $flag |= self::MEMC_VAL_IS_SERIALIZED;\n }\n\n if (array_key_exists(self::OPT_COMPRESSION, $this->_options) and $this->_options[self::OPT_COMPRESSION]) {\n $flag |= self::MEMC_VAL_COMPRESSED;\n $value = gzcompress($value);\n }\n return array($flag, $value);\n }",
"function pack_p($value) {\n $first_half = pack('V', $value & 0xffffffff);\n $second_half = pack('V', ($value >> 32) & 0xffffffff);\n\n return $first_half . $second_half;\n}",
"function packSI16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packSI16\");\n\n\t\tif (!(is_numeric($number))) {\n\n\t\t\t$this->FMError(\"packSI16 argument not a number\");\n\t\t}\n\n\t\t$number = (int) $number;\n\n\t\t$lower_limit = -32767;\n\t\t$upper_limit = 32767;\n\n\t\tif ($number < $lower_limit) {\n\n\t\t\t$number = $lower_limit;\n\t\t}\n\n\t\tif ($number > $upper_limit) {\n\n\t\t\t$number = $upper_limit;\n\t\t}\n\n\t\tif ($number < 0 ) {\n\n\t\t\t$number = $upper_limit + 1 + abs($number);\n\t\t}\n\n\t\t$number = sprintf(\"%04x\", $number);\n\n\t\t$low_byte = base_convert(substr($number, 2, 2), 16, 10);\n\t\t$high_byte = base_convert(substr($number, 0, 2), 16, 10);\n\n\t\t$atom = chr($low_byte) . chr($high_byte);\n\n\t\tarray_pop($this->FMDebug);\n\n \treturn $atom;\n\t}",
"function packFIXED16($number)\n\t{\n\t\tarray_push($this->FMDebug, \"packFIXED16\");\n\n\t\t$lower_limit_high_word = -32767;\n\t\t$upper_limit_high_word = 32767;\n\t\t$lower_limit_low_word = 0;\n\t\t$upper_limit_low_word = 9999;\n\n\t if (!(is_numeric($number))) {\n\n \t $this->FMError(\"packFIXED16 argument not a number\");\n \t}\n\n\t\t$number = round($number, 4);\n\n\t\t$high_word = intval($number);\n\n\t\tif ($high_word < $lower_limit_high_word) {\n\n\t\t\t$high_word = $lower_limit_high_word;\n\t\t}\n\n\t\tif ($high_word > $upper_limit_high_word) {\n\n\t\t\t$high_word = $upper_limit_high_word;\n\t\t}\n\n\t\t$low_word = (int) ((abs($number) - intval(abs($number))) * 10000);\n\n\t\t$atom = $this->packUI16(intval($low_word * 65536 / 10000));\n\t\t$atom .= $this->packSI16($high_word);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function str2bin($str)\n {\n $out = '';\n\n foreach (str_split($str) as $char) {\n //determine symbol ASCII-code\n $dec = ord($char);\n //convert to binary representation and add leading zeros\n $bin = sprintf('%08d', base_convert($dec, 10, 2));\n $out .= $bin;\n }\n\n return $out;\n }"
] |
[
"0.5493488",
"0.53938377",
"0.53446263",
"0.5320433",
"0.5320433",
"0.5320433",
"0.5316941",
"0.5142852",
"0.5058767",
"0.5020219",
"0.48972964",
"0.48881283",
"0.48350528",
"0.48101637",
"0.4808326",
"0.4804111",
"0.47964606",
"0.478104",
"0.4657796",
"0.46249056",
"0.4605041",
"0.45791924",
"0.4576951",
"0.45647734",
"0.4534426",
"0.4486713",
"0.44829983",
"0.44604388",
"0.4419199",
"0.44001502"
] |
0.83268684
|
0
|
string packSTRING(string text) converts the given text string into an SWF STRING atom.
|
function packSTRING($text)
{
array_push($this->FMDebug, "packSTRING");
if (!(is_string($text))) {
$this->FMError("packSTRING argument not a string");
}
$atom = strtr($text, chr(0), "") . chr(0);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packstr( &$out )\n{\n $args = func_num_args();\n for ( $i = 1; $i < $args; $i++ )\n {\n $str = func_get_arg( $i ); \n $out .= pack( 'Ca*', strlen( $str ), $str );\n }\n}",
"public function putString($string, $dynamic = true)\n {\n // appends string length if requires\n if($dynamic)\n {\n $this->putShort( strlen($string) );\n }\n\n $this->buffer .= $string;\n }",
"private function write_ue4_string(&$file, $string)\n {\n $length = strlen($string) + 1;\n $packed_data = pack('i', $length);\n fwrite($file, $packed_data);\n fwrite($file, $string);\n fwrite($file, pack('c', '0'));\n }",
"public function fromString(string $string);",
"static public function PackStringWithLength($str)\n {\n $len = strlen($str);\n # UTF-8\n if (!self::ValidateUTF8($str)) {\n throw new Exception('Bad UTF-8 String');\n }\n return pack('n', $len) . $str;\n }",
"public function addStringAttachment($string, $filename, $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'attachment')\n {\n }",
"public static function stringToStream($string)\n {\n return fopen('data://text/plain,'.urlencode($string), 'rb');\n }",
"public static function putObjectString($string, $bucket, $uri, $acl = self::ACL_PRIVATE, $metaHeaders = array(), $contentType = 'text/plain')\n\t{\n\t\treturn self::putObject($string, $bucket, $uri, $acl, $metaHeaders, $contentType);\n\t}",
"public static function putObjectString($string, $bucket, $uri, $acl = self::ACL_PRIVATE, $metaHeaders = array(), $contentType = 'text/plain')\n\t{\n\t\treturn self::putObject($string, $bucket, $uri, $acl, $metaHeaders, $contentType);\n\t}",
"protected abstract function addString($string);",
"function sefencode($string)\n{\n\treturn titleToLocation($string);\n}",
"function post_string($string_name) {\n\t$string = $_POST[$string_name];\n\tsettype($string, \"string\");\n\treturn $string;\n}",
"function addString($string_to_add){\n\t\tsettype($string_to_add,\"string\");\n\t\tif(strlen($string_to_add)>0){\n\t\t\t$this->_Items[] = new StringBufferItem($string_to_add);\n\t\t}\n\t}",
"public function ofString($string_buffer = '', $options = [],$stream_type=null){\n\n $stream = fopen('php://temp', 'r+');\n if ($string_buffer !== '') {\n fwrite($stream, $string_buffer);\n fseek($stream, 0);\n }\n if(null == $stream_type){\n $stream_type = self::STREAM_STRING;\n }\n return $this->init_stream($stream, $options,$stream_type);\n\n }",
"public static function strToHex($string) {\n $hex = unpack('H*', $string);\n return '0x' . array_shift($hex);\n }",
"public function writeString($value)\n {\n $len = strlen($value);\n $this->writeUInt16($len);\n $this->data .= pack('a' . $len, $value);\n $this->position += $len;\n }",
"private function writeStringRecord($stringValue): void\n {\n $record = 0x0207; // Record identifier\n $data = StringHelper::UTF8toBIFF8UnicodeLong($stringValue);\n\n $length = strlen($data);\n $header = pack('vv', $record, $length);\n\n $this->append($header . $data);\n }",
"private function encode($text) {\n\t\t// 0x1 text frame (FIN + opcode)\n\t\t$b1 = 0x80 | (0x1 & 0x0f);\n\t\t$length = strlen($text);\n\t\t\n\t\tif ($length <= 125) {\n $header = pack('CC', $b1, $length);\n // echo \"pack CC\\n\";\n } elseif ($length > 125 && $length < 65536) {\n\t\t\t$header = pack('CCS', $b1, 126, $length); //original\n // echo \"pack CCS\\n\";\n } elseif($length >= 65536) {\n $header = pack('CCN', $b1, 127, $length);\n // echo \"pack CCN\\n\";\n }\n\t \n\t\treturn $header.$text;\n }",
"public static function hexToStr($string) {\n\n if (!self::hasHexPrefix($string)) {\n throw new \\Exception('String is missing Hex prefix \"0x\" : ' . $string);\n }\n $string = substr($string, strlen('0x'));\n $utf8 = '';\n\n\n $letters = str_split($string, 2);\n foreach ($letters as $letter) {\n $utf8 .= html_entity_decode(\"&#x$letter;\", ENT_QUOTES, 'UTF-8');\n }\n return $utf8;\n\n // Dosn't tackle Line 18\n // if ($string < 128) {\n // $utf = chr($string);\n // }\n // elseif ($string < 2048) {\n // $utf = chr(192 + (($string - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n // }\n // else {\n // $utf = chr(224 + (($string - ($string % 4096)) / 4096));\n // $utf .= chr(128 + ((($string % 4096) - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n //}\n\n // Can't handle Ö\n // $utf8 = hex2bin($string);\n\n // Can't handle Ö\n //$func_length = strlen($string);\n //for ($func_index = 0; $func_index < $func_length; ++$func_index) {\n // $utf8 .= chr(hexdec($string{$func_index} . $string{++$func_index}));\n //}\n\n // Destroys umlauts\n // for ($i=0; $i < strlen($string)-1; $i+=2){\n // $utf8 .= chr(hexdec($string[$i].$string[$i+1]));\n // }\n }",
"public function setFString($var)\n {\n GPBUtil::checkString($var, True);\n $this->f_string = $var;\n\n return $this;\n }",
"public function getString($string)\n {\n //argument 1 must be a string\n Argument::i()->test(1, 'string');\n\n return StringType::i($string);\n }",
"function asString();",
"function asString();",
"function _textstring($s)\n\t\t{\n\t\t\treturn '('.$this->_escape($s).')';\n\t\t}",
"protected function get_string($forum, $string, $a=null) {\n return get_string($string, 'forumng', $a);\n }",
"public static function fromString(string $string): static;",
"function s($s)\n {\n return Stringy::create($s);\n }",
"public function packerThreePack(string $data): string\n {\n $encoded = base64_encode($data);\n\n // Separa em dois pedaços\n $partOne = mb_substr($encoded, 0, 15, \"utf-8\");\n $partTwo = mb_substr($encoded, 15, null, \"utf-8\");\n\n // Insere 'Sg' para invalidar o base64\n return $partOne . 'Sg' . $partTwo;\n }",
"function mSTR(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$STR;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:226:3: ( 'str' ) \n // Tokenizer11.g:227:3: 'str' \n {\n $this->matchString(\"str\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function pythonifyString($theString) {\n $aThings = array(\n ') {' => ':',\n '}' => '',\n 'cv::' => 'cv2.',\n 'cvui::' => 'cvui.',\n 'if (' => 'if ',\n '} else {' => 'else:',\n '} else if (' => 'elif ',\n 'while (' => 'while ',\n ');' => ')',\n '//' => '#',\n '\"' => '\\'',\n );\n\n $aNormalized = pythonifyType($theString, false);\n $aConverted = str_replace(array_keys($aThings), array_values($aThings), $aNormalized);\n\n return $aConverted;\n}"
] |
[
"0.522399",
"0.51513124",
"0.51432884",
"0.50322723",
"0.50104105",
"0.49826735",
"0.49735427",
"0.49654144",
"0.49654144",
"0.48993614",
"0.48892844",
"0.48859438",
"0.48802847",
"0.48650703",
"0.48247328",
"0.48176405",
"0.47901568",
"0.47835737",
"0.47835344",
"0.47402084",
"0.47318035",
"0.47134948",
"0.47134948",
"0.47100666",
"0.47095063",
"0.47051454",
"0.4702948",
"0.47014955",
"0.4700472",
"0.46897745"
] |
0.8187188
|
0
|
string packRECT(integer Xmin, integer Xmax, integer Ymin, integer Ymax) returns an SWF RECT bit value (atom) string.
|
function packRECT($Xmin, $Xmax, $Ymin, $Ymax)
{
array_push($this->FMDebug, "packRECT");
if (!(($Xmin == 0) and ($Xmax == 0) and ($Ymin == 0) and ($Ymax == 0))) {
$Xmin = $this->packSBchunk($Xmin);
$Xmax = $this->packSBchunk($Xmax);
$Ymin = $this->packSBchunk($Ymin);
$Ymax = $this->packSBchunk($Ymax);
$nBits = (int) max(strlen($Xmin), strlen($Xmax), strlen($Ymin), strlen($Ymax));
$Xmin = str_repeat(substr($Xmin, 0, 1), $nBits - strlen($Xmin)) . $Xmin;
$Xmax = str_repeat(substr($Xmax, 0, 1), $nBits - strlen($Xmax)) . $Xmax;
$Ymin = str_repeat(substr($Ymin, 0, 1), $nBits - strlen($Ymin)) . $Ymin;
$Ymax = str_repeat(substr($Ymax, 0, 1), $nBits - strlen($Ymax)) . $Ymax;
$atom = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;
} else {
$atom = "00000";
}
$atom = $this->packBitValues($atom);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getRect() {}",
"public function rect($x1, $y1, $width, $height, $style = self::STYLE_DRAW) {}",
"public function getRectangle() {}",
"public function getBBox($asRect = true) {}",
"function rectangle($x1, $y1, $x2, $y2)\r\n {\r\n $resp = \"\";\r\n $resp .= $this->forceBrush();\r\n $resp .= $this->_getJavascriptVar() . \".fillRect($x1, $y1, $x2 - $x1 + 1, $y2 - $y1 + 1);\\n\";\r\n $resp .= $this->forcePen();\r\n $resp .= $this->_getJavascriptVar() . \".strokeRect($x1, $y1, $x2 - $x1 + 1, $y2 - $y1 + 1);\\n\";\r\n\r\n return $resp;\r\n }",
"protected function getPathFromRect(SimpleXMLElement $rect){\n\n\t\tif(empty($rect['width']) || $rect['width'] < 0 || empty($rect['height']) || $rect['height'] < 0){\n\t\t\treturn '';\n\t\t}\n\t\tif(empty($rect['x'])){\n\t\t\t$rect['x'] = 0;\n\t\t}\n\t\tif(empty($rect['y'])){\n\t\t\t$rect['y'] = 0;\n\t\t}\n\t\treturn 'M'.$rect['x'].' '.$rect['y'].'l'.$rect['width'].' 0l0 '.$rect['height'].'l'.(-$rect['width']).' 0Z';\n\n\t}",
"function roundRect($sx, $sy, $ex, $ey)\r\n {\r\n\r\n\t\t $r2d = \"(Math.PI/180)\";\r\n\r\n $r = ($this->Width > $this->Height) ? (($this->Height-20)*0.15) : (($this->Width-20)*0.15);\r\n\r\n $resp = \"\";\r\n \t\t$resp .= $this->_getJavascriptVar() . \".beginPath();\\n\";\r\n\t\t $resp .= $this->_getJavascriptVar() . \".moveTo($sx + $r, $sy);\\n\";\r\n\t\t $resp .= $this->_getJavascriptVar() . \".lineTo($ex - $r,$sy);\\n\";\r\n\t \t $resp .= $this->_getJavascriptVar() . \".arc($ex - $r,$sy + $r, $r, $r2d*270, $r2d*360,false);\\n\";\r\n \t\t\t$resp .= $this->_getJavascriptVar() . \".lineTo($ex, $ey - $r); \\n\";\r\n $resp .= $this->_getJavascriptVar() . \".arc($ex - $r,$ey -$r,$r,$r2d*0,$r2d*90,false);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".lineTo($sx+$r,$ey); \\n\";\r\n $resp .= $this->_getJavascriptVar() . \".arc($sx+$r,$ey-$r,$r,$r2d*90,$r2d*180,false);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".lineTo($sx,$sy + $r);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".arc($sx + $r,$sy + $r,$r,$r2d*180,$r2d*270,false);\\n\";\r\n $resp .= $this->_getJavascriptVar() . \".closePath();\\n\";\r\n\r\n $resp .= $this->forceBrush();\r\n $resp .= $this->_getJavascriptVar() . \".fill();\\n\";\r\n\r\n $resp .= $this->forcePen();\r\n\r\n // paint\r\n $resp .= $this->_getJavascriptVar() . \".stroke(); \\n\";\r\n\r\n\r\n return $resp;\r\n\t }",
"public function getRect()\n {\n $x1 = min([$this->p1->x, $this->p2->x, $this->p3->x]);\n $y1 = min([$this->p1->y, $this->p2->y, $this->p3->y]);\n $x2 = max([$this->p1->x, $this->p2->x, $this->p3->x]);\n $y2 = max([$this->p1->y, $this->p2->y, $this->p3->y]);\n\n return [new Point($x1, $y1), new Point($x2, $y2)];\n }",
"public function getDifferencesRect() {}",
"public function rect($x, $y, $width, $height) {}",
"function RoundedRect($x, $y, $w, $h, $r, $style = '', $angle = '1234')\n {\n $k = $this->k;\n $hp = $this->h;\n if($style=='F')\n $op='f';\n elseif($style=='FD' or $style=='DF')\n $op='B';\n else\n $op='S';\n $MyArc = 4/3 * (sqrt(2) - 1);\n $this->_out(sprintf('%.2f %.2f m',($x+$r)*$k,($hp-$y)*$k ));\n\n $xc = $x+$w-$r;\n $yc = $y+$r;\n $this->_out(sprintf('%.2f %.2f l', $xc*$k,($hp-$y)*$k ));\n if (strpos($angle, '2')===false)\n $this->_out(sprintf('%.2f %.2f l', ($x+$w)*$k,($hp-$y)*$k ));\n else\n $this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc);\n\n $xc = $x+$w-$r;\n $yc = $y+$h-$r;\n $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-$yc)*$k));\n if (strpos($angle, '3')===false)\n $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-($y+$h))*$k));\n else\n $this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r);\n\n $xc = $x+$r;\n $yc = $y+$h-$r;\n $this->_out(sprintf('%.2f %.2f l',$xc*$k,($hp-($y+$h))*$k));\n if (strpos($angle, '4')===false)\n $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-($y+$h))*$k));\n else\n $this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc);\n\n $xc = $x+$r ;\n $yc = $y+$r;\n $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$yc)*$k ));\n if (strpos($angle, '1')===false)\n {\n $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$y)*$k ));\n $this->_out(sprintf('%.2f %.2f l',($x+$r)*$k,($hp-$y)*$k ));\n }\n else\n $this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r);\n $this->_out($op);\n }",
"function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function drawRectangle($width, $height);",
"public function getRectanglesJs()\n\t{\n\t\t$return = '';\n\t\tif (null !== $this->resources->itemAt('rectangles'))\n\t\t{\n\t\t\tforeach ($this->resources->itemAt('rectangles') as $rectangle)\n\t\t\t{\n\t\t\t\t$return .= $rectangle->toJs($this->getJsName());\n\t\t\t\t$return .= \"\\n \";\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}",
"function makeRectangle(array $point, $width, $height)\n{\n return [\n 'point' => $point,\n 'width' => $width,\n 'height' => $height\n ];\n}",
"public function createRectangle()\n {\n imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, imagecolorallocate($this->image, 255, 255, 255));\n }",
"public function __toString()\n {\n return $this->width . 'x' . $this->height;\n }",
"public function toString() {\n\t\treturn sprintf( 'w:%s', $this->width );\n\t}",
"function frameRect($x1, $y1, $x2, $y2)\r\n {\r\n $this->forcePen();\r\n $this->forceBrush();\r\n echo \"$this->_canvas.drawRect($x1, $y1, $x2-$x1+1, $y2-$y1+1);\\n\";\r\n }",
"public abstract function getBoundingBox(): Rectangle;",
"public function getBounds();",
"public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}",
"public function setRect(\\SetaPDF_Core_DataStructure_Rectangle $rect) {}",
"function packRGB($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGB\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function getTrimBox($fallback = true, $asRect = true) {}",
"public function getCropBox($fallback = true, $asRect = true) {}",
"public static function invalidRectangleBoundCoordinates()\n {\n return new static('A rectangle bound must have a south west & a north east coordinate.');\n }",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}"
] |
[
"0.57791054",
"0.53096384",
"0.5308607",
"0.51663464",
"0.50992197",
"0.50085294",
"0.49951544",
"0.49309316",
"0.49129072",
"0.49086183",
"0.48994306",
"0.488942",
"0.48034692",
"0.4786136",
"0.47583207",
"0.4739426",
"0.46155405",
"0.45669386",
"0.4544448",
"0.45359993",
"0.45149535",
"0.45009193",
"0.44811067",
"0.4473253",
"0.44545597",
"0.44358206",
"0.44281015",
"0.4417511",
"0.4385112",
"0.4379323"
] |
0.8047116
|
0
|
string packRGB(integer R, integer G, integer B) returns an SWF RGB atom string.
|
function packRGB($R, $G, $B)
{
array_push($this->FMDebug, "packRGB");
$atom = $this->packUI8($R);
$atom .= $this->packUI8($G);
$atom .= $this->packUI8($B);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packRGBA($R, $G, $B, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGBA\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\t\t$atom .= $this->packUI8($A);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function stringrgb($arr){\r\n\treturn \"RGB(\".$arr[0].\",\".$arr[1].\",\".$arr[2].\")\";\r\n}",
"function rgb2html($r, $g = -1, $b = -1) {\n if (is_array($r) && sizeof($r) == 3)\n list($r, $g, $b) = $r;\n $r = intval($r);\n $g = intval($g);\n $b = intval($b);\n $r = dechex($r < 0 ? 0 : ($r > 255 ? 255 : $r));\n $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g));\n $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b));\n $color = (strlen($r) < 2 ? '0' : '') . $r;\n $color .= (strlen($g) < 2 ? '0' : '') . $g;\n $color .= (strlen($b) < 2 ? '0' : '') . $b;\n return '#' . $color;\n }",
"function RGBToHex($r, $g, $b) {\n $hex = \"#\";\n $hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n return $hex;\n }",
"private function RGBToHex($r, $g, $b) {\n\t\t$hex = \"#\";\n\t\t$hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n\t\treturn $hex;\n\t}",
"function rgb2html($r, $g=-1, $b=-1)\n\t{\n\t if (is_array($r) && sizeof($r) == 3)\n\t list($r, $g, $b) = $r;\n\n\t $r = intval($r); $g = intval($g);\n\t $b = intval($b);\n\n\t $r = dechex($r<0?0:($r>255?255:$r));\n\t $g = dechex($g<0?0:($g>255?255:$g));\n\t $b = dechex($b<0?0:($b>255?255:$b));\n\n\t $color = (strlen($r) < 2?'0':'').$r;\n\t $color .= (strlen($g) < 2?'0':'').$g;\n\t $color .= (strlen($b) < 2?'0':'').$b;\n\t return '#'.$color;\n\t}",
"function rgbhex($r, $g, $b){\n $r = intval($r);\n $g = intval($g);\n $b = intval($b);\n $r = dechex($r < 0 ? 0 : ($r > 255 ? 255 : $r));\n $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g));\n $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b));\n \n $hex = (strlen($r) < 2 ? '0' : '') . $r;\n $hex .= (strlen($g) < 2 ? '0' : '') . $g;\n $hex .= (strlen($b) < 2 ? '0' : '') . $b;\n\n return $hex;\n}",
"function packSetBackgroundColorTag($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packSetBackgroundColorTag\");\n\n\t\t$TagID = 9;\n\t\t$RGB = $this->packRGB($R, $G, $B);\n\t\t$TagLength = strlen($RGB);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $RGB;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public static function gifStr($r = 0, $g = 0, $b = 0, $transparent = true) {\n return pack('C*',\n 71, 73, 70, 56, 57, 97, // \"GIF89a\"\n\n // Logical screen descriptor\n 1, 0, // logical screen width\n 1, 0, // logical screen height\n 128, // global color table | color resolution(3) | sort flag | size of global color table (3)\n 0, // background color index\n 0, // pixel aspect ratio\n $r, $g, $b, 0, 0, 0, // global color table\n\n // Graphic control extension\n 0x21, // extension introducer\n 0xF9, // graphic control label\n 4, // block size\n 1, // disposal method(3) | user input(3) | transparency |\n 0, 0, // delay time\n $transparent ? 0 : 1, // transparent color index\n 0, // block terminator\n\n // Image descriptor\n 0x2C, // image seperator\n 0, 0, // image left position\n 0, 0, // image top position\n 1, 0, // image height\n 1, 0, // image width\n 0, // local color | interlaced | ordered | reserved(2) | size of color table (3)\n\n 2, 2, 68, 1, 0, // image data\n\n 59); // gif trailer\n }",
"function fixRGB($r, $g, $b){\t\t\r\t\t\r\t\tif($r > 255) $r = \"FF\";\r\t\telse if($r < 0) $r = \"00\";\r\t\telse $r = dechex($r);\r\t\t\r\t\tif(strlen($r) < 2) $r = \"0\".$r;\r\t\t\r\t\tif($g > 255) $g = \"FF\";\r\t\telse if($g < 0) $g = \"00\";\r\t\telse $g = dechex($g);\r\t\t\r\t\tif(strlen($g) < 2) $g = \"0\".$r;\r\t\t\r\t\tif($b > 255) $b = \"FF\";\r\t\telse if($b < 0) $b = \"00\";\r\t\telse $b = dechex($b);\r\t\t\r\t\tif(strlen($b) < 2) $b = \"0\".$b;\r\t\t\r\t\treturn \"#\".$r.$g.$b;\r\t}",
"function packGRADRECORD($Ratio, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADRECORD\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGBA((int)$R, (int)$G, (int)$B, (int)$A);\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGB((int)$R, (int)$G, (int)$B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function rgb2hex($r, $g = NULL, $b = NULL) {\n\t\t$rgb = array();\n\t\t\n\t\tif (! is_array($r)) {\n\t\t\t$rgb['r'] = $r;\n\t\t\t$rgb['g'] = $g;\n\t\t\t$rgb['b'] = $b;\n\t\t} else {\n\t\t\t$rgb = $r;\n\t\t}\n\t\t\n\t\t$hex = '#';\n\t\t$hex.= str_pad(dechex($rgb['r']), 2, '0', STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($rgb['g']), 2, '0', STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($rgb['b']), 2, '0', STR_PAD_LEFT);\n\t\t\n\t\treturn $hex;\n\t}",
"public function convertRgbToHex($r, $g, $b)\n {\n $r = dechex($r<0?0:($r>255?255:$r));\n $g = dechex($g<0?0:($g>255?255:$g));\n $b = dechex($b<0?0:($b>255?255:$b));\n\n $color = (strlen($r) < 2?'0':'').$r;\n $color .= (strlen($g) < 2?'0':'').$g;\n $color .= (strlen($b) < 2?'0':'').$b;\n\n return $color;\n }",
"public function __toString()\n {\n return (string) $this->_rgb_hex;\n }",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function rgb_array_to_hex_string( array $rgb ) : string {\n\t\treturn self::integer_to_two_character_hex( $rgb['r'] ) . self::integer_to_two_character_hex( $rgb['g'] ) . self::integer_to_two_character_hex( $rgb['b'] );\n\t}",
"function Scaffold_hextorgb($hex,$format='preformatted') {\n\t// Regexp for a valid hex digit\n\t$d = '[a-fA-F0-9]';\n\t// Make sure $hex is valid\n\tif (preg_match(\"/^#($d$d)($d$d)($d$d)\\$/\", $hex, $rgb)) {\n\t $rgb_values = hexdec($rgb[1]).','.hexdec($rgb[2]).','.hexdec($rgb[3]);\n\t if ($format != 'preformatted') {\n\t\t return $rgb_values;\n\t }\n\t return 'rgb('.$rgb_values.')';\n\t}\n\tif (preg_match(\"/^($d)($d)($d)$/\", $hex, $rgb)) {\n\t $rgb_values = hexdec($rgb[1] . $rgb[1]).','.hexdec($rgb[2] . $rgb[2]).','.hexdec($rgb[3] . $rgb[3]);\n\t\tif ($format != 'preformatted') {\n\t\t return $rgb_values;\n\t }\n\t return 'rgb('.$rgb_values.')';\n\t}\n\treturn $hex;\n}",
"function generar_color($rgb){\n $vermell= substr($rgb,1,2); \n $verd = substr($rgb,3,2); \n $blau = substr($rgb,5,2); \n \n //Converteixo de hexadecimal a decimal \n $enter_vermell= hexdec($vermell); \n $enter_verd= hexdec($verd); \n $enter_blau= hexdec($blau); \n \n //Valor que li sumarem o restarem a cada component rgb: \n $valor = hexdec(22); \n \n //Calculo l'umbral del color. \n $umbral = 255/2; //7F en hexadecimal. \n \n //Calculo la foscor del color entrat: \n $foscor= ($enter_vermell + $enter_verd + $enter_blau) /3; \n \n //El color és clar. Per tant tenim que enfosquirlo restant-li el $valor en cada component rgb. \n if($foscor >= $umbral){ \n $enter_vermell = ($enter_vermell-$valor<00) ? 00 : $enter_vermell-$valor; \n $enter_verd = ($enter_verd-$valor<00) ? 00 : $enter_verd-$valor; \n $enter_blau = ($enter_blau-$valor<00) ? 00 : $enter_blau-$valor; \n //if($enter_vermell-$valor<00){ $nou_enter_vermell = 00; } else { $enter_vermell=$enter_vermell-$valor; } \n //if($enter_vermell-$valor<00){ $nou_enter_vermell = 00; } else { $enter_vermell=$enter_vermell-$valor; } \n } \n \n //El color és fosc. Per tant tenim que aclararlo sumant-li el $valor en cada component rgb. \n else{ \n $enter_vermell = ($enter_vermell+$valor>255) ? 255 : $enter_vermell+$valor; \n $enter_verd = ($enter_verd+$valor>255) ? 255 : $enter_verd+$valor; \n $enter_blau = ($enter_blau+$valor>255) ? 255 : $enter_blau+$valor; \n } \n $vermell=dechex($enter_vermell); \n $verd=dechex($enter_verd); \n $blau=dechex($enter_blau); \n \n $rgb=\"#\".$vermell.$verd.$blau; \n return $rgb; \n}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function colorToRGBString($color)\n {\n $rgb = self::colorToRGB($color);\n return sprintf(\"%02x%02x%02x\", $rgb['r'], $rgb['g'], $rgb['b']);\n }",
"public function convert(string $hex) : string\n {\n list($r, $g, $b) = sscanf(ltrim($hex, '#'), \"%02x%02x%02x\");\n return \"rgb($r, $g, $b)\";\n }",
"function Scaffold_rgbtohex($rgb) {\n\t$hex = \"\";\n\tfor($i=0; $i < 3; $i++) {\n\n\t\t// Convert the decimal digit to hex\n\t\t$hexDigit = dechex($rgb[$i]);\n\n\t\t// Add a leading zero if necessary\n\t\tif(strlen($hexDigit) == 1) {\n\t\t\t$hexDigit = \"0\" . $hexDigit;\n\t\t}\n\n\t\t// Append to the hex string\n\t\t$hex .= $hexDigit;\n\t}\n\t// Return the complete hex string\n\treturn '#'.$hex;\n}",
"public static function HexMe(array $rgb)\n {\n if(count($rgb) > 3)\n $rgb = array_slice($rgb,0,3);\n return implode('',array_map('ColorName::ColorDechex',$rgb));\n }",
"public function rgbToRgb565(int $r, int $g, int $b) : int\n {\n return (($r >> 3) << 11) | (($g >> 2) << 5) | ($b >> 3);\n }",
"static function rgb2hex($rgb) {\n $rgb = Util::eliminarEspacios($rgb);\n if (is_string($rgb)) {\n if (strpos($rgb, \"rgb\") !== false) {\n $rgb = str_replace(\"rgb(\", \"\", str_replace(\")\", \"\", $rgb));\n }\n $rgb = explode(\",\", $rgb);\n }\n\n $hex = \"#\";\n $hex .= str_pad(dechex($rgb[0]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($rgb[1]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($rgb[2]), 2, \"0\", STR_PAD_LEFT);\n\n return $hex; // returns the hex value including the number sign (#)\n }",
"function hex2rgb( $colour ) {\n if ( $colour[0] == '#' ) {\n $colour = substr( $colour, 1 );\n }\n if ( strlen( $colour ) == 6 ) {\n list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );\n } elseif ( strlen( $colour ) == 3 ) {\n list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );\n } else {\n return false;\n }\n $r = hexdec( $r );\n $g = hexdec( $g );\n $b = hexdec( $b );\n //return array( 'red' => $r, 'green' => $g, 'blue' => $b );\n return \"rgb($r,$g,$b)\";\n}",
"function wp_tinycolor_string_to_rgb($color_str)\n {\n }",
"public static function rgb($_triad) {\n\t\t$_len=strlen($_triad);\n\t\tif ($_len==3 || $_len==6) {\n\t\t\t$_color=str_split($_triad,$_len/3);\n\t\t\tforeach ($_color as &$_hue)\n\t\t\t\t$_hue=hexdec(str_repeat($_hue,6/$_len));\n\t\t\treturn $_color;\n\t\t}\n\t\ttrigger_error(self::TEXT_Color);\n\t\treturn FALSE;\n\t}",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected function _convert($colour) {\n\t\t$r = dechex(($colour >> 16) & 0xFF);\n\t\t$g = dechex(($colour >> 8) & 0xFF);\n\t\t$b = dechex($colour & 0xFF);\n\n\t\treturn implode('', array(\n\t\t\tstr_pad($r, 2, $r),\n\t\t\tstr_pad($g, 2, $g),\n\t\t\tstr_pad($b, 2, $b),\n\t\t));\n\t}"
] |
[
"0.6809387",
"0.66178674",
"0.63858926",
"0.6253658",
"0.62318885",
"0.6223213",
"0.61872345",
"0.6167783",
"0.6072258",
"0.5896541",
"0.5843754",
"0.58372474",
"0.5613304",
"0.55443496",
"0.5536719",
"0.5431299",
"0.5412004",
"0.539117",
"0.53475714",
"0.5222901",
"0.51461416",
"0.51425666",
"0.50694317",
"0.5055281",
"0.50518584",
"0.5046199",
"0.5023689",
"0.501207",
"0.50020754",
"0.49869138"
] |
0.82715243
|
0
|
string packRGBA(integer R, integer G, integer B, integer A) returns an SWF RGBA atom string.
|
function packRGBA($R, $G, $B, $A)
{
array_push($this->FMDebug, "packRGBA");
$atom = $this->packUI8($R);
$atom .= $this->packUI8($G);
$atom .= $this->packUI8($B);
$atom .= $this->packUI8($A);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packRGB($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGB\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packGRADRECORD($Ratio, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADRECORD\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGBA((int)$R, (int)$G, (int)$B, (int)$A);\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGB((int)$R, (int)$G, (int)$B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function gifStr($r = 0, $g = 0, $b = 0, $transparent = true) {\n return pack('C*',\n 71, 73, 70, 56, 57, 97, // \"GIF89a\"\n\n // Logical screen descriptor\n 1, 0, // logical screen width\n 1, 0, // logical screen height\n 128, // global color table | color resolution(3) | sort flag | size of global color table (3)\n 0, // background color index\n 0, // pixel aspect ratio\n $r, $g, $b, 0, 0, 0, // global color table\n\n // Graphic control extension\n 0x21, // extension introducer\n 0xF9, // graphic control label\n 4, // block size\n 1, // disposal method(3) | user input(3) | transparency |\n 0, 0, // delay time\n $transparent ? 0 : 1, // transparent color index\n 0, // block terminator\n\n // Image descriptor\n 0x2C, // image seperator\n 0, 0, // image left position\n 0, 0, // image top position\n 1, 0, // image height\n 1, 0, // image width\n 0, // local color | interlaced | ordered | reserved(2) | size of color table (3)\n\n 2, 2, 68, 1, 0, // image data\n\n 59); // gif trailer\n }",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function formatted()\n {\n return 'rgba('.$this->red.', '.$this->green.', '.$this->blue.', '.$this->alpha.')';\n }",
"public function getAlpha()\n {\n $alpha = 100;\n if (strlen($this->argb) >= 6) {\n $dec = hexdec(substr($this->argb, 0, 2));\n $alpha = number_format(($dec / 255) * 100, 2);\n }\n\n return $alpha;\n }",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSetBackgroundColorTag($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packSetBackgroundColorTag\");\n\n\t\t$TagID = 9;\n\t\t$RGB = $this->packRGB($R, $G, $B);\n\t\t$TagLength = strlen($RGB);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $RGB;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function stringrgb($arr){\r\n\treturn \"RGB(\".$arr[0].\",\".$arr[1].\",\".$arr[2].\")\";\r\n}",
"function astra_rgba2hex( $string, $include_alpha = false ) {\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_rgba2hex()' );\n\treturn astra_addon_rgba2hex( $string, $include_alpha = false );\n}",
"function rgb2html($r, $g = -1, $b = -1) {\n if (is_array($r) && sizeof($r) == 3)\n list($r, $g, $b) = $r;\n $r = intval($r);\n $g = intval($g);\n $b = intval($b);\n $r = dechex($r < 0 ? 0 : ($r > 255 ? 255 : $r));\n $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g));\n $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b));\n $color = (strlen($r) < 2 ? '0' : '') . $r;\n $color .= (strlen($g) < 2 ? '0' : '') . $g;\n $color .= (strlen($b) < 2 ? '0' : '') . $b;\n return '#' . $color;\n }",
"function RGBToHex($r, $g, $b) {\n $hex = \"#\";\n $hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n return $hex;\n }",
"function rgbhex($r, $g, $b){\n $r = intval($r);\n $g = intval($g);\n $b = intval($b);\n $r = dechex($r < 0 ? 0 : ($r > 255 ? 255 : $r));\n $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g));\n $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b));\n \n $hex = (strlen($r) < 2 ? '0' : '') . $r;\n $hex .= (strlen($g) < 2 ? '0' : '') . $g;\n $hex .= (strlen($b) < 2 ? '0' : '') . $b;\n\n return $hex;\n}",
"function rgb2html($r, $g=-1, $b=-1)\n\t{\n\t if (is_array($r) && sizeof($r) == 3)\n\t list($r, $g, $b) = $r;\n\n\t $r = intval($r); $g = intval($g);\n\t $b = intval($b);\n\n\t $r = dechex($r<0?0:($r>255?255:$r));\n\t $g = dechex($g<0?0:($g>255?255:$g));\n\t $b = dechex($b<0?0:($b>255?255:$b));\n\n\t $color = (strlen($r) < 2?'0':'').$r;\n\t $color .= (strlen($g) < 2?'0':'').$g;\n\t $color .= (strlen($b) < 2?'0':'').$b;\n\t return '#'.$color;\n\t}",
"function apng_encode($width, $height, $pixels)\n{\n\t$data = \"\\x00\" . implode(\"\\x00\", str_split($pixels, 4 * $width));\n\t$png = \"\\x89PNG\\r\\n\\x1a\\n\";\n\t$png .= png_encode_chunk('IHDR', pack('N2C5', $width, $height, 8, 6, 0, 0, 0));\n\t$png .= png_encode_chunk('acTL', pack('N2', 1, 1));\n\t$png .= png_encode_chunk('fcTL', pack('N5n2C2', 0, $width, $height, 0, 0, 0, 0, 0, 1));\n\t$png .= png_encode_chunk('IDAT', zlib_encode($data, ZLIB_ENCODING_DEFLATE));\n\t$png .= png_encode_chunk('IEND', '');\n\treturn $png;\n}",
"private function RGBToHex($r, $g, $b) {\n\t\t$hex = \"#\";\n\t\t$hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n\t\treturn $hex;\n\t}",
"function uabb_parse_color_to_hex( $code = '' ) {\n\t$color = '';\n\t$hex = '';\n\tif( $code != '' ) {\n\t\tif ( strpos( $code, 'rgba' ) !== false ) {\n\t\t\t$code = ltrim( $code, 'rgba(' );\n\t\t\t$code = rtrim( $code, ')' );\n\t\t\t$rgb = explode( ',', $code );\n\t\t\t$hex .= str_pad(dechex($rgb[0]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$hex .= str_pad(dechex($rgb[1]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$hex .= str_pad(dechex($rgb[2]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$color = $hex;\n\t\t} else {\n\t\t\t$color = ltrim( $code, '#' );\n\t\t}\n\t}\n\t//var_dump($hex); die;\n\treturn $color;\n}",
"private function getColor($id = null, $r = 0, $g = 0, $b = 0, $alpha = 0) {\n $paleta = array(\n array('r' => 200, 'g' => 200, 'b' => 200),\n array('r' => 51, 'g' => 102, 'b' => 204),\n array('r' => 220, 'g' => 57, 'b' => 18),\n array('r' => 255, 'g' => 153, 'b' => 0),\n array('r' => 16, 'g' => 150, 'b' => 24),\n array('r' => 153, 'g' => 0, 'b' => 153),\n array('r' => 0, 'g' => 153, 'b' => 198),\n array('r' => 221, 'g' => 68, 'b' => 119),\n array('r' => 102, 'g' => 170, 'b' => 0)\n );\n\n if(!$this->opTransparente){\n $alpha = 0;\n }\n\n if ($id || $id == 0) {\n return imagecolorallocatealpha($this->image, $paleta[$id]['r'], $paleta[$id]['g'], $paleta[$id]['b'], $alpha);\n } else {\n return imagecolorallocatealpha($this->image, $r, $g, $b, $alpha);\n }\n }",
"function hexToRgba($hex, $opacity = 0)\n {\n $hex = str_replace(\"#\", \"\", $hex);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = array($r, $g, $b);\n $opacity = ($opacity >= 0 && $opacity <= 1 && $opacity != null) ? $opacity : 1 ;\n return \"rgba(\" . implode(\",\", $rgb) . \",\" .$opacity. \")\";\n }",
"function ss_hex2rgba( $color, $opacity = false ) {\r\n\r\n\t$default = 'rgb(0,0,0)';\r\n\r\n\t//Return default if no color provided\r\n\tif ( empty( $color ) )\r\n\t\treturn $default;\r\n\r\n\t//Sanitize $color if \"#\" is provided\r\n\tif ( $color[0] == '#' ) {\r\n\t\t$color = substr( $color, 1 );\r\n\t}\r\n\r\n\t//Check if color has 6 or 3 characters and get values\r\n\tif ( strlen( $color ) == 6 ) {\r\n\t\t$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\r\n\t} elseif ( strlen( $colour ) == 3 ) {\r\n\t\t$hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\r\n\t} else {\r\n\t\treturn $default;\r\n\t}\r\n\r\n\t//Convert hexadec to rgb\r\n\t$rgb = array_map( 'hexdec', $hex );\r\n\r\n\t//Check if opacity is set(rgba or rgb)\r\n\tif ( $opacity ) {\r\n\t\tif ( abs( $opacity ) > 1 )\r\n\t\t\t$opacity = 1.0;\r\n\t\t$output = 'rgba('.implode( \",\", $rgb ).','.$opacity.')';\r\n\t} else {\r\n\t\t$output = 'rgb('.implode( \",\", $rgb ).')';\r\n\t}\r\n\r\n\t//Return rgb(a) color string\r\n\treturn $output;\r\n}",
"function fixRGB($r, $g, $b){\t\t\r\t\t\r\t\tif($r > 255) $r = \"FF\";\r\t\telse if($r < 0) $r = \"00\";\r\t\telse $r = dechex($r);\r\t\t\r\t\tif(strlen($r) < 2) $r = \"0\".$r;\r\t\t\r\t\tif($g > 255) $g = \"FF\";\r\t\telse if($g < 0) $g = \"00\";\r\t\telse $g = dechex($g);\r\t\t\r\t\tif(strlen($g) < 2) $g = \"0\".$r;\r\t\t\r\t\tif($b > 255) $b = \"FF\";\r\t\telse if($b < 0) $b = \"00\";\r\t\telse $b = dechex($b);\r\t\t\r\t\tif(strlen($b) < 2) $b = \"0\".$b;\r\t\t\r\t\treturn \"#\".$r.$g.$b;\r\t}",
"protected static function renderColor($a_value, $a_opacity = 1)\n\t{\n\t\tif(self::isValidColor($a_value))\n\t\t{\n\t\t\tif(strlen($a_value) == 4)\n\t\t\t{\n\t\t\t\treturn \"\\\"rgba(\".hexdec($a_value[1].$a_value[1]).\", \".\n\t\t\t\t\thexdec($a_value[2].$a_value[2]).\", \".\n\t\t\t\t\thexdec($a_value[3].$a_value[3]).\", \".$a_opacity.\")\\\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"\\\"rgba(\".hexdec($a_value[1].$a_value[2]).\", \".\n\t\t\t\t\thexdec($a_value[3].$a_value[4]).\", \".\n\t\t\t\t\thexdec($a_value[5].$a_value[6]).\", \".$a_opacity.\")\\\"\";\n\t\t\t}\n\t\t}\n\t}",
"public static function rgb2hex($r, $g = NULL, $b = NULL) {\n\t\t$rgb = array();\n\t\t\n\t\tif (! is_array($r)) {\n\t\t\t$rgb['r'] = $r;\n\t\t\t$rgb['g'] = $g;\n\t\t\t$rgb['b'] = $b;\n\t\t} else {\n\t\t\t$rgb = $r;\n\t\t}\n\t\t\n\t\t$hex = '#';\n\t\t$hex.= str_pad(dechex($rgb['r']), 2, '0', STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($rgb['g']), 2, '0', STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($rgb['b']), 2, '0', STR_PAD_LEFT);\n\t\t\n\t\treturn $hex;\n\t}",
"private function mombo_hex_2_rgba($color, $opacity = false) {\n $default = 'rgb(0,0,0)';\n //Return default if no color provided\n if(empty($color))\n return $default; \n \n //Sanitize $color if \"#\" is provided \n if ($color[0] == '#' ) {\n $color = substr( $color, 1 );\n }\n \n //Check if color has 6 or 3 characters and get values\n if (strlen($color) == 6) {\n $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\n } elseif ( strlen( $color ) == 3 ) {\n $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\n } else {\n return $default;\n }\n \n //Convert hexadec to rgb\n $rgb = array_map('hexdec', $hex);\n \n //Check if opacity is set(rgba or rgb)\n if($opacity){\n if(abs($opacity) > 1)\n $opacity = 1.0;\n $output = 'rgba('.implode(\",\",$rgb).','.$opacity.')';\n } else {\n $output = 'rgb('.implode(\",\",$rgb).')';\n }\n \n //Return rgb(a) color string\n return $output;\n }",
"public function toHex()\n\t{\n\t\treturn sprintf('#%s%s%s', Strings::padLeft(dechex($this->r), 2, '0'), Strings::padLeft(dechex($this->g), 2, '0'), Strings::padLeft(dechex($this->b), 2, '0'));\n\t}",
"public static function renderColor($a_value, $a_opacity = 1)\n\t{\n\t\tif(self::isValidColor($a_value))\n\t\t{\n\t\t\tif(strlen($a_value) == 4)\n\t\t\t{\n\t\t\t\treturn \"rgba(\".hexdec($a_value[1].$a_value[1]).\", \".\n\t\t\t\t\thexdec($a_value[2].$a_value[2]).\", \".\n\t\t\t\t\thexdec($a_value[3].$a_value[3]).\", \".$a_opacity.\")\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"rgba(\".hexdec($a_value[1].$a_value[2]).\", \".\n\t\t\t\t\thexdec($a_value[3].$a_value[4]).\", \".\n\t\t\t\t\thexdec($a_value[5].$a_value[6]).\", \".$a_opacity.\")\";\n\t\t\t}\n\t\t}\n\t}",
"function alaya_color_hex2rgba($color, $opacity = false) {\n\n\t$default = 'rgb(0,0,0)';\n\n\t//Return default if no color provided\n\tif(empty($color))\n return $default; \n\n\t//Sanitize $color if \"#\" is provided \n if ($color[0] == '#' ) {\n \t$color = substr( $color, 1 );\n }\n\n //Check if color has 6 or 3 characters and get values\n if (strlen($color) == 6) {\n $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );\n } elseif ( strlen( $color ) == 3 ) {\n $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );\n } else {\n return $default;\n }\n\n //Convert hexadec to rgb\n $rgb = array_map('hexdec', $hex);\n\n //Check if opacity is set(rgba or rgb)\n if($opacity){\n \tif(abs($opacity) > 1)\n \t\t$opacity = 1.0;\n \t$output = 'rgba('.implode(\",\",$rgb).','.$opacity.')';\n } else {\n \t$output = 'rgb('.implode(\",\",$rgb).')';\n }\n\n //Return rgb(a) color string\n\t\t$output = apply_filters('alaya_color_hex2rgba', $output);\n return $output;\n}",
"function ts_hex_to_rgb($hex,$transparency = '') {\r\n $hex = str_replace(\"#\", \"\", $hex);\r\n\r\n if(strlen($hex) == 3) {\r\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\r\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\r\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\r\n } else {\r\n $r = hexdec(substr($hex,0,2));\r\n $g = hexdec(substr($hex,2,2));\r\n $b = hexdec(substr($hex,4,2));\r\n }\r\n $rgb = array($r, $g, $b);\r\n return 'rgba('.implode(\",\", $rgb).(!empty($transparency) ? ', '.$transparency : '').')'; \r\n}",
"function hex2rgba( $color, $opacity = false ) {\n\n $default = 'rgb(0,0,0)';\n\n //Return default if no color provided\n if ( empty( $color ) ) {\n return $default;\n }\n\n //Sanitize $color if \"#\" is provided\n if ( $color[0] == '#' ) {\n $color = substr( $color, 1 );\n }\n\n //Check if color has 6 or 3 characters and get values\n if ( strlen( $color ) == 6 ) {\n $hex = array(\n $color[0] . $color[1],\n $color[2] . $color[3],\n $color[4] . $color[5],\n );\n } elseif ( strlen( $color ) == 3 ) {\n $hex = array(\n $color[0] . $color[0],\n $color[1] . $color[1],\n $color[2] . $color[2],\n );\n } else {\n return $default;\n }\n\n //Convert hexadec to rgb\n $rgb = array_map( 'hexdec', $hex );\n\n //Check if opacity is set(rgba or rgb)\n if ( $opacity ) {\n if ( abs( $opacity ) > 1 ) {\n $opacity = 1.0;\n }\n $output = 'rgba(' . implode( \",\", $rgb ) . ',' . $opacity . ')';\n } else {\n $output = 'rgb(' . implode( \",\", $rgb ) . ')';\n }\n\n //Return rgb(a) color string\n return $output;\n}"
] |
[
"0.71228063",
"0.6505872",
"0.625929",
"0.61208004",
"0.61115587",
"0.6040388",
"0.5877591",
"0.58114743",
"0.5768534",
"0.5740145",
"0.5719021",
"0.55575347",
"0.54868335",
"0.544735",
"0.54376286",
"0.5426778",
"0.54098505",
"0.53434175",
"0.53330547",
"0.52981025",
"0.527214",
"0.52428055",
"0.5194436",
"0.51931494",
"0.51622194",
"0.51462984",
"0.5101664",
"0.5063717",
"0.503716",
"0.50341856"
] |
0.83538127
|
0
|
string packMATRIX(boolean HasScale, float ScaleX, float ScaleY,boolean HasRotate, float RotateSkew0, float RotateSkew1, integer TranslateX, integer TranslateY) returns an SWF MATRIX atom string.
|
function packMATRIX($HasScale, $ScaleX, $ScaleY, $HasRotate, $RotateSkew0, $RotateSkew1, $TranslateX, $TranslateY)
{
array_push($this->FMDebug, "packMATRIX");
$atom = "";
if ($HasScale) {
$ScaleX = $this->packFBchunk($ScaleX);
$ScaleY = $this->packFBchunk($ScaleY);
$nScaleBits = (int) max(strlen($ScaleX), strlen($ScaleY));
#$nScaleBits = 31;
$ScaleX = str_repeat(substr($ScaleX, 0, 1), ($nScaleBits - strlen($ScaleX))) . $ScaleX;
$ScaleY = str_repeat(substr($ScaleY, 0, 1), ($nScaleBits - strlen($ScaleY))) . $ScaleY;
$atom = "1" . $this->packnBits($nScaleBits, 5) . $ScaleX . $ScaleY;
} else {
$atom = "0";
}
if ($HasRotate) {
$RotateSkew0 = $this->packFBchunk($RotateSkew0);
$RotateSkew1 = $this->packFBchunk($RotateSkew1);
#$nRotateBits = 31;
$nRotateBits = (int) max(strlen($RotateSkew0), strlen($RotateSkew1));
$RotateSkew0 = str_repeat(substr($RotateSkew0, 0, 1), $nRotateBits - strlen($RotateSkew0)) . $RotateSkew0;
$RotateSkew1 = str_repeat(substr($RotateSkew1, 0, 1), $nRotateBits - strlen($RotateSkew1)) . $RotateSkew1;
$atom .= "1" . $this->packnBits($nRotateBits, 5) . $RotateSkew0 . $RotateSkew1;
} else {
$atom .= "0";
}
if (($TranslateX == 0) and ($TranslateY == 0)) {
$atom .= "00000";
} else {
$TranslateX = $this->packSBchunk($TranslateX);
$TranslateY = $this->packSBchunk($TranslateY);
$nTranslateBits = (int) max(strlen($TranslateX), strlen($TranslateY));
$TranslateX = str_repeat(substr($TranslateX, 0, 1), $nTranslateBits - strlen($TranslateX)) . $TranslateX;
$TranslateY = str_repeat(substr($TranslateY, 0, 1), $nTranslateBits - strlen($TranslateY)) . $TranslateY;
$atom .= $this->packnBits($nTranslateBits, 5) . $TranslateX . $TranslateY;
}
$atom = $this->packBitValues($atom);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function store_product_matrix( $args = null ){\n\t\t$matrix = store_get_product_matrix($args);\n\n\t\t// Set output to be full script tag\n\t\t$output = '<script type=\"text/javascript\">\n\t\t/* <![CDATA[ */\n\t\tstoreAPI.matrix.data[' . $matrix['id'] . '] = ' . json_encode( $matrix ) . ';\n\t\t/* ]]> */\n\t\t</script>';\n\n\t\techo $output;\n\t}",
"private function parseMatrixElement(SimpleXMLElement $element): Matrix\n {\n $matrix = new Matrix();\n\n $matrix->translate((int) $element['translateX'], (int) $element['translateY']);\n\n if ($element['hasScale'] == 'true') {\n $matrix->scale((int) $element['scaleX'], (int) $element['scaleY']);\n }\n\n if ($element['hasRotate'] == 'true') {\n $matrix->rotate((int) $element['rotateSkew0'], (int) $element['rotateSkew1']);\n }\n\n return $matrix;\n }",
"public function getCurrentTransformationMatrix() {}",
"public function testMatrixEncoding()\n {\n $service = new MatrixService();\n $result = $service->encodeMatrix($this->expected_matrix_result);\n\n $this->assertEquals($result, $this->expected_matrix_result_encoded);\n }",
"public function getMatrix($asArray = false) {}",
"function getMatrixX() {\n // width\n return 15;\n }",
"public function getTextMatrix() {}",
"public function getFontMatrix() {}",
"public function setTextMatrix($aOrMatrix, $b = null, $c = null, $d = null, $e = null, $f = null) {}",
"public function matrix()\n {\n echo \"在Linux下通过,Matrix,展示>>{$this->imgFile->play()}<<\";\n }",
"function printMatrix($header,$matrix = null){\n $widthColumn = ($this->GetPageWidth() - (2 * $this->marginSize)) / sizeof($header);\n\n for($i = 0; $i< sizeof($header); $i++){\n $this->Cell($widthColumn,$this->fontSize/2,$header[$i],1,0,'C'); \n }\n\n //Salto de linea para los valores de la matriz\n\n $this->Ln();\n\n $this->SetFont($this->font,'',$this->fontSize);\n\n foreach($matrix as $row){\n foreach($row as $value){\n $this->Cell($widthColumn,$this->fontSize/2,\"EMPTY\",1,0,'C'); \n }\n $this->Ln();\n }\n\n // for($i = 0; $i< 40; $i++){\n // for($j = 0; $j< sizeof($header); $j++){\n // $this->Cell($widthColumn,$this->fontSize/2,\"EMPTY\",1,0,'C'); \n // }\n // $this->Ln();\n // }\n }",
"public function setTextMatrix($a, $b, $c, $d, $e, $f) {}",
"public function transpose();",
"function exportToMEGAFormat($matrixAndKeys, $title=\"MLVA_Export\", $description=\"\")\n{\n list($keys, $matrix) = $matrixAndKeys;\n $nbStrains = count($keys);\n $title = url_title($title);\n header(\"Content-Type: application/txt\");\n header(\"Content-disposition: attachment; filename=\".$title.\".meg\");\n echo \"#mega\\r\\n[if file does not open with MEGA, check MEGA manual for taxa names rules.]\\r\\n\";\n echo \"!Title: $title;\\r\\n!Format DataType=Distance DataFormat=LowerLeft NTaxa=$nbStrains;\\r\\n\";\n echo \"!Description\\r\\n$description\\r\\n;\\r\\n\\r\\n\";\n // replace incompatibles characters\n // And print strains\n for ($i = 0; $i < $nbStrains; $i++)\n {\n echo '#'.url_title($keys[$i][0]).PHP_EOL;\n }\n // Print the matrix\n for ($i = 0; $i < $nbStrains; $i++)\n {\n echo implode(\" \", $matrix[$i]).PHP_EOL;\n }\n}",
"public function addCurrentTransformationMatrix($a, $b, $c, $d, $e, $f) {}",
"public function addCurrentTransformationMatrix($a, $b, $c, $d, $e, $f) {}",
"public function addCurrentTransformationMatrix($a, $b, $c, $d, $e, $f) {}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function setMatrixAttribute($value)\n {\n $this->attributes['matrix'] = json_encode($value, JSON_UNESCAPED_UNICODE);\n }",
"private function include_matrix_js() {\n\n\t\t$this->EE->cp->add_to_foot(\n\t\t\t\t'<script type=\"text/javascript\" src=\"'.$this->EE->config->item('theme_folder_url').'third_party/dm_eeck/editor_matrix.js\"></script>'\n\t\t);\n\t}",
"public function getMatrix()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('matrix');\n }",
"protected function getVersionMatrix() {}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"public function defineStructure()\n {\n return StructureType::Matrix;\n }",
"public function getAsString(): string\n {\n $model = <<<MODEL\n<mujoco>\n <option timestep=\"0.02\" viscosity=\"0\" density=\"0\" gravity=\"0 0 -9.81\" collision=\"dynamic\"/>\n <compiler coordinate=\"global\" angle=\"degree\"/>\n <default>\n <geom rgba=\".8 .6 .4 1\"/>\n <joint limited=\"true\"/>\n </default>\n <asset>\n <texture type=\"skybox\" builtin=\"gradient\" rgb1=\"1 1 1\" rgb2=\".6 .8 1\" width=\"256\" height=\"256\"/>\n <texture type=\"2d\" name=\"checkers\" builtin=\"checker\" width=\"256\" height=\"256\" rgb1=\"0 0 0\" rgb2=\"1 1 1\"/>\n <material name=\"checker_mat\" texture=\"checkers\" texrepeat=\"15 15\"/>\n <!--<material name=\"spiral_mat\" texture=\"spiral\" texrepeat=\"1 1\"/>-->\n </asset>\n <visual>\n <global offwidth=\"1920\" offheight=\"1080\"/>\n <map stiffness=\"10\" stiffnessrot=\"20\"/>\n </visual>\n\n\n <worldbody>\n <camera name='targeting' pos='1 1 2' mode='targetbodycom' target='body_0'/>\n\n <geom name=\"floor\" material=\"checker_mat\" pos=\"30 50 -20\" size=\"420 420 .125\" rgba=\"1 1 1 1\" type=\"plane\"\n condim=\"6\" friction=\"5 0.5 0.1\"/>\n\n <site name=\"reference_0\" pos=\"130 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_1\" pos=\"180 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_2\" pos=\"230 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_3\" pos=\"280 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_4\" pos=\"330 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_5\" pos=\"380 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n <site name=\"reference_6\" pos=\"430 0 -15\" size=\"5 5 5\" type=\"sphere\" rgba=\"255 255 0 1\"/>\n\n\n <body name=\"body_0\">\n <freejoint/>\n <site name=\"head\" size=\"2 2 2\" rgba=\"1 0 0 0.5\" pos=\"80 0 0\"/>\n <geom name=\"geom_0\" type=\"sphere\" pos=\"0.00 0.00 0.20\" size=\"0.3\"/>\n <body name=\"body_1\">\n <!--1st arms-->\n <geom name=\"geom_1\" type=\"capsule\" fromto=\"0.00 0.00 0.00 0.00 10.0 10.0\" size=\"01.00000\"/>\n <geom name=\"geom_2\" type=\"capsule\" fromto=\"0.00 0.00 0.00 0.00 -10.0 10.0\" size=\"01.00000\"/>\n <!--spine-->\n <geom name=\"geom_3\" type=\"capsule\" fromto=\"0.00 0.00 0.00 80.0 0.00 0.00\" size=\"01.00000\"/>\n <!--contact point which is used to create heading vector-->\n <geom name=\"contact_1\" type=\"sphere\" pos=\"0.00 0.00 0.00\" size=\"0.01\" rgba=\"1 0 1 0.5\" density=\"1\"/>\n\n <!--2nd arms-->\n <geom name=\"geom_4\" type=\"capsule\" fromto=\"40.0 0.00 0.00 40.0 10.0 10.0\" size=\"01.00000\"/>\n <geom name=\"geom_5\" type=\"capsule\" fromto=\"40.0 0.00 0.00 40.0 -10.0 10.0\" size=\"01.00000\"/>\n\n <!--3rd arms-->\n <geom name=\"geom_18\" type=\"capsule\" fromto=\"80.0 0.00 0.00 80.0 10.0 10.0\" size=\"01.00000\"/>\n <geom name=\"geom_19\" type=\"capsule\" fromto=\"80.0 0.00 0.00 80.0 -10.0 10.0\" size=\"01.00000\"/>\n\n <!--first leg pair-->\n <!--upper leg-->\n <body name=\"body_2\">\n <joint type=\"hinge\" pos=\"0 -10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_0\"/>\n <geom name=\"geom_6\" type=\"capsule\" fromto=\"0.00 -10.0 10.0 0.00 -20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_3\">\n <joint type=\"hinge\" pos=\"0 -20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_1\"/>\n <geom name=\"geom_7\" type=\"capsule\" fromto=\"0.00 -20.0 10.0 0.00 -30.0 -5.0\" size=\"01.00000\"/>\n </body>\n </body>\n <!--upper leg-->\n <body name=\"body_4\">\n <joint type=\"hinge\" pos=\"0 10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_2\"/>\n <geom name=\"geom_8\" type=\"capsule\" fromto=\"0.00 10.0 10.0 0.00 20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_5\">\n <joint type=\"hinge\" pos=\"0 20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_3\"/>\n <geom name=\"geom_9\" type=\"capsule\" fromto=\"0.00 20.0 10.0 0.00 30.0 -5\" size=\"01.00000\"/>\n </body>\n </body>\n\n <!--second leg pair-->\n <!--upper leg-->\n <body name=\"body_6\">\n <joint type=\"hinge\" pos=\"40 -10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_4\"/>\n <geom name=\"geom_10\" type=\"capsule\" fromto=\"40.0 -10.0 10.0 40.0 -20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_7\">\n <joint type=\"hinge\" pos=\"40 -20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_5\"/>\n <geom name=\"geom_11\" type=\"capsule\" fromto=\"40.0 -20.0 10.0 40.0 -30.0 -5.0\" size=\"01.00000\"/>\n </body>\n </body>\n <!--upper leg-->\n <body name=\"body_8\">\n <joint type=\"hinge\" pos=\"40 10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_6\"/>\n <geom name=\"geom_12\" type=\"capsule\" fromto=\"40.0 10.0 10.0 40.0 20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_9\">\n <joint type=\"hinge\" pos=\"40 20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_7\"/>\n <geom name=\"geom_13\" type=\"capsule\" fromto=\"40.0 20.0 10.0 40.0 30.0 -0.5\" size=\"01.00000\"/>\n </body>\n </body>\n\n <!--third leg pair-->\n <!--upper leg-->\n <body name=\"body_10\">\n <joint type=\"hinge\" pos=\"80 -10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_8\"/>\n <geom name=\"geom_14\" type=\"capsule\" fromto=\"80 -10.0 10.0 80 -20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_11\">\n <joint type=\"hinge\" pos=\"80 -20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_9\"/>\n <geom name=\"geom_15\" type=\"capsule\" fromto=\"80 -20.0 10.0 80 -30.0 -5.0\" size=\"01.00000\"/>\n </body>\n </body>\n <!--upper leg-->\n <body name=\"body_12\">\n <joint type=\"hinge\" pos=\"80 10 10\" axis=\"0 0 1\" limited=\"true\" range=\"-45 45\" name=\"motor_10\"/>\n <geom name=\"geom_16\" type=\"capsule\" fromto=\"80 10.0 10.0 80 20.0 10.0\" size=\"01.00000\"/>\n <!--lower leg-->\n <body name=\"body_13\">\n <joint type=\"hinge\" pos=\"80 20 10\" axis=\"1 0 0\" limited=\"true\" range=\"-20 45\" name=\"motor_11\"/>\n <geom name=\"geom_17\" type=\"capsule\" fromto=\"80 20.0 10.0 80 30.0 -0.5\" size=\"01.00000\"/>\n </body>\n </body>\n </body>\n </body>\n </worldbody>\n\n <actuator>\n <motor name=\"motor_0\" joint=\"motor_0\" gear=\"100000\"/>\n <motor name=\"motor_1\" joint=\"motor_1\" gear=\"100000\"/>\n <motor name=\"motor_2\" joint=\"motor_2\" gear=\"100000\"/>\n <motor name=\"motor_3\" joint=\"motor_3\" gear=\"100000\"/>\n <motor name=\"motor_4\" joint=\"motor_4\" gear=\"100000\"/>\n <motor name=\"motor_5\" joint=\"motor_5\" gear=\"100000\"/>\n <motor name=\"motor_6\" joint=\"motor_6\" gear=\"100000\"/>\n <motor name=\"motor_7\" joint=\"motor_7\" gear=\"100000\"/>\n <motor name=\"motor_8\" joint=\"motor_8\" gear=\"100000\"/>\n <motor name=\"motor_9\" joint=\"motor_9\" gear=\"100000\"/>\n <motor name=\"motor_10\" joint=\"motor_10\" gear=\"100000\"/>\n <motor name=\"motor_11\" joint=\"motor_11\" gear=\"100000\"/>\n </actuator>\n</mujoco>\nMODEL;\n\n return $model;\n }"
] |
[
"0.55219305",
"0.53764206",
"0.51711553",
"0.49365306",
"0.4683214",
"0.46577725",
"0.46372634",
"0.45059124",
"0.44873473",
"0.44660345",
"0.4456446",
"0.44196334",
"0.4413233",
"0.4383588",
"0.43652472",
"0.4364406",
"0.4364406",
"0.43613276",
"0.43456453",
"0.43348673",
"0.43200368",
"0.43012527",
"0.42824665",
"0.4278601",
"0.42758858",
"0.42628872",
"0.42628872",
"0.42628872",
"0.42462355",
"0.42359024"
] |
0.79635066
|
0
|
string packCXFORM(boolean HasAddTerms, integer RedAddTerm, integer GreenAddTerm, integer BlueAddTerm, boolean HasMultTerms, integer RedMultTerm, integer GreenMultTerm, integer BlueMultTerm) returns an SWF CXFORM atom string.
|
function packCXFORM($HasAddTerms, $RedAddTerm, $GreenAddTerm, $BlueAddTerm, $HasMultTerms, $RedMultTerm, $GreenMultTerm, $BlueMultTerm)
{
array_push($this->FMDebug, "packCXFORM");
if ($HasAddTerms) {
$RedAddTerm = $this->packSBchunk($RedAddTerm);
$GreenAddTerm = $this->packSBchunk($GreenAddTerm);
$BlueAddTerm = $this->packSBchunk($BlueAddTerm);
$atom = "1";
} else {
$atom = "0";
}
if ($HasMultTerms) {
$RedMultTerm = $this->packSBchunk($RedMultTerm);
$GreenMultTerm = $this->packSBchunk($GreenMultTerm);
$BlueMultTerm = $this->packSBchunk($BlueMultTerm);
$atom .= "1";
} else {
$atom .= "0";
}
if (!(($HasAddTerms == 0) and ($HasMultTerms == 0))) {
$nBits = (int) max(strlen($RedMultTerm), strlen($GreenMultTerm), strlen($BlueMultTerm), strlen($RedAddTerm), strlen($GreenAddTerm), strlen($BlueAddTerm));
$RedAddTerm = str_repeat(substr($RedAddTerm, 0, 1), $nBits - strlen($RedAddTerm)) . $RedAddTerm;
$GreenAddTerm = str_repeat(substr($GreenAddTerm, 0, 1), $nBits - strlen($GreenAddTerm)) . $GreenAddTerm;
$BlueAddTerm = str_repeat(substr($BlueAddTerm, 0, 1), $nBits - strlen($BlueAddTerm)) . $BlueAddTerm;
$RedMultTerm = str_repeat(substr($RedMultTerm, 0, 1), $nBits - strlen($RedMultTerm)) . $RedMultTerm;
$GreenMultTerm = str_repeat(substr($GreenMultTerm, 0, 1), $nBits - strlen($GreenMultTerm)) . $GreenMultTerm;
$BlueMultTerm = str_repeat(substr($BlueMultTerm, 0, 1), $nBits - strlen($BlueMultTerm)) . $BlueMultTerm;
$atom .= $this->packnBits($nBits, 5);
if ($HasMultTerms) {
$atom .= $RedMultTerm . $GreenMultTerm . $BlueMultTerm;
}
if ($HasAddTerms) {
$atom .= $RedAddTerm . $GreenAddTerm . $BlueAddTerm;
}
}
$atom = $this->packBitValues($atom);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packCXFORMWITHALPHA($HasAddTerms, $RedAddTerm, $GreenAddTerm, $BlueAddTerm, $AlphaAddTerm, $HasMultTerms, $RedMultTerm, $GreenMultTerm, $BlueMultTerm, $AlphaMultTerm)\n\t{\n\t\tarray_push($this->FMDebug, \"packCXFORMWITHALPHA\");\n\n\t\tif ($HasAddTerms) {\n\n\t\t\t$RedAddTerm = $this->packSBchunk($RedAddTerm);\n\t\t\t$GreenAddTerm = $this->packSBchunk($GreenAddTerm);\n\t\t\t$BlueAddTerm = $this->packSBchunk($BlueAddTerm);\n\t\t\t$AlphaAddTerm = $this->packSBchunk($AlphaAddTerm);\n\n\t\t\t$atom = \"1\";\n\n\t\t} else {\n\n\t\t\t$atom = \"0\";\n\t\t}\n\n\t\tif ($HasMultTerms) {\n\n\t\t\t$RedMultTerm = $this->packSBchunk($RedMultTerm);\n\t\t\t$GreenMultTerm = $this->packSBchunk($GreenMultTerm);\n\t\t\t$BlueMultTerm = $this->packSBchunk($BlueMultTerm);\n\t\t\t$AlphaMultTerm = $this->packSBchunk($AlphaMultTerm);\n\n\t\t\t$atom .= \"1\";\n\n\t\t} else {\n\n\t\t\t$atom .= \"0\";\n\t\t}\n\n\t\tif (!(($HasAddTerms == 0) and ($HasMultTerms == 0))) {\n\n\t\t\t$nBits = (int) max(strlen($RedMultTerm), strlen($GreenMultTerm), strlen($BlueMultTerm), strlen($AlphaMultTerm), strlen($RedAddTerm), strlen($GreenAddTerm), strlen($BlueAddTerm), strlen($AlphaAddTerm));\n\n\t\t\t$RedAddTerm = str_repeat(substr($RedAddTerm, 0, 1), $nBits - strlen($RedAddTerm)) . $RedAddTerm;\n\t\t\t$GreenAddTerm = str_repeat(substr($GreenAddTerm, 0, 1), $nBits - strlen($GreenAddTerm)) . $GreenAddTerm;\n\t\t\t$BlueAddTerm = str_repeat(substr($BlueAddTerm, 0, 1), $nBits - strlen($BlueAddTerm)) . $BlueAddTerm;\n\t\t\t$AlphaAddTerm = str_repeat(substr($AlphaAddTerm, 0, 1), $nBits - strlen($AlphaAddTerm)) . $AlphaAddTerm;\n\n\t\t\t$RedMultTerm = str_repeat(substr($RedMultTerm, 0, 1), $nBits - strlen($RedMultTerm)) . $RedMultTerm;\n\t\t\t$GreenMultTerm = str_repeat(substr($GreenMultTerm, 0, 1), $nBits - strlen($GreenMultTerm)) . $GreenMultTerm;\n\t\t\t$BlueMultTerm = str_repeat(substr($BlueMultTerm, 0, 1), $nBits - strlen($BlueMultTerm)) . $BlueMultTerm;\n\t\t\t$AlphaMultTerm = str_repeat(substr($AlphaMultTerm, 0, 1), $nBits - strlen($AlphaMultTerm)) . $AlphaMultTerm;\n\n\t\t\t$atom .= $this->packnBits($nBits, 5);\n\n\t\t\tif ($HasMultTerms == \"1\") {\n\t\t\t\t$atom .= $RedMultTerm . $GreenMultTerm . $BlueMultTerm . $AlphaMultTerm;\n\t\t\t}\n\n\t\t\tif ($HasAddTerms == \"1\") {\n\t\t\t\t$atom .= $RedAddTerm . $GreenAddTerm . $BlueAddTerm . $AlphaAddTerm;\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $this->packBitValues($atom);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function formC() {\r\n return new NormalizationForm(\"FormC\", 4);\r\n }",
"function _putformxobjects() {\n $filter=($this->compress) ? '/Filter /FlateDecode ' : '';\n\t reset($this->tpls);\n foreach($this->tpls AS $tplidx => $tpl) {\n\n $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];\n \t\t$this->_newobj();\n \t\t$this->tpls[$tplidx]['n'] = $this->n;\n \t\t$this->_out('<<'.$filter.'/Type /XObject');\n $this->_out('/Subtype /Form');\n $this->_out('/FormType 1');\n $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',\n // llx\n $tpl['x'] * $this->k,\n // lly\n -$tpl['y'] * $this->k,\n // urx\n ($tpl['w'] + $tpl['x']) * $this->k,\n // ury\n ($tpl['h'] - $tpl['y']) * $this->k\n ));\n \n if ($tpl['x'] != 0 || $tpl['y'] != 0) {\n $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]',\n -$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2\n ));\n }\n \n $this->_out('/Resources ');\n\n $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');\n \tif (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {\n \t$this->_out('/Font <<');\n foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)\n \t\t$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');\n \t$this->_out('>>');\n }\n \tif(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || \n \t isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))\n \t{\n $this->_out('/XObject <<');\n if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {\n foreach($this->_res['tpl'][$tplidx]['images'] as $image)\n \t\t\t$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');\n }\n if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {\n foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)\n $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');\n }\n $this->_out('>>');\n \t}\n \t$this->_out('>>');\n \t\n \t$this->_out('/Length ' . strlen($p) . ' >>');\n \t\t$this->_putstream($p);\n \t\t$this->_out('endobj');\n }\n }",
"function createCtfEstimateForm($extra=false) {\n\t// check if coming directly from a session\n\t$expId = $_GET['expId'];\n\tif ($expId) {\n\t\t$sessionId=$expId;\n\t\t$formAction=$_SERVER['PHP_SELF'].\"?expId=$expId\";\n\t}\n\telse {\n\t\t$sessionId=$_POST['sessionId'];\n\t\t$formAction=$_SERVER['PHP_SELF'];\t\n\t}\n\t$projectId=getProjectId();\n\n\t// check if running ctffind or ctftilt\n\t$progname = \"Xmipp CTF Estimator\";\n\t$runbase = \"xmippctf\";\n\n\t$presetval = ($_POST['preset']) ? $_POST['preset'] : 'en';\n\t$javafunctions = \"\";\n\t$javafunctions .= writeJavaPopupFunctions('appion');\n\tprocessing_header(\"$progname Launcher\", \"$progname\", $javafunctions);\n\n\tif ($extra) {\n\t\techo \"<font color='#cc3333' size='+2'>$extra</font>\\n<hr/>\\n\";\n\t}\n\n\techo\"\n\t<form name='viewerform' method='POST' action='$formAction'>\\n\";\n\t$sessiondata=getSessionList($projectId,$expId);\n\t$sessioninfo=$sessiondata['info'];\n\t$presets=$sessiondata['presets'];\n\tif (!empty($sessioninfo)) {\n\t\t$sessionpath=getBaseAppionPath($sessioninfo).'/ctf/';\n\t}\n\t$ctf = new particledata();\n\t$lastrunnumber = $ctf->getLastRunNumberForType($sessionId,'ApAceRunData','name'); \n\twhile (file_exists($sessionpath.$runbase.'run'.($lastrunnumber+1)))\n\t\t$lastrunnumber += 1;\n\t$defrunname = ($_POST['runname']) ? $_POST['runname'] : $runbase.'run'.($lastrunnumber+1);\n\n\t// set defaults and check posted values\n\t$form_fieldsz = ($_POST['fieldsize']) ? $_POST['fieldsize'] : 512;\n\t$form_resmin = ($_POST['resmin']) ? $_POST['resmin'] : '100';\n\t$form_resmax = ($_POST['resmax']) ? $_POST['resmax'] : '10';\n\n\techo\"\n\t<TABLE BORDER=0 CLASS=tableborder CELLPADDING=15>\n\t<TR>\n\t <TD VALIGN='TOP'>\";\n\n\tcreateAppionLoopTable($sessiondata, $defrunname, \"ctf\");\n\techo\"\n\t </TD>\n\t <TD CLASS='tablebg'>\";\n\n\techo \"<b>$progname Values</b><br/>\\n\";\n\techo \"<INPUT TYPE='text' NAME='fieldsize' VALUE='$form_fieldsz' size='6'>\\n\";\n\techo docpop('field','Field Size');\n\techo \"<br />\\n\";\n\techo \"<input type='text' name='resmin' value='$form_resmin' size='6'>\\n\";\n\techo docpop('resmin','Minimum Resolution');\n\techo \" (Ångstroms)<br />\\n\";\n\techo \"<input type='text' name='resmax' value='$form_resmax' size='6'>\\n\";\n\techo docpop('resmax','Maximum Resolution');\n\techo \" (Ångstroms)<br />\\n\";\n\techo \"<br />\\n\";\n\n\techo\"\n\t </TD>\n\t</tr>\n\t<TR>\n\t <TD COLSPAN='2' ALIGN='CENTER'>\\n<hr />\";\n\techo getSubmitForm(\"Run $progname\");\n\techo \"\n\t </td>\n\t</tr>\n\t</table>\n\t</form>\\n\";\n\n\techo referenceBox(\"Fast, robust, and accurate determination of transmission electron microscopy contrast transfer function.\", 2007, \"Sorzano CO, Jonic S, Núñez-Ramírez R, Boisset N, Carazo JM.\", \"J Struct Biol.\", 160, 2, 17911028, false, false, \"img/xmipp_logo.png\");\n\n\tprocessing_footer();\n}",
"function packPlaceObjectTag($CharacterID, $Depth, $MATRIX, $CXFORM)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObjectTag\");\n\n\t\t$TagID = 4;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16($Depth);\n\t\t$TagLength = strlen($CharacterID . $Depth . $MATRIX . $CXFORM);\n\t\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth . $MATRIX . $CXFORM;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function mf_complemento_ecc11($datos)\n{\n global $__mf_namespaces__;\n $__mf_namespaces__['ecc11']['uri'] = 'http://www.sat.gob.mx/EstadoDeCuentaCombustible';\n $__mf_namespaces__['ecc11']['xsd'] = 'http://www.sat.gob.mx/sitio_internet/cfd/EstadoDeCuentaCombustible/ecc11.xsd';\n\n $atrs = mf_atributos_nodo($datos);\n $xml = \"<ecc11:EstadoDeCuentaCombustible Version='1.1' $atrs>\";\n\tif(isset($datos['Conceptos']))\n\t{\n\t\t$atrs = mf_atributos_nodo($datos['Conceptos']);\n\t\t$xml .= \"<ecc11:Conceptos $atrs>\";\n\t\tforeach($datos['Conceptos'] as $idx =>$entidad)\n\t\t{\n\t\t\tif(is_array($datos['Conceptos'][$idx]))\n\t\t\t{\n\t\t\t\t$atrs = mf_atributos_nodo($entidad);\n\t\t\t\t$xml .= \"<ecc11:ConceptoEstadoDeCuentaCombustible $atrs>\";\n\t\t\t\tif(isset($entidad['Traslados']))\n\t\t\t\t{\n\t\t\t\t\t$atrs = mf_atributos_nodo($entidad['Traslados']);\n\t\t\t\t\t$xml .= \"<ecc11:Traslados $atrs>\";\n\t\t\t\t\tforeach($entidad['Traslados'] as $idx2 =>$det)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(is_array($entidad['Traslados'][$idx2]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$atrs = mf_atributos_nodo($det);\n\t\t\t\t\t\t\t$xml .= \"<ecc11:Traslado $atrs/>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$xml .= \"</ecc11:Traslados>\";\n\t\t\t\t}\n\t\t\t\t$xml .= \"</ecc11:ConceptoEstadoDeCuentaCombustible>\";\n\t\t\t}\n\t\t}\n\t\t$xml .= \"</ecc11:Conceptos>\";\n\t}\n\t$xml .= \"</ecc11:EstadoDeCuentaCombustible>\";\n return $xml;\n}",
"function toString($submit=FALSE,$reset=FALSE) {\n\t\tglobal $chksid;\t\n\t\t//generate the form\n\t\t$return_string = \"\";\n\t\t$return_string .= \"<div id=\\\"myFormCont\\\">\\n\";\n\t\t$return_string .= \"<form enctype=\\\"multipart/form-data\\\" action=\\\"$this->actionTarget\\\" method=\\\"post\\\" name=\\\"myform\\\">\\n\";\n\t\t$return_string .= \"<div><input type=\\\"hidden\\\" name=\\\"checksid\\\" value=\\\"$chksid\\\" size=\\\"100\\\"></div>\\n\";\n\t\t$return_string .= $this->makeButton('new');\n\t\t$return_string .= $this->makeButton('previous');\n\t\t$return_string .= $this->makeButton('next');\n\t\t// generate the individual fieldsets with their resp. form fields\n\t\t$return_string .= $this->makeFieldset();\n\t\t$return_string .= \"<br>\\n\";\n\t\t// default submit is 'submit'\n\t\tif ($submit) $thelabel = $submit;\t\t\n\t\telse $thelabel = \"submit\";\n\t\t$return_string .= $this->makeButton($thelabel);\n\t\tif ($reset) $thelabel = $reset;\n\t\telse $thelabel = \"reset\";\n\t\t$return_string .= $this->makeButton($thelabel);\n\t\t$return_string .= \"\\n</form>\\n</div>\\n\";\n\t\treturn ($return_string);\n\t}",
"function mk_customizerForm($cName, $cGen, $str = ''){\n\t$str='<h4><a href=\"#\">Customize Descriptions</a></h4>\n\t\t<p>Enter characters name to personalize each & every descriptions on this page to your character.</p>';\n\t\t\t$str .='<form action=\"' . htmlspecialchars(THIS_PAGE) . '\" method=\"get\">\n\t\t\t\t<input type=\"text\" name=\"codeName\"\n\t\t\t\t\tvalue=\"' . $cName . '\" placeholder=\"Alias / Codename?\"><br>\n\t\t\t\t\t<input type=\"radio\" name=\"gender\"';\n\n\t\t\t\t\tif ((isset($cGen)) && ($cGen==\"female\")){ $str .= \"checked\"; }\n\n\t\t\t\t\t$str .='value=\"female\"> Female <input type=\"radio\" name=\"gender\"';\n\n\t\t\t\t\tif ((isset($cGen)) && ($cGen==\"male\")){ $str .= \"checked\"; }\n\n\t\t\t\t\t$str .='value=\"male\"> Male\n\t\t\t\t\t<br /><br/>';\n\n\t\t\t\t$str .='<input type=\"hidden\" name=\"CharID\" value=\"0\">\n\t\t\t\t<input type=\"submit\" value=\"Submit\">\n\t\t\t</form>\n\t\t<hr />';\n\n\treturn $str;\n}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"static public function formatForms($forms)\n {\n\t\t$v = Tools::alphanumpunct($forms);\n\t\t$v = preg_replace('/[;,]+/', ';', $v); // replace one or more spaces with one ';' to separate words\n\t\t$v = self::trimDelimitedString(';', $v);\n\t\t$v = self::wrapString(';', $v);\n\n\t\treturn $v;\n\t}",
"function createCtfFindForm($extra=false) {\n\t// check if coming directly from a session\n\t$expId = $_GET['expId'];\n\tif ($expId) {\n\t\t$sessionId=$expId;\n\t\t$formAction=$_SERVER['PHP_SELF'].\"?expId=$expId\";\n\t}\n\telse {\n\t\t$sessionId=$_POST['sessionId'];\n\t\t$formAction=$_SERVER['PHP_SELF'];\t\n\t}\n\t$projectId=getProjectId();\n\n\t// check if running ctffind or ctftilt\n\t$progname = \"CtfFind\";\n\t$runbase = \"ctffind\";\n\t$ctftilt = $_GET['ctftilt'];\n\tif ($ctftilt) {\n\t\t$progname = \"CtfTilt\";\n\t\t$runbase = \"ctftilt\";\n\t\t$formAction .= \"&ctftilt=True\";\n\t}\n\n\t$presetval = ($_POST['preset']) ? $_POST['preset'] : 'en';\n\t$javafunctions = \"\";\n\t$javafunctions .= writeJavaPopupFunctions('appion');\n\t$javafunctions .= \"<script>\n\t\tfunction carbon_preset(obj) {\n\t\t obj.resmin.value = '40';\n\t\t obj.resmax.value = '8';\n\t\t obj.medium[0].checked = true;\n\t\t obj.medium[1].checked = false;\n\t\t obj.defstep.value = 1000;\n\t\t return;\n\t\t}\n\t\tfunction ice_preset(obj) {\n\t\t obj.resmin.value = '100';\n\t\t obj.resmax.value = '10';\n\t\t obj.medium[0].checked = false;\n\t\t obj.medium[1].checked = true;\n\t\t obj.defstep.value = 1000;\n\t\t return;\n\t\t}\n\t\tfunction finetune_preset(obj) {\n\t\t obj.resmin.value = '100';\n\t\t obj.resmax.value = '10';\n\t\t obj.defstep.value = 100;\n\t\t return;\n\t\t}\n\t\tfunction bestdbChange(obj) {\n\t\t\tif (obj.bestdb.checked) {\n\t\t\t\tobj.ampice.style.backgroundColor = '#bbbbbb';\t\t\n\t\t\t\tobj.ampcarbon.style.backgroundColor = '#bbbbbb';\n\t\t\t\tobj.resmax.style.backgroundColor = '#bbbbbb';\n\t\t\t\tobj.dast.style.backgroundColor = '#bbbbbb';\n\t\t\t} else {\n\t\t\t\tobj.ampice.style.backgroundColor = '#ffffff';\t\t\n\t\t\t\tobj.ampcarbon.style.backgroundColor = '#ffffff';\n\t\t\t\tobj.resmax.style.backgroundColor = '#ffffff';\n\t\t\t\tobj.dast.style.backgroundColor = '#ffffff';\n\t\t\t}\t\t\t\n\t\t return;\n\t\t}\t\t\n\t\tfunction updateDFsearch() {\n\t\t var dstep = parseFloat(document.getElementById('defstep').value);\n\t\t var numstep = parseFloat(document.getElementById('numstep').value);\n\t\t var range = dstep*numstep*1e-4;\n\t\t range = (range).toFixed(2);\n\t\t document.getElementById('srange').innerHTML=range;\n\t\t}\n\t\t</script>\";\n\n\tprocessing_header(\"$progname Launcher\", \"CTF Estimation by $progname\", $javafunctions);\n\n\n\tif ($extra) {\n\t\techo \"<font color='#cc3333' size='+2'>$extra</font>\\n<hr/>\\n\";\n\t} elseif ($ctftilt) {\n\t\techo \"<font color='#bb8800' size='+1'>WARNING: CtfTilt is very slow and \"\n\t\t\t.\"you cannot use the tilt angle or astigmatism results in makestack</font><br/><br/>\\n\";\n\t}\n\n\techo\"\n\t<form name='viewerform' method='POST' action='$formAction'>\\n\";\n\t$sessiondata=getSessionList($projectId,$expId);\n\t$sessioninfo=$sessiondata['info'];\n\t$presets=$sessiondata['presets'];\n\tif (!empty($sessioninfo)) {\n\t\t$sessionpath=getBaseAppionPath($sessioninfo).'/ctf/';\n\t}\n\t$ctf = new particledata();\n\t$lastrunnumber = $ctf->getLastRunNumberForType($sessionId,'ApAceRunData','name');\n\twhile (file_exists($sessionpath.$runbase.'run'.($lastrunnumber+1)))\n\t\t$lastrunnumber += 1;\n\t$defrunname = ($_POST['runname']) ? $_POST['runname'] : $runbase.'run'.($lastrunnumber+1);\n\n\t// set defaults and check posted values\n\t$form_fieldsz = ($_POST['fieldsize']) ? $_POST['fieldsize'] : 512;\n\t$form_bin = ($_POST['binval']) ? $_POST['binval'] : 2;\n\t$form_ampc = ($_POST['ampcarbon']) ? $_POST['ampcarbon'] : '0.15';\n\t$form_ampi = ($_POST['ampice']) ? $_POST['ampice'] : '0.07';\n\t$form_resmin = ($_POST['resmin']) ? $_POST['resmin'] : '100';\n\t$form_resmax = ($_POST['resmax']) ? $_POST['resmax'] : '10';\n\n\t$form_defstep = ($_POST['defstep']) ? $_POST['defstep'] : '1000';\n\t$form_numstep = ($_POST['numstep']) ? $_POST['numstep'] : '25';\n\t// check if ctftilt is set\n\t$ctftiltcheck = ($_POST['runctftilt']=='on') ? 'CHECKED' : '';\n\t$form_dast = ($_POST['dast']) ? $_POST['dast'] : '500';\n\n\t$form_nominal = ($_POST['nominal']) ? $_POST['nominal']: 'db value';\n\techo\"\n\t<TABLE BORDER=0 CLASS=tableborder CELLPADDING=15>\n\t<TR>\n\t <TD VALIGN='TOP'>\";\n\n\tcreateAppionLoopTable($sessiondata, $defrunname, \"ctf\");\n\t// give user option to run ctftilt (useful for film data)\n\n\n\techo\"</TD>\\n<TD CLASS='tablebg'>\\n\";\n\n\tif (!$ctftilt) { \n\t\techo \"<input type='checkbox' name='runctftilt' $ctftiltcheck>\\n\";\n\t\techo docpop('ctftilt','Run CtfTilt');\n\t\techo \", instead of CtfFind<br/><br/>\\n\";\n\t}\n\techo docpop('medium','<b>Medium:</b>');\n\techo \"<br/>\n\t <INPUT TYPE='radio' NAME='medium' VALUE='carbon'> carbon \n\t <INPUT TYPE='radio' NAME='medium' VALUE='ice' checked> ice<br/>\n\t <br/>\\n\";\n\n\techo docpop('ampcontrast','<b>Amplitude Contrast:</b>');\n\techo \"<br />\\n\";\n\techo \"<INPUT TYPE='text' NAME='ampcarbon' VALUE='$form_ampc' SIZE='4'>\\n\";\n\techo \"Carbon<br />\\n\";\n\techo \"<INPUT TYPE='text' NAME='ampice' VALUE='$form_ampi' SIZE='4'>\\n\";\n\techo \"Ice\\n\";\n\techo \"<br/><br/>\\n\";\n\n\techo \"<INPUT TYPE='text' NAME='binval' VALUE='$form_bin' SIZE='4'>\\n\";\n\techo docpop('binval','Pre-Binning');\n\techo \"<br/><br/>\\n\";\n\t\n\tif ($lastrunnumber > 1) {\n\t\techo \"<input type='checkbox' name='bestdb' $bestdbcheck onClick='bestdbChange(this.form)'>\\n\";\n\t\techo docpop('ctffindBestdb','Use best values from DB');\n\t} else {\n\t\techo \"<i>Use best values from DB is not available\"\n\t\t\t.\"<br/>($lastrunnumber ctf runs)</i>\\n\";\n\t}\n\techo \"<br />\\n\";\n\techo \"<B>Override nominal defocus set in experiment:</B><br />\\n\";\n\techo \"Set to:<INPUT TYPE='text' NAME='nominal' VALUE='\".$form_nominal.\"' SIZE='8'>\\n\";\n\techo \"<FONT SIZE=-2><I>(in μm, i.e. <B>2.0</B>)</I></FONT><br />\";\n\n\techo \"<br/><br/>\\n\";\n\n\techo \"<b>$progname Values</b><br/>\\n\";\n\techo \"<INPUT TYPE='text' NAME='fieldsize' VALUE='$form_fieldsz' size='6'>\\n\";\n\techo docpop('field','Field Size');\n\techo \"(pixels)<br />\\n\";\n\techo \"<input type='text' name='resmin' value='$form_resmin' size='6'>\\n\";\n\techo docpop('resmin','Minimum Resolution');\n\techo \" (Ångstroms)<br />\\n\";\n\techo \"<input type='text' name='resmax' value='$form_resmax' size='6'>\\n\";\n\techo docpop('resmax','Maximum Resolution');\n\techo \" (Ångstroms)<br />\\n\";\n\techo \"<br />\\n\";\n\techo \"<input type='text' id='defstep' name='defstep' \"\n\t\t.\"value='$form_defstep' size='6' onChange='updateDFsearch()'>\\n\";\n\techo docpop('defstep','Defocus search step size');\n\techo \" (Ångstroms)<br />\\n\";\n\techo \"<input type='text' id='numstep' name='numstep' \"\n\t\t.\"value='$form_numstep' size='6' onChange='updateDFsearch()'>\\n\";\n\techo docpop('numstep','Number of steps to search');\n\techo \"<br />\\n\";\n\techo \"Search range: ± <span id='srange'>\";\n\techo round($form_defstep*$form_numstep*1e-4,2);\n\techo \"</span>µm<br><br>\\n\";\n\techo \"<input type='text' name='dast' value='$form_dast' size='6'>\\n\";\n\techo docpop('dast','Expected astigmatism');\n\techo \" (Ångstroms)<br />\\n\";\n\n\techo \"<br />\\n\";\n\n\n\techo \"<b>PRESET VALUES:</b>\";\n\techo \"<table border='0'><tr><td>\\n\";\n\techo \"<input type='button' onClick='carbon_preset(this.form)' \n\t\tvalue='Carbon Initial Search'>\";\n\techo \"</td></tr><tr><td>\\n\";\n\techo \"<input type='button' onClick='ice_preset(this.form)' \n\t\tvalue='Ice Initial Search'>\";\n\techo \"</td></tr><tr><td>\\n\";\n\techo \"<input type='button' onClick='finetune_preset(this.form)' \n\t\tvalue='Fine Tune Previous Run'>\";\n\techo \"</td></tr></table>\\n\";\n\n\t//echo \"<INPUT TYPE='checkbox' NAME='confcheck' onclick='enableconf(this)'>\\n\";\n\t//echo \"Reprocess Below Confidence Value<br />\\n\";\n\t//echo \"Set Value:<INPUT TYPE='text' NAME='reprocess' DISABLED VALUE='0.8' SIZE='4'>\\n\";\n\t//echo \"<FONT SIZE=-2><I>(between 0.0 - 1.0)</I></FONT><br />\\n\";\n\t\t\n\t//if ($ctfruns > 0) {\n\t//\techo\"\n\t//\t\t<INPUT TYPE='checkbox' NAME='newnominal'>\n\t// Use Previously ACE Estimated Defocus\";\n\t//}\n\techo\"\n\t </TD>\n\t</tr>\n\t<TR>\n\t <TD COLSPAN='2' ALIGN='CENTER'>\\n<hr />\";\n\techo getSubmitForm(\"Run $progname\");\n\techo \"\n\t </td>\n\t</tr>\n\t</table>\n\t</form>\\n\";\n\n\techo referenceBox(\"Accurate determination of local defocus and specimen tilt in electron microscopy.\", 2003, \"Mindell, JA, Grigorieff N.\", \"J Struct Biol.\", 142, 3, 12781660, false, false, \"img/grigorieff_lab.png\");\n\n\tprocessing_footer();\n}",
"function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLEARRAY\");\n\n\t\tif ($FillStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($FillStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom = chr(0xff) . $this->packUI16($FillStyleCount);\n\t\t}\n\n\t\t$atom .= $FillStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packBitValues($atoms)\n\t{\n\t\tarray_push($this->FMDebug, \"packBitsValues\");\n\n\t\tif (!(is_string($atoms))) {\n\n\t\t\t$this->FMError(\"packBitValues argument not a string\");\n\t\t}\n\n\t\t$atoms = $atoms . str_repeat(\"0\", (int) ((ceil(strlen($atoms) / 8)) * 8 - strlen($atoms)));\n\n\t\t$limit = ceil(strlen($atoms) / 8);\n\n\t\t$bytestream = \"\";\n\n\t\tfor ($n = 0; $n < $limit; $n++) {\n\n\t\t\t$bytestream .= chr(base_convert(substr($atoms, 0, 8), 2, 10));\n\t\t\t$atoms = substr($atoms, 8);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $bytestream;\n\t}",
"public function addform()\n\t{\n\t\t\t$this->setMethod('get');\n\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($_GET);\n\t\t\t//echo \"</pre>\";\n\t\t\t$this->addElement('radio', 'Status', array(\n\t\t\t\t'required' => true,\n 'separator' => ' ',\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t\t'separator' => '',\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\n\t\t\n\t\t\n\t\t$this->addElement ( \n 'multiCheckbox', 'Functional_type', \n array (\n \n\t\t//'setrequired' => true,\n 'multiOptions' => array(\n '1' => 'Pre Installation',\n '2' => 'Installation',\n '3' => 'Post Installation'\n \n ),\n 'separator' => '',\n\t\t\t\t\t//'value' => '2' // select these 2 values\n )\n);\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}",
"function form_shortcode( $atts ) {\n \n if ( isset( $atts['form'] ) ) {\n \n $form_id_or_key = $atts['form'];\n unset( $atts['form'] );\n \n ob_start();\n \n $this->render( $form_id_or_key, $atts );\n \n $output = ob_get_clean();\n \n return $output;\n \n }\n \n }",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function customcert_reset_course_form_definition(&$mform) {\n $mform->addElement('header', 'customcertheader', get_string('modulenameplural', 'customcert'));\n $mform->addElement('advcheckbox', 'reset_customcert', get_string('deletissuedcustomcerts', 'customcert'));\n}",
"function customcert_reset_course_form_definition(&$mform) {\n $mform->addElement('header', 'customcertheader', get_string('modulenameplural', 'customcert'));\n $mform->addElement('advcheckbox', 'reset_customcert', get_string('deletissuedcustomcerts', 'customcert'));\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"public function printForm() {\n\t\t$html = '';\n\t\t$values = $this->value();\n\n\t\tforeach ($this->options as $value => $label) {\n\t\t\t$id = $this->name().'_'.$value;\n\t\t\t$html .= '<div><input type=\"checkbox\" id=\"'.$id.'\" name=\"'.$id.'\" value=\"'.$value.'\" '.((isset($this->selected[$id]) && $this->selected[$id])?' checked':'').'/><label for=\"'.$id.'\">'.$label.'</label></div>'.\"\\n\";\n\t\t}\n\n\t\tforeach ($this->others as $name => $label) {\n\t\t\t$value = $values[$name];\n\n\n\t\t\t$id = $this->name().'_'.$name;\n\t\t\t$label = '<label for=\"'.$id.'\">'.$label.'</label> <input onclick=\"document.getElementById(\\''.$id.'\\').checked=\\'checked\\';\" name=\"'.$id.'[]\" value=\"'.htmlentities($value).'\" />';\n\t\t\t$input = '<input type=\"checkbox\" id=\"'.$id.'\" '.(($value)?(' checked=\"checked\" '):('')).'name=\"'.$id.'[]\" value=\"'.htmlentities($value).'\" />';\n\t\t\t$html .= '<div class=\"checkbox\">'.($this->label_left?($label.$input):($input.$label)).'</div>';\n\t\t}\n\t\treturn $html;\n\t}",
"static function numberForm (ViewRegistry $context) {\n $form=\"<form action=\\\"\\\" method=\\\"get\\\" id=\\\"messageNumber\\\" drawer=\\\"Rec\\\"><p>\".l(\"Message\").\" (\".$context->g(\"forumBegin\").\"..\".$context->g(\"forumEnd\").\"): \";\n $form.=\"<input type=\\\"text\\\" name=\\\"begin\\\" style=\\\"width:5em;\\\" value=\\\"\".$context->g(\"begin\").\"\\\" />\";\n $form.=\"<input type=\\\"hidden\\\" name=\\\"length\\\" value=\\\"\".$context->g(\"length\").\"\\\" />\";\n $form.=\"</p></form>\";\n return ($form);\n }",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function escape_reset_course_form_definition(&$mform) {\n $mform->addElement('header', 'escapeheader', get_string('modulenameplural', 'escape'));\n $mform->addElement('advcheckbox', 'reset_escape', get_string('deleteallattempts','escape'));\n $mform->addElement('advcheckbox', 'reset_escape_user_overrides',\n get_string('removealluseroverrides', 'escape'));\n $mform->addElement('advcheckbox', 'reset_escape_group_overrides',\n get_string('removeallgroupoverrides', 'escape'));\n}",
"public static function formKC() {\r\n return new NormalizationForm(\"FormKC\", 5);\r\n }"
] |
[
"0.7792559",
"0.5297224",
"0.50137186",
"0.46945417",
"0.46664774",
"0.46567962",
"0.46560583",
"0.46555126",
"0.4640202",
"0.46049318",
"0.45996198",
"0.45888087",
"0.45336267",
"0.45033967",
"0.4493177",
"0.44893822",
"0.44852194",
"0.4459767",
"0.44463316",
"0.44049907",
"0.44049907",
"0.44049907",
"0.44030488",
"0.44030488",
"0.4392408",
"0.43818998",
"0.43804452",
"0.43748936",
"0.437295",
"0.43715554"
] |
0.85744715
|
0
|
string packCXFORMWITHALPHA(boolean HasAddTerms, integer RedAddTerm, integer GreenAddTerm, integer BlueAddTerm, integer AlphaAddTerm, boolean HasMultTerms, integer RedMultTerm, integer GreenMultTerm, integer BlueMultTerm, integer AlphaMultTerm) returns an SWF CXFORMWITHALPHA atom string.
|
function packCXFORMWITHALPHA($HasAddTerms, $RedAddTerm, $GreenAddTerm, $BlueAddTerm, $AlphaAddTerm, $HasMultTerms, $RedMultTerm, $GreenMultTerm, $BlueMultTerm, $AlphaMultTerm)
{
array_push($this->FMDebug, "packCXFORMWITHALPHA");
if ($HasAddTerms) {
$RedAddTerm = $this->packSBchunk($RedAddTerm);
$GreenAddTerm = $this->packSBchunk($GreenAddTerm);
$BlueAddTerm = $this->packSBchunk($BlueAddTerm);
$AlphaAddTerm = $this->packSBchunk($AlphaAddTerm);
$atom = "1";
} else {
$atom = "0";
}
if ($HasMultTerms) {
$RedMultTerm = $this->packSBchunk($RedMultTerm);
$GreenMultTerm = $this->packSBchunk($GreenMultTerm);
$BlueMultTerm = $this->packSBchunk($BlueMultTerm);
$AlphaMultTerm = $this->packSBchunk($AlphaMultTerm);
$atom .= "1";
} else {
$atom .= "0";
}
if (!(($HasAddTerms == 0) and ($HasMultTerms == 0))) {
$nBits = (int) max(strlen($RedMultTerm), strlen($GreenMultTerm), strlen($BlueMultTerm), strlen($AlphaMultTerm), strlen($RedAddTerm), strlen($GreenAddTerm), strlen($BlueAddTerm), strlen($AlphaAddTerm));
$RedAddTerm = str_repeat(substr($RedAddTerm, 0, 1), $nBits - strlen($RedAddTerm)) . $RedAddTerm;
$GreenAddTerm = str_repeat(substr($GreenAddTerm, 0, 1), $nBits - strlen($GreenAddTerm)) . $GreenAddTerm;
$BlueAddTerm = str_repeat(substr($BlueAddTerm, 0, 1), $nBits - strlen($BlueAddTerm)) . $BlueAddTerm;
$AlphaAddTerm = str_repeat(substr($AlphaAddTerm, 0, 1), $nBits - strlen($AlphaAddTerm)) . $AlphaAddTerm;
$RedMultTerm = str_repeat(substr($RedMultTerm, 0, 1), $nBits - strlen($RedMultTerm)) . $RedMultTerm;
$GreenMultTerm = str_repeat(substr($GreenMultTerm, 0, 1), $nBits - strlen($GreenMultTerm)) . $GreenMultTerm;
$BlueMultTerm = str_repeat(substr($BlueMultTerm, 0, 1), $nBits - strlen($BlueMultTerm)) . $BlueMultTerm;
$AlphaMultTerm = str_repeat(substr($AlphaMultTerm, 0, 1), $nBits - strlen($AlphaMultTerm)) . $AlphaMultTerm;
$atom .= $this->packnBits($nBits, 5);
if ($HasMultTerms == "1") {
$atom .= $RedMultTerm . $GreenMultTerm . $BlueMultTerm . $AlphaMultTerm;
}
if ($HasAddTerms == "1") {
$atom .= $RedAddTerm . $GreenAddTerm . $BlueAddTerm . $AlphaAddTerm;
}
}
$atom = $this->packBitValues($atom);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packCXFORM($HasAddTerms, $RedAddTerm, $GreenAddTerm, $BlueAddTerm, $HasMultTerms, $RedMultTerm, $GreenMultTerm, $BlueMultTerm)\n\t{\n\t\tarray_push($this->FMDebug, \"packCXFORM\");\n\n\t\tif ($HasAddTerms) {\n\n\t\t\t$RedAddTerm = $this->packSBchunk($RedAddTerm);\n\t\t\t$GreenAddTerm = $this->packSBchunk($GreenAddTerm);\n\t\t\t$BlueAddTerm = $this->packSBchunk($BlueAddTerm);\n\n\t\t\t$atom = \"1\";\n\n\t\t} else {\n\n\t\t\t$atom = \"0\";\n\t\t}\n\n\t\tif ($HasMultTerms) {\n\n\t\t\t$RedMultTerm = $this->packSBchunk($RedMultTerm);\n\t\t\t$GreenMultTerm = $this->packSBchunk($GreenMultTerm);\n\t\t\t$BlueMultTerm = $this->packSBchunk($BlueMultTerm);\n\n\t\t\t$atom .= \"1\";\n\n\t\t} else {\n\n\t\t\t$atom .= \"0\";\n\t\t}\n\n\t\tif (!(($HasAddTerms == 0) and ($HasMultTerms == 0))) {\n\n\t\t\t$nBits = (int) max(strlen($RedMultTerm), strlen($GreenMultTerm), strlen($BlueMultTerm), strlen($RedAddTerm), strlen($GreenAddTerm), strlen($BlueAddTerm));\n\n\t\t\t$RedAddTerm = str_repeat(substr($RedAddTerm, 0, 1), $nBits - strlen($RedAddTerm)) . $RedAddTerm;\n\t\t\t$GreenAddTerm = str_repeat(substr($GreenAddTerm, 0, 1), $nBits - strlen($GreenAddTerm)) . $GreenAddTerm;\n\t\t\t$BlueAddTerm = str_repeat(substr($BlueAddTerm, 0, 1), $nBits - strlen($BlueAddTerm)) . $BlueAddTerm;\n\n\t\t\t$RedMultTerm = str_repeat(substr($RedMultTerm, 0, 1), $nBits - strlen($RedMultTerm)) . $RedMultTerm;\n\t\t\t$GreenMultTerm = str_repeat(substr($GreenMultTerm, 0, 1), $nBits - strlen($GreenMultTerm)) . $GreenMultTerm;\n\t\t\t$BlueMultTerm = str_repeat(substr($BlueMultTerm, 0, 1), $nBits - strlen($BlueMultTerm)) . $BlueMultTerm;\n\n\t\t\t$atom .= $this->packnBits($nBits, 5);\n\n\t\t\tif ($HasMultTerms) {\n\n\t\t\t\t$atom .= $RedMultTerm . $GreenMultTerm . $BlueMultTerm;\n\t\t\t}\n\n\t\t\tif ($HasAddTerms) {\n\n\t\t\t\t$atom .= $RedAddTerm . $GreenAddTerm . $BlueAddTerm;\n\t\t\t}\n\n\t\t}\n\n\t\t$atom = $this->packBitValues($atom);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"private function format($a, $b, $c)\n {\n $str = '';\n /* $a */\n if (abs($a) == 1) {\n if ($a < 0) {\n $str .= '-';\n }\n } else {\n $str .= $a;\n }\n $str .= 'X^2';\n /* $b */\n if ($b != 0) {\n if (abs($b) == 1) {\n if ($b > 0) {\n $str .= '+';\n } else {\n $str .= '-';\n }\n } else {\n if ($b > 0) {\n $str .= '+';\n }\n $str .= $b;\n }\n $str .= 'X';\n }\n /* $c */\n if ($c > 0) {\n $str .= '+';\n }\n $str .= $c . '=0';\n\n return $str;\n }",
"function ezafi_form($s) {\n if (substr($s, -2) == \"\\xd9\\x87\") // HEH\n return $s.\"\\xe2\\x80\\x8c\\xdb\\x8c\"; // ZWNJ+YEH\n else\n return $s;\n}",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"private function encode($text) {\n\t\t// 0x1 text frame (FIN + opcode)\n\t\t$b1 = 0x80 | (0x1 & 0x0f);\n\t\t$length = strlen($text);\n\t\t\n\t\tif ($length <= 125) {\n $header = pack('CC', $b1, $length);\n // echo \"pack CC\\n\";\n } elseif ($length > 125 && $length < 65536) {\n\t\t\t$header = pack('CCS', $b1, 126, $length); //original\n // echo \"pack CCS\\n\";\n } elseif($length >= 65536) {\n $header = pack('CCN', $b1, 127, $length);\n // echo \"pack CCN\\n\";\n }\n\t \n\t\treturn $header.$text;\n }",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function Scaffold_hextorgb($hex,$format='preformatted') {\n\t// Regexp for a valid hex digit\n\t$d = '[a-fA-F0-9]';\n\t// Make sure $hex is valid\n\tif (preg_match(\"/^#($d$d)($d$d)($d$d)\\$/\", $hex, $rgb)) {\n\t $rgb_values = hexdec($rgb[1]).','.hexdec($rgb[2]).','.hexdec($rgb[3]);\n\t if ($format != 'preformatted') {\n\t\t return $rgb_values;\n\t }\n\t return 'rgb('.$rgb_values.')';\n\t}\n\tif (preg_match(\"/^($d)($d)($d)$/\", $hex, $rgb)) {\n\t $rgb_values = hexdec($rgb[1] . $rgb[1]).','.hexdec($rgb[2] . $rgb[2]).','.hexdec($rgb[3] . $rgb[3]);\n\t\tif ($format != 'preformatted') {\n\t\t return $rgb_values;\n\t }\n\t return 'rgb('.$rgb_values.')';\n\t}\n\treturn $hex;\n}",
"function packstr( &$out )\n{\n $args = func_num_args();\n for ( $i = 1; $i < $args; $i++ )\n {\n $str = func_get_arg( $i ); \n $out .= pack( 'Ca*', strlen( $str ), $str );\n }\n}",
"function encode($text) {\n $b1 = 0x80 | (0x1 & 0x0f);\n $length = strlen($text);\n\n if ($length <= 125)\n $header = pack('CC', $b1, $length);\n elseif($length > 125 && $length < 65536)$header = pack('CCS', $b1, 126, $length);\n elseif($length >= 65536)\n $header = pack('CCN', $b1, 127, $length);\n\n return $header.$text;\n}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function htheme_contact_shortcode( $atts ) {\r\n\r\n\t\t#SETUP CONTENT CLASS\r\n\t\t$htheme_data = $this->htheme_content->htheme_get_contact_form($atts);\r\n\r\n\t\t#RETURN DATA/HTML\r\n\t\treturn $htheme_data;\r\n\r\n\t}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"public static function formC() {\r\n return new NormalizationForm(\"FormC\", 4);\r\n }",
"function xoft_encode($plain_data,$key){\r\n\r\n $key_length=0; //key length counter\r\n $all_bin_chars=\"\";\r\n $cipher_data=\"\";\r\n\r\n for($i=0;$i<mb_strlen($plain_data);$i++){\r\n\t$p=mb_substr($plain_data,$i,1); // p = plaintext\r\n\t$k=mb_substr($key,$key_length,1); // k = key\r\n\t$key_length++;\r\n\r\n\tif($key_length>=mb_strlen($key)){\r\n\t\t$key_length=0;\r\n\t}\r\n\r\n\t$dec_chars=ord($p)^ord($k);\r\n\t$dec_chars=$dec_chars + mb_strlen($key);\r\n\t$bin_chars=decbin($dec_chars);\r\n\r\n\twhile(mb_strlen($bin_chars)<8){\r\n\t\t$bin_chars=\"0\".$bin_chars;\r\n\t}\r\n\r\n\t$all_bin_chars=$all_bin_chars.$bin_chars;\r\n\r\n }\r\n\r\n $m=0;\r\n\r\n for($j=0;$j<mb_strlen($all_bin_chars);$j=$j+4){\r\n\t$four_bit=mb_substr($all_bin_chars,$j,4); // split 8 bit to 4 bit\r\n\t$four_bit_dec=bindec($four_bit);\r\n\r\n\t$decimal_value=$four_bit_dec * 4 + $m; //multiply by 4 plus m where m=0,1,2, or 3\r\n\r\n\t$base64_value=dectobase64($decimal_value); //convert to base64 value\r\n\t$cipher_data=$cipher_data.$base64_value;\r\n\t$m++;\r\n\r\n\tif($m>3){\r\n\t\t$m=0;\r\n\t}\r\n }\r\n\r\n return $cipher_data;\r\n}",
"function form_shortcode( $atts ) {\n \n if ( isset( $atts['form'] ) ) {\n \n $form_id_or_key = $atts['form'];\n unset( $atts['form'] );\n \n ob_start();\n \n $this->render( $form_id_or_key, $atts );\n \n $output = ob_get_clean();\n \n return $output;\n \n }\n \n }",
"function build() {\n\t\treturn parent::build(CATEGORY_SYMBOLIC, 0, 0);\n\t}",
"function createHexaWords(string $word, string $verseId, int &$key, array &$verseWords, string $strongsNum = ''): void {\n $nonWordPattern = nonwordRegexPattern();\n if (preg_match(\"/^($nonWordPattern)+$/u\", $word, $matches) === 1) {\n if (in_array($matches[0], hexaPunctuation::OPENERS)) {\n $ending = false;\n } else {\n $ending = true;\n }\n $newWord = new hexaPunctuation($verseId, $matches[0], $key++, '', '', $ending);\n $verseWords[] = $newWord;\n return;\n }\n if (preg_match(\"/^($nonWordPattern)+/u\", $word, $matches) === 1) {\n $newWord = new hexaPunctuation($verseId, $matches[0], $key++, '', '', false);\n $verseWords[] = $newWord;\n }\n $trimPattern = \"($nonWordPattern|\\s)\";\n $wordOnly = preg_replace(\"/(^$trimPattern*)|($trimPattern*$)/u\", '', $word);\n if (utf8_strlen($wordOnly) > 0) {\n $newWord = new hexaWord($verseId, $wordOnly, $key++, $strongsNum, '');\n $verseWords[] = $newWord;\n }\n if (preg_match(\"/($nonWordPattern)+$/u\", $word, $matches) === 1) {\n $newWord = new hexaPunctuation($verseId, $matches[0], $key++);\n $verseWords[] = $newWord;\n }\n}",
"function pt_shortcode( $atts )\n\t\t{\n\t\t\treturn $this->pt_show_blc_front();\n\t\t}",
"function mf_complemento_ecc11($datos)\n{\n global $__mf_namespaces__;\n $__mf_namespaces__['ecc11']['uri'] = 'http://www.sat.gob.mx/EstadoDeCuentaCombustible';\n $__mf_namespaces__['ecc11']['xsd'] = 'http://www.sat.gob.mx/sitio_internet/cfd/EstadoDeCuentaCombustible/ecc11.xsd';\n\n $atrs = mf_atributos_nodo($datos);\n $xml = \"<ecc11:EstadoDeCuentaCombustible Version='1.1' $atrs>\";\n\tif(isset($datos['Conceptos']))\n\t{\n\t\t$atrs = mf_atributos_nodo($datos['Conceptos']);\n\t\t$xml .= \"<ecc11:Conceptos $atrs>\";\n\t\tforeach($datos['Conceptos'] as $idx =>$entidad)\n\t\t{\n\t\t\tif(is_array($datos['Conceptos'][$idx]))\n\t\t\t{\n\t\t\t\t$atrs = mf_atributos_nodo($entidad);\n\t\t\t\t$xml .= \"<ecc11:ConceptoEstadoDeCuentaCombustible $atrs>\";\n\t\t\t\tif(isset($entidad['Traslados']))\n\t\t\t\t{\n\t\t\t\t\t$atrs = mf_atributos_nodo($entidad['Traslados']);\n\t\t\t\t\t$xml .= \"<ecc11:Traslados $atrs>\";\n\t\t\t\t\tforeach($entidad['Traslados'] as $idx2 =>$det)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(is_array($entidad['Traslados'][$idx2]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$atrs = mf_atributos_nodo($det);\n\t\t\t\t\t\t\t$xml .= \"<ecc11:Traslado $atrs/>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$xml .= \"</ecc11:Traslados>\";\n\t\t\t\t}\n\t\t\t\t$xml .= \"</ecc11:ConceptoEstadoDeCuentaCombustible>\";\n\t\t\t}\n\t\t}\n\t\t$xml .= \"</ecc11:Conceptos>\";\n\t}\n\t$xml .= \"</ecc11:EstadoDeCuentaCombustible>\";\n return $xml;\n}",
"function _putformxobjects() {\n $filter=($this->compress) ? '/Filter /FlateDecode ' : '';\n\t reset($this->tpls);\n foreach($this->tpls AS $tplidx => $tpl) {\n\n $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];\n \t\t$this->_newobj();\n \t\t$this->tpls[$tplidx]['n'] = $this->n;\n \t\t$this->_out('<<'.$filter.'/Type /XObject');\n $this->_out('/Subtype /Form');\n $this->_out('/FormType 1');\n $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',\n // llx\n $tpl['x'] * $this->k,\n // lly\n -$tpl['y'] * $this->k,\n // urx\n ($tpl['w'] + $tpl['x']) * $this->k,\n // ury\n ($tpl['h'] - $tpl['y']) * $this->k\n ));\n \n if ($tpl['x'] != 0 || $tpl['y'] != 0) {\n $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]',\n -$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2\n ));\n }\n \n $this->_out('/Resources ');\n\n $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');\n \tif (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {\n \t$this->_out('/Font <<');\n foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)\n \t\t$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');\n \t$this->_out('>>');\n }\n \tif(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || \n \t isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))\n \t{\n $this->_out('/XObject <<');\n if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {\n foreach($this->_res['tpl'][$tplidx]['images'] as $image)\n \t\t\t$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');\n }\n if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {\n foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)\n $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');\n }\n $this->_out('>>');\n \t}\n \t$this->_out('>>');\n \t\n \t$this->_out('/Length ' . strlen($p) . ' >>');\n \t\t$this->_putstream($p);\n \t\t$this->_out('endobj');\n }\n }",
"function printLetter($params)\n{\n extract($params);\n if ($value == \"1\") {\n $form = \"Interview\";\n } elseif ($value == \"2\") {\n $form = \"Driver\";\n } else {\n $form = \"\";\n }\n return $form;\n}",
"function acf_get_encoded_terms($values)\n{\n}"
] |
[
"0.7611623",
"0.4752848",
"0.45876986",
"0.4581715",
"0.45489585",
"0.45030707",
"0.44790882",
"0.44581077",
"0.44271913",
"0.4424195",
"0.44073224",
"0.4394092",
"0.43929133",
"0.4373154",
"0.4371239",
"0.43618944",
"0.43591142",
"0.43537766",
"0.43537766",
"0.43537766",
"0.4344394",
"0.4336062",
"0.43245688",
"0.43236727",
"0.43055132",
"0.4271372",
"0.4271289",
"0.42689866",
"0.42562333",
"0.42372882"
] |
0.8745822
|
0
|
// // Compound data types // // // string packZLIBBITMAPDATA(string ColorTableRGB, string BitmapPixelData) returns an SWF ZLIBBITMAPDATA string.
|
function packZLIBBITMAPDATA($ColorTableRGB, $BitmapPixelData)
{
array_push($this->FMDebug, "packZLIBBITMAPDATA");
$atom = $ColorTableRGB . $BitmapPixelData;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packZLIBBITMAPDATA2($ColorTableRGBA, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA2\");\n\n\t\t$atom = $ColorTableRGBA . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function _get_ico_data() {\n\t\tif ( ! is_array( $this->_images ) || empty( $this->_images ) )\n\t\t\treturn false;\n\t\t\n\t\t\n\t\t$data = pack( 'vvv', 0, 1, count( $this->_images ) );\n\t\t$pixel_data = '';\n\t\t\n\t\t$icon_dir_entry_size = 16;\n\t\t\n\t\t$offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) );\n\t\t\n\t\tforeach ( $this->_images as $image ) {\n\t\t\t$data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset );\n\t\t\t$pixel_data .= $image['data'];\n\t\t\t\n\t\t\t$offset += $image['size'];\n\t\t}\n\t\t\n\t\t$data .= $pixel_data;\n\t\tunset( $pixel_data );\n\t\t\n\t\t\n\t\treturn $data;\n\t}",
"public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}",
"function _add_image_data( $im ) {\n\t\t$width = imagesx( $im );\n\t\t$height = imagesy( $im );\n\t\t\n\t\t\n\t\t$pixel_data = array();\n\t\t\n\t\t$opacity_data = array();\n\t\t$current_opacity_val = 0;\n\t\t\n\t\tfor ( $y = $height - 1; $y >= 0; $y-- ) {\n\t\t\tfor ( $x = 0; $x < $width; $x++ ) {\n\t\t\t\t$color = imagecolorat( $im, $x, $y );\n\t\t\t\t\n\t\t\t\t$alpha = ( $color & 0x7F000000 ) >> 24;\n\t\t\t\t$alpha = ( 1 - ( $alpha / 127 ) ) * 255;\n\t\t\t\t\n\t\t\t\t$color &= 0xFFFFFF;\n\t\t\t\t$color |= 0xFF000000 & ( $alpha << 24 );\n\t\t\t\t\n\t\t\t\t$pixel_data[] = $color;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$opacity = ( $alpha <= 127 ) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t$current_opacity_val = ( $current_opacity_val << 1 ) | $opacity;\n\t\t\t\t\n\t\t\t\tif ( ( ( $x + 1 ) % 32 ) == 0 ) {\n\t\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t\t$current_opacity_val = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ( $x % 32 ) > 0 ) {\n\t\t\t\twhile ( ( $x++ % 32 ) > 0 )\n\t\t\t\t\t$current_opacity_val = $current_opacity_val << 1;\n\t\t\t\t\n\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t$current_opacity_val = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$image_header_size = 40;\n\t\t$color_mask_size = $width * $height * 4;\n\t\t$opacity_mask_size = ( ceil( $width / 32 ) * 4 ) * $height;\n\t\t\n\t\t\n\t\t$data = pack( 'VVVvvVVVVVV', 40, $width, ( $height * 2 ), 1, 32, 0, 0, 0, 0, 0, 0 );\n\t\t\n\t\tforeach ( $pixel_data as $color )\n\t\t\t$data .= pack( 'V', $color );\n\t\t\n\t\tforeach ( $opacity_data as $opacity )\n\t\t\t$data .= pack( 'N', $opacity );\n\t\t\n\t\t\n\t\t$image = array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'color_palette_colors' => 0,\n\t\t\t'bits_per_pixel' => 32,\n\t\t\t'size' => $image_header_size + $color_mask_size + $opacity_mask_size,\n\t\t\t'data' => $data,\n\t\t);\n\t\t\n\t\t$this->_images[] = $image;\n\t}",
"function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function xlsBOF() {\r\n return pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \r\n \r\n}",
"public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function png_encode_chunk($type, $data)\n{\n\treturn pack('N', strlen($data)) . $type . $data . pack('N', crc32($type.$data));\n}",
"function packJPEGTablesTag($BitmapJPEGEncoding)\n\t{\n\t\tarray_push($this->FMDebug, \"packJPEGTablesTag\");\n\n\t\t$TagID = 8;\n\t\t$TagLength = strlen($BitmapJPEGEncoding);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function addFile($data, $directoryName) {\r\n\r\n $directoryName = str_replace(\"\\\\\", \"/\", $directoryName); \r\n \r\n $feedArrayRow = \"\\x50\\x4b\\x03\\x04\";\r\n $feedArrayRow .= \"\\x14\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\"; \r\n $feedArrayRow .= \"\\x08\\x00\"; \r\n $feedArrayRow .= \"\\x00\\x00\\x00\\x00\";\r\n\r\n $uncompressedLength = strlen($data); \r\n $compression = crc32($data); \r\n $gzCompressedData = gzcompress($data); \r\n $gzCompressedData = substr( substr($gzCompressedData, 0, strlen($gzCompressedData) - 4), 2);\r\n $compressedLength = strlen($gzCompressedData); \r\n $feedArrayRow .= pack(\"V\",$compression);\r\n $feedArrayRow .= pack(\"V\",$compressedLength);\r\n $feedArrayRow .= pack(\"V\",$uncompressedLength);\r\n $feedArrayRow .= pack(\"v\", strlen($directoryName) );\r\n $feedArrayRow .= pack(\"v\", 0 );\r\n $feedArrayRow .= $directoryName; \r\n\r\n $feedArrayRow .= $gzCompressedData; \r\n\r\n $feedArrayRow .= pack(\"V\",$compression);\r\n $feedArrayRow .= pack(\"V\",$compressedLength);\r\n $feedArrayRow .= pack(\"V\",$uncompressedLength);\r\n\r\n $this -> compressedData[] = $feedArrayRow;\r\n\r\n $newOffset = strlen(implode(\"\", $this->compressedData));\r\n\r\n $addCentralRecord = \"\\x50\\x4b\\x01\\x02\";\r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x14\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\"; \r\n $addCentralRecord .=\"\\x08\\x00\"; \r\n $addCentralRecord .=\"\\x00\\x00\\x00\\x00\";\r\n $addCentralRecord .= pack(\"V\",$compression);\r\n $addCentralRecord .= pack(\"V\",$compressedLength);\r\n $addCentralRecord .= pack(\"V\",$uncompressedLength);\r\n $addCentralRecord .= pack(\"v\", strlen($directoryName) );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"v\", 0 );\r\n $addCentralRecord .= pack(\"V\", 32 );\r\n\r\n $addCentralRecord .= pack(\"V\", $this -> oldOffset );\r\n $this -> oldOffset = $newOffset;\r\n\r\n $addCentralRecord .= $directoryName; \r\n\r\n $this -> centralDirectory[] = $addCentralRecord; \r\n }",
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public static function bitMapToArray($data)\n {\n if (strlen($data) == 0) {\n return null;\n }\n\n $output = array();\n $offset = 0;\n $length = strlen($data);\n\n while ($offset < $length) {\n \n //\n // unpack the window and length values\n //\n $x = unpack('@' . $offset . '/Cwindow/Clength', $data);\n $offset += 2;\n\n //\n // copy out the bitmap value\n //\n $bitmap = unpack('C*', substr($data, $offset, $x['length']));\n $offset += $x['length'];\n\n //\n // I'm not sure if there's a better way of doing this, but PHP doesn't\n // have a 'B' flag for unpack()\n //\n $bitstr = '';\n foreach ($bitmap as $r) {\n \n $bitstr .= sprintf('%08b', $r);\n }\n\n $blen = strlen($bitstr);\n for ($i=0; $i<$blen; $i++) {\n\n if ($bitstr[$i] == '1') {\n \n $type = $x['window'] * 256 + $i;\n\n if (isset(Net_DNS2_Lookups::$rr_types_by_id[$type])) {\n\n $output[] = Net_DNS2_Lookups::$rr_types_by_id[$type];\n } else {\n\n $output[] = 'TYPE' . $type;\n }\n }\n }\n }\n\n return $output;\n }",
"function apng_encode($width, $height, $pixels)\n{\n\t$data = \"\\x00\" . implode(\"\\x00\", str_split($pixels, 4 * $width));\n\t$png = \"\\x89PNG\\r\\n\\x1a\\n\";\n\t$png .= png_encode_chunk('IHDR', pack('N2C5', $width, $height, 8, 6, 0, 0, 0));\n\t$png .= png_encode_chunk('acTL', pack('N2', 1, 1));\n\t$png .= png_encode_chunk('fcTL', pack('N5n2C2', 0, $width, $height, 0, 0, 0, 0, 0, 1));\n\t$png .= png_encode_chunk('IDAT', zlib_encode($data, ZLIB_ENCODING_DEFLATE));\n\t$png .= png_encode_chunk('IEND', '');\n\treturn $png;\n}",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}",
"function get_png_imageinfo($file) {\n\tif (empty($file)) return false;\n\n\t$info = unpack('A8sig/Nchunksize/A4chunktype/Nwidth/Nheight/Cbit-depth/'.\n 'Ccolor/Ccompression/Cfilter/Cinterface', \n\t\tfile_get_contents($file,0,null,0,29))\n\t\t;\n\n\tif (empty($info)) return false;\n\n\tif (\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\"!=array_shift($info))\n\t\treturn false; // no PNG signature.\n\n\tif (13 != array_shift($info))\n\t\treturn false; // wrong length for IHDR chunk.\n\n\tif ('IHDR'!==array_shift($info))\n\t\treturn false; // a non-IHDR chunk singals invalid data.\n\n\t$color = $info['color'];\n\n\t$type = array(0=>'Greyscale', 2=>'Truecolour', 3=>'Indexed-colour',\n\t4=>'Greyscale with alpha', 6=>'Truecolour with alpha');\n\n\tif (empty($type[$color]))\n\t\treturn false; // invalid color value\n\n\t$info['color-type'] = $type[$color];\n\n\t$samples = ((($color%4)%3)?3:1)+($color>3);\n\n\t$info['channels'] = $samples;\n\t$info['bits'] = $info['bit-depth'];\n\n\treturn $info;\n}",
"function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"function xlsWriteLabel($Row, $Col, $Value ) {\r\n$L = strlen($Value);\r\necho pack(\"ssssss\", 0x204, 8 + $L, $Row, $Col, 0x0, $L);\r\necho $Value;\r\nreturn;\r\n}",
"function combineVMU($bw, $color)\n{\n $bwHandle = fopen('.//upload//' . $bw . '//ICONDATA.VMS', 'r');\n $colorHandle = fopen('.//upload//' . $color . '//ICONDATA.VMS', 'r');\n $bwHeaderAndImage = stream_get_contents($bwHandle, 160, $offset = 0);\n $colorImage = stream_get_contents($colorHandle, $length = 864, $offset = 160);\n fclose($bwHandle);\n fclose($colorHandle);\n\n $finalBuffer = $bwHeaderAndImage . $colorImage;\n if (!file_exists('.//upload//' . $bw . '_')) {\n mkdir('.//upload//' . $bw . '_');\n }\n $moshHandle = fopen('.//upload//' . $bw . '_//ICONDATA.VMS', 'c+');\n copy('.//upload//' . $bw . '//ICONDATA.VMI', './/upload//' . $bw . '_//ICONDATA.VMI');\n\n $bytes_written = false;\n $bytes_written = fwrite($moshHandle, $finalBuffer, 1024);\n fclose($moshHandle);\n\n createZipAndDownload('.//' . $bw . '_//');\n}",
"public static function arrayToBitMap(array $data)\n {\n if (count($data) == 0) {\n return null;\n }\n\n $current_window = 0;\n\n //\n // go through each RR\n //\n $max = 0;\n $bm = array();\n\n foreach ($data as $rr) {\n \n $rr = strtoupper($rr);\n\n //\n // get the type id for the RR\n //\n $type = @Net_DNS2_Lookups::$rr_types_by_name[$rr];\n if (isset($type)) {\n\n //\n // skip meta types or qtypes\n // \n if ( (isset(Net_DNS2_Lookups::$rr_qtypes_by_id[$type]))\n || (isset(Net_DNS2_Lookups::$rr_metatypes_by_id[$type]))\n ) {\n continue;\n }\n\n } else {\n\n //\n // if it's not found, then it must be defined as TYPE<id>, per\n // RFC3845 section 2.2, if it's not, we ignore it.\n //\n list($name, $type) = explode('TYPE', $rr);\n if (!isset($type)) {\n\n continue;\n }\n }\n\n //\n // build the current window\n //\n $current_window = (int)($type / 256);\n \n $val = $type - $current_window * 256.0;\n if ($val > $max) {\n $max = $val;\n }\n\n $bm[$current_window][$val] = 1;\n $bm[$current_window]['length'] = ceil(($max + 1) / 8);\n }\n\n $output = '';\n\n foreach ($bm as $window => $bitdata) {\n\n $bitstr = '';\n\n for ($i=0; $i<$bm[$window]['length'] * 8; $i++) {\n if (isset($bm[$window][$i])) {\n $bitstr .= '1';\n } else {\n $bitstr .= '0';\n }\n }\n\n $output .= pack('CC', $window, $bm[$window]['length']);\n $output .= pack('H*', self::bigBaseConvert($bitstr));\n }\n\n return $output;\n }",
"private function _hex2bin ($data)\r\n\t{\r\n\t\t$len = strlen ($data);\r\n\t\treturn pack (\"H\" . $len, $data);\r\n\t}"
] |
[
"0.7680287",
"0.61073524",
"0.609357",
"0.6044502",
"0.58287084",
"0.5696682",
"0.56885993",
"0.530152",
"0.5264529",
"0.5205254",
"0.51832974",
"0.517483",
"0.5144551",
"0.5140277",
"0.5140277",
"0.5140277",
"0.5098841",
"0.5083123",
"0.507336",
"0.50733316",
"0.4983174",
"0.497115",
"0.49080777",
"0.48918572",
"0.4874188",
"0.48680645",
"0.48444462",
"0.47649488",
"0.47368318",
"0.46971405"
] |
0.81324923
|
0
|
string packZLIBBITMAPDATA2( string ColorTableRGBA, string BitmapPixelData) returns an SWF ZLIBBITMAPDATA2 string.
|
function packZLIBBITMAPDATA2($ColorTableRGBA, $BitmapPixelData)
{
array_push($this->FMDebug, "packZLIBBITMAPDATA2");
$atom = $ColorTableRGBA . $BitmapPixelData;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packZLIBBITMAPDATA($ColorTableRGB, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA\");\n\n\t\t$atom = $ColorTableRGB . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}",
"public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }",
"function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}",
"function _get_ico_data() {\n\t\tif ( ! is_array( $this->_images ) || empty( $this->_images ) )\n\t\t\treturn false;\n\t\t\n\t\t\n\t\t$data = pack( 'vvv', 0, 1, count( $this->_images ) );\n\t\t$pixel_data = '';\n\t\t\n\t\t$icon_dir_entry_size = 16;\n\t\t\n\t\t$offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) );\n\t\t\n\t\tforeach ( $this->_images as $image ) {\n\t\t\t$data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset );\n\t\t\t$pixel_data .= $image['data'];\n\t\t\t\n\t\t\t$offset += $image['size'];\n\t\t}\n\t\t\n\t\t$data .= $pixel_data;\n\t\tunset( $pixel_data );\n\t\t\n\t\t\n\t\treturn $data;\n\t}",
"public static function bitMapToArray($data)\n {\n if (strlen($data) == 0) {\n return null;\n }\n\n $output = array();\n $offset = 0;\n $length = strlen($data);\n\n while ($offset < $length) {\n \n //\n // unpack the window and length values\n //\n $x = unpack('@' . $offset . '/Cwindow/Clength', $data);\n $offset += 2;\n\n //\n // copy out the bitmap value\n //\n $bitmap = unpack('C*', substr($data, $offset, $x['length']));\n $offset += $x['length'];\n\n //\n // I'm not sure if there's a better way of doing this, but PHP doesn't\n // have a 'B' flag for unpack()\n //\n $bitstr = '';\n foreach ($bitmap as $r) {\n \n $bitstr .= sprintf('%08b', $r);\n }\n\n $blen = strlen($bitstr);\n for ($i=0; $i<$blen; $i++) {\n\n if ($bitstr[$i] == '1') {\n \n $type = $x['window'] * 256 + $i;\n\n if (isset(Net_DNS2_Lookups::$rr_types_by_id[$type])) {\n\n $output[] = Net_DNS2_Lookups::$rr_types_by_id[$type];\n } else {\n\n $output[] = 'TYPE' . $type;\n }\n }\n }\n }\n\n return $output;\n }",
"public function packerTwoPack($data)\n {\n $encoded = base64_encode($data);\n\n // Separa em dois pedaços\n $partOne = mb_substr($encoded, 0, 5, \"utf-8\");\n $partTwo = mb_substr($encoded, 5, null, \"utf-8\");\n\n // Insere 'Sg' para invalidar o base64\n return $partOne . 'Sg' . $partTwo;\n }",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function packerTwoUnpack(string $data): string\n {\n // Separa em dois pedaços\n $partOne = mb_substr($data, 0, 5, \"utf-8\");\n $partTwo = mb_substr($data, 7, null, \"utf-8\");\n return base64_decode($partOne . $partTwo);\n }",
"function _add_image_data( $im ) {\n\t\t$width = imagesx( $im );\n\t\t$height = imagesy( $im );\n\t\t\n\t\t\n\t\t$pixel_data = array();\n\t\t\n\t\t$opacity_data = array();\n\t\t$current_opacity_val = 0;\n\t\t\n\t\tfor ( $y = $height - 1; $y >= 0; $y-- ) {\n\t\t\tfor ( $x = 0; $x < $width; $x++ ) {\n\t\t\t\t$color = imagecolorat( $im, $x, $y );\n\t\t\t\t\n\t\t\t\t$alpha = ( $color & 0x7F000000 ) >> 24;\n\t\t\t\t$alpha = ( 1 - ( $alpha / 127 ) ) * 255;\n\t\t\t\t\n\t\t\t\t$color &= 0xFFFFFF;\n\t\t\t\t$color |= 0xFF000000 & ( $alpha << 24 );\n\t\t\t\t\n\t\t\t\t$pixel_data[] = $color;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$opacity = ( $alpha <= 127 ) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t$current_opacity_val = ( $current_opacity_val << 1 ) | $opacity;\n\t\t\t\t\n\t\t\t\tif ( ( ( $x + 1 ) % 32 ) == 0 ) {\n\t\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t\t$current_opacity_val = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( ( $x % 32 ) > 0 ) {\n\t\t\t\twhile ( ( $x++ % 32 ) > 0 )\n\t\t\t\t\t$current_opacity_val = $current_opacity_val << 1;\n\t\t\t\t\n\t\t\t\t$opacity_data[] = $current_opacity_val;\n\t\t\t\t$current_opacity_val = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$image_header_size = 40;\n\t\t$color_mask_size = $width * $height * 4;\n\t\t$opacity_mask_size = ( ceil( $width / 32 ) * 4 ) * $height;\n\t\t\n\t\t\n\t\t$data = pack( 'VVVvvVVVVVV', 40, $width, ( $height * 2 ), 1, 32, 0, 0, 0, 0, 0, 0 );\n\t\t\n\t\tforeach ( $pixel_data as $color )\n\t\t\t$data .= pack( 'V', $color );\n\t\t\n\t\tforeach ( $opacity_data as $opacity )\n\t\t\t$data .= pack( 'N', $opacity );\n\t\t\n\t\t\n\t\t$image = array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'color_palette_colors' => 0,\n\t\t\t'bits_per_pixel' => 32,\n\t\t\t'size' => $image_header_size + $color_mask_size + $opacity_mask_size,\n\t\t\t'data' => $data,\n\t\t);\n\t\t\n\t\t$this->_images[] = $image;\n\t}",
"function get_png_imageinfo($file) {\n\tif (empty($file)) return false;\n\n\t$info = unpack('A8sig/Nchunksize/A4chunktype/Nwidth/Nheight/Cbit-depth/'.\n 'Ccolor/Ccompression/Cfilter/Cinterface', \n\t\tfile_get_contents($file,0,null,0,29))\n\t\t;\n\n\tif (empty($info)) return false;\n\n\tif (\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\"!=array_shift($info))\n\t\treturn false; // no PNG signature.\n\n\tif (13 != array_shift($info))\n\t\treturn false; // wrong length for IHDR chunk.\n\n\tif ('IHDR'!==array_shift($info))\n\t\treturn false; // a non-IHDR chunk singals invalid data.\n\n\t$color = $info['color'];\n\n\t$type = array(0=>'Greyscale', 2=>'Truecolour', 3=>'Indexed-colour',\n\t4=>'Greyscale with alpha', 6=>'Truecolour with alpha');\n\n\tif (empty($type[$color]))\n\t\treturn false; // invalid color value\n\n\t$info['color-type'] = $type[$color];\n\n\t$samples = ((($color%4)%3)?3:1)+($color>3);\n\n\t$info['channels'] = $samples;\n\t$info['bits'] = $info['bit-depth'];\n\n\treturn $info;\n}",
"private static function decodeFilterLZWDecode($data){\n\t\t// intialize string to return\n\t\t$decoded = '';\n\t\t// data length\n\t\t$data_length = strlen($data);\n\t\t// convert string to binary string\n\t\t$bitstring = '';\n\t\tfor($i = 0; $i < $data_length; ++$i){\n\t\t\t$bitstring .= sprintf('%08b', ord($data{$i}));\n\t\t}\n\t\t// get the number of bits\n\t\t$data_length = strlen($bitstring);\n\t\t// initialize code length in bits\n\t\t$bitlen = 9;\n\t\t// initialize dictionary index\n\t\t$dix = 258;\n\t\t// initialize the dictionary (with the first 256 entries).\n\t\t$dictionary = array();\n\t\tfor($i = 0; $i < 256; ++$i){\n\t\t\t$dictionary[$i] = chr($i);\n\t\t}\n\t\t// previous val\n\t\t$prev_index = 0;\n\t\t// while we encounter EOD marker (257), read code_length bits\n\t\twhile(($data_length > 0) AND ( ($index = bindec(substr($bitstring, 0, $bitlen))) != 257)){\n\t\t\t// remove read bits from string\n\t\t\t$bitstring = substr($bitstring, $bitlen);\n\t\t\t// update number of bits\n\t\t\t$data_length -= $bitlen;\n\t\t\tif($index == 256){ // clear-table marker\n\t\t\t\t// reset code length in bits\n\t\t\t\t$bitlen = 9;\n\t\t\t\t// reset dictionary index\n\t\t\t\t$dix = 258;\n\t\t\t\t$prev_index = 256;\n\t\t\t\t// reset the dictionary (with the first 256 entries).\n\t\t\t\t$dictionary = array();\n\t\t\t\tfor($i = 0; $i < 256; ++$i){\n\t\t\t\t\t$dictionary[$i] = chr($i);\n\t\t\t\t}\n\t\t\t} elseif($prev_index == 256){\n\t\t\t\t// first entry\n\t\t\t\t$decoded .= $dictionary[$index];\n\t\t\t\t$prev_index = $index;\n\t\t\t} else {\n\t\t\t\t// check if index exist in the dictionary\n\t\t\t\tif($index < $dix){\n\t\t\t\t\t// index exist on dictionary\n\t\t\t\t\t$decoded .= $dictionary[$index];\n\t\t\t\t\t$dic_val = $dictionary[$prev_index] . $dictionary[$index]{0};\n\t\t\t\t\t// store current index\n\t\t\t\t\t$prev_index = $index;\n\t\t\t\t} else {\n\t\t\t\t\t// index do not exist on dictionary\n\t\t\t\t\t$dic_val = $dictionary[$prev_index] . $dictionary[$prev_index]{0};\n\t\t\t\t\t$decoded .= $dic_val;\n\t\t\t\t}\n\t\t\t\t// update dictionary\n\t\t\t\t$dictionary[$dix] = $dic_val;\n\t\t\t\t++$dix;\n\t\t\t\t// change bit length by case\n\t\t\t\tif($dix == 2047){\n\t\t\t\t\t$bitlen = 12;\n\t\t\t\t} elseif($dix == 1023){\n\t\t\t\t\t$bitlen = 11;\n\t\t\t\t} elseif($dix == 511){\n\t\t\t\t\t$bitlen = 10;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $decoded;\n\t}",
"protected function bitmap2bytemap($bitmap,$width,$height) \r\n { \r\n $bytemap=array(); \r\n for ($j=0;$j<$height;++$j) \r\n { \r\n for ($i=0;$i<$width/8;++$i) \r\n { \r\n $bitstring=\"\"; \r\n for ($k=0;$k<8;++$k) \r\n if (isset($bitmap[$j][$i*8+$k])) \r\n $bitstring.=$bitmap[$j][$i*8+$k]; \r\n else \r\n $bitstring.=\"1\"; \r\n $bytemap[$j][]=bindec($bitstring); \r\n } \r\n } \r\n return $bytemap; \r\n }",
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"function _parsepng($file)\n\t\t{\n\t\t\t$f=fopen($file,'rb');\n\t\t\t//Extract info from a PNG file\n\t\t\tif(!$f)\t$this->Error('Can\\'t open image file: '.$file);\n\t\t\t//Check signature\n\t\t\tif(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))\n\t\t\t\t$this->Error('Not a PNG file: '.$file);\n\t\t\t//Read header chunk\n\t\t\tfread($f,4);\n\t\t\tif(fread($f,4)!='IHDR')\t$this->Error('Incorrect PNG file: '.$file);\n\t\t\t$w=$this->_freadint($f);\n\t\t\t$h=$this->_freadint($f);\n\t\t\t$bpc=ord(fread($f,1));\n\t\t\tif($bpc>8) $this->Error('16-bit depth not supported: '.$file);\n\t\t\t$ct=ord(fread($f,1));\n\t\t\tif($ct==0) $colspace='DeviceGray';\n\t\t\telseif($ct==2) $colspace='DeviceRGB';\n\t\t\telseif($ct==3) $colspace='Indexed';\n\t\t\telse $this->Error('Alpha channel not supported: '.$file);\n\t\t\tif(ord(fread($f,1))!=0)\t$this->Error('Unknown compression method: '.$file);\n\t\t\tif(ord(fread($f,1))!=0)\t$this->Error('Unknown filter method: '.$file);\n\t\t\tif(ord(fread($f,1))!=0)\t$this->Error('Interlacing not supported: '.$file);\n\t\t\tfread($f,4);\n\t\t\t$parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';\n\t\t\t//Scan chunks looking for palette, transparency and image data\n\t\t\t$pal='';\n\t\t\t$trns='';\n\t\t\t$data='';\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$n=$this->_freadint($f);\n\t\t\t\t$type=fread($f,4);\n\t\t\t\tif($type=='PLTE')\n\t\t\t\t{\n\t\t\t\t\t//Read palette\n\t\t\t\t\t$pal=fread($f,$n);\n\t\t\t\t\tfread($f,4);\n\t\t\t\t}\n\t\t\t\telseif($type=='tRNS')\n\t\t\t\t{\n\t\t\t\t\t//Read transparency info\n\t\t\t\t\t$t=fread($f,$n);\n\t\t\t\t\tif($ct==0) $trns=array(ord(substr($t,1,1)));\n\t\t\t\t\telseif($ct==2) $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos=strpos($t,chr(0));\n\t\t\t\t\t\tif(is_int($pos)) $trns=array($pos);\n\t\t\t\t\t}\n\t\t\t\t\tfread($f,4);\n\t\t\t\t}\n\t\t\t\telseif($type=='IDAT')\n\t\t\t\t{\n\t\t\t\t\t//Read image data block\n\t\t\t\t\t$data.=fread($f,$n);\n\t\t\t\t\tfread($f,4);\n\t\t\t\t}\n\t\t\t\telseif($type=='IEND')\tbreak;\n\t\t\t\telse fread($f,$n+4);\n\t\t\t}\n\t\t\twhile($n);\n\t\t\tif($colspace=='Indexed' and empty($pal)) $this->Error('Missing palette in '.$file);\n\t\t\tfclose($f);\n\t\t\treturn array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);\n\t\t}",
"public function packerOneUnpack(string $data): string\n {\n // Separa em dois pedaços\n $partOne = mb_substr($data, 0, 10, \"utf-8\");\n $partTwo = mb_substr($data, 12, null, \"utf-8\");\n return base64_decode($partOne . $partTwo);\n }",
"function read_image_descriptor()\r\n\t{\r\n\t\t/* Reset global variables */\r\n\t\t$this->buffer = array();\r\n\t\t$this->fou = '';\r\n\r\n\t\t/* Header -> GIF89a */\r\n\t\t$this->fou .= \"\\x47\\x49\\x46\\x38\\x39\\x61\";\r\n\r\n\t\t$this->getbytes(9);\r\n for($i = 0; $i < 9; $i++)\r\n $this->image_descriptor[$i] = $this->buffer[$i];\r\n\r\n $local_color_table_flag = ($this->buffer[8] & 0x80) ? TRUE : FALSE;\r\n if($local_color_table_flag)\r\n {\r\n \t$code = ($this->buffer[8] & 0x07);\r\n \t$sorted = ($this->buffer[8] & 0x20) ? TRUE : FALSE;\r\n }\r\n else\r\n {\r\n $code = $this->global_color_table_code;\r\n $sorted = $this->global_sorted;\r\n }\r\n\r\n $size = 2 << $code;\r\n\r\n $this->logical_screen_descriptor[4] &= 0x70;\r\n $this->logical_screen_descriptor[4] |= 0x80;\r\n $this->logical_screen_descriptor[4] |= $code;\r\n\r\n if($sorted)\r\n\t\t\t$this->logical_screen_descriptor [4] |= 0x08;\r\n\t\t$this->putbytes($this->logical_screen_descriptor, 7);\r\n\r\n\t\tif($local_color_table_flag)\r\n\t\t{\r\n\t\t\t$this->getbytes(3 * $size);\r\n $this->putbytes($this->buffer, 3 * $size);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->putbytes($this->global, 3 * $size);\r\n\r\n\t\t$this->fou .= \"\\x2C\";\r\n\r\n\t\t$this->image_descriptor[8] &= 0x40;\r\n\r\n\t\t$this->putbytes($this->image_descriptor, 9);\r\n\r\n /* LZW minimum code size */\r\n\t\t$this->getbytes(1);\r\n\t\t$this->putbytes($this->buffer, 1);\r\n\r\n\t\t/* Image Data */\r\n for(;;)\r\n {\r\n \t$this->getbytes(1);\r\n\t\t\t$this->putbytes($this->buffer, 1);\r\n if(($u = $this->buffer[0]) == 0)\r\n \tbreak;\r\n $this->getbytes($u);\r\n $this->putbytes($this->buffer, $u);\r\n }\r\n\r\n\t\t/* trailer */\r\n\t\t$this->fou .= \"\\x3B\";\r\n\r\n\t\t/* Write to file */\r\n\t\tswitch($this->fm)\r\n\t\t{\r\n\t\t\t/* Write as BMP */\r\n\t\t\tcase \"BMP\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".bmp\";\r\n\t\t\t\tif(!$this->imageBmp($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n /* Write as PNG */\r\n\t\t\tcase \"PNG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".png\";\r\n\t\t\t\tif(!imagePng($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as JPG */\r\n\t\t\tcase \"JPG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".jpg\";\r\n\t\t\t\tif(!imageJpeg($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as GIF */\r\n\t\t\tcase \"GIF\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".gif\";\r\n\t\t\t\tif(!imageGif($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public function packerTwoUnpack($data, $revert = false)\n {\n // Separa em dois pedaços\n $partOne = mb_substr($data, 0, 5, \"utf-8\");\n $partTwo = mb_substr($data, 7, null, \"utf-8\");\n return base64_decode($partOne . $partTwo);\n }",
"public function getZippedfile() {\r\n\r\n $data = implode(\"\", $this -> compressedData); \r\n $controlDirectory = implode(\"\", $this -> centralDirectory); \r\n\r\n return \r\n $data. \r\n $controlDirectory. \r\n $this -> endOfCentralDirectory. \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"v\", sizeof($this -> centralDirectory)). \r\n pack(\"V\", strlen($controlDirectory)). \r\n pack(\"V\", strlen($data)). \r\n \"\\x00\\x00\"; \r\n }",
"function packJPEGTablesTag($BitmapJPEGEncoding)\n\t{\n\t\tarray_push($this->FMDebug, \"packJPEGTablesTag\");\n\n\t\t$TagID = 8;\n\t\t$TagLength = strlen($BitmapJPEGEncoding);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public static function arrayToBitMap(array $data)\n {\n if (count($data) == 0) {\n return null;\n }\n\n $current_window = 0;\n\n //\n // go through each RR\n //\n $max = 0;\n $bm = array();\n\n foreach ($data as $rr) {\n \n $rr = strtoupper($rr);\n\n //\n // get the type id for the RR\n //\n $type = @Net_DNS2_Lookups::$rr_types_by_name[$rr];\n if (isset($type)) {\n\n //\n // skip meta types or qtypes\n // \n if ( (isset(Net_DNS2_Lookups::$rr_qtypes_by_id[$type]))\n || (isset(Net_DNS2_Lookups::$rr_metatypes_by_id[$type]))\n ) {\n continue;\n }\n\n } else {\n\n //\n // if it's not found, then it must be defined as TYPE<id>, per\n // RFC3845 section 2.2, if it's not, we ignore it.\n //\n list($name, $type) = explode('TYPE', $rr);\n if (!isset($type)) {\n\n continue;\n }\n }\n\n //\n // build the current window\n //\n $current_window = (int)($type / 256);\n \n $val = $type - $current_window * 256.0;\n if ($val > $max) {\n $max = $val;\n }\n\n $bm[$current_window][$val] = 1;\n $bm[$current_window]['length'] = ceil(($max + 1) / 8);\n }\n\n $output = '';\n\n foreach ($bm as $window => $bitdata) {\n\n $bitstr = '';\n\n for ($i=0; $i<$bm[$window]['length'] * 8; $i++) {\n if (isset($bm[$window][$i])) {\n $bitstr .= '1';\n } else {\n $bitstr .= '0';\n }\n }\n\n $output .= pack('CC', $window, $bm[$window]['length']);\n $output .= pack('H*', self::bigBaseConvert($bitstr));\n }\n\n return $output;\n }",
"function apng_encode($width, $height, $pixels)\n{\n\t$data = \"\\x00\" . implode(\"\\x00\", str_split($pixels, 4 * $width));\n\t$png = \"\\x89PNG\\r\\n\\x1a\\n\";\n\t$png .= png_encode_chunk('IHDR', pack('N2C5', $width, $height, 8, 6, 0, 0, 0));\n\t$png .= png_encode_chunk('acTL', pack('N2', 1, 1));\n\t$png .= png_encode_chunk('fcTL', pack('N5n2C2', 0, $width, $height, 0, 0, 0, 0, 0, 1));\n\t$png .= png_encode_chunk('IDAT', zlib_encode($data, ZLIB_ENCODING_DEFLATE));\n\t$png .= png_encode_chunk('IEND', '');\n\treturn $png;\n}",
"function png_encode_chunk($type, $data)\n{\n\treturn pack('N', strlen($data)) . $type . $data . pack('N', crc32($type.$data));\n}",
"public function get_icon2d(): string\n {\n return $this->_download('icon2d.png');\n }",
"function packRGBA($R, $G, $B, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGBA\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\t\t$atom .= $this->packUI8($A);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function uncompress($data){\n return zlib_decode($data);\n }"
] |
[
"0.7547967",
"0.6553669",
"0.5730698",
"0.56731284",
"0.56338185",
"0.5439804",
"0.54095966",
"0.5052822",
"0.504998",
"0.5014762",
"0.5003144",
"0.4992375",
"0.47835088",
"0.47505832",
"0.4716648",
"0.46927845",
"0.46459442",
"0.45855194",
"0.45827988",
"0.45445365",
"0.4540226",
"0.45396203",
"0.45390397",
"0.45007297",
"0.44934776",
"0.44817498",
"0.44808906",
"0.4429345",
"0.43702158",
"0.4369683"
] |
0.85497624
|
0
|
string packGRADRECORD(string ShapeTag, integer Ratio, integer R, integer G, integer B, boolean AlphaFlag, integer A) returns an SWF GRADRECORD string.
|
function packGRADRECORD($Ratio, $R, $G, $B, $AlphaFlag, $A)
{
array_push($this->FMDebug, "packGRADRECORD");
if ($AlphaFlag) {
$atom = $this->packUI8((int)$Ratio) . $this->packRGBA((int)$R, (int)$G, (int)$B, (int)$A);
} else {
$atom = $this->packUI8((int)$Ratio) . $this->packRGB((int)$R, (int)$G, (int)$B);
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packRGB($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGB\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSetBackgroundColorTag($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packSetBackgroundColorTag\");\n\n\t\t$TagID = 9;\n\t\t$RGB = $this->packRGB($R, $G, $B);\n\t\t$TagLength = strlen($RGB);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $RGB;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packRGBA($R, $G, $B, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGBA\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\t\t$atom .= $this->packUI8($A);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public static function gifStr($r = 0, $g = 0, $b = 0, $transparent = true) {\n return pack('C*',\n 71, 73, 70, 56, 57, 97, // \"GIF89a\"\n\n // Logical screen descriptor\n 1, 0, // logical screen width\n 1, 0, // logical screen height\n 128, // global color table | color resolution(3) | sort flag | size of global color table (3)\n 0, // background color index\n 0, // pixel aspect ratio\n $r, $g, $b, 0, 0, 0, // global color table\n\n // Graphic control extension\n 0x21, // extension introducer\n 0xF9, // graphic control label\n 4, // block size\n 1, // disposal method(3) | user input(3) | transparency |\n 0, 0, // delay time\n $transparent ? 0 : 1, // transparent color index\n 0, // block terminator\n\n // Image descriptor\n 0x2C, // image seperator\n 0, 0, // image left position\n 0, 0, // image top position\n 1, 0, // image height\n 1, 0, // image width\n 0, // local color | interlaced | ordered | reserved(2) | size of color table (3)\n\n 2, 2, 68, 1, 0, // image data\n\n 59); // gif trailer\n }",
"public function build(): string\n {\n $this->verifyBom($this->encoding, $this->description);\n $this->_handleDefaultValues();\n\n $frame = $this->encoding->getCode();\n $frame .= $this->mimeType;\n $frame .= \"\\x00\";\n $frame .= $this->pictureType;\n $frame .= $this->description;\n $frame .= $this->encoding->getDelimiter();\n $frame .= $this->pictureData;\n\n return $frame;\n }",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function __toString() {\n\t\tif (!$this->isBound()) {\n\t\t\treturn 'DImage '.$this->id.' [not bound]';\n\t\t}\n\t\t$r = 'DImage '.$this->id.' ['.$this->info;\n\t\tif ($this->getFrameCount() > 1) {\n\t\t\t$r .= ' frames:'.$this->getFrameCount();\n\t\t}\n\t\t$r .= ' #'.$this->getResourceID();\n\t\t$r .= ']';\n\t\treturn $r;\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packRECORDHEADER($TagID, $TagLength)\n\t{\n\t\tarray_push($this->FMDebug, \"packRECORDHEADER\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_short_tag_limit = 62;\n\t\t$upper_long_tag_limit = 2147483647;\n\n \tif (!(is_integer($TagLength))) {\n\n \t$this->FMError(\"packRECORDHEADER argument (TagLength) not an integer\");\n \t}\n\n \tif ($TagLength < $lower_limit) {\n\n \t$this->FMError(\"packRECORDHEADER argument (TagLength) negative\");\n \t}\n\n \tif ($TagLength > $upper_short_tag_limit) {\n\n\t\t\tif ($TagLength > $upper_long_tag_limit) {\n\n \t\t$this->FMError(\"packRECORDHEADER argument (TagLength) out of range\");\n\t\t\t} else {\n\n\t\t\t\t$atom = $TagID << 6;\n\t\t\t\t$atom += 0x3f;\n\t\t\t\t$atom = $this->packUI16($atom);\n\t\t\t\t$atom .= $this->packUI32($TagLength);\n\t\t\t}\n \t} else {\n\n\t\t\t$atom = $TagID << 6;\n\t\t\t$atom += $TagLength;\n\t\t\t$atom = $this->packUI16($atom);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function toGDImage() {}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function dumpGraphic()\r\n {\r\n // Graphic component that dumps binary data\r\n header(\"Content-type: $this->_binarytype\");\r\n\r\n // Tries to prevent the browser from caching the image\r\n header(\"Pragma: no-cache\");\r\n header(\"Cache-Control: no-cache, must-revalidate\");// HTTP/1.1\r\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");// Date in the past\r\n\r\n if($this->hasValidDataField())\r\n {\r\n echo $this->readDataFieldValue();\r\n }\r\n\r\n exit;\r\n }",
"public static function getJPG($code, $w = 10, $h = 10, $pad = 5, $r = 0, $g = 0, $b = 0)\n {\n \t// Require GD library\n if (!function_exists('imagecreate'))\n \treturn null;\n\n // Return the invalid image\n if ($code === null)\n \treturn null;\n\n // Make sure it is a trimmed string\n $code = trim((string)$code);\n\n \t// Create a new datamatrix object\n \trequire_once(dirname(__FILE__) . '/barcode/datamatrix.php');\n\t\t$qrcode = new \\Datamatrix($code);\n\t\t$barcode_array = $qrcode->getBarcodeArray();\n\t\t$barcode_array['code'] = $code;\n\n // calculate image size\n $width = ($barcode_array['num_cols'] * $w) + $pad * 2;\n $height = ($barcode_array['num_rows'] * $h) + $pad * 2;\n\n // Create the image\n\t\t$png = imagecreate($width, $height);\n\t\t$bgcol = imagecolorallocate($png, 255, 255, 255);\n\t\timagerectangle($png, 0, 0, $width, $height, $bgcol);\n\t\t//imagecolortransparent($png, $bgcol);\n\t\t$fgcol = imagecolorallocate($png, $r, $g, $b);\n\n // Print barcode elements\n $y = $pad;\n for ($r = 0; $r < $barcode_array['num_rows']; ++$r)\n {\n $x = $pad;\n for ($c = 0; $c < $barcode_array['num_cols']; ++$c)\n {\n if ($barcode_array['bcode'][$r][$c] == 1)\n imagefilledrectangle($png, $x, $y, ($x + $w), ($y + $h), $fgcol);\n $x += $w;\n }\n $y += $h;\n }\n\n // Return the image resource\n return $png;\n }",
"public static function png24()\n {\n return new FlagQualifier(self::PNG24);\n }",
"private function get_gif_header()\n {\n $this->p_forward(10);\n if ($this->readbits($mybyte = $this->readbyte_int(), 0, 1) === 1) {\n $this->p_forward(2);\n $this->p_forward(pow(2, $this->readbits($mybyte, 5, 3) + 1) * 3);\n } else {\n $this->p_forward(2);\n }\n\n $this->imageinfo['gifheader'] = $this->datapart(0, $this->pointer);\n if ($this->decoding) {\n $this->orgvars['gifheader'] = $this->imageinfo['gifheader'];\n $this->imgWidth = ord($this->orgvars['gifheader'][7]) * 256 + ord($this->orgvars['gifheader'][6]);\n $this->imgHeight = ord($this->orgvars['gifheader'][9]) * 256 + ord($this->orgvars['gifheader'][8]);\n $this->orgvars['background_color'] = $this->orgvars['gifheader'][11];\n }\n\n }",
"public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }",
"function GIFAddHeader() {\n $cmap = 0;\n \n if (ord($this->BUF[0] {\n 10\n }) & 0x80) {\n $cmap = 3 * (2 << (ord($this->BUF[0] {\n 10\n }) & 0x07));\n \n $this->GIF.= substr($this->BUF[0], 6, 7);\n $this->GIF.= substr($this->BUF[0], 13, $cmap);\n $this->GIF.= \"!\\377\\13NETSCAPE2.0\\3\\1\" . GIFEncoder::GIFWord($this->LOP) . \"\\0\";\n }\n }",
"function getRepresentation() {\n\t $n = count($this->genes) + 1;\n\t $rep = array();\n\t for($i=1;$i<$n;$i++) $rep[] = $i;\n\n\t for($i=1;$i<($n-1);$i++) {\n\t $t = $rep[$this->genes[$i][0]];\n\t $rep[$this->genes[$i][0]] = $rep[$this->genes[$i][1]];\n\t $rep[$this->genes[$i][1]] = $t;\n\t }\n\t $lrep = '';\n\t foreach($rep as $g) $lrep .= $g . ',';\n\n\t //Since in our tests items are progressive, let's count progressive\n\t $cprog = 0;\n\t for($i=0;$i<count($rep)-1;$i++) \n\t if(($rep[$i+1]-$rep[$i]) == 1) $cprog ++;\n\t $lrep .= \" $cprog couple in order\";\n\t return $lrep;\n\t}",
"function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"function _decode_v1($rawtag) {\n if ($this->debug) print($this->debugbeg . \"_decode_v1(\\$rawtag)<HR>\\n\");\n\n if ($rawtag[125] == Chr(0) and $rawtag[126] != Chr(0)) {\n // ID3 v1.1\n $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a28COMMENT/x1/C1TRACK/C1GENRENO';\n } else {\n // ID3 v1\n $format = 'a3TAG/a30NAME/a30ARTISTS/a30ALBUM/a4YEAR/a30COMMENT/C1GENRENO';\n }\n\n $id3tag = unpack($format, $rawtag);\n if ($this->debug) print_r($id3tag);\n\n if ($id3tag['TAG'] == 'TAG') {\n $id3tag['GENRE'] = $this->getgenre($id3tag['GENRENO']);\n } else {\n $id3tag = PEAR::raiseError( 'TAG not found', PEAR_MP3_ID_TNF);\n }\n if ($this->debug) print($this->debugend);\n return $id3tag;\n }"
] |
[
"0.6697453",
"0.55117744",
"0.54920924",
"0.5308683",
"0.5234073",
"0.515901",
"0.51350087",
"0.5129538",
"0.51254475",
"0.49191442",
"0.48836234",
"0.4721503",
"0.45517355",
"0.45411506",
"0.45297745",
"0.44331715",
"0.4418591",
"0.43690202",
"0.43674013",
"0.43567267",
"0.4342501",
"0.42850256",
"0.4266956",
"0.42332008",
"0.4197517",
"0.4190199",
"0.41887027",
"0.41628164",
"0.41571426",
"0.411194"
] |
0.81805587
|
0
|
string packGRADIENT(string GradientRecords) returns an SWF GRADIENT string.
|
function packGRADIENT($GradientRecords, $AlphaFlag)
{
array_push($this->FMDebug, "packGRADIENT");
if ($AlphaFlag) {
$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;
} else {
$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packGRADRECORD($Ratio, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADRECORD\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGBA((int)$R, (int)$G, (int)$B, (int)$A);\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGB((int)$R, (int)$G, (int)$B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function getGradient();",
"protected function _getGradientStartColour() {\n $base_colour = $this->_getColour();\n $colour = \"\";\n foreach (array(0, 2, 4) as $pos) {\n $rgb_val = hexdec(substr($base_colour, $pos, 2));\n $rgb_val = max(0, min(255, $rgb_val + (self::GRADIENT_COLOUR_STEP / 2)));\n $colour .= str_pad(dechex($rgb_val), 2, \"0\", STR_PAD_LEFT);\n }\n return $colour;\n }",
"protected function _getGradientEndColour() {\n $base_colour = $this->_getColour();\n $colour = \"\";\n foreach (array(0, 2, 4) as $pos) {\n $rgb_val = hexdec(substr($base_colour, $pos, 2));\n $rgb_val = max(0, min(255, $rgb_val - (self::GRADIENT_COLOUR_STEP / 2)));\n $colour .= str_pad(dechex($rgb_val), 2, \"0\", STR_PAD_LEFT);\n }\n return $colour;\n }",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function gs_background_markup( $color = '', $opacity = 1 ) {\n\n\t$rtn = '';\n\n\tif ( ! ( '' === $color ) ) {\n\t\t$rgba = 'rgba(' . hex2rgb( $color ) . ',' . $opacity . ')';\n\t\t$rtn .= 'linear-gradient(' . $rgba . ',' . $rgba . ')'; //no-repeat center center/cover\n\n\t\treturn 'background-image: ' . $rtn;\n\t}\n\n\treturn $rtn;\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 }",
"static function create_background_style_attr( $attrs ) {\n\t\t$bg_style = array();\n\n\t\tif ( ! empty( $attrs ) ) {\n\t\t\tforeach ( $attrs as $key => $value ) {\n\t\t\t\t$trimmed_val = trim( $value );\n\t\t\t\tif ( ! empty( $trimmed_val ) ) {\n\t\t\t\t\tif ( 'background-image' === $key ) {\n\t\t\t\t\t\t$bg_style[] = $key . ': url(' . esc_url( $trimmed_val ) . ')';\n\t\t\t\t\t}\n\t\t\t\t\telse if ( 'background-color' === $key ) {\n\t\t\t\t\t\t// to overwrite the gradient set with CSS background property\n\t\t\t\t\t\t$bg_style[] = 'background: ' . $trimmed_val;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$bg_style[] = $key . ': ' . $trimmed_val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $bg_style ) ) {\n\t\t\treturn '';\n\t\t}\n\t\telse {\n\t\t\treturn join( '; ', $bg_style );\n\t\t}\n\n\t}",
"function postground($kind,$graphHeight,$graphWidth,$graphSpacer)\n{\n\t\tglobal $leftoffs;\n\t\tglobal $legendarr;\n\t\tglobal $colorarr;\n\t\tglobal $colordarr;\n\t\tglobal $legendoffset;\n\t\tglobal $year;\n\t\tglobal $xaxis;\n\t\tglobal $yaxis;\n\t\tglobal $topoffs;\n\t\tglobal $bottoffs;\n\t\tglobal $yearsize;\n\n\t\tglobal $arrowWidth;\n\t\tglobal $arrowHeight;\n\n\t\tfor ($i=0;$i<5;$i++){\n\n\t\t\t\t// Bottom and left line\n\t\t\t\t$svgstr.=\"<line x1='10' y1='\".(($i+1)*$graphSpacer+15).\"' x2='\".($graphWidth).\"' y2='\".(($i+1)*$graphSpacer+15).\"' stroke-width='2' stroke='black'/>\";\n\t\t\t\t$svgstr.=\"<line x1='\".($leftoffs-1).\"' y1='\".(10+$topoffs+($i*$graphSpacer)).\"' x2='\".($leftoffs-1).\"' y2='\".(135+$topoffs+($i*$graphSpacer)).\"' stroke-width='2' stroke='black'/>\";\n\n\t\t\t\t// Attempt at arrow-beard-head\n\t\t\t\t$svgstr.=\"<polygon points='\";\n\t\t\t\t$svgstr.=($leftoffs-1).\",\".(5+$topoffs+($i*$graphSpacer));\n\t\t\t\t$svgstr.=\",\".($leftoffs-$arrowWidth-2).\",\".($arrowHeight+$topoffs+($i*$graphSpacer));\n\t\t\t\t$svgstr.=\",\".($leftoffs+$arrowWidth).\",\".($arrowHeight+$topoffs+($i*$graphSpacer));\n\t\t\t\t$svgstr.=\"' stroke-width='2' stroke='none' fill='black' />\";\n\n\t\t}\n\n\t\treturn $svgstr;\t\t\n}",
"function NombreCursoColor($varcursocolor)\n{\n\tif ($varcursocolor == 1) return \"linear-gradient(\n to right bottom, \n rgba(54, 227, 250, 0.589),\n rgba(36, 154, 250, 0.795)\n )\";\n\tif ($varcursocolor == 2) return \"linear-gradient(\n to right bottom, \n rgba(1, 152, 252, 0.363),\n rgba(0, 80, 126, 0.534)\n\t)\";\n\tif ($varcursocolor == 3) return \"linear-gradient(\n to right bottom,\n rgba(250, 184, 60, 0.849),\n rgba(253, 151, 18, 0.63)\n\t)\";\n\tif ($varcursocolor == 4) return \"linear-gradient(\n to right bottom,\n rgba(250, 145, 60, 0.849),\n rgba(252, 64, 6, 0.63)\n )\";\n\tif ($varcursocolor == 5) return \"linear-gradient(\n to right bottom,\n rgba(248, 150, 121, 0.795),\n rgba(250, 91, 52, 0.774)\n )\";\n\tif ($varcursocolor == 6) return \"linear-gradient(\n to right bottom,\n rgba(165, 61, 1, 0.795),\n rgba(71, 32, 1, 0.774)\n )\";\n\tif ($varcursocolor == 7) return \"linear-gradient(\n to right bottom, \n rgba(76, 1, 252, 0.363),\n rgba(38, 0, 126, 0.534)\n )\";\n}",
"function stringrgb($arr){\r\n\treturn \"RGB(\".$arr[0].\",\".$arr[1].\",\".$arr[2].\")\";\r\n}",
"public function format(string $format = 'svg');",
"public static function createData($gisString, $mysqlVersion)\n {\n $geomFromText = $mysqlVersion >= 50600 ? 'ST_GeomFromText' : 'GeomFromText';\n $gisString = trim($gisString);\n $geomTypes = '(POINT|MULTIPOINT|LINESTRING|MULTILINESTRING|POLYGON|MULTIPOLYGON|GEOMETRYCOLLECTION)';\n if (preg_match(\"/^'\" . $geomTypes . \"\\(.*\\)',[0-9]*$/i\", $gisString)) {\n return $geomFromText . '(' . $gisString . ')';\n }\n\n if (preg_match('/^' . $geomTypes . '\\(.*\\)$/i', $gisString)) {\n return $geomFromText . \"('\" . $gisString . \"')\";\n }\n\n return $gisString;\n }",
"public function prepare_background( $data ) {\n\n\t\t\tif ( ! is_array( $data ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tunset( $data['image'] );\n\n\t\t\t$result = '';\n\t\t\t$format = 'background-%s:%s;';\n\n\t\t\tforeach ( $data as $prop => $value ) {\n\n\t\t\t\tif ( ! $value ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tswitch ( $prop ) {\n\t\t\t\t\tcase 'color':\n\t\t\t\t\t\t$value = $this->sanitize_hex_color( $value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'position':\n\t\t\t\t\t\t$value = str_replace( '-', ' ', $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$result .= sprintf( $format, $prop, $value );\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}",
"function packRGB($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGB\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function style(){\r\n\t\t// Sorry mom :(\r\n\t\t$style=\"<style>\r\n\t\t\t.debug{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding: 15px;\r\n\t\t\t\tmargin: 15px;\r\n\t\t\t\tborder: 1px solid black;\r\n\t\t\t\tcolor: black;\r\n\t\t\t\tfont-size: 14px;\r\n\t\t\t\tfont-family: monospace;\r\n\t\t\t\toverflow: auto;\r\n\t\t\t\t\r\n\t\t\t\ttext-align: left;\r\n\t\t\t\tline-height: 14px;\r\n\t\t\t\tborder-radius: 10px;\r\n\t\t\t\tmoz-border-radiuz: 10px;\r\n\t\t\t\t\r\n\t\t\t\tbackground-image: linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -o-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -moz-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -webkit-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -ms-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\t\r\n\t\t\t\tbackground-image: -webkit-gradient(\r\n\t\t\t\t\tlinear,\r\n\t\t\t\t\tleft bottom,\r\n\t\t\t\t\tleft top,\r\n\t\t\t\t\tcolor-stop(0.9, rgb(251,255,199)),\r\n\t\t\t\t\tcolor-stop(1, rgb(227,222,157))\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t</style>\r\n\t\t \";\r\n\t\treturn $style;\r\n\t}",
"protected function build_variables_string() {\r\n\t\t$fields = array(\r\n\t\t\t'StatusCode',\r\n\t\t\t'Message',\r\n\t\t\t'PreviousStatusCode',\r\n\t\t\t'PreviousMessage',\r\n\t\t\t'CrossReference',\r\n\t\t\t'Amount',\r\n\t\t\t'CurrencyCode',\r\n\t\t\t'OrderID',\r\n\t\t\t'TransactionType',\r\n\t\t\t'TransactionDateTime',\r\n\t\t\t'OrderDescription',\r\n\t\t\t'CustomerName',\r\n\t\t\t'Address1',\r\n\t\t\t'Address2',\r\n\t\t\t'Address3',\r\n\t\t\t'Address4',\r\n\t\t\t'City',\r\n\t\t\t'State',\r\n\t\t\t'PostCode',\r\n\t\t\t'CountryCode',\r\n\t\t\t'EmailAddress',\r\n\t\t\t'PhoneNumber',\r\n\t\t);\r\n\r\n\t\t$result = 'MerchantID=' . get_option( 'paymentsense_id' ) .\r\n\t\t\t'&Password=' . get_option( 'paymentsense_password' );\r\n\t\tforeach ( $fields as $field ) {\r\n\t\t\t$result .= '&' . $field . '=' . self::get_post_var( $field );\r\n\t\t}\r\n\r\n\t\treturn $result;\r\n\t}",
"function Scaffold_hextorgb($hex,$format='preformatted') {\n\t// Regexp for a valid hex digit\n\t$d = '[a-fA-F0-9]';\n\t// Make sure $hex is valid\n\tif (preg_match(\"/^#($d$d)($d$d)($d$d)\\$/\", $hex, $rgb)) {\n\t $rgb_values = hexdec($rgb[1]).','.hexdec($rgb[2]).','.hexdec($rgb[3]);\n\t if ($format != 'preformatted') {\n\t\t return $rgb_values;\n\t }\n\t return 'rgb('.$rgb_values.')';\n\t}\n\tif (preg_match(\"/^($d)($d)($d)$/\", $hex, $rgb)) {\n\t $rgb_values = hexdec($rgb[1] . $rgb[1]).','.hexdec($rgb[2] . $rgb[2]).','.hexdec($rgb[3] . $rgb[3]);\n\t\tif ($format != 'preformatted') {\n\t\t return $rgb_values;\n\t }\n\t return 'rgb('.$rgb_values.')';\n\t}\n\treturn $hex;\n}",
"public function convert_variables_to_color( $string ){\n\t\t$theme_colors = !empty(self::$_theme_colors->colors) ? self::$_theme_colors->colors : array();\n\n\t\tfor( $i = 0; $i < self::$_theme_color_count ; $i++ ){\n\t\t\t$string = str_replace(\"#\" . self::VAR_PREFIX . $i, $theme_colors[$i]->color , $string );\n\t\t}\n\n\t\treturn $string;\n\t}",
"function background($kind,$graphHeight,$graphWidth,$graphSpacer)\n{\n\t\tglobal $leftoffs;\n\t\tglobal $legendarr;\n\t\tglobal $colorarr;\n\t\tglobal $colordarr;\n\t\tglobal $legendoffset;\n\t\tglobal $year;\n\t\tglobal $xaxis;\n\t\tglobal $yaxis;\n\t\tglobal $topoffs;\n\t\tglobal $bottoffs;\n\t\tglobal $yearsize;\n\n\t\tglobal $arrowWidth;\n\t\tglobal $arrowHeight;\n\n\t\t// ----------------------------============###### Background ######============----------------------------\n\t\t$svgstr=\"\";\n\n\t\tfor($j=0;$j<count($legendarr[$kind]);$j++) {\n\t\t\tif ($j>=(count($legendarr[$kind])/2)) {$legendoffset=25;}\n\t\t\tif($legendarr[$kind][$j] != \"\"){\n\t\t\t\t$svgstr.=\"<rect x='\".(20+((($j+1)%3)*130)).\"' y='\".(4+$legendoffset).\"' width='24' height='20' style='\".$colordarr[$kind][$j].\"' />\";\n\t\t\t\t$svgstr.=\"<rect x='\".(20+((($j+1)%3)*130)).\"' y='\".(6+$legendoffset).\"' width='22' height='18' style='\".$colorarr[$kind][$j].\"' />\";\t\t\t\t\t\t\n\t\t\t\t$svgstr.=\"<text x='\".(45+((($j+1)%3)*130)).\"' y='\".(22+$legendoffset).\"' font-family='Arial Narrow' font-size='20'>\".$legendarr[$kind][$j].\"</text>\";\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\tfor ($i=0;$i<6;$i++){\n\t\t\t\t// Year\n\t\t\t\t$svgstr.=\"<rect x='10' y='\".($topoffs+($i*$graphSpacer)).\"' width='\".($graphWidth).\"' height='\".($graphHeight).\"' style='fill:#eee' />\";\n\t\t\t\t$svgstr.=\"<text x='17' y='\".($graphSpacer+($i*$graphSpacer)).\"' font-family='Arial Narrow' font-size='\".$yearsize.\"' style='fill:#888' >\".$year[$i].\"</text>\";\n\t\t\t\t$svgstr.=\"<text x='15' y='\".(($graphSpacer-2)+($i*$graphSpacer)).\"' font-family='Arial Narrow' font-size='\".$yearsize.\"' style='fill:#fff' >\".$year[$i].\"</text>\";\n\n\t\t\t\t// Axis text\n\t\t\t\t$svgstr.=\"<text id='xaxislable\".$i.\"' x='\".(($leftoffs-60)+((410-$leftoffs)/2)).\"' y='\".(($graphSpacer+34)+($i*$graphSpacer)).\"' font-family='Arial Narrow' font-size='16' style='fill:#888' >\".$xaxis[$kind].\"</text>\";\n\t\t\t\t$svgstr.=\"<text id='yaxislable\".$i.\"' x='\".($leftoffs).\"' y='\".(($graphSpacer+38)+($i*$graphSpacer)).\"' font-family='Arial Narrow' font-size='16' style='fill:#888;' transform='rotate(-90,\".($leftoffs-18).\",\".(($graphSpacer+26)+($i*$graphSpacer)).\")' >\".$yaxis[$kind].\"</text>\";\n\n\t\t}\n\n\t\treturn $svgstr;\t\t\n}",
"function gradiente($_w=50,$_h=280,$_arq=\"gradiente.png\") {\r\n\t$_img = imagecreatetruecolor($_w,$_h);\r\n\t$_prt = imagecolorallocate($_img, 0x00, 0x00, 0x00); \r\n\t$_brc = imagecolorallocate($_img, 0xff, 0xff, 0xff);\r\n\timagefilledrectangle($_img,0,0,$_w-1,$_h-1,$_brc);\r\n\timagerectangle($_img,0,0,$_w-1,$_h-1,$_prt);\r\n\r\n \t// Tabela de Cores\r\n\t$_idx_c = 0;\r\n \tfor($i=0;$i<=255;$i+=5) {\r\n\t $_c[\"c_grad_\". $_idx_c] = imagecolorallocate($_img,255,$i,0);\r\n\t $_idx_c++;\r\n }\r\n \tfor($i=240;$i>=0;$i-=5) {\r\n\t $_c[\"c_grad_\". $_idx_c] = imagecolorallocate($_img,$i,255,0);\r\n\t $_idx_c++;\r\n }\r\n \tfor($i=15;$i<=105;$i+=5) {\r\n\t $_c[\"c_grad_\". $_idx_c] = imagecolorallocate($_img,0,255,$i);\r\n\t $_idx_c++;\r\n }\r\n \tfor($i=5;$i<=100;$i+=5) {\r\n\t $_c[\"c_grad_\". $_idx_c] = imagecolorallocate($_img,0,255-$i,135);\r\n\t $_idx_c++;\r\n }\r\n\r\n\t// Desenha o gradiente....\r\n\tfor($i=0;$i<=$_idx_c;$i++) {\r\n\t\t$_py1 = $_h-$i*2-2;\r\n\t\t$_py2 = $_h-($i+1)*2-2;\r\n\t\t$_cor = $_c[\"c_grad_\". $i];\r\n \timagefilledrectangle($_img,1,$_py1 ,$_w-2,$_py2 ,$_cor);\t\r\n\t}\r\n\timagepng($_img,$_arq);\r\n}",
"function grdgp_convertFromString($pString, $pMinGrade, $pMaxGrade) {\n if ($pString=='') {\n $this->grdgp_setDefaults();\n }\n else {\n for ($i = 0; $i < $this->grdgp_grade_count; $i++)\n $this->grdgp_grade_isGroupEnd [$i] = FALSE;\n $ar = explode('~',$pString);\n for ($i = 0; $i < count($ar); $i++) {\n $j = $ar[$i];\n if ( ($j >= 0) and ($j < $this->grdgp_grade_count) )\n $this->grdgp_grade_isGroupEnd [$j] = TRUE;\n }\n }\n $this->grdgp_refresh();\n}",
"function build_color_rule($mod_name) {\n\t\t\t$element = json_decode($this->get_cached_mod($mod_name));\n\t\t\t$element_props = '';\n\t\t\tif (isset($element->mode) && $element->mode === 'image' && !empty($element->imgwidth)) {\n\t\t\t\t$element_props = \"\\twidth: {$element->imgwidth}px;\";\n\t\t\t}\n\t\t\tif (isset($element->color) && '' != $element->color) {\n\t\t\t\t$opacity = ( isset($element->opacity) && '' != $element->opacity ) ? $element->opacity : 1;\n\t\t\t\t$element_props .=$opacity < 1 ? \"\\n\\tcolor: rgba(\" . $this->hex2rgb($element->color) . ',' . $opacity . ');' : \"\\n\\tcolor: #$element->color;\";\n\t\t\t}\n\t\t\treturn $element_props;\n\t\t}",
"public function formatted()\n {\n return 'rgba('.$this->red.', '.$this->green.', '.$this->blue.', '.$this->alpha.')';\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}",
"function writeRdfToString() \r\n\t{\r\n\t \t// Import Package Syntax\r\n\t\tinclude_once(RDFAPI_INCLUDE_DIR.PACKAGE_SYNTAX_RDF); \t\t\r\n\t\t$ser = new RdfSerializer();\r\n\t $rdf =& $ser->serialize($this->getMemModel());\r\n\t\treturn $rdf;\r\n\t}",
"function makeformatstring($names){\n\t$formatstring = '';\n foreach ($names as $name=>$type) {\n \tif($type=='@'){\n \t\t$formatstring .= $type.substr($name,2).\"/\";\n \t} else {\n \t\t$formatstring .= $type.$name.\"/\";\n \t}\n \t\n }\n return $formatstring;\n}",
"private function GENPayload() {\n\n\t\t$payload = pack('C', 1);\n\n\t\t$sensCount = mt_rand(1, 8);\n\n\t\t$sensors = '';\n\n\t\tfor ( $idx = 0; $idx < $sensCount; $idx++ ) {\n\t\t\t$sensor;\n\t\t\t$sensorValue;\n\n\t\t\t$sensType = mt_rand(1,7);\n\n\t\t\t$sensor = pack('v', $sensType);\n\t\t\t$sensorValue = pack('V', mt_rand());\n\n\t\t\t$sensors = $sensors . $sensor . $sensorValue;\n\n\t\t}\n\n\t\t$payload = $payload . $sensors;\n\n\t\t$this->payload_raw = base64_encode($payload);\n\n\t}",
"public static function gifStr($r = 0, $g = 0, $b = 0, $transparent = true) {\n return pack('C*',\n 71, 73, 70, 56, 57, 97, // \"GIF89a\"\n\n // Logical screen descriptor\n 1, 0, // logical screen width\n 1, 0, // logical screen height\n 128, // global color table | color resolution(3) | sort flag | size of global color table (3)\n 0, // background color index\n 0, // pixel aspect ratio\n $r, $g, $b, 0, 0, 0, // global color table\n\n // Graphic control extension\n 0x21, // extension introducer\n 0xF9, // graphic control label\n 4, // block size\n 1, // disposal method(3) | user input(3) | transparency |\n 0, 0, // delay time\n $transparent ? 0 : 1, // transparent color index\n 0, // block terminator\n\n // Image descriptor\n 0x2C, // image seperator\n 0, 0, // image left position\n 0, 0, // image top position\n 1, 0, // image height\n 1, 0, // image width\n 0, // local color | interlaced | ordered | reserved(2) | size of color table (3)\n\n 2, 2, 68, 1, 0, // image data\n\n 59); // gif trailer\n }"
] |
[
"0.54687995",
"0.4871736",
"0.47287098",
"0.47041547",
"0.45779288",
"0.4503",
"0.44052985",
"0.44040188",
"0.4354905",
"0.43240753",
"0.42637828",
"0.42358702",
"0.42321247",
"0.4189776",
"0.41158366",
"0.41122633",
"0.40843678",
"0.40722743",
"0.4064639",
"0.40604928",
"0.40470138",
"0.4046239",
"0.40432742",
"0.40426862",
"0.4031296",
"0.4029441",
"0.40278623",
"0.40220118",
"0.40197933",
"0.3991329"
] |
0.77086824
|
0
|
string packFILLSTYLE(int FillStyleType, int R, int G, int B, int A, string GradientMatrix, string Gradient, integer BitmapID, string BitmapMatrix) returns an SWF FILLSTYLE string.
|
function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)
{
array_push($this->FMDebug, "packFILLSTYLE");
//-------------------------------------------------- .[cal]
// add vertical and horizontal straight edges.
if(!isset($atom) & $this->Cal_mode){
$atom = "";
}
// [cal].
switch ($FillStyleType) {
case 0x00:
if ($AlphaFlag) {
if ($A == "") {
$A = 0xff;
}
$atom .= $this->packRGBA($R, $G, $B, $A);
} else {
$atom .= $this->packRGB($R, $G, $B);
}
break;
case 0x10:
$atom .= $GradientMatrix . $Gradient;
break;
case 0x12:
$atom .= $GradientMatrix . $Gradient;
break;
case 0x40:
$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;
break;
case 0x41:
$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;
break;
default:
$this->FMError("packFILLSTYLE unknown FillStyleType value");
}
$atom = $this->packUI8($FillStyleType) . $atom;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLEARRAY\");\n\n\t\tif ($FillStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($FillStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom = chr(0xff) . $this->packUI16($FillStyleCount);\n\t\t}\n\n\t\t$atom .= $FillStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function Style_Fill($color=null) {\n\n return array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, \n 'color' => array('rgb' => $color) \n ); \n}",
"function Style_Fill($color=null) {\n\n return array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, \n 'color' => array('rgb' => $color) \n ); \n}",
"protected function markupFill() {\r\n\t\t\tif($this->_fill) {\r\n\t\t\t\treturn '&chm=B,'.$this->_fill;\r\n\t\t\t} else {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t}",
"private function _getFillPatternByIndex($index)\n\t{\n\t\tswitch ($index) {\n\t\tcase 0x00: return PHPExcel_Style_Fill::FILL_NONE;\n\t\tcase 0x01: return PHPExcel_Style_Fill::FILL_SOLID;\n\t\tcase 0x02: return PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY;\n\t\tcase 0x03: return PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY;\n\t\tcase 0x04: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY;\n\t\tcase 0x05: return PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL;\n\t\tcase 0x06: return PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL;\n\t\tcase 0x07: return PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN;\n\t\tcase 0x08: return PHPExcel_Style_Fill::FILL_PATTERN_DARKUP;\n\t\tcase 0x09: return PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID;\n\t\tcase 0x0A: return PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS;\n\t\tcase 0x0B: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL;\n\t\tcase 0x0C: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL;\n\t\tcase 0x0D: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN;\n\t\tcase 0x0E: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP;\n\t\tcase 0x0F: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID;\n\t\tcase 0x10: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS;\n\t\tcase 0x11: return PHPExcel_Style_Fill::FILL_PATTERN_GRAY125;\n\t\tcase 0x12: return PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625;\n\t\tdefault: return false;\n\t\t}\n\t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function build(): string\n {\n return 'filled';\n }",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function swf_shapefillbitmapclip($bitmapid)\n{\n}",
"function build_color_rule($mod_name) {\n\t\t\t$element = json_decode($this->get_cached_mod($mod_name));\n\t\t\t$element_props = '';\n\t\t\tif (isset($element->mode) && $element->mode === 'image' && !empty($element->imgwidth)) {\n\t\t\t\t$element_props = \"\\twidth: {$element->imgwidth}px;\";\n\t\t\t}\n\t\t\tif (isset($element->color) && '' != $element->color) {\n\t\t\t\t$opacity = ( isset($element->opacity) && '' != $element->opacity ) ? $element->opacity : 1;\n\t\t\t\t$element_props .=$opacity < 1 ? \"\\n\\tcolor: rgba(\" . $this->hex2rgb($element->color) . ',' . $opacity . ');' : \"\\n\\tcolor: #$element->color;\";\n\t\t\t}\n\t\t\treturn $element_props;\n\t\t}",
"function packRGB($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGB\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function style(){\r\n\t\t// Sorry mom :(\r\n\t\t$style=\"<style>\r\n\t\t\t.debug{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding: 15px;\r\n\t\t\t\tmargin: 15px;\r\n\t\t\t\tborder: 1px solid black;\r\n\t\t\t\tcolor: black;\r\n\t\t\t\tfont-size: 14px;\r\n\t\t\t\tfont-family: monospace;\r\n\t\t\t\toverflow: auto;\r\n\t\t\t\t\r\n\t\t\t\ttext-align: left;\r\n\t\t\t\tline-height: 14px;\r\n\t\t\t\tborder-radius: 10px;\r\n\t\t\t\tmoz-border-radiuz: 10px;\r\n\t\t\t\t\r\n\t\t\t\tbackground-image: linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -o-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -moz-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -webkit-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -ms-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\t\r\n\t\t\t\tbackground-image: -webkit-gradient(\r\n\t\t\t\t\tlinear,\r\n\t\t\t\t\tleft bottom,\r\n\t\t\t\t\tleft top,\r\n\t\t\t\t\tcolor-stop(0.9, rgb(251,255,199)),\r\n\t\t\t\t\tcolor-stop(1, rgb(227,222,157))\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t</style>\r\n\t\t \";\r\n\t\treturn $style;\r\n\t}",
"function packGRADRECORD($Ratio, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADRECORD\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGBA((int)$R, (int)$G, (int)$B, (int)$A);\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)$Ratio) . $this->packRGB((int)$R, (int)$G, (int)$B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSetBackgroundColorTag($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packSetBackgroundColorTag\");\n\n\t\t$TagID = 9;\n\t\t$RGB = $this->packRGB($R, $G, $B);\n\t\t$TagLength = strlen($RGB);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $RGB;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function imagesetstyle($image, $style)\n{\n}",
"public function getCSS(){\n\t\ttry{\t\t\t\n\t\t\t$color = (is_null($this->color)? \"\" : $this->color->getCSS());\n\t\t\tif(is_null($this->imgResource)){\n\t\t\t\t$css = sprintf(\"background: %s \", $color);\n\t\t\t}else{\t\t\t \t\t\t\n\t\t\t\t$pos = sprintf(\"%s %s\", $this->imgPosition[0], $this->imgPosition[0]);\n\t\t\t\t$css = sprintf(\"background: %s url(\\\"%s\\\") %s %s %s\", $color, \n\t\t\t\t\t\t$this->imgResource, $pos, $this->imgRepetition, $this->imgAttachment);\n\t\t\t}\n\t\t\treturn $css.\";\";\n\t\t}catch(Exception $e){\n\t\t\tthrow new Exception(ErrorHelper::formatMessage(__FUNCTION__,__CLASS__,$e));\n\t\t}\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function string() {\n $styles = [];\n if ($this->fg !== null) {\n $styles []= $this->fg;\n }\n\n if ($this->bg !== null) {\n $styles []= $this->bg;\n }\n\n $styles = array_merge($styles, $this->format);\n\n if (empty($styles)) {\n return $this->str;\n } else {\n $escape = \"\\e[\" . join(';', $styles) . 'm';\n return $escape . $this->str . \"\\e[\" . self::ANSI_OFF . 'm';\n }\n }",
"function acf_get_field_group_style($field_group)\n{\n}",
"function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}",
"private function _readBIFF8Style($recordData)\n\t{\n\t\t$style = array();\n\t\t\n\t\t// offset: 0; size: 2; Index to FONT record\n\t\tif ($this->_GetInt2d($recordData, 0) < 4) {\n\t\t\t$fontIndex = $this->_GetInt2d($recordData, 0);\n\t\t} else {\n\t\t\t// this has to do with that index 4 is omitted in all BIFF versions for some strange reason\n\t\t\t// check the OpenOffice documentation of the FONT record\n\t\t\t$fontIndex = $this->_GetInt2d($recordData, 0) - 1;\n\t\t}\n\t\t$style['font'] = $this->_font[$fontIndex];\n\t\t\n\t\t// offset: 2; size: 2; Index to FORMAT record\n\t\t\t$numberFormatIndex = $this->_GetInt2d($recordData, 2);\n\t\t\t$style['numberformat'] = $this->_readBIFF8NumberFormat($numberFormatIndex);\n\t\t\n\t\t$style['protection'] = array();\n\t\t// offset: 4; size: 2; XF type, cell protection, and parent style XF\n\t\t\t// bit 2-0; mask 0x0007; XF_TYPE_PROT\n\t\t\t$xfTypeProt = $this->_GetInt2d($recordData, 4);\n\t\t\t\t// bit 0; mask 0x01; 1 = cell is locked\n\t\t\t\t$isLocked = (0x01 & $xfTypeProt) >> 0;\n\t\t\t\t$style['protection']['locked'] = $isLocked ? true : false;\n\t\t\t\t// bit 1;\n\t\t\t\t// bit 2;\n\t\t\n\t\t// offset: 6; size: 1; Alignment and text break\n\t\t$style['alignment'] = array();\n\t\t\t// bit 2-0, mask 0x07; horizontal alignment\n\t\t\t$horAlign = (0x07 & ord($recordData[6])) >> 0;\n\t\t\tswitch ($horAlign) {\n\t\t\t\tcase 0: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; break;\n\t\t\t\tcase 1: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT; break;\n\t\t\t\tcase 2: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER; break;\n\t\t\t\tcase 3: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT; break;\n\t\t\t\tcase 5: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY; break;\n\t\t\t}\n\t\t\t// bit 3, mask 0x08; wrap text\n\t\t\t$wrapText = (0x08 & ord($recordData[6])) >> 3;\n\t\t\tswitch ($wrapText) {\n\t\t\t\tcase 0: $style['alignment']['wrap'] = false; break;\n\t\t\t\tcase 1: $style['alignment']['wrap'] = true; break;\n\t\t\t}\n\t\t\t// bit 6-4, mask 0x70; vertical alignment\n\t\t\t$vertAlign = (0x70 & ord($recordData[6])) >> 4;\n\t\t\tswitch ($vertAlign) {\n\t\t\t\tcase 0: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP; break;\n\t\t\t\tcase 1: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER; break;\n\t\t\t\tcase 2: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; break;\n\t\t\t\tcase 3: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY; break;\n\t\t\t}\n\t\t// offset: 7; size: 1; XF_ROTATION: Text rotation angle\n\t\t// offset: 8; size: 1; Indentation, shrink to cell size, and text direction\n\t\t// offset: 9; size: 1; Flags used for attribute groups\n\t\t\n\t\t$style['borders'] = array(\n\t\t\t'left' => array(),\n\t\t\t'right' => array(),\n\t\t\t'top' => array(),\n\t\t\t'bottom' => array(),\n\t\t);\n\t\t// offset: 10; size: 4; Cell border lines and background area\n\t\t\t// bit: 3-0; mask: 0x0000000F; left style\n\t\t\tif ($bordersLeftStyle = $this->_readBorderStyle((0x0000000F & $this->_GetInt4d($recordData, 10)) >> 0)) {\n\t\t\t\t$style['borders']['left']['style'] = $bordersLeftStyle;\n\t\t\t}\n\t\t\t// bit: 7-4; mask: 0x000000F0; right style\n\t\t\tif ($bordersRightStyle = $this->_readBorderStyle((0x000000F0 & $this->_GetInt4d($recordData, 10)) >> 4)) {\n\t\t\t\t$style['borders']['right']['style'] = $bordersRightStyle;\n\t\t\t}\n\t\t\t// bit: 11-8; mask: 0x00000F00; top style\n\t\t\tif ($bordersTopStyle = $this->_readBorderStyle((0x00000F00 & $this->_GetInt4d($recordData, 10)) >> 8)) {\n\t\t\t\t$style['borders']['top']['style'] = $bordersTopStyle;\n\t\t\t}\n\t\t\t// bit: 15-12; mask: 0x0000F000; bottom style\n\t\t\tif ($bordersBottomStyle = $this->_readBorderStyle((0x0000F000 & $this->_GetInt4d($recordData, 10)) >> 12)) {\n\t\t\t\t$style['borders']['bottom']['style'] = $bordersBottomStyle;\n\t\t\t}\n\t\t\t// bit: 22-16; mask: 0x007F0000; left color\n\t\t\tif ($bordersLeftColor = $this->_readColor((0x007F0000 & $this->_GetInt4d($recordData, 10)) >> 16)) {\n\t\t\t\t$style['borders']['left']['color'] = $bordersLeftColor;\n\t\t\t}\n\t\t\t// bit: 29-23; mask: 0x3F800000; right color\n\t\t\tif ($bordersRightColor = $this->_readColor((0x3F800000 & $this->_GetInt4d($recordData, 10)) >> 23)) {\n\t\t\t\t$style['borders']['right']['color'] = $bordersRightColor;\n\t\t\t}\n\t\t\t\n\t\t$style['fill'] = array();\n\t\t// offset: 14; size: 4;\n\t\t\t// bit: 6-0; mask: 0x0000007F; top color\n\t\t\tif ($bordersTopColor = $this->_readColor((0x0000007F & $this->_GetInt4d($recordData, 14)) >> 0)) {\n\t\t\t\t$style['borders']['top']['color'] = $bordersTopColor;\n\t\t\t}\n\t\t\t// bit: 13-7; mask: 0x00003F80; top color\n\t\t\tif ($bordersBottomColor = $this->_readColor((0x00003F80 & $this->_GetInt4d($recordData, 14)) >> 7)) {\n\t\t\t\t$style['borders']['bottom']['color'] = $bordersBottomColor;\n\t\t\t}\n\t\t\t// bit: 31-26; mask: 0xFC000000 fill pattern\n\t\t\tif ($fillType = $this->_getFillPatternByIndex((0xFC000000 & $this->_GetInt4d($recordData, 14)) >> 26)) {\n\t\t\t\t$style['fill']['type'] = $fillType;\n\t\t\t}\n\t\t// offset: 18; size: 2; pattern and background colour\n\t\t\t// bit: 6-0; mask: 0x007F; color index for pattern color\n\t\t\tif ($rgb = $this->_readColor((0x007F & $this->_GetInt2d($recordData, 18)) >> 0)) {\n\t\t\t\t$style['fill']['startcolor'] = $rgb;\n\t\t\t}\n\t\t\t// bit: 13-7; mask: 0x3F80; color index for pattern background\n\t\t\tif ($rgb = $this->_readColor((0x3F80 & $this->_GetInt2d($recordData, 18)) >> 7)) {\n\t\t\t\t$style['fill']['endcolor'] = $rgb;\n\t\t\t}\n\t\treturn $style;\n\t}"
] |
[
"0.6465233",
"0.6454228",
"0.5898071",
"0.57853055",
"0.55045474",
"0.5446288",
"0.5446288",
"0.5402339",
"0.53819317",
"0.53332055",
"0.53084457",
"0.51920485",
"0.5106323",
"0.5092213",
"0.5089909",
"0.5075534",
"0.507473",
"0.50066054",
"0.5005038",
"0.49435043",
"0.49204698",
"0.49003384",
"0.48922616",
"0.48921514",
"0.48673642",
"0.48616087",
"0.48060346",
"0.47522646",
"0.47438428",
"0.47288215"
] |
0.8496563
|
0
|
string packFILLSTYLEARRAY(string ShapeTag, integer FillStyleCount, string FillStyles) returns an SWF FILLSTYLEARRAY string.
|
function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)
{
array_push($this->FMDebug, "packFILLSTYLEARRAY");
if ($FillStyleCount < 0xff) {
$atom = $this->packUI8($FillStyleCount);
} else {
$atom = chr(0xff) . $this->packUI16($FillStyleCount);
}
$atom .= $FillStyles;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packLINESTYLEARRAY($LineStyleCount, $LineStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLEARRAY\");\n\n\t\tif ($LineStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($LineStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom .= char(0xff) . $this->packUI16($LineStyleCount);\n\t\t}\n\n\t\t$atom .= $LineStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function gotravel_mikado_get_font_style_array($first_empty = false) {\n\t\t$font_styles = array(\n\t\t\t'normal' => 'normal',\n\t\t\t'italic' => 'italic'\n\t\t);\n\n\t\treturn $first_empty ? array_merge(array('' => ''), $font_styles) : $font_styles;\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function get($size): array\r\n {\r\n $s = ShapeSettings::AVAILABLE_CHARACTERS['SPACE'];\r\n $f = ShapeSettings::AVAILABLE_CHARACTERS['FILL'];\r\n $e = ShapeSettings::AVAILABLE_CHARACTERS['EDGE'];\r\n \r\n switch ($size) {\r\n case 5:\r\n return [\r\n 1 => [[$s => 3], [$e => 1]],\r\n 2 => [[$s => 3], [$f => 1]],\r\n 3 => [[$s => 2], [$f => 3]],\r\n 4 => [[$s => 1], [$f => 5]],\r\n 5 => [[$f => 7]],\r\n ];\r\n case 7:\r\n return [\r\n 1 => [[$s => 5], [$e => 1]],\r\n 2 => [[$s => 5], [$f => 1]],\r\n 3 => [[$s => 4], [$f => 3]],\r\n 4 => [[$s => 3], [$f => 5]],\r\n 5 => [[$s => 2], [$f => 7]],\r\n 6 => [[$s => 1], [$f => 9]],\r\n 7 => [[$f => 11]],\r\n ];\r\n case 11:\r\n return [\r\n 1 => [[$s => 9], [$e => 1]],\r\n 2 => [[$s => 9], [$f => 1]],\r\n 3 => [[$s => 8], [$f => 3]],\r\n 4 => [[$s => 7], [$f => 5]],\r\n 5 => [[$s => 6], [$f => 7]],\r\n 6 => [[$s => 5], [$f => 9]],\r\n 7 => [[$s => 4], [$f => 11]],\r\n 8 => [[$s => 3], [$f => 13]],\r\n 9 => [[$s => 2], [$f => 15]],\r\n 10 => [[$s => 1], [$f => 17]],\r\n 11 => [[$f => 19]],\r\n ];\r\n default:\r\n return [];\r\n }\r\n }",
"public function getFormStyle()\n {\n $prop = array();\n\n $prop['alignment'] = $this->value['text-align'];\n\n if (isset($this->value['background']['color']) && is_array($this->value['background']['color'])) {\n $prop['fillColor'] = $this->value['background']['color'];\n }\n\n if (isset($this->value['border']['t']['color'])) {\n $prop['strokeColor'] = $this->value['border']['t']['color'];\n }\n\n if (isset($this->value['border']['t']['width'])) {\n $prop['lineWidth'] = $this->value['border']['t']['width'];\n }\n\n if (isset($this->value['border']['t']['type'])) {\n $prop['borderStyle'] = $this->value['border']['t']['type'];\n }\n\n if (!empty($this->value['color'])) {\n $prop['textColor'] = $this->value['color'];\n }\n\n if (!empty($this->value['font-size'])) {\n $prop['textSize'] = $this->value['font-size'];\n }\n\n return $prop;\n }",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function Style_Fill($color=null) {\n\n return array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, \n 'color' => array('rgb' => $color) \n ); \n}",
"function Style_Fill($color=null) {\n\n return array( 'type' => PHPExcel_Style_Fill::FILL_SOLID, \n 'color' => array('rgb' => $color) \n ); \n}",
"public function packingCreate(array $array);",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected static function getCardFormats() : array\n {\n return Formats::getList();\n }",
"public function get_styles() {\n\t\treturn [];\n\t}",
"public static function cssStyleFromArray(array $style): ?string\n {\n $result = '';\n foreach ($style as $name => $value) {\n $result .= \"$name: $value; \";\n }\n\n // Return null if empty to avoid rendering the \"style\" attribute.\n return $result === '' ? null : rtrim($result);\n }",
"public function get_styles () {\r\n\t\treturn empty($this->_data[self::STYLES])\r\n\t\t\t? array()\r\n\t\t\t: $this->_data[self::STYLES]\r\n\t\t;\r\n\t}",
"protected function formatSizes()\n {\n /*\n allow for multiple formats\n 'lg' => 800\n or\n 'lg' => [800, 600]\n or\n 'lg' => ['width' => ..., 'height' => ...]\n */\n foreach (static::sizes() as $key => $size) {\n if (! is_array($size)) {\n $f[$key] = ['width' => $size, 'height' => $size];\n } elseif (! isset($size['width'])) {\n $f[$key] = ['width' => $size[0], 'height' => $size[1]];\n } else {\n $f[$key] = $size;\n }\n }\n\n return $f;\n }",
"private function styles_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Styles', 'formidable' ) . '</h3>'\n\t\t\t . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',\n\t\t\t'prev_page' => 'entries',\n\t\t\t'next_page' => 'import',\n\t\t\t'selector' => '.general-style',\n\t\t\t'position' => array( 'edge' => 'left', 'align' => 'right' ),\n\t\t);\n\t}",
"public function getFormat(): array;",
"function get_font_border_styles( $style = '', $color = '', $width = '' ) {\n\n\t$css = ['', ''];\n\n\tif ( $style == 'yes' || $style == 'hover' ) {\n\n\t\t$css[1] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t$css[0] .= 'box-sizing: border-box;';\n\n\t\tif ( $style == 'yes' ) {\n\t \t\t$css[0] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t} elseif ( $style == 'hover' ) {\n\t\t\t$css[0] .= 'border:' . $width . 'px solid transparent;';\n\t\t}\n\n\t} else {\n\t\t$css[1] .= 'border-color: transparent;';\n\t\t$css[0] .= 'border-color: transparent;';\n\t}\n\n\treturn $css;\n}",
"public function getFills(): array;",
"public function register_style_formats( $init_array ) {\n\t\t$style_formats = array(\n\t\t\t// Each array child is a format with it's own settings\n\t\t\t'headers' => array(\n\t\t\t\t'title' => 'Headers',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Header 1',\n\t\t\t\t\t\t'format' => 'h1',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Header 2',\n\t\t\t\t\t\t'format' => 'h2',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Header 3',\n\t\t\t\t\t\t'format' => 'h3',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Header 4',\n\t\t\t\t\t\t'format' => 'h4',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Header 5',\n\t\t\t\t\t\t'format' => 'h5',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Header 6',\n\t\t\t\t\t\t'format' => 'h6',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'inline' => array(\n\t\t\t\t'title' => 'Inline',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Bold',\n\t\t\t\t\t\t'icon' => 'bold',\n\t\t\t\t\t\t'format' => 'bold',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Italic',\n\t\t\t\t\t\t'icon' => 'italic',\n\t\t\t\t\t\t'format' => 'italic',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Underline',\n\t\t\t\t\t\t'icon' => 'underline',\n\t\t\t\t\t\t'format' => 'underline',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Strikethrough',\n\t\t\t\t\t\t'icon' => 'strikethrough',\n\t\t\t\t\t\t'format' => 'strikethrough',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Superscript',\n\t\t\t\t\t\t'icon' => 'superscript',\n\t\t\t\t\t\t'format' => 'superscript',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Subscript',\n\t\t\t\t\t\t'icon' => 'subscript',\n\t\t\t\t\t\t'format' => 'subscript',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Code',\n\t\t\t\t\t\t'icon' => 'code',\n\t\t\t\t\t\t'format' => 'code',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Lead',\n\t\t\t\t\t\t'classes' => 'lead',\n\t\t\t\t\t\t'inline' => 'span',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'Blocks' => array(\n\t\t\t\t'title' => 'Blocks',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Paragraph',\n\t\t\t\t\t\t'format' => 'p',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Blockquote',\n\t\t\t\t\t\t'format' => 'blockquote',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Div',\n\t\t\t\t\t\t'format' => 'div',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Pre',\n\t\t\t\t\t\t'format' => 'pre',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Section',\n\t\t\t\t\t\t'format' => 'section',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'Alignment' => array(\n\t\t\t\t'title' => 'Alignment',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Left',\n\t\t\t\t\t\t'icon' => 'alignleft',\n\t\t\t\t\t\t'format' => 'alignleft',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Right',\n\t\t\t\t\t\t'icon' => 'alignright',\n\t\t\t\t\t\t'format' => 'alignright',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Center',\n\t\t\t\t\t\t'icon' => 'aligncenter',\n\t\t\t\t\t\t'format' => 'aligncenter',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => 'Justify',\n\t\t\t\t\t\t'icon' => 'alignjustify',\n\t\t\t\t\t\t'format' => 'alignjustify',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'Unordered Lists' => array(\n\t\t\t\t'title' => 'Unordered Lists',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.nobullet',\n\t\t\t\t\t\t'selector' => 'ul',\n\t\t\t\t\t\t'classes' => 'nobullet',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.square',\n\t\t\t\t\t\t'selector' => 'ul',\n\t\t\t\t\t\t'classes' => 'square',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.circle',\n\t\t\t\t\t\t'selector' => 'ul',\n\t\t\t\t\t\t'classes' => 'circle',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.disc',\n\t\t\t\t\t\t'selector' => 'ul',\n\t\t\t\t\t\t'classes' => 'disc',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.bordered',\n\t\t\t\t\t\t'selector' => 'ul',\n\t\t\t\t\t\t'classes' => 'bordered',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'Ordered Lists' => array(\n\t\t\t\t'title' => 'Ordered Lists',\n\t\t\t\t'items' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.nobullet',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'nobullet',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.decimal',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'decimal',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.decimal-leading-zero',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'decimal-leading-zero',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.lower-roman',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'lower-roman',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.upper-roman',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'upper-roman',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.lower-alpha',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'lower-alpha',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.upper-alpha',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'upper-alpha',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.counter',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'counter',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.bordered',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'bordered',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'title' => '.strong',\n\t\t\t\t\t\t'selector' => 'ol',\n\t\t\t\t\t\t'classes' => 'strong',\n\t\t\t\t\t\t'wrapper' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t// Allow filtering further\n\t\t$style_formats = apply_filters( 'mpress_style_formats', $style_formats );\n\t\t// Json encode and place in array\n\t\t$init_array['style_formats'] = json_encode( $style_formats );\n\t\t// return to editor\n\t\treturn $init_array;\n\t}",
"public static function generate_array_default_element_settings($shortcodes=false, $group='', $tag='') {\n $defaults = array();\n if($shortcodes==false) $shortcodes = SUPER_Shortcodes::shortcodes();\n foreach($shortcodes[$group]['shortcodes'][$tag]['atts'] as $k => $v){\n if( !empty( $v['fields'] ) ) {\n foreach( $v['fields'] as $fk => $fv ) {\n if( (isset($fv['type'])) && ($fv['type']=='multicolor') ) {\n foreach( $fv['colors'] as $ck => $cv ) {\n if( isset($fv['default']) ) $defaults[$ck] = $cv['default'];\n }\n }else{\n if( isset($fv['default']) ) $defaults[$fk] = $fv['default'];\n }\n }\n }\n }\n return $defaults;\n }",
"private static function get_styles() {\n\n\t\treturn [\n\t\t\t'basic' => esc_html__( 'Basic', 'wpforms' ),\n\t\t\t'compact' => esc_html__( 'Compact', 'wpforms' ),\n\t\t\t'table' => esc_html__( 'Table', 'wpforms' ),\n\t\t\t'table_compact' => esc_html__( 'Table, Compact', 'wpforms' ),\n\t\t];\n\t}",
"#[ArrayShape(['label' => \"array|string\"])]\n public function definition(): array\n {\n $array = [\n 'label' => 'Check installation',\n 'menu_code' => 'my-space-installer',\n 'package' => 'my-space',\n 'route' => 'setup.installation.my-space',\n 'is_active' => true\n ];\n return $array;\n }",
"private function _readBIFF8Style($recordData)\n\t{\n\t\t$style = array();\n\t\t\n\t\t// offset: 0; size: 2; Index to FONT record\n\t\tif ($this->_GetInt2d($recordData, 0) < 4) {\n\t\t\t$fontIndex = $this->_GetInt2d($recordData, 0);\n\t\t} else {\n\t\t\t// this has to do with that index 4 is omitted in all BIFF versions for some strange reason\n\t\t\t// check the OpenOffice documentation of the FONT record\n\t\t\t$fontIndex = $this->_GetInt2d($recordData, 0) - 1;\n\t\t}\n\t\t$style['font'] = $this->_font[$fontIndex];\n\t\t\n\t\t// offset: 2; size: 2; Index to FORMAT record\n\t\t\t$numberFormatIndex = $this->_GetInt2d($recordData, 2);\n\t\t\t$style['numberformat'] = $this->_readBIFF8NumberFormat($numberFormatIndex);\n\t\t\n\t\t$style['protection'] = array();\n\t\t// offset: 4; size: 2; XF type, cell protection, and parent style XF\n\t\t\t// bit 2-0; mask 0x0007; XF_TYPE_PROT\n\t\t\t$xfTypeProt = $this->_GetInt2d($recordData, 4);\n\t\t\t\t// bit 0; mask 0x01; 1 = cell is locked\n\t\t\t\t$isLocked = (0x01 & $xfTypeProt) >> 0;\n\t\t\t\t$style['protection']['locked'] = $isLocked ? true : false;\n\t\t\t\t// bit 1;\n\t\t\t\t// bit 2;\n\t\t\n\t\t// offset: 6; size: 1; Alignment and text break\n\t\t$style['alignment'] = array();\n\t\t\t// bit 2-0, mask 0x07; horizontal alignment\n\t\t\t$horAlign = (0x07 & ord($recordData[6])) >> 0;\n\t\t\tswitch ($horAlign) {\n\t\t\t\tcase 0: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; break;\n\t\t\t\tcase 1: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT; break;\n\t\t\t\tcase 2: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER; break;\n\t\t\t\tcase 3: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT; break;\n\t\t\t\tcase 5: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY; break;\n\t\t\t}\n\t\t\t// bit 3, mask 0x08; wrap text\n\t\t\t$wrapText = (0x08 & ord($recordData[6])) >> 3;\n\t\t\tswitch ($wrapText) {\n\t\t\t\tcase 0: $style['alignment']['wrap'] = false; break;\n\t\t\t\tcase 1: $style['alignment']['wrap'] = true; break;\n\t\t\t}\n\t\t\t// bit 6-4, mask 0x70; vertical alignment\n\t\t\t$vertAlign = (0x70 & ord($recordData[6])) >> 4;\n\t\t\tswitch ($vertAlign) {\n\t\t\t\tcase 0: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP; break;\n\t\t\t\tcase 1: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER; break;\n\t\t\t\tcase 2: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; break;\n\t\t\t\tcase 3: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY; break;\n\t\t\t}\n\t\t// offset: 7; size: 1; XF_ROTATION: Text rotation angle\n\t\t// offset: 8; size: 1; Indentation, shrink to cell size, and text direction\n\t\t// offset: 9; size: 1; Flags used for attribute groups\n\t\t\n\t\t$style['borders'] = array(\n\t\t\t'left' => array(),\n\t\t\t'right' => array(),\n\t\t\t'top' => array(),\n\t\t\t'bottom' => array(),\n\t\t);\n\t\t// offset: 10; size: 4; Cell border lines and background area\n\t\t\t// bit: 3-0; mask: 0x0000000F; left style\n\t\t\tif ($bordersLeftStyle = $this->_readBorderStyle((0x0000000F & $this->_GetInt4d($recordData, 10)) >> 0)) {\n\t\t\t\t$style['borders']['left']['style'] = $bordersLeftStyle;\n\t\t\t}\n\t\t\t// bit: 7-4; mask: 0x000000F0; right style\n\t\t\tif ($bordersRightStyle = $this->_readBorderStyle((0x000000F0 & $this->_GetInt4d($recordData, 10)) >> 4)) {\n\t\t\t\t$style['borders']['right']['style'] = $bordersRightStyle;\n\t\t\t}\n\t\t\t// bit: 11-8; mask: 0x00000F00; top style\n\t\t\tif ($bordersTopStyle = $this->_readBorderStyle((0x00000F00 & $this->_GetInt4d($recordData, 10)) >> 8)) {\n\t\t\t\t$style['borders']['top']['style'] = $bordersTopStyle;\n\t\t\t}\n\t\t\t// bit: 15-12; mask: 0x0000F000; bottom style\n\t\t\tif ($bordersBottomStyle = $this->_readBorderStyle((0x0000F000 & $this->_GetInt4d($recordData, 10)) >> 12)) {\n\t\t\t\t$style['borders']['bottom']['style'] = $bordersBottomStyle;\n\t\t\t}\n\t\t\t// bit: 22-16; mask: 0x007F0000; left color\n\t\t\tif ($bordersLeftColor = $this->_readColor((0x007F0000 & $this->_GetInt4d($recordData, 10)) >> 16)) {\n\t\t\t\t$style['borders']['left']['color'] = $bordersLeftColor;\n\t\t\t}\n\t\t\t// bit: 29-23; mask: 0x3F800000; right color\n\t\t\tif ($bordersRightColor = $this->_readColor((0x3F800000 & $this->_GetInt4d($recordData, 10)) >> 23)) {\n\t\t\t\t$style['borders']['right']['color'] = $bordersRightColor;\n\t\t\t}\n\t\t\t\n\t\t$style['fill'] = array();\n\t\t// offset: 14; size: 4;\n\t\t\t// bit: 6-0; mask: 0x0000007F; top color\n\t\t\tif ($bordersTopColor = $this->_readColor((0x0000007F & $this->_GetInt4d($recordData, 14)) >> 0)) {\n\t\t\t\t$style['borders']['top']['color'] = $bordersTopColor;\n\t\t\t}\n\t\t\t// bit: 13-7; mask: 0x00003F80; top color\n\t\t\tif ($bordersBottomColor = $this->_readColor((0x00003F80 & $this->_GetInt4d($recordData, 14)) >> 7)) {\n\t\t\t\t$style['borders']['bottom']['color'] = $bordersBottomColor;\n\t\t\t}\n\t\t\t// bit: 31-26; mask: 0xFC000000 fill pattern\n\t\t\tif ($fillType = $this->_getFillPatternByIndex((0xFC000000 & $this->_GetInt4d($recordData, 14)) >> 26)) {\n\t\t\t\t$style['fill']['type'] = $fillType;\n\t\t\t}\n\t\t// offset: 18; size: 2; pattern and background colour\n\t\t\t// bit: 6-0; mask: 0x007F; color index for pattern color\n\t\t\tif ($rgb = $this->_readColor((0x007F & $this->_GetInt2d($recordData, 18)) >> 0)) {\n\t\t\t\t$style['fill']['startcolor'] = $rgb;\n\t\t\t}\n\t\t\t// bit: 13-7; mask: 0x3F80; color index for pattern background\n\t\t\tif ($rgb = $this->_readColor((0x3F80 & $this->_GetInt2d($recordData, 18)) >> 7)) {\n\t\t\t\t$style['fill']['endcolor'] = $rgb;\n\t\t\t}\n\t\treturn $style;\n\t}"
] |
[
"0.6419456",
"0.60140437",
"0.5900259",
"0.5504699",
"0.48440683",
"0.48269296",
"0.47883797",
"0.47883657",
"0.4738978",
"0.47301006",
"0.4727437",
"0.4727437",
"0.47248092",
"0.46514058",
"0.46451342",
"0.4572173",
"0.4544075",
"0.4541758",
"0.44886026",
"0.4475497",
"0.44716024",
"0.44515562",
"0.44509998",
"0.44395146",
"0.4439466",
"0.44219068",
"0.44212204",
"0.4419687",
"0.43854263",
"0.43574312"
] |
0.82096404
|
0
|
string packLINESTYLE(integer Width, integer R, integer G, integer B, integer A) returns an SWF LINESTYLE string.
|
function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)
{
array_push($this->FMDebug, "packLINESTYLE");
$atom = $this->packUI16($Width);
if ($AlphaFlag) {
if ($A == "") {
$A = 0xff;
}
$atom .= $this->packRGBA($R, $G, $B, $A);
} else {
$atom .= $this->packRGB($R, $G, $B);
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packLINESTYLEARRAY($LineStyleCount, $LineStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLEARRAY\");\n\n\t\tif ($LineStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($LineStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom .= char(0xff) . $this->packUI16($LineStyleCount);\n\t\t}\n\n\t\t$atom .= $LineStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function lineStyle()\n {\n return isset($this->data->graphicElement->pen[\"lineStyle\"]) ? (string) $this->data->graphicElement->pen[\"lineStyle\"] : \"Solid\";\n }",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function render() {\n $output = array();\n array_push($output, 0, \"STYLE\");\n array_push($output, 5, $this->getHandle());\n array_push($output, 100, \"AcDbSymbolTableRecord\");\n array_push($output, 100, \"AcDbTextStyleTableRecord\");\n array_push($output, 2, strtoupper($this->name));\n array_push($output, 70, $this->flag);\n array_push($output, 6, $this->lineType);\n return implode(PHP_EOL, $output);\n }",
"public function getLineEndingStyles() {}",
"public function getLineEndingStyles() {}",
"function SetLineStyle($style) {\r\n\t\textract($style);\r\n\t\tif (isset($width)) {\r\n\t\t\t$width_prev = $this->LineWidth;\r\n\t\t\t$this->SetLineWidth($width);\r\n\t\t\t$this->LineWidth = $width_prev;\r\n\t\t}\r\n\t\tif (isset($cap)) {\r\n\t\t\t$ca = array('butt' => 0, 'round'=> 1, 'square' => 2);\r\n\t\t\tif (isset($ca[$cap]))\r\n\t\t\t\t$this->_out($ca[$cap] . ' J');\r\n\t\t}\r\n\t\tif (isset($join)) {\r\n\t\t\t$ja = array('miter' => 0, 'round' => 1, 'bevel' => 2);\r\n\t\t\tif (isset($ja[$join]))\r\n\t\t\t\t$this->_out($ja[$join] . ' j');\r\n\t\t}\r\n\t\tif (isset($dash)) {\r\n\t\t\t$dash_string = '';\r\n\t\t\tif ($dash) {\r\n\t\t\t\t$tab = explode(',', $dash);\r\n\t\t\t\t$dash_string = '';\r\n\t\t\t\tforeach ($tab as $i => $v) {\r\n\t\t\t\t\tif ($i > 0)\r\n\t\t\t\t\t\t$dash_string .= ' ';\r\n\t\t\t\t\t$dash_string .= sprintf('%.2F', $v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!isset($phase) || !$dash)\r\n\t\t\t\t$phase = 0;\r\n\t\t\t$this->_out(sprintf('[%s] %.2F d', $dash_string, $phase));\r\n\t\t}\r\n\t\tif (isset($color)) {\r\n\t\t\tlist($r, $g, $b) = $color;\r\n\t\t\t$this->SetDrawColor($r, $g, $b);\r\n\t\t}\r\n\t}",
"function extract_style($line) {\n $style = null;\n if (preg_match(self::REGEX_STYLE, $line)) {\n $styleAllPlain = preg_replace(self::REGEX_STYLE, ' \\1', $line);\n $styleAll = preg_split('/([.#])/', $styleAllPlain, NULL, PREG_SPLIT_DELIM_CAPTURE);\n for ($i = 1; $i < count($styleAll); $i += 2) {\n if ($styleAll[$i] == '.') {\n $styleClass[] = $styleAll[$i + 1];\n } else if ($styleAll[$i] == '#') {\n $styleId[] = $styleAll[$i + 1];\n }\n }\n if (isset($styleClass) && is_array($styleClass)) {\n $style .= ' class=\"' . implode(' ', $styleClass) . '\"';\n }\n if (isset($styleId) && is_array($styleId)) {\n $style .= ' id=\"' . implode(' ', $styleId) . '\"';\n }\n }\n return $style;\n }",
"public function getLineEndingStyle() {}",
"function get_font_border_styles( $style = '', $color = '', $width = '' ) {\n\n\t$css = ['', ''];\n\n\tif ( $style == 'yes' || $style == 'hover' ) {\n\n\t\t$css[1] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t$css[0] .= 'box-sizing: border-box;';\n\n\t\tif ( $style == 'yes' ) {\n\t \t\t$css[0] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t} elseif ( $style == 'hover' ) {\n\t\t\t$css[0] .= 'border:' . $width . 'px solid transparent;';\n\t\t}\n\n\t} else {\n\t\t$css[1] .= 'border-color: transparent;';\n\t\t$css[0] .= 'border-color: transparent;';\n\t}\n\n\treturn $css;\n}",
"function string() {\n $styles = [];\n if ($this->fg !== null) {\n $styles []= $this->fg;\n }\n\n if ($this->bg !== null) {\n $styles []= $this->bg;\n }\n\n $styles = array_merge($styles, $this->format);\n\n if (empty($styles)) {\n return $this->str;\n } else {\n $escape = \"\\e[\" . join(';', $styles) . 'm';\n return $escape . $this->str . \"\\e[\" . self::ANSI_OFF . 'm';\n }\n }",
"function ps_set_border_style($psdoc, $style, $width)\n{\n}",
"protected function _drawStyle($style) {}",
"public function setLineEndingStyle($lineEndingStyle) {}",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function drawStyle()\r\n\t{\r\n\t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public static function renderStyle( array $styleOptions = array() );",
"function style(){\r\n\t\t// Sorry mom :(\r\n\t\t$style=\"<style>\r\n\t\t\t.debug{\r\n\t\t\t\tposition: relative;\r\n\t\t\t\tpadding: 15px;\r\n\t\t\t\tmargin: 15px;\r\n\t\t\t\tborder: 1px solid black;\r\n\t\t\t\tcolor: black;\r\n\t\t\t\tfont-size: 14px;\r\n\t\t\t\tfont-family: monospace;\r\n\t\t\t\toverflow: auto;\r\n\t\t\t\t\r\n\t\t\t\ttext-align: left;\r\n\t\t\t\tline-height: 14px;\r\n\t\t\t\tborder-radius: 10px;\r\n\t\t\t\tmoz-border-radiuz: 10px;\r\n\t\t\t\t\r\n\t\t\t\tbackground-image: linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -o-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -moz-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -webkit-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\tbackground-image: -ms-linear-gradient(bottom, rgb(251,255,199) 90%, rgb(227,222,157) 100%);\r\n\t\t\t\t\r\n\t\t\t\tbackground-image: -webkit-gradient(\r\n\t\t\t\t\tlinear,\r\n\t\t\t\t\tleft bottom,\r\n\t\t\t\t\tleft top,\r\n\t\t\t\t\tcolor-stop(0.9, rgb(251,255,199)),\r\n\t\t\t\t\tcolor-stop(1, rgb(227,222,157))\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t</style>\r\n\t\t \";\r\n\t\treturn $style;\r\n\t}",
"public static function get_title_style() {\n\t\t$post_id = wpv_get_the_ID();\n\n\t\tif(!current_theme_supports('wpv-page-title-style') || is_null($post_id))\n\t\t\treturn;\n\n\t\t$bgcolor = wpv_sanitize_accent(wpv_post_meta($post_id, 'local-title-background-color', true));\n\t\t$bgimage = wpv_post_meta($post_id, 'local-title-background-image', true);\n\t\t$bgrepeat = wpv_post_meta($post_id, 'local-title-background-repeat', true);\n\t\t$bgsize = wpv_post_meta($post_id, 'local-title-background-size', true);\n\t\t$bgattachment = wpv_post_meta($post_id, 'local-title-background-attachment', true);\n\t\t$bgposition = wpv_post_meta($post_id, 'local-title-background-position', true);\n\n\t\t$style = '';\n\t\tif(!empty($bgcolor))\n\t\t\t$style .= \"background-color:$bgcolor;\";\n\t\tif(!empty($bgimage)) {\n\t\t\t$style .= \"background-image:url('$bgimage');\";\n\t\t\tif(!empty($bgrepeat))\n\t\t\t\t$style .= \"background-repeat:$bgrepeat;\";\n\t\t\tif(!empty($bgsize))\n\t\t\t\t$style .= \"background-size:$bgsize;\";\n\t\t}\n\n\t\treturn $style;\n\t}",
"function printMessage(string $message, int $styleIndex = 0)\n{\n $styles = [\"\\e[0m\", \"\\e[32m\", \"\\e[33m\", \"\\e[31m\"];\n echo \"{$styles[$styleIndex]}{$message}{$styles[0]}\\n\";\n}",
"function SetStyle($tag, $enable)\n{\n $this->$tag += ($enable ? 1 : -1);\n $style = '';\n foreach(array('B', 'I', 'U') as $s)\n {\n if($this->$s>0)\n $style .= $s;\n }\n $this->SetFont('',$style);\n}",
"function SetStyle($tag, $enable)\n{\n $this->$tag += ($enable ? 1 : -1);\n $style = '';\n foreach(array('B', 'I', 'U') as $s)\n {\n if($this->$s>0)\n $style .= $s;\n }\n $this->SetFont('',$style);\n}",
"function __toString(): string\n {\n return $this->lineWidth->toString() . \" w\\n\";\n }",
"function SetStyle($tag, $enable)\r\n{\r\n $this->$tag += ($enable ? 1 : -1);\r\n $style = '';\r\n foreach(array('B', 'I', 'U') as $s)\r\n {\r\n if($this->$s>0)\r\n $style .= $s;\r\n }\r\n $this->SetFont('',$style);\r\n}",
"function SetStyle($tag,$enable)\n{\n $this->$tag+=($enable ? 1 : -1);\n $style='';\n foreach(array('B','I','U') as $s)\n if($this->$s>0)\n $style.=$s;\n $this->SetFont('',$style);\n}",
"function studiare_inline_style($value) {\n\techo studiare_get_inline_style($value);\n}",
"public function getLineStyle()\n {\n\n $color = $this->lineColor();\n\n if (!$color)\n {\n $color = $this->fontColor();\n }\n\n return array(\n 'width' => $this->lineWidth(),\n 'cap' => 'butt', 'join' => 'miter',\n 'dash' => $this->getDash(),\n 'color' => $color\n );\n }",
"function gdl_style_att( $attribute, $value ){\n\t\treturn $attribute . ': ' . $value . '; ';\n\t}",
"public function setLineCapStyle($lineCapStyle) {}"
] |
[
"0.6211077",
"0.5912425",
"0.5907948",
"0.57798314",
"0.5693939",
"0.56922895",
"0.5659433",
"0.5601032",
"0.5544994",
"0.55392694",
"0.5503642",
"0.5495088",
"0.5368116",
"0.5332696",
"0.5322319",
"0.5313093",
"0.52647734",
"0.5240175",
"0.521486",
"0.5202548",
"0.51914084",
"0.5145127",
"0.5145127",
"0.51309586",
"0.51239705",
"0.509948",
"0.5092254",
"0.50885564",
"0.5075596",
"0.5071045"
] |
0.8293128
|
0
|
string packLINESTYLEARRAY(int LineStyleCount, string LineStyles) returns an SWF LINESTYLEARRAY string.
|
function packLINESTYLEARRAY($LineStyleCount, $LineStyles)
{
array_push($this->FMDebug, "packLINESTYLEARRAY");
if ($LineStyleCount < 0xff) {
$atom = $this->packUI8($LineStyleCount);
} else {
$atom .= char(0xff) . $this->packUI16($LineStyleCount);
}
$atom .= $LineStyles;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLEARRAY\");\n\n\t\tif ($FillStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($FillStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom = chr(0xff) . $this->packUI16($FillStyleCount);\n\t\t}\n\n\t\t$atom .= $FillStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function getLineStyle()\n {\n\n $color = $this->lineColor();\n\n if (!$color)\n {\n $color = $this->fontColor();\n }\n\n return array(\n 'width' => $this->lineWidth(),\n 'cap' => 'butt', 'join' => 'miter',\n 'dash' => $this->getDash(),\n 'color' => $color\n );\n }",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function wktBuildLinestring(array $points);",
"public function getLineEndingStyles() {}",
"public function getLineEndingStyles() {}",
"public function lines()\n {\n $array = preg_split('/[\\r\\n]{1,2}/u', $this->str);\n /** @noinspection CallableInLoopTerminationConditionInspection */\n for ($i = 0; $i < count($array); $i++) {\n $array[$i] = static::create($array[$i], $this->encoding);\n }\n\n return $array;\n }",
"public static function multiLineStringToArray($string) {\n return preg_split(\"/\\r?\\n/\", $string);\n }",
"private function _RenderLineXLS($arrLine, $strStyle = NULL, $bolRenderToFile = TRUE)\n \t{\n \t\t// Set first column\n \t\t$intCol\t= ($this->_intColOffset) ? $this->_intColOffset : 0;\n \t\t\n \t\t$arrOutput = Array();\n \t\tforeach ($this->_arrDefine[$arrLine['**Type']] as $strField=>$arrField)\n \t\t{\n \t\t\t// Put in default values\n \t\t\t$arrField['Value']\t\t= ($arrLine[$strField] !== NULL)\t? $arrLine[$strField]\t\t\t\t\t\t\t: $arrField['Value'];\n \t\t\t$arrField['PadChar']\t= ($arrField['PadChar'] !== NULL)\t? $arrField['PadChar']\t\t\t\t\t\t\t: ' ';\n \t\t\t$arrField['PadType']\t= ($arrField['PadType'] !== NULL)\t? $arrField['PadType']\t\t\t\t\t\t\t: STR_PAD_RIGHT;\n \t\t\t$arrField['Value']\t\t= ($arrField['Config'])\t\t\t\t? $this->GetConfigField($arrField['Config'])\t: $arrField['Value'];\n \t\t\t\n \t\t\t// Prepare field\n \t\t\t$arrType = explode('::', $arrField['Type']);\n \t\t\tswitch ($arrType[0])\n \t\t\t{\n \t\t\t\tcase 'Integer':\n \t\t\t\t\t$mixValue\t= (int)$arrField['Value'];\n \t\t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\tcase 'Date':\n \t\t\t\tcase 'Time':\n \t\t\t\t\t$strDate\t= $arrField['Value'];\n \t\t\t\t\tswitch ($arrType[1])\n \t\t\t\t\t{\n \t\t\t\t\t\tcase 'YYYYMMDD':\n \t\t\t\t\t\t\t$strParse\t= $strDate;\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\t\n \t\t\t\t\t\tcase 'YYYY-MM-DD':\n \t\t\t\t\t\t\t$strParse\t= $strDate;\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\n \t\t\t\t\t\tcase 'DD-MM-YYYY':\n \t\t\t\t\t\tcase 'DD/MM/YYYY':\n \t\t\t\t\t\t\t$strParse\t= substr($strDate, -4, 4);\n \t\t\t\t\t\t\t$strParse\t.= substr($strDate, 4, 2);\n \t\t\t\t\t\t\t$strParse\t.= substr($strDate, 0, 2);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\n \t\t\t\t\t\tcase 'HHII':\n \t\t\t\t\t\t\t$strParse\t= date(\"Y-m-d\");\n \t\t\t\t\t\t\t$strParse\t.= substr($strDate, 0, 2) . \":\";\n \t\t\t\t\t\t\t$strParse\t.= substr($strDate, 2, 4) . \":\";\n \t\t\t\t\t\t\t$strParse\t.= \"00\";\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Is it a valid date?\n \t\t\t\t\tif (!strtotime($strParse))\n \t\t\t\t\t{\n\t\t\t\t\t\t$strMessage\t= \"Request #{$arrLine['**Request']}; Field '$strField' with value '$strDate' is not a valid {$arrType[1]} date\";\n\t\t\t\t\t\treturn Array('Pass' => FALSE, 'Line' => $strMessage);\n \t\t\t\t\t}\n \t\t\t\t\t$mixValue\t= $strDate;\n \t\t\t\t\tbreak;\n \t\t\t\t\n \t\t\t\tdefault:\n \t\t\t\t\t// String\n \t\t\t\t\t$mixValue\t= $arrField['Value'];\n \t\t\t\t\tbreak;\n \t\t\t}\n \t\t\t\n\t\t\t// Is this fixed-width?\n\t\t\tif ($arrField['Length'])\n\t\t\t{\n\t\t\t\tif (($intLength = strlen($mixValue)) > $arrField['Length'])\n\t\t\t\t{\n\t\t\t\t\t// Field is too long, fail out\n\t\t\t\t\tCliEcho(\"Request #{$arrLine['**Request']}; Field '$strField' is $intLength chars, truncated to max of {$arrField['Length']} chars\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Pad the field\n\t\t\t\t$mixValue\t= str_pad(substr($mixValue, 0, $arrField['Length']), $arrField['Length'], $arrField['PadChar'], $arrField['PadType']);\n\t\t\t}\n\t\t\t\n\t\t\t// Render XLS line\n\t\t\tif ($bolRenderToFile)\n\t\t\t{\n\t\t\t\tif ($strStyle)\n\t\t\t\t{\n\t\t\t\t\t$this->_wksWorksheet->writeString($this->_intRow, $intCol, $mixValue, $this->_arrFormat[$strStyle]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tswitch ($arrType[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'Integer':\n\t\t\t\t\t\t\t$this->_wksWorksheet->writeNumber($this->_intRow, $intCol, $mixValue, $this->_arrFormat['Integer']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'FNN':\n\t\t\t\t\t\t\t$this->_wksWorksheet->writeNumber($this->_intRow, $intCol, $mixValue, $this->_arrFormat['FNN']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->_wksWorksheet->writeString($this->_intRow, $intCol, $mixValue);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$intCol++;\n \t\t}\n \t\t$this->_intRow++;\n \t\t\n \t\t// Implode Plaintext line\n \t\t$strLine\t\t= implode(';', $arrOutput);\n \t\t\n \t\treturn Array('Pass' => FALSE, 'Line' => $strLine);\n \t}",
"function getStylePropertiesFromInlineStyleCode($code) {\r\n\t$code = preg_replace('/\\/\\*.*\\*\\//s', '', $code);\r\n\tpreg_match_all('/([^:;]*)\\s*:\\s*([^:;]*)\\s*\\;/', $code, $matches);\r\n\t$cleanedProperties = array();\r\n\t$cleanedPropertyValues = array();\t\r\n\t// remove extra spaces (including line breaks)\t\r\n\tforeach($matches[1] as $match) {\r\n\t\t$match = preg_replace('/\\r\\n/', ' ', $match);\r\n\t\t$match = preg_replace('/\\s+/', ' ', $match);\r\n\t\t$match = trim($match);\r\n\t\t$cleanedProperties[] = $match;\r\n\t}\r\n\tforeach($matches[2] as $match) {\r\n\t\t$match = preg_replace('/\\r\\n/', ' ', $match);\r\n\t\t$match = preg_replace('/\\s+/', ' ', $match);\r\n\t\t$match = trim($match);\r\n\t\t$cleanedPropertyValues[] = $match;\t\t\r\n\t}\t\r\n\t$ArrayOfStyleProperties = array($cleanedProperties, $cleanedPropertyValues);\r\n\treturn $ArrayOfStyleProperties;\r\n}",
"function getLines()\n\t{\n\t\t//echo 'font file = ' . $this->calculateFontFile() . ' ' . $this->textFont . '<br>';\n\t\tif(isset($this->lines) && $this->width == $this->lines[\"width\"] && $this->textSize == $this->lines[\"textSize\"])\n\t\t{\n\t\t\treturn $this->lines;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$rawPars = explode(\"\\r\\n\", $this->contents);\n\t\t\t\n\t\t\t//\tgo through each paragraph and find the line breaks\n\t\t\t//\t\twhen we're done we should have an array processed\n\t\t\t//\t\tparagraphs. Each paragraph should be an array of \n\t\t\t//\t\tlines.\n\t\t\t//echo \"the font it is selecting \" . $this->calculateFontFile() . '<br>';\n\t\t\t$this->pdf->selectFont($this->calculateFontFile());\n\t\t\t$lines = array();\n\t\t\t$lines2 = array();\n\t\t\t$lines[\"longest\"] = 0;\n\t\t\t$lines[\"width\"] = $this->width;\n\t\t\t$lines[\"textSize\"] = $this->textSize;\n\t\t\tif(strlen($this->contents) == 1)\n\t\t\t{\n\t\t\t\t$lines[\"longest\"] = $this->pdf->getTextWidth($this->textSize, $this->contents);\n\t\t\t\t$lines[\"length\"][] = $lines[\"longest\"];\n\t\t\t\t$lines[\"text\"][] = $this->contents;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile( list($parNum, $thisPar) = each($rawPars) )\n\t\t\t\t{\n\t\t\t\t\t//\tinit your data\n\n\t\t\t\t\t$len = strlen($thisPar);\n\t\t\t\t\t$last = $len - 1;\n\t\t\t\t\t$lastEnd = -1;\n\t\t\t\t\t$curStart = 0;\n\t\t\t\t\t$curLen = 0;\n\n\t\t\t\t\tif( strlen($thisPar) == 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$lines[\"text\"][] = \"\";\n\t\t\t\t\t\t$lines[\"length\"][] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor($i = 1; $i < $len; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//\tif we are at a breaking point.\n\t\t\t\t\t\t//\t\ta breaking point is either\n\t\t\t\t\t\t//\t\t\ta real char before a space or\n\t\t\t\t\t\t//\t\t\tthe last char in the string\n\n\t\t\t\t\t\tif( (($thisPar[$i] == \" \") && ($thisPar[$i - 1] != \" \")) || ($i == $last) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word = substr($thisPar, $lastEnd + 1, ($i) - $lastEnd);\n\n\t\t\t\t\t\t\t$wordLen = ($this->pdf->getTextWidth($this->textSize, $word));\n\n\t\t\t\t\t\t\t//\tdid we find a line break yet\n\n\t\t\t\t\t\t\tif($i == $last)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $lastEnd + 1, $i - $lastEnd);\n\t\t\t\t\t\t\t\t\t$word = trim($word);\n\t\t\t\t\t\t\t\t\t$this->pdf->getTextWidth($this->textSize, $word);\n\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $wordLen;\n\t\t\t\t\t\t\t\t\tif($wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $wordLen;\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\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $i - $curStart + 1);\n\t\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen + $wordLen;\n\t\t\t\t\t\t\t\t\tif($curLen + $wordLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen + $wordLen;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( $curLen + $wordLen > $this->width )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$line = substr($thisPar, $curStart, $lastEnd - $curStart + 1);\n\t\t\t\t\t\t\t\t$lines[\"text\"][] = $line;\n\t\t\t\t\t\t\t\t$lines[\"length\"][] = $curLen;\n\t\t\t\t\t\t\t\tif($curLen > $lines[\"longest\"])\n\t\t\t\t\t\t\t\t\t$lines[\"longest\"] = $curLen;\n\n\t\t\t\t\t\t\t\t$curLen = $wordLen;\n\t\t\t\t\t\t\t\t$curStart = $lastEnd + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$curLen += $wordLen;\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t$lastEnd = $i;\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\t$this->lines = $lines;\n\t\t\t//$this->pdf->selectFont(ZOOP_DIR . \"/pdf/fonts/Helvetica-Bold.afm\");\n\t\t\t//echo_r($lines);\n\t\t\t//echo 'font = ' . $this->textFont . ' bold = ' . ($this->bold ? 1 : 0) . ' italics = ' . ($this->italics ? 1 : 0) . ' size = ' . $this->textSize . ' ' . $this->bold . ' ' . $this->bold . '<br>';\n\t\t\t//echo 'true length = ' . $this->pdf->getTextWidth($this->textSize, 'asdfkla sdfklasdfjlkas;dfgj aslkfj alkw[sfjeoifjsa fi;awesfil;ifas efjilse;filaws eji iiiiiiiiiiiiiii') . '<br>';\n\t\t\treturn $this->lines;\n\t\t}\n\t}",
"public function getLineItems(): array;",
"public function get_styles() {\n\t\treturn [];\n\t}",
"public function getLinesToArray($multilines){\n $arrayTmp = array();\n $array = array();\n \n $arrayTmp = explode(\"\\n\", $multilines);\n foreach($array AS $item){\n $array[] = ereg_replace(\"[[:cntrl:]]\", \"\", $item);\n }\n return $array;\n }",
"function NbLinesSplit($w,$txt,$lineno)\n{\n $cw=&$this->CurrentFont['cw'];\n if($w==0)\n $w=$this->w-$this->rMargin-$this->x;\n $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;\n $s=str_replace(\"\\r\",'',$txt);\n $nb=strlen($s);\n if($nb>0 and $s[$nb-1]==\"\\n\")\n $nb--;\n $sep=-1;\n $i=0;\n $j=0;\n $l=0;\n $nl=1;\n $cnt=0;\n while($i<$nb)\n {\n $c=$s[$i];\n $cnt+=1;\n \t\t$a[$cnt]= $nl;\n if($nl==$lineno){\n \t$Stringposition=$i;\n \tbreak;\n }\n if($c==\"\\n\")\n {\n $i++;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n continue;\n }\n if($c==' ')\n $sep=$i;\n $l+=$cw[$c];\n \t \n if($l>$wmax)\n {\n if($sep==-1)\n {\n if($i==$j)\n $i++;\n }\n else\n $i=$sep+1;\n $sep=-1;\n $j=$i;\n $l=0;\n $nl++;\n \n }\n else{\n $i++;\n \n }\n /* if($nl=='12'){\n \t$Stringposition=$i;\n \tbreak;\n }*/\n }\n return $Stringposition;\n}",
"protected function getStyle()\n {\n return explode(\n ',',\n Mage::getStoreConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_DYNAMIC_COUPON_STYLE)\n );\n }",
"function BuildStyleList($FileName, $InclStandard, $InclID, $InclSubStyle)\n {\n $array=array();\n\n if (($FileName === \"\") || (!file_exists($FileName))) return $array;\n if (($file = fopen($FileName, \"r\")) == false) return $array;\n\n // Preload File, Parse out comments\n $flag = false;\n while (!feof($file))\n {\n $line = fgets($file, 4096);\n $line = trim($line);\n while ($line != \"\")\n {\n if ($flag)\n {\n $pos = strpos($line, \"*/\");\n if ($pos === false) $line = \"\";\n else\n {\n $line = substr($line, $pos + 3, strlen($line));\n $flag = false;\n }\n }\n else\n {\n $pos = strpos($line, \"/*\");\n if ($pos === false)\n {\n $lines[] = $line;\n $line = \"\";\n }\n else\n {\n $flag = true;\n if ($pos !== 0)\n {\n $temp = trim(substr($line, 0, $pos));\n if (!$temp===\"\") $lines[] = $temp;\n }\n $line = substr($line, $pos + 2, strlen($line));\n }\n }\n }\n }\n fclose($file);\n // Nothing to work with\n if ((!isset($lines)) || (count($lines) == 0)) return $array;\n\n // Parse lines, remove CSS Definitions\n reset($lines);\n $flag = false;\n $lines2=array();\n while (list($index, $line) = each($lines))\n {\n while ($line!==\"\")\n {\n if ($flag)\n {\n $pos = strpos($line, \"}\");\n if ($pos === false) $line = \"\";\n else\n {\n $line = trim(substr($line, $pos + 1, strlen($line)));\n $flag = false;\n }\n }\n else\n {\n $pos = strpos($line, \"{\");\n if ($pos === false)\n {\n if (($line!==\"\") && (!in_array($line, $lines2)))\n $lines2[] = $line;\n $line = \"\";\n }\n else\n {\n $flag = true;\n if ($pos !== 0)\n {\n $temp = trim(substr($line, 0, $pos));\n if ($temp!==\"\")\n if ((!isset($lines2)) || (!in_array($temp, $lines2)))\n $lines2[] = $temp;\n }\n $line = trim(substr($line, $pos + 1, strlen($line)));\n }\n }\n }\n }\n // Nothing to work with\n if ((!isset($lines2)) || (count($lines2) == 0)) return $array;\n\n // Prepare style list\n reset($lines2);\n while (list(, $line) = each($lines2))\n {\n $words = explode(\",\", $line);\n reset($words);\n while (list(, $word) = each($words))\n {\n $word = trim($word);\n if ($word == \"\") continue;\n\n if ($InclSubStyle == 0)\n {\n $pos1 = strpos($word, '.');\n $pos2 = strpos($word, '#');\n if (($pos1 === 0) || ($pos2 === 0))\n {\n $prefix = $word{0};\n $word = trim(substr($word, 1, strlen($word)));\n $parts = preg_split('/[ .#]/', $word);\n reset($parts);\n $part = $prefix . trim(current($parts));\n }\n else\n {\n $parts = preg_split('/[ .#]/', $word); \n reset($parts);\n $part = trim(current($parts));\n }\n }\n else\n $part = $word;\n\n if (trim($part) == \"\") continue;\n\n if ((isset($array)) && (in_array($part, $array))) continue;\n\n $pos1 = strpos($part, '.');\n $pos2 = strpos($part, '#');\n if ((($InclStandard == 1) && ($pos1 === false) && ($pos2 === false))\n || (($InclID == 1) && ($pos2 === 0))\n || ($pos1 === 0)\n )\n {\n $array[] = $part;\n }\n }\n }\n return $array;\n }",
"public function getLineEndingStyle() {}",
"public function getLines();",
"public function getLines();",
"public function getLineStyleProperty($elements)\n {\n return $this->getArrayElementsValue($this->lineStyleProperties, $elements);\n }",
"private function snippetArrayToLines($snips)\n\t{\n\t\t$lines = array();\n\n\t\tforeach ($snips as $snip) {\n\t\t\t$snip = explode(\"\\n\", $snip);\n\t\t\t$lines = array_merge($lines, $snip);\n\t\t}\n\n\t\treturn $lines;\n\t}",
"public function get_styles () {\r\n\t\treturn empty($this->_data[self::STYLES])\r\n\t\t\t? array()\r\n\t\t\t: $this->_data[self::STYLES]\r\n\t\t;\r\n\t}",
"protected function _RenderLine($arrLine, $strStyle = NULL, $bolRenderToFile = TRUE)\n \t{\n \t\tswitch ($this->_strFileFormat)\n \t\t{\n \t\t\tcase 'XLS':\n \t\t\t\t$arrResult\t= $this->_RenderLineXLS($arrLine, $strStyle, $bolRenderToFile);\n \t\t\t\t//CliEcho($arrResult['Line']);\n \t\t\t\tbreak;\n \t\t\t\t\n \t\t\tdefault:\n \t\t\t\t$arrResult\t= $this->_RenderLineTXT($arrLine, $bolRenderToFile);\n \t\t\t\t//CliEcho($arrResult['Line']);\n \t\t\t\tbreak;\n \t\t}\n \t\t\n \t\treturn $arrResult;\n \t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function lineStyle()\n {\n return isset($this->data->graphicElement->pen[\"lineStyle\"]) ? (string) $this->data->graphicElement->pen[\"lineStyle\"] : \"Solid\";\n }",
"public function wktGenerateLinestring(array $start = NULL, $segments = NULL);",
"private function build_lines_aggregate_array(){\n\n\t\t$this->lines_aggregate_array = array();\n\t\tforeach($this->per_team_lines[0] as $key => $value){\n\t\t\t$line_play_type = null;\n\t\t\tif($key === 'women_doubles'){\n\t\t\t\t$line_play_type = 'wd';\n\t\t\t}\n\t\t\telse if($key === 'men_doubles'){\n\t\t\t\t$line_play_type = 'md';\n\t\t\t}\n\t\t\telse if($key === 'women_singles'){\n\t\t\t\t$line_play_type = 'ws';\n\t\t\t}\n\t\t\telse if($key === 'men_singles'){\n\t\t\t\t$line_play_type = 'ms';\n\t\t\t}\n\t\t\telse if($key === 'mixed_doubles'){\n\t\t\t\t$line_play_type = 'xd';\n\t\t\t}\n\t\t\telse if($key === 'mixed_singles'){\n\t\t\t\t$line_play_type = 'xs';\n\t\t\t}\n\t\t\tif($line_play_type !== null){\n\t\t\t\tarray_push($this->lines_aggregate_array, array(\n\t\t\t\t\t'line_play_type' => $line_play_type,\n\t\t\t\t\t'count' => $value\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t}",
"public function render() {\n $output = array();\n array_push($output, 0, \"STYLE\");\n array_push($output, 5, $this->getHandle());\n array_push($output, 100, \"AcDbSymbolTableRecord\");\n array_push($output, 100, \"AcDbTextStyleTableRecord\");\n array_push($output, 2, strtoupper($this->name));\n array_push($output, 70, $this->flag);\n array_push($output, 6, $this->lineType);\n return implode(PHP_EOL, $output);\n }"
] |
[
"0.62705845",
"0.580934",
"0.56910366",
"0.5491188",
"0.54462826",
"0.5225337",
"0.52241683",
"0.5130334",
"0.507651",
"0.5056019",
"0.5045188",
"0.49905744",
"0.49734467",
"0.4969315",
"0.49660856",
"0.49006063",
"0.48733947",
"0.48434487",
"0.4840043",
"0.48370647",
"0.48370647",
"0.48186558",
"0.48140958",
"0.48137802",
"0.47918248",
"0.47913808",
"0.47479448",
"0.47237295",
"0.47205338",
"0.47200316"
] |
0.85582846
|
0
|
string packCURVEDEDGERECORD( integer ControlDeltaX, integer ControlDeltaY, integer AnchorDeltaX, integer AnchorDeltaY) returns an SWF CURVEDEDGERECORD string.
|
function packCURVEDEDGERECORD($ControlDeltaX, $ControlDeltaY, $AnchorDeltaX, $AnchorDeltaY)
{
array_push($this->FMDebug, "packCURVEDEDGERECORD");
$TypeFlag = "1";
$StraightEdge = "0";
$ControlDeltaX = $this->packSBchunk($ControlDeltaX);
$ControlDeltaY = $this->packSBchunk($ControlDeltaY);
$AnchorDeltaX = $this->packSBchunk($AnchorDeltaX);
$AnchorDeltaY = $this->packSBchunk($AnchorDeltaY);
$NumBits = (int) max(strlen($ControlDeltaX), strlen($ControlDeltaY), strlen($AnchorDeltaX), strlen($AnchorDeltaY));
$nBits = $this->packnBits($NumBits - 2, 4);
$ControlDeltaX = str_repeat(substr($ControlDeltaX, 0, 1), ($NumBits - strlen($ControlDeltaX))) . $ControlDeltaX;
$ControlDeltaY = str_repeat(substr($ControlDeltaY, 0, 1), ($NumBits - strlen($ControlDeltaY))) . $ControlDeltaY;
$AnchorDeltaX = str_repeat(substr($AnchorDeltaX, 0, 1), ($NumBits - strlen($AnchorDeltaX))) . $AnchorDeltaX;
$AnchorDeltaY = str_repeat(substr($AnchorDeltaY, 0, 1), ($NumBits - strlen($AnchorDeltaY))) . $AnchorDeltaY;
$atom = $TypeFlag . $StraightEdge . $nBits . $ControlDeltaX . $ControlDeltaY . $AnchorDeltaX . $AnchorDeltaY;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSTRAIGHTEDGERECORD($GeneralLineFlag, $VertLineFlag, $DeltaX, $DeltaY)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRAIGHTEDGERECORD\");\n\n\t\t$TypeFlag = \"1\";\n\t\t$StraightEdge = \"1\";\n\n\t\tif (($DeltaX == 0) and ($DeltaY == 0)) {\n\n\t\t\t$atom = sprintf(\"%1d\", $TypeFlag) . sprintf(\"%1d\", $StraightEdge) . \"0\" ;\n\n\t\t} else {\n\n\t\t\t$DeltaX = $this->packSBchunk($DeltaX); \n\t\t\t$DeltaY = $this->packSBchunk($DeltaY);\n\n\t\t\t$NumBits = (int) max(strlen($DeltaX), strlen($DeltaY));\n\n\t\t\t$nBits = $this->packnBits(($NumBits - 2), 4);\n\n\t\t\t$DeltaX = str_repeat(substr($DeltaX, 0, 1), ($NumBits - strlen($DeltaX))) . $DeltaX;\n\t\t\t$DeltaY = str_repeat(substr($DeltaY, 0, 1), ($NumBits - strlen($DeltaY))) . $DeltaY;\n\n\t\t\t$atom = sprintf(\"%1d\", $TypeFlag) . sprintf(\"%1d\", $StraightEdge) . $nBits . sprintf(\"%1d\", $GeneralLineFlag);\n\n\t\t\tif ($GeneralLineFlag) {\n\n\t\t\t\t$atom .= $DeltaX . $DeltaY;\n\n\t\t\t} else {\n\n\t\t\t\tif ($VertLineFlag) {\n\n\t\t\t\t\t$atom .= sprintf(\"%1d\", $VertLineFlag) . $DeltaY; \n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= sprintf(\"%1d\", $VertLineFlag) . $DeltaX; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function dragonCurve(string $input): string\n{\n $b = $input;\n $b = strrev($b);\n $length = strlen($b);\n for ($i = 0; $i < $length; $i++) {\n $b[$i] = $b[$i] === '1' ? '0' : '1';\n }\n return $input . '0' . $b;\n}",
"function stepper($angle){\n $a = $angle-10;\n if( $a > 170) { $a = 180-($a-180); }\n $a = $a/10;\n\n // Number of units between biggest and smallest\n $steps = 18;\n\n // Start color\n $r1 = 15;\n $g1 = 9;\n $b1 = 8;\n\n // End color\n $r2 = 71;\n $g2 = 103;\n $b2 = 146;\n\n $steps = ($steps + 1);\n $r_diff = abs($r1-$r2)/$steps;\n $g_diff = abs($g1-$g2)/$steps;\n $b_diff = abs($b1-$b2)/$steps;\n\n $r1 = $r1 - ($r_diff*$a); \n $g1 = $g1 - ($g_diff*$a); \n $b1 = $b1 - ($b_diff*$a); \n\n return \n str_pad(dechex($r1),2,0,STR_PAD_LEFT).\n str_pad(dechex($g1),2,0,STR_PAD_LEFT).\n str_pad(dechex($b1),2,0,STR_PAD_LEFT);\n\n}",
"private function createOrd()\n {\n $point1 = new Point(\n $this->style->canvas->left,\n $this->style->canvas->top - $this->style->axes->ord->marginY\n );\n\n $point2 = new Point(\n $point1->x,\n $this->style->canvas->top + $this->style->canvas->height\n );\n\n return $this->getLine(\n $point1,\n $point2,\n $this->style->axes->ord->color,\n $this->style->axes->ord->thickness\n );\n }",
"public function complementary()\n {\n return $this->hueShift(180);\n }",
"private function getDel()\n\t{\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn '';\n\t\t\n\t\techo '<input type=\"button\" value=\"'.$this->TXT_BUTTON_DEL.'\" ';\n\t\techo 'onclick=\"delImg('.$this->aImg['albumId'].','.$this->aImg['id'].', \\''.$this->TXT_JS_PROMPT.'\\');\" ';\n\t\techo '/>';\n\t}",
"public function toHex()\n\t{\n\t\treturn sprintf('#%s%s%s', Strings::padLeft(dechex($this->r), 2, '0'), Strings::padLeft(dechex($this->g), 2, '0'), Strings::padLeft(dechex($this->b), 2, '0'));\n\t}",
"function NombreCursoColor($varcursocolor)\n{\n\tif ($varcursocolor == 1) return \"linear-gradient(\n to right bottom, \n rgba(54, 227, 250, 0.589),\n rgba(36, 154, 250, 0.795)\n )\";\n\tif ($varcursocolor == 2) return \"linear-gradient(\n to right bottom, \n rgba(1, 152, 252, 0.363),\n rgba(0, 80, 126, 0.534)\n\t)\";\n\tif ($varcursocolor == 3) return \"linear-gradient(\n to right bottom,\n rgba(250, 184, 60, 0.849),\n rgba(253, 151, 18, 0.63)\n\t)\";\n\tif ($varcursocolor == 4) return \"linear-gradient(\n to right bottom,\n rgba(250, 145, 60, 0.849),\n rgba(252, 64, 6, 0.63)\n )\";\n\tif ($varcursocolor == 5) return \"linear-gradient(\n to right bottom,\n rgba(248, 150, 121, 0.795),\n rgba(250, 91, 52, 0.774)\n )\";\n\tif ($varcursocolor == 6) return \"linear-gradient(\n to right bottom,\n rgba(165, 61, 1, 0.795),\n rgba(71, 32, 1, 0.774)\n )\";\n\tif ($varcursocolor == 7) return \"linear-gradient(\n to right bottom, \n rgba(76, 1, 252, 0.363),\n rgba(38, 0, 126, 0.534)\n )\";\n}",
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function cercle($cx,$cy,$r){\n return \"<circle cx=\\\"$cx\\\" cy=\\\"$cy\\\" r=\\\"$r\\\" />\";\n}",
"function _paintJS()\r\n {\r\n $result = \"\";\r\n\r\n $w = max($this->Width, 1);\r\n $h = max($this->Height, 1);\r\n\r\n if ($this->_bevelstyle == bsLowered)\r\n {\r\n $color1 = \"#000000\";\r\n $color2 = \"#EEEEEE\";\r\n }\r\n else\r\n {\r\n $color1 = \"#EEEEEE\";\r\n $color2 = \"#000000\";\r\n };\r\n\r\n switch ($this->_shape)\r\n {\r\n case bsFrame:\r\n $temp = $color1;\r\n $color1 = $color2;\r\n $result .= $this->BevelRect(1, 1, $w - 1, $h - 1, $color1, $color2);\r\n $color2 = $temp;\r\n $color1 = $temp;\r\n $result .= $this->BevelRect(0, 0, $w - 2, $h - 2, $color1, $color2);\r\n break;\r\n case bsTopLine:\r\n $result .= $this->BevelLine($color1, 0, 0, $w, 0);\r\n $result .= $this->BevelLine($color2, 0, 1, $w, 1);\r\n break;\r\n case bsBottomLine:\r\n $result .= $this->BevelLine($color1, 0, $h - 2, $w, $h - 2);\r\n $result .= $this->BevelLine($color2, 0, $h - 1, $w, $h - 1);\r\n break;\r\n case bsLeftLine:\r\n $result .= $this->BevelLine($color1, 0, 0, 0, $h);\r\n $result .= $this->BevelLine($color2, 1, 0, 1, $h);\r\n break;\r\n case bsRightLine:\r\n $result .= $this->BevelLine($color1, $w - 2, 0, $w - 2, $h);\r\n $result .= $this->BevelLine($color2, $w - 1, 0, $w - 1, $h);\r\n break;\r\n case bsSpacer:\r\n break;\r\n default: // bsBox\r\n $result .= $this->BevelRect(0, 0, $w - 1, $h - 1, $color1, $color2);\r\n break;\r\n }\r\n\r\n return $result;\r\n }",
"public function getSides(){\n $str=\"\";\n foreach ($this->sides as $side){\n $str .= (strlen($str) === 0)?$side:\", $side\";\n }\n return \"[$str]\";\n }",
"public function &draw_movedown_button($in_tag, $in_value = false)\n {\n $text = \"\";\n //$text .= '<TD class=\"reportico-maintain-up-down-button-cell\">';\n $text .= '<input class=\"reportico-maintain-move-down-button reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . '_MOVEDOWN\" value=\"\">';\n //$text .= '</TD>';\n return $text;\n }",
"private function DMStoDEC($_deg, $_min, $_sec, $_ref)\n {\n\n $_array = explode('/', $_deg);\n $_deg = $_array[0] / $_array[1];\n $_array = explode('/', $_min);\n $_min = $_array[0] / $_array[1];\n $_array = explode('/', $_sec);\n $_sec = $_array[0] / $_array[1];\n\n $_coordinate = $_deg + ((($_min * 60) + ($_sec)) / 3600);\n /**\n * + + = North/East\n * + - = North/West\n * - - = South/West\n * - + = South/East\n */\n if ('s' === strtolower($_ref) || 'w' === strtolower($_ref)) {\n // Negatify the coordinate\n $_coordinate = 0 - $_coordinate;\n }\n\n return $_coordinate;\n }",
"public function &draw_delete_button($in_tag, $in_value = false)\n {\n $text = \"\";\n //$text .= '<TD class=\"reportico-maintain-up-down-button-cell\">';\n $text .= '<input class=\"reportico-maintain-delete-button reportico-submit\" type=\"submit\" name=\"submit_' . $in_tag . '_DELETE\" value=\"\">';\n //$text .= '</TD>';\n return $text;\n }",
"public function __toString() {\n\t\tif (!$this->isBound()) {\n\t\t\treturn 'DImage '.$this->id.' [not bound]';\n\t\t}\n\t\t$r = 'DImage '.$this->id.' ['.$this->info;\n\t\tif ($this->getFrameCount() > 1) {\n\t\t\t$r .= ' frames:'.$this->getFrameCount();\n\t\t}\n\t\t$r .= ' #'.$this->getResourceID();\n\t\t$r .= ']';\n\t\treturn $r;\n\t}",
"public static function createDELbutton($id, $js_routine='alert(\"no js-routine to delete\");'){\n\t\tif(empty($id)) return \"<span>xDELx</span>\";\n\t\treturn \"<button type='button' class='btn_del' onclick='{$js_routine}({$id})'>del</button>\";\n\t}",
"private function getCaptionButton()\n\t{\t\t\n\t\t\n\t\t$link = '<input type=\"button\" onclick=\"editCaption(';\n\t\t$link .= $this->aImg['albumId'].', '.$this->aImg['id'].');\" value=\"%s\"/>';\n\t\t\n\t\tif($this->aImg['sCaption'])\n\t\t{\n\t\t\t$link = sprintf(\n\t\t\t\t$link,\t\t\t\t\n\t\t\t\t$this->TXT_LINK_EDIT\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$link = sprintf(\n\t\t\t\t$link,\t\t\t\t\n\t\t\t\t$this->TXT_LINK_ADD\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $link;\n\t}",
"public function __toString()\n {\n return sprintf(\n \"<%s,%s>\",\n (string) $this->center,\n $this->radius\n );\n }",
"private function getFourthCommand()\n {\n // ORDER_4_PHASE_1\n $phase1 = new Phase();\n $phase1->ottp = static::ORDER_4_PHASE_1;\n\n // ORDER_4_PHASE_2\n $phase2 = new Phase();\n $phase2->ottp = static::ORDER_4_PHASE_2;\n\n // ORDER_4\n $command = new Command();\n $command->ortr = static::ORDER_4;\n $command->phases = [ 0 => $phase1, 1 => $phase2 ];\n\n return $command;\n }",
"function phpkd_vblvb_color_picker_element($x, $y, $color)\n{\n\tglobal $vbulletin;\n\treturn \"\\t\\t<td style=\\\"background:$color\\\" id=\\\"sw$x-$y\\\"><img src=\\\"../\" . $vbulletin->options['cleargifurl'] . \"\\\" alt=\\\"\\\" style=\\\"width:11px; height:11px\\\" /></td>\\r\\n\";\n}",
"public static function v4Thumb(): string\n {\n return sprintf(\n '%s-%04x-%04x-%04x-%04x%04x%04x',\n 'Thumb',\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n // 48 bits for \"node\"\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }",
"function Ellipse($x,$y,$rx,$ry,$style='D')\n\t\t{\n\t\t\tif($style=='F') $op='f';\n\t\t\telseif($style=='FD' or $style=='DF') $op='B';\n\t\t\telse $op='S';\n\t\t\t$lx=4/3*(M_SQRT2-1)*$rx;\n\t\t\t$ly=4/3*(M_SQRT2-1)*$ry;\n\t\t\t$k=$this->k;\n\t\t\t$h=$this->h;\n\t\t\t$this->_out(sprintf('%.2f %.2f m %.2f %.2f %.2f %.2f %.2f %.2f c',\n\t\t\t\t($x+$rx)*$k,($h-$y)*$k,\n\t\t\t\t($x+$rx)*$k,($h-($y-$ly))*$k,\n\t\t\t\t($x+$lx)*$k,($h-($y-$ry))*$k,\n\t\t\t\t$x*$k,($h-($y-$ry))*$k));\n\t\t\t$this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c',\n\t\t\t\t($x-$lx)*$k,($h-($y-$ry))*$k,\n\t\t\t\t($x-$rx)*$k,($h-($y-$ly))*$k,\n\t\t\t\t($x-$rx)*$k,($h-$y)*$k));\n\t\t\t$this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c',\n\t\t\t\t($x-$rx)*$k,($h-($y+$ly))*$k,\n\t\t\t\t($x-$lx)*$k,($h-($y+$ry))*$k,\n\t\t\t\t$x*$k,($h-($y+$ry))*$k));\n\t\t\t$this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c %s',\n\t\t\t\t($x+$lx)*$k,($h-($y+$ry))*$k,\n\t\t\t\t($x+$rx)*$k,($h-($y+$ly))*$k,\n\t\t\t\t($x+$rx)*$k,($h-$y)*$k,\n\t\t\t\t$op));\n\t\t}",
"protected static function rc4 ( $a , $b )\n {\n for ( $f = \"\" , $d = 0 , $i = 0 , $y = 0 , $c ; $i < 256 ; $i++ )\n {\n $c [ $i ] = $i;\n }\n for ( $i = 0 , $d , $e , $g = strlen ( $a ) ; $i < 256 ; $i++ )\n {\n $d = ( $d + $c [ $i ] + ord ( $a [ $i % $g ] ) ) % 256;\n $e = $c [ $i ];\n $c [ $i ] = $c [ $d ];\n $c [ $d ] = $e;\n }\n for ( $y , $i , $d = 0 , $f ; $y < strlen ( $b ) ; $y++ )\n {\n $i = ( $i + 1 ) % 256;\n $d = ( $d + $c [ $i ] ) % 256;\n $e = $c [ $i ];\n $c [ $i ] = $c [ $d ];\n $c [ $d ] = $e;\n $f .= chr ( ord ( $b [ $y ] ) ^ $c [ ( $c [ $i ] + $c [ $d ] ) % 256 ] );\n }\n return $f;\n }",
"function fiftyone_degrees_get_signature_string($signature, $headers) {\n $bytes = array();\n $length = fiftyone_degrees_get_signature_length($signature, $headers);\n for($i = 0; $i < $length; $i++) {\n $bytes[$i] = ord('_');\n }\n foreach ($signature['node_indexs'] as $node_index) {\n $node = fiftyone_degrees_read_node($node_index, $headers);\n $node_characters = fiftyone_degrees_get_node_characters($node, $headers);\n $node_char_count = count($node_characters);\n for ($i = 0; $i < $node_char_count; $i++) {\n $bytes[$node['position'] + $i + 1] = $node_characters[$i];\n }\n }\n $string = '';\n foreach($bytes as $byte) {\n $string .= chr($byte);\n }\n return $string;\n}",
"function get_markup() \n\t{\n\t\t$n = count($this->coor);\n\n\t\tif ($n == 0) {\n\t\t\t# Range is special case\n\t\t\treturn $this->make_position( $this->latdeg_min, \n\t\t\t\t\t\t $this->londeg_min )\n\t\t\t . \" to \"\n\t\t\t . $this->make_position( $this->latdeg_max,\n\t\t\t\t\t\t $this->londeg_max );\n\t\t} elseif ($n == 2) {\n\t\t\treturn $this->coor[0].';'.\n\t\t\t $this->coor[1];\n\n\t\t} elseif ($n == 4) {\n\t\t\treturn $this->coor[0].'° '.\n\t\t\t $this->coor[1].' '.\n\t\t\t $this->coor[2].'° '.\n\t\t\t $this->coor[3];\n\n\t\t} elseif ($n == 6) {\n\t\t\treturn $this->coor[0].'°'.\n\t\t\t $this->coor[1].'′ '.\n\t\t\t $this->coor[2].' '.\n\t\t\t $this->coor[3].'°'.\n\t\t\t $this->coor[4].'′ '.\n\t\t\t $this->coor[5];\n\n\t\t} elseif ($n == 8) {\n\t\t\treturn $this->coor[0].'°'.\n\t\t\t $this->coor[1].'′'.\n\t\t\t $this->coor[2].'″ '.\n\t\t\t $this->coor[3].' '.\n\t\t\t $this->coor[4].'°'.\n\t\t\t $this->coor[5].'′'.\n\t\t\t $this->coor[6].'″ '.\n\t\t\t $this->coor[7];\n\t\t} else {\n\t\t\treturn $this->get_error();\n\t\t}\n\t}",
"function getData(string $initial, int $length): string\n{\n $data = $initial;\n while (strlen($data) < $length) {\n $data = dragonCurve($data);\n }\n\n return substr($data, 0, $length);\n}",
"public function __toString(): string\n {\n $aString = array();\n $aString['shape'] = 'equilateral triangle';\n $aString['side'] = $this->side;\n $aString['area'] = $this->getArea();\n $aString['perimeter'] = $this->getPerimeter();\n return json_encode($aString);\n }"
] |
[
"0.5591843",
"0.5437215",
"0.5128616",
"0.5018663",
"0.43794337",
"0.43203098",
"0.42786032",
"0.4208354",
"0.41687718",
"0.41169554",
"0.41010457",
"0.40476498",
"0.40292555",
"0.40269917",
"0.40216148",
"0.40120408",
"0.39870292",
"0.39774537",
"0.39440122",
"0.39437082",
"0.39347202",
"0.3929913",
"0.39260206",
"0.39058742",
"0.3903882",
"0.38968438",
"0.38916743",
"0.3890193",
"0.38722074",
"0.3870765"
] |
0.805668
|
0
|
string packSTRAIGHTEDGERECORD( boolean GeneralLineFlag, boolean VertLineFlag, integer DeltaX, integer DeltaY) returns an SWF STRAIGHTEDGERECORD string.
|
function packSTRAIGHTEDGERECORD($GeneralLineFlag, $VertLineFlag, $DeltaX, $DeltaY)
{
array_push($this->FMDebug, "packSTRAIGHTEDGERECORD");
$TypeFlag = "1";
$StraightEdge = "1";
if (($DeltaX == 0) and ($DeltaY == 0)) {
$atom = sprintf("%1d", $TypeFlag) . sprintf("%1d", $StraightEdge) . "0" ;
} else {
$DeltaX = $this->packSBchunk($DeltaX);
$DeltaY = $this->packSBchunk($DeltaY);
$NumBits = (int) max(strlen($DeltaX), strlen($DeltaY));
$nBits = $this->packnBits(($NumBits - 2), 4);
$DeltaX = str_repeat(substr($DeltaX, 0, 1), ($NumBits - strlen($DeltaX))) . $DeltaX;
$DeltaY = str_repeat(substr($DeltaY, 0, 1), ($NumBits - strlen($DeltaY))) . $DeltaY;
$atom = sprintf("%1d", $TypeFlag) . sprintf("%1d", $StraightEdge) . $nBits . sprintf("%1d", $GeneralLineFlag);
if ($GeneralLineFlag) {
$atom .= $DeltaX . $DeltaY;
} else {
if ($VertLineFlag) {
$atom .= sprintf("%1d", $VertLineFlag) . $DeltaY;
} else {
$atom .= sprintf("%1d", $VertLineFlag) . $DeltaX;
}
}
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packCURVEDEDGERECORD($ControlDeltaX, $ControlDeltaY, $AnchorDeltaX, $AnchorDeltaY)\n\t{\n\t\tarray_push($this->FMDebug, \"packCURVEDEDGERECORD\");\n\n\t\t$TypeFlag = \"1\";\n\t\t$StraightEdge = \"0\";\n\n\t\t$ControlDeltaX = $this->packSBchunk($ControlDeltaX); \n\t\t$ControlDeltaY = $this->packSBchunk($ControlDeltaY);\n\t\t$AnchorDeltaX = $this->packSBchunk($AnchorDeltaX); \n\t\t$AnchorDeltaY = $this->packSBchunk($AnchorDeltaY);\n\n\t\t$NumBits = (int) max(strlen($ControlDeltaX), strlen($ControlDeltaY), strlen($AnchorDeltaX), strlen($AnchorDeltaY));\n\n\t\t$nBits = $this->packnBits($NumBits - 2, 4);\n\n\t\t$ControlDeltaX = str_repeat(substr($ControlDeltaX, 0, 1), ($NumBits - strlen($ControlDeltaX))) . $ControlDeltaX;\n\t\t$ControlDeltaY = str_repeat(substr($ControlDeltaY, 0, 1), ($NumBits - strlen($ControlDeltaY))) . $ControlDeltaY;\n\n\t\t$AnchorDeltaX = str_repeat(substr($AnchorDeltaX, 0, 1), ($NumBits - strlen($AnchorDeltaX))) . $AnchorDeltaX;\n\t\t$AnchorDeltaY = str_repeat(substr($AnchorDeltaY, 0, 1), ($NumBits - strlen($AnchorDeltaY))) . $AnchorDeltaY;\n\n\t\t$atom = $TypeFlag . $StraightEdge . $nBits . $ControlDeltaX . $ControlDeltaY . $AnchorDeltaX . $AnchorDeltaY;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function EdtDuJour($tab_data, $jour, $flags) \r\n{\r\n\t$result = \"\";\r\n\tif ($flags & HORIZONTAL) {\r\n\t\t$result = EdtDuJourHorizontal($tab_data, $jour, $flags);\r\n\t}\r\n\telse {\r\n\t\t$result = EdtDuJourVertical($tab_data, $jour, $flags);\r\n\t}\r\n\treturn $result;\r\n}",
"public function getDirectionStr(): string\n {\n return self::DIRECTION_STRS[$this->direction];\n }",
"public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }",
"public function getString(){\n return \"Side: \" . $this -> side\n . \"<br> Volume: \" . $this -> getVolume()\n . \"<br> Surface: \" . $this -> getSurface();\n }",
"public function getContragentDirectionStr(): string\n {\n return self::DIRECTION_STRS_FOR_CONTRAGENT[$this->direction];\n }",
"public function format()\n {\n return sprintf('%s %s %s', $this->x(), $this->y(), $this->z());\n }",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function new_node_str($flag = '', $parent_pos = null, $keys = null, $values_pos = null, $children_pos = null)\n {\n $empty_str = str_repeat(Database::$empty_char, $this->pos_len);\n\n $flag_str = $flag ? $flag : str_repeat(Database::$empty_char, $this->n_format['flag']['length']);\n\n $parent_pos_str = $parent_pos ? str_pad($parent_pos, $this->pos_len, Database::$empty_char, STR_PAD_LEFT)\n : $empty_str;\n\n $keys_str = $this->get_property_pos_str($keys, $this->t * 2 - 1);\n $values_pos_str = $this->get_property_pos_str($values_pos, $this->t * 2 - 1);\n $children_pos_str = $this->get_property_pos_str($children_pos, $this->t * 2);\n\n if ($this->is_delimited) {\n $d = $this->delimiter;\n return $flag_str . $d . $parent_pos_str . $d . $keys_str . $d . $values_pos_str . $d . $children_pos_str . \"\\n\";\n } else {\n return $flag_str . $parent_pos_str . $keys_str . $values_pos_str . $children_pos_str . \"\\n\";\n }\n }",
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function __toString()\r\n {\r\n $string = '';\r\n\t$i=0;\r\n foreach ($this->pieces as $column) {\r\n\r\n foreach ($column as $piece) {\r\n if ($piece === '') {\r\n $string .= ('-');\r\n } else {\r\n $string .= $piece;\r\n }\r\n\t\t$i++;\r\n\t\tif($i%3==0)\r\n\t\t{\r\n\t\t\t$string .= \"\\n\";\r\n\t\t}\r\n }\r\n\r\n }\r\n\r\n return $string;\r\n }",
"public function wktBuildLinestring(array $points);",
"public function toString() : string\n {\n return sprintf(\n self::TO_STRING_FORMAT,\n $this->y,\n $this->m,\n $this->d,\n $this->h,\n $this->i,\n $this->s\n );\n }",
"public static function build_new_fleet ( $fleet_array )\r\n\t{\r\n\t\t$current_fleet\t= explode ( ';' , $fleet_array );\r\n\t\t$new_fleet \t= '';\r\n\r\n\t\tforeach ( $current_fleet as $item => $group )\r\n\t\t{\r\n\t\t\tif ( $group != '' )\r\n\t\t\t{\r\n\t\t\t\t$ship\t= explode ( ',' , $group );\r\n\r\n\t\t\t\tif ( $ship[0] == 208 )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $ship[1] > 1 )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$new_fleet\t.= $ship[0] . ',' . ( $ship[1] - 1 ) . ',';\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{\r\n\t\t\t\t\tif ( $ship[1] <> 0 )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$new_fleet .= $ship[0] . ',' . $ship[1] . ',';\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 $new_fleet;\r\n\t}",
"function wkt() {\n $wkt_string = '';\n $wkt = 'LINESTRING(';\n for ($i = 0; $i < count($this->geometries); $i++) {\n if (count($this->geometries[i]['coords']) === 0) {\n return 'LINESTRING(empty)';\n } else {\n $coords = $this->geometries[i]['coords'];\n foreach ($coords as $c) {\n $wkt .= $c[0] . ' ' . $c[1] . ',';\n }\n $wkt_string .= substr($wkt, 0, -1) . ')';\n }\n }\n return $wkt_string;\n }",
"public function toDocxXML(): string\n {\n $properties = [\n 'color',\n 'lang',\n 'sz',\n 'szCs',\n 'position',\n 'spacing',\n ];\n\n $value = '';\n if ($this->rFonts !== null) {\n $rFonts = htmlentities($this->rFonts ?? '', ENT_XML1);\n $value .= '<w:rFonts w:ascii=\"' . $rFonts . '\" w:hAnsi=\"' . $rFonts . '\" w:cs=\"' . $rFonts . '\"/>';\n }\n if ($this->rStyle !== null) {\n $rStyle = htmlentities($this->rStyle ?? '', ENT_XML1);\n $value .= '<w:rStyle w:val=\"' . $rStyle . '\"/>';\n }\n foreach ($properties as $property) {\n if ($this->$property !== null) {\n $value .= '<w:' . $property . ' w:val=\"' . $this->$property . '\"/>';\n }\n }\n return $value;\n }",
"function format_datum_2($geef_datum_2) {\n //\n\t\t\t$jaar = substr($geef_datum_2,0,4);\n\t\t\t$maand = substr($geef_datum_2,5,2);\n\t\t\t$dag = substr($geef_datum_2,8,2);\n\n\t\treturn( $dag .'-'. $maand .'-'. $jaar );\n\t}",
"public function deliberaString() {\n \n if($this->emittente == \"Consiglio di Dipartimento\") {\n $tipo_emitt = \"Consiglio\";\n } else if ($this->tipo_emitt == \"Direttore di dipartimento\") {\n $tipo_emitt = \"Direttore\";\n }else{\n $tipo_emitt = $this->emittente;\n }\n \n return \"delibera n. \".$this->num_delibera.\" del \". $this->dataDelibera().\" dal \".$tipo_emitt.\" del \".$this->dipartimento; \n }",
"public function toHex(bool $twosCompliment = false);",
"public function __toString(): string\n {\n $aString = array();\n $aString['shape'] = 'equilateral triangle';\n $aString['side'] = $this->side;\n $aString['area'] = $this->getArea();\n $aString['perimeter'] = $this->getPerimeter();\n return json_encode($aString);\n }",
"function zusatz_zeichnen($ZEbene_Bezeichnung,$Ebeneninhalt,$s,$X_min,$Y_max,$Stroke_width,$Color)\n{\n\treturn $ZE_Ausg = ' <g transform=\"matrix('.$s.' 0 0 '.$s.' '.$X_min.' '.$Y_max.')\" id=\"zusatz_'.$ZEbene_Bezeichnung.'\" fill=\"none\" pointer-events=\"none\" stroke-width=\"'.$Stroke_width.'\" stroke=\"'.$Color.'\">\n\t\t\t<desc>Zusatz-Inhalt '.utf8_encode($ZEbene_Bezeichnung).'</desc>'.\n\t\t\t$Ebeneninhalt\n\t.'</g>';\n}",
"function get_markup() \n\t{\n\t\t$n = count($this->coor);\n\n\t\tif ($n == 0) {\n\t\t\t# Range is special case\n\t\t\treturn $this->make_position( $this->latdeg_min, \n\t\t\t\t\t\t $this->londeg_min )\n\t\t\t . \" to \"\n\t\t\t . $this->make_position( $this->latdeg_max,\n\t\t\t\t\t\t $this->londeg_max );\n\t\t} elseif ($n == 2) {\n\t\t\treturn $this->coor[0].';'.\n\t\t\t $this->coor[1];\n\n\t\t} elseif ($n == 4) {\n\t\t\treturn $this->coor[0].'° '.\n\t\t\t $this->coor[1].' '.\n\t\t\t $this->coor[2].'° '.\n\t\t\t $this->coor[3];\n\n\t\t} elseif ($n == 6) {\n\t\t\treturn $this->coor[0].'°'.\n\t\t\t $this->coor[1].'′ '.\n\t\t\t $this->coor[2].' '.\n\t\t\t $this->coor[3].'°'.\n\t\t\t $this->coor[4].'′ '.\n\t\t\t $this->coor[5];\n\n\t\t} elseif ($n == 8) {\n\t\t\treturn $this->coor[0].'°'.\n\t\t\t $this->coor[1].'′'.\n\t\t\t $this->coor[2].'″ '.\n\t\t\t $this->coor[3].' '.\n\t\t\t $this->coor[4].'°'.\n\t\t\t $this->coor[5].'′'.\n\t\t\t $this->coor[6].'″ '.\n\t\t\t $this->coor[7];\n\t\t} else {\n\t\t\treturn $this->get_error();\n\t\t}\n\t}",
"public function toHex()\n\t{\n\t\treturn sprintf('#%s%s%s', Strings::padLeft(dechex($this->r), 2, '0'), Strings::padLeft(dechex($this->g), 2, '0'), Strings::padLeft(dechex($this->b), 2, '0'));\n\t}",
"protected function createLineStringX(): LineStringEntity\n {\n return $this->createLineString([\n new Point(8, 15),\n new Point(4, 8),\n ]);\n }",
"protected function createLineStringZ(): LineStringEntity\n {\n return $this->createLineString([\n new Point(2, 5),\n new Point(3, 6),\n new Point(12, 8),\n new Point(10, 10),\n new Point(13, 11),\n ]);\n }",
"public function toString()\n {\n return vsprintf(\n '%08s-%04s-%04s-%02s%02s-%012s',\n $this->fields\n );\n }",
"public function getStdShipToCd()\n {\n return $this->std_ship_to_cd;\n }"
] |
[
"0.62386286",
"0.5969523",
"0.5024242",
"0.49985194",
"0.4855188",
"0.48129693",
"0.48101723",
"0.46010622",
"0.4580902",
"0.45488966",
"0.45260507",
"0.45207193",
"0.45130622",
"0.45024148",
"0.44672477",
"0.4459017",
"0.4434804",
"0.4420946",
"0.43567938",
"0.43507832",
"0.43402693",
"0.43051216",
"0.4294101",
"0.42906958",
"0.42849192",
"0.4284387",
"0.42684135",
"0.42632273",
"0.42437732",
"0.4243665"
] |
0.8618322
|
0
|
string packSTYLECHANGERECORD( integer StateNewStyles, integer StateLineStyle, integer StateFillStyle1, integer StateFillStyle0, integer StateMoveTo, integer MoveDeltaX, integer MoveDeltaY, integer nFillBits, integer nLineBits, integer FillStyle0, integer FillStyle1, integer LineStyle, string FillStyles, string LineStyles, integer NumFillBits, integer NumLineBits) returns an SWF STYLECHANGERECORD string.
|
function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)
{
#error_log("statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits");
#error_log("nFillBits: $nFillBits");
#error_log("nLineBits: $nLineBits");
array_push($this->FMDebug, "packSTYLECHANGERECORD");
$atom = array("Bitstream" => "", "Bytestream" => "");
$atom["Bitstream"] .= "0";
$atom["Bitstream"] .= sprintf("%1d", $StateNewStyles);
$atom["Bitstream"] .= sprintf("%1d", $StateLineStyle);
$atom["Bitstream"] .= sprintf("%1d", $StateFillStyle1);
$atom["Bitstream"] .= sprintf("%1d", $StateFillStyle0);
$atom["Bitstream"] .= sprintf("%1d", $StateMoveTo);
if ($StateMoveTo == 1) {
$MoveDeltaX = $this->packSBchunk($MoveDeltaX);
$MoveDeltaY = $this->packSBchunk($MoveDeltaY);
$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));
$nMoveBits = $this->packnBits($MoveBits, 5);
$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;
$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;
$atom["Bitstream"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;
}
if ($StateFillStyle0) {
$atom["Bitstream"] .= $this->packnBits($FillStyle0, $nFillBits);
}
if ($StateFillStyle1) {
$atom["Bitstream"] .= $this->packnBits($FillStyle1, $nFillBits);
}
if ($StateLineStyle) {
$atom["Bitstream"] .= $this->packnBits($LineStyle, $nLineBits);
#error_log($this->packnBits($LineStyle, $nLineBits));
#error_log("here?");
}
if ($StateNewStyles) {
$atom["Bytestream"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSTRAIGHTEDGERECORD($GeneralLineFlag, $VertLineFlag, $DeltaX, $DeltaY)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRAIGHTEDGERECORD\");\n\n\t\t$TypeFlag = \"1\";\n\t\t$StraightEdge = \"1\";\n\n\t\tif (($DeltaX == 0) and ($DeltaY == 0)) {\n\n\t\t\t$atom = sprintf(\"%1d\", $TypeFlag) . sprintf(\"%1d\", $StraightEdge) . \"0\" ;\n\n\t\t} else {\n\n\t\t\t$DeltaX = $this->packSBchunk($DeltaX); \n\t\t\t$DeltaY = $this->packSBchunk($DeltaY);\n\n\t\t\t$NumBits = (int) max(strlen($DeltaX), strlen($DeltaY));\n\n\t\t\t$nBits = $this->packnBits(($NumBits - 2), 4);\n\n\t\t\t$DeltaX = str_repeat(substr($DeltaX, 0, 1), ($NumBits - strlen($DeltaX))) . $DeltaX;\n\t\t\t$DeltaY = str_repeat(substr($DeltaY, 0, 1), ($NumBits - strlen($DeltaY))) . $DeltaY;\n\n\t\t\t$atom = sprintf(\"%1d\", $TypeFlag) . sprintf(\"%1d\", $StraightEdge) . $nBits . sprintf(\"%1d\", $GeneralLineFlag);\n\n\t\t\tif ($GeneralLineFlag) {\n\n\t\t\t\t$atom .= $DeltaX . $DeltaY;\n\n\t\t\t} else {\n\n\t\t\t\tif ($VertLineFlag) {\n\n\t\t\t\t\t$atom .= sprintf(\"%1d\", $VertLineFlag) . $DeltaY; \n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= sprintf(\"%1d\", $VertLineFlag) . $DeltaX; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packCURVEDEDGERECORD($ControlDeltaX, $ControlDeltaY, $AnchorDeltaX, $AnchorDeltaY)\n\t{\n\t\tarray_push($this->FMDebug, \"packCURVEDEDGERECORD\");\n\n\t\t$TypeFlag = \"1\";\n\t\t$StraightEdge = \"0\";\n\n\t\t$ControlDeltaX = $this->packSBchunk($ControlDeltaX); \n\t\t$ControlDeltaY = $this->packSBchunk($ControlDeltaY);\n\t\t$AnchorDeltaX = $this->packSBchunk($AnchorDeltaX); \n\t\t$AnchorDeltaY = $this->packSBchunk($AnchorDeltaY);\n\n\t\t$NumBits = (int) max(strlen($ControlDeltaX), strlen($ControlDeltaY), strlen($AnchorDeltaX), strlen($AnchorDeltaY));\n\n\t\t$nBits = $this->packnBits($NumBits - 2, 4);\n\n\t\t$ControlDeltaX = str_repeat(substr($ControlDeltaX, 0, 1), ($NumBits - strlen($ControlDeltaX))) . $ControlDeltaX;\n\t\t$ControlDeltaY = str_repeat(substr($ControlDeltaY, 0, 1), ($NumBits - strlen($ControlDeltaY))) . $ControlDeltaY;\n\n\t\t$AnchorDeltaX = str_repeat(substr($AnchorDeltaX, 0, 1), ($NumBits - strlen($AnchorDeltaX))) . $AnchorDeltaX;\n\t\t$AnchorDeltaY = str_repeat(substr($AnchorDeltaY, 0, 1), ($NumBits - strlen($AnchorDeltaY))) . $AnchorDeltaY;\n\n\t\t$atom = $TypeFlag . $StraightEdge . $nBits . $ControlDeltaX . $ControlDeltaY . $AnchorDeltaX . $AnchorDeltaY;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLEARRAY\");\n\n\t\tif ($FillStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($FillStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom = chr(0xff) . $this->packUI16($FillStyleCount);\n\t\t}\n\n\t\t$atom .= $FillStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packLINESTYLEARRAY($LineStyleCount, $LineStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLEARRAY\");\n\n\t\tif ($LineStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($LineStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom .= char(0xff) . $this->packUI16($LineStyleCount);\n\t\t}\n\n\t\t$atom .= $LineStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function drawStyle()\r\n\t{\r\n\t}",
"function style_evt($agenda, $evt)\r\n{\r\n\tif($agenda[\"evt_affichage_couleur\"]==\"background\" && !isset($_GET[\"printmode\"]))\treturn STYLE_BORDER_RADIUS.\"box-shadow: 2px 2px 2px #777;color:#fff;background-color:\".$evt[\"couleur_cat\"].\";\";\r\n\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn STYLE_BORDER_RADIUS.\"box-shadow: 2px 2px 2px #777;color:\".$evt[\"couleur_cat\"].\";background-color:#fff;border:1px solid \".$evt[\"couleur_cat\"].\";background-image:url(\".PATH_TPL.\"module_agenda/background.jpg);background-repeat:no-repeat;\";\r\n}",
"function toColor($n){\n\t\t\treturn(\"#\".substr(\"000000\".dechex($n),-6));\n\t\t}",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function get_font_border_styles( $style = '', $color = '', $width = '' ) {\n\n\t$css = ['', ''];\n\n\tif ( $style == 'yes' || $style == 'hover' ) {\n\n\t\t$css[1] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t$css[0] .= 'box-sizing: border-box;';\n\n\t\tif ( $style == 'yes' ) {\n\t \t\t$css[0] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t} elseif ( $style == 'hover' ) {\n\t\t\t$css[0] .= 'border:' . $width . 'px solid transparent;';\n\t\t}\n\n\t} else {\n\t\t$css[1] .= 'border-color: transparent;';\n\t\t$css[0] .= 'border-color: transparent;';\n\t}\n\n\treturn $css;\n}",
"function build_color_rule($mod_name) {\n\t\t\t$element = json_decode($this->get_cached_mod($mod_name));\n\t\t\t$element_props = '';\n\t\t\tif (isset($element->mode) && $element->mode === 'image' && !empty($element->imgwidth)) {\n\t\t\t\t$element_props = \"\\twidth: {$element->imgwidth}px;\";\n\t\t\t}\n\t\t\tif (isset($element->color) && '' != $element->color) {\n\t\t\t\t$opacity = ( isset($element->opacity) && '' != $element->opacity ) ? $element->opacity : 1;\n\t\t\t\t$element_props .=$opacity < 1 ? \"\\n\\tcolor: rgba(\" . $this->hex2rgb($element->color) . ',' . $opacity . ');' : \"\\n\\tcolor: #$element->color;\";\n\t\t\t}\n\t\t\treturn $element_props;\n\t\t}",
"function renderStyle($styles) {\n $str = \"\";\n foreach($styles as $style) {\n \n switch($style['Name']) {\n case 'fontFamily':\n $str .= strtolower(preg_replace('/(?<=\\\\w)(?=[A-Z])/',\"-$1\", $style['Name']));\n $str .= \":\";\n $str .= $this->renderFont($style['Value']);\n $str .= \";\";\n break;\n case 'border':\n $str .= $this->renderBorder($style);\n break;\n case 'margin':\n case 'padding':\n $str .= $this->renderSide($style);\n break;\n default:\n $str .= strtolower(preg_replace('/(?<=\\\\w)(?=[A-Z])/',\"-$1\", $style['Name']));\n $str .= \":\";\n $str .= $style['Value'];\n $str .= \";\";\n break;\n } \n \n }\n return $str;\n }",
"function getStyle() {return $this->readstyle();}",
"function SetStyle($tag,$enable)\n{\n $this->$tag+=($enable ? 1 : -1);\n $style='';\n foreach(array('B','I','U') as $s)\n if($this->$s>0)\n $style.=$s;\n $this->SetFont('',$style);\n}",
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function SetStyle($tag, $enable)\r\n{\r\n $this->$tag += ($enable ? 1 : -1);\r\n $style = '';\r\n foreach(array('B', 'I', 'U') as $s)\r\n {\r\n if($this->$s>0)\r\n $style .= $s;\r\n }\r\n $this->SetFont('',$style);\r\n}",
"function NombreCursoColor($varcursocolor)\n{\n\tif ($varcursocolor == 1) return \"linear-gradient(\n to right bottom, \n rgba(54, 227, 250, 0.589),\n rgba(36, 154, 250, 0.795)\n )\";\n\tif ($varcursocolor == 2) return \"linear-gradient(\n to right bottom, \n rgba(1, 152, 252, 0.363),\n rgba(0, 80, 126, 0.534)\n\t)\";\n\tif ($varcursocolor == 3) return \"linear-gradient(\n to right bottom,\n rgba(250, 184, 60, 0.849),\n rgba(253, 151, 18, 0.63)\n\t)\";\n\tif ($varcursocolor == 4) return \"linear-gradient(\n to right bottom,\n rgba(250, 145, 60, 0.849),\n rgba(252, 64, 6, 0.63)\n )\";\n\tif ($varcursocolor == 5) return \"linear-gradient(\n to right bottom,\n rgba(248, 150, 121, 0.795),\n rgba(250, 91, 52, 0.774)\n )\";\n\tif ($varcursocolor == 6) return \"linear-gradient(\n to right bottom,\n rgba(165, 61, 1, 0.795),\n rgba(71, 32, 1, 0.774)\n )\";\n\tif ($varcursocolor == 7) return \"linear-gradient(\n to right bottom, \n rgba(76, 1, 252, 0.363),\n rgba(38, 0, 126, 0.534)\n )\";\n}",
"public function getStyle();",
"function SetStyle($tag, $enable)\n{\n $this->$tag += ($enable ? 1 : -1);\n $style = '';\n foreach(array('B', 'I', 'U') as $s)\n {\n if($this->$s>0)\n $style .= $s;\n }\n $this->SetFont('',$style);\n}",
"function SetStyle($tag, $enable)\n{\n $this->$tag += ($enable ? 1 : -1);\n $style = '';\n foreach(array('B', 'I', 'U') as $s)\n {\n if($this->$s>0)\n $style .= $s;\n }\n $this->SetFont('',$style);\n}",
"private static function getControlCode() {\n if ( self :: $conrolCode === null ) {\n self :: $conrolCode = pack('c', 0x1B);\n }\n return self:: $conrolCode;\n }",
"public function getStyle() {}",
"public function render() {\n $output = array();\n array_push($output, 0, \"STYLE\");\n array_push($output, 5, $this->getHandle());\n array_push($output, 100, \"AcDbSymbolTableRecord\");\n array_push($output, 100, \"AcDbTextStyleTableRecord\");\n array_push($output, 2, strtoupper($this->name));\n array_push($output, 70, $this->flag);\n array_push($output, 6, $this->lineType);\n return implode(PHP_EOL, $output);\n }",
"public function createStyle(\n StyleEnum ...$styles\n ): StyleInterface;",
"public function createStyle(\n StyleEnum ...$styles\n ): StyleInterface;",
"function getStyle() { return $this->_style; }",
"function fontStyles()\r\n {\r\n /*\r\n if ($this->_control!=null)\r\n {\r\n if ($this->_control->ParentFont)\r\n {\r\n $parent=$this->_control->Parent;\r\n if ($parent!=null) return($parent->Font->readFontString());\r\n }\r\n }\r\n */\r\n\r\n $textalign=\"\";\r\n switch($this->_align)\r\n {\r\n case taLeft: $textalign=\"text-align: left;\"; break;\r\n case taRight: $textalign=\"text-align: right;\"; break;\r\n case taCenter: $textalign=\"text-align: center;\"; break;\r\n case taJustify: $textalign=\"text-align: justify;\"; break;\r\n }\r\n\r\n $fontstyle=\"\";\r\n switch($this->_style)\r\n {\r\n case fsNormal: $fontstyle=\"font-style: normal;\"; break;\r\n case fsItalic: $fontstyle=\"font-style: italic;\"; break;\r\n case fsOblique: $fontstyle=\"font-style: oblique;\"; break;\r\n }\r\n\r\n // changed to fix RAID#282144\r\n $fontvariant=\"\";\r\n switch($this->_variant)\r\n {\r\n case vaNormal: $fontvariant=\"font-variant: normal;\"; break;\r\n case vaSmallCaps: $fontvariant=\"font-variant: small-caps;\"; break;\r\n }\r\n\r\n $texttransform=\"\";\r\n switch($this->_case)\r\n {\r\n case caCapitalize: $texttransform=\"text-transform: capitalize;\"; break;\r\n case caUpperCase: $texttransform=\"text-transform: uppercase;\"; break;\r\n case caLowerCase: $texttransform=\"text-transform: lowercase;\"; break;\r\n case caNone: $texttransform=\"text-transform: none;\"; break;\r\n }\r\n\r\n $color=\"\";\r\n if ($this->_color!=\"\") $color=\"color: $this->_color;\";\r\n\r\n $lineheight=\"\";\r\n if ($this->_lineheight!=\"\") $lineheight=\"line-height: $this->_lineheight;\";\r\n\r\n $fontweight=\"\";\r\n if ($this->_weight!=\"\") $fontweight=\"font-weight: $this->_weight;\";\r\n\r\n return \" $color$fontweight$textalign$fontstyle$lineheight$fontvariant$texttransform \";\r\n }",
"public function toDocxXML(): string\n {\n $properties = [\n 'color',\n 'lang',\n 'sz',\n 'szCs',\n 'position',\n 'spacing',\n ];\n\n $value = '';\n if ($this->rFonts !== null) {\n $rFonts = htmlentities($this->rFonts ?? '', ENT_XML1);\n $value .= '<w:rFonts w:ascii=\"' . $rFonts . '\" w:hAnsi=\"' . $rFonts . '\" w:cs=\"' . $rFonts . '\"/>';\n }\n if ($this->rStyle !== null) {\n $rStyle = htmlentities($this->rStyle ?? '', ENT_XML1);\n $value .= '<w:rStyle w:val=\"' . $rStyle . '\"/>';\n }\n foreach ($properties as $property) {\n if ($this->$property !== null) {\n $value .= '<w:' . $property . ' w:val=\"' . $this->$property . '\"/>';\n }\n }\n return $value;\n }"
] |
[
"0.5743887",
"0.55181766",
"0.5358953",
"0.52467763",
"0.51774824",
"0.51675856",
"0.51321167",
"0.49866882",
"0.47658157",
"0.46695453",
"0.46178138",
"0.45849955",
"0.4572855",
"0.45614114",
"0.45541468",
"0.45351824",
"0.45239133",
"0.45153934",
"0.4510889",
"0.45043802",
"0.4503835",
"0.4503835",
"0.44456387",
"0.44371286",
"0.4436156",
"0.4434876",
"0.4434876",
"0.44297844",
"0.44224086",
"0.4414943"
] |
0.84812057
|
0
|
string packENDSHAPERECORD() returns an SWF ENDSHAPERECORD string.
|
function packENDSHAPERECORD()
{
array_push($this->FMDebug, "packENDSHAPERECORD");
$TypeFlag = "0";
$EndOfShape = "00000";
$atom = $TypeFlag . $EndOfShape;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSTRAIGHTEDGERECORD($GeneralLineFlag, $VertLineFlag, $DeltaX, $DeltaY)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRAIGHTEDGERECORD\");\n\n\t\t$TypeFlag = \"1\";\n\t\t$StraightEdge = \"1\";\n\n\t\tif (($DeltaX == 0) and ($DeltaY == 0)) {\n\n\t\t\t$atom = sprintf(\"%1d\", $TypeFlag) . sprintf(\"%1d\", $StraightEdge) . \"0\" ;\n\n\t\t} else {\n\n\t\t\t$DeltaX = $this->packSBchunk($DeltaX); \n\t\t\t$DeltaY = $this->packSBchunk($DeltaY);\n\n\t\t\t$NumBits = (int) max(strlen($DeltaX), strlen($DeltaY));\n\n\t\t\t$nBits = $this->packnBits(($NumBits - 2), 4);\n\n\t\t\t$DeltaX = str_repeat(substr($DeltaX, 0, 1), ($NumBits - strlen($DeltaX))) . $DeltaX;\n\t\t\t$DeltaY = str_repeat(substr($DeltaY, 0, 1), ($NumBits - strlen($DeltaY))) . $DeltaY;\n\n\t\t\t$atom = sprintf(\"%1d\", $TypeFlag) . sprintf(\"%1d\", $StraightEdge) . $nBits . sprintf(\"%1d\", $GeneralLineFlag);\n\n\t\t\tif ($GeneralLineFlag) {\n\n\t\t\t\t$atom .= $DeltaX . $DeltaY;\n\n\t\t\t} else {\n\n\t\t\t\tif ($VertLineFlag) {\n\n\t\t\t\t\t$atom .= sprintf(\"%1d\", $VertLineFlag) . $DeltaY; \n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= sprintf(\"%1d\", $VertLineFlag) . $DeltaX; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected function makeEndAlternativeBoundaryString() {\n\t\treturn '--' . $this->_mailAlternativeBoundary . '--' . $this->_endString;\n\t}",
"function packCURVEDEDGERECORD($ControlDeltaX, $ControlDeltaY, $AnchorDeltaX, $AnchorDeltaY)\n\t{\n\t\tarray_push($this->FMDebug, \"packCURVEDEDGERECORD\");\n\n\t\t$TypeFlag = \"1\";\n\t\t$StraightEdge = \"0\";\n\n\t\t$ControlDeltaX = $this->packSBchunk($ControlDeltaX); \n\t\t$ControlDeltaY = $this->packSBchunk($ControlDeltaY);\n\t\t$AnchorDeltaX = $this->packSBchunk($AnchorDeltaX); \n\t\t$AnchorDeltaY = $this->packSBchunk($AnchorDeltaY);\n\n\t\t$NumBits = (int) max(strlen($ControlDeltaX), strlen($ControlDeltaY), strlen($AnchorDeltaX), strlen($AnchorDeltaY));\n\n\t\t$nBits = $this->packnBits($NumBits - 2, 4);\n\n\t\t$ControlDeltaX = str_repeat(substr($ControlDeltaX, 0, 1), ($NumBits - strlen($ControlDeltaX))) . $ControlDeltaX;\n\t\t$ControlDeltaY = str_repeat(substr($ControlDeltaY, 0, 1), ($NumBits - strlen($ControlDeltaY))) . $ControlDeltaY;\n\n\t\t$AnchorDeltaX = str_repeat(substr($AnchorDeltaX, 0, 1), ($NumBits - strlen($AnchorDeltaX))) . $AnchorDeltaX;\n\t\t$AnchorDeltaY = str_repeat(substr($AnchorDeltaY, 0, 1), ($NumBits - strlen($AnchorDeltaY))) . $AnchorDeltaY;\n\n\t\t$atom = $TypeFlag . $StraightEdge . $nBits . $ControlDeltaX . $ControlDeltaY . $AnchorDeltaX . $AnchorDeltaY;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"protected function makeEndFileBoundaryString() {\n\t\treturn '--' . $this->_mailFileBoundary . '--' . $this->_endString;\n\t}",
"public function __toString()\n {\n return $this->_start . '–' . $this->_end;\n }",
"public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }",
"public function getSides(){\n $str=\"\";\n foreach ($this->sides as $side){\n $str .= (strlen($str) === 0)?$side:\", $side\";\n }\n return \"[$str]\";\n }",
"public function toString()\n {\n $count = $this->count();\n if ($count === 0) {\n return '';\n }\n $args = $this->toArray();\n \\array_unshift($args, \\str_repeat('C', $count));\n // constant-time, PHP <5.6 equivalent to pack('C*', ...$args);\n return \\call_user_func_array('\\\\pack', $args);\n }",
"protected function makeAlternativeBoundaryString() {\n\t\treturn '--' . $this->_mailAlternativeBoundary . $this->_endString;\n\t}",
"public function getEndBat()\n {\n return $this->get(self::_END_BAT);\n }",
"private function end() {\n return $this->formats['end'];\n }",
"public static function hash()\r\n {\r\n return sprintf(\"%s[#]%s \", Color::GRN, Color::END);\r\n }",
"function xlsBOF() {\r\n\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\n\treturn;\r\n}",
"protected function makeMimeVersionHeaderString() {\n\t\treturn $this->_mailMimeVersion . $this->_endString;\n\t}",
"function xlsBOF() {\n\t\techo pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\n\t\treturn;\n\t\t}",
"function __toString()\r\n {\r\n $string = '';\r\n\t$i=0;\r\n foreach ($this->pieces as $column) {\r\n\r\n foreach ($column as $piece) {\r\n if ($piece === '') {\r\n $string .= ('-');\r\n } else {\r\n $string .= $piece;\r\n }\r\n\t\t$i++;\r\n\t\tif($i%3==0)\r\n\t\t{\r\n\t\t\t$string .= \"\\n\";\r\n\t\t}\r\n }\r\n\r\n }\r\n\r\n return $string;\r\n }",
"public function packerTwoPack($data)\n {\n $encoded = base64_encode($data);\n\n // Separa em dois pedaços\n $partOne = mb_substr($encoded, 0, 5, \"utf-8\");\n $partTwo = mb_substr($encoded, 5, null, \"utf-8\");\n\n // Insere 'Sg' para invalidar o base64\n return $partOne . 'Sg' . $partTwo;\n }",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"public function getString(){\n return \"Side: \" . $this -> side\n . \"<br> Volume: \" . $this -> getVolume()\n . \"<br> Surface: \" . $this -> getSurface();\n }",
"function toString(){\n\t\treturn $this->_String4;\n\t}",
"function rle4_decode ($str, $width){\n $w = floor($width/2) + ($width % 2);\n $lineWidth = $w + (3 - ( ($width-1) / 2) % 4); \n $pixels = array();\n $cnt = strlen($str);\n for ($i=0;$i<$cnt;$i++){\n $o = ord($str[$i]);\n switch ($o){\n case 0: # ESCAPE\n $i++;\n switch (ord($str[$i])){\n case 0: # NEW LINE \n while (count($pixels)%$lineWidth!=0)\n $pixels[]=0;\n break;\n case 1: # END OF FILE\n while (count($pixels)%$lineWidth!=0)\n $pixels[]=0;\n break 3;\n case 2: # DELTA\n $i += 2;\n break;\n default: # ABSOLUTE MODE\n $num = ord($str[$i]);\n for ($j=0;$j<$num;$j++){\n if ($j%2==0){\n $c = ord($str[++$i]);\n $pixels[] = ($c & 240)>>4;\n } else\n $pixels[] = $c & 15;\n }\n if ($num % 2) $i++;\n }\n break;\n default:\n $c = ord($str[++$i]);\n for ($j=0;$j<$o;$j++)\n $pixels[] = ($j%2==0 ? ($c & 240)>>4 : $c & 15);\n }\n }\n \n $out = '';\n if (count($pixels)%2) $pixels[]=0;\n $cnt = count($pixels)/2;\n for ($i=0;$i<$cnt;$i++)\n $out .= chr(16*$pixels[2*$i] + $pixels[2*$i+1]);\n return $out;\n}",
"public function getCharEnd();",
"public function toString() {\n\t\treturn sprintf( 'w:%s', $this->width );\n\t}",
"public function __toString()\n {\n $str = \"\\n---Remote Control---\\n\";\n for ($i=0; $i<=4; $i++) {\n $str .= \"\\nSlot[$i]\" . $this->onCommand[$i]->getName() . \" <===> \" . $this->offCommand[$i]->getName();\n }\n return $str;\n }",
"public function toString() : string\n {\n return sprintf(\n self::TO_STRING_FORMAT,\n $this->y,\n $this->m,\n $this->d,\n $this->h,\n $this->i,\n $this->s\n );\n }",
"public function __toString()\n {\n return $this->getHex();\n }"
] |
[
"0.5493647",
"0.53036153",
"0.50533575",
"0.49691272",
"0.48601094",
"0.4820835",
"0.48006102",
"0.48004195",
"0.4786613",
"0.47767657",
"0.47277722",
"0.47137943",
"0.46645463",
"0.46284655",
"0.46279255",
"0.46189737",
"0.46171808",
"0.45981103",
"0.4581907",
"0.4581907",
"0.4581907",
"0.45775157",
"0.45721447",
"0.456998",
"0.45551708",
"0.4508638",
"0.4503734",
"0.44808912",
"0.4477407",
"0.44642958"
] |
0.7911651
|
0
|
string packSHAPEWITHSTYLE(string FillStyles, string LineStyles, integer NumFillBits, integer NumLineBits, string ShapeRecords) returns an SWF SHAPEWITHSTYLE string.
|
function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)
{
array_push($this->FMDebug, "packSHAPEWITHSTYLE");
$lower_limit = 0;
$upper_limit = 15;
if (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {
$this->FMError("packSHAPEWITHSTYLE argument (NumFillBits) out of range");
}
if (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {
$this->FMError("packSHAPEWITHSTYLE argument (NumLineBits) out of range");
}
$atom = $FillStyles;
$atom .= $LineStyles;
$NumFillBits = $this->packnBits($NumFillBits, 4);
$NumLineBits = $this->packnBits($NumLineBits, 4);
$atom .= $this->packBitValues($NumFillBits . $NumLineBits);
$atom .= $ShapeRecords;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packLINESTYLE($Width, $R, $G, $B, $AlphaFlag, $A)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLE\");\n\n\t\t$atom = $this->packUI16($Width);\n\n\t\tif ($AlphaFlag) {\n\n\t\t\tif ($A == \"\") {\n\n\t\t\t\t$A = 0xff;\n\t\t\t}\n\n\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t} else {\n\n\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLEARRAY\");\n\n\t\tif ($FillStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($FillStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom = chr(0xff) . $this->packUI16($FillStyleCount);\n\t\t}\n\n\t\t$atom .= $FillStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packSTYLECHANGERECORD($StateNewStyles, $StateLineStyle, $StateFillStyle1, $StateFillStyle0, $StateMoveTo, $MoveDeltaX, $MoveDeltaY, $nFillBits, $nLineBits, $FillStyle0, $FillStyle1, $LineStyle, $FillStyles, $LineStyles, $NumFillBits, $NumLineBits)\n\t{\n#error_log(\"statennewstyles: $StateNewStyles, statelinestyle: $StateLineStyle, statefillstyle1: $StateFillStyle1, statefillstyle0: $StateFillStyle0, statemoveto: $StateMoveTo, movedeltaX: $MoveDeltaX, movedeltay: $MoveDeltaY, nfillbits: $nFillBits, nlinebits: $nLineBits, fillstyle0: $FillStyle0, fillstyle1: $FillStyle1, linestyle: $LineStyle, fillstyles: $FillStyles, linestyles: $LineStyles, numfillbits: $NumFillBits, numlinebits: $NumLineBits\");\n#error_log(\"nFillBits: $nFillBits\");\n#error_log(\"nLineBits: $nLineBits\");\n\t\tarray_push($this->FMDebug, \"packSTYLECHANGERECORD\");\n\n\t\t$atom = array(\"Bitstream\" => \"\", \"Bytestream\" => \"\");\n\t\t$atom[\"Bitstream\"] .= \"0\";\n\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateNewStyles);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateLineStyle);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle1);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateFillStyle0);\n\t\t$atom[\"Bitstream\"] .= sprintf(\"%1d\", $StateMoveTo);\n\n\t\tif ($StateMoveTo == 1) {\n\n\t\t\t$MoveDeltaX = $this->packSBchunk($MoveDeltaX); \n\t\t\t$MoveDeltaY = $this->packSBchunk($MoveDeltaY);\n\n\t\t\t$MoveBits = (int) max(strlen($MoveDeltaX), strlen($MoveDeltaY));\n\t\t\t$nMoveBits = $this->packnBits($MoveBits, 5);\n\n\t\t\t$MoveDeltaX = str_repeat(substr($MoveDeltaX, 0, 1), ($MoveBits - strlen($MoveDeltaX))) . $MoveDeltaX;\n\t\t\t$MoveDeltaY = str_repeat(substr($MoveDeltaY, 0, 1), ($MoveBits - strlen($MoveDeltaY))) . $MoveDeltaY;\n\n\t\t\t$atom[\"Bitstream\"] .= $nMoveBits . $MoveDeltaX . $MoveDeltaY;\n\t\t}\n\n\t\tif ($StateFillStyle0) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle0, $nFillBits);\n\t\t} \n\n\t\tif ($StateFillStyle1) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($FillStyle1, $nFillBits);\n\t\t} \n\n\t\tif ($StateLineStyle) {\n\n\t\t\t$atom[\"Bitstream\"] .= $this->packnBits($LineStyle, $nLineBits);\n\t\t\t#error_log($this->packnBits($LineStyle, $nLineBits));\n\t\t\t#error_log(\"here?\");\n\t\t} \n\n\t\tif ($StateNewStyles) {\n\n\t\t\t$atom[\"Bytestream\"] = $FillStyles . $LineStyles . $this->packUI8((int)($this->packnBits($NumFillBits, 4) . $this->packnBits($NumLineBits, 4)));\n\t\t} \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packLINESTYLEARRAY($LineStyleCount, $LineStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packLINESTYLEARRAY\");\n\n\t\tif ($LineStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($LineStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom .= char(0xff) . $this->packUI16($LineStyleCount);\n\t\t}\n\n\t\t$atom .= $LineStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function ps_set_border_style($psdoc, $style, $width)\n{\n}",
"public function format(ShapeInterface $shape);",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}",
"private function _readBIFF8Style($recordData)\n\t{\n\t\t$style = array();\n\t\t\n\t\t// offset: 0; size: 2; Index to FONT record\n\t\tif ($this->_GetInt2d($recordData, 0) < 4) {\n\t\t\t$fontIndex = $this->_GetInt2d($recordData, 0);\n\t\t} else {\n\t\t\t// this has to do with that index 4 is omitted in all BIFF versions for some strange reason\n\t\t\t// check the OpenOffice documentation of the FONT record\n\t\t\t$fontIndex = $this->_GetInt2d($recordData, 0) - 1;\n\t\t}\n\t\t$style['font'] = $this->_font[$fontIndex];\n\t\t\n\t\t// offset: 2; size: 2; Index to FORMAT record\n\t\t\t$numberFormatIndex = $this->_GetInt2d($recordData, 2);\n\t\t\t$style['numberformat'] = $this->_readBIFF8NumberFormat($numberFormatIndex);\n\t\t\n\t\t$style['protection'] = array();\n\t\t// offset: 4; size: 2; XF type, cell protection, and parent style XF\n\t\t\t// bit 2-0; mask 0x0007; XF_TYPE_PROT\n\t\t\t$xfTypeProt = $this->_GetInt2d($recordData, 4);\n\t\t\t\t// bit 0; mask 0x01; 1 = cell is locked\n\t\t\t\t$isLocked = (0x01 & $xfTypeProt) >> 0;\n\t\t\t\t$style['protection']['locked'] = $isLocked ? true : false;\n\t\t\t\t// bit 1;\n\t\t\t\t// bit 2;\n\t\t\n\t\t// offset: 6; size: 1; Alignment and text break\n\t\t$style['alignment'] = array();\n\t\t\t// bit 2-0, mask 0x07; horizontal alignment\n\t\t\t$horAlign = (0x07 & ord($recordData[6])) >> 0;\n\t\t\tswitch ($horAlign) {\n\t\t\t\tcase 0: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; break;\n\t\t\t\tcase 1: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT; break;\n\t\t\t\tcase 2: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER; break;\n\t\t\t\tcase 3: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT; break;\n\t\t\t\tcase 5: $style['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY; break;\n\t\t\t}\n\t\t\t// bit 3, mask 0x08; wrap text\n\t\t\t$wrapText = (0x08 & ord($recordData[6])) >> 3;\n\t\t\tswitch ($wrapText) {\n\t\t\t\tcase 0: $style['alignment']['wrap'] = false; break;\n\t\t\t\tcase 1: $style['alignment']['wrap'] = true; break;\n\t\t\t}\n\t\t\t// bit 6-4, mask 0x70; vertical alignment\n\t\t\t$vertAlign = (0x70 & ord($recordData[6])) >> 4;\n\t\t\tswitch ($vertAlign) {\n\t\t\t\tcase 0: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP; break;\n\t\t\t\tcase 1: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER; break;\n\t\t\t\tcase 2: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; break;\n\t\t\t\tcase 3: $style['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY; break;\n\t\t\t}\n\t\t// offset: 7; size: 1; XF_ROTATION: Text rotation angle\n\t\t// offset: 8; size: 1; Indentation, shrink to cell size, and text direction\n\t\t// offset: 9; size: 1; Flags used for attribute groups\n\t\t\n\t\t$style['borders'] = array(\n\t\t\t'left' => array(),\n\t\t\t'right' => array(),\n\t\t\t'top' => array(),\n\t\t\t'bottom' => array(),\n\t\t);\n\t\t// offset: 10; size: 4; Cell border lines and background area\n\t\t\t// bit: 3-0; mask: 0x0000000F; left style\n\t\t\tif ($bordersLeftStyle = $this->_readBorderStyle((0x0000000F & $this->_GetInt4d($recordData, 10)) >> 0)) {\n\t\t\t\t$style['borders']['left']['style'] = $bordersLeftStyle;\n\t\t\t}\n\t\t\t// bit: 7-4; mask: 0x000000F0; right style\n\t\t\tif ($bordersRightStyle = $this->_readBorderStyle((0x000000F0 & $this->_GetInt4d($recordData, 10)) >> 4)) {\n\t\t\t\t$style['borders']['right']['style'] = $bordersRightStyle;\n\t\t\t}\n\t\t\t// bit: 11-8; mask: 0x00000F00; top style\n\t\t\tif ($bordersTopStyle = $this->_readBorderStyle((0x00000F00 & $this->_GetInt4d($recordData, 10)) >> 8)) {\n\t\t\t\t$style['borders']['top']['style'] = $bordersTopStyle;\n\t\t\t}\n\t\t\t// bit: 15-12; mask: 0x0000F000; bottom style\n\t\t\tif ($bordersBottomStyle = $this->_readBorderStyle((0x0000F000 & $this->_GetInt4d($recordData, 10)) >> 12)) {\n\t\t\t\t$style['borders']['bottom']['style'] = $bordersBottomStyle;\n\t\t\t}\n\t\t\t// bit: 22-16; mask: 0x007F0000; left color\n\t\t\tif ($bordersLeftColor = $this->_readColor((0x007F0000 & $this->_GetInt4d($recordData, 10)) >> 16)) {\n\t\t\t\t$style['borders']['left']['color'] = $bordersLeftColor;\n\t\t\t}\n\t\t\t// bit: 29-23; mask: 0x3F800000; right color\n\t\t\tif ($bordersRightColor = $this->_readColor((0x3F800000 & $this->_GetInt4d($recordData, 10)) >> 23)) {\n\t\t\t\t$style['borders']['right']['color'] = $bordersRightColor;\n\t\t\t}\n\t\t\t\n\t\t$style['fill'] = array();\n\t\t// offset: 14; size: 4;\n\t\t\t// bit: 6-0; mask: 0x0000007F; top color\n\t\t\tif ($bordersTopColor = $this->_readColor((0x0000007F & $this->_GetInt4d($recordData, 14)) >> 0)) {\n\t\t\t\t$style['borders']['top']['color'] = $bordersTopColor;\n\t\t\t}\n\t\t\t// bit: 13-7; mask: 0x00003F80; top color\n\t\t\tif ($bordersBottomColor = $this->_readColor((0x00003F80 & $this->_GetInt4d($recordData, 14)) >> 7)) {\n\t\t\t\t$style['borders']['bottom']['color'] = $bordersBottomColor;\n\t\t\t}\n\t\t\t// bit: 31-26; mask: 0xFC000000 fill pattern\n\t\t\tif ($fillType = $this->_getFillPatternByIndex((0xFC000000 & $this->_GetInt4d($recordData, 14)) >> 26)) {\n\t\t\t\t$style['fill']['type'] = $fillType;\n\t\t\t}\n\t\t// offset: 18; size: 2; pattern and background colour\n\t\t\t// bit: 6-0; mask: 0x007F; color index for pattern color\n\t\t\tif ($rgb = $this->_readColor((0x007F & $this->_GetInt2d($recordData, 18)) >> 0)) {\n\t\t\t\t$style['fill']['startcolor'] = $rgb;\n\t\t\t}\n\t\t\t// bit: 13-7; mask: 0x3F80; color index for pattern background\n\t\t\tif ($rgb = $this->_readColor((0x3F80 & $this->_GetInt2d($recordData, 18)) >> 7)) {\n\t\t\t\t$style['fill']['endcolor'] = $rgb;\n\t\t\t}\n\t\treturn $style;\n\t}",
"protected function createStyle()\n\t{\n\t\treturn new TPanelStyle;\n\t}",
"function get_font_border_styles( $style = '', $color = '', $width = '' ) {\n\n\t$css = ['', ''];\n\n\tif ( $style == 'yes' || $style == 'hover' ) {\n\n\t\t$css[1] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t$css[0] .= 'box-sizing: border-box;';\n\n\t\tif ( $style == 'yes' ) {\n\t \t\t$css[0] .= 'border:' . $width . 'px solid ' . $color . ';';\n\t\t} elseif ( $style == 'hover' ) {\n\t\t\t$css[0] .= 'border:' . $width . 'px solid transparent;';\n\t\t}\n\n\t} else {\n\t\t$css[1] .= 'border-color: transparent;';\n\t\t$css[0] .= 'border-color: transparent;';\n\t}\n\n\treturn $css;\n}",
"function drawStyle()\r\n\t{\r\n\t}",
"protected function _drawStyle($style) {}",
"public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }",
"public function render() {\n $output = array();\n array_push($output, 0, \"STYLE\");\n array_push($output, 5, $this->getHandle());\n array_push($output, 100, \"AcDbSymbolTableRecord\");\n array_push($output, 100, \"AcDbTextStyleTableRecord\");\n array_push($output, 2, strtoupper($this->name));\n array_push($output, 70, $this->flag);\n array_push($output, 6, $this->lineType);\n return implode(PHP_EOL, $output);\n }",
"private function _addLayers()\n {\n $sort = array();\n\n $this->layers['base'] = 'on';\n unset($this->layers['grid']);\n\n if (isset($this->output) && $this->output == 'svg') {\n unset($this->layers['relief'], $this->layers['reliefgrey']);\n }\n\n foreach ($this->layers as $key => $row) {\n $sort[$key] = (isset($this->shapes[$key])) ? $this->shapes[$key]['sort'] : $row;\n }\n array_multisort($sort, SORT_ASC, $this->layers);\n\n $srs_projections = implode(array_keys(self::$accepted_projections), \" \");\n\n foreach ($this->layers as $name => $status) {\n //make the layer\n if (array_key_exists($name, $this->shapes)) {\n $layer = ms_newLayerObj($this->map_obj);\n $layer->set(\"name\", $name);\n $layer->setMetaData(\"wfs_title\", $name);\n $layer->setMetaData(\"wfs_typename\", $name);\n $layer->setMetaData(\"wfs_srs\", $srs_projections);\n $layer->setMetaData(\"wfs_extent\", \"-180 -90 180 90\");\n $layer->setMetaData(\"wfs_encoding\", $this->shapes[$name]['encoding']);\n $layer->setMetaData(\"wms_title\", $name);\n $layer->setMetaData(\"wms_srs\", $srs_projections);\n $layer->setMetaData(\"gml_include_items\", \"all\");\n $layer->setMetaData(\"gml_featureid\", \"OBJECTID\");\n $layer->set(\"type\", $this->shapes[$name]['type']);\n $layer->set(\"status\", MS_ON);\n $layer->setConnectionType(MS_SHAPEFILE);\n $layer->set(\"data\", $this->shapes[$name]['shape']);\n $layer->setProjection(self::getProjection($this->default_projection));\n $layer->set(\"template\", \"template.html\");\n $layer->set(\"dump\", true);\n\n switch ($name) {\n case 'lakesOutline':\n $class = ms_newClassObj($layer);\n $style = ms_newStyleObj($class);\n $style->color->setRGB(80, 80, 80);\n break;\n\n case 'rivers':\n case 'lakes':\n $class = ms_newClassObj($layer);\n $style = ms_newStyleObj($class);\n $style->color->setRGB(120, 120, 120);\n break;\n\n case 'oceans':\n $class = ms_newClassObj($layer);\n $style = ms_newStyleObj($class);\n $style->color->setRGB(220, 220, 220);\n break;\n\n case 'conservation':\n $layer->set(\"opacity\", 75);\n $class = ms_newClassObj($layer);\n $class->set(\"name\", \"Conservation International 2011 Hotspots\");\n $style = ms_newStyleObj($class);\n $style->color->setRGB(200, 200, 200);\n $style->outlinecolor->setRGB(30, 30, 30);\n $this->_legend_required = true;\n break;\n\n case 'ecoregions':\n $layer->set(\"opacity\", 75);\n $layer->set(\"classitem\", \"ECO_SYM\");\n $this->_setEcoregionClasses($layer);\n $this->_legend_required = true;\n break;\n\n case 'rivernames':\n case 'lakenames':\n $layer->set(\"tolerance\", 1);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"name\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(8, MS_UR, $this->shapes[$name]['encoding']));\n break;\n\n case 'base':\n case 'countries':\n case 'stateprovinces':\n $class = ms_newClassObj($layer);\n $style = ms_newStyleObj($class);\n $style->set(\"width\", $this->_determineWidth());\n $style->color->setRGB(10, 10, 10);\n break;\n\n case 'countrynames':\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"name\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(12, MS_CC, $this->shapes[$name]['encoding']));\n break;\n\n case 'stateprovnames':\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"name\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(10, MS_CC, $this->shapes[$name]['encoding']));\n break;\n\n case 'placenames':\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"name\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(8, MS_UR, $this->shapes[$name]['encoding']));\n\n $style = ms_newStyleObj($class);\n $style->set(\"symbolname\", \"circle\");\n $style->set(\"size\", ($this->_isResize() && $this->_download_factor > 1) ? $this->_download_factor*7 : 6);\n $style->color->setRGB(100, 100, 100);\n break;\n\n case 'physicalLabels':\n case 'marineLabels':\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"name\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(8, MS_UR, $this->shapes[$name]['encoding']));\n break;\n\n case 'hotspotLabels':\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"NAME\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(8, MS_UR, \"UTF-8\"));\n break;\n\n case 'ecoregionLabels':\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", \"pixels\");\n $layer->set(\"labelitem\", \"ECO_NAME\");\n $class = ms_newClassObj($layer);\n $class->addLabel($this->_createLabel(8, MS_UR, \"UTF-8\"));\n break;\n\n default:\n }\n }\n }\n }",
"function createPenStyle($img, $penStyle, $baseColor, $bgColor)\r\n{\r\n $b = ColorFromHex($img, $bgColor);\r\n $w = ColorFromHex($img, $baseColor);\r\n\r\n switch ($penStyle)\r\n {\r\n case psDash:\r\n return array($w, $w, $w, $w, $b, $b, $b, $b);\r\n break;\r\n case psDashDot:\r\n return array($w, $w, $w, $w, $b, $b, $w, $b, $b);\r\n break;\r\n case psDot:\r\n return array($w, $b, $b, $w, $b, $b);\r\n break;\r\n case psDashDotDot:\r\n return array($w, $w, $w, $w, $b, $w, $b, $w, $b);\r\n break;\r\n default:\r\n //psSolid\r\n return array($w);\r\n break;\r\n }\r\n}",
"public function wktGenerateGeometry();",
"public function createStyle(\n StyleEnum ...$styles\n ): StyleInterface;",
"public function createStyle(\n StyleEnum ...$styles\n ): StyleInterface;",
"private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }",
"public function createNewStyle($data) {\n\n $data = [\n 'id' => $this->generateUUID(),\n 'name' => $data['name'],\n 'line_id' => $data['lineId'],\n 'product_brief' => isset($data['productBrief']) ? json_encode($data['productBrief']) : null,\n 'customer_style_code' => isset($data['customerStyleCode']) ? $data['customerStyleCode'] : null,\n ];\n\n return $this->create($data);\n\t}",
"function wp_migrate_old_typography_shape($metadata)\n {\n }",
"private function _interpretStyle($style_str = null)\n\t{\n\t\tif(is_null($style_str))\n\t\t\treturn self::GEOMETRY_SCALE_NONE;\n\n\t\t$match = false;\n\t\tforeach(self::$_GEOMETRY_INTERPRETATION_MAPPING as $style => $pattern) {\n\t\t\tif(!is_null($pattern)) {\n\t\t\t\t$pattern = '~'.$pattern.'~';\n\n\t\t\t\tif(preg_match($pattern, $style_str)) {\n\t\t\t\t\t$match = $style;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn !$match ? self::GEOMETRY_SCALE_NONE : $match;\n\t}"
] |
[
"0.6606548",
"0.60184246",
"0.58629304",
"0.5816754",
"0.5805765",
"0.5761126",
"0.5671612",
"0.56430024",
"0.56099504",
"0.5174917",
"0.50803417",
"0.50738627",
"0.49741384",
"0.49557322",
"0.4932957",
"0.49172035",
"0.4900288",
"0.48821038",
"0.48514026",
"0.4843962",
"0.48224843",
"0.48101506",
"0.4785707",
"0.47397134",
"0.47027814",
"0.47027814",
"0.4696535",
"0.4663122",
"0.45364144",
"0.4533664"
] |
0.8155388
|
0
|
string packSHAPE(integer NumFillBits, integer NumLineBits, string ShapeRecords) returns an SWF SHAPE string.
|
function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)
{
array_push($this->FMDebug, "packSHAPE");
$lower_limit = 0;
$upper_limit = 15;
if (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {
$this->FMError("packSHAPE argument (NumFillBits) out of range");
}
if (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {
$this->FMError("packSHAPE argument (NumLineBits) out of range");
}
$atom = $this->packnBits($NumFillBits, 4);
$atom .= $this->packnBits($NumLineBits, 4);
$atom = $this->packBitValues($atom);
$atom .= $ShapeRecords;
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function shapeString() : string\n {\n return (string) $this->m . ' x ' . (string) $this->n;\n }",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}",
"public function format(ShapeInterface $shape);",
"function packFILLSTYLEARRAY($FillStyleCount, $FillStyles)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLEARRAY\");\n\n\t\tif ($FillStyleCount < 0xff) {\n\n\t\t\t$atom = $this->packUI8($FillStyleCount);\n\n\t\t} else {\n\n\t\t\t$atom = chr(0xff) . $this->packUI16($FillStyleCount);\n\t\t}\n\n\t\t$atom .= $FillStyles; \n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function getShapeId()\n {\n return $this->shape_id;\n }",
"function packGRADIENT($GradientRecords, $AlphaFlag)\n\t{\n\t\tarray_push($this->FMDebug, \"packGRADIENT\");\n\n\t\tif ($AlphaFlag) {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 5) . $GradientRecords;\n\t\t} else {\n\t\t\t$atom = $this->packUI8((int)strlen($GradientRecords) / 4) . $GradientRecords;\n\t\t}\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }",
"function getShape() { return $this->_shape; }",
"function getShape() { return $this->_shape; }",
"public function getShape1()\n {\n }",
"private static function getShapefilePath($files)\n {\n /*\n * Check shapefile is complete i.e. contains XXX.shp, XXX.dbf and XXX.shx\n */\n $path = null;\n for ($i = count($files); $i--;) {\n if (strtolower(substr($files[$i], -3)) === 'shp') {\n $path = $files[$i];\n break;\n }\n }\n \n return isset($path) && is_readable($path) && is_file($path) ? $path : null;\n }",
"public function build(): string\n {\n $this->verifyBom($this->encoding, $this->description);\n $this->_handleDefaultValues();\n\n $frame = $this->encoding->getCode();\n $frame .= $this->mimeType;\n $frame .= \"\\x00\";\n $frame .= $this->pictureType;\n $frame .= $this->description;\n $frame .= $this->encoding->getDelimiter();\n $frame .= $this->pictureData;\n\n return $frame;\n }",
"private function buildDebug( $records ){\n\n $data = $this->buildLabelSizeData('SRCE', hex2bin( current( unpack( \"H*\", $records['SRCE'] ) ) ) );\n\n if (isset($records['LINE']) && count($records['LINE']))\n $data .= $this->buildLabelSizeData('LINE', hex2bin( implode('', $records['LINE'])) );\n// else\n// $data .= $this->buildLabelSizeData('LINE', hex2bin( implode('', [])) );\n\n if (isset($records['TRCE']))\n $data .= $this->buildLabelSizeData('TRCE', hex2bin( implode('', $records['TRCE'])) );\n\n return $this->buildLabelSizeData(\n 'DBUG', $data\n );\n }",
"public function wktGenerateGeometry();",
"protected function postShapeSaveAsRequest(Requests\\PostShapeSaveAsRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling postShapeSaveAs');\n }\n // verify the required parameter 'slide_index' is set\n if ($request->slideIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $slideIndex when calling postShapeSaveAs');\n }\n // verify the required parameter 'shape_index' is set\n if ($request->shapeIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $shapeIndex when calling postShapeSaveAs');\n }\n // verify the required parameter 'format' is set\n if ($request->format === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $format when calling postShapeSaveAs');\n }\n\n $resourcePath = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/{format}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->password !== null) {\n $queryParams['password'] = ObjectSerializer::toQueryValue($request->password);\n }\n // query params\n if ($request->folder !== null) {\n $queryParams['folder'] = ObjectSerializer::toQueryValue($request->folder);\n }\n // query params\n if ($request->storage !== null) {\n $queryParams['storage'] = ObjectSerializer::toQueryValue($request->storage);\n }\n // query params\n if ($request->scaleX !== null) {\n $queryParams['scaleX'] = ObjectSerializer::toQueryValue($request->scaleX);\n }\n // query params\n if ($request->scaleY !== null) {\n $queryParams['scaleY'] = ObjectSerializer::toQueryValue($request->scaleY);\n }\n // query params\n if ($request->bounds !== null) {\n $queryParams['bounds'] = ObjectSerializer::toQueryValue($request->bounds);\n }\n // query params\n if ($request->fontsFolder !== null) {\n $queryParams['fontsFolder'] = ObjectSerializer::toQueryValue($request->fontsFolder);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"name\", $request->name);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"slideIndex\", $request->slideIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"shapeIndex\", $request->shapeIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"format\", $request->format);\n $_tempBody = null;\n if (isset($request->options)) {\n $_tempBody = $request->options;\n }\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['multipart/form-data'],\n ['application/json']);\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n }\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'POST');\n }",
"function wkt() {\n $wkt_string = '';\n $wkt = 'LINESTRING(';\n for ($i = 0; $i < count($this->geometries); $i++) {\n if (count($this->geometries[i]['coords']) === 0) {\n return 'LINESTRING(empty)';\n } else {\n $coords = $this->geometries[i]['coords'];\n foreach ($coords as $c) {\n $wkt .= $c[0] . ' ' . $c[1] . ',';\n }\n $wkt_string .= substr($wkt, 0, -1) . ')';\n }\n }\n return $wkt_string;\n }",
"private function readSHPHeader()\n {\n // Shape Type\n $this->setFilePointer(Shapefile::FILE_SHP, 32);\n $this->setShapeType($this->readInt32L(Shapefile::FILE_SHP));\n \n // Read Bounding Box if there are any records in the file.\n // Z and M ranges are always present in the Shapefile, although with value 0 if not used.\n if (!$this->getOption(Shapefile::OPTION_IGNORE_SHAPEFILE_BBOX) && ($this->getTotRecords() === Shapefile::UNKNOWN || $this->getTotRecords() > 0)) {\n $bounding_box = $this->readXYBoundingBox() + $this->readZRange() + $this->readMRange();\n if (!$this->isZ()) {\n unset($bounding_box['zmin']);\n unset($bounding_box['zmax']);\n }\n if (!$this->isM()) {\n unset($bounding_box['mmin']);\n unset($bounding_box['mmax']);\n }\n $this->setCustomBoundingBox($bounding_box);\n }\n \n // Set SHP file pointer to first record\n $this->setFilePointer(Shapefile::FILE_SHP, Shapefile::SHP_HEADER_SIZE);\n return $this;\n }",
"function packFILLSTYLE($FillStyleType, $R, $G, $B, $AlphaFlag, $A, $GradientMatrix, $Gradient, $BitmapID, $BitmapMatrix)\n\t{\n\t\tarray_push($this->FMDebug, \"packFILLSTYLE\");\n\n\t\t//-------------------------------------------------- .[cal]\n\t\t// add vertical and horizontal straight edges.\n\t\tif(!isset($atom) & $this->Cal_mode){\n\t\t $atom = \"\";\n\t\t}\n\t\t// [cal].\n\n\n\t\tswitch ($FillStyleType) {\n\n\t\t\tcase 0x00:\n\n\t\t\t\tif ($AlphaFlag) {\n\n\t\t\t\t\tif ($A == \"\") {\n\n\t\t\t\t\t\t$A = 0xff;\n\t\t\t\t\t}\n\n\t\t\t\t\t$atom .= $this->packRGBA($R, $G, $B, $A);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$atom .= $this->packRGB($R, $G, $B);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x10:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x12:\n\n\t\t\t\t$atom .= $GradientMatrix . $Gradient;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x40:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 0x41:\n\n\t\t\t\t$atom .= $this->packUI16($BitmapID) . $BitmapMatrix;\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packFILLSTYLE unknown FillStyleType value\");\n\t\t}\n\n\t\t$atom = $this->packUI8($FillStyleType) . $atom;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function shape($value) {\n return $this->setProperty('shape', $value);\n }",
"public function getShape2()\n {\n }",
"private function readDBFHeader()\n {\n // Number of records\n $this->setFilePointer(Shapefile::FILE_DBF, 4);\n if ($this->readInt32L(Shapefile::FILE_DBF) !== $this->getTotRecords() && $this->getTotRecords() !== Shapefile::UNKNOWN) {\n throw new ShapefileException(Shapefile::ERR_DBF_MISMATCHED_FILE);\n }\n \n // Header and Record size\n $this->dbf_header_size = $this->readInt16L(Shapefile::FILE_DBF);\n $this->dbf_record_size = $this->readInt16L(Shapefile::FILE_DBF);\n \n // Fields\n $this->dbf_fields = [];\n $this->setFilePointer(Shapefile::FILE_DBF, 32);\n while ($this->getFilePointer(Shapefile::FILE_DBF) < $this->dbf_header_size - 1) {\n $name = $this->normalizeDBFFieldNameCase($this->readString(Shapefile::FILE_DBF, 10));\n $this->setFileOffset(Shapefile::FILE_DBF, 1);\n $type = $this->readString(Shapefile::FILE_DBF, 1);\n $this->setFileOffset(Shapefile::FILE_DBF, 4);\n $size = $this->readChar(Shapefile::FILE_DBF);\n $decimals = $this->readChar(Shapefile::FILE_DBF);\n $ignored = in_array($name, $this->getOption(Shapefile::OPTION_DBF_IGNORED_FIELDS));\n if ($type === Shapefile::DBF_TYPE_MEMO && !$ignored && !$this->isFileOpen(Shapefile::FILE_DBT)) {\n throw new ShapefileException(Shapefile::ERR_FILE_MISSING, strtoupper(Shapefile::FILE_DBT));\n }\n $this->dbf_fields[] = [\n 'name' => $ignored ? null : $this->addField($name, $type, $size, $decimals, true),\n 'ignored' => $ignored,\n 'size' => $size,\n ];\n $this->setFileOffset(Shapefile::FILE_DBF, 14);\n }\n \n // Field terminator byte\n if ($this->readChar(Shapefile::FILE_DBF) !== Shapefile::DBF_FIELD_TERMINATOR) {\n throw new ShapefileException(Shapefile::ERR_DBF_FILE_NOT_VALID);\n }\n \n return $this;\n }",
"function shape ($arguments) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tshape');\n return $rc->newInstanceArgs( $arguments ); \n}",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"protected function postNotesSlideShapeSaveAsRequest(Requests\\PostNotesSlideShapeSaveAsRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling postNotesSlideShapeSaveAs');\n }\n // verify the required parameter 'slide_index' is set\n if ($request->slideIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $slideIndex when calling postNotesSlideShapeSaveAs');\n }\n // verify the required parameter 'shape_index' is set\n if ($request->shapeIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $shapeIndex when calling postNotesSlideShapeSaveAs');\n }\n // verify the required parameter 'format' is set\n if ($request->format === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $format when calling postNotesSlideShapeSaveAs');\n }\n\n $resourcePath = '/slides/{name}/slides/{slideIndex}/notesSlide/shapes/{shapeIndex}/{format}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->password !== null) {\n $queryParams['password'] = ObjectSerializer::toQueryValue($request->password);\n }\n // query params\n if ($request->folder !== null) {\n $queryParams['folder'] = ObjectSerializer::toQueryValue($request->folder);\n }\n // query params\n if ($request->storage !== null) {\n $queryParams['storage'] = ObjectSerializer::toQueryValue($request->storage);\n }\n // query params\n if ($request->scaleX !== null) {\n $queryParams['scaleX'] = ObjectSerializer::toQueryValue($request->scaleX);\n }\n // query params\n if ($request->scaleY !== null) {\n $queryParams['scaleY'] = ObjectSerializer::toQueryValue($request->scaleY);\n }\n // query params\n if ($request->bounds !== null) {\n $queryParams['bounds'] = ObjectSerializer::toQueryValue($request->bounds);\n }\n // query params\n if ($request->fontsFolder !== null) {\n $queryParams['fontsFolder'] = ObjectSerializer::toQueryValue($request->fontsFolder);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"name\", $request->name);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"slideIndex\", $request->slideIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"shapeIndex\", $request->shapeIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"format\", $request->format);\n $_tempBody = null;\n if (isset($request->options)) {\n $_tempBody = $request->options;\n }\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['multipart/form-data'],\n ['application/json']);\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n }\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'POST');\n }"
] |
[
"0.7144628",
"0.6012865",
"0.5900498",
"0.5738529",
"0.5615256",
"0.5609689",
"0.5489456",
"0.5321926",
"0.5224413",
"0.49802437",
"0.47562456",
"0.47535473",
"0.4680655",
"0.4677452",
"0.46161076",
"0.45312107",
"0.4523077",
"0.45113346",
"0.44662642",
"0.44604236",
"0.44375095",
"0.43877408",
"0.4383477",
"0.43700254",
"0.43613535",
"0.43457192",
"0.433534",
"0.43339965",
"0.43267503",
"0.4321066"
] |
0.7677107
|
0
|
string packASSET(integer Tag, string Label) returns an ASSET string used by ExportAssets and ImportAssets tags.
|
function packASSET($Tag, $Label)
{
array_push($this->FMDebug, "packASSET");
$atom = $this->packUI16($Tag);
$atom .= $this->packSTRING($Label);
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packExportAssetsTag($AssetList)\n\t{\n\t\tarray_push($this->FMDebug, \"packExportAssetsTag\");\n\n\t\t$TagID = 56;\n\n\t\t$AssetCount = substr_count($AssetList, chr(0));\n\n\t\t$TagLength = strlen($AssetCount . $AssetList);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $AssetCount . $AssetList;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packImportAssetsTag($URL, $AssetList)\n\t{\n\t\tarray_push($this->FMDebug, \"packImportAssetsTag\");\n\n\t\t$TagID = 57;\n\n\t\t$URL = $this->packSTRING($URL);\n\n\t\t$AssetCount = substr_count($AssetList, chr(0)) - 1;\n\n\t\t$TagLength = strlen($URL, $AssetCount . $AssetList);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $URL . $AssetCount . $AssetList;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function getTag()\n {\n return 'assets';\n }",
"function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}",
"function asset($url = '')\n{\n return ASSET . $url;\n}",
"public static function getArchivalTagList() {\n\t\t// $archival_tags = [];\n// \t\tforeach (self::$asset_tags as $tag=>$label){\n// \t\t\tif (strpos($label,'*') !== false){\n// \t\t\t\t$archive_tags[] = \"'$tag'\";\n// \t\t\t}\n// \t\t}\n\t\treturn \"'\" . implode(\"','\",array_keys(self::$asset_tags)) . \"'\" ;\n\t}",
"protected function getAssetType($tag)\n {\n switch($tag)\n {\n case 'img':\n return 'images';\n break;\n\n case 'video':\n return 'videos';\n break;\n\n case 'a':\n return 'link';\n break;\n\n default:\n return 'other';\n break;\n }\n\n return 'other';\n }",
"protected function asset($name, $group)\n\t{\n\t\tif(!$asset = $this->find($name, $group))\n\t\t{\n\t\t\treturn PHP_EOL . '/* Basset could not find asset [' . $name . '] */' . PHP_EOL;\n\t\t}\n\n\t\t$contents = file_get_contents($asset['file']);\n\n\t\tif($group == 'styles')\n\t\t{\n\t\t\t$contents = Basset\\URIRewriter::rewrite($contents, dirname($asset['file']));\n\t\t}\n\n\t\tif($asset['less'] && $this->settings['less']['php'])\n\t\t{\n\t\t\t$less = new Basset\\lessc;\n\n\t\t\t$contents = $less->parse($contents);\n\t\t}\n\n\t\treturn $contents . PHP_EOL;\n\t}",
"public function getCode()\n {\n return 'resource_to_asset';\n }",
"public function __toString()\n\t{\n\t\tif(!$this->group)\n\t\t{\n\t\t\t$this->group = (isset($this->assets['styles']) && isset($this->assets['scripts']) ? 'styles' : (isset($this->assets['styles']) ? 'styles' : 'scripts'));\n\t\t}\n\n\t\treturn $this->render($this->group);\n\t}",
"function smarty_modifier_toAssetPath($string) {\n\n if (strpos($string, \"::\") !== false) {\n $parts = explode(\"::\", $string);\n $src = ModulesContext::instance()->getConfig()->get(\"businessRoot\", \"src\");\n $base = trim(str_replace(\"::\", \"/\", $src), \"/\");\n $result = \"$base/$parts[0]/assets/$parts[1]\";\n } else {\n $result = \"assets/$result\";\n }\n\n $resultingPath = Loader::toSinglePath($result, \".tpl\");\n\n return $resultingPath;\n}",
"function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function asset($name = null)\n {\n $document = explode('/', rtrim(app('http.request')->uri, \"/\"));\n $document = end($document);\n\n $defaultPath = $document === 'public' ? 'assets/' : 'public/assets/';\n\n $packpage = new \\Anonym\\Assets\\VersionPackpage('', '%f', $defaultPath);\n return $name !== null ? $packpage->getUrl($name) : $defaultPath;\n }",
"public function name()\n\t{\n\t\tif($this->name)\n\t\t{\n\t\t\treturn $this->name;\n\t\t}\n\n\t\t$name = array();\n\n\t\tforeach($this->assets[$this->group] as $asset)\n\t\t{\n\t\t\t$name[] = str_replace(path('base'), '', $asset['source']) . '/' . $asset['file'];\n\t\t}\n\n\t\tsort($name);\n\n\t\treturn $this->name = md5('basset_' . $this->group . '_' . implode('', $name));\n\t}",
"public function tags()\n\t{\n\t\t$tags = '';\n\n\t\tif ($this->collection->shouldCombine())\n\t\t{\n\t\t\t$tags = $this->tag($this->collection->cacheFileUrl);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($this->collection->items as $asset)\n\t\t\t{\n\t\t\t\t$tags .= $this->tag($asset->url);\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}",
"public function tag()\n\t{\n\t\t/* Example usage:\n\t\t{exp:crush:tag \n\t\t\tfilename=\"/_assets/css/style.css\"\n\t\t\tminify=\"y\"\n\t\t\tvars=\"my_var1=#333|my_var2=20px\"\n\t\t\tattributes=\"media=print|title=monkey\"\n\t\t} \n\t\t*/\n\t\treturn csscrush_tag(\n\t\t\t$this->filename, \n\t\t\t$this->get_params(FALSE, array('filename', 'attributes')),\n\t\t\t$this->attributes\n\t\t);\n\n\t}",
"public function getAssetType() : string\n {\n return $this->getProperty()->assetType;\n }",
"function packSTRING($text)\n\t{\n\t\tarray_push($this->FMDebug, \"packSTRING\");\n\n\t\tif (!(is_string($text))) {\n\n\t\t\t$this->FMError(\"packSTRING argument not a string\");\n\t\t}\n\n\t\t$atom = strtr($text, chr(0), \"\") . chr(0);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function render_assets_tags($type = '', $group = '')\n\t{\n\t\t$assets_tags = '';\n\t\t\n\t\tforeach(array('css', 'js') as $try_type)\n\t\t{\n\t\t\tif(!$type || $type == $try_type)\n\t\t\t{\n\t\t\t\t$assets_tags .= $this->_build_assets_tags($try_type, $this->_combine_assets($try_type, $this->_assets[$try_type]), $group);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $assets_tags;\n\t}",
"protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\t\treturn 'com_groups.group.' . (int) $this->$k;\n\t}",
"public function getName()\n {\n return 'assets';\n }",
"public function getName()\n {\n return 'assets';\n }",
"function asset_tran($a) {\n\n\tstatic $asset_tran = array (\n\t'R' => 'O',\n\t'S' => 'O',\n\t'D' => 'X',\n\t'N' => 'U',\n\t);\n\treturn $asset_tran[$a] ?? $a;\n}",
"function assetTags ($type, $paths, $incTag, $blockTag) {\n\n $paths = uv($paths);\n if (!is_array($paths)) {\n $paths = !$paths ? [] : [$paths];\n }\n // if ($type == 'js') {\n // $jsData = Tht::module('Js')->u_plugin('jsData');\n // if ($jsData) { array_unshift($paths, $jsData); }\n // }\n\n if (!count($paths)) { return ''; }\n\n $nonce = Tht::module('Web')->u_nonce();\n\n $includes = [];\n $blocks = [];\n foreach ($paths as $path) {\n\n if (!OTypeString::isa($path)) {\n $this->error(\"Path must be a `url` or `$type` TypeString: `$path`\");\n }\n\n if (HtmlTypeString::isa($path)) {\n $tag = $path->u_stringify();\n $blocks []= $tag;\n }\n else if (!UrlTypeString::isa($path)){\n\n // Inline it in the HTML document\n $str = $path->u_stringify();\n if ($type == 'js' && !preg_match('#\\s*\\(function\\(\\)\\{#', $str)) {\n $str = \"(function(){\" . $str . \"})();\";\n }\n\n $vals = [\n 'body' => OTypeString::create('html', $str),\n ];\n if ($type == 'js') {\n $vals['nonce'] = $nonce;\n }\n $blockTag->u_fill(OMap::create($vals));\n $blocks []= $blockTag->u_stringify();\n }\n else {\n if ($path->u_is_relative()) {\n // TODO: Link to asset, with cache time set to file modtime\n\n // $basePath = ;\n // if (defined('BASE_URL')) {\n // $basePath = preg_replace('#' . BASE_URL . '#', '', $basePath);\n // }\n\n // $filePath = Tht::getThtFileName(Tht::path('pages', $basePath));\n // $path->u_query([ 'cache' => filemtime($filePath));\n }\n\n $vals = [\n 'url' => $path\n ];\n if ($type == 'js') {\n $vals['nonce'] = $nonce;\n }\n $incTag->u_fill(OMap::create($vals));\n $includes []= $incTag->u_stringify();\n }\n }\n\n $sIncludes = implode(\"\\n\", $includes);\n $sBlocks = implode(\"\\n\\n\", $blocks);\n\n return $sIncludes . \"\\n\" . $sBlocks;\n }",
"public function saveNBT(): CompoundTag\n\t{\n\t\treturn CompoundTag::create()->setByte(\"bruhhhhIHatePM4Entities\", 1);\n\t}",
"function _encode_v1() {\n if ($this->debug) print($this->debugbeg . \"_encode_v1()<HR>\\n\");\n\n if ($this->track) {\n // ID3 v1.1\n $id3pack = 'a3a30a30a30a4a28x1C1C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->track,\n $this->genreno\n );\n } else {\n // ID3 v1\n $id3pack = 'a3a30a30a30a4a30C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->genreno\n );\n }\n\n if ($this->debug) {\n print('id3pack: ' . $id3pack . \"\\n\");\n $unp = unpack('H*new', $newtag);\n print_r($unp);\n }\n\n if ($this->debug) print($this->debugend);\n return $newtag;\n }",
"protected function group($group)\n {\n if ( ! isset($this->assets[$group]) or count($this->assets[$group]) == 0) return '';\n\n $out = '';\n\n // each $assset object has a render function. Use it\n foreach ($this->assets[$group] as $asset) {\n $out .= $asset->render();\n }\n\n return $out;\n }",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function asset_image_tag($asset, $thumbnail_type = 'full', $options = array(), $relative_path = null)\n{\n if ($asset == null) {\n return '';\n }\n $options = array_merge(array(\n 'alt' => $asset->getDescription() . ' ' . $asset->getCopyright(),\n 'title' => $asset->getDescription() . ' ' . $asset->getCopyright()\n ), $options);\n\n if($asset->isImage())\n {\n $src = $asset->getUrl($thumbnail_type, $relative_path);\n }\n else\n {\n if($thumbnail_type == 'full')\n {\n throw new sfAssetException('Impossible to render a non-image asset in an image tag');\n }\n else\n {\n switch($asset->getType())\n {\n case 'txt':\n $src = '/sfAssetsLibraryPlugin/images/txt.png';\n break;\n case 'xls':\n $src = '/sfAssetsLibraryPlugin/images/xls.png';\n break;\n case 'doc':\n $src = '/sfAssetsLibraryPlugin/images/doc.png';\n break;\n case 'pdf':\n $src = '/sfAssetsLibraryPlugin/images/pdf.png';\n break;\n case 'html':\n $src = '/sfAssetsLibraryPlugin/images/html.png';\n break;\n case 'archive':\n $src = '/sfAssetsLibraryPlugin/images/archive.png';\n break;\n case 'bin':\n $src = '/sfAssetsLibraryPlugin/images/bin.png';\n break;\n default:\n $src = '/sfAssetsLibraryPlugin/images/unknown.png';\n }\n }\n }\n return image_tag($src, $options);\n}",
"protected function _getAssetTitle() {\n return $this->shortname;\n }"
] |
[
"0.61574143",
"0.5868938",
"0.5862714",
"0.5612724",
"0.5589589",
"0.5491182",
"0.51010966",
"0.49497572",
"0.49055585",
"0.47979584",
"0.47944203",
"0.4727726",
"0.47122222",
"0.47073808",
"0.4703685",
"0.47003153",
"0.46563938",
"0.46492666",
"0.4625888",
"0.4618678",
"0.45876995",
"0.45876995",
"0.45772249",
"0.45601252",
"0.45547232",
"0.4549658",
"0.4546849",
"0.45032486",
"0.44959176",
"0.44945177"
] |
0.8559517
|
0
|
array parseJPEGfile(string filename) returns an array that holds the given JPEG file broken up into chunks.
|
function parseJPEGfile($filename)
{
array_push($this->FMDebug, "parseJPEGfile");
$SOI = chr(0xff) . chr(0xd8);
$APP0 = chr(0xff) . chr(0xe0);
$DQT = chr(0xff) . chr(0xdb);
$SOF0 = chr(0xff) . chr(0xc0);
$SOF1 = chr(0xff) . chr(0xc1);
$SOF2 = chr(0xff) . chr(0xc2);
$DHT = chr(0xff) . chr(0xc4);
$DRI = chr(0xff) . chr(0xdd);
$SOS = chr(0xff) . chr(0xda);
$EOI = chr(0xff) . chr(0xd9);
$COM = chr(0xff) . chr(0xfe);
$filearray = array("JPEGEncoding" => "", "JPEGImage" => "");
$filehandle = fopen($filename, "r");
if ($filehandle == FALSE) {
$this->FMError("parseJPEGfile cannot open file");
}
$jpeg = fread($filehandle, filesize($filename));
fclose($filehandle);
$marker = strpos($jpeg, $SOI);
$jpeg = substr($jpeg, $marker);
$loop = True;
while ($loop == True) {
if (strlen($jpeg) == 0) {
$loop = False;
}
switch (substr($jpeg, 0, 2)) {
case $SOI:
$filearray["JPEGEncoding"] = $SOI;
$filearray["JPEGImage"] = $SOI;
$jpeg = substr($jpeg, 2);
break;
case $APP0:
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$filearray["JPEGImage"] .= substr($jpeg, 0, $blocklength + 2);
$jpeg = substr($jpeg, $blocklength + 2);
break;
case $DQT:
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$filearray["JPEGEncoding"] .= substr($jpeg, 0, $blocklength + 2);
$jpeg = substr($jpeg, $blocklength + 2);
break;
case $SOF0:
case $SOF1:
case $SOF2:
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$filearray["JPEGImage"] .= substr($jpeg, 0, $blocklength + 2);
$filearray["width"] = ord(substr($jpeg, 7, 1)) * 256 + ord(substr($jpeg, 8, 1));
$filearray["height"] = ord(substr($jpeg, 5, 1)) * 256 + ord(substr($jpeg, 6, 1));
$jpeg = substr($jpeg, $blocklength + 2);
break;
case $DHT:
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$filearray["JPEGEncoding"] .= substr($jpeg, 0, $blocklength + 2);
$jpeg = substr($jpeg, $blocklength + 2);
break;
case $DRI:
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$filearray["JPEGImage"] .= substr($jpeg, 0, $blocklength + 2);
$jpeg = substr($jpeg, $blocklength + 2);
break;
case $COM:
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$jpeg = substr($jpeg, $blocklength + 2);
break;
case $EOI:
$filearray["JPEGEncoding"] .= $EOI;
$filearray["JPEGImage"] .= $EOI;
$loop = False;
break;
default:
if (substr($jpeg, 0, 2) == $SOS) {
$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));
$filearray["JPEGImage"] .= substr($jpeg, 0, $blocklength + 2);
$jpeg = substr($jpeg, $blocklength + 2);
$marker = strpos($jpeg, chr(255));
$filearray["JPEGImage"] .= substr($jpeg, 0, $marker);
$jpeg = substr($jpeg, $marker);
$foundsos = True;
} else {
if ($foundsos) {
$filearray["JPEGImage"] .= substr($jpeg, 0, 1);
$jpeg = substr($jpeg, 1);
$marker = strpos($jpeg, chr(255));
$filearray["JPEGImage"] .= substr($jpeg, 0, $marker);
$jpeg = substr($jpeg, $marker);
} else {
$this->FMError("parseJPEGfile error parsing JPEG file file");
}
}
}
};
array_pop($this->FMDebug);
return $filearray;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function _parsejpg($file)\n\t\t{\n\t\t\t$a=GetImageSize($file);\n\t\t\tif(!$a)\n\t\t\t\t$this->Error('Missing or incorrect image file: '.$file);\n\t\t\tif($a[2]!=2)\n\t\t\t\t$this->Error('Not a JPEG file: '.$file);\n\t\t\tif(!isset($a['channels']) or $a['channels']==3)\n\t\t\t\t$colspace='DeviceRGB';\n\t\t\telseif($a['channels']==4)\n\t\t\t\t$colspace='DeviceCMYK';\n\t\t\telse\n\t\t\t\t$colspace='DeviceGray';\n\t\t\t$bpc=isset($a['bits']) ? $a['bits'] : 8;\n\t\t\t//Read whole file\n\t\t\t$f=fopen($file,'rb');\n\t\t\t$data='';\n\t\t\twhile(!feof($f))\n\t\t\t\t$data.=fread($f,4096);\n\t\t\tfclose($f);\n\t\t\treturn array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);\n\t\t}",
"public function _checkparsejpg($file)\r\n\t{\r\n\t\t\r\n\t\t$a = getimagesize($file);\r\n\t\tif(!$a)\r\n\t\t\t$this->ImageError('Missing or incorrect image file: '.$file);\r\n\t\tif($a[2]!=2)\r\n\t\t\t$this->ImageError('Not a JPEG file: '.$file);\r\n\t\tif(!isset($a['channels']) || $a['channels']==3)\r\n\t\t\t$colspace='DeviceRGB';\r\n\t\telseif($a['channels']==4)\r\n\t\t\t$colspace='DeviceCMYK';\r\n\t\telse\r\n\t\t\t$colspace='DeviceGray';\r\n\t\t$bpc=isset($a['bits']) ? $a['bits'] : 8;\r\n\t\t//Read whole file\r\n\t\t$f=fopen($file,'rb');\r\n\t\t$data='';\r\n\t\twhile(!feof($f))\r\n\t\t\t$data.=fread($f,8192);\r\n\t\tfclose($f);\r\n\t\treturn array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);\r\n\t}",
"public static function split_to_array($filename) {\n $file_handle = fopen($filename,'r');\n //get file size\n $file_size = filesize($filename);\n //no of parts to split\n $parts = $file_size / self::$buffer;\n\n //store all the file names\n $file_parts = array();\n\n //name of input file\n $file_name = basename($filename);\n\n for($i=0;$i<$parts;$i++){\n //read buffer sized amount from file\n $file_part = fread($file_handle, self::$buffer);\n //add the name of the file to part list\n array_push($file_parts, $file_part);\n } \n //close the main file handle\n\n fclose($file_handle);\n return $file_parts;\n }",
"public function parse($filename)\n {\n $this->open($filename);\n return $this->readChunks();\n }",
"public static function processFile( string $src, ) : array {\n\t\t$mime\t= static::adjustMime( $src );\n\t\t\n\t\treturn [\n\t\t\t'src'\t\t=> $src,\n\t\t\t'mime'\t\t=> $mime,\n\t\t\t'filename'\t=> \\basename( $src ),\n\t\t\t'filesize'\t=> \\filesize( $src ),\n\t\t\t'description'\t=> '',\n\t\t\t\n\t\t\t// Process thumbnail if needed\n\t\t\t'thumbnail'\t=>\n\t\t\t\t\\in_array( $mime, static::$thumbnail_types ) ? \n\t\t\t\tstatic::createThumbnail( $src, $mime ) : ''\n\t\t];\n\t}",
"public function LoadFromJPEG($fname)\r\n {\r\n\t\t$f = file_get_contents($fname);\r\n\t\t$len = strlen($f);\r\n\t\t$pos = 0;\r\n\t\t$counter = 0;\r\n\t\t$profile_chunks = array(); // tu su ulozene jednotlive casti profilu\r\n\r\n\t\twhile ($pos < $len && $counter < 1000)\r\n\t\t{\r\n\t\t\t$pos = strpos($f, \"\\xff\", $pos);\r\n\t\t\tif ($pos === false) break; // dalsie 0xFF sa uz nenaslo - koniec vyhladavania\r\n\r\n\t\t\t$type = $this->getJPEGSegmentType($f, $pos);\r\n\t\t\tswitch ($type)\r\n\t\t\t{\r\n\t\t\t\tcase 0xe2: // APP2\r\n\t\t\t\t\t//echo \"APP2 \";\r\n\t\t\t\t\t$size = $this->getJPEGSegmentSize($f, $pos);\r\n\t\t\t\t\t//echo \"Size: $size\\n\";\r\n\r\n\t\t\t\t\tif ($this->getJPEGSegmentContainsICC($f, $pos, $size))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//echo \"+ ICC Profile: YES\\n\";\r\n\t\t\t\t\t\tlist($chunk_no, $chunk_cnt) = $this->getJPEGSegmentICCChunkInfo($f, $pos);\r\n\t\t\t\t\t\t//echo \"+ ICC Profile chunk number: $chunk_no\\n\";\r\n\t\t\t\t\t\t//echo \"+ ICC Profile chunks count: $chunk_cnt\\n\";\r\n\r\n\t\t\t\t\t\tif ($chunk_no <= $chunk_cnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$profile_chunks[$chunk_no] = $this->getJPEGSegmentICCChunk($f, $pos);\r\n\r\n\t\t\t\t\t\t\tif ($chunk_no == $chunk_cnt) // posledny kusok\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tksort($profile_chunks);\r\n\t\t\t\t\t\t\t\t$this->SetProfile(implode('', $profile_chunks));\r\n\t\t\t\t\t\t\t\treturn 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\t$pos += $size + 2; // size of segment data + 2B size of segment marker\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 0xe0: // APP0\r\n\t\t\t\tcase 0xe1: // APP1\r\n\t\t\t\tcase 0xe3: // APP3\r\n\t\t\t\tcase 0xe4: // APP4\r\n\t\t\t\tcase 0xe5: // APP5\r\n\t\t\t\tcase 0xe6: // APP6\r\n\t\t\t\tcase 0xe7: // APP7\r\n\t\t\t\tcase 0xe8: // APP8\r\n\t\t\t\tcase 0xe9: // APP9\r\n\t\t\t\tcase 0xea: // APP10\r\n\t\t\t\tcase 0xeb: // APP11\r\n\t\t\t\tcase 0xec: // APP12\r\n\t\t\t\tcase 0xed: // APP13\r\n\t\t\t\tcase 0xee: // APP14\r\n\t\t\t\tcase 0xef: // APP15\r\n\t\t\t\tcase 0xc0: // SOF0\r\n\t\t\t\tcase 0xc2: // SOF2\r\n\t\t\t\tcase 0xc4: // DHT\r\n\t\t\t\tcase 0xdb: // DQT\r\n\t\t\t\tcase 0xda: // SOS\r\n\t\t\t\tcase 0xfe: // COM\r\n\t\t\t\t\t$size = $this->getJPEGSegmentSize($f, $pos);\r\n\t\t\t\t\t$pos += $size + 2; // size of segment data + 2B size of segment marker\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 0xd8: // SOI\r\n\t\t\t\tcase 0xdd: // DRI\r\n\t\t\t\tcase 0xd9: // EOI\r\n\t\t\t\tcase 0xd0: // RST0\r\n\t\t\t\tcase 0xd1: // RST1\r\n\t\t\t\tcase 0xd2: // RST2\r\n\t\t\t\tcase 0xd3: // RST3\r\n\t\t\t\tcase 0xd4: // RST4\r\n\t\t\t\tcase 0xd5: // RST5\r\n\t\t\t\tcase 0xd6: // RST6\r\n\t\t\t\tcase 0xd7: // RST7\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$pos += 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$counter++;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n }",
"public function fileToArray(string $filename): array;",
"public function fromFile(string $filename): array;",
"function arrayfile_to_array($filepath){\n $fsize = filesize($filepath);\n if ($fsize > 0) {\n $fp = fopen($filepath, \"r\");\n $encoded = fread($fp, $fsize);\n fclose($fp);\n return unserialize($encoded);\n }\n }",
"function getData($filename) {\n\t\t$the_big_array = array();\n\n\t\t// Open the file for reading\n\t\tif (($h = fopen(\"{$filename}\", \"r\")) !== FALSE)\n\t\t{\n\t\t\t// Each line in the file is converted into an individual array that we call $data\n\t\t\t// The items of the array are comma separated\n\t\t\twhile (($data = fgetcsv($h, 1000, \",\")) !== FALSE)\n\t\t\t{\n\t\t\t\t// Each individual array is being pushed into the nested array\n\t\t\t\t$the_big_array[] = $data;\n\t\t\t}\n\n\t\t\t// Close the file\n\t\t\tfclose($h);\n\t\t}\n\n\t\t$headers = $the_big_array[0];\n\t\t//pr ($headers);\n\n\t\t//pr ($the_big_array); exit;\n\t\t$newArray = array();\n\t\tforeach( $the_big_array as $key => $array) {\n\t\t\tif ($key == 0) continue;\n\t\t\tforeach ($headers as $hk => $hv) {\n\t\t\t\t$newArray[$key][ $hv ] = $array[$hk];\n\t\t\t}\n\t\t}\n\n\t\t//clean it up\n\t\t$the_big_array = array();\n\n\t\treturn $newArray;\n\t}",
"private function parseChunks()\n {\n if ($this->chunksParsed) return;\n if ($this->dbg) echo (\"parseChunks on \" . $this->fileName . \"<br/>\");\n if (!($fp = fopen($this->fileName, \"rb\")))\n return;\n $this->chunkPosArray = array();\n $this->chunkSizeArray = array();\n $this->actualTimeBeginArray = array();\n $this->totalDataBytes = 0;\n fseek($fp, $this->firstData, SEEK_SET);\n $timeBegin = $this->timeStart;\n while (!feof($fp))\n {\n $str = fread($fp, 4);\n if ($str == \"\") // not sure why feof does not pick this up\n break;\n if ($str != 'data')\n {\n if ($this->dbg)\n echo (\"oops. should be data chunk.<br/>\");\n break;\n }\n $str = fread($fp, 4);\n $chunkSize = 0;\n for ($i = 3; $i >=0; $i--)\n {\n $chunkSize *= 256;\n $chunkSize += ord($str[$i]);\n }\n array_push($this->chunkPosArray, ftell($fp));\n array_push($this->actualTimeBeginArray , $timeBegin);\n array_push($this->chunkSizeArray, $chunkSize);\n if ($this->dbg) echo (\"chunkSize: \" . $chunkSize . \"<br/> timeBegin: \" .\n $timeBegin . \"</br\");\n $this->totalDataBytes += $chunkSize;\n $timeBegin += $chunkSize / $this->byteRateAdjusted;\n fseek($fp, $chunkSize, SEEK_CUR); \n }\n $this->chunksParsed = 1;\n $this->timeEnd = $timeBegin;\n fclose($fp);\n if ($this->dbg) \n {\n echo (\"chunks parsed: \" . count($this->chunkSizeArray, 0) . \"<br/>\");\n echo (\"timeEnd: \" . $timeBegin . \" <br/>\");\n echo (\"totalDataBytes: \" . $this->totalDataBytes . \"<br/>\");\n }\n }",
"function arrayfile_to_array($filepath) {\n// It is assumed that the file being read is a serialized array (created using array_to_arrayfile)\n $fsize = @filesize($filepath);\n if ($fsize > 0) {\n $fp = fopen($filepath, \"r\");\n $encoded = fread($fp, $fsize);\n fclose($fp);\n return unserialize($encoded);\n } else\n return array();\n}",
"public function read(string $filename): array;",
"public function parseFile(string $filename);",
"public function getImageArray();",
"function openFile($filename) \n{\n $handle = fopen($filename, 'r');\n $contents = fread($handle, filesize($filename));\n $contentsArray = explode(\"\\n\", trim($contents));\n fclose($handle);\n return $contentsArray;\n}",
"private function readFileAsArray()\n {\n return file($this->getFolder() . $this->filename);\n }",
"function albums_get_images($album) {\n\t$files = read_dir_contents(ALBUMS_DIR.'/'.$album, 'files');\n\tif (!$files)\n\t\treturn FALSE;\n\n\telseif ($files) {\n\t\tnatcasesort($files);\n\t\tforeach ($files as $file) {\n\t\t\t$parts = explode('.', $file);\n\t\t\tif (count($parts) == 4) {\n\t\t\t\tlist($number, $fdirname, $ext, $php) = $parts;\n\t\t\t\tinclude_once (ALBUMS_DIR.'/'.$album.'/'.$file);\n\t\t\t\t$images[] = array(\n\t\t\t\t\t'title' => $name,\n\t\t\t\t\t'info' => $info,\n\t\t\t\t\t'seoname' => $fdirname,\n\t\t\t\t\t'filename' => $file,\n\t\t\t\t\t'filename_image' => $fdirname.'.'.$ext\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($file);\n\n\t\treturn $images;\n\t}\n}",
"public static function getImageData($filename){\n $exif = exif_read_data(wfArray::get($GLOBALS, 'sys/app_dir').$filename, 0, true);\n return $exif;\n }",
"public static function parse_dimensions_from_filename( $src ) {\n\t\t$width_height_string = [];\n\n\t\tif ( preg_match( '#-(\\d+)x(\\d+)\\.(?:' . implode( '|', self::$extensions ) . '){1}$#i', $src, $width_height_string ) ) {\n\t\t\t$width = (int) $width_height_string[1];\n\t\t\t$height = (int) $width_height_string[2];\n\n\t\t\tif ( $width && $height ) {\n\t\t\t\treturn [ $width, $height ];\n\t\t\t}\n\t\t}\n\n\t\treturn [ false, false ];\n\t}",
"protected function getWidthAndHeightLocal(string $filepath): array\n {\n $result = getimagesize($filepath);\n if (!$result) {\n return $this->emptySize;\n }\n list($width, $height) = $result;\n return [\n 'width' => $width,\n 'height' => $height,\n ];\n }",
"function processFile($filepath) {\n\t$output = [];\n\n\t// Retrieve the image information.\n\t$data = file_get_contents($filepath);\n\t$output['base64'] = base64_encode($data);\n\t$output['type'] = pathinfo($filepath, PATHINFO_EXTENSION);\n\n\t// Check for if the image contains a hot dog.\n\t$properties = checkHotDog($filepath);\n\tif ($properties['ishotdog']) {\n\t\t$output['hotdog'] = true;\n\t\t$output['title'] = 'Hot Dog';\n\t\t$output['description'] = $properties['description'];\n\t}\n\telse {\n\t\t$output['hotdog'] = false;\n\t\t$output['title'] = 'Not a Hot Dog';\n\t\t$output['description'] = $properties['description'];\n\t}\n\n\tif (isset($properties['error'])) {\n\t\t$output['error'] = $properties['error'];\n\t}\n\n\treturn $output;\n}",
"function parse_file($file) { $buffer='';\n if ( substr($file, -3, 3) == '.gz' ) {\n\t$gz = @gzopen($file, 'rb');\n\n\tif ($gz) {\n\n\t\t# Check to see if we got a report\n \t\t# Check to make sure we have a valid file\n\t\t# Read the file\n\t\twhile (!gzeof($gz)) {\n\t \t$buffer .= gzread($gz, 4096);\n \t}\n \tgzclose($gz);\n \t} \n\telse {\n\t\tdie(\"Could not open gzip file. Exiting...\");\n\t}\n\n\tvar_dump(json_decode($buffer),TRUE);\n }\n else {\n\tdie(\"Wrong file type. Exiting...\");\n }\n}",
"function parse_file($filename,$delimiter = \",\") {\n if(!file_exists($filename) || !is_readable($filename))\n return FALSE;\n \n $header = NULL;\n $data = array();\n if (($handle = fopen($filename, 'r')) !== FALSE)\n {\n while (($row = fgetcsv($handle, 100000, $delimiter)) !== FALSE)\n {\n if($row[0]!=NULL)\n $data[] = $row;\n }\n fclose($handle);\n }\n return $data;\n }",
"public function parseFile($filename)\n {\n return $this->parseString(file_get_contents($filename));\n }",
"function loadImage($filename) {\n $image = false;\n $imageInfo = getimagesize($filename);\n $imageType = '';\n $imageType = $imageInfo[2];\n if( $imageType == IMAGETYPE_JPEG ) {\n $image = imagecreatefromjpeg($filename);\n } elseif( $imageType == IMAGETYPE_GIF ) {\n $image = imagecreatefromgif($filename);\n } elseif( $imageType == IMAGETYPE_PNG ) {\n $image = imagecreatefrompng($filename);\n }\n return $image ? array('image' => $image, 'imgType' => $imageType, 'imageInfo' => $imageInfo) : array();\n}",
"function file_to_array($filename) {\n if (file_exists($filename)) {\n $encoded_string = file_get_contents($filename);\n\n if ($encoded_string !== false) {\n return json_decode($encoded_string, true);\n } \n }\n \n return false;\n}",
"public function parseFilename($filename)\n {\n $parts = [];\n if (preg_match('/(.*)_(\\d\\d)\\.(\\d\\d)\\.(\\d\\d)_(\\d\\d)-(\\d\\d)_(.*)_(\\d{1,4})_TVOON_(..)\\.(.*)\\.otrkey/', $filename, $matches)) {\n $parts = [\n 'name' => $filename,\n 'title' => str_replace('_', ' ', $matches[1]),\n 'start' => Carbon::create($matches[2] + 2000, $matches[3], $matches[4], $matches[5], $matches[6], 0),\n 'station' => str_replace('_', ' ', $matches[7]),\n 'duration' => $matches[8],\n 'language' => $matches[9],\n 'quality' => $matches[10],\n ];\n }\n\n if (preg_match('/S(\\d{2,})E(\\d{2,})/', $filename, $matches)) {\n $parts['season'] = (int) $matches[1];\n $parts['episode'] = (int) $matches[2];\n }\n\n return $parts;\n }",
"function getImageFiles() {\n $path = dirname(__FILE__) . \"/img\";\n $images = array();\n $folder = opendir($path);\n while (false !== ($filename = readdir($folder))) {\n if ($filename != \"ajax-loader.gif\") {\n $parts = serendipity_parseFileName($filename);\n $img_data = serendipity_getimagesize($path . '/' . $filename);\n if (!isset($img_data['noimage'])) {\n // Curly braces are just a different syntax of associative array assignment\n $images[$filename] = array('fname'=>$filename, 'width'=>$img_data[0], 'height'=>$img_data[1]);\n }\n }\n }\n closedir($folder);\n ksort($images);\n return $images;\n }",
"public static function spitNameByExtension(string $filename): array\n {\n if (false === $pos = \\strrpos($filename, '.')) {\n return [$filename, ''];\n }\n\n return [\\substr($filename, 0, $pos), \\substr($filename, $pos + 1)];\n }"
] |
[
"0.6943459",
"0.6355114",
"0.6095227",
"0.58583456",
"0.554212",
"0.5534001",
"0.5515431",
"0.54046845",
"0.5333513",
"0.5290704",
"0.52735454",
"0.5267078",
"0.5235156",
"0.52107257",
"0.51242894",
"0.5123614",
"0.5116047",
"0.5089484",
"0.50796473",
"0.50730205",
"0.5031206",
"0.4971711",
"0.49702734",
"0.4970055",
"0.496764",
"0.49423313",
"0.48700497",
"0.4866908",
"0.4821463",
"0.48183784"
] |
0.7830543
|
0
|
array parseTIFFfile(string filename, array AlphaPalette) returns an array that holds the given JPEG file broken up into chunks.
|
function parseTIFFfile($filename, $AlphaPalette)
{
array_push($this->FMDebug, "parseTIFFfile");
$II = chr(0x49) . chr(0x49);
$MM = chr(0x4d) . chr(0x4d);
$TIFFNewSubfileType = array("II" => chr(0xfe) . chr(0x00), "MM" => chr(0x00) . chr(0xfe));
$TIFFSubfileType = array("II" => chr(0xff) . chr(0x00), "MM" => chr(0x00) . chr(0xff));
$TIFFImageWidth = array("II" => chr(0x00) . chr(0x01), "MM" => chr(0x01) . chr(0x00));
$TIFFImageLength = array("II" => chr(0x01) . chr(0x01), "MM" => chr(0x01) . chr(0x01));
$TIFFBitsPerSample = array("II" => chr(0x02) . chr(0x01), "MM" => chr(0x01) . chr(0x02));
$TIFFCompression = array("II" => chr(0x03) . chr(0x01), "MM" => chr(0x01) . chr(0x03));
$TIFFPhotometricInterpretation = array("II" => chr(0x06) . chr(0x01), "MM" => chr(0x01) . chr(0x06));
$TIFFThresholding = array("II" => chr(0x07) . chr(0x01), "MM" => chr(0x01) . chr(0x07));
$TIFFCellWidth = array("II" => chr(0x08) . chr(0x01), "MM" => chr(0x01) . chr(0x08));
$TIFFCellLength = array("II" => chr(0x09) . chr(0x01), "MM" => chr(0x01) . chr(0x09));
$TIFFFillOrder = array("II" => chr(0x0a) . chr(0x01), "MM" => chr(0x01) . chr(0x0a));
$TIFFDocumentName = array("II" => chr(0x0d) . chr(0x01), "MM" => chr(0x01) . chr(0x0d));
$TIFFImageDescription = array("II" => chr(0x0e) . chr(0x01), "MM" => chr(0x01) . chr(0x0e));
$TIFFMake = array("II" => chr(0x0f) . chr(0x01), "MM" => chr(0x01) . chr(0x0f));
$TIFFModel = array("II" => chr(0x10) . chr(0x01), "MM" => chr(0x01) . chr(0x10));
$TIFFStripOffsets = array("II" => chr(0x11) . chr(0x01), "MM" => chr(0x01) . chr(0x11));
$TIFFOrientation = array("II" => chr(0x12) . chr(0x01), "MM" => chr(0x01) . chr(0x12));
$TIFFSamplesPerPixel = array("II" => chr(0x15) . chr(0x01), "MM" => chr(0x01) . chr(0x15));
$TIFFRowsPerStrip = array("II" => chr(0x16) . chr(0x01), "MM" => chr(0x01) . chr(0x16));
$TIFFStripByteCounts = array("II" => chr(0x17) . chr(0x01), "MM" => chr(0x01) . chr(0x17));
$TIFFMinSampleValue = array("II" => chr(0x18) . chr(0x01), "MM" => chr(0x01) . chr(0x18));
$TIFFMaxSampleValue = array("II" => chr(0x19) . chr(0x01), "MM" => chr(0x01) . chr(0x19));
$TIFFXResolution = array("II" => chr(0x1a) . chr(0x01), "MM" => chr(0x01) . chr(0x1a));
$TIFFYResolution = array("II" => chr(0x1b) . chr(0x01), "MM" => chr(0x01) . chr(0x1b));
$TIFFPlanarConfiguration = array("II" => chr(0x1c) . chr(0x01), "MM" => chr(0x01) . chr(0x1c));
$TIFFPageName = array("II" => chr(0x1d) . chr(0x01), "MM" => chr(0x01) . chr(0x1d));
$TIFFXPosition = array("II" => chr(0x1e) . chr(0x01), "MM" => chr(0x01) . chr(0x1e));
$TIFFYPosition = array("II" => chr(0x1f) . chr(0x01), "MM" => chr(0x01) . chr(0x1f));
$TIFFFreeOffsets = array("II" => chr(0x20) . chr(0x01), "MM" => chr(0x01) . chr(0x20));
$TIFFFreeByteCounts = array("II" => chr(0x21) . chr(0x01), "MM" => chr(0x01) . chr(0x21));
$TIFFGrayResponseUnit = array("II" => chr(0x22) . chr(0x01), "MM" => chr(0x01) . chr(0x22));
$TIFFGrayResponseCurve = array("II" => chr(0x23) . chr(0x01), "MM" => chr(0x01) . chr(0x23));
$TIFFT4Options = array("II" => chr(0x24) . chr(0x01), "MM" => chr(0x01) . chr(0x24));
$TIFFT6Options = array("II" => chr(0x25) . chr(0x01), "MM" => chr(0x01) . chr(0x25));
$TIFFResolutionUnit = array("II" => chr(0x28) . chr(0x01), "MM" => chr(0x01) . chr(0x28));
$TIFFPageNumber = array("II" => chr(0x29) . chr(0x01), "MM" => chr(0x01) . chr(0x29));
$TIFFTransferFunction = array("II" => chr(0x2d) . chr(0x01), "MM" => chr(0x01) . chr(0x2d));
$TIFFSoftware = array("II" => chr(0x31) . chr(0x01), "MM" => chr(0x01) . chr(0x31));
$TIFFDateTime = array("II" => chr(0x32) . chr(0x01), "MM" => chr(0x01) . chr(0x32));
$TIFFArtist = array("II" => chr(0x3b) . chr(0x01), "MM" => chr(0x01) . chr(0x3b));
$TIFFHostComputer = array("II" => chr(0x3c) . chr(0x01), "MM" => chr(0x01) . chr(0x3c));
$TIFFPredictor = array("II" => chr(0x3d) . chr(0x01), "MM" => chr(0x01) . chr(0x3d));
$TIFFWhitePoint = array("II" => chr(0x3e) . chr(0x01), "MM" => chr(0x01) . chr(0x3e));
$TIFFPrimaryChromaticities = array("II" => chr(0x3f) . chr(0x01), "MM" => chr(0x01) . chr(0x3f));
$TIFFColorMap = array("II" => chr(0x40) . chr(0x01), "MM" => chr(0x01) . chr(0x40));
$TIFFHalftoneHints = array("II" => chr(0x41) . chr(0x01), "MM" => chr(0x01) . chr(0x41));
$TIFFTileWidth = array("II" => chr(0x42) . chr(0x01), "MM" => chr(0x01) . chr(0x42));
$TIFFTileLength = array("II" => chr(0x43) . chr(0x01), "MM" => chr(0x01) . chr(0x43));
$TIFFTileOffsets = array("II" => chr(0x44) . chr(0x01), "MM" => chr(0x01) . chr(0x44));
$TIFFTileByteCounts = array("II" => chr(0x45) . chr(0x01), "MM" => chr(0x01) . chr(0x45));
$TIFFInkSet = array("II" => chr(0x4c) . chr(0x01), "MM" => chr(0x01) . chr(0x4c));
$TIFFInkNames = array("II" => chr(0x4d) . chr(0x01), "MM" => chr(0x01) . chr(0x4d));
$TIFFNumberOfInks = array("II" => chr(0x4e) . chr(0x01), "MM" => chr(0x01) . chr(0x4e));
$TIFFDotRange = array("II" => chr(0x50) . chr(0x01), "MM" => chr(0x01) . chr(0x50));
$TIFFTargetPrinter = array("II" => chr(0x51) . chr(0x01), "MM" => chr(0x01) . chr(0x51));
$TIFFExtraSamples = array("II" => chr(0x52) . chr(0x01), "MM" => chr(0x01) . chr(0x52));
$TIFFSampleFormat = array("II" => chr(0x53) . chr(0x01), "MM" => chr(0x01) . chr(0x53));
$TIFFSMinSampleValue = array("II" => chr(0x54) . chr(0x01), "MM" => chr(0x01) . chr(0x54));
$TIFFSMaxSampleValue = array("II" => chr(0x55) . chr(0x01), "MM" => chr(0x01) . chr(0x55));
$TIFFTransferRange = array("II" => chr(0x56) . chr(0x01), "MM" => chr(0x01) . chr(0x56));
$TIFFJPEGProc = array("II" => chr(0x00) . chr(0x02), "MM" => chr(0x02) . chr(0x00));
$TIFFJPEGInterchangeFormat = array("II" => chr(0x01) . chr(0x02), "MM" => chr(0x02) . chr(0x01));
$TIFFJPEGInterchangeFormatLength = array("II" => chr(0x02) . chr(0x02), "MM" => chr(0x02) . chr(0x02));
$TIFFJPEGRestartInterval = array("II" => chr(0x03) . chr(0x02), "MM" => chr(0x02) . chr(0x03));
$TIFFJPEGLosslessPredictors = array("II" => chr(0x05) . chr(0x02), "MM" => chr(0x02) . chr(0x05));
$TIFFJPEGPointTransforms = array("II" => chr(0x06) . chr(0x02), "MM" => chr(0x02) . chr(0x06));
$TIFFJPEGQTables = array("II" => chr(0x07) . chr(0x02), "MM" => chr(0x02) . chr(0x07));
$TIFFJPEGDCTables = array("II" => chr(0x08) . chr(0x02), "MM" => chr(0x02) . chr(0x08));
$TIFFJPEGACTables = array("II" => chr(0x09) . chr(0x02), "MM" => chr(0x02) . chr(0x09));
$TIFFYCbCrCoefficients = array("II" => chr(0x11) . chr(0x02), "MM" => chr(0x02) . chr(0x11));
$TIFFYCbCrSubSampling = array("II" => chr(0x12) . chr(0x02), "MM" => chr(0x02) . chr(0x12));
$TIFFYCbCrPositioning = array("II" => chr(0x13) . chr(0x02), "MM" => chr(0x02) . chr(0x13));
$TIFFReferenceBlackWhite = array("II" => chr(0x14) . chr(0x02), "MM" => chr(0x02) . chr(0x14));
$TIFFCopyright = array("II" => chr(0x98) . chr(0x82), "MM" => chr(0x82) . chr(0x98));
$TIFFfile = array();
$filehandle = fopen($filename, "r");
if ($filehandle == FALSE) {
$this->FMError("parseTIFFfile cannot open file");
}
$tiff = fread($filehandle, filesize($filename));
fclose($filehandle);
$byteorder = substr($tiff, 0, 2);
$filetype = substr($tiff, 2, 2);
$ifdoffset = substr($tiff, 4, 4);
$valueoffset = substr($tiff, 8, 4);
if ($byteorder == $II) {
if ($filetype != chr(0x2a) . chr(0x00)) {
$this->FMError("parseTIFFfile -- not a TIFF file!");
}
$ifdoffset = (ord(substr($ifdoffset, 3, 1)) * 256 + ord(substr($ifdoffset, 2, 1))) * 65536 + ord(substr($ifdoffset, 1, 1)) * 256 + ord(substr($ifdoffset, 0, 1));
$valueoffset = (ord(substr($valueoffset, 3, 1)) * 256 + ord(substr($valueoffset, 2, 1))) * 65536 + ord(substr($valueoffset, 1, 1)) * 256 + ord(substr($valueoffset, 0, 1));
}
//--------------------------------------------------
// unpack MM byte order TIFF.
if ($byteorder == $MM) {
$this->FMError("Cannot handle MM byte order in TIFF files, yet");
}
$ifdtags = substr($tiff, $ifdoffset, 2);
//--------------------------------------------------
// unpack II byte order TIFF.
if ($byteorder == $II) {
$ifdtags = ord(substr($ifdtags, 1, 1)) * 256 + ord(substr($ifdtags, 0, 1));
for ($n = 0; $n < $ifdtags; $n++) {
$tag = substr($tiff, $ifdoffset + 2 + $n * 12, 2);
$valuetype = substr($tiff, $ifdoffset + 2 + $n * 12 + 2, 2);
$valuetype = ord(substr($valuetype, 1, 1)) * 256 + ord(substr($valuetype, 0, 1));
switch($tag) {
case $TIFFNewSubfileType["II"]:
break;
case $TIFFSubfileType["II"]:
break;
case $TIFFImageWidth["II"]:
if ($valuetype == 3) {
$imagewidth = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$imagewidth = ord(substr($imagewidth, 1, 1)) * 256 + ord(substr($imagewidth, 0, 1));
$TIFFfile["ImageWidth"] = $imagewidth;
} elseif ($valuetype == 4) {
$imagewidth = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$imagewidth = (ord(substr($imagewidth, 3, 1)) * 256 + ord(substr($imagewidth, 2, 1))) * 65536 + ord(substr($imagewidth, 1, 1)) * 256 + ord(substr($imagewidth, 0, 1));
$TIFFfile["ImageWidth"] = $imagewidth;
} else {
$this->FMError("ImageWidth tag: wrong data type");
}
break;
case $TIFFImageLength["II"]:
if ($valuetype == 3) {
$imagelength = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$imagelength = ord(substr($imagelength, 1, 1)) * 256 + ord(substr($imagelength, 0, 1));
$TIFFfile["ImageLength"] = $imagelength;
} elseif ($valuetype == 4) {
$imagelength = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$imagelength = (ord(substr($imagelength, 3, 1)) * 256 + ord(substr($imagelength, 2, 1))) * 65536 + ord(substr($imagelength, 1, 1)) * 256 + ord(substr($imagelength, 0, 1));
$TIFFfile["ImageLength"] = $imagelength;
} else {
$this->FMError("ImageLength tag: wrong data type");
}
break;
case $TIFFBitsPerSample["II"]:
if ($valuetype == 3) {
$nvalues = substr($tiff, $ifdoffset + 2 + $n * 12 + 4, 4);
$nvalues = (ord(substr($nvalues, 3, 1)) * 256 + ord(substr($nvalues, 2, 1))) * 65536 + ord(substr($nvalues, 1, 1)) * 256 + ord(substr($nvalues, 0, 1));
$TIFFfile["BitsPerSample"] = array();
if ($nvalues == 1) {
$bitspersample = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$bitspersample = ord(substr($bitspersample, 1, 1)) * 256 + ord(substr($bitspersample, 0, 1));
$TIFFfile["BitsPerSample"][0] = $bitspersample;
} else {
$voffset = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$voffset = (ord(substr($voffset, 3, 1)) * 256 + ord(substr($voffset, 2, 1))) * 65536 + ord(substr($voffset, 1, 1)) * 256 + ord(substr($voffset, 0, 1));
for ($counter = 0; $counter < $nvalues; $counter++) {
$foffset = $voffset + 2 * $counter;
$bitspersample = ord(substr($tiff, $foffset + 1, 1)) * 256 + ord(substr($tiff, $foffset, 1));
$TIFFfile["BitsPerSample"][$counter] = $bitspersample;
}
}
} else {
$this->FMError("BitsPerSample: wrong tag value type");
}
break;
case $TIFFCompression["II"]:
if ($valuetype == 3) {
$compression = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$compression = ord(substr($compression, 1, 1)) * 256 + ord(substr($compression, 0, 1));
if ($compression == 1) {
$TIFFfile["Compression"] = $compression;
} else {
$this->FMError("Cannot handle this kind of compression yet");
}
} else {
$this->FMError("Compression tag: wrong data type");
}
if ($TIFFfile["Compression"] != 1) {
$this->FMError("Cannot Handle compressed TIFF files, sorry.");
}
break;
case $TIFFPhotometricInterpretation["II"]:
if ($valuetype == 3) {
$interpretation = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$interpretation = ord(substr($interpretation, 1, 1)) * 256 + ord(substr($interpretation, 0, 1));
$TIFFfile["PhotometricInterpretation"] = $interpretation;
} else {
$this->FMError("PhotometricInterpretation tag: wrong data type");
}
break;
case $TIFFThresholding["II"]:
break;
case $TIFFCellWidth["II"]:
break;
case $TIFFCellLength["II"]:
break;
case $TIFFFillOrder["II"]:
if ($valuetype == 3) {
$fillorder = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$fillorder = ord(substr($fillorder, 1, 1)) * 256 + ord(substr($fillorder, 0, 1));
$TIFFfile["FillOrder"] = $fillorder;
} else {
$this->FMError("FillOrder tag: wrong data type");
}
break;
case $TIFFDocumentName["II"]:
break;
case $TIFFImageDescription["II"]:
break;
case $TIFFMake["II"]:
break;
case $TIFFModel["II"]:
break;
case $TIFFStripOffsets["II"]:
$nvalues = substr($tiff, $ifdoffset + 2 + $n * 12 + 4, 4);
$nvalues = (ord(substr($nvalues, 3, 1)) * 256 + ord(substr($nvalues, 2, 1))) * 65536 + ord(substr($nvalues, 1, 1)) * 256 + ord(substr($nvalues, 0, 1));
$voffset = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$voffset = (ord(substr($voffset, 3, 1)) * 256 + ord(substr($voffset, 2, 1))) * 65536 + ord(substr($voffset, 1, 1)) * 256 + ord(substr($voffset, 0, 1));
$TIFFfile["StripOffsets"] = array();
if ($valuetype == 3) {
if ($nvalues == 1) {
$TIFFfile["StripOffsets"][0] = $voffset;
} else {
for ($counter = 0; $counter < $nvalues; $counter++) {
$foffset = $voffset + 2 * $counter;
$stripoffsets = ord(substr($tiff, $foffset + 1, 1)) * 256 + ord(substr($tiff, $foffset, 1));
$TIFFfile["StripOffsets"][$counter] = $stripoffsets;
}
}
} elseif ($valuetype == 4) {
if ($nvalues == 1) {
$TIFFfile["StripOffsets"][0] = $voffset;
} else {
for ($counter = 0; $counter < $nvalues; $counter++) {
$foffset = $voffset + 4 * $counter;
$stripoffsets = (ord(substr($tiff, $foffset + 3, 1)) * 256 + ord(substr($tiff, $foffset + 2, 1))) * 65536 + ord(substr($tiff, $foffset + 1, 1)) * 256 + ord(substr($tiff, $foffset, 1));
$TIFFfile["StripOffsets"][$counter] = $stripoffsets;
}
}
} else {
$this->FMError("StripOffsets: wrong tag value type");
}
break;
case $TIFFOrientation["II"]:
if ($valuetype == 3) {
$subfiletype = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$subfiletype = ord(substr($subfiletype, 1, 1)) * 256 + ord(substr($subfiletype, 0, 1));
$TIFFfile["Orientation"] = $subfiletype;
} else {
$this->FMError("Orientation tag: wrong data type");
}
break;
case $TIFFSamplesPerPixel["II"]:
if ($valuetype == 3) {
$samplesperpixel = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$samplesperpixel = ord(substr($samplesperpixel, 1, 1)) * 256 + ord(substr($samplesperpixel, 0, 1));
$TIFFfile["SamplesPerPixel"] = $samplesperpixel;
} else {
$this->FMError("SamplesPerPixel tag: wrong data type");
}
break;
case $TIFFRowsPerStrip["II"]:
if ($valuetype == 3) {
$rowsperstrip = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$rowsperstrip = ord(substr($rowsperstrip, 1, 1)) * 256 + ord(substr($rowsperstrip, 0, 1));
$TIFFfile["RowsPerStrip"] = $rowsperstrip;
} elseif ($valuetype == 4) {
$rowsperstrip = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$rowsperstrip = (ord(substr($rowsperstrip, 3, 1)) * 256 + ord(substr($rowsperstrip, 2, 1))) * 65536 + ord(substr($rowsperstrip, 1, 1)) * 256 + ord(substr($rowsperstrip, 0, 1));
$TIFFfile["RowsPerStrip"] = $rowsperstrip;
} else {
$this->FMError("RowsPerStrip tag: wrong data type");
}
break;
case $TIFFStripByteCounts["II"]:
$nvalues = substr($tiff, $ifdoffset + 2 + $n * 12 + 4, 4);
$nvalues = (ord(substr($nvalues, 3, 1)) * 256 + ord(substr($nvalues, 2, 1))) * 65536 + ord(substr($nvalues, 1, 1)) * 256 + ord(substr($nvalues, 0, 1));
$voffset = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$voffset = (ord(substr($voffset, 3, 1)) * 256 + ord(substr($voffset, 2, 1))) * 65536 + ord(substr($voffset, 1, 1)) * 256 + ord(substr($voffset, 0, 1));
$TIFFfile["StripByteCounts"] = array();
if ($valuetype == 3) {
if ($nvalues == 1) {
$TIFFfile["StripByteCounts"][0] = $voffset;
} else {
for ($counter = 0; $counter < $nvalues; $counter++) {
$foffset = $voffset + 2 * $counter;
$stripbytecounts = ord(substr($tiff, $foffset + 1, 1)) * 256 + ord(substr($tiff, $foffset, 1));
$TIFFfile["StripByteCounts"][$counter] = $stripbytecounts;
}
}
} elseif ($valuetype == 4) {
if ($nvalues == 1) {
$TIFFfile["StripByteCounts"][0] = $voffset;
} else {
for ($counter = 0; $counter < $nvalues; $counter++) {
$foffset = $voffset + 4 * $counter;
$stripbytecounts = (ord(substr($tiff, $foffset + 3, 1)) * 256 + ord(substr($tiff, $foffset + 2, 1))) * 65536 + ord(substr($tiff, $foffset + 1, 1)) * 256 + ord(substr($tiff, $foffset, 1));
$TIFFfile["StripByteCounts"][$counter] = $stripbytecounts;
}
}
} else {
$this->FMError("StripByteCounts: wrong tag value type");
}
break;
case $TIFFMinSampleValue["II"]:
break;
case $TIFFMaxSampleValue["II"]:
break;
case $TIFFXResolution["II"]:
break;
case $TIFFYResolution["II"]:
break;
case $TIFFPlanarConfiguration["II"]:
if ($valuetype == 3) {
$planarconfiguration = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$planarconfiguration = ord(substr($planarconfiguration, 1, 1)) * 256 + ord(substr($planarconfiguration, 0, 1));
$TIFFfile["PlanarConfiguration"] = $planarconfiguration;
} else {
$this->FMError("PlanarConfiguration tag: wrong data type");
}
break;
case $TIFFPageName["II"]:
break;
case $TIFFXPosition["II"]:
break;
case $TIFFYPosition["II"]:
break;
case $TIFFFreeOffsets["II"]:
break;
case $TIFFFreeByteCounts["II"]:
break;
case $TIFFGrayResponseUnit["II"]:
break;
case $TIFFGrayResponseCurve["II"]:
break;
case $TIFFT4Options["II"]:
break;
case $TIFFT6Options["II"]:
break;
case $TIFFResolutionUnit["II"]:
break;
case $TIFFPageNumber["II"]:
break;
case $TIFFTransferFunction["II"]:
break;
case $TIFFSoftware["II"]:
break;
case $TIFFDateTime["II"]:
break;
case $TIFFArtist["II"]:
break;
case $TIFFHostComputer["II"]:
break;
case $TIFFPredictor["II"]:
break;
case $TIFFWhitePoint["II"]:
break;
case $TIFFPrimaryChromaticities["II"]:
break;
case $TIFFColorMap["II"]:
if ($valuetype == 3) {
$nvalues = substr($tiff, $ifdoffset + 2 + $n * 12 + 4, 4);
$nvalues = ord(substr($nvalues, 1, 1)) * 256 + ord(substr($nvalues, 0, 1));
$voffset = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 4);
$voffset = (ord(substr($voffset, 3, 1)) * 256 + ord(substr($voffset, 2, 1))) * 65536 + ord(substr($voffset, 1, 1)) * 256 + ord(substr($voffset, 0, 1));
$TIFFfile["ColorMap"] = substr($tiff, $voffset, 2 * $nvalues);
} else {
$this->FMError("ColorMap: wrong tag value type");
}
break;
case $TIFFHalftoneHints["II"]:
break;
case $TIFFTileWidth["II"]:
break;
case $TIFFTileLength["II"]:
break;
case $TIFFTileOffsets["II"]:
break;
case $TIFFTileByteCounts["II"]:
break;
case $TIFFInkSet["II"]:
break;
case $TIFFInkNames["II"]:
break;
case $TIFFNumberOfInks["II"]:
break;
case $TIFFExtraSamples["II"]:
if ($valuetype == 3) {
$extrasamples = substr($tiff, $ifdoffset + 2 + $n * 12 + 8, 2);
$extrasamples = ord(substr($extrasamples, 1, 1)) * 256 + ord(substr($extrasamples, 0, 1));
$TIFFfile["ExtraSamples"] = $extrasamples;
} else {
$this->FMError("ExtraSamples: wrong data type");
}
break;
case $TIFFSampleFormat["II"]:
break;
case $TIFFSMinSampleValue["II"]:
break;
case $TIFFSMaxSampleValue["II"]:
break;
case $TIFFTransferRange["II"]:
break;
case $TIFFJPEGProc["II"]:
break;
case $TIFFJPEGInterchangeFormat["II"]:
break;
case $TIFFJPEGInterchangeFormatLength["II"]:
break;
case $TIFFJPEGRestartInterval["II"]:
break;
case $TIFFJPEGLosslessPredictors["II"]:
break;
case $TIFFJPEGPointTransforms["II"]:
break;
case $TIFFJPEGQTables["II"]:
break;
case $TIFFJPEGDCTables["II"]:
break;
case $TIFFJPEGACTables["II"]:
break;
case $TIFFYCbCrCoefficients["II"]:
break;
case $TIFFYCbCrSubSampling["II"]:
break;
case $TIFFYCbCrPositioning["II"]:
break;
case $TIFFReferenceBlackWhite["II"]:
break;
case $TIFFCopyright["II"]:
break;
}
}
}
//--------------------------------------------------
// process TIFF data.
$bitmap = array();
switch ($TIFFfile["PhotometricInterpretation"]) {
//--------------------------------------------------
// Bilevel - WhiteIsZero.
case 0:
if (!(in_array("BitsPerSample", $TIFFfile))) {
}
//--------------------------------------------------
// build image stream.
$imagestream = "";
$nstrips = count($TIFFfile["StripOffsets"]);
for($counter = 0; $counter < $nstrips; $counter++) {
$imagestream .= substr($tiff, $TIFFfile["StripOffsets"][$counter], $TIFFfile["StripByteCounts"][$counter]);
}
$newimagestream = "";
$padcount = $TIFFfile["ImageWidth"] % 4;
if (($padcount) == 0) {
$padding = "";
} else {
$padding = str_repeat(chr(0), 4 - $padcount);
}
for($counter = 0; $counter < $TIFFfile["ImageLength"]; $counter++) {
$newimagestream .= substr($imagestream, $counter * $TIFFfile["ImageWidth"], $TIFFfile["ImageWidth"]) . $padding;
}
//--------------------------------------------------
// create palettes.
$swfcolormap = "";
if ($AlphaPalette == null) {
for($counter = 255; $counter >= 0; $counter--) {
$r = chr($counter);
$g = chr($counter);
$b = chr($counter);
$swfcolormap .= $r . $g . $b;
}
$bitmap["colortablesize"] = (strlen($swfcolormap) / 3) - 1;
} else {
$a = array();
for($counter = 0; $counter < 256; $counter++) {
$a[$counter] = chr(255);
}
$limita = sizeof($AlphaPalette);
reset($AlphaPalette);
for ($counter = 0; $counter < $limita; $counter++) {
$tmp = each($AlphaPalette);
$a[$tmp["key"]] = chr($tmp["value"]);
}
for($counter = 255; $counter >= 0; $counter--) {
$r = chr($counter);
$g = chr($counter);
$b = chr($counter);
$swfcolormap .= $r . $g . $b . $a[$counter];
}
$bitmap["colortablesize"] = (strlen($swfcolormap) / 4) - 1;
}
$zlibbitmapdata = gzcompress($swfcolormap . $newimagestream, 9);
$alphadata = gzcompress($imagestream, 9);
break;
//--------------------------------------------------
// Bilevel - BlackIsZero.
case 1:
//--------------------------------------------------
// build image stream.
$imagestream = "";
$nstrips = count($TIFFfile["StripOffsets"]);
for($counter = 0; $counter < $nstrips; $counter++) {
$imagestream .= substr($tiff, $TIFFfile["StripOffsets"][$counter], $TIFFfile["StripByteCounts"][$counter]);
}
$newimagestream = "";
$padcount = $TIFFfile["ImageWidth"] % 4;
if (($padcount) == 0) {
$padding = "";
} else {
$padding = str_repeat(chr(0), 4 - $padcount);
}
for($counter = 0; $counter < $TIFFfile["ImageLength"]; $counter++) {
$newimagestream .= substr($imagestream, $counter * $TIFFfile["ImageWidth"], $TIFFfile["ImageWidth"]) . $padding;
}
//--------------------------------------------------
// create palette.
$swfcolormap = "";
if ($AlphaPalette == null) {
for($counter = 0; $counter < 256; $counter++) {
$r = chr($counter);
$g = chr($counter);
$b = chr($counter);
$swfcolormap .= $r . $g . $b;
}
$bitmap["colortablesize"] = (strlen($swfcolormap) / 3) - 1;
} else {
$a = array();
for($counter = 0; $counter < 256; $counter++) {
$a[$counter] = chr(255);
}
$limita = sizeof($AlphaPalette);
reset($AlphaPalette);
for ($counter = 0; $counter < $limita; $counter++) {
$tmp = each($AlphaPalette);
$a[$tmp["key"]] = chr($tmp["value"]);
}
for($counter = 0; $counter < 256; $counter++) {
$r = chr($counter);
$g = chr($counter);
$b = chr($counter);
$swfcolormap .= $r . $g . $b . $a[$counter];
}
$bitmap["colortablesize"] = (strlen($swfcolormap) / 4) - 1;
}
$zlibbitmapdata = gzcompress($swfcolormap . $newimagestream, 9);
$alphadata = gzcompress($imagestream, 9);
break;
//--------------------------------------------------
// RGB.
case 2:
$this->FMError("Cannot handle full-color images, use JPEG instead");
break;
//--------------------------------------------------
// Palette.
case 3:
//--------------------------------------------------
// build image stream.
$imagestream = "";
$nstrips = count($TIFFfile["StripOffsets"]);
for($counter = 0; $counter < $nstrips; $counter++) {
$imagestream .= substr($tiff, $TIFFfile["StripOffsets"][$counter], $TIFFfile["StripByteCounts"][$counter]);
}
$newimagestream = "";
$padcount = $TIFFfile["ImageWidth"] % 4;
if (($padcount) == 0) {
$padding = "";
} else {
$padding = str_repeat(chr(0), 4 - $padcount);
}
for($counter = 0; $counter < $TIFFfile["ImageLength"]; $counter++) {
$newimagestream .= substr($imagestream, $counter * $TIFFfile["ImageWidth"], $TIFFfile["ImageWidth"]) . $padding;
}
//--------------------------------------------------
// reconfigure palette.
$newcolormap = "";
$limit = strlen($TIFFfile["ColorMap"]);
for($counter = 0; $counter < $limit; $counter++) {
$newcolormap .= substr($TIFFfile["ColorMap"], 2 * $counter, 1);
}
$swfcolormap = "";
$limit = strlen($newcolormap) / 3;
if ($AlphaPalette == null) {
for($counter = 0; $counter < $limit; $counter++) {
$r = substr($newcolormap, $counter, 1);
$g = substr($newcolormap, $counter + $limit, 1);
$b = substr($newcolormap, $counter + $limit, 1);
$swfcolormap .= $r . $g . $b;
}
$bitmap["colortablesize"] = (strlen($swfcolormap) / 3) - 1;
} else {
$a = array();
for($counter = 0; $counter < 256; $counter++) {
$a[$counter] = chr(255);
}
$limita = sizeof($AlphaPalette);
reset($AlphaPalette);
for ($counter = 0; $counter < $limita; $counter++) {
$tmp = each($AlphaPalette);
$a[$tmp["key"]] = chr($tmp["value"]);
}
for($counter = 0; $counter < 256; $counter++) {
$r = substr($newcolormap, $counter, 1);
$g = substr($newcolormap, $counter + $limit, 1);
$b = substr($newcolormap, $counter + $limit, 1);
$swfcolormap .= $r . $g . $b . $a[$counter];
}
$bitmap["colortablesize"] = (strlen($swfcolormap) / 4) - 1;
}
$zlibbitmapdata = gzcompress($swfcolormap . $newimagestream, 9);
$alphadata = gzcompress($imagestream, 9);
break;
//--------------------------------------------------
// Transparency mask.
case 4:
$this->FMError("Cannot handle images with transparency masks, use RGB + Alpha encoding");
break;
}
$bitmap["format"] = 3;
$bitmap["width"] = $TIFFfile["ImageWidth"];
$bitmap["height"] = $TIFFfile["ImageLength"];
$bitmap["colortable"] = $swfcolormap;
$bitmap["newimagestream"] = $newimagestream;
$bitmap["zlibbitmapdata"] = $zlibbitmapdata;
$bitmap["alphadata"] = $alphadata;
array_pop($this->FMDebug);
return $bitmap;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function _parsejpg($file)\n\t\t{\n\t\t\t$a=GetImageSize($file);\n\t\t\tif(!$a)\n\t\t\t\t$this->Error('Missing or incorrect image file: '.$file);\n\t\t\tif($a[2]!=2)\n\t\t\t\t$this->Error('Not a JPEG file: '.$file);\n\t\t\tif(!isset($a['channels']) or $a['channels']==3)\n\t\t\t\t$colspace='DeviceRGB';\n\t\t\telseif($a['channels']==4)\n\t\t\t\t$colspace='DeviceCMYK';\n\t\t\telse\n\t\t\t\t$colspace='DeviceGray';\n\t\t\t$bpc=isset($a['bits']) ? $a['bits'] : 8;\n\t\t\t//Read whole file\n\t\t\t$f=fopen($file,'rb');\n\t\t\t$data='';\n\t\t\twhile(!feof($f))\n\t\t\t\t$data.=fread($f,4096);\n\t\t\tfclose($f);\n\t\t\treturn array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);\n\t\t}",
"function parseJPEGfile($filename)\n\t{\n\t\tarray_push($this->FMDebug, \"parseJPEGfile\");\n\n\t\t$SOI = chr(0xff) . chr(0xd8);\n\t\t$APP0 = chr(0xff) . chr(0xe0);\n\t\t$DQT = chr(0xff) . chr(0xdb);\n\t\t$SOF0 = chr(0xff) . chr(0xc0);\n\t\t$SOF1 = chr(0xff) . chr(0xc1);\n\t\t$SOF2 = chr(0xff) . chr(0xc2);\n\t\t$DHT = chr(0xff) . chr(0xc4);\n\t\t$DRI = chr(0xff) . chr(0xdd);\n\t\t$SOS = chr(0xff) . chr(0xda);\n\t\t$EOI = chr(0xff) . chr(0xd9);\n\t\t$COM = chr(0xff) . chr(0xfe);\n\n\t\t$filearray = array(\"JPEGEncoding\" => \"\", \"JPEGImage\" => \"\");\n\n\t\t$filehandle = fopen($filename, \"r\");\n\n\t\tif ($filehandle == FALSE) {\n\t\t\t$this->FMError(\"parseJPEGfile cannot open file\");\n\t\t}\n\n\t\t$jpeg = fread($filehandle, filesize($filename));\n\n\t\tfclose($filehandle);\n\n\t\t$marker = strpos($jpeg, $SOI);\n\n\t\t$jpeg = substr($jpeg, $marker);\n\n\t\t$loop = True;\n\n\t\twhile ($loop == True) {\n\n\t\t\tif (strlen($jpeg) == 0) {\n\t\t\t\t$loop = False;\n\t\t\t}\n\n\t\t\tswitch (substr($jpeg, 0, 2)) {\n\n\t\t\t\tcase $SOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] = $SOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] = $SOI;\n\t\t\t\t\t$jpeg = substr($jpeg, 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $APP0:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DQT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $SOF0:\n\t\t\t\tcase $SOF1:\n\t\t\t\tcase $SOF2:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$filearray[\"width\"] = ord(substr($jpeg, 7, 1)) * 256 + ord(substr($jpeg, 8, 1));\t\n\t\t\t\t\t$filearray[\"height\"] = ord(substr($jpeg, 5, 1)) * 256 + ord(substr($jpeg, 6, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DHT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DRI:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $COM:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $EOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= $EOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= $EOI;\n\t\t\t\t\t$loop = False;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif (substr($jpeg, 0, 2) == $SOS) {\n\n\t\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t$foundsos = True;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ($foundsos) {\n\t\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, 1);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, 1);\n\t\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$this->FMError(\"parseJPEGfile error parsing JPEG file file\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $filearray;\n\t}",
"public function _checkparsejpg($file)\r\n\t{\r\n\t\t\r\n\t\t$a = getimagesize($file);\r\n\t\tif(!$a)\r\n\t\t\t$this->ImageError('Missing or incorrect image file: '.$file);\r\n\t\tif($a[2]!=2)\r\n\t\t\t$this->ImageError('Not a JPEG file: '.$file);\r\n\t\tif(!isset($a['channels']) || $a['channels']==3)\r\n\t\t\t$colspace='DeviceRGB';\r\n\t\telseif($a['channels']==4)\r\n\t\t\t$colspace='DeviceCMYK';\r\n\t\telse\r\n\t\t\t$colspace='DeviceGray';\r\n\t\t$bpc=isset($a['bits']) ? $a['bits'] : 8;\r\n\t\t//Read whole file\r\n\t\t$f=fopen($file,'rb');\r\n\t\t$data='';\r\n\t\twhile(!feof($f))\r\n\t\t\t$data.=fread($f,8192);\r\n\t\tfclose($f);\r\n\t\treturn array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data);\r\n\t}",
"function _parsepng($file)\n\t\t{\n\t\t\t$f=fopen($file,'rb');\n\t\t\t//Extract info from a PNG file\n\t\t\tif(!$f)\t$this->Error('Can\\'t open image file: '.$file);\n\t\t\t//Check signature\n\t\t\tif(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))\n\t\t\t\t$this->Error('Not a PNG file: '.$file);\n\t\t\t//Read header chunk\n\t\t\tfread($f,4);\n\t\t\tif(fread($f,4)!='IHDR')\t$this->Error('Incorrect PNG file: '.$file);\n\t\t\t$w=$this->_freadint($f);\n\t\t\t$h=$this->_freadint($f);\n\t\t\t$bpc=ord(fread($f,1));\n\t\t\tif($bpc>8) $this->Error('16-bit depth not supported: '.$file);\n\t\t\t$ct=ord(fread($f,1));\n\t\t\tif($ct==0) $colspace='DeviceGray';\n\t\t\telseif($ct==2) $colspace='DeviceRGB';\n\t\t\telseif($ct==3) $colspace='Indexed';\n\t\t\telse $this->Error('Alpha channel not supported: '.$file);\n\t\t\tif(ord(fread($f,1))!=0)\t$this->Error('Unknown compression method: '.$file);\n\t\t\tif(ord(fread($f,1))!=0)\t$this->Error('Unknown filter method: '.$file);\n\t\t\tif(ord(fread($f,1))!=0)\t$this->Error('Interlacing not supported: '.$file);\n\t\t\tfread($f,4);\n\t\t\t$parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';\n\t\t\t//Scan chunks looking for palette, transparency and image data\n\t\t\t$pal='';\n\t\t\t$trns='';\n\t\t\t$data='';\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$n=$this->_freadint($f);\n\t\t\t\t$type=fread($f,4);\n\t\t\t\tif($type=='PLTE')\n\t\t\t\t{\n\t\t\t\t\t//Read palette\n\t\t\t\t\t$pal=fread($f,$n);\n\t\t\t\t\tfread($f,4);\n\t\t\t\t}\n\t\t\t\telseif($type=='tRNS')\n\t\t\t\t{\n\t\t\t\t\t//Read transparency info\n\t\t\t\t\t$t=fread($f,$n);\n\t\t\t\t\tif($ct==0) $trns=array(ord(substr($t,1,1)));\n\t\t\t\t\telseif($ct==2) $trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos=strpos($t,chr(0));\n\t\t\t\t\t\tif(is_int($pos)) $trns=array($pos);\n\t\t\t\t\t}\n\t\t\t\t\tfread($f,4);\n\t\t\t\t}\n\t\t\t\telseif($type=='IDAT')\n\t\t\t\t{\n\t\t\t\t\t//Read image data block\n\t\t\t\t\t$data.=fread($f,$n);\n\t\t\t\t\tfread($f,4);\n\t\t\t\t}\n\t\t\t\telseif($type=='IEND')\tbreak;\n\t\t\t\telse fread($f,$n+4);\n\t\t\t}\n\t\t\twhile($n);\n\t\t\tif($colspace=='Indexed' and empty($pal)) $this->Error('Missing palette in '.$file);\n\t\t\tfclose($f);\n\t\t\treturn array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);\n\t\t}",
"public function parse(): void\n {\n $compression = $this->file->readShort();\n $this->parseImageData($compression);\n }",
"protected function _parsepng($file)\n {\n // Extract info from a PNG file\n $f = fopen($file,'rb');\n if(!$f)\n $this->Error('Can\\'t open image file: '.$file);\n if($this->isInterlaced($file)){\n \n $img=@\\imagecreatefrompng($file); \n imageinterlace($img,0);\n ob_start();\n imagepng($img);\n $data = ob_get_clean();\n imagedestroy($img);\n $f = fopen('php://temp','rb+');\n if(!$f)\n $this->Error('Unable to create memory stream');\n fwrite($f,$data);\n rewind($f);\n }\n $info = $this->_parsepngstream($f,$file);\n fclose($f);\n return $info;\n }",
"function get_png_imageinfo($file) {\n\tif (empty($file)) return false;\n\n\t$info = unpack('A8sig/Nchunksize/A4chunktype/Nwidth/Nheight/Cbit-depth/'.\n 'Ccolor/Ccompression/Cfilter/Cinterface', \n\t\tfile_get_contents($file,0,null,0,29))\n\t\t;\n\n\tif (empty($info)) return false;\n\n\tif (\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\"!=array_shift($info))\n\t\treturn false; // no PNG signature.\n\n\tif (13 != array_shift($info))\n\t\treturn false; // wrong length for IHDR chunk.\n\n\tif ('IHDR'!==array_shift($info))\n\t\treturn false; // a non-IHDR chunk singals invalid data.\n\n\t$color = $info['color'];\n\n\t$type = array(0=>'Greyscale', 2=>'Truecolour', 3=>'Indexed-colour',\n\t4=>'Greyscale with alpha', 6=>'Truecolour with alpha');\n\n\tif (empty($type[$color]))\n\t\treturn false; // invalid color value\n\n\t$info['color-type'] = $type[$color];\n\n\t$samples = ((($color%4)%3)?3:1)+($color>3);\n\n\t$info['channels'] = $samples;\n\t$info['bits'] = $info['bit-depth'];\n\n\treturn $info;\n}",
"private function extractFile(array $file)\n {\n $this->seek($file['offset']);\n\n $contents = $this->read($file['size']['compressed']);\n\n if ($file['flags'] & self::BZ2) {\n if (!$this->compression['bzip2']) {\n throw new RuntimeException(\n \"The \\\"bz2\\\" extension is required to decompress \\\"{$file['name']['data']}\\\".\"\n );\n }\n\n $contents = bzdecompress($contents);\n } elseif ($file['flags'] & self::GZ) {\n if (!$this->compression['gzip']) {\n throw new RuntimeException(\n \"The \\\"zlib\\\" extension is required to decompress \\\"{$file['name']['data']}\\\".\"\n );\n }\n\n $contents = gzinflate($contents);\n }\n\n return $contents;\n }",
"public function getImageArray();",
"public function fromFile(string $filename): array;",
"public function parse($filename)\n {\n $this->open($filename);\n return $this->readChunks();\n }",
"private function parseChunks()\n {\n if ($this->chunksParsed) return;\n if ($this->dbg) echo (\"parseChunks on \" . $this->fileName . \"<br/>\");\n if (!($fp = fopen($this->fileName, \"rb\")))\n return;\n $this->chunkPosArray = array();\n $this->chunkSizeArray = array();\n $this->actualTimeBeginArray = array();\n $this->totalDataBytes = 0;\n fseek($fp, $this->firstData, SEEK_SET);\n $timeBegin = $this->timeStart;\n while (!feof($fp))\n {\n $str = fread($fp, 4);\n if ($str == \"\") // not sure why feof does not pick this up\n break;\n if ($str != 'data')\n {\n if ($this->dbg)\n echo (\"oops. should be data chunk.<br/>\");\n break;\n }\n $str = fread($fp, 4);\n $chunkSize = 0;\n for ($i = 3; $i >=0; $i--)\n {\n $chunkSize *= 256;\n $chunkSize += ord($str[$i]);\n }\n array_push($this->chunkPosArray, ftell($fp));\n array_push($this->actualTimeBeginArray , $timeBegin);\n array_push($this->chunkSizeArray, $chunkSize);\n if ($this->dbg) echo (\"chunkSize: \" . $chunkSize . \"<br/> timeBegin: \" .\n $timeBegin . \"</br\");\n $this->totalDataBytes += $chunkSize;\n $timeBegin += $chunkSize / $this->byteRateAdjusted;\n fseek($fp, $chunkSize, SEEK_CUR); \n }\n $this->chunksParsed = 1;\n $this->timeEnd = $timeBegin;\n fclose($fp);\n if ($this->dbg) \n {\n echo (\"chunks parsed: \" . count($this->chunkSizeArray, 0) . \"<br/>\");\n echo (\"timeEnd: \" . $timeBegin . \" <br/>\");\n echo (\"totalDataBytes: \" . $this->totalDataBytes . \"<br/>\");\n }\n }",
"public function extractMetaData(File $file, array $previousExtractedData = []): array\n {\n $sizeParts = [200, 200];\n $processedImage = $file->process(\n ProcessedFile::CONTEXT_IMAGECROPSCALEMASK,\n [\n 'width' => $sizeParts[0],\n 'height' => $sizeParts[1],\n 'crop' => null\n ]\n );\n $colors = self::extractFromFile($processedImage);\n foreach ($colors as &$color) {\n $color = Color::fromIntToHex($color);\n }\n unset($color);\n $metadata = [\n 'tx_colorextractor_color1' => $colors[0] ?? '',\n 'tx_colorextractor_color2' => $colors[1] ?? '',\n 'tx_colorextractor_color3' => $colors[2] ?? '',\n 'tx_colorextractor_color4' => $colors[3] ?? '',\n 'tx_colorextractor_color5' => $colors[4] ?? '',\n ];\n if ((bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)\n ->get('color_extractor', 'useLogging')\n ) {\n $this->logger->info('color_extractor', [\n 'file Extraction' => $file->getPublicUrl(),\n 'colors' => implode(',', $colors ?? [])\n\n ]);\n }\n return $metadata;\n }",
"public function fileToArray(string $filename): array;",
"function parse_file($file) { $buffer='';\n if ( substr($file, -3, 3) == '.gz' ) {\n\t$gz = @gzopen($file, 'rb');\n\n\tif ($gz) {\n\n\t\t# Check to see if we got a report\n \t\t# Check to make sure we have a valid file\n\t\t# Read the file\n\t\twhile (!gzeof($gz)) {\n\t \t$buffer .= gzread($gz, 4096);\n \t}\n \tgzclose($gz);\n \t} \n\telse {\n\t\tdie(\"Could not open gzip file. Exiting...\");\n\t}\n\n\tvar_dump(json_decode($buffer),TRUE);\n }\n else {\n\tdie(\"Wrong file type. Exiting...\");\n }\n}",
"public static function split_to_array($filename) {\n $file_handle = fopen($filename,'r');\n //get file size\n $file_size = filesize($filename);\n //no of parts to split\n $parts = $file_size / self::$buffer;\n\n //store all the file names\n $file_parts = array();\n\n //name of input file\n $file_name = basename($filename);\n\n for($i=0;$i<$parts;$i++){\n //read buffer sized amount from file\n $file_part = fread($file_handle, self::$buffer);\n //add the name of the file to part list\n array_push($file_parts, $file_part);\n } \n //close the main file handle\n\n fclose($file_handle);\n return $file_parts;\n }",
"function get_image_alt($file){\r\n $h1count = preg_match_all('/(alt=.)([a-zA-Z0-9\\s]{1,})/',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}",
"public function read(string $filename): array;",
"private function readFileAsArray()\n {\n return file($this->getFolder() . $this->filename);\n }",
"protected function extractFromFile($file)\n {\n $data = [];\n foreach ($this->readers as $reader) { /* @var $reader AbstractMetadataReader */\n $data = array_merge($data, $reader->extractFromFile($file));\n }\n return $data;\n }",
"function processFile($filepath) {\n\t$output = [];\n\n\t// Retrieve the image information.\n\t$data = file_get_contents($filepath);\n\t$output['base64'] = base64_encode($data);\n\t$output['type'] = pathinfo($filepath, PATHINFO_EXTENSION);\n\n\t// Check for if the image contains a hot dog.\n\t$properties = checkHotDog($filepath);\n\tif ($properties['ishotdog']) {\n\t\t$output['hotdog'] = true;\n\t\t$output['title'] = 'Hot Dog';\n\t\t$output['description'] = $properties['description'];\n\t}\n\telse {\n\t\t$output['hotdog'] = false;\n\t\t$output['title'] = 'Not a Hot Dog';\n\t\t$output['description'] = $properties['description'];\n\t}\n\n\tif (isset($properties['error'])) {\n\t\t$output['error'] = $properties['error'];\n\t}\n\n\treturn $output;\n}",
"public function parse (array $file_names);",
"public function getImgResource($file, $fileArray)\n {\n if (empty($file) && empty($fileArray)) {\n return null;\n }\n if (!is_array($fileArray)) {\n $fileArray = (array)$fileArray;\n }\n $imageResource = null;\n $tsfe = $this->getTypoScriptFrontendController();\n if ($file === 'GIFBUILDER') {\n /** @var GifBuilder $gifCreator */\n $gifCreator = GeneralUtility::makeInstance(GifBuilder::class);\n $gifCreator->init();\n $theImage = '';\n if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) {\n $gifCreator->start($fileArray, $this->data);\n $theImage = $gifCreator->gifBuild();\n }\n $imageResource = $gifCreator->getImageDimensions($theImage);\n $imageResource['origFile'] = $theImage;\n } else {\n if ($file instanceof File) {\n $fileObject = $file;\n } elseif ($file instanceof FileReference) {\n $fileObject = $file->getOriginalFile();\n } else {\n try {\n if ($fileArray['import.']) {\n $importedFile = trim($this->stdWrap('', $fileArray['import.']));\n if (!empty($importedFile)) {\n $file = $importedFile;\n }\n }\n\n if (MathUtility::canBeInterpretedAsInteger($file)) {\n $treatIdAsReference = isset($fileArray['treatIdAsReference.']) ? $this->stdWrap($fileArray['treatIdAsReference'], $fileArray['treatIdAsReference.']) : $fileArray['treatIdAsReference'];\n if (!empty($treatIdAsReference)) {\n $file = $this->getResourceFactory()->getFileReferenceObject($file);\n $fileObject = $file->getOriginalFile();\n } else {\n $fileObject = $this->getResourceFactory()->getFileObject($file);\n }\n } elseif (preg_match('/^(0|[1-9][0-9]*):/', $file)) { // combined identifier\n $fileObject = $this->getResourceFactory()->retrieveFileOrFolderObject($file);\n } else {\n if (isset($importedFile) && !empty($importedFile) && !empty($fileArray['import'])) {\n $file = $fileArray['import'] . $file;\n }\n $fileObject = $this->getResourceFactory()->retrieveFileOrFolderObject($file);\n }\n } catch (Exception $exception) {\n /** @var \\TYPO3\\CMS\\Core\\Log\\Logger $logger */\n $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);\n $logger->warning('The image \"' . $file . '\" could not be found and won\\'t be included in frontend output', ['exception' => $exception]);\n return null;\n }\n }\n if ($fileObject instanceof File) {\n $processingConfiguration = [];\n $processingConfiguration['width'] = isset($fileArray['width.']) ? $this->stdWrap($fileArray['width'], $fileArray['width.']) : $fileArray['width'];\n $processingConfiguration['height'] = isset($fileArray['height.']) ? $this->stdWrap($fileArray['height'], $fileArray['height.']) : $fileArray['height'];\n $processingConfiguration['fileExtension'] = isset($fileArray['ext.']) ? $this->stdWrap($fileArray['ext'], $fileArray['ext.']) : $fileArray['ext'];\n $processingConfiguration['maxWidth'] = isset($fileArray['maxW.']) ? (int)$this->stdWrap($fileArray['maxW'], $fileArray['maxW.']) : (int)$fileArray['maxW'];\n $processingConfiguration['maxHeight'] = isset($fileArray['maxH.']) ? (int)$this->stdWrap($fileArray['maxH'], $fileArray['maxH.']) : (int)$fileArray['maxH'];\n $processingConfiguration['minWidth'] = isset($fileArray['minW.']) ? (int)$this->stdWrap($fileArray['minW'], $fileArray['minW.']) : (int)$fileArray['minW'];\n $processingConfiguration['minHeight'] = isset($fileArray['minH.']) ? (int)$this->stdWrap($fileArray['minH'], $fileArray['minH.']) : (int)$fileArray['minH'];\n $processingConfiguration['noScale'] = isset($fileArray['noScale.']) ? $this->stdWrap($fileArray['noScale'], $fileArray['noScale.']) : $fileArray['noScale'];\n $processingConfiguration['additionalParameters'] = isset($fileArray['params.']) ? $this->stdWrap($fileArray['params'], $fileArray['params.']) : $fileArray['params'];\n $processingConfiguration['frame'] = isset($fileArray['frame.']) ? (int)$this->stdWrap($fileArray['frame'], $fileArray['frame.']) : (int)$fileArray['frame'];\n if ($file instanceof FileReference) {\n $processingConfiguration['crop'] = $this->getCropAreaFromFileReference($file, $fileArray);\n } else {\n $processingConfiguration['crop'] = $this->getCropAreaFromFromTypoScriptSettings($fileObject, $fileArray);\n }\n\n // Possibility to cancel/force profile extraction\n // see $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileCommand']\n if (isset($fileArray['stripProfile'])) {\n $processingConfiguration['stripProfile'] = $fileArray['stripProfile'];\n }\n // Check if we can handle this type of file for editing\n if (GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileObject->getExtension())) {\n $maskArray = $fileArray['m.'];\n // Must render mask images and include in hash-calculating\n // - otherwise we cannot be sure the filename is unique for the setup!\n if (is_array($maskArray)) {\n $mask = $this->getImgResource($maskArray['mask'], $maskArray['mask.']);\n $bgImg = $this->getImgResource($maskArray['bgImg'], $maskArray['bgImg.']);\n $bottomImg = $this->getImgResource($maskArray['bottomImg'], $maskArray['bottomImg.']);\n $bottomImg_mask = $this->getImgResource($maskArray['bottomImg_mask'], $maskArray['bottomImg_mask.']);\n\n $processingConfiguration['maskImages']['maskImage'] = $mask['processedFile'];\n $processingConfiguration['maskImages']['backgroundImage'] = $bgImg['processedFile'];\n $processingConfiguration['maskImages']['maskBottomImage'] = $bottomImg['processedFile'];\n $processingConfiguration['maskImages']['maskBottomImageMask'] = $bottomImg_mask['processedFile'];\n }\n $processedFileObject = $fileObject->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $processingConfiguration);\n $hash = $processedFileObject->calculateChecksum();\n // store info in the TSFE template cache (kept for backwards compatibility)\n if ($processedFileObject->isProcessed() && !isset($tsfe->tmpl->fileCache[$hash])) {\n $tsfe->tmpl->fileCache[$hash] = [\n 0 => $processedFileObject->getProperty('width'),\n 1 => $processedFileObject->getProperty('height'),\n 2 => $processedFileObject->getExtension(),\n 3 => $processedFileObject->getPublicUrl(),\n 'origFile' => $fileObject->getPublicUrl(),\n 'origFile_mtime' => $fileObject->getModificationTime(),\n // This is needed by \\TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder,\n // in order for the setup-array to create a unique filename hash.\n 'originalFile' => $fileObject,\n 'processedFile' => $processedFileObject,\n 'fileCacheHash' => $hash\n ];\n }\n $imageResource = $tsfe->tmpl->fileCache[$hash];\n }\n }\n }\n // If image was processed by GIFBUILDER:\n // ($imageResource indicates that it was processed the regular way)\n if (!isset($imageResource)) {\n $theImage = $tsfe->tmpl->getFileName($file);\n if ($theImage) {\n $gifCreator = GeneralUtility::makeInstance(GifBuilder::class);\n /** @var $gifCreator GifBuilder */\n $gifCreator->init();\n $info = $gifCreator->imageMagickConvert($theImage, 'WEB');\n $info['origFile'] = $theImage;\n // This is needed by \\TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash.\n $info['origFile_mtime'] = @filemtime($theImage);\n $imageResource = $info;\n }\n }\n // Hook 'getImgResource': Post-processing of image resources\n if (isset($imageResource)) {\n /** @var ContentObjectGetImageResourceHookInterface $hookObject */\n foreach ($this->getGetImgResourceHookObjects() as $hookObject) {\n $imageResource = $hookObject->getImgResourcePostProcess($file, (array)$fileArray, $imageResource, $this);\n }\n }\n return $imageResource;\n }",
"function fetch_colors($filename = '')\n\t{\n\t\tif (!empty($filename))\n\t\t{\n\t\t\t// resize to obtain most significant colors\n\t\t\t$preview_width = 150;\n\t\t\t$preview_height = 150;\n\t\t\t$size = GetImageSize($filename);\n\t\t\t$scale = 1;\n\t\t\tif ($size[0] > 0)\n\t\t\t{\n\t\t\t\t$scale = min($preview_width / $size[0], $preview_height / $size[1]);\n\t\t\t}\n\t\t\tif ($scale < 1)\n\t\t\t{\n\t\t\t\t$width = floor($scale*$size[0]);\n\t\t\t\t$height = floor($scale*$size[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$width = $size[0];\n\t\t\t\t$height = $size[1];\n\t\t\t}\n\t\t\t$image_resized = imagecreatetruecolor($width, $height);\n\t\t\tif ($size[2] == 1)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefromgif($filename);\n\t\t\t}\n\t\t\tif ($size[2] == 2)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefromjpeg($filename);\n\t\t\t}\n\t\t\tif ($size[2] == 3)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefrompng($filename);\n\t\t\t}\n\t\t\t// we need the nearest neihbor resizing because it doesn't alter the colors\n\t\t\timagecopyresampled($image_resized, $image_orig, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t\t\t$im = $image_resized;\n\t\t\t$imgWidth = imagesx($im);\n\t\t\t$imgHeight = imagesy($im);\n\t\t\tfor ($y = 0; $y < $imgHeight; $y++)\n\t\t\t{\n\t\t\t\tfor ($x = 0; $x < $imgWidth; $x++)\n\t\t\t\t{\n\t\t\t\t\t$index = imagecolorat($im, $x, $y);\n\t\t\t\t\t$Colors = imagecolorsforindex($im, $index);\n\t\t\t\t\t// round off the colors to reduce the number of colors to prevent duplicates\n\t\t\t\t\t$Colors['red'] = intval((($Colors['red']) + 15) / 32) * 32;\n\t\t\t\t\t$Colors['green'] = intval((($Colors['green']) + 15) / 32) * 32;\n\t\t\t\t\t$Colors['blue'] = intval((($Colors['blue']) + 15) / 32) * 32;\n\t\t\t\t\tif ($Colors['red'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['red'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\tif ($Colors['green'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['green'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\tif ($Colors['blue'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['blue'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\t$hexarray[] = substr(\"0\" . dechex($Colors['red']), -2) . substr(\"0\" . dechex($Colors['green']), -2) . substr(\"0\" . dechex($Colors['blue']), -2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$hexarray = array_count_values($hexarray);\n\t\t\tnatsort($hexarray);\n\t\t\t$hexarray = array_reverse($hexarray, true);\n\t\t\treturn $hexarray;\n\t\t}\n\t}",
"public function parseFile(string $filename);",
"function arrayfile_to_array($filepath){\n $fsize = filesize($filepath);\n if ($fsize > 0) {\n $fp = fopen($filepath, \"r\");\n $encoded = fread($fp, $fsize);\n fclose($fp);\n return unserialize($encoded);\n }\n }",
"function get_images($file){\r\n $h1count = preg_match_all('/(<img)\\s (src=\"([a-zA-Z0-9\\.;:\\/\\?&=_|\\r|\\n]{1,})\")/isxmU',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[3]);\r\n array_push($res,count($patterns[3]));\r\n return $res;\r\n}",
"public static function processFile( string $src, ) : array {\n\t\t$mime\t= static::adjustMime( $src );\n\t\t\n\t\treturn [\n\t\t\t'src'\t\t=> $src,\n\t\t\t'mime'\t\t=> $mime,\n\t\t\t'filename'\t=> \\basename( $src ),\n\t\t\t'filesize'\t=> \\filesize( $src ),\n\t\t\t'description'\t=> '',\n\t\t\t\n\t\t\t// Process thumbnail if needed\n\t\t\t'thumbnail'\t=>\n\t\t\t\t\\in_array( $mime, static::$thumbnail_types ) ? \n\t\t\t\tstatic::createThumbnail( $src, $mime ) : ''\n\t\t];\n\t}",
"function readfileas_array($fname, $delims = array(PHP_EOL)) {\n #multiexplode from https://php.net/manual/en/function.explode.php#111307\n $ret = file_get_contents($fname);\n if (! $ret) {\n return FALSE;\n }else{\n if (empty($delims)) {\n return FALSE;\n }\n $ret = str_replace($delims, $delims[0], $ret);//collapse all delimiters into the first one, and use the first one as the only delimiter with explode below:\n return array_filter(explode($delims[0], $ret));//ignores empty lines (+ the extra one at the end which was added regardless)\n }\n}",
"function cjpopups_reArrayFiles(&$file_post)\n{\n $file_ary = array();\n $file_count = count($file_post['name']);\n $file_keys = array_keys($file_post);\n\n for ($i=0; $i<$file_count; $i++) {\n foreach ($file_keys as $key) {\n $file_ary[$i][$key] = $file_post[$key][$i];\n }\n }\n return $file_ary;\n}"
] |
[
"0.60984826",
"0.5918459",
"0.55164343",
"0.54745656",
"0.5084433",
"0.48550558",
"0.48051867",
"0.47655693",
"0.47639757",
"0.47557777",
"0.47009367",
"0.46586326",
"0.46093923",
"0.4604141",
"0.45704207",
"0.4550895",
"0.44877198",
"0.44685373",
"0.4464365",
"0.44638208",
"0.4462375",
"0.44526595",
"0.44290963",
"0.44071203",
"0.43893564",
"0.4389294",
"0.43850526",
"0.43825623",
"0.43780586",
"0.43774801"
] |
0.78466564
|
0
|
// // Tags // // // null AutoSetSWFVersion(integer version) sets the SWF file version number to version. NOTE: don't call this function directly. Use SetSWFVersion() from the Toolbox instead.
|
function AutoSetSWFVersion($version)
{
array_push($this->FMDebug, "AutoSetSWFVersion");
if ($this->SWFVersion < $version) {
$this->SWFVersion = (int) $version;
}
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setVersion($version) {}",
"public function setVersion($version) {}",
"public function setVersion($version);",
"public function setVersion($version);",
"public function setVersion($version);",
"public function setVersion($version);",
"public function setVersion($version);",
"public function setVersion(string $version);",
"private function setVersion($v){\n\t\t$this->version = $v;\n\t}",
"public function setVersion($version)\n\t{\n\t\t$this->version = (int) $version;\n\t}",
"public function setVersion($value){\n $this->version = $value;\n }",
"function acf_update_db_version($version = '')\n{\n}",
"function autoVer($filename){\n\t$ext = substr(strrchr($filename, '.'), 1);\r\n\t$path = $_SERVER['DOCUMENT_ROOT'].'/Apps/M/View/default/'.$ext.'/'.$filename;\r\n $ver = filemtime($path);\n//\t$ver='0415';\n echo $filename.'?v='.$ver;\n}",
"public function setVersion($version) {\n\t\t$this->version = $version;\n\t}",
"public function setVersion($rel_version = null, $api_version = null)\n {\n $release = $this->findNodeRelativeTo(\n './p:version',\n $this->_requireCurrentRelease()\n );\n $version = $this->findNode('/p:package/p:version');\n if ($rel_version !== null) {\n $this->replaceTextNodeRelativeTo(\n './p:release', $version, $rel_version\n );\n $this->replaceTextNodeRelativeTo(\n './p:release', $release, $rel_version\n );\n }\n if ($api_version !== null) {\n $this->replaceTextNodeRelativeTo(\n './p:api', $version, $api_version\n );\n $this->replaceTextNodeRelativeTo(\n './p:api', $release, $api_version\n );\n }\n }",
"public function setForceCurrentVersion($version)\n {\n $this->_options['current_version'] = $version;\n }",
"public function setVersion($version)\n {\n return $this->setParam(self::SOFTWARE_VER_PARAM_NAME, $version);\n }",
"public function setVersion(?int $value): void {\n $this->getBackingStore()->set('version', $value);\n }",
"public function setApiVersion($version)\n {\n if (ctype_digit(strval($version))) {\n $this->apiVersion = (int)$version;\n }\n }",
"public function setVersion($version)\n {\n $this->version = $version;\n }",
"function setCurrentVersion(&$version) {\n\t\t$this->currentVersion = $version;\n\t}",
"private static function version()\n {\n $files = ['Version'];\n $folder = static::$root.'Foundation'.'/';\n\n self::call($files, $folder);\n }",
"function acf_get_full_version($version = '1')\n{\n}",
"public function setApiVersion($version)\n {\n $this->_apiVersion = (int)$version;\n }",
"public function setVersion($value)\n {\n return $this->set(self::_VERSION, $value);\n }",
"public function setVersion(?string $value): void {\n $this->getBackingStore()->set('version', $value);\n }",
"public function setVersion(?string $value): void {\n $this->getBackingStore()->set('version', $value);\n }",
"function getVersion() {\r\n\t\treturn '1.1';\r\n\t}",
"public function setVersion($version)\n {\n $this->version = $version;\n }",
"public function setVersion($version)\n {\n $this->version = $version;\n }"
] |
[
"0.58671564",
"0.58671564",
"0.57372695",
"0.57372695",
"0.57372695",
"0.57372695",
"0.57372695",
"0.5668459",
"0.55860573",
"0.5555139",
"0.5503851",
"0.54676896",
"0.54150856",
"0.5404872",
"0.53981376",
"0.5283705",
"0.5277751",
"0.52743995",
"0.5255054",
"0.5250701",
"0.52447826",
"0.52360356",
"0.5179927",
"0.5164084",
"0.5156295",
"0.513453",
"0.513453",
"0.51282436",
"0.51075184",
"0.51075184"
] |
0.8491539
|
0
|
string packRECORDHEADER(integer TagID, integer TagLength) returns the SWF RECORDHEADER string.
|
function packRECORDHEADER($TagID, $TagLength)
{
array_push($this->FMDebug, "packRECORDHEADER");
$lower_limit = 0;
$upper_short_tag_limit = 62;
$upper_long_tag_limit = 2147483647;
if (!(is_integer($TagLength))) {
$this->FMError("packRECORDHEADER argument (TagLength) not an integer");
}
if ($TagLength < $lower_limit) {
$this->FMError("packRECORDHEADER argument (TagLength) negative");
}
if ($TagLength > $upper_short_tag_limit) {
if ($TagLength > $upper_long_tag_limit) {
$this->FMError("packRECORDHEADER argument (TagLength) out of range");
} else {
$atom = $TagID << 6;
$atom += 0x3f;
$atom = $this->packUI16($atom);
$atom .= $this->packUI32($TagLength);
}
} else {
$atom = $TagID << 6;
$atom += $TagLength;
$atom = $this->packUI16($atom);
}
array_pop($this->FMDebug);
return $atom;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createVariableHeader(): string\n {\n return $this->getPacketIdentifierBinaryRepresentation();\n }",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function _generateHeaderInfo()\n {\n return '0504';\n }",
"public function build()\n {\n # Fixed Header\n # Control Packet Type\n $cmd = $this->getMessageType() << 4;\n\n $cmd |= ($this->reserved_flags & 0x0F);\n\n $header = chr($cmd) . $this->remaining_length_bytes;\n\n $header .= $this->buildVariableHeader();\n\n return $header;\n }",
"function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public static function readHeader($file_name){\r\n\t\t\r\n\t\t$fh = fopen('./dbc/'.$file_name, 'rb');\r\n\t\t$_hdr_data[] = $file_name; // just a little extra info; passed to $Header\r\n\t\t$file_format = fread($fh, 4); // be sure to fopen the file! \r\n\t\tif($file_format == \"WDBC\") // is this a DBC file?\r\n\t\t{\r\n\t\t\tfor($i = 0; $i < 4; $i++)\r\n\t\t\t{\r\n\t\t\t\t$bin = fread($fh, 4);\r\n\t\t\t\t$hex = bin2hex($bin);\r\n\t\t\t\t$hex = substr($hex, 6, 2).substr($hex, 4, 2).substr($hex, 2, 2).substr($hex, 0, 2);\r\n\t\t\t\t$_hdr_data[] = hexdec($hex);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tdie($file_name.\" is not a DBC-file.\");\r\n\t\t}//else\r\n\t\t\r\n\t\treturn $_hdr_data; //0=>Name, 1=>Records, 2=>Fields, 3=>RecordSize, 4=>StringBlockSize\r\n\t\t\r\n\t}",
"private function generateHeader() {\n $rounds = $this->rounds;\n $flag = (($this->sha1 == true AND function_exists(\"sha1\")) ? 1 : 0) << 7;\n \n return substr(base64_encode(pack(\"N*\", $rounds | $flag << 24)), 0, 6);\n }",
"private function writeHeader(): void\n {\n $record = 0x0014; // Record identifier\n\n /* removing for now\n // need to fix character count (multibyte!)\n if (strlen($this->phpSheet->getHeaderFooter()->getOddHeader()) <= 255) {\n $str = $this->phpSheet->getHeaderFooter()->getOddHeader(); // header string\n } else {\n $str = '';\n }\n */\n\n $recordData = StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader());\n $length = strlen($recordData);\n\n $header = pack('vv', $record, $length);\n\n $this->append($header . $recordData);\n }",
"public function getHeaderString() {\n return $this->getPayload(FALSE);\n }",
"private function getHeader( $instanceCount )\n\t{\n\t\t$instanceCount = str_pad( dechex( $instanceCount ), 4, '0', STR_PAD_LEFT );\n\t\t$header = hex2bin( \"000000010000\" );\n\t\t$header .= hex2bin( $instanceCount );\n\t\t$header .= hex2bin( Helper::pad( 4 ) );\n\n\t\treturn $header;\n\t}",
"public function buildHeader($object = null): string\n {\n $characters = $this->getControlCharacters();\n\n return $characters['header']['start']['string'].\n $characters['prefix']['start']['string'].\n $this->getPrefix().\n $characters['prefix']['stop']['string'].\n $characters['field']['start']['string'].\n 'version'.\n $characters['field']['delimiter']['string'].\n self::getVersionForPrefix().\n $characters['field']['stop']['string'].\n (is_null($object) ? '' :\n $characters['field']['start']['string'].\n 'type'.\n $characters['field']['delimiter']['string'].\n gettype($object).'['.(is_object($object) ? get_class($object) : 'native').']'.\n $characters['field']['stop']['string']\n ).\n $characters['header']['stop']['string'];\n }",
"public function toString(): string\n\t{\n\t\t$aPkt = unpack('C*',$this->getData());\n\t\t$sReturn = \"Header | Type : \".$this->getPacketType().\" Port : \".$this->getPort().\" Control : \".$this->iCb.\" Pad : \".$this->iPadding.\" Seq : \".$this->iSeq.\" | Body |\".implode(\":\",$aPkt).\" |\";\n\t\treturn $sReturn;\t\n\t}",
"public function getHeader()\n {\n return <<<EOF\n<info>\nWW WW UU UU RRRRRR FFFFFFF LL \nWW WW UU UU RR RR FF LL \nWW W WW UU UU RRRRRR FFFF LL \n WW WWW WW UU UU RR RR FF LL \n WW WW UUUUU RR RR FF LLLLLLL \n \n</info>\n\nEOF;\n\n}",
"protected function makeMimeVersionHeaderString() {\n\t\treturn $this->_mailMimeVersion . $this->_endString;\n\t}",
"private function writePrintHeaders(): void\n {\n $record = 0x002a; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $fPrintRwCol = $this->printHeaders; // Boolean flag\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $fPrintRwCol);\n $this->append($header . $data);\n }",
"private function buildHeaderString()\n {\n $out = '';\n foreach($this->headers as $header => $value) {\n $out .= \"$header: $value\\r\\n\";\n }\n return $out;\n }",
"function packStartSoundTag($CharacterID, $SOUNDINFO)\n\t{\n\t\tarray_push($this->FMDebug, \"packStartSoundTag\");\n\n\t\t$TagID = 15;\n\n\t\t$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;\n\n\t\t$TagLength = strlen($StartSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"function writeWaveHeader($totalBytesForIntervals)\n {\n if ($this->dbg)\n {\n echo (\"Pretending to write header for \" . $totalBytesForIntervals . \"<br/>\");\n return;\n }\n\n $chunkSize = $totalBytesForIntervals + 12 + strlen($this->fmt);\n $str = \"\";\n for ($i = 0; $i < 4; $i++)\n {\n $str .= chr($chunkSize%256); $chunkSize /= 256;\n }\n \n echo (\"RIFF\");\n echo ($str);\n echo (\"WAVE\"); // 4 of the 12\n echo ($this->fmt);\n echo (\"data\"); // 8 of the 12\n $str = \"\";\n $chunkSize = $totalBytesForIntervals;\n for ($i = 0; $i < 4; $i++)\n {\n $str .= chr($chunkSize%256); $chunkSize /= 256;\n }\n echo ($str); // 12 of the 12 \n }",
"public function getHeaderString () {\n\t\t$headers = array();\n\t\tforeach ($this->_headers as $name => $value) {\n\t\t $headers[] = $name . \": \" . $value;\n\t\t}\n\t\treturn implode(\"\\r\\n\", $headers);\n\t}",
"function _init_header()\n {\n $this->head1 = false;\n $this->head = false;\n\n // try to get ID3v1 first\n fseek($this->fd, -128, SEEK_END);\n $buf = fread($this->fd, 128);\n if (strlen($buf) == 128 && substr($buf, 0, 3) == 'TAG')\n {\n\t$tmp = unpack('a3id/a30Title/a30Artist/a30AlbumTitle/a4Year/a28Description/CReserved/CTrack/CGenre', $buf);\n\t$this->head1 = $tmp;\n }\n\n // try to get ID3v2\n fseek($this->fd, 0, SEEK_SET);\n $buf = fread($this->fd, 10);\n if (strlen($buf) == 10 && substr($buf, 0, 3) == 'ID3') \n {\n\t$tmp = unpack('a3id/Cver/Crev/Cflag/C4size', $buf);\n\t$tmp['size'] = ($tmp['size1']<<21)|($tmp['size2']<<14)|($tmp['size3']<<7)|$tmp['size4'];\n\tunset($tmp['size1'], $tmp['size2'], $tmp['size3'], $tmp['size4']);\n\n\t$this->head = $tmp;\n\t$this->head_buf = fread($this->fd, $tmp['size']);\n }\n return ($this->head1 || $this->head);\n }",
"function rs2xmlrpcval_header($adodbrs)\r\n {\r\n $numfields = $adodbrs->FieldCount();\r\n $numrecords = $adodbrs->RecordCount();\r\n\r\n // build structure holding recordset information\r\n $fieldstruct = array();\r\n for ($i = 0; $i < $numfields; $i++) {\r\n $fld = $adodbrs->FetchField($i);\r\n $fieldarray = array();\r\n if (isset($fld->name))\r\n $fieldarray[\"name\"] =& new xmlrpcval ($fld->name);\r\n if (isset($fld->type))\r\n $fieldarray[\"type\"] =& new xmlrpcval ($fld->type);\r\n if (isset($fld->max_length))\r\n $fieldarray[\"max_length\"] =& new xmlrpcval ($fld->max_length, \"int\");\r\n if (isset($fld->not_null))\r\n $fieldarray[\"not_null\"] =& new xmlrpcval ($fld->not_null, \"boolean\");\r\n if (isset($fld->has_default))\r\n $fieldarray[\"has_default\"] =& new xmlrpcval ($fld->has_default, \"boolean\");\r\n if (isset($fld->default_value))\r\n $fieldarray[\"default_value\"] =& new xmlrpcval ($fld->default_value);\r\n $fieldstruct[$i] =& new xmlrpcval ($fieldarray, \"struct\");\r\n }\r\n $fieldcount =& new xmlrpcval ($numfields, \"int\");\r\n $recordcount =& new xmlrpcval ($numrecords, \"int\");\r\n $sql =& new xmlrpcval ($adodbrs->sql);\r\n $fieldinfo =& new xmlrpcval ($fieldstruct, \"array\");\r\n\r\n $header =& new xmlrpcval ( array(\r\n \"fieldcount\" => $fieldcount,\r\n \"recordcount\" => $recordcount,\r\n \"sql\" => $sql,\r\n \"fieldinfo\" => $fieldinfo\r\n ), \"struct\");\r\n\r\n return $header;\r\n }",
"protected function makeHeader()\n {\n $header = '';\n foreach(self::$headers as $k => $v) {\n $header .= $k . \": \" . $v . \"\\r\\n\";\n }\n\n return $header;\n }",
"protected function createRecordHeader(array $record): array\n {\n // Wildfire is extensible to support multiple protocols & plugins in a single request,\n // but we're not taking advantage of that (yet), so we're using \"1\" for simplicity's sake.\n return $this->createHeader(\n [1, 1, 1, self::$messageIndex++],\n $record['formatted']\n );\n }",
"protected function readHeader($binaryData) {\r\n\t\tif (strlen($binaryData) != 512) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$header = [];\r\n\t\t$checksum = 0;\r\n\t\t// First part of the header\r\n\t\tfor ($i = 0; $i < 148; $i++) {\r\n\t\t\t$checksum += ord(substr($binaryData, $i, 1));\r\n\t\t}\r\n\t\t// Calculate the checksum\r\n\t\t// Ignore the checksum value and replace it by ' ' (space)\r\n\t\tfor ($i = 148; $i < 156; $i++) {\r\n\t\t\t$checksum += ord(' ');\r\n\t\t}\r\n\t\t// Last part of the header\r\n\t\tfor ($i = 156; $i < 512; $i++) {\r\n\t\t\t$checksum += ord(substr($binaryData, $i, 1));\r\n\t\t}\r\n\t\t\r\n\t\t// extract values\r\n\t\t$format = 'Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/Z32uname/Z32gname/Z8devmajor/Z8devminor/Z155prefix';\r\n\t\t\r\n\t\t$data = unpack($format, $binaryData);\r\n\t\t\r\n\t\t// Extract the properties\r\n\t\t$header['checksum'] = octdec(trim($data['checksum']));\r\n\t\tif ($header['checksum'] == $checksum) {\r\n\t\t\t$header['filename'] = trim($data['filename']);\r\n\t\t\t$header['mode'] = octdec(trim($data['mode']));\r\n\t\t\t$header['uid'] = octdec(trim($data['uid']));\r\n\t\t\t$header['gid'] = octdec(trim($data['gid']));\r\n\t\t\t$header['size'] = octdec(trim($data['size']));\r\n\t\t\t$header['mtime'] = octdec(trim($data['mtime']));\r\n\t\t\t$header['prefix'] = trim($data['prefix']);\r\n\t\t\tif ($header['prefix']) {\r\n\t\t\t\t$header['filename'] = $header['prefix'].'/'.$header['filename'];\r\n\t\t\t}\r\n\t\t\tif (($header['typeflag'] = $data['typeflag']) == '5') {\r\n\t\t\t\t$header['size'] = 0;\r\n\t\t\t\t$header['type'] = 'folder';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$header['type'] = 'file';\r\n\t\t\t}\r\n\t\t\t$header['offset'] = $this->file->tell();\r\n\t\t\t\r\n\t\t\treturn $header;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function dbase_get_header_info($dbase_identifier)\n{\n}",
"public function getHeaderConcatPayloadString()\n {\n return $this->header->toBase64String() . \".\" . $this->payload->toBase64String();\n }",
"private static final function getMetaTAGHeader () {\r\n $tagMetaHeaderString = new S;\r\n $tagMetaPureString = new FileContent (FORM_TP_DIR . _S . 'frm_web_head_meta.tp');\r\n foreach (self::$objMetaTAG as $k => $v) {\r\n $tagMetaHeaderString->appendString (str_replace (array ('[%META_NAME_REPLACE%]', '[%META_CONTENT_INFO%]'),\r\n array (self::$objMetaTAG[$k]['name'], self::$objMetaTAG[$k]['info']), $tagMetaPureString));\r\n }\r\n // Do return ...\r\n return $tagMetaHeaderString;\r\n }",
"function dbase_get_header_info($dbase_identifier): array {}",
"public function getHeaderSize()\n {\n return 30 + $this->properties[\"fileNameLength\"] + $this->properties[\"extraFieldLength\"];\n }"
] |
[
"0.55913436",
"0.55053025",
"0.54071873",
"0.5403311",
"0.53649914",
"0.53253",
"0.52895314",
"0.5288521",
"0.5248829",
"0.5232854",
"0.5226172",
"0.5177835",
"0.51618814",
"0.5126504",
"0.511721",
"0.5075465",
"0.5058976",
"0.49784493",
"0.49649158",
"0.49528345",
"0.49210197",
"0.48957726",
"0.48617834",
"0.48425177",
"0.48365918",
"0.48168784",
"0.4792133",
"0.47649837",
"0.47445482",
"0.47387382"
] |
0.7905612
|
0
|
string packEndTag() returns an SWF End Tag string. TagID: 0
|
function packEndTag()
{
array_push($this->FMDebug, "packEndTag");
$TagID = 0;
$TagLength = 0;
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public final function endTag() : string\n {\n return $this->name && !$this->isEmpty ? '</' . $this->name . '>' : '';\n }",
"function End_Tag($parser, $tag)\r\n\t{\r\n\t\tif ($tag == 'AMP') return;\r\n\t\telse if ($tag == 'BOX')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'BR') return;\r\n\t\telse if ($tag == 'COPY') return;\r\n\t\telse if ($tag == 'DOCTYPE') return;\r\n\t\telse if ($tag == 'IMG') return;\r\n\t\telse if ($tag == 'INCLUDE') return;\r\n\t\telse if ($tag == 'INPUT') return;\r\n\t\telse if ($tag == 'LINK') return;\r\n\t\telse if ($tag == 'META') return;\r\n\t\telse if ($tag == 'NBSP') return;\r\n\t\telse if ($tag == 'NULL') return;\r\n\t\telse if ($tag == 'PRESENT')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get($this->data);\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse if ($tag == 'XFORM')\r\n\t\t{\r\n\t\t\t$objc = &$this->GetCurrentObject();\r\n\t\t\t$objd = &$this->GetDestinationObject();\r\n\t\t\t$objd->out .= $objc->Get();\r\n\t\t\tarray_pop($this->objs);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$obj = &$this->GetCurrentObject();\r\n\t\t\t$obj->out .= '</'.strtolower($tag).'>';\r\n\t\t}\r\n\t}",
"public function closeTag(): string\n {\n return $this->templateCloseTag;\n }",
"public static function tag_remove_end() {\n\t//--\n\treturn '<!-- PDF REMOVE END -->';\n\t//--\n}",
"public function makeClosingTag()\n {\n if ($this->selfClosing) {\n return '';\n }\n\n return '</'.$this->name.'>';\n }",
"function endTag ($tag = NULL)\n\t{\n\t\t$html = $tag ? \"</$tag>\" : \"</$this->tag>\";\n\t\t$this -> tag = '';\n\n\t\treturn $html;\n\t}",
"public function closeTag()\n {\n return '</form> </div></div>';\n }",
"function CloseTag() {\n\t\tif (!empty($this->tag)) {\n\t\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t\t$this->outputCode.=\"\";\n\t\t\t}\n\t\t\tif (!empty($this->tag))\n\t\t\t$this->outputCode.=\"</\".$this->tag.\">\";\n\t\t}\n\t\t//$this->outputCode.=\"\\n\";\n\t\t$this->indent--;\n\t}",
"public function closeTag()\n {\n return '</span>';\n }",
"function inline_archive_structure_end() {\n\n\techo '</div><!--end #archive-->';\n\t\n}",
"function _renderEnd()\n {\n echo '</div>' . $this->_varRenderer->renderEnd();\n }",
"public function getClosingTag() {\n return $this->closingTag;\n }",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function renderContentEnd()\n {\n echo CHtml::closeTag('div');\n }",
"public function renderContentEnd()\n {\n echo CHtml::closeTag('div');\n }",
"static public function endTag(Filter $filter)\n {\n\t\treturn '\n\t\t</form>\n\t\t<!-- /. grid filter form -->\n\t</div>';\n }",
"protected function transpileEndEmpty(): string\n {\n return '<?php endif; ?>';\n }",
"protected function _renderBodyEnd()\n\t{\n\t\treturn ''\n\t\t\t. \"\\n\" . Html::endTag( 'div' );\n\t}",
"function visual_group_end()\n\t\t{\t\t\t\n\t\t\t$output = '</div>';\n\t\t\treturn $output;\n\t\t}",
"private function renderBottom() {\n\t\t$bottom = '';\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$bottom .= $this->closeTag('channel');\n\t\t\t$bottom .= $this->closeTag('rss');\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$bottom .= $this->closeTag('rdf:RDF');\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$bottom .= $this->closeTag('feed');\n\t\t}\n\t\treturn $bottom;\n\t}",
"function page_end() {\n\t\t$this->tag= \"</body></html>\";\n\t\treturn $this -> tag;\n\t}",
"public function close() {\n\t\t\n\t\t// Render close tag\n\t\t\n\t\t$this->_post_render();\n\t\t\n\t\techo true === $this->options['render_tag'] ? $this->_render_tag( true ) : '';\n\t\t\n\t\techo $this->options['after'];\n\t\t\n\t}",
"public function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}",
"private function close() {\n echo \"</{$this->name}>\\n\";\n }",
"function renderEnd(&$render)\n {\n return '';\n }",
"function endGallery() {\n $content = '</div></div>';\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraEndGalleryHook'])) {\n foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraEndGalleryHook'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$content = $_procObj->extraEndGalleryProcessor($content, $this);\n }\n } \n return $content;\n }",
"private function _closeTag($xhtml = false)\n {\n $ele = '';\n if ($xhtml) {\n // Self close tag\n $ele .= '/';\n }\n\n // Close tag\n $ele .= '>';\n \n return $ele;\n }",
"public static function closeTag($tag) {\n\t\treturn '</' . $tag . '>';\n\t}",
"public static function end_header()\n\t{\n\t\treturn sprintf('</h%d>',\n\t\t\tmin(6, self::$nivel_cabecalho)\n\t\t);\n\t}",
"public function t_end_heredoc($sTag) {\n\t\t$this->inHereDoc = false;\n\t\t$this->oBeaut->add('\";');\n\t}"
] |
[
"0.62218356",
"0.6136998",
"0.61046",
"0.60372263",
"0.60131454",
"0.5885808",
"0.5836973",
"0.5812356",
"0.5688208",
"0.5672495",
"0.5628228",
"0.5605781",
"0.55574214",
"0.5553971",
"0.5553971",
"0.5498158",
"0.5476539",
"0.54751736",
"0.5462914",
"0.5457785",
"0.5440496",
"0.54349375",
"0.5426249",
"0.5424363",
"0.54243505",
"0.5415646",
"0.54090554",
"0.5403797",
"0.53907305",
"0.53732127"
] |
0.82080793
|
0
|
string packShowFrameTag() returns an SWF ShowFrameTag string. TagID: 1
|
function packShowFrameTag()
{
array_push($this->FMDebug, "packShowFrameTag");
$TagID = 1;
$TagLength = 0;
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function getFrame(): string;",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function render()\n {\n return '<frame name=\"'.$this->m_name.'\" scrolling=\"'.$this->m_scrolling.'\" '.(!$this->m_resize?\"noresize\":\"\").\n ' src=\"'.$this->m_src.'\" marginwidth=\"'.$this->m_margin.'\" marginheight=\"'.$this->m_margin.'\">'.\"\\n\";\n }",
"function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function getFrame() {}",
"function readFrame ($frameTag, $header, $ver) {\n\tif ($ver == 3) {\n\t\t$lengthOffset = 6;\n\t\t$textOffset = 11;\n\t} \n\tif ($ver == 2) {\n\t\t$lengthOffset = 4;\n\t\t$textOffset = 7;\n\t}\n\t\n\t// find the tag we're looking for\n\t$tagStart = strpos ($header, $frameTag) ;\n\t// this code only reads the first 256 bytes on larger frames\n\t$tagLength = ord (substr($header, $tagStart + 1 + $lengthOffset, 1));\n\t$textStart = $tagStart + $textOffset;\n\tif ($frameTag == \"COMM\" || $frameTag == \"COM\") {\n\t\t$textStart = $textStart + 4;\n\t\t$tagLength = $tagLength - 4;\n\t\t}\n\t$tagText = substr($header, $textStart, $tagLength - 1);\n\treturn stripJunk($tagText);\n}",
"function iframevideoShortcode( $atts, $content = null, $tag = '' ){\n\t$atts = array_change_key_case( (array)$atts, CASE_LOWER );\n\n\t$output = '<div class=\"iframe-video-wrapper\">' . $content . '</div>';\n\treturn $output;\n}",
"public static function traceShow()\n {\n return self::debugger(func_get_args(), 2, array(\"tag\" => \"div\"));\n }",
"function flashObjectTags($movie, $id, $width, $height, $bgcolor, $flashvars) {\r\n\r\n $id = array_pop(explode(\"/\",$movie));\r\n\r\n // The order in which we supply the parameters (stupidly) can affect the way the movie is displayed\r\n // We want scale = noscale, stage alignment (salign) = left and top (LT)\r\n //\r\n // Mac browsers that aren`t Mozilla, and Netscape 7 prefer scale first, then alignment\r\n // Mozilla on Mac and Non-IE PC browsers (other than Netscape 7) prefer alignment first, then scale\r\n // IE on PC does not seem to care\r\n //\r\n // So we detect the browser string for the `Mac` bit and echo the parameters accordingly\r\n //\r\n // If any problems are reported, saying the games are displayed in the window off-centre, try finding out which\r\n // order it is being viewed in the browser, and try the other way\r\n\r\n\t$userAgent = $_SERVER['HTTP_USER_AGENT'];\r\n\r\n\t// $isMac is true if we are using MSIE or Safari (but NOT Mozilla) for Mac\r\n\r\n\t// the user agent contains `Mac`, and either\r\n // 1. It does not contain the word `Gecko` (which makes it IE), or\r\n // 2. If it does contain `Gecko` then it must also say `Safari` (which makes it Safari)\r\n\r\n $isMac = strpos($userAgent, \"Mac\") !== false &&\r\n (strpos($userAgent,\"Gecko\") === false ||\r\n strpos($userAgent,\"Safari\") !== false);\r\n\r\n // $isNetscape7 is true if we are using NS7 on the PC\r\n\r\n $isNetscape7 = strpos($userAgent, \"Netscape/7\") !== false;\r\n $isFirefox = strpos($userAgent, \"Firefox\") !== false;\r\n\r\n\techo \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\\\" width=\\\"$width\\\" height=\\\"$height\\\" id=\\\"$id\\\">\\n\\n\";\r\n\r\n\techo \"<param name=\\\"movie\\\" value=\\\"$movie.swf\\\" />\\n\";\r\n\techo \"<param name=\\\"menu\\\" value=\\\"false\\\" />\\n\";\r\n\techo \"<param name=\\\"quality\\\" value=\\\"high\\\" />\\n\";\r\n\techo \"<param name=\\\"bgcolor\\\" value=\\\"$bgcolor\\\" />\\n\";\r\n\r\n/*\r\n\techo \"<param name=\\\"scale\\\" value=\\\"noscale\\\" />\\n\";\r\n\techo \"<param name=\\\"salign\\\" value=\\\"LT\\\" />\\n\";\r\n*/\r\n\r\n\techo \"<param name=\\\"flashvars\\\" value=\\\"$flashvars\\\" />\\n\\n\";\r\n\r\n\techo \"<embed src=\\\"$movie.swf\\\" quality=\\\"high\\\" menu=\\\"false\\\" bgcolor=\\\"$bgcolor\\\" width=\\\"$width\\\" height=\\\"$height\\\"\\n\";\r\n\r\n//\techo \"scale=\\\"noscale\\\" salign=\\\"LT\\\" \";\r\n\r\n\techo \"type=\\\"application/x-shockwave-flash\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\"\\n\";\r\n\techo \"flashvars=\\\"$flashvars\\\">\\n\";\r\n\r\n\techo \"</embed></object>\";\r\n\r\n\techo \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">\\n\";\r\n\r\n\techo \"window.$id.focus(); \\n\";\r\n\r\n\techo \"</script>\";\r\n\r\n}",
"public static function lookupId3v2FrameName($frameName)\n {\n return call_user_func(array(static::includeModule('tag', 'id3v2'), 'FrameNameShortLookup'), $frameName);\n }",
"function addFrame($attribs=array()){\n\t\t$this->childs[]=new we_baseElement(\"frame\",false,$attribs);\t\t\n\t}",
"function echoTag ($id,$tag,$highlight,$text,$markObjects)\r{\r\t\r\techo \"<span id=$id>\";\r\tif ($markObjects) {\r\t\tif ($tag == 'EVENT') { echo \"<span class=event>\"; } \r\t\telseif ($tag == 'TIMEX3') { echo \"<span class=timex>\"; } \r\t\telse { echo \" <span class=signal>\"; }\r\t}\r\tif ($highlight) { echo '<strong>'; }\r\tif ($id{0} == 'e') { $tagtype = 'event'; }\r\telseif ($id{0} == 't') { $tagtype = 'timex'; }\r\telseif ($id{0} == 's') { $tagtype = 'signal'; }\r\techo \"<span style=\\\"cursor:crosshair\\\" onClick=\\\"MM_goToURL('parent','displayTag.php?tagtype=$tagtype&text=$text')\\\">\";\r\techo $text;\r\techo \"</span>\";\r\tif ($highlight) { echo '</strong>'; }\r\tif ($markObjects) {\r\t\techo '</span><sub>'.$id.'</sub>';\r\t}\r\techo \"</span>\";\r}",
"public function shortcode_display($atts, $contet = '', $tag){\n\t\t\n\t\t$html = '';\n\t\t//our main upcoming preview shortcode\n\t\tif($tag == 'upcoming_post_preview'){\n\t\t\t\t\n\t\t\t//define default arguments\n\t\t\t$arguments = shortcode_atts(array(\n\t\t\t\t'number_of_previews'\t=> 1,\n\t\t\t\t'post_id'\t\t\t\t=> false\n\t\t\t\t), $atts, $tag);\n\t\t\t\t\n\t\t\t//build output\n\t\t\t$html .= $this->get_upcoming_post_preview($arguments);\n\t\t}\n\t\t\n\t\treturn $html;\n\t}",
"function begin_frame ($caption=\"\", $center=false, $padding=10)\r\n{\r\n $tdextra = \"\";\r\n\r\n if ($caption)\r\n {\r\n print(\"<h2>$caption</h2>\");\r\n }\r\n\r\n if ($center)\r\n {\r\n $tdextra .= \" align='center'\";\r\n }\r\n\r\n print(\"<table border='1' width='100%' cellspacing='0' cellpadding='$padding'><tr><td $tdextra>\\n\");\r\n}",
"function cmail_contact_frame($attrib)\n {\n global $OUTPUT;\n\n if (!$attrib['id'])\n $attrib['id'] = 'rcmcontactframe';\n \n $attrib['name'] = $attrib['id'];\n\n $OUTPUT->set_env('contentframe', $attrib['name']);\n $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif');\n\n return html::iframe($attrib);\n }",
"function shortcode_imageframe( $atts, $content = null ) {\n\t\t$variables = array( 'src'=>'', 'link'=>'#', 'alt'=>'imageframe-image', 'title'=>'', 'hover' => '', 'class' => '', 'width' => '', 'height' => '', 'label' => '', 'label_content' => '', 'position' => '', 'animation_type'=>'', 'animation_duration'=>'', 'animation_delay'=>'' ); // hover values = (hover-effect|hover-effect yellow|opacity)\n\t\textract( shortcode_atts( $variables, $atts ) );\n\t\t$class = empty( $class )?'':( ' class=\"' . esc_attr( $class ) . '\"' );\n\t\t$a_class = ( empty( $hover ) || ( $hover == 'opacity' ) )?'':( ' class=\"' . esc_attr( $hover ) . '\"' );\n\t\t$label = empty( $label )?'':( '<h3 class=\"caption-title\">' . esc_html( $label ) . '</h3>' );\n\t\t$label_content = empty( $label_content )?'':( '<span>' . esc_html( $label_content ) . '</span>' );\n\t\t$label_content = $label . $label_content;\n\t\t$width = empty( $width )?'':( ' width=\"' . esc_attr( $width ) . '\"' );\n\t\t$height = empty( $height )?'':( ' height=\"' . esc_attr( $height ) . '\"' );\n\t\t$img_class = '';\n\t\t$figure_class = ( $position != 'middle' )?'':( ' class=\"middle-block\"' );\n\t\t$alt = empty( $alt )?'':' alt=\"' . esc_attr( $alt ) . '\"';\n\t\t$animation = '';\n\t\tif ( ! empty( $animation_type ) ) {\n\t\t\t$img_class = ( $position != 'middle' )?' class=\"animated\"':( ' class=\"middle-item animated\"' );\n\t\t\t$animation .= ' data-animation-type=\"' . $animation_type . '\" data-animation-duration=\"' . $animation_duration . '\" data-animation-delay=\"' . $animation_delay . '\" ';\n\t\t} else {\n\t\t\t$img_class = ( $position != 'middle' )?'':( ' class=\"middle-item\"' );\n\t\t}\n\n\t\t$result = '';\n\t\t$result .= '<figure' . $figure_class . '>';\n\t\tif ( $link != \"no\" ) $result .= '<a href=\"' . esc_url( $link ) . '\" title=\"' . esc_attr( $title ) . '\"' . $a_class . '>';\n\t\t$result .= '<img src=\"' . esc_url( $src ) . '\"' . $alt . $width . $height . $img_class . $animation . ' />';\n\t\t$result .= do_shortcode( $content );\n\t\tif ( $hover == 'opacity' ) $result .= '<span class=\"opacity-wrapper\"></span>';\n\t\tif ( $link != \"no\" ) $result .= '</a>';\n\t\tif ( ! empty( $label_content ) ) $result .= '<figcaption>' . $label_content . '</figcaption>';\n\t\t$result .= '</figure>';\n\t\treturn $result;\n\t}",
"function pavi_shortcode_video($atts = array()){\n \n return pavi_get_display_video($atts);\n}",
"public function getFrameNumber() {}",
"public function getframe($frameID)\n {\n\n $frame = $this->sitemodel->getSingleFrame($frameID);\n if (!$frame) {\n return FALSE;\n }\n $frameContent = $frame->frames_content;\n if (!stristr($frameContent, '<link href=\"' . base_url('elements'))) {\n $frameContent = str_replace('<link href=\"', '<link href=\"' . base_url('elements') . '/', $frameContent);\n }\n if (stristr($frameContent, '<link href=\"' . base_url('elements') . '/https://')) {\n $frameContent = str_replace('<link href=\"' . base_url('elements') . '/https://', '<link href=\"https://', $frameContent);\n }\n if (!stristr($frameContent, '<script src=\"js' . base_url('elements'))) {\n $frameContent = str_replace('<script src=\"js', '<script src=\"' . base_url('elements') . '/js', $frameContent);\n }\n if (!stristr($frameContent, 'src=\"' . base_url('elements') . '/images')) {\n $frameContent = str_replace('src=\"images', 'src=\"' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'url(images')) {\n $frameContent = str_replace('url(images', 'url(' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'src=\"./images')) {\n $frameContent = str_replace('src=\"./images', 'src=\"' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'src=\"images')) {\n $frameContent = str_replace('src=\"images', 'src=\"' . base_url('elements') . '/images', $frameContent);\n }\n if (stristr($frameContent, 'href=\"./images')) {\n $frameContent = str_replace('href=\"./images', 'href=\"' . base_url('elements') . '/images', $frameContent);\n }\n echo $frameContent;\n }",
"function info( $args, $assoc_args ) {\n\t\t$video = new MBInfoVideo();\n\t\t$content = $args[0];\n\t\t$html = $video->parse_short_code($assoc_args, $content);\n\t\techo $html;\n\t}",
"function showIMG($url,\t$w=90,\t$h=90){\r\n\t$img = '';\r\n\t$extimg =\"jpg,jpe,peg,fif,png,gif,bmp\";\r\n\tif(stristr($extimg,\tsubstr($url,-3,3))){\r\n\t\t$h\t =\tempty($h) ? \"\" : ' height=\"'.$h.'\"';\r\n\t\t$w\t =\tempty($w) ? \"\" : ' width=\"'.$w.'\"';\r\n\t\t$img = \t'<img src=\"'.$url.'\" '.$w. $h .' border=\"0\" />';\r\n\t}\r\n\t\r\n\t$extvideo=\"swf,wmv,wav\";\r\n\tif(stristr($extvideo, substr($url,-3,3))){\r\n\t\t$img ='<embed name=\"flash\" src=\"'.$url.'\" quality=\"high\" bgcolor=\"#96BCE3\" z-index=\"0\" '\r\n\t\t.'wmode=\"transparent\" width=\"'.$w.'\" height=\"'.$h.'\" type=\"application/x-shockwave-'\r\n\t\t.'flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?'\r\n\t\t.'P1_Prod_Version=ShockwaveFlash\"></embed>';\r\n\t}\r\n\t//file flash movie\r\n\tif(substr($url,-3,3)==\"flv\"){\r\n\t\t$img='<embed src=\"flvplayer.swf\" z-index=\"0\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" flashvars=\"file='.base_url_site().'/'\r\n\t\t. $url.'&image=images/waitting.gif;location=flvplayer.swf&autostart=false\" '\r\n\t\t.'allowfullscreen=\"true\" height=\"'.$h.'\" width=\"'.$w.'\"></embed>';\t\t\r\n\t}\r\n\treturn $img;\r\n}",
"public function getFrame($framenumber) {}",
"function print_debug($content, $tag) {\n $output = '<span style=\"display:none\" id=\"';\n $output .= $tag;\n $output .= '\">';\n print_r($output);\n print_r($content);\n print_r('</span>');\n}",
"function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}",
"function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}",
"function iframe_header($title = '', $deprecated = \\false)\n {\n }",
"function shortcodes_xh_version()\n{\n global $pth;\n\n return '<h1>Shortcodes_xh</h1>'.\"\\n\"\n\t. tag('img src=\"'.$pth['folder']['plugins'].'shortcodes_xh/help/ShortCode_XH.png\" style=\"float: left; margin: 0 20px 20px 0\"')\n\t. '<p>This plugin is to use the familiar <a href=\"https://codex.wordpress.org/Shortcode_API\" target=\"_blank\">WordPress shortcode syntax</a> in CMSimple_XH.</p>'\n\t. '<p>Version: '.SHORTCODES_XH_VERSION.'</p>'.\"\\n\"\n\t. '<p>Copyright © 2015 <a href=\"http://cmsimple-jp.org\" target=\"_blank\">cmsimple-jp.org</a></p>'.\"\\n\"\n\t. '<p>Original <a href=\"https://github.com/Badcow/Shortcodes\" target=\"_blank\">Badcow/Shortcodes Latest commit 5 Apr 2015</a></p>'\n\t. '<p style=\"text-align: justify\">'\n\t. '<b>License</b>'. tag('br') . \"\\n\"\n\t. ' Art License Terms : <a href=\"http://creativecommons.org/licenses/by-sa/4.0/\" target=\"_blank\">Creative Commons License </a> . Detail <a href=\"https://github.com/Badcow/Shortcodes\" target=\"_blank\">https://github.com/Badcow/Shortcodes</a>'. tag('br').\"\\n\"\n\t. ' Software License terms : <a href=\"http://www.gnu.org/licenses/\" target=\"_blank\">GPLv3.</a>';\n}",
"function single_tag_title($prefix = '', $display = \\true)\n {\n }",
"public function getFrameType(){\n return $this->frameType; \n }"
] |
[
"0.60265905",
"0.5841845",
"0.5597621",
"0.5529826",
"0.5463722",
"0.5375955",
"0.5304689",
"0.51552314",
"0.51498055",
"0.5108206",
"0.49462873",
"0.4934485",
"0.49334583",
"0.49089503",
"0.48925012",
"0.48869136",
"0.48784658",
"0.48705894",
"0.4870424",
"0.4836969",
"0.47851685",
"0.47685936",
"0.47185442",
"0.47114486",
"0.47027114",
"0.47027114",
"0.4690025",
"0.4687875",
"0.4648965",
"0.4648342"
] |
0.85471505
|
0
|
null packDefineShapeTag(integer ShapeID, string ShapeBounds, string SHAPEWITHSTYLE) returns an SWF DefineShapeTag string. TagID: 2
|
function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)
{
array_push($this->FMDebug, "packDefineShapeTag");
$TagID = 2;
$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;
$TagLength = strlen($DefineShapeTag);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function shape(): string\n\t{\n\t\treturn \"Rectangle\";\n\t}",
"function getShape() { return $this->_shape; }",
"function getShape() { return $this->_shape; }",
"public function getShape1()\n {\n }",
"public function getShape2()\n {\n }",
"function swf_shapefillbitmapclip($bitmapid)\n{\n}",
"function packSHAPEWITHSTYLE($FillStyles, $LineStyles, $NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPEWITHSTYLE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPEWITHSTYLE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $FillStyles;\n\t\t$atom .= $LineStyles;\n\n\t\t$NumFillBits = $this->packnBits($NumFillBits, 4);\n\t\t$NumLineBits = $this->packnBits($NumLineBits, 4);\n\n\t\t$atom .= $this->packBitValues($NumFillBits . $NumLineBits);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"public function getShapeId()\n {\n return $this->shape_id;\n }",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packSHAPE($NumFillBits, $NumLineBits, $ShapeRecords)\n\t{\n\t\tarray_push($this->FMDebug, \"packSHAPE\");\n\n\t\t$lower_limit = 0;\n\t\t$upper_limit = 15;\n\n\t\tif (($NumFillBits < $lower_limit) or ($NumFillBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumFillBits) out of range\");\n\t\t}\n\n\t\tif (($NumLineBits < $lower_limit) or ($NumLineBits > $upper_limit)) {\n\t\t\t$this->FMError(\"packSHAPE argument (NumLineBits) out of range\");\n\t\t}\n\n\t\t$atom = $this->packnBits($NumFillBits, 4);\n\t\t$atom .= $this->packnBits($NumLineBits, 4);\n\n\t\t$atom = $this->packBitValues($atom);\n\t\t$atom .= $ShapeRecords;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function format(ShapeInterface $shape);",
"public function shape(int $id): OptionalInterface\n {\n return $this->tags()->filter(function ($item) use($id) { return $item['shapeId'] == $id; })->first();\n }",
"protected function addSvgContent(IdmlSvgShape $element, $tagName, $depth=0)\n {\n $attribs = $element->attribs;\n\n $attribs['style'] = $this->getStyleAttrib($element);\n\n if ($tagName != 'line')\n {\n $attribs['style'] .= $this->getSvgTransformationCSS($element, $tagName);\n }\n\n // Get the fill and stroke information, which is a different syntax than other HTML elements\n $svgStyleMgr = new IdmlSvgStyleManager();\n $attribs['style'] .= $svgStyleMgr->convertSvgStyles($element);\n\n // Set up and insert the polygon tag\n $strAttr = $this->getHTMLAttributesString($element, $attribs);\n $html = '<' . $tagName . ' ' . $strAttr . ' />';\n $this->addPageElement($html, $depth);\n\n $this->closeSvgElement($element, $depth);\n }",
"function setShape($a_shape)\n\t{\n\t\t$this->shape = $a_shape;\n\t}",
"function wp_migrate_old_typography_shape($metadata)\n {\n }",
"public function shape($value) {\n return $this->setProperty('shape', $value);\n }",
"function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"protected function putShapeSaveAsRequest(Requests\\PutShapeSaveAsRequest $request)\n {\n // verify the required parameter 'name' is set\n if ($request->name === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $name when calling putShapeSaveAs');\n }\n // verify the required parameter 'slide_index' is set\n if ($request->slideIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $slideIndex when calling putShapeSaveAs');\n }\n // verify the required parameter 'shape_index' is set\n if ($request->shapeIndex === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $shapeIndex when calling putShapeSaveAs');\n }\n // verify the required parameter 'format' is set\n if ($request->format === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $format when calling putShapeSaveAs');\n }\n // verify the required parameter 'out_path' is set\n if ($request->outPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $outPath when calling putShapeSaveAs');\n }\n\n $resourcePath = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/{format}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->outPath !== null) {\n $queryParams['outPath'] = ObjectSerializer::toQueryValue($request->outPath);\n }\n // query params\n if ($request->password !== null) {\n $queryParams['password'] = ObjectSerializer::toQueryValue($request->password);\n }\n // query params\n if ($request->folder !== null) {\n $queryParams['folder'] = ObjectSerializer::toQueryValue($request->folder);\n }\n // query params\n if ($request->storage !== null) {\n $queryParams['storage'] = ObjectSerializer::toQueryValue($request->storage);\n }\n // query params\n if ($request->scaleX !== null) {\n $queryParams['scaleX'] = ObjectSerializer::toQueryValue($request->scaleX);\n }\n // query params\n if ($request->scaleY !== null) {\n $queryParams['scaleY'] = ObjectSerializer::toQueryValue($request->scaleY);\n }\n // query params\n if ($request->bounds !== null) {\n $queryParams['bounds'] = ObjectSerializer::toQueryValue($request->bounds);\n }\n // query params\n if ($request->fontsFolder !== null) {\n $queryParams['fontsFolder'] = ObjectSerializer::toQueryValue($request->fontsFolder);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"name\", $request->name);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"slideIndex\", $request->slideIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"shapeIndex\", $request->shapeIndex);\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"format\", $request->format);\n $_tempBody = null;\n if (isset($request->options)) {\n $_tempBody = $request->options;\n }\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n }\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'PUT');\n }",
"public function newFeatureFlagCreateStruct(): CreateStruct;",
"public function wktGenerateGeometry();",
"public static function identicon($_hash,$_size=NULL) {\n\t\t$_blox=F3::$global['IBLOCKS'];\n\t\tif (is_null($_size))\n\t\t\t$_size=F3::$global['IPIXELS'];\n\t\t// Rotatable shapes\n\t\t$_dynamic=array(\n\t\t\tarray(.5,1,1,0,1,1),\n\t\t\tarray(.5,0,1,0,.5,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.5),\n\t\t\tarray(0,.5,.5,0,1,.5,.5,1,.5,.5),\n\t\t\tarray(0,.5,1,0,1,1,0,1,1,.5),\n\t\t\tarray(1,0,1,1,.5,1,1,.5,.5,.5),\n\t\t\tarray(0,0,1,0,1,.5,0,0,.5,1,0,1),\n\t\t\tarray(0,0,.5,0,1,.5,.5,1,0,1,.5,.5),\n\t\t\tarray(.5,0,.5,.5,1,.5,1,1,.5,1,.5,.5,0,.5),\n\t\t\tarray(0,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,.5,.5,1,1,.5,.5,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,0,1,1,.5,1,1,.75,.5,.5,1,.25),\n\t\t\tarray(0,.5,.5,0,.5,.5,1,0,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,1,1,0,1,1,.5,.5,.25,.5,.75,0,.5,.5,.25),\n\t\t\tarray(0,.5,.5,.5,.5,0,1,0,.5,.5,1,.5,.5,1,.5,.5,0,1),\n\t\t\tarray(0,0,1,0,.5,.5,.5,0,0,.5,1,.5,.5,1,.5,.5,0,1)\n\t\t);\n\t\t// Fixed shapes (for center sprite)\n\t\t$_static=array(\n\t\t\tarray(),\n\t\t\tarray(0,0,1,0,1,1,0,1),\n\t\t\tarray(.5,0,1,.5,.5,1,0,.5),\n\t\t\tarray(0,0,1,0,1,1,0,1,0,.5,.5,1,1,.5,.5,0,0,.5),\n\t\t\tarray(.25,0,.75,0,.5,.5,1,.25,1,.75,.5,.5,\n\t\t\t\t.75,1,.25,1,.5,.5,0,.75,0,.25,.5,.5),\n\t\t\tarray(0,0,.5,.25,1,0,.75,.5,1,1,.5,.75,0,1,.25,.5),\n\t\t\tarray(.33,.33,.67,.33,.67,.67,.33,.67),\n\t\t\tarray(0,0,.33,0,.33,.33,.67,.33,.67,0,1,0,1,.33,.67,.33,\n\t\t\t\t.67,.67,1,.67,1,1,.67,1,.67,.67,.33,.67,.33,1,0,1,\n\t\t\t\t0,.67,.33,.67,.33,.33,0,.33)\n\t\t);\n\t\t// Parse MD5 hash\n\t\t$_hash=F3::resolve($_hash);\n\t\tlist($_bgR,$_bgG,$_bgB)=self::rgb(F3::$global['BGCOLOR']);\n\t\tlist($_fgR,$_fgG,$_fgB)=self::rgb(substr($_hash,0,6));\n\t\t$_shapeC=hexdec($_hash[6]);\n\t\t$_angleC=hexdec($_hash[7]%4);\n\t\t$_shapeX=hexdec($_hash[8]);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_shapeS[$_i]=hexdec($_hash[9+$_i*2]);\n\t\t\t$_angleS[$_i]=hexdec($_hash[10+$_i*2]%4);\n\t\t}\n\t\t// Start with NxN blank slate\n\t\t$_identicon=imagecreatetruecolor($_size*$_blox,$_size*$_blox);\n\t\timageantialias($_identicon,TRUE);\n\t\t$_bg=imagecolorallocate($_identicon,$_bgR,$_bgG,$_bgB);\n\t\t$_fg=imagecolorallocate($_identicon,$_fgR,$_fgG,$_fgB);\n\t\t// Generate corner sprites\n\t\t$_corner=imagecreatetruecolor($_size,$_size);\n\t\timagefill($_corner,0,0,$_bg);\n\t\t$_sprite=$_dynamic[$_shapeC];\n\t\tfor ($_i=0,$_len=count($_sprite);$_i<$_len;$_i++)\n\t\t\t$_sprite[$_i]=$_sprite[$_i]*$_size;\n\t\timagefilledpolygon($_corner,$_sprite,$_len/2,$_fg);\n\t\tfor ($_i=0;$_i<$_angleC;$_i++)\n\t\t\t$_corner=imagerotate($_corner,90,$_bg);\n\t\t// Generate side sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_side[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_side[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeS[$_i]];\n\t\t\tfor ($_j=0,$_len=count($_sprite);$_j<$_len;$_j++)\n\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\timagefilledpolygon($_side[$_i],$_sprite,$_len/2,$_fg);\n\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t$_side[$_i]=imagerotate($_side[$_i],90,$_bg);\n\t\t}\n\t\t// Generate center sprites\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\t$_center[$_i]=imagecreatetruecolor($_size,$_size);\n\t\t\timagefill($_center[$_i],0,0,$_bg);\n\t\t\t$_sprite=$_dynamic[$_shapeX];\n\t\t\tif ($_blox%2>0 && $_i==$_blox-3)\n\t\t\t\t// Odd center sprites\n\t\t\t\t$_sprite=$_static[$_shapeX%8];\n\t\t\t$_len=count($_sprite);\n\t\t\tif ($_len) {\n\t\t\t\tfor ($_j=0;$_j<$_len;$_j++)\n\t\t\t\t\t$_sprite[$_j]=$_sprite[$_j]*$_size;\n\t\t\t\timagefilledpolygon($_center[$_i],$_sprite,$_len/2,$_fg);\n\t\t\t}\n\t\t\tif ($_i<($_blox-3))\n\t\t\t\tfor ($_j=0;$_j<$_angleS[$_i];$_j++)\n\t\t\t\t\t$_center[$_i]=imagerotate($_center[$_i],90,$_bg);\n\t\t}\n\t\t// Paste sprites\n\t\tfor ($_i=0;$_i<4;$_i++) {\n\t\t\timagecopy($_identicon,$_corner,0,0,0,0,$_size,$_size);\n\t\t\tfor ($_j=0;$_j<$_blox-2;$_j++) {\n\t\t\t\timagecopy($_identicon,$_side[$_j],\n\t\t\t\t\t$_size*($_j+1),0,0,0,$_size,$_size);\n\t\t\t\tfor ($_k=$_j;$_k<$_blox-3-$_j;$_k++)\n\t\t\t\t\timagecopy($_identicon,$_center[$_k],\n\t\t\t\t\t\t$_size*($_k+1),$_size*($_j+1),0,0,$_size,$_size);\n\t\t\t}\n\t\t\t$_identicon=imagerotate($_identicon,90,$_bg);\n\t\t}\n\t\tif ($_blox%2>0)\n\t\t\t// Paste odd center sprite\n\t\t\timagecopy($_identicon,$_center[$_blox-3],\n\t\t\t\t$_size*(floor($_blox/2)),$_size*(floor($_blox/2)),0,0,\n\t\t\t\t$_size,$_size);\n\t\t// Resize\n\t\t$_resized=imagecreatetruecolor($_size,$_size);\n\t\timagecopyresampled($_resized,$_identicon,0,0,0,0,$_size,$_size,\n\t\t\t$_size*$_blox,$_size*$_blox);\n\t\t// Make the background transparent\n\t\timagecolortransparent($_resized,$_bg);\n\t\tif (PHP_SAPI!='cli' && !headers_sent())\n\t\t\theader(F3::HTTP_Content.': image/png');\n\t\timagepng($_resized,NULL,self::PNG_Compress,PNG_NO_FILTER);\n\t\t// Free resources\n\t\timagedestroy($_identicon);\n\t\timagedestroy($_resized);\n\t\timagedestroy($_corner);\n\t\tfor ($_i=0;$_i<$_blox-2;$_i++) {\n\t\t\timagedestroy($_side[$_i]);\n\t\t\timagedestroy($_center[$_i]);\n\t\t}\n\t}",
"private function _loadShapes()\n {\n //shaded relief\n $this->shapes['relief'] = array(\n 'shape' => $this->shape_path . \"/HYP_HR_SR_OB_DR/HYP_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n // Geotiff created by David P. Shorthouse using above file.\n $this->shapes['reliefgrey'] = array(\n 'shape' => $this->shape_path . \"/GRAY_HR_SR_OB_DR/GRAY_HR_SR_OB_DR.tif\",\n 'type' => MS_LAYER_RASTER,\n 'encoding' => \"UTF-8\",\n 'sort' => 1\n );\n\n //lakes outline\n $this->shapes['lakesOutline'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 2\n );\n\n //lakes\n $this->shapes['lakes'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //oceans\n $this->shapes['oceans'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_ocean\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //conservation\n $this->shapes['conservation'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //ecoregions\n $this->shapes['ecoregions'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 3\n );\n\n //base map\n $this->shapes['base'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_land\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //base map\n $this->shapes['countries'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 4\n );\n\n //stateprovinces_polygon\n $this->shapes['stateprovinces_polygon'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 5\n );\n\n //stateprovinces\n $this->shapes['stateprovinces'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces_lines_shp\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 6\n );\n\n //lake names\n $this->shapes['lakenames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_lakes\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 7\n );\n\n //rivers\n $this->shapes['rivers'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 8\n );\n\n //rivers\n $this->shapes['rivernames'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_rivers_lake_centerlines\",\n 'type' => MS_LAYER_LINE,\n 'encoding' => \"CP1252\",\n 'sort' => 9\n );\n\n //placename\n $this->shapes['placenames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_populated_places_simple\",\n 'type' => MS_LAYER_POINT,\n 'encoding' => \"CP1252\",\n 'sort' => 10\n );\n\n //State/Provincial labels\n $this->shapes['stateprovnames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_1_states_provinces\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 11\n );\n\n //Country labels\n $this->shapes['countrynames'] = array(\n 'shape' => $this->shape_path . \"/10m_cultural/10m_cultural/ne_10m_admin_0_map_units\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 12\n );\n\n //physicalLabels\n $this->shapes['physicalLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_regions_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 13\n );\n\n //marineLabels\n $this->shapes['marineLabels'] = array(\n 'shape' => $this->shape_path . \"/10m_physical/ne_10m_geography_marine_polys\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n //hotspotLabels\n $this->shapes['hotspotLabels'] = array(\n 'shape' => $this->shape_path . \"/conservation_international/hotspots_2011_polygons\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"UTF-8\",\n 'sort' => 14\n );\n\n //ecoregions\n $this->shapes['ecoregionLabels'] = array(\n 'shape' => $this->shape_path . \"/wwf_terr_ecos/wwf_terr_ecos\",\n 'type' => MS_LAYER_POLYGON,\n 'encoding' => \"CP1252\",\n 'sort' => 14\n );\n\n }"
] |
[
"0.80861247",
"0.75327116",
"0.7478791",
"0.55284053",
"0.5521733",
"0.5478506",
"0.54683393",
"0.54122144",
"0.533564",
"0.52448165",
"0.5169032",
"0.5159855",
"0.5091816",
"0.5070557",
"0.50339454",
"0.49965882",
"0.49951172",
"0.49697185",
"0.49162316",
"0.48604488",
"0.48142937",
"0.47414443",
"0.47031245",
"0.4698927",
"0.46871677",
"0.4680884",
"0.4668494",
"0.4659803",
"0.4659174",
"0.455811"
] |
0.81988907
|
0
|
string packPlaceObjectTag(integer CharacterID, integer Depth, string MATRIX, string CXFORM) return an SWF PlaceObject tag string. TagID: 4
|
function packPlaceObjectTag($CharacterID, $Depth, $MATRIX, $CXFORM)
{
array_push($this->FMDebug, "packPlaceObjectTag");
$TagID = 4;
$CharacterID = $this->packUI16($CharacterID);
$Depth = $this->packUI16($Depth);
$TagLength = strlen($CharacterID . $Depth . $MATRIX . $CXFORM);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth . $MATRIX . $CXFORM;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packRemoveObjectTag($CharacterID, $Depth)\n\t{\n\t\tarray_push($this->FMDebug, \"packRemoveObjectTag\");\n#error_log($CharacterID);\n\t\t$TagID = 5;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16((int)$Depth);\n\n\t\t$TagLength = strlen($CharacterID . $Depth);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function _buildXMLstringLevel($object, $depth)\n\t{\n\t\t// Initialize variables\n\t\t$retval = '';\n\t\t$tab\t= '';\n\t\tfor($i=1;$i <= $depth; $i++) {\n\t\t\t$tab .= \"\\t\";\n\t\t}\n\n\t\tforeach (get_object_vars( $object ) as $key=>$item)\n\t\t{\n\t\t\tif (is_object($item))\n\t\t\t{\n\t\t\t\t$retval .= $tab.\"<group name=\\\"\".$key.\"\\\">\\n\";\n\t\t\t\t$retval .= $this->_buildXMLstringLevel($item, $depth+1);\n\t\t\t\t$retval .= $tab.\"</group>\\n\";\n\t\t\t} else {\n\t\t\t\t$retval .= $tab.\"<entry name=\\\"\".$key.\"\\\">\".$item.\"</entry>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}",
"function packRemoveObject2Tag($Depth)\n\t{\n\t\tarray_push($this->FMDebug, \"packRemoveObject2Tag\");\n\n\t\t$TagID = 28;\n\n\t\t$Depth = $this->packUI16($Depth);\n\n\t\t$TagLength = strlen($Depth);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Depth;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function _putformxobjects() {\n $filter=($this->compress) ? '/Filter /FlateDecode ' : '';\n\t reset($this->tpls);\n foreach($this->tpls AS $tplidx => $tpl) {\n\n $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer'];\n \t\t$this->_newobj();\n \t\t$this->tpls[$tplidx]['n'] = $this->n;\n \t\t$this->_out('<<'.$filter.'/Type /XObject');\n $this->_out('/Subtype /Form');\n $this->_out('/FormType 1');\n $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]',\n // llx\n $tpl['x'] * $this->k,\n // lly\n -$tpl['y'] * $this->k,\n // urx\n ($tpl['w'] + $tpl['x']) * $this->k,\n // ury\n ($tpl['h'] - $tpl['y']) * $this->k\n ));\n \n if ($tpl['x'] != 0 || $tpl['y'] != 0) {\n $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]',\n -$tpl['x'] * $this->k * 2, $tpl['y'] * $this->k * 2\n ));\n }\n \n $this->_out('/Resources ');\n\n $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');\n \tif (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) {\n \t$this->_out('/Font <<');\n foreach($this->_res['tpl'][$tplidx]['fonts'] as $font)\n \t\t$this->_out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R');\n \t$this->_out('>>');\n }\n \tif(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || \n \t isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls']))\n \t{\n $this->_out('/XObject <<');\n if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) {\n foreach($this->_res['tpl'][$tplidx]['images'] as $image)\n \t\t\t$this->_out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R');\n }\n if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) {\n foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl)\n $this->_out($this->tplprefix . $i . ' ' . $tpl['n'] . ' 0 R');\n }\n $this->_out('>>');\n \t}\n \t$this->_out('>>');\n \t\n \t$this->_out('/Length ' . strlen($p) . ' >>');\n \t\t$this->_putstream($p);\n \t\t$this->_out('endobj');\n }\n }",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"abstract protected function getObjectTag();",
"function packENDSHAPERECORD()\n\t{\n\t\tarray_push($this->FMDebug, \"packENDSHAPERECORD\");\n\n\t\t$TypeFlag = \"0\";\n\t\t$EndOfShape = \"00000\";\n\n\t\t$atom = $TypeFlag . $EndOfShape;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packASSET($Tag, $Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packASSET\");\n\n\t\t$atom = $this->packUI16($Tag);\n\t\t$atom .= $this->packSTRING($Label);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function forgeObject()\n {\n // Check if we have an object creation array.\n if ($this->provider && isset($this->provider['render']['object'])) {\n // Start object tag.\n $object = '<object';\n\n foreach ($this->provider['render']['object']['attributes'] as $attribute => $val) {\n $object .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n $object .= '>';\n\n // Create params.\n if ( isset($this->provider['render']['object']['params']) ) {\n foreach ($this->provider['render']['object']['params'] as $param => $val) {\n $object .= sprintf('<param name=\"%s\" value=\"%s\"></param>', $param, $val);\n }\n }\n\n // Create embed.\n if ( isset($this->provider['render']['object']['embed']) ) {\n $object .= '<embed';\n // embed can have same attributes as object itself (height, width etc)\n foreach ($this->provider['render']['object']['embed'] as $attribute => $val) {\n $val = ( is_bool($val) && $val ? ($val ? 'true' : 'false') : $val );\n $object .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n $object .= '></embed>';\n }\n\n // Close object tag.\n $object .= '</object>';\n\n $object .= $this->forgeScript();\n\n return $object;\n }\n }",
"public function tagAs($objid, $tag);",
"function _encode_v1() {\n if ($this->debug) print($this->debugbeg . \"_encode_v1()<HR>\\n\");\n\n if ($this->track) {\n // ID3 v1.1\n $id3pack = 'a3a30a30a30a4a28x1C1C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->track,\n $this->genreno\n );\n } else {\n // ID3 v1\n $id3pack = 'a3a30a30a30a4a30C1';\n $newtag = pack($id3pack,\n 'TAG',\n $this->name,\n $this->artists,\n $this->album,\n $this->year,\n $this->comment,\n $this->genreno\n );\n }\n\n if ($this->debug) {\n print('id3pack: ' . $id3pack . \"\\n\");\n $unp = unpack('H*new', $newtag);\n print_r($unp);\n }\n\n if ($this->debug) print($this->debugend);\n return $newtag;\n }",
"function _get_preview_environment_comcode($tag)\n{\n\t$actual_tag=$tag;\n\tif ($tag=='attachment_safe') $tag='attachment';\n\n\t$comcode='';\n\tlist($tag_list,$custom_tag_list)=_get_details_comcode_tags();\n\n\tif (array_key_exists($tag,$tag_list))\n\t{\n\t\t$parameters=$tag_list[$tag];\n\t} else\n\t{\n\t\t$_params=$custom_tag_list[$tag];\n\t\t$parameters=explode(',',preg_replace('#=[^,]*#','',$_params['tag_parameters']));\n\t}\n\n\tif (in_array('param',$parameters))\n\t{\n\t\t$_parameters=array('param');\n\t\tunset($parameters[array_search('param',$parameters)]);\n\t\t$parameters=array_merge($_parameters,$parameters);\n\t}\n\t$bparameters='';\n\t$bparameters_xml='';\n\t$tag_contents=post_param('tag_contents','');\n\tif ($tag=='include')\n\t{\n\t\t$tag_contents=preg_replace('# .*$#','',$tag_contents);\n\t\t$_tag_contents=explode(':',$tag_contents,2);\n\t\t$bparameters=' param=\"'.str_replace('\"','\\\"',$_tag_contents[0]).'\"';\n\t\t$tag_contents=$_tag_contents[1];\n\t}\n\telseif ($tag=='concepts')\n\t{\n\t\t$i=0;\n\t\twhile (post_param('x_key_'.strval($i),'')!='')\n\t\t{\n\t\t\t$key=str_replace('\"','\\\"',post_param('x_key_'.strval($i)));\n\t\t\t$value=str_replace('\"','\\\"',post_param('x_value_'.strval($i)));\n\t\t\t$bparameters.=' '.strval($i+1).'_key=\"'.$key.'\"';\n\t\t\t$bparameters.=' '.strval($i+1).'_value=\"'.$value.'\"';\n\n\t\t\t$i++;\n\t\t}\n\t}\n\telseif ($tag=='jumping')\n\t{\n\t\t$i=0;\n\t\twhile (post_param('string_'.strval($i),'')!='')\n\t\t{\n\t\t\t$value=str_replace('\"','\\\"',post_param('string_'.strval($i)));\n\t\t\t$bparameters.=' '.strval($i).'=\"'.$value.'\"';\n\t\t\t$i++;\n\t\t}\n\t}\n\telseif ($tag=='shocker')\n\t{\n\t\t$i=0;\n\t\twhile(post_param('left_'.strval($i),'') != '')\n\t\t{\n\t\t\t$left=str_replace('\"','\\\"',post_param('left_'.strval($i)));\n\t\t\t$right=str_replace('\"','\\\"',post_param('right_'.strval($i),''));\n\t\t\t$bparameters.=' left_'.strval($i+1).'=\"'.$left.'\"';\n\t\t\t$bparameters.=' right_'.strval($i+1).'=\"'.$right.'\"';\n\n//\t\t\t\t$bparameters_xml.='<blockParam key=\"'.($i+1).'_value\" val=\"'.$value.'\" />';\n\t\t\t$i++;\n\t\t}\n\t\tif (post_param('min','') != '')\n\t\t\t$bparameters.=' min=\"'.str_replace('\"','\\\"',post_param('min')).'\"';\n\t\tif (post_param('max','') != '')\n\t\t\t$bparameters.=' max=\"'.str_replace('\"','\\\"',post_param('max')).'\"';\n\t}\n\telseif ($tag=='random')\n\t{\n\t\t$i=0;\n\t\t$last=0;\n\t\twhile (post_param('string_'.strval($i),'')!='')\n\t\t{\n\t\t\t$name=str_replace('\"','\\\"',post_param('X_'.strval($i),''));\n\t\t\tif ($name=='') $name=strval($last+1);\n\t\t\t$value=str_replace('\"','\\\"',post_param('string_'.strval($i)));\n\t\t\t$bparameters.=' '.$name.'=\"'.$value.'\"';\n\t\t\t$i++;\n\t\t\t$last=intval($name);\n\t\t}\n\t}\n\telseif ($tag=='sections')\n\t{\n\t\t$i=0;\n\t\t$default=post_param_integer('default',0);\n\t\t$comcode='[surround]';\n\t\t$controller=array();\n\t\twhile (post_param('tag_contents_'.strval($i),'')!='' && post_param('name_'.strval($i),'')!='')\n\t\t{\n\t\t\t$def='';\n\t\t\t$content=post_param('tag_contents_'.strval($i));\n\t\t\t$name=post_param('name_'.strval($i));\n\t\t\tif($default==($i+1))\n\t\t\t{\n\t\t\t\t$def=\" default=\\\"1\\\"\";\n\t\t\t}\n\t\t\t$comcode.=\"[section=\\\"$name\\\"$def]\".$content.\"[/section]\";\n\t\t\t$controller[]=$name;\n\t\t\t$bparameters.=\"<section=\\\"$name\\\"$def>\".$content.\"</section>\";\n\t\t\t$i++;\n\t\t}\n\t\t$comcode.=\"[section_controller]\".implode(\",\", $controller).\"[/section_controller]\";\n\t\t$bparameters.=\"<section_controller>\".implode(\",\", $controller).\"</section_controller>\";\n\t}\n\telseif ($tag=='big_tabs')\n\t{\n\t\t$i=0;\n\t\t$default=post_param_integer('default',0);\n\t\t$time=post_param_integer('switch_time', 6000);\n\t\t$comcode='';\n\t\t$controller=array();\n\t\twhile (post_param('tag_contents_'.strval($i),'')!='' && post_param('name_'.strval($i),'')!='')\n\t\t{\n\t\t\t$def='';\n\t\t\t$content=post_param('tag_contents_'.strval($i));\n\t\t\t$name=post_param('name_'.strval($i));\n\t\t\tif($default==($i+1))\n\t\t\t{\n\t\t\t\t$def=\" default=\\\"1\\\"\";\n\t\t\t}\n\t\t\t$comcode.=\"[big_tab=\\\"$name\\\"$def]\".$content.\"[/big_tab]\";\n\t\t\t$controller[]=$name;\n\t\t\t$bparameters.=\"<big_tab=\\\"$name\\\"$def>\".$content.\"</big_tab>\";\n\t\t\t$i++;\n\t\t}\n\t\t$comcode=\"[surround][big_tab_controller switch_time=\\\"$time\\\"]\".implode(\",\", $controller).\"[/big_tab_controller]\".$comcode.\"[/surround]\";\n\t\t$bparameters.=\"[surround]<big_tab_controller switch_time=\\\"$time\\\">\".implode(\",\", $controller).\"</big_tab_controller>[/surround]\";\n\t}\n\telseif ($tag=='tabs')\n\t{\n\t\t$i=0;\n\t\t$default=post_param_integer('default',0);\n\t\t$comcode='';\n\t\t$controller=array();\n\t\twhile (post_param('tag_contents_'.strval($i),'')!='' && post_param('name_'.strval($i),'')!='')\n\t\t{\n\t\t\t$def='';\n\t\t\t$content=post_param('tag_contents_'.strval($i));\n\t\t\t$name=post_param('name_'.strval($i));\n\t\t\tif($default==($i+1))\n\t\t\t{\n\t\t\t\t$def=\" default=\\\"1\\\"\";\n\t\t\t}\n\t\t\t$comcode.=\"[tab=\\\"$name\\\"$def]\".$content.\"[/tab]\";\n\t\t\t$controller[]=$name;\n\t\t\t$bparameters.=\"<tab=\\\"$name\\\"$def>\".$content.\"</tab>\";\n\t\t\t$i++;\n\t\t}\n\t\t$comcode=\"[tabs=\\\"\".implode(\",\", $controller).\"\\\"]\".$comcode.\"[/tabs]\";\n\t\t$bparameters=\"<tabs=\\\"\".implode(\",\", $controller).\"\\\">\".$bparameters.\"</tabs>\";\n\t}\n\telseif ($tag=='list')\n\t{\n\t\t$i=0;\n\t\t$defaults=post_param('default','normal');\n\t\t$comcode_arr=array();\n\t\t$xml='';\n\t\twhile (post_param('tag_contents_'.strval($i),'')!='')\n\t\t{\n\t\t\t$def='';\n\t\t\t$contents=post_param('tag_contents_'.strval($i));\n\t\t\t$comcode_arr[]=$contents;\n\t\t\t$xml.=\"<listElement>$contents</listElement>\";\n\t\t\t$i++;\n\t\t}\n\t\t$comcode=\"[list default=\\\"$defaults\\\"]\".implode(\"[*]\", $comcode_arr).\"[/list]\";\n\t\t$bparameters=\"<list default=\\\"$defaults\\\">$xml</list>\";\n\t}\n\telse\n\t{\n\t\tforeach ($parameters as $parameter)\n\t\t{\n\t\t\t$value=post_param($parameter,'');\n\n\t\t\tif (($tag=='attachment') && ($parameter=='thumb') && ($value==''))\n\t\t\t{\n\t\t\t\t$value='0';\n\t\t\t}\n\n\t\t\tif ($value!='')\n\t\t\t{\n\t\t\t\tif ($parameter=='param')\n\t\t\t\t{\n\t\t\t\t\t$bparameters.='=\"'.str_replace('\"','\\\"',$value).'\"';\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$bparameters.=' '.$parameter.'=\"'.str_replace('\"','\\\"',$value).'\"';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif($comcode=='')\n\t\t$comcode='['.$actual_tag.$bparameters.']'.$tag_contents.'[/'.$actual_tag.']';\n\n\treturn array($comcode,$bparameters);\n}",
"function objectToString( &$object, $params )\n\t{\n\t\t$depth = 1;\n\t\t$retval = \"<?xml version=\\\"1.0\\\" ?>\\n<config>\\n\";\n\t\tforeach (get_object_vars( $object ) as $key=>$item)\n\t\t{\n\t\t\tif (is_object($item))\n\t\t\t{\n\t\t\t\t$retval .= \"\\t<group name=\\\"\".$key.\"\\\">\\n\";\n\t\t\t\t$retval .= $this->_buildXMLstringLevel($item, $depth+1);\n\t\t\t\t$retval .= \"\\t</group>\\n\";\n\t\t\t} else {\n\t\t\t\t$retval .= \"\\t<entry name=\\\"\".$key.\"\\\">\".$item.\"</entry>\\n\";\n\t\t\t}\n\t\t}\n\t\t$retval .= '</config>';\n\t\treturn $retval;\n\t}",
"function create_placeobj($place, $hlink,$done=1) {\n\t\t$ePlaceObj = $this->dom->createElement(\"placeobj\");\n\t\t$ePlaceObj->setAttribute(\"handle\", $hlink);\n\t\t$ePlaceObj->setAttribute(\"id\", $hlink);\n\t\t$ePlaceObj->setAttribute(\"change\", time());\n\n\t\t$ePTitle = $this->dom->createElement(\"ptitle\");\n\t\t$ePTitle = $ePlaceObj->appendChild($ePTitle);\n\t\t$ePlaceObj = $this->ePlaces->appendChild($ePlaceObj);\n\t\t$ePlaceText = $this->dom->createTextNode($place);\n\t\t$ePTitle->appendChild($ePlaceText);\n\t\t$num = 1;\n\t\twhile (($namegSource = get_sub_record(1, \"1 OBJE\", $place, $num)) != null) {\n\t\t\t$this->create_mediaref($this->ePlaces, $namegSource, 1,$done);\n\t\t\t$num++;\n\t\t}\n\t}",
"function packStartSoundTag($CharacterID, $SOUNDINFO)\n\t{\n\t\tarray_push($this->FMDebug, \"packStartSoundTag\");\n\n\t\t$TagID = 15;\n\n\t\t$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;\n\n\t\t$TagLength = strlen($StartSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function parsePlaceInstruction($doc, $form, $body, $command) {\n\t\t$placeholder = $_POST[\"command\"];\n\n\t \t$div = $doc->createElement('div', $placeholder);\n\t \t$textEntry = $doc->createElement('p', $placeholder);\n\t \t// $div->appendChild($textEntry);\n\t \t$doc->appendChild($div);\n\t \t\n\t \t$instructionSet = new placementInstructions();\n\t \tif(strlen($command) < 5) {\n\t\t\techo \"string\";\n\t\t\t//Command too short \n\t\t\treturn;\n\t\t}\n\n\t\t$acceptedDirection = array('NORTH', 'SOUTH', 'EAST', 'WEST');\n\t\t\n\t\t$instructionSet = new placementInstructions();\n\t\t$commandArray = explode(\",\", $command);\n\t\t// echo count($commandArray);\n\n\t\tif(count($commandArray) < 2 || count($commandArray) > 3) {\n\t\t\t// At least 2 commas should be present in a command\n\t\t\treturn;\n\t\t}\n\n\t\tfor($i = 0; $i < count($commandArray); $i++) {\n\t\t\t$commandArray[$i] = str_replace(' ', '', $commandArray[$i]);\n\n\t\t\t// \"PLACE0\" split 1st coord from place\n\t\t\tif(strpos($commandArray[$i], 'PLACE') !== false) {\n\t\t\t\t$tempStr = $commandArray[$i];\n\t\t\t\t$tmpArray = explode(\"PLACE\", $commandArray[$i]);\n\t\t\t\t// $tempStr->str_replace('PLACE', '', $tempStr);\n\t\t\t\t// Put first coord in coord array.\n\t\t\t\tarray_unshift($instructionSet->coordinates, $tmpArray[1]);\n\t\t\t\t$instructionSet->place = true;\n\t\t\t} else if(in_array($commandArray[$i], $acceptedDirection)) {\n\t\t\t\t$instructionSet->facing = $commandArray[$i];\n\t\t\t\t//echo $facing;\n\t\t\t} else {\n\t\t\t\tarray_push($instructionSet->coordinates, $commandArray[$i]);\n\t\t\t}\n\t\t}\t\n\n\n\t\t//___________________PLACE, X, Y, F_________________\n\t\t// line needs to be comma separated\n\t\t// 4 elements ALWAYS\n\t\t// elements load in non-linearly so doesn't matter if its not the first element\n\t\t// HOwever, order in PLACE command itself must be rigidly followed\n\t\t//-------------------X & Y--------------------------\n\t\t// same line as PLACE\n\t\t// two numbers, single-digit\n\t\t// check if type is numbers\n\t\t// if(X > 0 && X < 5 ) && (Y > 0 && Y < 5 )\n\n\t\t//-------------------F------------------------------\n\t\t//Can only be string type\n\t\t//NORTH, SOUTH, EAST or WEST\n\t\t//Must be all-caps\n\t \t// $instructionSet = parseCommand($placeholder);\n\n\t \techo printStart($instructionSet);\n\t\t// $placeholder = $doc->getElementsByTagName('command')[0];\n\t\t// $formsToRemove = $doc->getElementById('cursor');\n\t\t// echo $formsToRemove->nodeValue;\n\t\t// foreach($formsToRemove as $form) {\n\t\t\t// $formParent = $formsToRemove->parentNode;\n\t\t\t// $formParent->removeChild($formsToRemove);\t\n\t\t// }\n\t\t\n\t\tsetAttr($doc, 'input', 'placeholder', 'Enter next Instructions');\n\n\t\t// $form = $doc->getElementsByTagName('command')[0];\n\t\t// setAttr($doc, 'input', 'placeholder', 'Enter next Instructions');\n\t\treturn $instructionSet;\n\t}",
"function echoTag ($id,$tag,$highlight,$text,$markObjects)\r{\r\t\r\techo \"<span id=$id>\";\r\tif ($markObjects) {\r\t\tif ($tag == 'EVENT') { echo \"<span class=event>\"; } \r\t\telseif ($tag == 'TIMEX3') { echo \"<span class=timex>\"; } \r\t\telse { echo \" <span class=signal>\"; }\r\t}\r\tif ($highlight) { echo '<strong>'; }\r\tif ($id{0} == 'e') { $tagtype = 'event'; }\r\telseif ($id{0} == 't') { $tagtype = 'timex'; }\r\telseif ($id{0} == 's') { $tagtype = 'signal'; }\r\techo \"<span style=\\\"cursor:crosshair\\\" onClick=\\\"MM_goToURL('parent','displayTag.php?tagtype=$tagtype&text=$text')\\\">\";\r\techo $text;\r\techo \"</span>\";\r\tif ($highlight) { echo '</strong>'; }\r\tif ($markObjects) {\r\t\techo '</span><sub>'.$id.'</sub>';\r\t}\r\techo \"</span>\";\r}",
"function printobject ($problem, $objecttype, $objectname, $key) {\n $fields = array();\n $formats = array();\n $specialobjs = specialdisplaytypes();\n fieldsforobject ($problem, $objecttype, $objectname, \"\", $key, 0,\n $fields, $empty, $specialobjs, $dummy, $objecttype,\n $formats);\n if (($objecttype == \"xy_coord\") && (! $nospecial)) {\n echo \"(\" . $fields[0][\"value\"] . \", \" . $fields[1][\"value\"] . \")\" ;\n }\n else if (($objecttype == \"latlong\") && (! $nospecial)) {\n $lat = $fields[0][\"value\"];\n $long = $fields[1][\"value\"];\n echo abs($lat) . (($lat < 0) ? \"S\" : \"N\") . \" \" .\n abs($long) . (($long < 0) ? \"W\" : \"E\");\n }\n else if (($objecttype == \"matrix\") && (! $nospecial)) {\n echo \"<TABLE BORDER=1>\\n\";\n $k = 0;\n for ($i = 0; $i < $fields[0][\"value\"]; $i++) {\n echo \"<TR>\\n\";\n for ($j = 0; $j < $fields[1][\"value\"]; $j++) {\n echo \"<TD>\\n\";\n echo $fields[2][\"list\"][$k++];\n echo \"</TD>\\n\";\n }\n echo \"</TR>\\n\";\n }\n echo \"</TABLE>\\n\";\n }\n else {\n for ($i = 0; $i < sizeof ($fields); $i++) {\n echo \"<TR><TD>\" . $fields[$i][\"field_name\"] . \"</TD><TD>\";\n if ($fields[$i][\"value\"] && $fields[$i][\"isglobalptr\"])\n echo \"<A HREF=\\\"otherdata.php?dataname=\" . $fields[$i][\"value\"] .\n \"&problem=\" . $problem . \"&action=View\\\" >\" .\n $fields[$i][\"value\"] . \"</A>\";\n else if ($fields[$i][\"objvalue\"])\n printobject ($problem, $fields[$i][\"datatype\"],\n $fields[$i][\"objvalue\"], \"internal_key\");\n else if (! $fields[$i][\"islist\"])\n echo $fields[$i][\"value\"];\n else if (sizeof ($fields[$i][\"list\"]) == 0)\n echo \" \";\n else if (! $fields[$i][\"subobjects\"]) {\n// echo \"{\" . $fields[$i][\"list\"][0];\n// for ($j = 1; $j < sizeof ($fields[$i][\"list\"]); $j++)\n// echo \", \" . $fields[$i][\"list\"][$j];\n// echo \"}\";\n for ($j = 0; $j < sizeof ($fields[$i][\"list\"]); $j++)\n echo ($j ? \", \" : \"\") . $fields[$i][\"list\"][$j];\n }\n else if ($specialobjs[$fields[$i][\"datatype\"]]) {\n echo \"{\";\n for ($j = 0; $j < sizeof ($fields[$i][\"list\"]); $j++) {\n if ($j != 0)\n echo \", \";\n printobject ($problem, $fields[$i][\"datatype\"],\n $fields[$i][\"list\"][$j], \"internal_key\");\n }\n echo \"}\";\n }\n else {\n for ($j = 0; $j < sizeof ($fields[$i][\"list\"]); $j++) {\n echo \"<TABLE BORDER=1>\\n\";\n printobject ($problem, $fields[$i][\"datatype\"],\n $fields[$i][\"list\"][$j], \"internal_key\");\n echo \"</TABLE>\\n\";\n }\n }\n echo \"</TD></TR>\\n\";\n }\n }\n }",
"function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function flashObjectTags($movie, $id, $width, $height, $bgcolor, $flashvars) {\r\n\r\n $id = array_pop(explode(\"/\",$movie));\r\n\r\n // The order in which we supply the parameters (stupidly) can affect the way the movie is displayed\r\n // We want scale = noscale, stage alignment (salign) = left and top (LT)\r\n //\r\n // Mac browsers that aren`t Mozilla, and Netscape 7 prefer scale first, then alignment\r\n // Mozilla on Mac and Non-IE PC browsers (other than Netscape 7) prefer alignment first, then scale\r\n // IE on PC does not seem to care\r\n //\r\n // So we detect the browser string for the `Mac` bit and echo the parameters accordingly\r\n //\r\n // If any problems are reported, saying the games are displayed in the window off-centre, try finding out which\r\n // order it is being viewed in the browser, and try the other way\r\n\r\n\t$userAgent = $_SERVER['HTTP_USER_AGENT'];\r\n\r\n\t// $isMac is true if we are using MSIE or Safari (but NOT Mozilla) for Mac\r\n\r\n\t// the user agent contains `Mac`, and either\r\n // 1. It does not contain the word `Gecko` (which makes it IE), or\r\n // 2. If it does contain `Gecko` then it must also say `Safari` (which makes it Safari)\r\n\r\n $isMac = strpos($userAgent, \"Mac\") !== false &&\r\n (strpos($userAgent,\"Gecko\") === false ||\r\n strpos($userAgent,\"Safari\") !== false);\r\n\r\n // $isNetscape7 is true if we are using NS7 on the PC\r\n\r\n $isNetscape7 = strpos($userAgent, \"Netscape/7\") !== false;\r\n $isFirefox = strpos($userAgent, \"Firefox\") !== false;\r\n\r\n\techo \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\\\" width=\\\"$width\\\" height=\\\"$height\\\" id=\\\"$id\\\">\\n\\n\";\r\n\r\n\techo \"<param name=\\\"movie\\\" value=\\\"$movie.swf\\\" />\\n\";\r\n\techo \"<param name=\\\"menu\\\" value=\\\"false\\\" />\\n\";\r\n\techo \"<param name=\\\"quality\\\" value=\\\"high\\\" />\\n\";\r\n\techo \"<param name=\\\"bgcolor\\\" value=\\\"$bgcolor\\\" />\\n\";\r\n\r\n/*\r\n\techo \"<param name=\\\"scale\\\" value=\\\"noscale\\\" />\\n\";\r\n\techo \"<param name=\\\"salign\\\" value=\\\"LT\\\" />\\n\";\r\n*/\r\n\r\n\techo \"<param name=\\\"flashvars\\\" value=\\\"$flashvars\\\" />\\n\\n\";\r\n\r\n\techo \"<embed src=\\\"$movie.swf\\\" quality=\\\"high\\\" menu=\\\"false\\\" bgcolor=\\\"$bgcolor\\\" width=\\\"$width\\\" height=\\\"$height\\\"\\n\";\r\n\r\n//\techo \"scale=\\\"noscale\\\" salign=\\\"LT\\\" \";\r\n\r\n\techo \"type=\\\"application/x-shockwave-flash\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\"\\n\";\r\n\techo \"flashvars=\\\"$flashvars\\\">\\n\";\r\n\r\n\techo \"</embed></object>\";\r\n\r\n\techo \"<script language=\\\"JavaScript\\\" type=\\\"text/javascript\\\">\\n\";\r\n\r\n\techo \"window.$id.focus(); \\n\";\r\n\r\n\techo \"</script>\";\r\n\r\n}",
"function wkt_generate() {\n $types = array(\n 'point',\n 'linestring',\n 'polygon',\n 'multipoint',\n 'multilinestring',\n 'multipolygon',\n );\n // don't always generate the same type\n shuffle($types);\n $type = $types[0];\n $func = 'wkt_generate_' . $type;\n if (method_exists($this, $func)) {\n $wkt = $this->$func();\n return drupal_strtoupper($type) . ' (' . $wkt . ')';\n }\n return 'POINT (0 0)';\n }",
"private function getTrackingCode($objectName)\n {\n $code =\n \"window.dataLayer = window.dataLayer || [];\\n\".\n \"function {$objectName}(){dataLayer.push(arguments);}\\n\".\n \"{$objectName}('js', new Date());\\n\"\n ;\n\n return $code;\n }"
] |
[
"0.79175663",
"0.60307455",
"0.54985607",
"0.5479237",
"0.54320943",
"0.53111875",
"0.5229272",
"0.51056445",
"0.4995838",
"0.49165836",
"0.4868962",
"0.48576972",
"0.48097783",
"0.47879413",
"0.47877154",
"0.4738859",
"0.47326258",
"0.4719163",
"0.46801302",
"0.46460286",
"0.4637412",
"0.45933473",
"0.4569481",
"0.45539233",
"0.44973403",
"0.44871768",
"0.44858438",
"0.44530383",
"0.44235367",
"0.44134045"
] |
0.86179775
|
0
|
string packRemoveObjectTag(integer CharacterID, integer Depth) returns an SWF RemoveObject tag string. TagID: 5
|
function packRemoveObjectTag($CharacterID, $Depth)
{
array_push($this->FMDebug, "packRemoveObjectTag");
#error_log($CharacterID);
$TagID = 5;
$CharacterID = $this->packUI16($CharacterID);
$Depth = $this->packUI16((int)$Depth);
$TagLength = strlen($CharacterID . $Depth);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packRemoveObject2Tag($Depth)\n\t{\n\t\tarray_push($this->FMDebug, \"packRemoveObject2Tag\");\n\n\t\t$TagID = 28;\n\n\t\t$Depth = $this->packUI16($Depth);\n\n\t\t$TagLength = strlen($Depth);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Depth;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function unTag($objid, $tag);",
"function packPlaceObjectTag($CharacterID, $Depth, $MATRIX, $CXFORM)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObjectTag\");\n\n\t\t$TagID = 4;\n\n\t\t$CharacterID = $this->packUI16($CharacterID);\n\t\t$Depth = $this->packUI16($Depth);\n\t\t$TagLength = strlen($CharacterID . $Depth . $MATRIX . $CXFORM);\n\t\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $CharacterID . $Depth . $MATRIX . $CXFORM;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packPlaceObject2Tag($PlaceFlagMove, $PlaceFlagHasCharacter, $CharacterID, $Depth, $MATRIX, $CXFORM, $Ratio, $Name, $ClipActions)\n\t{\n\t\tarray_push($this->FMDebug, \"packPlaceObject2Tag\");\n\n\t\t$TagID = 26;\n\n\t\t$PlaceFlagHasClipActions = \"0\";\n\t\t$PlaceFlagReserved = \"0\";\n\t\t$PlaceFlagHasName = \"0\";\n\t\t$PlaceFlagHasRatio = \"0\";\n\t\t$PlaceFlagHasColorTransform = \"0\";\n\t\t$PlaceFlagHasMatrix = \"0\";\n\n\t\t$payload = \"\";\n\n\t\tif ($PlaceFlagMove) {\n\n\t\t\t$PlaceFlagMove = \"1\";\n\n\t\t} else {\n\n\t\t\t$PlaceFlagMove = \"0\";\n\t\t}\n\n\n\t\tif (($PlaceFlagHasCharacter) and ($CharacterID != null)) {\n\n\t\t\t$PlaceFlagHasCharacter = \"1\";\n\t\t\t$payload .= $this->packUI16($CharacterID);\n\n\t\t} else {\n\n\t\t\t$PlaceFlagHasCharacter = \"0\";\n\t\t}\n\n\t\tif (!($MATRIX == \"\")) {\n\n\t\t\t$PlaceFlagHasMatrix = \"1\";\n\t\t\t$payload .= $MATRIX;\n\t\t}\n\n\t\tif (!($CXFORM == \"\")) {\n\n\t\t\t$PlaceFlagHasColorTransform = \"1\";\n\t\t\t$payload .= $CXFORM;\n\t\t}\n\n\t\tif (!($Ratio == NULL)) {\n\n\t\t\t$PlaceFlagHasRatio = \"1\";\n\t\t\t$payload .= $this->packUI16($Ratio);\n\t\t}\n\n\t\tif (!($Name == NULL)) {\n\n\t\t\t$PlaceFlagHasName = \"1\";\n\t\t\t$payload .= $this->packSTRING($Name);\n\t\t}\n\n\t\tif (!($ClipActions == NULL)) {\n\n\t\t\t$PlaceFlagHasClipActions = \"1\";\n\t\t\t$payload .= $ClipActions;\n\t\t}\n\n\t\t$PlaceFlags = $PlaceFlagHasClipActions . $PlaceFlagReserved . $PlaceFlagHasName . $PlaceFlagHasRatio . $PlaceFlagHasColorTransform . $PlaceFlagHasMatrix . $PlaceFlagHasCharacter . $PlaceFlagMove;\n\n\t\t$payload = $this->packBitValues($PlaceFlags) . $this->packUI16($Depth). $payload;\n\n\t\t$TagLength = strlen($payload);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $payload;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"abstract protected function getObjectTag();",
"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}",
"private function destory(object $obj) : string\n {\n $temp = (\"Destorying \" . $obj->getName()) . \"<br/>\";\n unset($obj);\n return $temp;\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}",
"function OBJM_DeleteObject($respdata)\r\n{\r\n\t//PARSE THE STRING AND FORM A QUERY PARAMS\r\n\tparse_str($respdata) ;\t\r\n\t$objectTypeVal = strtoupper($OBJECTTYPE);\r\n\t$objectIDVal = strtoupper($OBJECTID);\r\n\t\r\n\t$respdata = 'FAIL'; \r\n\t\r\n\tif($objectTypeVal == \"PAGE\")\r\n\t\treturn false; \r\n\t//GET THE TARGET OBJECT ID TO BE DELETED \r\n\t$TMObjectID = \"TM_\".$objectIDVal; \r\n\t$DIVObjectID = \"DIV_\".$objectIDVal; \r\n\t\r\n\t//Before that check if the item is already referred somewhere in which case delete that first\r\n\t//get the list of nodes with tag as div \r\n\t$tag = \"li\"; //later it can be li as well while using JQX\r\n\t$_SESSION['sceneCompXMLDOM']->load($_SESSION['sceneCompXMLFilePath']); \r\n\t$nodelist = $_SESSION['sceneCompXMLDOM']->getElementsByTagName($tag); \r\n\t$arrTodelete = array(); \r\n\t$arrIndex=0; \r\n\tif($objectTypeVal == \"LAYER\")\r\n\t{\r\n\t\tfor($i = 0; $i < $nodelist->length; $i++)\r\n\t\t{\r\n\t\t\t//get the node \t\r\n\t\t\t$currNode = $nodelist->item($i); \t\t\r\n\t\t\t//check if the nodes' type is that of Layer type\r\n\t\t\t$type = $currNode->getAttribute(\"type\"); \r\n\t\t\tif($type == \"LAYER\")\r\n\t\t\t{ \t\t\r\n\t\t\t\t/// then check if the node has data-srcid same as that of the target\t\r\n\t\t\t\t$srcid = $currNode->getAttribute(\"data-srcid\");\r\n\t\t\t\tif($srcid == $TMObjectID)\t\r\n\t\t\t\t{\r\n\t\t\t\t//then get the ID of the node and call for deletion\r\n\t\t\t\t\t$nodeID = $currNode->getAttribute(\"id\");\r\n\t\t\t\t\t$arrTodelete[$arrIndex++] = $nodeID; \t\t\t\r\n\t\t\t\t}\r\n\t\t\t} \t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//now delete the copied nodes from the stored IDs in the array\r\n\t\tforeach ($arrTodelete as $index => $arrValue)\r\n\t\t{\r\n\t\t\t$ID = $arrValue;\r\n\t\t\t$retval = CDOC_COMMON_DeleteElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], $ID, true, \"type\", $objectTypeVal);\r\n\t\t\r\n\t\t\tif($retval != true)\r\n\t\t\t\treturn $retval;\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t\t\r\n\t//DELETE IT FROM SC SML DATA \r\n\t$retval = CDOC_COMMON_DeleteElement($_SESSION['sceneCompXMLDOM'], $_SESSION['sceneCompXMLFilePath'], $TMObjectID, true, \"type\", $objectTypeVal);\r\n\t\r\n\tif($retval != true)\r\n\t\treturn $retval; \r\n\t\r\n\t//CALL APPROPRIATE OBJECT SPECIFIC FUNCTION TO DELETE IT FROM HTML DOM \r\n\tif(!isset($_SESSION['projHTMLDOM']))\r\n\t\treturn false; \r\n\tif(!isset($_SESSION['projHTMLFilename']))\r\n\t\treturn false;\r\n\tif($objectTypeVal == 'HTMLOBJECT')\r\n\t{\r\n\t\t$retval = CDOC_COMMON_DeleteHTMLElement($_SESSION['projHTMLDOM'], $_SESSION['projHTMLFilename'], $DIVObjectID);\r\n\t\t$respdata = 'OK';\r\n\t}\r\n\telse if($objectTypeVal == 'SOURCE')\r\n\t{\r\n\t\t$retval = CDOC_COMMON_DeleteHTMLElement($_SESSION['projHTMLDOM'], $_SESSION['projHTMLFilename'], $objectIDVal);\r\n\t\t$respdata = 'OK';\r\n\t}\r\n\t\t\r\n\t\r\n\treturn $retval; \r\n}",
"public function remove ($obj) {}",
"public function tagAs($objid, $tag);",
"function TestPlan_remove_tag($plan_id, $tag_name) {\n\t// Create call\n//\t$call = new xmlrpcmsg('TestPlan.remove_tag', array(new xmlrpcval(array(\"plan_id\" => new xmlrpcval($plan_id, \"int\"), \"tag_name\" => new xmlrpcval($tag_name, \"string\")), \"struct\")));\n\t$call = new xmlrpcmsg('TestPlan.remove_tag', array(new xmlrpcval($plan_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function remove($object);",
"public function remove($object);",
"function _buildXMLstringLevel($object, $depth)\n\t{\n\t\t// Initialize variables\n\t\t$retval = '';\n\t\t$tab\t= '';\n\t\tfor($i=1;$i <= $depth; $i++) {\n\t\t\t$tab .= \"\\t\";\n\t\t}\n\n\t\tforeach (get_object_vars( $object ) as $key=>$item)\n\t\t{\n\t\t\tif (is_object($item))\n\t\t\t{\n\t\t\t\t$retval .= $tab.\"<group name=\\\"\".$key.\"\\\">\\n\";\n\t\t\t\t$retval .= $this->_buildXMLstringLevel($item, $depth+1);\n\t\t\t\t$retval .= $tab.\"</group>\\n\";\n\t\t\t} else {\n\t\t\t\t$retval .= $tab.\"<entry name=\\\"\".$key.\"\\\">\".$item.\"</entry>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}",
"public function delete_tag($tag);",
"public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}",
"function non_DOM_deleteme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}",
"function we_tag_delete(array $attribs){\n\t$id = weTag_getAttribute('id', $attribs, 0, we_base_request::INT);\n\t$type = weTag_getAttribute('type', $attribs, 'document', we_base_request::STRING);\n\t$userid = weTag_getAttribute('userid', $attribs, 0, we_base_request::STRING); // deprecated use protected=true instead\n\t$protected = weTag_getAttribute('protected', $attribs, false, we_base_request::BOOL);\n\t$admin = weTag_getAttribute('admin', $attribs, '', we_base_request::STRING);\n\t$mail = weTag_getAttribute('mail', $attribs, '', we_base_request::EMAIL);\n\t$mailfrom = weTag_getAttribute('mailfrom', $attribs, '', we_base_request::EMAIL);\n\t$charset = weTag_getAttribute('charset', $attribs, \"iso-8859-1\", we_base_request::STRING);\n\t$doctype = weTag_getAttribute('doctype', $attribs, '', we_base_request::STRING);\n\t$classid = weTag_getAttribute('classid', $attribs, '', we_base_request::INT);\n\t$pid = weTag_getAttribute('pid', $attribs, 0, we_base_request::INT);\n\t$forceedit = weTag_getAttribute('forceedit', $attribs, false, we_base_request::BOOL);\n\n\tswitch($type){\n\t\tcase 'document':\n\t\t\t$docID = $id ? : we_base_request::_(we_base_request::INT, 'we_delDocument_ID');\n\t\t\tif(!$docID){\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$doc = new we_webEditionDocument();\n\t\t\t$doc->initByID($docID);\n\t\t\t$table = FILE_TABLE;\n\t\t\tif($doctype){\n\t\t\t\t$doctypeID = f('SELECT ID FROM ' . DOC_TYPES_TABLE . ' WHERE DocType LIKE \"' . $GLOBALS['DB_WE']->escape($doctype) . '\"');\n\t\t\t\tif($doc->DocType != $doctypeID){\n\t\t\t\t\t$GLOBALS['we_' . $type . '_delete_ok'] = false;\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($mail){\n\t\t\t\t$mailtext = sprintf(g_l('global', '[std_mailtext_delDoc]'), $doc->Path);\n\t\t\t\t$subject = g_l('global', '[std_subject_delDoc]');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'object':\n\t\t\t$docID = $id ? : we_base_request::_(we_base_request::INT, 'we_delObject_ID', $id);\n\t\t\tif(!$docID){\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$doc = new we_objectFile();\n\t\t\t$doc->initByID($docID, OBJECT_FILES_TABLE);\n\t\t\t$table = OBJECT_FILES_TABLE;\n\t\t\tif($classid && $doc->TableID != $classid){//FIXME: IsClassFolder\n\t\t\t\t$GLOBALS['we_' . $type . '_delete_ok'] = false;\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tif($mail){\n\t\t\t\t$mailtext = sprintf(g_l('global', '[std_mailtext_delObj]'), $doc->Path);\n\t\t\t\t$subject = g_l('global', '[std_subject_delObj]');\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn;\n\t}\n\n\tif($pid && $doc->ParentID != $pid){\n\t\t$GLOBALS['we_' . $type . '_delete_ok'] = false;\n\t\treturn '';\n\t}\n\n\t$isOwner = !empty($_SESSION['webuser']['registered']) && isset($_SESSION['webuser']['ID']) && (\n\t\t($protected && $_SESSION['webuser']['ID'] == $doc->WebUserID) ||\n\t\t($userid && $_SESSION['webuser']['ID'] == $doc->getElement($userid))\n\t\t);\n\n\n\t$isAdmin = !empty($_SESSION['webuser']['registered']) && $admin && !empty($_SESSION['webuser'][$admin]);\n\n\tif($isAdmin || $isOwner || $forceedit){\n\t\twe_base_delete::deleteEntry($docID, $table);\n\t\t$GLOBALS['we_' . $type . '_delete_ok'] = true;\n\t\tif($mail){\n\t\t\tif(!$mailfrom){\n\t\t\t\t$mailfrom = 'dontReply@' . $_SERVER['SERVER_NAME'];\n\t\t\t}\n\t\t\t$phpmail = new we_helpers_mail($mail, $subject, $mailfrom);\n\t\t\t$phpmail->setCharSet($charset);\n\t\t\t$phpmail->addTextPart(trim($mailtext));\n\t\t\t$phpmail->buildMessage();\n\t\t\t$phpmail->Send();\n\t\t}\n\t} else {\n\t\t$GLOBALS['we_' . $type . '_delete_ok'] = false;\n\t}\n\treturn '';\n}",
"function delVakoImage($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the vako with $object->reference->ShopId */ \n}",
"public function remove($object): void;",
"function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function remove($name, $removeObjects = true) {}",
"static private function _delete($object) {\n $objects = self::getStack($object->_type);\n $fileName = self::getFileNameByObject($object);\n if (isset($objects[$object->_id])) {\n unset($objects[$object->_id]);\n }\n else {\n // self::fail('Can not find object id '.$object->_id);\n }\n $stringToWrite = '';\n foreach ($objects as $object) {\n $stringToWrite .= json_encode($object) . self::getConfig('delimiter') . PHP_EOL;\n }\n if (file_put_contents($fileName, $stringToWrite)) {\n return TRUE;\n }\n self::fail('Failure on delete, unable to write file');\n }",
"function remove($aws_data_object) {\n\t\t}",
"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 remove($object)\n {\n parent::delete($object); // TODO: Change the autogenerated stub\n }",
"private function retrieve_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //if the openener is not in the Object we ignore it\n $temp_parent = $this->tags['parent']; //check to see if it's a closable tag.\n while ($temp_parent) { //till we reach '' (the initial value);\n if ($tag . $this->tags[$tag . 'count'] === $temp_parent) { //if this is it use it\n break;\n }\n $temp_parent = isset($this->tags[$temp_parent . 'parent']) ? $this->tags[$temp_parent . 'parent'] : ''; //otherwise keep on climbing up the DOM Tree\n }\n if ($temp_parent) { //if we caught something\n $this->indent_level = $this->tags[$tag . $this->tags[$tag . 'count']]; //set the indent_level accordingly\n $this->tags['parent'] = $this->tags[$temp_parent . 'parent']; //and set the current parent\n }\n unset($this->tags[$tag . $this->tags[$tag . 'count'] . 'parent']); //delete the closed tags parent reference...\n unset($this->tags[$tag . $this->tags[$tag . 'count']]); //...and the tag itself\n if ($this->tags[$tag . 'count'] === 1) {\n unset($this->tags[$tag . 'count']);\n } else {\n $this->tags[$tag . 'count']--;\n }\n }\n }",
"private static function parseObject(mixed $object, int $level, array &$cache): string {\n $output = '';\n $className = get_class($object);\n\n if (($id = array_search($object, $cache, true)) !== false) $output .= \"{$className}#\" . (++$id) . '(...)';\n else if (static::$depth <= $level) $output .= \"{$className}(...)\";\n else {\n $id = array_push($cache, $object);\n $members = (array)$object;\n $keys = array_keys($members);\n $spaces = str_repeat(' ', $level * 4);\n $output .= \"$className#$id {\";\n\n foreach ($keys as $key) {\n $keyDisplay = strtr(trim(\"$key\"), [\"\\0\" => ':']);\n $output .= PHP_EOL . \"{$spaces} [$keyDisplay] => \" . self::parseVariable($members[$key], $level + 1, $cache);\n }\n $output .= PHP_EOL . \"{$spaces}}\";\n }\n return $output;\n }",
"function __unserialize($sObject) {\n\t$__ret =preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $sObject );\n\treturn unserialize($__ret);\n}"
] |
[
"0.7644641",
"0.5938855",
"0.5864545",
"0.56504995",
"0.5300621",
"0.5238896",
"0.51192707",
"0.50909144",
"0.50846994",
"0.5047743",
"0.5030615",
"0.4995205",
"0.4969054",
"0.4969054",
"0.4949305",
"0.4887155",
"0.48479554",
"0.4820061",
"0.48111668",
"0.4800512",
"0.47886324",
"0.47203046",
"0.47115615",
"0.46581358",
"0.46444836",
"0.46334848",
"0.46317965",
"0.4615577",
"0.45843503",
"0.4578776"
] |
0.8399743
|
0
|
string packDefineBitsTag(integer BitmapID, string BitmapJPEGImage) return an SWF DefineBits tag string. TagID: 6
|
function packDefineBitsTag($CharacterID, $BitmapJPEGImage)
{
array_push($this->FMDebug, "packDefineBitsTag");
$TagID = 6;
$BitmapID = $this->packUI16($CharacterID);
$TagLength = strlen($BitmapID . $BitmapJPEGImage);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packJPEGTablesTag($BitmapJPEGEncoding)\n\t{\n\t\tarray_push($this->FMDebug, \"packJPEGTablesTag\");\n\n\t\t$TagID = 8;\n\t\t$TagLength = strlen($BitmapJPEGEncoding);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function imageBmp($img, $file, $RLE=0)\r\n\t{\r\n\t\t$ColorCount = imagecolorstotal($img);\r\n\t\t$Transparent = imagecolortransparent($img);\r\n\t\t$IsTransparent = $Transparent != -1;\r\n\t\tif($IsTransparent)\r\n\t\t\t$ColorCount--;\r\n\t\tif($ColorCount == 0)\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 24;\r\n\t\t}\r\n\t\tif(($ColorCount > 0) && ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\t$ColorCount = 2;\r\n\t\t\t$BitCount = 1;\r\n\t\t}\r\n\t\tif(($ColorCount > 2) && ($ColorCount <= 16))\r\n\t\t{\r\n\t\t\t$ColorCount = 16;\r\n\t\t\t$BitCount = 4;\r\n\t\t}\r\n\t\tif(($ColorCount > 16) && ($ColorCount <= 256))\r\n\t\t{\r\n\t\t\t$ColorCount = 0;\r\n\t\t\t$BitCount = 8;\r\n\t\t}\r\n\t\t$Width = imageSX($img);\r\n\t\t$Height = imageSY($img);\r\n\t\t$Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4;\r\n\t\tif($BitCount < 24)\r\n\t\t\t$palsize = pow(2, $BitCount) * 4;\r\n\t\t$size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54;\r\n\t\t$size += $palsize;\r\n\t\t$offset = 54 + $palsize;\r\n\t\t// Bitmap File Header\r\n\t\t$ret = 'BM';\r\n\t\t$ret .= $this->int_to_dword($size);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword($offset);\r\n\t\t// Bitmap Info Header\r\n\t\t$ret .= $this->int_to_dword(40);\r\n\t\t$ret .= $this->int_to_dword($Width);\r\n\t\t$ret .= $this->int_to_dword($Height);\r\n\t\t$ret .= $this->int_to_word(1);\r\n\t\t$ret .= $this->int_to_word($BitCount);\r\n\t\t$ret .= $this->int_to_dword($RLE);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t$ret .= $this->int_to_dword(0);\r\n\t\t// image data\r\n\t\t$CC = $ColorCount;\r\n\t\t$sl1 = strlen($ret);\r\n\t\tif($CC == 0)\r\n\t\t\t$CC = 256;\r\n\t\tif($BitCount < 24)\r\n\t\t{\r\n\t\t\t$ColorTotal = imagecolorstotal($img);\r\n\t\t\tif($IsTransparent)\r\n\t\t\t\t$ColorTotal--;\r\n\t\t\tfor($p = 0; $p < $ColorTotal; $p++)\r\n\t\t\t{\r\n\t\t\t\t$color = imagecolorsforindex($img, $p);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"blue\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"green\"]);\r\n\t\t\t\t$ret .= $this->inttobyte($color[\"red\"]);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t\t$CT = $ColorTotal;\r\n\t\t\tfor($p = $ColorTotal; $p < $CC; $p++)\r\n\t\t\t{\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t\t$ret .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($BitCount <= 8)\r\n\t\t{\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\t$bWrite = \"\";\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorat($img, $x, $y);\r\n\t\t\t\t\t$bWrite .= $this->decbinx($color, $BitCount);\r\n\t\t\t\t\tif(strlen($bWrite) == 8)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t\t\t$bWrite = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif((strlen($bWrite) < 8) and (strlen($bWrite) != 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sl = strlen($bWrite);\r\n\t\t\t\t\tfor($t = 0; $t < 8 - $sl; $t++)\r\n\t\t\t\t\t\t$sl .= \"0\";\r\n\t\t\t\t\t$retd .= $this->inttobyte(bindec($bWrite));\r\n\t\t\t\t}\r\n\t\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t\t$retd .= $this->inttobyte(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(($RLE == 1) and ($BitCount == 8))\r\n\t\t{\r\n\t\t\tfor($t = 0; $t < strlen($retd); $t += 4)\r\n\t\t\t{\r\n\t\t\t\tif($t != 0)\r\n\t\t\t\t\tif(($t) % $Width == 0)\r\n\t\t\t\t\t\t$ret .= chr(0).chr(0);\r\n\r\n\t\t\t\tif(($t + 5) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0);\r\n\t\t\t\t\t$t += 1;\r\n\t\t\t\t}\r\n\t\t\t\tif(($t + 6) % $Width == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ret .= chr(0).chr(6).substr($retd, $t, 6);\r\n\t\t\t\t\t$t += 2;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$ret .= chr(0).chr(4).substr($retd, $t, 4);\r\n\t\t\t}\r\n\t\t\t$ret .= chr(0).chr(1);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$ret .= $retd;\r\n\t\tif($BitCount == 24)\r\n\t\t{\r\n\t\t\tfor($z = 0; $z < $Zbytek; $z++)\r\n\t\t\t\t$Dopl .= chr(0);\r\n\r\n\t\t\tfor($y = $Height - 1; $y >= 0; $y--)\r\n\t\t\t{\r\n\t\t\t\tfor($x = 0; $x < $Width; $x++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$color = imagecolorsforindex($img, ImageColorAt($img, $x, $y));\r\n\t\t\t\t\t$ret .= chr($color[\"blue\"]).chr($color[\"green\"]).chr($color[\"red\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$ret .= $Dopl;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(fwrite(fopen($file, \"wb\"), $ret))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"public function getImageTag();",
"function template_bits_bit_row_image( $id, $image ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<img id='img-item-{$id}' src='{$this->ipsclass->skin_acp_url}/images/{$image}' border='0' alt='' />\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function getBits();",
"function imagecreatefrombmp($file)\n{\n global $CurrentBit, $echoMode;\n\n $Data = '';\n $f = fopen($file, \"r\");\n $Header = fread($f, 2);\n\n if ($Header == \"BM\") {\n $Size = freaddword($f);\n $Reserved1 = freadword($f);\n $Reserved2 = freadword($f);\n $FirstByteOfImage = freaddword($f);\n\n $SizeBITMAPINFOHEADER = freaddword($f);\n $Width = freaddword($f);\n $Height = freaddword($f);\n $biPlanes = freadword($f);\n $biBitCount = freadword($f);\n $RLECompression = freaddword($f);\n $WidthxHeight = freaddword($f);\n $biXPelsPerMeter = freaddword($f);\n $biYPelsPerMeter = freaddword($f);\n $NumberOfPalettesUsed = freaddword($f);\n $NumberOfImportantColors = freaddword($f);\n\n if ($biBitCount < 24) {\n $img = imagecreate($Width, $Height);\n $Colors = pow(2, $biBitCount);\n for($p = 0; $p < $Colors; $p ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $Reserved = freadbyte($f);\n $Palette [] = imagecolorallocate($img, $R, $G, $B);\n }\n\n if ($RLECompression == 0) {\n $Zbytek =(4 - ceil(($Width /(8 / $biBitCount)))% 4) % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n $CurrentBit = 0;\n for($x = 0; $x < $Width; $x ++) {\n $C = freadbits($f, $biBitCount);\n imagesetpixel($img, $x, $y, $Palette [$C]);\n }\n if ($CurrentBit != 0) {\n freadbyte($f);\n }\n for($g = 0; $g < $Zbytek; $g ++) {\n freadbyte($f);\n }\n }\n\n }\n }\n\n if ($RLECompression == 1) //$BI_RLE8\n {\n $y = $Height;\n $pocetb = 0;\n\n while (true) {\n $y--;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n $Data .= fread($f, $pocet);\n $pocetb += $pocet;\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n for($r = 0; $r < $pocet; $r ++) {\n $Data .= chr($suffix);\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($RLECompression == 2) //$BI_RLE4\n {\n $y = $Height;\n $pocetb = 0;\n\n /*while (!feof($f))\n echo freadbyte($f).'_'.freadbyte($f).\"<BR>\";*/\n while (true) {\n //break;\n $y --;\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n\n $echoit = false;\n\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n if (($prefix == 0) and($suffix == 1)) {\n break;\n }\n if (feof($f)) {\n break;\n }\n\n while (!(($prefix == 0) and($suffix == 0))) {\n if ($prefix == 0) {\n $pocet = $suffix;\n\n $CurrentBit = 0;\n for($h = 0; $h < $pocet; $h ++) {\n $Data .= chr(freadbits($f, 4));\n }\n if ($CurrentBit != 0) {\n freadbits($f, 4);\n }\n $pocetb += ceil(($pocet / 2));\n if ($pocetb % 2 == 1) {\n freadbyte($f);\n $pocetb ++;\n }\n }\n\n if ($prefix > 0) {\n $pocet = $prefix;\n $i = 0;\n for($r = 0; $r < $pocet; $r ++) {\n if ($i % 2 == 0) {\n $Data .= chr($suffix % 16);\n } else {\n $Data .= chr(floor($suffix / 16));\n }\n $i ++;\n }\n }\n $prefix = freadbyte($f);\n $suffix = freadbyte($f);\n $pocetb += 2;\n if ($echoit) {\n echo \"Prefix: $prefix Suffix: $suffix<BR>\";\n }\n }\n\n for($x = 0; $x < strlen($Data); $x ++) {\n imagesetpixel($img, $x, $y, $Palette [ord($Data [$x])]);\n }\n $Data = '';\n\n }\n\n }\n\n if ($biBitCount == 24) {\n $img = imagecreatetruecolor($Width, $Height);\n $Zbytek = $Width % 4;\n\n for($y = $Height - 1; $y >= 0; $y --) {\n for($x = 0; $x < $Width; $x ++) {\n $B = freadbyte($f);\n $G = freadbyte($f);\n $R = freadbyte($f);\n $color = imagecolorexact($img, $R, $G, $B);\n if ($color == - 1)\n $color = imagecolorallocate($img, $R, $G, $B);\n imagesetpixel($img, $x, $y, $color);\n }\n for($z = 0; $z < $Zbytek; $z ++) {\n freadbyte($f);\n }\n }\n\n }\n\n return $img;\n\n }\n\n fclose($f);\n\n}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function read_image_descriptor()\r\n\t{\r\n\t\t/* Reset global variables */\r\n\t\t$this->buffer = array();\r\n\t\t$this->fou = '';\r\n\r\n\t\t/* Header -> GIF89a */\r\n\t\t$this->fou .= \"\\x47\\x49\\x46\\x38\\x39\\x61\";\r\n\r\n\t\t$this->getbytes(9);\r\n for($i = 0; $i < 9; $i++)\r\n $this->image_descriptor[$i] = $this->buffer[$i];\r\n\r\n $local_color_table_flag = ($this->buffer[8] & 0x80) ? TRUE : FALSE;\r\n if($local_color_table_flag)\r\n {\r\n \t$code = ($this->buffer[8] & 0x07);\r\n \t$sorted = ($this->buffer[8] & 0x20) ? TRUE : FALSE;\r\n }\r\n else\r\n {\r\n $code = $this->global_color_table_code;\r\n $sorted = $this->global_sorted;\r\n }\r\n\r\n $size = 2 << $code;\r\n\r\n $this->logical_screen_descriptor[4] &= 0x70;\r\n $this->logical_screen_descriptor[4] |= 0x80;\r\n $this->logical_screen_descriptor[4] |= $code;\r\n\r\n if($sorted)\r\n\t\t\t$this->logical_screen_descriptor [4] |= 0x08;\r\n\t\t$this->putbytes($this->logical_screen_descriptor, 7);\r\n\r\n\t\tif($local_color_table_flag)\r\n\t\t{\r\n\t\t\t$this->getbytes(3 * $size);\r\n $this->putbytes($this->buffer, 3 * $size);\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->putbytes($this->global, 3 * $size);\r\n\r\n\t\t$this->fou .= \"\\x2C\";\r\n\r\n\t\t$this->image_descriptor[8] &= 0x40;\r\n\r\n\t\t$this->putbytes($this->image_descriptor, 9);\r\n\r\n /* LZW minimum code size */\r\n\t\t$this->getbytes(1);\r\n\t\t$this->putbytes($this->buffer, 1);\r\n\r\n\t\t/* Image Data */\r\n for(;;)\r\n {\r\n \t$this->getbytes(1);\r\n\t\t\t$this->putbytes($this->buffer, 1);\r\n if(($u = $this->buffer[0]) == 0)\r\n \tbreak;\r\n $this->getbytes($u);\r\n $this->putbytes($this->buffer, $u);\r\n }\r\n\r\n\t\t/* trailer */\r\n\t\t$this->fou .= \"\\x3B\";\r\n\r\n\t\t/* Write to file */\r\n\t\tswitch($this->fm)\r\n\t\t{\r\n\t\t\t/* Write as BMP */\r\n\t\t\tcase \"BMP\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".bmp\";\r\n\t\t\t\tif(!$this->imageBmp($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n /* Write as PNG */\r\n\t\t\tcase \"PNG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".png\";\r\n\t\t\t\tif(!imagePng($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as JPG */\r\n\t\t\tcase \"JPG\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".jpg\";\r\n\t\t\t\tif(!imageJpeg($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t\t/* Write as GIF */\r\n\t\t\tcase \"GIF\":\r\n\t\t\t\t$im = imageCreateFromString($this->fou);\r\n\t\t\t\t$framename = $this->sp . $this->image_count++ . \".gif\";\r\n\t\t\t\tif(!imageGif($im, $framename))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->es = \"error #3\";\r\n\t\t\t\t\treturn(0);\r\n\t\t\t\t}\r\n\t\t\t\timageDestroy($im);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }",
"function ImageCreateFromBMP($filename)\n{\n //Ouverture du fichier en mode binaire\n if (! $f1 = fopen($filename,\"rb\")) return FALSE;\n\n //1 : Chargement des ent�tes FICHIER\n $FILE = unpack(\"vfile_type/Vfile_size/Vreserved/Vbitmap_offset\", fread($f1,14));\n if ($FILE['file_type'] != 19778) return FALSE;\n\n //2 : Chargement des ent�tes BM\n $BMP = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.\n '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.\n '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));\n $BMP['colors'] = pow(2,$BMP['bits_per_pixel']);\n if ($BMP['size_bitmap'] == 0) $BMP['size_bitmap'] = $FILE['file_size'] - $FILE['bitmap_offset'];\n $BMP['bytes_per_pixel'] = $BMP['bits_per_pixel']/8;\n $BMP['bytes_per_pixel2'] = ceil($BMP['bytes_per_pixel']);\n $BMP['decal'] = ($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] -= floor($BMP['width']*$BMP['bytes_per_pixel']/4);\n $BMP['decal'] = 4-(4*$BMP['decal']);\n if ($BMP['decal'] == 4) $BMP['decal'] = 0;\n\n //3 : Chargement des couleurs de la palette\n $PALETTE = array();\n if ($BMP['colors'] < 16777216)\n {\n $PALETTE = unpack('V'.$BMP['colors'], fread($f1,$BMP['colors']*4));\n }\n\n //4 : Cr�ation de l'image\n $IMG = fread($f1,$BMP['size_bitmap']);\n $VIDE = chr(0);\n\n $res = imagecreatetruecolor($BMP['width'],$BMP['height']);\n $P = 0;\n $Y = $BMP['height']-1;\n while ($Y >= 0)\n {\n $X=0;\n while ($X < $BMP['width'])\n {\n if ($BMP['bits_per_pixel'] == 24)\n $COLOR = unpack(\"V\",substr($IMG,$P,3).$VIDE);\n elseif ($BMP['bits_per_pixel'] == 16)\n {\n $COLOR = unpack(\"n\",substr($IMG,$P,2));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 8)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,$P,1));\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 4)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*2)%2 == 0) $COLOR[1] = ($COLOR[1] >> 4) ; else $COLOR[1] = ($COLOR[1] & 0x0F);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n elseif ($BMP['bits_per_pixel'] == 1)\n {\n $COLOR = unpack(\"n\",$VIDE.substr($IMG,floor($P),1));\n if (($P*8)%8 == 0) $COLOR[1] = $COLOR[1] >>7;\n elseif (($P*8)%8 == 1) $COLOR[1] = ($COLOR[1] & 0x40)>>6;\n elseif (($P*8)%8 == 2) $COLOR[1] = ($COLOR[1] & 0x20)>>5;\n elseif (($P*8)%8 == 3) $COLOR[1] = ($COLOR[1] & 0x10)>>4;\n elseif (($P*8)%8 == 4) $COLOR[1] = ($COLOR[1] & 0x8)>>3;\n elseif (($P*8)%8 == 5) $COLOR[1] = ($COLOR[1] & 0x4)>>2;\n elseif (($P*8)%8 == 6) $COLOR[1] = ($COLOR[1] & 0x2)>>1;\n elseif (($P*8)%8 == 7) $COLOR[1] = ($COLOR[1] & 0x1);\n $COLOR[1] = $PALETTE[$COLOR[1]+1];\n }\n else\n return FALSE;\n imagesetpixel($res,$X,$Y,$COLOR[1]);\n $X++;\n $P += $BMP['bytes_per_pixel'];\n }\n $Y--;\n $P+=$BMP['decal'];\n }\n\n //Fermeture du fichier\n fclose($f1);\n\n return $res;\n}",
"function template_bits_bit_row( $sec, $custom_bit, $remove_button, $altered_image ) {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div class='tablerow1' id='dvb-{$sec['func_name']}' title='Выберите нужные ячейки для редактирования сразу нескольких шаблонов' onclick='parent.template_toggle_bit_row(\"{$sec['func_name']}\")' >\n <div style='float:right;width:auto;'>\n $remove_button\n <a style='text-decoration:none' title='Предпросмотр в виде текста' href='#' onclick='pop_win(\"act=rtempl&code=preview&suid={$sec['suid']}&type=text\"); parent.template_cancel_bubble( event, true );'><img src='{$this->ipsclass->skin_acp_url}/images/te_text.gif' border='0' alt='Предпросмотр в виде текста'></a>\n <a style='text-decoration:none' title='Предпросмотр в виде HTML' href='#' onclick='pop_win(\"act=rtempl&code=preview&suid={$sec['suid']}&type=css\"); parent.template_cancel_bubble( event, true );'><img src='{$this->ipsclass->skin_acp_url}/images/te_html.gif' border='0' alt='Предпросмотр в виде HTML'> </a>\n </div>\n <div align='left'>\n <img src='{$this->ipsclass->skin_acp_url}/images/file.gif' title='Шаблон: {$sec['set_id']}' alt='Шаблон' style='vertical-align:middle' />\n {$altered_image}\n <a id='bn-{$sec['func_name']}' onclick='parent.template_load_editor(\"{$sec['func_name']}\", event)' href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template-edit-bit&bitname={$sec['func_name']}&p={$sec['_p']}&id={$sec['_id']}&group_name={$sec['group_name']}&type=single' title='название шаблона: {$sec['func_name']}'>{$sec['easy_name']}</a>\n {$custom_bit}\n </div>\n</div>\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}",
"function generateBit($freq = array(), $codes = array()){\n\t\t$bit = \"\";\t\t//inisialisasi bit\n\n\t for($i = 0; $i < strlen($this->textInside); $i++)\t\t//melakukan perulangan sebanyak text \n\t $bit.=$codes[array_search($this->textInside[$i], array_keys($freq))]; //mencari char ke-i dalam freq dan menambahkannya ke dalam bit\n\n\t return $bit;\t\t//mengembalikan nilai bit\n\t}",
"public function getBits(): int;",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function xlsBOF() {\r\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\r\nreturn;\r\n}",
"function packStartSoundTag($CharacterID, $SOUNDINFO)\n\t{\n\t\tarray_push($this->FMDebug, \"packStartSoundTag\");\n\n\t\t$TagID = 15;\n\n\t\t$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;\n\n\t\t$TagLength = strlen($StartSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"public static function png32()\n {\n return new FlagQualifier(self::PNG32);\n }",
"function define_image_vars ( ) {\r\n\t\t/*\r\n\t\t * Changlog\r\n\t\t * v1.1, November 11, 2009\r\n\t\t * - Cleaned\r\n\t\t */\r\n\t\tglobal $IMAGE_TYPE_EXTS, $IMAGE_TYPE_EXT, $IMAGE_TYPE_READFUNCTION, $IMAGE_TYPE_WRITEFUNCTION, $IMAGE_CODE_TYPE, $IMAGE_SUPPORTED_READ_TYPES, $IMAGE_SUPPORTED_READ_EXTENSIONS, $IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS, $IMAGE_SUPPORTED_WRITE_TYPES, $IMAGE_SUPPORTED_WRITE_EXTENSIONS, $IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS, $IMAGE_SUPPORTED_TYPES, $IMAGE_SUPPORTED_EXTENSIONS, $IMAGE_SUPPORTED_TYPES_EXTENSIONS;\r\n\t\tif ( isset($IMAGE_TYPE_EXTS) )\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t$IMAGE_TYPE_EXTS = array(IMAGETYPE_GIF => array('gif'), IMAGETYPE_JPEG => array('jpeg', 'jpg', 'jpe'), IMAGETYPE_JPEG2000 => array('jpeg', 'jpg', 'jpe'), IMAGETYPE_PNG => array('png'), IMAGETYPE_PSD => array('psd'), IMAGETYPE_BMP => array('bmp'), IMAGETYPE_TIFF_II => array('tiff'), IMAGETYPE_TIFF_MM => array('tiff'), IMAGETYPE_JPC => array('jpc'), IMAGETYPE_JP2 => array('jp2'), IMAGETYPE_JPX => array('jpx'), IMAGETYPE_JB2 => array('jb2'), IMAGETYPE_SWF => array('swf'), IMAGETYPE_SWC => array('swc'), IMAGETYPE_IFF => array('iff'), IMAGETYPE_WBMP => array('wbmp'), IMAGETYPE_XBM => array('xbm'));\r\n\t\t$IMAGE_TYPE_EXT = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_READ_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_READ_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_WRITE_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_WRITE_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_TYPE_READFUNCTION = array();\r\n\t\t$IMAGE_TYPE_WRITEFUNCTION = array();\r\n\t\t\r\n\t\tforeach ( $IMAGE_TYPE_EXTS as $image_type => $image_extensions ) {\r\n\t\t\t// Check type\r\n\t\t\tforeach ( $image_extensions as $image_extension ) {\r\n\t\t\t\t// Check read\r\n\t\t\t\t$image_read_function = 'imagecreatefrom' . $image_extension;\r\n\t\t\t\t$image_supported_read = function_exists($image_read_function);\r\n\t\t\t\tif ( $image_supported_read ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t}\r\n\t\t\t\t// check write\r\n\t\t\t\t$image_write_function = 'image' . $image_extension;\r\n\t\t\t\t$image_supported_write = function_exists($image_write_function);\r\n\t\t\t\tif ( $image_supported_write ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t}\r\n\t\t\t\t// Check overall\r\n\t\t\t\tif ( $image_supported_read && $image_supported_write ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_TYPE_EXT[$image_type] = $image_extension;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t\t$IMAGE_TYPE_WRITEFUNCTION[$image_type] = $image_write_function;\r\n\t\t\t\t\t$IMAGE_TYPE_READFUNCTION[$image_type] = $image_read_function;\r\n\t\t\t\t\t// Done we work\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t// Continue\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Done\r\n\t\treturn true;\r\n\t}",
"function xlsBOF() { \necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); \nreturn; \n}",
"function xlsBOF() \n{\necho pack(\"ssssss\", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);\nreturn;\n}"
] |
[
"0.79386944",
"0.734408",
"0.7009969",
"0.68176705",
"0.6501725",
"0.5843437",
"0.57410514",
"0.5719129",
"0.5573473",
"0.5523145",
"0.5471826",
"0.54699826",
"0.54532945",
"0.5400485",
"0.53236556",
"0.52690977",
"0.52354395",
"0.51948726",
"0.5099099",
"0.50602084",
"0.5039152",
"0.5033824",
"0.5024561",
"0.5024561",
"0.5024561",
"0.50174296",
"0.50030965",
"0.4981456",
"0.49804845",
"0.49787766"
] |
0.81631297
|
0
|
string packJPEGTablesTag( string BitmapJPEGEncoding) returns an SWF JPEGTablesTag string. TagID: 8
|
function packJPEGTablesTag($BitmapJPEGEncoding)
{
array_push($this->FMDebug, "packJPEGTablesTag");
$TagID = 8;
$TagLength = strlen($BitmapJPEGEncoding);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapJPEGEncoding;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function parseJPEGfile($filename)\n\t{\n\t\tarray_push($this->FMDebug, \"parseJPEGfile\");\n\n\t\t$SOI = chr(0xff) . chr(0xd8);\n\t\t$APP0 = chr(0xff) . chr(0xe0);\n\t\t$DQT = chr(0xff) . chr(0xdb);\n\t\t$SOF0 = chr(0xff) . chr(0xc0);\n\t\t$SOF1 = chr(0xff) . chr(0xc1);\n\t\t$SOF2 = chr(0xff) . chr(0xc2);\n\t\t$DHT = chr(0xff) . chr(0xc4);\n\t\t$DRI = chr(0xff) . chr(0xdd);\n\t\t$SOS = chr(0xff) . chr(0xda);\n\t\t$EOI = chr(0xff) . chr(0xd9);\n\t\t$COM = chr(0xff) . chr(0xfe);\n\n\t\t$filearray = array(\"JPEGEncoding\" => \"\", \"JPEGImage\" => \"\");\n\n\t\t$filehandle = fopen($filename, \"r\");\n\n\t\tif ($filehandle == FALSE) {\n\t\t\t$this->FMError(\"parseJPEGfile cannot open file\");\n\t\t}\n\n\t\t$jpeg = fread($filehandle, filesize($filename));\n\n\t\tfclose($filehandle);\n\n\t\t$marker = strpos($jpeg, $SOI);\n\n\t\t$jpeg = substr($jpeg, $marker);\n\n\t\t$loop = True;\n\n\t\twhile ($loop == True) {\n\n\t\t\tif (strlen($jpeg) == 0) {\n\t\t\t\t$loop = False;\n\t\t\t}\n\n\t\t\tswitch (substr($jpeg, 0, 2)) {\n\n\t\t\t\tcase $SOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] = $SOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] = $SOI;\n\t\t\t\t\t$jpeg = substr($jpeg, 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $APP0:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DQT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $SOF0:\n\t\t\t\tcase $SOF1:\n\t\t\t\tcase $SOF2:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$filearray[\"width\"] = ord(substr($jpeg, 7, 1)) * 256 + ord(substr($jpeg, 8, 1));\t\n\t\t\t\t\t$filearray[\"height\"] = ord(substr($jpeg, 5, 1)) * 256 + ord(substr($jpeg, 6, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DHT:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $DRI:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase $COM:\n\n\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $EOI:\n\n\t\t\t\t\t$filearray[\"JPEGEncoding\"] .= $EOI;\n\t\t\t\t\t$filearray[\"JPEGImage\"] .= $EOI;\n\t\t\t\t\t$loop = False;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif (substr($jpeg, 0, 2) == $SOS) {\n\n\t\t\t\t\t\t$blocklength = ord(substr($jpeg, 2, 1)) * 256 + ord(substr($jpeg, 3, 1));\t\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $blocklength + 2);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $blocklength + 2);\n\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t$foundsos = True;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ($foundsos) {\n\t\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, 1);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, 1);\n\t\t\t\t\t\t\t$marker = strpos($jpeg, chr(255));\n\t\t\t\t\t\t\t$filearray[\"JPEGImage\"] .= substr($jpeg, 0, $marker);\n\t\t\t\t\t\t\t$jpeg = substr($jpeg, $marker);\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$this->FMError(\"parseJPEGfile error parsing JPEG file file\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $filearray;\n\t}",
"function encode_trans3($text,$table_file='gb2big5') {\n // $str = fread($fp,strlen($table_file.'.table')); \n // fclose($fp); \n $max=strlen($text)-1; \n for($i=0;$i<$max;$i++) { \n $h=ord($text[$i]); \n if($h>=160) { \n $l=ord($text[$i+1]); \n if($h==161 && $l==64) { \n $text[$i]=' '; \n $text[++$i]=' '; \n }else{ \n $pos = ($h-160)*510+($l-1)*2; \n $text[$i]=$str[$pos]; \n $text[++$i]=$str[$pos+1]; \n } \n } \n } \n return $text; \n}",
"abstract protected function encodingTables();",
"public function getImageTag();",
"function big52gb( $instr )\n{\n\t\t$stream = fopen( LIB_DIR.\"/tables/big5-gb.tab\", \"r\" );\n\t\t$len = strlen( $instr );\n\t\t$i = 0;\n\t\tfor ( ;\t$i < $len;\t++$i\t)\n\t\t{\n\t\t\t\t$h = ord( $instr[$i] );\n\t\t\t\tif ( 160 <= $h )\n\t\t\t\t{\n\t\t\t\t\t\t$l = ord( $instr[$i + 1] );\n\t\t\t\t\t\tif ( $h == 161 && $l == 64 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$gb = \" \";\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\tfseek( $fp, ( ( $h - 160 ) * 255 + $l - 1 ) * 3 );\n\t\t\t\t\t\t\t\t$gb = fread( $fp, 2 );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$instr[$i] = $gb[0];\n\t\t\t\t\t\t$instr[$i + 1] = $gb[1];\n\t\t\t\t\t\t++$i;\n\t\t\t\t}\n\t\t}\n\t\tfclose( $fp );\n\t\treturn $instr;\n}",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function encode(/*$newwidth, $newheight*/)\n {\n $newwidth = $this->currImgWidth;//$this->imgWidth;\n $newheight = $this->currImgHeight;//$this->imgHeight;\n if (!$this->outFile) {\n $this->outFile = $this->srcFile;\n }\n $mystring = '';\n $this->pointer = 0;\n $this->imagedata = array();\n $this->imageinfo = array();\n $this->handle = 0;\n $this->index = 0;\n\n $k = 0;\n foreach ($this->parsedfiles as $imagepart) {\n $this->loadfile($imagepart);\n $this->get_gif_header();\n $this->get_application_data();\n $this->get_comment_data();\n $this->get_graphics_extension(0);\n $this->get_image_block(0);\n\n //get transparent color index and color\n if (isset($this->encdata[$this->index - 1])) {\n $gxdata = $this->encdata[$this->index - 1]['graphicsextension'];\n } else {\n $gxdata = null;\n }\n $ghdata = $this->imageinfo['gifheader'];\n $trcolor = '';\n $hastransparency = $gxdata[3];\n\n if ($hastransparency) {\n $trcx = ord($gxdata[6]);\n $trcolor = substr($ghdata, 13 + $trcx * 3, 3);\n }\n\n //global color table to image data;\n $this->transfercolortable($this->imageinfo['gifheader'], $this->imagedata[$this->index - 1]['imagedata']);\n\n $imageblock = &$this->imagedata[$this->index - 1]['imagedata'];\n\n //if transparency exists transfer transparency index\n if ($hastransparency) {\n $haslocalcolortable = ((ord($imageblock[9]) & 128) === 128);\n if ($haslocalcolortable) {\n //local table exists. determine boundaries and look for it.\n $tablesize = (pow(2, (ord($imageblock[9]) & 7) + 1) * 3) + 10;\n $this->orgvars[$this->index - 1]['transparent_color_index'] =\n ((strrpos(substr($this->imagedata[$this->index - 1]['imagedata'], 0, $tablesize), $trcolor) - 10) / 3);\n } else {\n //local table doesnt exist, look at the global one.\n $tablesize = (pow(2, (ord($gxdata[10]) & 7) + 1) * 3) + 10;\n $this->orgvars[$this->index - 1]['transparent_color_index'] =\n ((strrpos(substr($ghdata, 0, $tablesize), $trcolor) - 10) / 3);\n }\n }\n\n //apply original delay time,transparent index and disposal values to graphics extension\n\n if (!$this->imagedata[$this->index - 1]['graphicsextension']) {\n $this->imagedata[$this->index - 1]['graphicsextension'] = chr(0x21).chr(0xf9).chr(0x04).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00);\n }\n\n $imagedata = &$this->imagedata[$this->index - 1]['graphicsextension'];\n\n $imagedata[3] = chr((ord($imagedata[3]) & 0xE3) | ($this->orgvars[$this->index - 1]['disposal_method'] << 2));\n $imagedata[4] = chr($this->orgvars[$this->index - 1]['delay_time'] % 256);\n $imagedata[5] = chr(floor($this->orgvars[$this->index - 1]['delay_time'] / 256));\n if ($hastransparency) {\n $imagedata[6] = chr($this->orgvars[$this->index - 1]['transparent_color_index']);\n }\n $imagedata[3] = chr(ord($imagedata[3]) | $hastransparency);\n\n //apply calculated left and top offset\n $imageblock[1] = chr(round(($this->orgvars[$this->index - 1]['offset_left'] * $this->wr) % 256));\n $imageblock[2] = chr(floor(($this->orgvars[$this->index - 1]['offset_left'] * $this->wr) / 256));\n $imageblock[3] = chr(round(($this->orgvars[$this->index - 1]['offset_top'] * $this->hr) % 256));\n $imageblock[4] = chr(floor(($this->orgvars[$this->index - 1]['offset_top'] * $this->hr) / 256));\n\n if ($this->index === 1) {\n if (!isset($this->imageinfo['applicationdata']) || !$this->imageinfo['applicationdata']) {\n $this->imageinfo['applicationdata'] = chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0'.chr(0x03).chr(0x01).chr(0x00).chr(0x00).chr(0x00);\n }\n\n if (!isset($this->imageinfo['commentdata']) || !$this->imageinfo['commentdata']) {\n //$this->imageinfo[\"commentdata\"] = chr(0x21).chr(0xfe).chr(0x10).\"PHPGIFRESIZER1.0\".chr(0);\n $this->imageinfo['commentdata'] = chr(0x21).chr(0xfe).chr(0x10).'MONTENIGGER_____'.chr(0);\n }\n $mystring .= $this->orgvars['gifheader'].$this->imageinfo['applicationdata'].$this->imageinfo['commentdata'];\n if (isset($this->orgvars['hasgx_type_0']) && $this->orgvars['hasgx_type_0']) {\n $mystring .= $this->globaldata['graphicsextension_0'];\n }\n if (isset($this->orgvars['hasgx_type_1']) && $this->orgvars['hasgx_type_1']) {\n $mystring .= $this->globaldata['graphicsextension'];\n }\n }\n\n $mystring .= $imagedata.$imageblock;\n $k++;\n $this->closefile();\n }\n\n $mystring .= chr(0x3b);\n\n //applying new width & height to gif header\n $mystring[6] = chr($newwidth % 256);\n $mystring[7] = chr(floor($newwidth / 256));\n $mystring[8] = chr($newheight % 256);\n $mystring[9] = chr(floor($newheight / 256));\n $mystring[11] = $this->orgvars['background_color'];\n\n if (!file_put_contents($this->outFile, $mystring)) {\n throw new ImageException('outfile write failed');\n }\n }",
"abstract protected function _getEncodingTable();",
"function packEndTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packEndTag\");\n\n\t\t$TagID = 0;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"abstract protected function encodingTablesOrder();",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function kdw_row_tiles_txt_img (){ \r\n \r\n}",
"function packFrameLabelTag($Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packFrameLabelTag\");\n\n\t\t$TagID = 43;\n\t\t$Label = $this->packSTRING($Label);\n\t\t$TagLength = strlen($Label);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packASSET($Tag, $Label)\n\t{\n\t\tarray_push($this->FMDebug, \"packASSET\");\n\n\t\t$atom = $this->packUI16($Tag);\n\t\t$atom .= $this->packSTRING($Label);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function wm_write_metadata($image_id)\n{\n global $conf, $logger;\n \n $query = '\nSELECT\n img.name,\n img.comment,\n img.author,\n img.date_creation,\n GROUP_CONCAT(tags.name) AS tags,\n img.path,\n img.representative_ext\n FROM '.IMAGES_TABLE.' AS img\n LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id\n LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id\n WHERE img.id = '.$image_id.'\n GROUP BY img.id, img.name, img.comment, img.author, img.path, img.representative_ext\n;';\n $result = pwg_query($query);\n $row = pwg_db_fetch_assoc($result);\n\n $name = wm_prepare_string($row['name'], 256);\n $description = wm_prepare_string($row['comment'], 2000);\n $author = wm_prepare_string($row['author'], 32);\n\n $command = isset($conf['exiftool_path']) ? $conf['exiftool_path'] : 'exiftool';\n $command.= ' -q';\n\n if (strlen($name) > 0)\n {\n # 2#105 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Headline=\"'.$name.'\"';\n\n # 2#005 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:ObjectName=\"'.wm_cutString($name, 64).'\"';\n }\n\n if (strlen($description) > 0)\n {\n # 2#120 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Caption-Abstract=\"'.$description.'\"';\n }\n\n if (strlen($author) > 0)\n {\n # 2#080 in iptcparse($imginfo['APP13'])\n $iptc_field = 'By-line';\n\n if (\n $conf['use_iptc']\n and isset($conf['use_iptc_mapping']['author'])\n and '2#122' == $conf['use_iptc_mapping']['author']\n )\n {\n # 2#122 in iptcparse($imginfo['APP13'])\n $iptc_field = 'Writer-Editor';\n }\n\n $command.= ' -IPTC:'.$iptc_field.'=\"'.$author.'\"';\n }\n \n if (strlen($row['tags']) > 0)\n {\n $tags = explode(',', $row['tags']);\n foreach ($tags as $tag)\n {\n $tag = wm_prepare_string($tag, 64);\n\n # 2#025 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Keywords=\"'.$tag.'\"';\n }\n }\n\n $command.= ' \"'.$row['path'].'\"';\n $command.= ' 2>&1';\n // echo $command;\n $logger->info(__FUNCTION__.' command = '.$command);\n\n $exec_return = exec($command, $output, $rc);\n // echo '$exec_return = '.$exec_return.'<br>';\n // echo '<pre>'; print_r($output); echo '</pre>';\n\n // as derivatives may contain metadata, they must be reset\n delete_element_derivatives($row);\n\n return array($rc, $output);\n}",
"function packZLIBBITMAPDATA($ColorTableRGB, $BitmapPixelData)\n\t{\n\t\tarray_push($this->FMDebug, \"packZLIBBITMAPDATA\");\n\n\t\t$atom = $ColorTableRGB . $BitmapPixelData;\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function re_generate_chinese_tags($tag_arr)\n\t {\n\t \t$result_data = array(); \n\t \t$pre_tag_data = $this->tag_extract->name_entity_retrieve($tag_arr);\n\t \t$result_data['location'] = isset($pre_tag_data['ns']) ? $pre_tag_data['ns'] : array();\n\t \t$result_data['tag'] = array();\n\t \t\n\t \tforeach($pre_tag_data as $key=>$item)\n\t \t{//merge all the name tags together, exclude 'ns'(location tags)\n\t \t\tif('ns' != $key)\n\t \t\t{\n\t \t\t\t$result_data['tag'] = array_merge($result_data['tag'], $item);\n\t \t\t} \n\t \t}\n\t \treturn $result_data;\n\t }",
"function encode_advanced_rle(string $path_to_encode, string $result_path) {\n // check if the picture exist\n if (!file_exists($path_to_encode)) return 1;\n $codemotif = \"\";\n $hexa = bin2hex(file_get_contents($path_to_encode));\n $taille = strlen($hexa);\n\n // set a space all the two carracters. I'm gonna call it a motif\n for ($i = 1; $i < $taille; $i += 2)\n $codemotif = $codemotif.$hexa[$i-1].$hexa[$i].' ';\n \n $taille2 = strlen($codemotif);\n $compress = \"\";\n\n $i = 2;\n while ($i <= $taille2 - 3) {\n // compare the motifs two by two, and since they are equal, concatenate them.\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n $count = 0;\n if ($pack == $pack2) {\n $count++;\n do {\n $count++;\n $i += 3;\n if ($i+1 >= $taille2) break;\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n } while ($pack == $pack2);\n $compress .= $count.' '.$pack;\n $i += 3;\n if ($i+1 >= $taille2) break;\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n $count = 0;\n }\n // compare the motifs two by two, and since they are differents.\n if ($pack != $pack2) {\n $j = $i;\n do {\n $count++;\n $i += 3; \n if ($i + 1 >= $taille2) {\n $count++;\n $i += 3;\n break;\n }\n $pack = $codemotif[$i-2].$codemotif[$i-1].' ';\n $pack2 = $codemotif[$i+1].$codemotif[$i+2].' ';\n } while ($pack != $pack2);\n $compress .= '00 '.$count.' ';\n // add the last motif if they are an odd number\n while ($j < $i) {\n $pack = $codemotif[$j-2].$codemotif[$j-1].' ';\n $compress = $compress.$pack;\n $j += 3;\n }\n }\n }\n\n // make a save \n if (file_exists($result_path)) unlink($result_path);\n file_put_contents($result_path, $compress);\n return 0;\n}",
"public static function getPredefinedEncodingTable($encoding) {}",
"public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }",
"function GetImgTitle( $spr, $img, $lang_id=NULL )\n {\n $tmp_db = DBs::getInstance();\n $q = \"SELECT * FROM `\".$spr.\"` WHERE `img`='\".$img.\"'\";\n if( !empty($lang_id) ) $q = $q .\" AND `lang_id`='\".$lang_id.\"'\";\n $res = $tmp_db->db_Query($q);\n //echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if ( !$res OR !$tmp_db->result ) return false;\n $row = $tmp_db->db_FetchAssoc();\n $retval = $row['name'];\n if( $this->make_encoding==1 AND !empty($this->encoding_from) AND !empty($this->encoding_to) ) {\n $retval = iconv($this->encoding_to, $this->encoding_from, $retval);\n }\n return strip_tags($retval);\n }",
"protected function _getEncodingTable() {}",
"protected function _getEncodingTable() {}",
"protected function _getEncodingTable() {}",
"protected function _parseTagTable() {}"
] |
[
"0.7031254",
"0.6447481",
"0.58611286",
"0.54457736",
"0.5268019",
"0.5124953",
"0.5090811",
"0.5032178",
"0.501785",
"0.49330118",
"0.49095833",
"0.4889974",
"0.48055092",
"0.4783662",
"0.47834405",
"0.47528788",
"0.4705607",
"0.46976468",
"0.4697321",
"0.4645206",
"0.46320876",
"0.4628108",
"0.46134627",
"0.4610443",
"0.46009788",
"0.45635116",
"0.45577523",
"0.45576623",
"0.45576623",
"0.45391127"
] |
0.83158267
|
0
|
string packSetBackgroundColorTag(integer R, integer G, integer B) return an SWF SetBackgroundColorTag string. TagID: 9
|
function packSetBackgroundColorTag($R, $G, $B)
{
array_push($this->FMDebug, "packSetBackgroundColorTag");
$TagID = 9;
$RGB = $this->packRGB($R, $G, $B);
$TagLength = strlen($RGB);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $RGB;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_tag_bg( $tag ) {\n $tag_bg = get_tag_data( $tag , 'tag_bg' );\n return $tag_bg;\n}",
"public function getBackgroundColor() {}",
"public function getBackgroundColor() {}",
"public function getBackgroundColor() {}",
"function get_background_color()\n {\n }",
"function setBackground($c1 = 0xEEEEEE, $c2 = false)\n {\n if ($c2 === false) {\n $c2 = $c1;\n }\n $this->bg1 = $this->hexcol($c1);\n $this->bg2 = $this->hexcol($c2);\n }",
"function setBackground($c1 = 0xEEEEEE, $c2 = false)\n {\n if ($c2 === false) {\n $c2 = $c1;\n }\n $this->bg1 = $this->hexcol($c1);\n $this->bg2 = $this->hexcol($c2);\n }",
"public function setBackgroundColor($backgroundColor) {}",
"function background_color()\n {\n }",
"function packRGB($R, $G, $B)\n\t{\n\t\tarray_push($this->FMDebug, \"packRGB\");\n\n\t\t$atom = $this->packUI8($R);\n\t\t$atom .= $this->packUI8($G);\n\t\t$atom .= $this->packUI8($B);\n\n\t\tarray_pop($this->FMDebug);\n\n\t\treturn $atom;\n\t}",
"function pl_bg_color(){\n\t\n\tif( pl_check_color_hash( get_set_color( 'the_bg' ) ) )\n\t\treturn get_set_color( 'the_bg' );\n\telse \n\t\treturn 'FFFFFF';\t\n}",
"public function setBackgroundColor($color) {}",
"public static function set_instance( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n global $edb;\n\n $tag_id = (int) $tag_id;\n\n $_tag = self::get_instance( $tag_id );\n\n $tag_name = !empty($tag_name) ? _text( $tag_name, 32 ) : $_tag->tag_name;\n $tag_color = !empty($tag_color) ? _hexadec($tag_color) : $_tag->tag_color;\n $tag_bg = !empty($tag_bg) ? _hexadec($tag_bg) : $_tag->tag_bg;\n\n $edb->update('tags', 'tag_name,tag_color,tag_bg', \"'$tag_name', '#$tag_color', '#$tag_bg'\", \"tag_id_PK = $tag_id\" );\n }",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function backgroundColor(array $color);",
"function imagesetstyle($image, $style)\n{\n}",
"function get_tag_color( $tag ) {\n $tag_color = get_tag_data( $tag , 'tag_color' );\n return $tag_color;\n}",
"public function background($color, $quality=null);",
"function BeforeShowView(&$xt, &$templatefile, &$values, &$pageObject)\n{\n\n\t\tif ($values['Color']) {\n\t$xt->assign(\"bgc_category\",'style=\"background:'.$values['Color'].';\" ');\n}\n\n\n;\t\t\n}",
"function update_tag( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::set_instance( $tag_id, $tag_name, $tag_color, $tag_bg );\n return $tag;\n}",
"public function backgroundColor(int $r = 0, int $g = 0, int $b = 0)\n {\n $this->label.= \"48;2;$r;$g;$b;\";\n return $this;\n\n }",
"private function get_colored($string = \" [ info ] \", $cix = 6) {\n return (Validator::equals($this->color,true) && Validator::isa($cix,\"integer\")\n ? hex2bin(\"1b\").$this->colors[$cix].$string.\n hex2bin(\"1b\").$this->colors[count($this->colors)-1]\n : $string);\n }",
"function bgColor() {\n\t$color = dechex(rand(0x000000, 0xDDDDDD));\n\treturn \"#{$color}\";\n}",
"private function set_background_color()\n {\n imagecolorallocate(\n $this->img,\n L_BACKGROUND_COLOR_R,\n L_BACKGROUND_COLOR_G,\n L_BACKGROUND_COLOR_B\n );\n }",
"public function setBackgroundColor($var)\n {\n GPBUtil::checkInt32($var);\n $this->backgroundColor = $var;\n\n return $this;\n }",
"public static function background($value)\n {\n self::$background = Color::toRGBA($value);\n }",
"public function tag()\n\t{\n\t\t/* Example usage:\n\t\t{exp:crush:tag \n\t\t\tfilename=\"/_assets/css/style.css\"\n\t\t\tminify=\"y\"\n\t\t\tvars=\"my_var1=#333|my_var2=20px\"\n\t\t\tattributes=\"media=print|title=monkey\"\n\t\t} \n\t\t*/\n\t\treturn csscrush_tag(\n\t\t\t$this->filename, \n\t\t\t$this->get_params(FALSE, array('filename', 'attributes')),\n\t\t\t$this->attributes\n\t\t);\n\n\t}",
"public function getBackgroundColor()\n {\n return $this->backgroundColor;\n }",
"function stringrgb($arr){\r\n\treturn \"RGB(\".$arr[0].\",\".$arr[1].\",\".$arr[2].\")\";\r\n}",
"protected function setBgColor():void{\n\n\t\tif(isset($this->background)){\n\t\t\treturn;\n\t\t}\n\n\t\tif($this::moduleValueIsValid($this->options->bgColor)){\n\t\t\t$this->background = $this->prepareModuleValue($this->options->bgColor);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->background = $this->prepareModuleValue([255, 255, 255]);\n\t}"
] |
[
"0.5744463",
"0.5722278",
"0.5721587",
"0.5721587",
"0.5714087",
"0.5615828",
"0.5615828",
"0.5589299",
"0.55334467",
"0.5501269",
"0.54330194",
"0.51138276",
"0.51073486",
"0.5097645",
"0.50713974",
"0.5008555",
"0.497067",
"0.49545133",
"0.49510744",
"0.49480376",
"0.49454364",
"0.49339873",
"0.49303386",
"0.49297628",
"0.4928538",
"0.48834574",
"0.48349783",
"0.48088282",
"0.48000002",
"0.47966653"
] |
0.8187415
|
0
|
string packDefineSoundTag(integer CharacterID, integer SoundFormat, integer SoundRate, integer SoundSize, integer SoundType, integer SoundSampleCount, string SoundFile) returns an SWFDefineSoundTag string. TagID: 14
|
function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)
{
array_push($this->FMDebug, "packDefineSoundTag");
#error_log("here--");
$TagID = 14;
$DefineSoundTag = $this->packnBits($SoundFormat, 4);
$DefineSoundTag .= $this->packnBits($SoundRate, 2);
$DefineSoundTag .= $this->packnBits($SoundSize, 1);
$DefineSoundTag .= $this->packnBits($SoundType, 1);
$DefineSoundTag = $this->packBitValues($DefineSoundTag);
$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;
$DefineSoundTag .= $this->packUI32($SoundSampleCount);
$file_handle = fopen($SoundFile, "r");
$file = fread($file_handle, filesize($SoundFile));
fclose($file_handle);
if ($SoundFormat == 2) {
$DefineSoundTag .= $this->packUI16(10) . $file;
}
$TagLength = strlen($DefineSoundTag);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packStartSoundTag($CharacterID, $SOUNDINFO)\n\t{\n\t\tarray_push($this->FMDebug, \"packStartSoundTag\");\n\n\t\t$TagID = 15;\n\n\t\t$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;\n\n\t\t$TagLength = strlen($StartSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG2Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG2Tag\");\n\n\t\t$TagID = 21;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGEncoding . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineBitsJPEG3Tag($BitmapID, $BitmapJPEGEncoding, $BitmapJPEGImage, $BitmapAlphaData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsJPEG3Tag\");\n\n\t\t$TagID = 35;\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$Offset = $this->packUI32(strlen($BitmapJPEGEncoding . $BitmapJPEGImage));\n\t\t$TagLength = strlen($BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $Offset . $BitmapJPEGEncoding . $BitmapJPEGImage . $BitmapAlphaData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function makeSound()\n {\n echo 'Maw Maw....<br>';\n }",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function makeSound()\n {\n echo 'Wow wow....<br>';\n }",
"public function getSoundPackName(): ?string\n {\n return $this->getParam(self::SOUND_PACK_NAME);\n }",
"public function sound_mp3()\n\t{\n\t\tif (preg_match('/.+[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Terraplane Sun - Funnel of Love.mp3\" - 21.55 MB - (1/6) - yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}\\(\\d+\\/(\\d+\\))[ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk09920 - [01/12] - \"Guido Negraszus - Night Cafe Iii (Freedom Travellers) (2012)(320).par2\" yEnc\n\t\tif (preg_match('/^trtk\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(LUNATIC SOUL - IMPRESSIONS) [00/18] - \"Lunatic Soul - Impressions 2011.nzb\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/8] - \"Black Market Flowers - Bind (1993).sfv\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[1/1] - (150 MP3 Album Charts) - \"Atlantean Kodex - The White Goddess.rar\" yEnc\n\t\t//[1/1] - (MP3 Album Charts) - \"Black Sabbath - 13.rar\" yEnc\n\t\t//[1/1] - (Top100 Album Charts) - \"Bastille - Pompeii.rar\" yEnc\n\t\t//[1/1] - (Top100 Charts) - \"Beatrice Egli - Gluecksgefuehle.rar\" yEnc\n\t\t//[1/1] - (Top100 Single Charts) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(((Top)?\\d+ )?(MP3 )?((Album|Single) )?Charts\\)[ -]{0,4}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - (Album Top 100) - \"[Dance] David Guetta - One Love (2010) .rar\" yEnc\n\t\t//[1/1] - (Album Top 100) - \"Aerosmith - Music From Another Dimension.rar\" yEnc\n\t\t//[1/1] - Album Top 100 - \"ACDC - Live At River Plate.rar\" yEnc\n\t\t//[1/1] (Album Top 100 - 2012) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\t//[1/1] (Album Top 100 2012) - \"Asaf Avidan And The Mojos - One Day.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}(\\()?(Album|Single) Top \\d+ ([- ]{0,2}\\d+)?(\\))? - \"(\\[.+?\\] )?(.+?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - Top 100 Album Charts 2012 - \"Aura Dione feat. Rock Mafia - Friends.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Top \\d+ Album Charts \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<>usenet-piraten.info<>partner<>ssl-news.info<> - [10/10] - \"Overexposed (Deluxe Version).vol31+23.par2\" yEnc\n\t\tif (preg_match('/^.+usenet-piraten\\.info.+ - \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Adam Levine (Maroon 5) & Alicia Keys - Daylight & Girl on fire LIVE 55TH GRAMMY AWARDS 320Kpbs.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/4) - VERBAteam present - \"Avril Lavigne - Rock 'N Roll (Official Audio).mp3\" - 5,80 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - VERBAteam present - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - (Album Top 1000) - \"Davis, Miles - Complete Live at the Plugged Nickel 1965.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(Album Top \\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - Album Top 100 - \"Rammstein - Made In Germany 1995-2011.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Album Top \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Andrea Berg - My Danish Collection (2013) by dem verrückten Lordi (14/27) \"Andrea Berg - My Danish Collection (2013).par2\" - 132,74 MB 150920134 yEnc\n\t\t//Der Deutsche Beat Mix Teil 2 auf wunsch (by dem verrückten Lordi) (2/9) \"Der Deutsche Beat Mix Teil 3 Back.jpg\" - 117,84 MB 13.11.05 yEnc\n\t\tif (preg_match('/^(.+?) (\\()?by dem verrückten Lordi(\\))? {1,2}\\(\\d+\\/\\d+\\) \".+?' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB].+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Christian Anders - Tief in dir (15/24) \"Christian Anders - Tief In Dir Back.jpg\" - 58,56 MB by dem verrückten Lordi 0703123 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}by dem verrückten Lordi.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Der etwas andere Mix - Wilde Herzenmix (auf wunsch) neu (by dem verrückten Lordi) (1/8) \"Der etwas andere Mix - Wilde Herzenmix.par2\" yEnc\n\t\tif (preg_match('/^Der etwas.+ - (.+) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Full Discography - The Cranberries (01/47) \"Full Discography - The Cranberries.par2\" - 3,52 GB 2812111 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}\\d+ yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //jean ferrat année 1967 à 1969 meil29 \"17 Rien à voir.mp3\" yEnc\n\t\tif (preg_match('/^(.+?) meil29 \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Selected Songs by Various Artists - Depeche Mode - Personal Jesus (Acoustic Version).mp3 yEnc\n\t\tif (preg_match('/^Selected Songs by Various Artists - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"public function createSmil(){\n\n try {\n\n $smil = $this->song->songId.\"_song.smil\";\n $streamUrl = 'vod/smil:'.$smil.'/playlist.m3u8';\n /* $this->song->smilFile = $slim;\n $this->song->streamUrl = $streamUrl;*/\n $this->song->update([\n 'smilFile' => $smil,\n 'streamUrl' => $streamUrl,\n ]);\n\n $smilfile = fopen(\"newfile.smil\", \"w\") or die(Log::error(\"something went wrong\"));\n $txt = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <smil title=\"Audio SMIL\">\n <body>\n <switch><audio src=\"mp3:'.$this->song->songId.'_song.mp3\"> \n <param name=\"audioBitrate\" value=\"128000\" valuetype=\"data\"></param> \n </audio>\n </switch>\n </body>\n </smil>';\n fwrite($smilfile, $txt);\n fclose($smilfile);\n\n // $extn = $smilfile->getClientOriginalExtension();\n $smil_fileName = $smil;\n $imageController = new ImageController();\n $trackPath = $imageController->UploadSmil('smil', $smilfile, $smil_fileName, $this->song->songId);\n }catch (Exception $exception){\n Log::error($exception->getMessage());\n }\n\n\n\n }",
"function packDefineBitsPtrTag($Pointer)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsPtrTag\");\n\n\t\t$TagID = 1023;\n\n\t\t$TagLength = strlen($this->packUI32($Pointer));\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $Label;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape3Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape3Tag\");\n\n\t\t$TagID = 32;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function getAudioCodec() {}",
"function packDefineBitsLossless2Tag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData2)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLossless2Tag\");\n\n\t\t$TagID = 36;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData2;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function readShort();",
"public function sounds_mp3_electronic()\n\t{\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(2/7) \"Cosmic Baby live at Energy 1995.vol00+01.PAR2\" - 0 B - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+ [bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[0sk]-[2002-12-06]-[idm]-[vinyl]-[4/5]-[Maps_And_Diagrams_-_Ti_Sta_Bene_Marone-(cact_001)-Vinyl-2002]--cact 001.sfv yEnc\n\t\tif (preg_match('/^\\[0sk\\]-\\[\\d+-\\d+-\\d+\\]-\\[.+\\]-\\[.+\\]-\\[\\d+\\/\\d+\\]-\\[([\\w.,& ()\\[\\]\\'\\`-]{8,})\\]--.+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[10_years---happy_bday_absme]-[cd]-[04/15]-[va_-_spacewars_01-(plkcd003)-cd-1996-nwd]-01-Nuw Idol - Union Of Ilk -nwd-.mp3 yEnc\n\t\tif (preg_match('/^\\[.+\\]-\\[.+\\]-\\[\\d+\\/\\d+\\]-\\[([\\w.,& ()\\[\\]\\'\\`-]{8,})\\]-.+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Alec Empire - Low On Ice 06 - Untitled.mp3 yEnc\n\t\tif (preg_match('/^([\\w.,& ()\\[\\]\\'\\`-]{8,}?)[-_\\s]{0,3}\\d+[-_\\s]{0,3}[\\w.,& ()\\[\\]\\'\\`-]{8,}?\\b.?([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Selected Songs by Various Artists - Collide - Razor Sharp.mp3 yEnc\n\t\tif (preg_match('/^Selected Songs by Various Artists - ([^.]{8,})([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function sp_audio_sc( $atts ) {\n\n\textract( shortcode_atts( array(\n\t\t'mp3' => '',\n\t\t'ogg' => '',\n\t\t'width' => '',\n\t\t'height' => '',\n\t\t'preload' => false,\n\t\t'autoplay' => false,\n\t), $atts ) );\n\n\tglobal $post;\n\n\tif ( $mp3 )\n\t\t$mp3 = '<source src=\"' . $mp3 . '\" type=\"audio/mp3\" />';\n\n\tif ( $ogg )\n\t\t$ogg = '<source src=\"' . $ogg . '\" type=\"audio/ogg\" />';\n\n\tif ( $preload )\n\t\t$preload = 'preload=\"' . $preload . '\"';\n\n\tif ( $autoplay )\n\t\t$autoplay = 'autoplay';\n\n\t$output = \"<audio id='AudioPlayerV1-id-$post->ID' class='AudioPlayerV1' width='100%' height='29' controls {$preload} {$autoplay} data-fallback='\" . SP_BASE_URL . \"js/audioplayerv1.swf'>\n\t\t\t\t\t{$mp3}\n\t\t\t\t\t{$ogg}\n\t\t\t\t</audio>\";\n\n\treturn $output;\n\n}",
"function media_upload_audio()\n {\n }",
"function getAudio($office,$name){\n echo '<audio controls>';\n echo ' <source src=\"../' . $office . '-audio/' . $name . '.ogg\" />';\n echo ' <source src=\"../' . $office . '-audio/' . $name . '.mp3\" />';\n echo '</audio><br />'; \n }",
"function packDefineBitsLosslessTag($BitmapID, $BitmapFormat, $BitmapWidth, $BitmapHeight, $BitmapColorTableSize, $ZlibBitmapData)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsLosslessTag\");\n\n\t\t$TagID = 20;\n\n\t\t$BitmapID = $this->packUI16($BitmapID);\n\t\t$BitmapWidth = $this->packUI16($BitmapWidth);\n\t\t$BitmapHeight = $this->packUI16($BitmapHeight);\n\t\n\t\tswitch ($BitmapFormat) {\n\n\t\t\tcase 3:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI8($BitmapColorTableSize); \n\t\t\t\tbreak;\n\t\n\t\t\tcase 4:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI16($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\n\t\t\t\t$BitmapColorTableSize = $this->packUI32($BitmapColorTableSize); \n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$this->FMError(\"packDefineBitsLosslessTag illegal argument (BitmapFormat)\");\n\t\t}\n\n\t\t$BitmapFormat = $this->packUI8($BitmapFormat);\n\n\t\t$TagLength = strlen($BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData);\n\t\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapFormat . $BitmapWidth . $BitmapHeight . $BitmapColorTableSize . $ZlibBitmapData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function _audio($src, $atts = array()) {\n $files = array();\n $isExternal = media_isexternal($src);\n\n if ($isExternal) {\n // take direct source for external files\n list(/*ext*/, $srcMime) = mimetype($src);\n $files[$srcMime] = $src;\n } else {\n // prepare alternative formats\n $extensions = array('ogg', 'mp3', 'wav');\n $files = media_alternativefiles($src, $extensions);\n }\n\n $out = '';\n // open audio tag\n $out .= '<audio '.buildAttributes($atts).' controls=\"controls\">'.NL;\n $fallback = '';\n\n // output source for each alternative audio format\n foreach($files as $mime => $file) {\n if ($isExternal) {\n $url = $file;\n $linkType = 'externalmedia';\n } else {\n $url = ml($file, '', true, '&');\n $linkType = 'internalmedia';\n }\n $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));\n\n $out .= '<source src=\"'.hsc($url).'\" type=\"'.$mime.'\" />'.NL;\n // alternative content (just a link to the file)\n $fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);\n }\n\n // finish\n $out .= $fallback;\n $out .= '</audio>'.NL;\n return $out;\n }",
"public function getSound()\n {\n if (is_null($this->captcha)) {\n \\BDC_HttpHelper::BadRequest('captcha');\n }\n\n // identifier of the particular Captcha object instance\n $instanceId = $this->getInstanceId();\n if (is_null($instanceId)) {\n \\BDC_HttpHelper::BadRequest('instance');\n }\n\n // response headers\n \\BDC_HttpHelper::SmartDisallowCache();\n\n // response MIME type & headers\n $mimeType = $this->captcha->CaptchaBase->SoundMimeType;\n header(\"Content-Type: {$mimeType}\");\n header('Content-Transfer-Encoding: binary');\n\n // sound generation\n $rawSound = $this->captcha->CaptchaBase->GetSound($instanceId);\n return $rawSound;\n }",
"public static function soundSubtypeToString ($sndSubtype) {\n\t\t$val = NULL;\n\t\tswitch ($sndSubtype) {\n\t\t\tcase self::SOUND_SUBTYPE_PRF_SONG:\n\t\t\t\t$val = \"song\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_PRF_MEDLEY:\n\t\t\t\t$val = \"medley\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_PRF_INST:\n\t\t\t\t$val = \"instrumental\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_PRF_SPOKEN:\n\t\t\t\t$val = \"spoken or shtick\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_PRF_OTHER:\n\t\t\t\t$val = \"other\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_TALK_ANNC:\n\t\t\t\t$val = \"announcement\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_TALK_CONV:\n\t\t\t\t$val = \"conversation\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_TALK_AUCTION:\n\t\t\t\t$val = \"auction\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_TALK_SONGID:\n\t\t\t\t$val = \"song identification\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_TALK_OTHER:\n\t\t\t\t$val = \"other\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_NOISE_SETUP:\n\t\t\t\t$val = \"setup\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_NOISE_SILENCE:\n\t\t\t\t$val = \"silence\";\n\t\t\t\tbreak;\n\t\t\tcase self::SOUND_SUBTYPE_NOISE_OTHER:\n\t\t\t\t$val = \"other\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $val;\n\t}",
"function packDefineMorphShapeTag($ShapeID, $FromShapeBounds, $ToShapeBounds, $MorphFillStyles, $MorphLineStyles, $FromShape, $ToShape)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineMorphShapeTag\");\n\t\t$TagID = 46;\n\n\t\t$DefineMorphShapeTag = $this->packUI16($ShapeID) . $FromShapeBounds . $ToShapeBounds . $this->packUI32(strlen($MorphFillStyles . $MorphLineStyles . $FromShape)) . $MorphFillStyles . $MorphLineStyles . $FromShape . $ToShape;\n\n\t\t$TagLength = strlen($DefineMorphShapeTag);\n\n\t\t$this->AutoSetSWFVersion(5);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineMorphShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function ReceivedAudio($f, $t, $d, $byteRateAdjust)\n {\n $this->ok = 0;\n $this->dbg = $d;\n $this->chunksParsed = 0;\n $this->calcStart($t);\n $this->fileName = $f;\n if (!($fp = fopen($f, \"rb\")))\n {\n echo (\"Failed to open \" . $f);\n return;\n }\n $str = fread($fp, 4);\n if ($str == \"RIFF\") // all .WAV files must have this\n {\n $str = fread($fp, 4);\n for ($i = 3; $i >=0; $i--)\n {\n $this->hdrSize *= 256;\n $this->hdrSize += ord($str[$i]);\n }\n if ($this->dbg) echo (\"hdrSize = \" . $this->hdrSize . \"<br/>\");\n\n $str = fread($fp, 4);\n if ($str == \"WAVE\") // all .WAV files must have this\n {\n $str = fread($fp, 4); $this->fmt = $str;\n if ($str == \"fmt \") // all .WAV files must have this\n {\n $str = fread($fp, 4); $this->fmt .= $str;\n $chunkSize = 0;\n for ($i = 3; $i >=0; $i--)\n {\n $chunkSize *= 256;\n $chunkSize += ord($str[$i]);\n }\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->waveFormat = ord($str[0]) + 256 * ord($str[1]);\n if ($this->dbg) echo (\"File has format: \" . $this->waveFormat . \"<br/>\");\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->numChannels = ord($str[1]);\n $this->numChannels *= 256;\n $this->numChannels += ord($str[0]);\n if ($this->dbg) echo (\"File has \" . $this->numChannels . \" channels<br/>\");\n $str = fread($fp, 4); $this->fmt .= $str;\n for ($i = 3; $i >=0; $i--)\n {\n $this->sampleRate *= 256;\n $this->sampleRate += ord($str[$i]);\n }\n if ($this->dbg) echo (\"File has \" . $this->sampleRate . \" sample rate<br/>\");\n $str = fread($fp, 4); $this->fmt .= $str;\n for ($i = 3; $i >=0; $i--)\n {\n $this->byteRate *= 256;\n $this->byteRate += ord($str[$i]);\n }\n if ($this->dbg) echo (\"File has \" . $this->byteRate . \" byteRate<br/>\");\n $this->byteRateAdjusted = $this->byteRate * $byteRateAdjust;\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->blockAlign = ord($str[0]) + 256 * ord($str[1]);\n if ($this->dbg) echo (\"File has \" . $this->blockAlign . \" blockAlign<br/>\");\n $str = fread($fp, 2); $this->fmt .= $str;\n $this->bitsPerSample = ord($str[0]) + 256 * ord($str[1]);\n if ($this->dbg) echo (\"File has \" . $this->bitsPerSample . \" bitsPerSample<br/>\");\n if ($chunkSize > 16)\n {\n $this->extraFmt = fread($fp, $chunkSize-16); // keep whole fmt\n $this->fmt .= $this->extraFmt;\n }\n $this->firstData = ftell($fp);\n $str = fread($fp, 4);\n if ($str == \"data\")\n {\n $this->ok = 1;\n if ($this->dbg) echo (\"File \" . $f . \" is OK<br/>\");\n } else {if ($this->dbg) echo (\"File \" . $f . \" error on data block<br/>\");}\n } else {if ($this->dbg) echo (\"File \" . $f . \" is not 'fmt' file<br/>\"); }\n } else {if ($this->dbg) echo (\"File \" . $f . \" is not a WAVE file<br/>\"); }\n } else {if ($this->dbg) echo (\"File \" . $f . \" is wrong format<br/>\"); }\n \n fclose($fp);\n $this->approxLenSec = $this->hdrSize / $this->byteRateAdjusted;\n if ($this->dbg) echo (\"approxLenSec = \" . $this->approxLenSec . \"<br/>\");\n }",
"public function sounds_flac()\n\t{\n\t\tif (preg_match('/^\\[\\d+\\]-\\[.+?\\]-\\[.+?\\]-\\[ (.+?) \\]-\\[\\d+\\/\\d+] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[:SEK9:][FLAC/Metal]-[:Burn_The_Priest-Burn_The_Priest-Remastered-CD-FLAC-2005-TiLLMYDEATH:]-[01/18]-\"00-burn_the_priest-burn_the_priest-remastered-cd-flac-2005-proof.jpg\" yEnc\n\t\tif (preg_match('/^\\[:.+:\\]\\[FLAC.+\\]-\\[:(.+):\\]-\\[\\d+\\/\\d+\\]-\".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function wp_get_audio_extensions()\n {\n }"
] |
[
"0.7372805",
"0.60184455",
"0.5573899",
"0.55175984",
"0.5511013",
"0.5488809",
"0.5388187",
"0.538631",
"0.5335308",
"0.5314489",
"0.5255093",
"0.52126896",
"0.5138901",
"0.5058506",
"0.50426906",
"0.4987886",
"0.4984806",
"0.49796543",
"0.49604073",
"0.49479148",
"0.4920561",
"0.4902758",
"0.48172554",
"0.4811437",
"0.48080245",
"0.48039263",
"0.47979686",
"0.47790945",
"0.4752578",
"0.4741536"
] |
0.8407293
|
0
|
string packStartSoundTag(integer CharacterID, string SOUNDINFO) returns an SWFDefineSoundTag string. TagID: 15
|
function packStartSoundTag($CharacterID, $SOUNDINFO)
{
array_push($this->FMDebug, "packStartSoundTag");
$TagID = 15;
$StartSoundTag = $this->packUI16($CharacterID) . $SOUNDINFO;
$TagLength = strlen($StartSoundTag);
$this->AutoSetSWFVersion(1);
$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $StartSoundTag;
array_pop($this->FMDebug);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function packDefineSoundTag($CharacterID, $SoundFormat, $SoundRate, $SoundSize, $SoundType, $SoundSampleCount, $SoundFile)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineSoundTag\");\n#error_log(\"here--\");\n\t\t$TagID = 14;\n\n\t\t$DefineSoundTag = $this->packnBits($SoundFormat, 4);\n\t\t$DefineSoundTag .= $this->packnBits($SoundRate, 2);\n\t\t$DefineSoundTag .= $this->packnBits($SoundSize, 1);\n\t\t$DefineSoundTag .= $this->packnBits($SoundType, 1);\n\n\t\t$DefineSoundTag = $this->packBitValues($DefineSoundTag);\n\t\n\t\t$DefineSoundTag = $this->packUI16($CharacterID) . $DefineSoundTag;\n\t\t$DefineSoundTag .= $this->packUI32($SoundSampleCount);\n\n\t\t$file_handle = fopen($SoundFile, \"r\");\n\t\t$file = fread($file_handle, filesize($SoundFile));\n\t\tfclose($file_handle);\n\n\t\tif ($SoundFormat == 2) {\n\n\t\t\t$DefineSoundTag .= $this->packUI16(10) . $file;\n\t\t}\t\n\t\t\n\t\t$TagLength = strlen($DefineSoundTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineSoundTag;\n\n\t\tarray_pop($this->FMDebug);\n\n\t}",
"public function makeSound()\n {\n echo 'Maw Maw....<br>';\n }",
"public function makeSound()\n {\n echo 'Wow wow....<br>';\n }",
"public function getSoundPackName(): ?string\n {\n return $this->getParam(self::SOUND_PACK_NAME);\n }",
"function sp_audio_sc( $atts ) {\n\n\textract( shortcode_atts( array(\n\t\t'mp3' => '',\n\t\t'ogg' => '',\n\t\t'width' => '',\n\t\t'height' => '',\n\t\t'preload' => false,\n\t\t'autoplay' => false,\n\t), $atts ) );\n\n\tglobal $post;\n\n\tif ( $mp3 )\n\t\t$mp3 = '<source src=\"' . $mp3 . '\" type=\"audio/mp3\" />';\n\n\tif ( $ogg )\n\t\t$ogg = '<source src=\"' . $ogg . '\" type=\"audio/ogg\" />';\n\n\tif ( $preload )\n\t\t$preload = 'preload=\"' . $preload . '\"';\n\n\tif ( $autoplay )\n\t\t$autoplay = 'autoplay';\n\n\t$output = \"<audio id='AudioPlayerV1-id-$post->ID' class='AudioPlayerV1' width='100%' height='29' controls {$preload} {$autoplay} data-fallback='\" . SP_BASE_URL . \"js/audioplayerv1.swf'>\n\t\t\t\t\t{$mp3}\n\t\t\t\t\t{$ogg}\n\t\t\t\t</audio>\";\n\n\treturn $output;\n\n}",
"public function setDefaultSounds(){\n if ( ! in_array($this->letter, self::$vowels_special) ){\n $this->sounds[] = new SingleSound( $this->letter );\n }else{\n //if previous letter not consonant\n if ($this->prevLetter && !in_array($this->prevLetter->letter, self::$consonants_sound) ){\n $this->sounds[] = new SingleSound( 'й');\n switch($this->letter){\n case \"я\": $this->sounds[] = new SingleSound(\"а\"); break;\n case \"е\": $this->sounds[] = new SingleSound(\"э\"); break;\n case \"ё\": $this->sounds[] = new SingleSound(\"о\"); break;\n case \"ю\": $this->sounds[] = new SingleSound(\"у\"); break;\n }\n }else{\n switch($this->letter){\n case \"я\": $this->sounds[] = new SingleSound(\"а\"); break;\n case \"е\": $this->sounds[] = new SingleSound(\"э\"); break;\n case \"ё\": $this->sounds[] = new SingleSound(\"о\"); break;\n case \"ю\": $this->sounds[] = new SingleSound(\"у\"); break;\n }\n //and prev consonant now soft\n if (count($this->prevLetter->sounds) > 0){\n $this->prevLetter->sounds[0]->setSoftness();\n }\n }\n }\n\n //2: soft sign after consonant make consonant soft\n if ( $this->nextLetter && $this->nextLetter->letter === 'ь' && in_array($this->letter, self::$consonants_sound) ){\n $this->sounds[0]->setSoftness();\n }\n\n //3: voiced in the end of word or before clunk consonant becomes clunk\n if ( in_array($this->letter, self::$voiced_paired) ){\n if ( is_null($this->nextLetter) || ($this->nextLetter && in_array($this->nextLetter->letter, self::$clunk_paired)) ){\n $key = array_search($this->letter, self::$voiced_paired);\n $this->sounds[0]->setClunkPaired( self::$clunk_paired[$key] );\n }\n }\n\n //4:жи ши ци\n if ( $this->letter == 'и' && in_array($this->prevLetter->letter, array('ж', 'ш', 'ц')) ){\n $this->sounds[0]->setSpell('ы');\n }\n\n //5: non pronounce consonants //http://orthographia.ru/orfografia.php?sid=45\n if ($this->prevLetter && $this->nextLetter){\n $non_pc = array('стн', 'стл', 'здн', 'рдц', 'рдч', 'стц', 'здц', 'ндц');\n foreach ($non_pc as $non_p) {\n $combo = $this->prevLetter->letter.$this->letter.$this->nextLetter->letter;\n #$non_letter = mb_substr($non_p, 1, 1, 'utf-8');\n if ($combo == $non_p){\n $this->sounds[0]->setSpell('');\n }\n }\n $non_pc_2 = array('нтск', 'ндск', 'нтств', 'стск');\n }\n\n //6: озвончение, косьба [з], молотьба [д] Глухой согласный перед звонким согласным ( кроме л, м, н, р, в, й ) заменяется парным ему звонким\n // http://bugaga.net.ru/ege/rus/theory/?n=1\n if ($this->nextLetter && in_array($this->letter, array('п', 'к', 'т', 'ш', 'с'))) {\n $nextLetter = $this->nextLetter->letter;\n if ($nextLetter == 'ь' && $this->nextLetter->nextLetter){\n $nextLetter = $this->nextLetter->nextLetter->letter;\n }\n if ( in_array($nextLetter, array('б', 'г', 'д', 'ж', 'з'))){\n $key = array_search($this->letter, self::$clunk_paired);\n $this->sounds[0]->setVoicedPaired( self::$voiced_paired[$key] );\n }\n }\n\n\n }",
"function packDefineBitsTag($CharacterID, $BitmapJPEGImage)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineBitsTag\");\n\n\t\t$TagID = 6;\n\t\t$BitmapID = $this->packUI16($CharacterID);\n\t\t$TagLength = strlen($BitmapID . $BitmapJPEGImage);\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $BitmapID . $BitmapJPEGImage;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packShowFrameTag()\n\t{\n\t\tarray_push($this->FMDebug, \"packShowFrameTag\");\n\n\t\t$TagID = 1;\n\t\t$TagLength = 0;\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength);\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function sound_mp3()\n\t{\n\t\tif (preg_match('/.+[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Terraplane Sun - Funnel of Love.mp3\" - 21.55 MB - (1/6) - yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}\\(\\d+\\/(\\d+\\))[ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk09920 - [01/12] - \"Guido Negraszus - Night Cafe Iii (Freedom Travellers) (2012)(320).par2\" yEnc\n\t\tif (preg_match('/^trtk\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(LUNATIC SOUL - IMPRESSIONS) [00/18] - \"Lunatic Soul - Impressions 2011.nzb\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/8] - \"Black Market Flowers - Bind (1993).sfv\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//[1/1] - (150 MP3 Album Charts) - \"Atlantean Kodex - The White Goddess.rar\" yEnc\n\t\t//[1/1] - (MP3 Album Charts) - \"Black Sabbath - 13.rar\" yEnc\n\t\t//[1/1] - (Top100 Album Charts) - \"Bastille - Pompeii.rar\" yEnc\n\t\t//[1/1] - (Top100 Charts) - \"Beatrice Egli - Gluecksgefuehle.rar\" yEnc\n\t\t//[1/1] - (Top100 Single Charts) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(((Top)?\\d+ )?(MP3 )?((Album|Single) )?Charts\\)[ -]{0,4}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - (Album Top 100) - \"[Dance] David Guetta - One Love (2010) .rar\" yEnc\n\t\t//[1/1] - (Album Top 100) - \"Aerosmith - Music From Another Dimension.rar\" yEnc\n\t\t//[1/1] - Album Top 100 - \"ACDC - Live At River Plate.rar\" yEnc\n\t\t//[1/1] (Album Top 100 - 2012) - \"Alicia Keys - Girl On Fire.rar\" yEnc\n\t\t//[1/1] (Album Top 100 2012) - \"Asaf Avidan And The Mojos - One Day.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}(\\()?(Album|Single) Top \\d+ ([- ]{0,2}\\d+)?(\\))? - \"(\\[.+?\\] )?(.+?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[6];\n\t\t} //[1/1] - Top 100 Album Charts 2012 - \"Aura Dione feat. Rock Mafia - Friends.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Top \\d+ Album Charts \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' {1,4}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<>usenet-piraten.info<>partner<>ssl-news.info<> - [10/10] - \"Overexposed (Deluxe Version).vol31+23.par2\" yEnc\n\t\tif (preg_match('/^.+usenet-piraten\\.info.+ - \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Adam Levine (Maroon 5) & Alicia Keys - Daylight & Girl on fire LIVE 55TH GRAMMY AWARDS 320Kpbs.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/4) - VERBAteam present - \"Avril Lavigne - Rock 'N Roll (Official Audio).mp3\" - 5,80 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) - VERBAteam present - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - (Album Top 1000) - \"Davis, Miles - Complete Live at the Plugged Nickel 1965.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\\(Album Top \\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1/1] - Album Top 100 - \"Rammstein - Made In Germany 1995-2011.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}Album Top \\d+[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Andrea Berg - My Danish Collection (2013) by dem verrückten Lordi (14/27) \"Andrea Berg - My Danish Collection (2013).par2\" - 132,74 MB 150920134 yEnc\n\t\t//Der Deutsche Beat Mix Teil 2 auf wunsch (by dem verrückten Lordi) (2/9) \"Der Deutsche Beat Mix Teil 3 Back.jpg\" - 117,84 MB 13.11.05 yEnc\n\t\tif (preg_match('/^(.+?) (\\()?by dem verrückten Lordi(\\))? {1,2}\\(\\d+\\/\\d+\\) \".+?' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB].+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Christian Anders - Tief in dir (15/24) \"Christian Anders - Tief In Dir Back.jpg\" - 58,56 MB by dem verrückten Lordi 0703123 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}by dem verrückten Lordi.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Der etwas andere Mix - Wilde Herzenmix (auf wunsch) neu (by dem verrückten Lordi) (1/8) \"Der etwas andere Mix - Wilde Herzenmix.par2\" yEnc\n\t\tif (preg_match('/^Der etwas.+ - (.+) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Full Discography - The Cranberries (01/47) \"Full Discography - The Cranberries.par2\" - 3,52 GB 2812111 yEnc\n\t\tif (preg_match('/^(.+?) \\(\\d+\\/\\d+\\) \".+?' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB] {1,2}\\d+ yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //jean ferrat année 1967 à 1969 meil29 \"17 Rien à voir.mp3\" yEnc\n\t\tif (preg_match('/^(.+?) meil29 \".+?' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Selected Songs by Various Artists - Depeche Mode - Personal Jesus (Acoustic Version).mp3 yEnc\n\t\tif (preg_match('/^Selected Songs by Various Artists - (.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"public function getSound()\n {\n if (is_null($this->captcha)) {\n \\BDC_HttpHelper::BadRequest('captcha');\n }\n\n // identifier of the particular Captcha object instance\n $instanceId = $this->getInstanceId();\n if (is_null($instanceId)) {\n \\BDC_HttpHelper::BadRequest('instance');\n }\n\n // response headers\n \\BDC_HttpHelper::SmartDisallowCache();\n\n // response MIME type & headers\n $mimeType = $this->captcha->CaptchaBase->SoundMimeType;\n header(\"Content-Type: {$mimeType}\");\n header('Content-Transfer-Encoding: binary');\n\n // sound generation\n $rawSound = $this->captcha->CaptchaBase->GetSound($instanceId);\n return $rawSound;\n }",
"function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}",
"function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}",
"function getAudio($office,$name){\n echo '<audio controls>';\n echo ' <source src=\"../' . $office . '-audio/' . $name . '.ogg\" />';\n echo ' <source src=\"../' . $office . '-audio/' . $name . '.mp3\" />';\n echo '</audio><br />'; \n }",
"function play_number($num){\r\n\t\t$out = '';\r\n\r\n\t\t$out .= \"<audio controls autoplay>\";\r\n\t\t$out .= \"<source src=sound/\".$num.\".wav type='audio/mpeg'>\";\r\n\t\t/*$out .= \"sleep(1)\";\r\n\t\t$out .= \"<source src=sound/\".$x1.\".wav type='audio/mpeg'>\";\r\n\t\t$out .= \"sleep(1)\";\r\n\t\t$out .= \"<source src=sound/\".$x0.\".wav type='audio/mpeg'>\";\r\n\t\t$out .= \"sleep(1)\";*/\r\n\t\t$out .= \"</audio>\";\r\n\t \r\n\t return $out;\r\n\t}",
"function _audio($src, $atts = array()) {\n $files = array();\n $isExternal = media_isexternal($src);\n\n if ($isExternal) {\n // take direct source for external files\n list(/*ext*/, $srcMime) = mimetype($src);\n $files[$srcMime] = $src;\n } else {\n // prepare alternative formats\n $extensions = array('ogg', 'mp3', 'wav');\n $files = media_alternativefiles($src, $extensions);\n }\n\n $out = '';\n // open audio tag\n $out .= '<audio '.buildAttributes($atts).' controls=\"controls\">'.NL;\n $fallback = '';\n\n // output source for each alternative audio format\n foreach($files as $mime => $file) {\n if ($isExternal) {\n $url = $file;\n $linkType = 'externalmedia';\n } else {\n $url = ml($file, '', true, '&');\n $linkType = 'internalmedia';\n }\n $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));\n\n $out .= '<source src=\"'.hsc($url).'\" type=\"'.$mime.'\" />'.NL;\n // alternative content (just a link to the file)\n $fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);\n }\n\n // finish\n $out .= $fallback;\n $out .= '</audio>'.NL;\n return $out;\n }",
"function template_tag_handler( $id = \"\", $pos = \"\", $dload = \"\", $play = \"\", $list = \"\" ) {\n\t\t\t\n\t\t\t$this->putTag_runCount++;\n\t\t\tif ( $this->theSettings['disable_template_tag'] == \"true\" ) { return; }\n\t\t\t\n\t\t\tif ( !empty($id) && !is_numeric($id) ) {\n\t\t\t\t$this->external_call = true;\n\t\t\t\t$shortcodes_return = do_shortcode( $id );\n\t\t\t\t$this->external_call = false;\n\t\t\t}\n\t\t\techo $shortcodes_return;\n\t\t\treturn;\t\t\t\n\t\t}",
"function packMacromediaFlashSWFHeader()\n\t{\n\t\tarray_push($this->FMDebug, \"packMacromediaFlashSWFHeader\");\n\n\t\t$HeaderLength = 21;\n\t\t$atom = \"FWS\";\n\t\t$atom .= $this->packUI8((int)$this->SWFVersion);\n\t\t$atom .= $this->packUI32($HeaderLength + strlen($this->MovieData));\n\n\t\t$Xmin = (int)$this->FrameSize[\"Xmin\"]; \n\t\t$Xmax = (int)$this->FrameSize[\"Xmax\"]; \n\t\t$Ymin = (int)$this->FrameSize[\"Ymin\"]; \n\t\t$Ymax = (int)$this->FrameSize[\"Ymax\"];\n\n\t\tif (min($Xmax, $Ymax) < 360) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too small\");\n\n\t\t}\n\n\t\tif (max($Xmax, $Ymax) > 57600) {\n\n\t\t\t$this->FMError(\"packMacromediaFlashSWFHeader movie frame too large\");\n\n\t\t}\n\n\t\t$Xmin = $this->packUBchunk($Xmin); \n\t\t$Xmax = $this->packUBchunk($Xmax); \n\t\t$Ymin = $this->packUBchunk($Ymin); \n\t\t$Ymax = $this->packUBchunk($Ymax);\n\n\t\t$nBits = 16;\n\n\t\t$Xmin = str_repeat(\"0\", ($nBits - strlen($Xmin))) . $Xmin;\n\t\t$Xmax = str_repeat(\"0\", ($nBits - strlen($Xmax))) . $Xmax;\n\t\t$Ymin = str_repeat(\"0\", ($nBits - strlen($Ymin))) . $Ymin;\n\t\t$Ymax = str_repeat(\"0\", ($nBits - strlen($Ymax))) . $Ymax;\n\n\t\t$RECT = $this->packnBits($nBits, 5) . $Xmin . $Xmax . $Ymin . $Ymax;\n\n\t\t$atom .= $this->packBitValues($RECT);\n\t\t$atom .= $this->packFIXED8((float)$this->FrameRate);\n\t\t$atom .= $this->packUI16((int)$this->FrameCounter);\n\n\t\t$this->MovieData = $atom . $this->MovieData;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function start_tag($tag, $pref, $nl, $extra = '')\n{\n tag($tag, 'start', $pref, $nl, $extra) ;\n}",
"function f_blank_song(){\n\treturn '/images/pixel_transp.gif';\n\t}",
"static function get_audio_id( $atts ) {\n\t\tif ( isset( $atts[0] ) )\n\t\t\treturn $atts[0];\n\t\telse\n\t\t\treturn 0;\n\t}",
"function audio_shortcode( $atts ) {\n\t\tglobal $ap_playerID;\n\t\tglobal $post;\n\t\tif ( ! is_array( $atts ) ) {\n\t\t\treturn '<!-- Audio shortcode passed invalid attributes -->';\n\t\t}\n\n\t\tif ( ! isset( $atts[0] ) ) {\n\t\t\tif ( isset( $atts['src'] ) ) {\n\t\t\t\t$atts[0] = $atts['src'];\n\t\t\t\tunset( $atts['src'] );\n\t\t\t} else {\n\t\t\t\treturn '<!-- Audio shortcode source not set -->';\n\t\t\t}\n\t\t}\n\n\t\t// add the special .js\n\t\twp_enqueue_script(\n\t\t\t'audio-shortcode',\n\t\t\tplugins_url( 'js/audio-shortcode.js', __FILE__ ),\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.1',\n\t\t\ttrue);\n\n\t\t// alert the infinite scroll renderer that it should try to load the script\n\t\tself::$add_script = true;\n\t\t$atts[0] = strip_tags( join( ' ', $atts ) );\n\t\t$src = ltrim( $atts[0], '=' );\n\t\t$ap_options = apply_filters(\n\t\t\t'audio_player_default_colors',\n\t\t\tarray(\n\t\t\t\t\"bg\" => \"0xF8F8F8\",\n\t\t\t\t\"leftbg\" => \"0xEEEEEE\",\n\t\t\t\t\"lefticon\" => \"0x666666\",\n\t\t\t\t\"rightbg\" => \"0xCCCCCC\",\n\t\t\t\t\"rightbghover\" => \"0x999999\",\n\t\t\t\t\"righticon\" => \"0x666666\",\n\t\t\t\t\"righticonhover\" => \"0xFFFFFF\",\n\t\t\t\t\"text\" => \"0x666666\",\n\t\t\t\t\"slider\" => \"0x666666\",\n\t\t\t\t\"track\" => \"0xFFFFFF\",\n\t\t\t\t\"border\" => \"0x666666\",\n\t\t\t\t\"loader\" => \"0x9FFFB8\"\n\t\t\t) );\n\n\t\tif ( ! isset( $ap_playerID ) ) {\n\t\t\t$ap_playerID = 1;\n\t\t} else {\n\t\t\t$ap_playerID++;\n\t\t}\n\n\t\tif ( ! isset( $load_audio_script ) ) {\n\t\t\t$load_audio_script = true;\n\t\t}\n\n\t\t// prep the audio files\n\t\t$src = trim( $src, ' \"' );\n\t\t$options = array();\n\t\t$data = preg_split( \"/\\|/\", $src );\n\t\t$sound_file = $data[0];\n\t\t$sound_files = explode( ',', $sound_file );\n\n\t\tif ( is_ssl() ) {\n\t\t\tfor ( $i = 0; $i < count( $sound_files ); $i++ ) {\n\t\t\t\t$sound_files[ $i ] = preg_replace( '#^http://([^.]+).files.wordpress.com/#', 'https://$1.files.wordpress.com/', $sound_files[ $i ] );\n\t\t\t}\n\t\t}\n\n\t\t$sound_files = array_map( 'trim', $sound_files );\n\t\t$sound_files = array_map( array( $this, 'rawurlencode_spaces' ), $sound_files );\n\t\t$sound_files = array_map( 'esc_url_raw', $sound_files ); // Ensure each is a valid URL\n\t\t$num_files = count( $sound_files );\n\t\t$sound_types = array(\n\t\t\t'mp3' => 'mpeg',\n\t\t\t'wav' => 'wav',\n\t\t\t'ogg' => 'ogg',\n\t\t\t'oga' => 'ogg',\n\t\t\t'm4a' => 'mp4',\n\t\t\t'aac' => 'mp4',\n\t\t\t'webm' => 'webm'\n\t\t);\n\n\t\tfor ( $i = 1; $i < count( $data ); $i++ ) {\n\t\t\t$pair = explode( \"=\", $data[$i] );\n\t\t\tif ( strtolower( $pair[0] ) != 'autostart' ) {\n\t\t\t\t$options[$pair[0]] = $pair[1];\n\t\t\t}\n\t\t}\n\n\t\t// Merge runtime options to default colour options\n\t\t// (runtime options overwrite default options)\n\t\tforeach ( $ap_options as $key => $default ) {\n\t\t\tif ( isset( $options[$key] ) ) {\n\t\t\t\tif ( preg_match( '/^(0x)?[a-f0-9]{6}$/i', $default ) && !preg_match( '/^(0x)?[a-f0-9]{6}$/i', $options[$key] ) ) {\n\t\t\t\t\t// Default is a hex color, but input is not\n\t\t\t\t\t$options[$key] = $default;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$options[$key] = $default;\n\t\t\t}\n\t\t}\n\t\t$options['soundFile'] = join( ',', $sound_files ); // Rebuild the option with our now sanitized data\n\t\t$flash_vars = array();\n\t\tforeach ( $options as $key => $value ) {\n\t\t\t$flash_vars[] = rawurlencode( $key ) . '=' . rawurlencode( $value );\n\t\t}\n\t\t$flash_vars = implode( '&', $flash_vars );\n\t\t$flash_vars = esc_attr( $flash_vars );\n\n\t\t// extract some of the options to insert into the markup\n\t\tif ( isset( $options['bgcolor'] ) && preg_match( '/^(0x)?[a-f0-9]{6}$/i', $options['bgcolor'] ) ) {\n\t\t\t$bgcolor = preg_replace( '/^(0x)?/', '#', $options['bgcolor'] );\n\t\t\t$bgcolor = esc_attr( $bgcolor );\n\t\t} else {\n\t\t\t$bgcolor = '#FFFFFF';\n\t\t}\n\n\t\tif ( isset( $options['width'] ) ) {\n\t\t\t$width = intval( $options['width'] );\n\t\t} else {\n\t\t\t$width = 290;\n\t\t}\n\n\t\t$loop = '';\n\t\t$script_loop = 'false';\n\t\tif ( isset( $options['loop'] ) && 'yes' == $options['loop'] ) {\n\t\t\t$script_loop = 'true';\n\t\t\tif ( 1 == $num_files ) {\n\t\t\t\t$loop = 'loop';\n\t\t\t}\n\t\t}\n\n\t\t$volume = 0.6;\n\t\tif ( isset( $options['initialvolume'] ) &&\n\t\t\t\t0.0 < floatval( $options['initialvolume'] ) &&\n\t\t\t\t100.0 >= floatval( $options['initialvolume'] ) ) {\n\n\t\t\t$volume = floatval( $options['initialvolume'] )/100.0;\n\t\t}\n\n\t\t$file_artists = array_pad( array(), $num_files, '' );\n\t\tif ( isset( $options['artists'] ) ) {\n\t\t\t$artists = preg_split( '/,/', $options['artists'] );\n\t\t\tforeach ( $artists as $i => $artist ) {\n\t\t\t\t$file_artists[$i] = esc_html( $artist ) . ' - ';\n\t\t\t}\n\t\t}\n\n\t\t// generate default titles\n\t\t$file_titles = array();\n\t\tfor ( $i = 0; $i < $num_files; $i++ ) {\n\t\t\t$file_titles[] = 'Track #' . ($i+1);\n\t\t}\n\n\t\t// replace with real titles if they exist\n\t\tif ( isset( $options['titles'] ) ) {\n\t\t\t$titles = preg_split( '/,/', $options['titles'] );\n\t\t\tforeach ( $titles as $i => $title ) {\n\t\t\t\t$file_titles[$i] = esc_html( $title );\n\t\t\t}\n\t\t}\n\n\t\t// fallback for the fallback, just a download link\n\t\t$not_supported = '';\n\t\tforeach ( $sound_files as $sfile ) {\n\t\t\t$not_supported .= sprintf(\n\t\t\t\t__( 'Download: <a href=\"%s\">%s</a><br />', 'jetpack' ),\n\t\t\t\tesc_url( $sfile ),\n\t\t\t\tesc_html( basename( $sfile ) ) );\n\t\t}\n\n\t\t// HTML5 audio tag\n\t\t$html5_audio = '';\n\t\t$all_mp3 = true;\n\t\t$add_audio = true;\n\t\t$num_good = 0;\n\t\t$to_remove = array();\n\t\tforeach ( $sound_files as $i => $sfile ) {\n\t\t\t$file_extension = pathinfo( $sfile, PATHINFO_EXTENSION );\n\t\t\tif ( ! preg_match( '/^(mp3|wav|ogg|oga|m4a|aac|webm)$/i', $file_extension ) ) {\n\t\t\t\t$html5_audio .= '<!-- Audio shortcode unsupported audio format -->';\n\t\t\t\tif ( 1 == $num_files ) {\n\t\t\t\t\t$html5_audio .= $not_supported;\n\t\t\t\t}\n\n\t\t\t\t$to_remove[] = $i; // make a note of the bad files\n\t\t\t\t$all_mp3 = false;\n\t\t\t\tcontinue;\n\t\t\t} elseif ( ! preg_match( '/^mp3$/i', $file_extension ) ) {\n\t\t\t\t$all_mp3 = false;\n\t\t\t}\n\n\t\t\tif ( 0 == $i ) { // only need one player\n\t\t\t\t$html5_audio .= <<<AUDIO\n\t\t\t\t<span id=\"wp-as-{$post->ID}_{$ap_playerID}-container\">\n\t\t\t\t\t<audio id='wp-as-{$post->ID}_{$ap_playerID}' controls preload='none' $loop style='background-color:$bgcolor;width:{$width}px;'>\n\t\t\t\t\t\t<span id=\"wp-as-{$post->ID}_{$ap_playerID}-nope\">$not_supported</span>\n\t\t\t\t\t</audio>\n\t\t\t\t</span>\n\t\t\t\t<br />\nAUDIO;\n\t\t\t}\n\t\t\t$num_good++;\n\t\t}\n\n\t\t// player controls, if needed\n\t\tif ( 1 < $num_files ) {\n\t\t\t$html5_audio .= <<<CONTROLS\n\t\t\t\t<span id='wp-as-{$post->ID}_{$ap_playerID}-controls' style='display:none;'>\n\t\t\t\t\t<a id='wp-as-{$post->ID}_{$ap_playerID}-prev'\n\t\t\t\t\t\thref='javascript:audioshortcode.prev_track( \"{$post->ID}_{$ap_playerID}\" );'\n\t\t\t\t\t\tstyle='font-size:1.5em;'>«</a>\n\t\t\t\t\t|\n\t\t\t\t\t<a id='wp-as-{$post->ID}_{$ap_playerID}-next'\n\t\t\t\t\t\thref='javascript:audioshortcode.next_track( \"{$post->ID}_{$ap_playerID}\", true, $script_loop );'\n\t\t\t\t\t\tstyle='font-size:1.5em;'>»</a>\n\t\t\t\t</span>\nCONTROLS;\n\t\t}\n\t\t$html5_audio .= \"<span id='wp-as-{$post->ID}_{$ap_playerID}-playing'></span>\";\n\n\t\tif ( is_ssl() )\n\t\t\t$protocol = 'https';\n\t\telse\n\t\t\t$protocol = 'http';\n\n\t\t$swfurl = apply_filters(\n\t\t\t'jetpack_static_url',\n\t\t\t\"$protocol://en.wordpress.com/wp-content/plugins/audio-player/player.swf\" );\n\n\t\t// all the fancy javascript is causing Google Reader to break, just include flash in GReader\n\t\t// override html5 audio code w/ just not supported code\n\t\tif ( is_feed() ) {\n\t\t\t$html5_audio = $not_supported;\n\t\t}\n\n\t\tif ( $all_mp3 ) {\n\t\t\t// process regular flash player, inserting HTML5 tags into object as fallback\n\t\t\t$audio_tags = <<<FLASH\n\t\t\t\t<object id='wp-as-{$post->ID}_{$ap_playerID}-flash' type='application/x-shockwave-flash' data='$swfurl' width='$width' height='24'>\n\t\t\t\t\t<param name='movie' value='$swfurl' />\n\t\t\t\t\t<param name='FlashVars' value='{$flash_vars}' />\n\t\t\t\t\t<param name='quality' value='high' />\n\t\t\t\t\t<param name='menu' value='false' />\n\t\t\t\t\t<param name='bgcolor' value='$bgcolor' />\n\t\t\t\t\t<param name='wmode' value='opaque' />\n\t\t\t\t\t$html5_audio\n\t\t\t\t</object>\nFLASH;\n\t\t} else { // just HTML5 for non-mp3 versions\n\t\t\t$audio_tags = $html5_audio;\n\t\t}\n\n\t\t// strip out all the bad files before it reaches .js\n\t\tforeach ( $to_remove as $i ) {\n\t\t\tarray_splice( $sound_files, $i, 1 );\n\t\t\tarray_splice( $file_artists, $i, 1 );\n\t\t\tarray_splice( $file_titles, $i, 1 );\n\t\t}\n\n\t\t// mashup the artist/titles for the script\n\t\t$script_titles = array();\n\t\tfor ( $i = 0; $i < $num_files; $i++ ) {\n\t\t\t$script_titles[] = $file_artists[$i] . $file_titles[$i];\n\n\t\t}\n\n\t\t// javacript to control audio\n\t\t$script_files = json_encode( $sound_files );\n\t\t$script_titles = json_encode( $script_titles );\n\t\t$script = <<<SCRIPT\n\t\t\t<script type='text/javascript'>\n\t\t\t//<![CDATA[\n\t\t\t(function() {\n\t\t\t\tvar prep = function() {\n\t\t\t\t\tif ( 'undefined' === typeof window.audioshortcode ) { return; }\n\t\t\t\t\taudioshortcode.prep(\n\t\t\t\t\t\t'{$post->ID}_{$ap_playerID}',\n\t\t\t\t\t\t$script_files,\n\t\t\t\t\t\t$script_titles,\n\t\t\t\t\t\t$volume,\n\t\t\t\t\t\t$script_loop\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t\tif ( 'undefined' === typeof jQuery ) {\n\t\t\t\t\tif ( document.addEventListener ) {\n\t\t\t\t\t\twindow.addEventListener( 'load', prep, false );\n\t\t\t\t\t} else if ( document.attachEvent ) {\n\t\t\t\t\t\twindow.attachEvent( 'onload', prep );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tjQuery(document).on( 'ready as-script-load', prep );\n\t\t\t\t}\n\t\t\t})();\n\t\t\t//]]>\n\t\t\t</script>\nSCRIPT;\n\n\t\t// add the special javascript, if needed\n\t\tif ( 0 < $num_good && ! is_feed() ) {\n\t\t\t$audio_tags .= $script;\n\t\t}\n\n\t\treturn \"<span style='text-align:left;display:block;'><p>$audio_tags</p></span>\";\n\t}",
"public function sounds_flac()\n\t{\n\t\tif (preg_match('/^\\[\\d+\\]-\\[.+?\\]-\\[.+?\\]-\\[ (.+?) \\]-\\[\\d+\\/\\d+] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[:SEK9:][FLAC/Metal]-[:Burn_The_Priest-Burn_The_Priest-Remastered-CD-FLAC-2005-TiLLMYDEATH:]-[01/18]-\"00-burn_the_priest-burn_the_priest-remastered-cd-flac-2005-proof.jpg\" yEnc\n\t\tif (preg_match('/^\\[:.+:\\]\\[FLAC.+\\]-\\[:(.+):\\]-\\[\\d+\\/\\d+\\]-\".+\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function media_upload_audio()\n {\n }",
"function send_replay_START(&$current) {\n send_replay_message(\"START \".@$current['class']\n .'_Round'.@$current['round']\n .'_Heat'.sprintf(\"%02d\", @$current['heat']));\n}",
"public function sounds_mp3_electronic()\n\t{\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(2/7) \"Cosmic Baby live at Energy 1995.vol00+01.PAR2\" - 0 B - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '[-_\\s]{0,3}\\d+ [bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[0sk]-[2002-12-06]-[idm]-[vinyl]-[4/5]-[Maps_And_Diagrams_-_Ti_Sta_Bene_Marone-(cact_001)-Vinyl-2002]--cact 001.sfv yEnc\n\t\tif (preg_match('/^\\[0sk\\]-\\[\\d+-\\d+-\\d+\\]-\\[.+\\]-\\[.+\\]-\\[\\d+\\/\\d+\\]-\\[([\\w.,& ()\\[\\]\\'\\`-]{8,})\\]--.+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[10_years---happy_bday_absme]-[cd]-[04/15]-[va_-_spacewars_01-(plkcd003)-cd-1996-nwd]-01-Nuw Idol - Union Of Ilk -nwd-.mp3 yEnc\n\t\tif (preg_match('/^\\[.+\\]-\\[.+\\]-\\[\\d+\\/\\d+\\]-\\[([\\w.,& ()\\[\\]\\'\\`-]{8,})\\]-.+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Alec Empire - Low On Ice 06 - Untitled.mp3 yEnc\n\t\tif (preg_match('/^([\\w.,& ()\\[\\]\\'\\`-]{8,}?)[-_\\s]{0,3}\\d+[-_\\s]{0,3}[\\w.,& ()\\[\\]\\'\\`-]{8,}?\\b.?([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Selected Songs by Various Artists - Collide - Razor Sharp.mp3 yEnc\n\t\tif (preg_match('/^Selected Songs by Various Artists - ([^.]{8,})([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function packDefineShapeTag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShapeTag\");\n\t\t$TagID = 2;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->AutoSetSWFVersion(1);\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"function packDefineShape2Tag($ShapeID, $ShapeBounds, $SHAPEWITHSTYLE)\n\t{\n\t\tarray_push($this->FMDebug, \"packDefineShape2Tag\");\n\n\t\t$TagID = 22;\n\n\t\t$DefineShapeTag = $this->packUI16($ShapeID) . $ShapeBounds . $SHAPEWITHSTYLE;\n\n\t\t$TagLength = strlen($DefineShapeTag);\n\n\t\t$this->MovieData .= $this->packRECORDHEADER($TagID, $TagLength) . $DefineShapeTag;\n\n\t\tarray_pop($this->FMDebug);\n\t}",
"public function createSmil(){\n\n try {\n\n $smil = $this->song->songId.\"_song.smil\";\n $streamUrl = 'vod/smil:'.$smil.'/playlist.m3u8';\n /* $this->song->smilFile = $slim;\n $this->song->streamUrl = $streamUrl;*/\n $this->song->update([\n 'smilFile' => $smil,\n 'streamUrl' => $streamUrl,\n ]);\n\n $smilfile = fopen(\"newfile.smil\", \"w\") or die(Log::error(\"something went wrong\"));\n $txt = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <smil title=\"Audio SMIL\">\n <body>\n <switch><audio src=\"mp3:'.$this->song->songId.'_song.mp3\"> \n <param name=\"audioBitrate\" value=\"128000\" valuetype=\"data\"></param> \n </audio>\n </switch>\n </body>\n </smil>';\n fwrite($smilfile, $txt);\n fclose($smilfile);\n\n // $extn = $smilfile->getClientOriginalExtension();\n $smil_fileName = $smil;\n $imageController = new ImageController();\n $trackPath = $imageController->UploadSmil('smil', $smilfile, $smil_fileName, $this->song->songId);\n }catch (Exception $exception){\n Log::error($exception->getMessage());\n }\n\n\n\n }",
"function mp3_func( $atts ) {\n $a = shortcode_atts( array(\n 0 => 'http://missing'\n ), $atts );\n\n\t$mp3url = str_replace(\"www.dropbox\", \"dl.dropbox\", str_replace(\"?dl=0\", \"?\", $a[0]));\n return \"<audio controls style='width: 100%'><source src='{$mp3url}' type='audio/mpeg'>Your browser does not support the audio element.</audio>\";\n}",
"public function sounds_mp3()\n\t{\n\t\tif (preg_match('/^\\(dream-of-usenet\\.info\\) - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //http://dream-of-usenet.org empfehlen newsconnection.eu - [02/32] - \"Adam_Ant-Manners_and_Physique-(MCAD-6315)-CD-FLAC-1989-2Eleven.par2\" yEnc\n\t\tif (preg_match('/^http:\\/\\/dream-of-usenet\\.org .+? - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk09920 - [01/12] - \"Guido Negraszus - Night Cafe Iii (Freedom Travellers) (2012)(320).par2\" yEnc\n\t\tif (preg_match('/^trtk\\d+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //>>> CREATIVE COMMONS NZB <<< \"dexter romweber duo-lookout\" - File 1 of 9: \"creative_commons_nzb_dexter_romweber_duo-lookout.rar\" yEnc\n\t\tif (preg_match('/^>>> CREATIVE COMMONS NZB <<< \"(.+?)\" - File \\d+ of \\d+: \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<usenet-space-cowboys.info>>> <<<Powered by https://secretusenet.com>< \"Justin_Bieber-Believe_Acoustic-2013-pLAN9_usenet-space-cowbys.info.rar\" >< 4/6 (78.65 MB) >< 60.84 MB > yEnc\n\t\tif (preg_match('/^.+?usenet-space.+?Powered by.+? \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 .\n\t\t\t\t\t '.+? \\d+\\/\\d+ \\(\\d+[.,]\\d+ [kKmMgG][bB]\\) .+? \\d+[.,]\\d+ [kKmMgG][bB] .+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"The Absence - Riders Of The Plague\" [00/14] - \"the_absence-riders_of_the_plague.nzb\" yEnc\n\t\tif (preg_match('/\"(.+)\"[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//( Albert Cummings Albums 6x By Dready Niek (1999-2012) ) ( ** By Dready Niek ** ) [11/20] - \"Albert Cummings Albums 6x By Dready Niek (1999-2012).part10.rar\" yEnc\n\t\t//( Fat Freddy's Drop - Blackbird (2013) -- By Dready Niek ) -- By Dready Niek ) [01/15] - \"Fat Freddy's Drop - Blackbird (2013) -- By Dready Niek.par2\" yEnc\n\t\tif (preg_match('/\\( (.+?)\\)[-_\\s]{0,3}( |\\().+\\)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //( Addison_Road-Addison_Road-2008 ) [01/10] - \"01. Addison Road - This Could Be Our Day.mp3\" yEnc\n\t\tif (preg_match('/\\( (.+?) \\)[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}\".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [0/8] - Crionics Post - Alice In Chains - Dirt REPOST\"Alice In Chains - Dirt.nzb\" yEnc\n\t\tif (preg_match('/^.+?\\[\\d+\\/(\\d+\\][-_\\s]{0,3}.+?)[-_\\s]{0,3}(\"|#34;)(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}(\"|#34;))[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(????) [001/153] - \"C4 House Party Horse Meat Disco Set 6.nfo\" C4 House Party Horse Meat Disco Set 6 yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(????) [19/22] - C.K.N. Demo 85 \"19-rotten system.mp3\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\] - (.+)[-_\\s]{0,3}\".+?' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(03/11) \"Europe - Discography (1983 - 2009) (320 kbps CBR) www.brothers-of-usenet.org - empfehlen - Newsconnection.par2\" yEnc\n\t\t//(03/11) \"Evanescence Diskographie (1998-2011) www.brothers-of-usenet.org - empfehlen - Newsconnection.par2\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"(.+?) {1,3}www\\.brothers-of-usenet\\.org - empfehlen - Newsconnection' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(107/123) - \"Mark.EG.M.Zone.Rave.Tape.Packs.Hard.Trance.1990s.vol006+04.PAR2\" - 11.39 GB yEnc\n\t\t//(12/16) \"Horrid Henry The Movie - Original Soundtrack.vol00+01.PAR2\" - 102.32 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[002/123] - \"Mark.EG.M.Zone.Rave.Tape.Packs.Hard.Trance.1990s.part001.rar\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //< usenetrevolution > <-> Partner of ssl-news.info <-> Anastacia.-.It's.a.Mans.World [04/15] - \"Anastacia.-.It's.a.Mans.World.part01.rar\" - 100,47 MB - yEnc\n\t\tif (preg_match('/^.+usenetrevolution.+Partner of ssl-news\\.info.+\\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e2,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<<Old but Sold>>> <<< >< >< \"German Top 50 ODC - 12.08.2013.nfo\" >< 02/33 (541,61 MB) >< 10,93 kB > yEnc\n\t\tif (preg_match('/^.+Old but Sold.+>< \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' >< \\d+\\/\\d+ \\(\\d+[.,]\\d+ [kKmMgG][bB]\\).+ yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //<<< <ghost-of-usenet.org> <\"MC Basstard Diskographie 16CDs 2000-2011 MP3 - Ghost.part08.rar\"> >www.SSL-News.info< - (10/43) - 1,69 GB yEnc\n\t\t//<<< <ghost-of-usenet.org> >\"UltraTraxx Rare Remixes - Vol 011 MP3 192kbps.par2\"> >www.SSL-News.info< - (1/9) - 120,82 MB yEnc\n\t\tif (preg_match('/^.+ghost-of-usenet.org[<>] [><]\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 .\n\t\t\t\t\t '> >www\\.SSL-News\\.info< - \\(\\d+\\/\\d+\\)[-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //BY REQ:........! - \"Keith Whitley - All American Country - .par2\" [06/22] yEnc\n\t\tif (preg_match('/^BY REQ.+ - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t ' \\[\\d+\\/\\d+\\] yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Der etwas andere Mix - Wilde Herzenmix (auf wunsch) neu (by dem verrückten Lordi) (1/8) \"Der etwas andere Mix - Wilde Herzenmix.par2\" yEnc\n\t\tif (preg_match('/^Der etwas.+ \\(\\d+\\/\\d+\\) \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //DJ Inferno Beatport Xtreme September 2011[63/66] - \"DJ Inferno Beatport Xtreme September 2011.vol073+55.PAR2\" upp o-o yEnc\n\t\t//Kastelruther Spatzen - Weihnachten Bei Uns Daheim (2011) (22/25) \"Kastelruther Spatzen - Weihnachten Bei Uns Daheim (2011).vol00+1.PAR2\" - 113,03 MB - Tapier 13.11.02 yEnc\n\t\tif (preg_match('/^.+[\\[\\(]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '.+yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"8 Wenn ich einmal gross bin .mp3\" Koelschefetz postet.Die Filue -Immer Wigger yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Queens Of The Stone Age - Rated R (2000) (10th Anniversary Deluxe Edition 2010) [EAC/Lame V0] \"QU2 - Queens of the Stone Age - Rated R.M3u\" yEnc\n\t\tif (preg_match('/^.+\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '.+yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //squeeze-east side story-nmr- [01/14] - 01-squeeze-in quintessence.mp3 yEnc\n\t\tif (preg_match('/^(.+?)- [\\[\\(]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\\d\\d.+?([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4}) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}"
] |
[
"0.70532537",
"0.5423868",
"0.5349111",
"0.53386843",
"0.52319247",
"0.52191067",
"0.51671654",
"0.5070674",
"0.48975518",
"0.4859897",
"0.48550314",
"0.48550314",
"0.47882614",
"0.4731203",
"0.47204885",
"0.46997142",
"0.4699471",
"0.46808586",
"0.46516508",
"0.4618996",
"0.45901436",
"0.45574626",
"0.45393053",
"0.4534696",
"0.45301405",
"0.45110232",
"0.45092967",
"0.44897738",
"0.44653156",
"0.44277725"
] |
0.88064265
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.