本文整理汇总了PHP中Link::store_basic方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::store_basic方法的具体用法?PHP Link::store_basic怎么用?PHP Link::store_basic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::store_basic方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: spam_trigger_killspam
function spam_trigger_killspam($id)
{
global $db, $current_user;
# include_once(mnminclude.'link.php');
# include_once(mnminclude.'votes.php');
$oldlevel = $current_user->user_level;
$current_user->user_level = 'admin';
killspam($id);
$current_user->user_level = $oldlevel;
return;
$db->query('UPDATE `' . table_users . "` SET user_enabled=0, `user_pass` = '63205e60098a9758101eeff9df0912ccaaca6fca3e50cdce3', user_level='Spammer' WHERE `user_id` = {$id}");
$db->query('UPDATE `' . table_links . '` SET `link_status` = "discard" WHERE `link_author` = "' . $id . '"');
$results = $db->get_results("SELECT comment_id, comment_link_id FROM `" . table_comments . "` WHERE `comment_user_id` = {$id}");
if ($results) {
foreach ($results as $result) {
$comment_id = $result->comment_id;
$db->query('DELETE FROM `' . table_comments . '` WHERE `comment_id` = "' . $comment_id . '"');
$db->query('DELETE FROM `' . table_comments . '` WHERE `comment_parent` = "' . $comment_id . '"');
$link = new Link();
$link->id = $result->comment_link_id;
$link->read();
$link->recalc_comments();
$link->store();
}
}
$results = $db->get_results("SELECT vote_id,vote_link_id FROM `" . table_votes . "` WHERE `vote_user_id` = {$id}");
if ($results) {
foreach ($results as $result) {
$db->query('DELETE FROM `' . table_votes . '` WHERE `vote_id` = "' . $result->vote_id . '"');
$link = new Link();
$link->id = $result->vote_link_id;
$link->read();
$vote = new Vote();
$vote->type = 'links';
$vote->link = $result->vote_link_id;
if (Voting_Method == 1) {
$link->votes = $vote->count();
$link->reports = $link->count_all_votes("<0");
} elseif (Voting_Method == 2) {
$link->votes = $vote->rating();
$link->votecount = $vote->count();
$link->reports = $link->count_all_votes("<0");
}
$link->store_basic();
$link->check_should_publish();
}
}
$db->query('DELETE FROM `' . table_saved_links . '` WHERE `saved_user_id` = "' . $id . '"');
$db->query('DELETE FROM `' . table_trackbacks . '` WHERE `trackback_user_id` = "' . $id . '"');
$db->query('DELETE FROM `' . table_friends . '` WHERE `friend_id` = "' . $id . '"');
$db->query('DELETE FROM `' . table_messages . "` WHERE `sender`={$id} OR `receiver`={$id}");
}
示例2: substr
//show the template
$main_smarty->assign('tpl_center', '/admin/submission_status');
$main_smarty->display($template_dir . '/admin/admin.tpl');
} else {
echo 'Error: link not found';
}
}
if ($action == "dodiscard" or $action == "dopublished" or $action == "donew") {
if ($link = $db->get_row("SELECT * FROM " . table_links . " WHERE link_id = {$id}")) {
$xaction = substr($action, 2, 100);
$link = new Link();
$link->id = $id;
$link->read();
$link->published_date = time();
$link->status = $xaction;
$link->store_basic();
$main_smarty->assign('action', $xaction);
$main_smarty->assign('story_url', getmyurl('story', $id));
$main_smarty->assign('admin_modify_url', getmyurl('admin_modify', $id));
$db->query("UPDATE " . table_links . " set link_status='" . $xaction . "' WHERE link_id={$id}");
totals_regenerate();
// pagename
define('pagename', 'linkadmin');
$main_smarty->assign('pagename', pagename);
// show the template
$main_smarty->assign('tpl_center', '/admin/submission_update');
$main_smarty->display($template_dir . '/admin/admin.tpl');
} else {
echo 'Error: link not found';
}
}
示例3: do_submit3
function do_submit3() {
global $db, $current_user;
$linkres=new Link;
$linkres->id=$link_id = intval($_POST['id']);
$linkres->read();
// Check it is not in the queue already
if($linkres->votes == 0 && $linkres->status != 'queued') {
$linkres->status='queued';
$linkres->date=time();
$linkres->store_basic();
$linkres->insert_vote($current_user->user_id);
$db->query("delete from links where link_author = $linkres->author and link_status='discard' and link_votes=0");
if(!empty($_POST['trackback'])) {
require_once(mnminclude.'trackback.php');
$trackres = new Trackback;
$trackres->url=preg_replace('/ /', '+', trim($_POST['trackback']));
$trackres->link=$linkres->id;
$trackres->title=$linkres->title;
$trackres->author=$linkres->author;
$trackres->content=$linkres->content;
$res = $trackres->send();
}
}
header("Location: ./shakeit.php");
die;
}
示例4: do_submit3
function do_submit3()
{
global $db;
$linkres = new Link();
$linkres->id = sanitize($_POST['id'], 3);
if (!is_numeric($linkres->id)) {
die;
}
if (!Submit_Complete_Step2 && $_SESSION['step'] != 2) {
die('Wrong step');
}
$linkres->read();
totals_adjust_count($linkres->status, -1);
totals_adjust_count('queued', 1);
$linkres->status = 'queued';
$vars = array('linkres' => &$linkres);
check_actions('do_submit3', $vars);
if ($vars['linkres']->status == 'discard') {
$vars = array('link_id' => $linkres->id);
check_actions('story_discard', $vars);
} elseif ($vars['linkres']->status == 'spam') {
$vars = array('link_id' => $linkres->id);
check_actions('story_spam', $vars);
}
$linkres->store_basic();
$linkres->check_should_publish();
if (isset($_POST['trackback']) && sanitize($_POST['trackback'], 3) != '') {
require_once mnminclude . 'trackback.php';
$trackres = new Trackback();
$trackres->url = sanitize($_POST['trackback'], 3);
$trackres->link = $linkres->id;
$trackres->title = $linkres->title;
$trackres->author = $linkres->author;
$trackres->content = $linkres->content;
$res = $trackres->send();
}
$vars = array('linkres' => $linkres);
check_actions('submit_pre_redirect', $vars);
if ($vars['redirect']) {
header('Location: ' . $vars['redirect']);
} elseif ($linkres->link_group_id == 0) {
header("Location: " . getmyurl('upcoming'));
} else {
$redirect = getmyurl("group_story", $linkres->link_group_id);
header("Location: {$redirect}");
}
die;
}
示例5: killspam
function killspam($id)
{
global $db;
require_once mnminclude . 'link.php';
require_once mnminclude . 'votes.php';
require_once mnminclude . 'tags.php';
$user = $db->get_row('SELECT * FROM ' . table_users . " where user_id={$id}");
if (!$user->user_id) {
return;
}
canIChangeUser($user->user_level);
$db->query('UPDATE `' . table_users . "` SET user_enabled=0, `user_pass` = '63205e60098a9758101eeff9df0912ccaaca6fca3e50cdce3', user_level = 'Spammer' WHERE `user_id` = {$id}");
$results = $db->get_results($sql = "SELECT comment_id, comment_link_id FROM `" . table_comments . "` WHERE `comment_user_id` = {$id}");
if ($results) {
foreach ($results as $result) {
$db->query($sql = 'UPDATE `' . table_comments . '` SET `comment_status` = "spam" WHERE `comment_id` = "' . $result->comment_id . '"');
$vars = array('comment_id' => $result->comment_id);
check_actions('comment_spam', $vars);
$link = new Link();
$link->id = $result->comment_link_id;
$link->read();
$link->recalc_comments();
$link->store();
}
}
ban_ip($user->user_ip, $user->user_lastip);
$results = $db->get_results("SELECT * FROM `" . table_groups . "` WHERE group_creator = '{$id}'");
if ($results) {
foreach ($results as $result) {
$db->query('DELETE FROM `' . table_group_member . '` WHERE member_group_id = ' . $result->group_id);
$db->query('DELETE FROM `' . table_group_shared . '` WHERE share_group_id = ' . $result->group_id);
}
}
$db->query("DELETE FROM `" . table_groups . "` WHERE group_creator = '{$id}'");
$results = $db->get_results("SELECT vote_id,vote_link_id FROM `" . table_votes . "` WHERE `vote_user_id` = {$id}");
if ($results) {
foreach ($results as $result) {
$db->query('DELETE FROM `' . table_votes . '` WHERE `vote_id` = "' . $result->vote_id . '"');
$link = new Link();
$link->id = $result->vote_link_id;
$link->read();
$vote = new Vote();
$vote->type = 'links';
$vote->link = $result->vote_link_id;
if (Voting_Method == 1) {
$link->votes = $vote->count();
$link->reports = $link->count_all_votes("<0");
} elseif (Voting_Method == 2) {
$link->votes = $vote->rating();
$link->votecount = $vote->count();
$link->reports = $link->count_all_votes("<0");
} elseif (Voting_Method == 3) {
$link->votes = $vote->count();
$link->karma = $vote->karma();
$link->reports = $link->count_all_votes("<0");
}
$link->store_basic();
$link->check_should_publish();
}
}
$results = $db->get_results($sql = "SELECT link_id, link_url FROM `" . table_links . "` WHERE `link_author` = {$id}");
global $USER_SPAM_RULESET, $FRIENDLY_DOMAINS;
$filename = mnmpath . $USER_SPAM_RULESET;
$lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$approved = file(mnmpath . $FRIENDLY_DOMAINS, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($results) {
foreach ($results as $result) {
if (preg_match('/:\\/\\/(www\\.)?([^\\/]+)(\\/|$)/', $result->link_url, $m)) {
$domain = strtoupper($m[2]) . "\n";
if (!in_array($domain, $lines) && !in_array($domain, $approved)) {
$lines[] = $domain;
$changed = 1;
}
}
$vars = array('link_id' => $result->link_id);
check_actions('story_spam', $vars);
}
}
if ($changed) {
if (is_writable($filename)) {
if ($handle = fopen($filename, 'w')) {
fwrite($handle, join("\n", $lines));
fclose($handle);
}
}
}
$db->query($sql = 'UPDATE `' . table_links . '` SET `link_status` = "spam" WHERE `link_author` = "' . $id . '"');
$db->query('DELETE FROM `' . table_saved_links . '` WHERE `saved_user_id` = "' . $id . '"');
$db->query('DELETE FROM `' . table_trackbacks . '` WHERE `trackback_user_id` = "' . $id . '"');
$db->query('DELETE FROM `' . table_friends . '` WHERE `friend_id` = "' . $id . '"');
$db->query('DELETE FROM `' . table_messages . "` WHERE `sender`={$id} OR `receiver`={$id}");
}
示例6: do_the_import_stuff
//.........这里部分代码省略.........
// strip all except letters and spaces and commas
$linkres->tags = preg_replace('/[^a-z A-Z,]+/i', '', $temp1);
}
//----------------------------------------------------------------------
if (checklevel('god')) {
$Story_Content_Tags_To_Allow = Story_Content_Tags_To_Allow_God;
} elseif (checklevel('admin')) {
$Story_Content_Tags_To_Allow = Story_Content_Tags_To_Allow_Admin;
} else {
$Story_Content_Tags_To_Allow = Story_Content_Tags_To_Allow_Normal;
}
$linkres->title_url = makeUrlFriendly($linkres->title);
$linkres->url = get_val($item, $MyArray['link_url']);
$linkres->url_title = $linkres->title;
$linkres->content = get_val($item, $MyArray['content']);
$linkres->content = strip_tags($linkres->content, $Story_Content_Tags_To_Allow);
$linkres->content = str_replace("\n", "<br />", $linkres->content);
$linkres->link_field1 = get_val($item, $MyArray['link_field1']);
$linkres->link_field2 = get_val($item, $MyArray['link_field2']);
$linkres->link_field3 = get_val($item, $MyArray['link_field3']);
$linkres->link_field4 = get_val($item, $MyArray['link_field4']);
$linkres->link_field5 = get_val($item, $MyArray['link_field5']);
$linkres->link_field6 = get_val($item, $MyArray['link_field6']);
$linkres->link_field7 = get_val($item, $MyArray['link_field7']);
$linkres->link_field8 = get_val($item, $MyArray['link_field8']);
$linkres->link_field9 = get_val($item, $MyArray['link_field9']);
$linkres->link_field10 = get_val($item, $MyArray['link_field10']);
$linkres->link_field11 = get_val($item, $MyArray['link_field11']);
$linkres->link_field12 = get_val($item, $MyArray['link_field12']);
$linkres->link_field13 = get_val($item, $MyArray['link_field13']);
$linkres->link_field14 = get_val($item, $MyArray['link_field14']);
$linkres->link_field15 = get_val($item, $MyArray['link_field15']);
$linkres->category = $feed->feed_category;
//MJE: MOD
$linkres->link_summary = utf8_substr(strip_tags($linkres->content), 0, StorySummary_ContentTruncate - 1);
//---------
if ($thecount >= $feed->feed_item_limit && $skipthis == 0) {
echo "Reached import limit, skipping<HR>";
$skipthis = 1;
}
if ($feed->feed_title_dupe == 0 && $skipthis == 0) {
// 0 means don't allow, 1 means allow
if ($linkres->duplicates_title($linkres->title) > 0) {
//echo "Title Match, skipping: " . $linkres->title . "<HR>";
echo '<span style="color:#fc0000;">Title Match, skipping</span> <hr>';
$skipthis = 1;
}
}
if ($feed->feed_url_dupe == 0 && $linkres->url != "" && $skipthis == 0) {
// 0 means don't allow, 1 means allow
if ($linkres->duplicates($linkres->url) > 0) {
//echo "URL Match, skipping: " . $linkres->title . "<HR>";
echo '<span style="color:#fc0000;">URL Match, skipping</span> <hr>';
$skipthis = 1;
}
}
if ($skipthis == 0) {
echo "Importing <hr>";
$added_one = true;
$linkres->store();
totals_adjust_count($linkres->status, 1);
tags_insert_string($linkres->id, $dblang, $linkres->tags);
require_once mnminclude . 'votes.php';
if ($feed->feed_random_vote_enable == 1) {
$feed->feed_votes = rand($feed->feed_random_vote_min, $feed->feed_random_vote_max);
}
$votes = 0;
for ($i = 1; $i <= $feed->feed_votes; $i++) {
$value = 1;
$vote = new Vote();
$vote->type = 'links';
$vote->user = 0;
$vote->link = $linkres->id;
$vote->ip = '0.0.0.' . $i;
$vote->value = $value;
$vote->insert();
$vote = "";
$votes += $value;
// $vote = new Vote;
// $vote->type='links';
// $vote->link=$linkres->id;
}
$linkres->votes = $votes;
$linkres->store_basic();
$linkres->check_should_publish();
$thecount = $thecount + 1;
}
}
$sql = "UPDATE `" . table_feeds . "` SET `feed_last_check` = FROM_UNIXTIME(" . (time() - 300) . ") WHERE `feed_id` = {$feed->feed_id};";
//echo $sql;
$db->query($sql);
} else {
echo "Feed not fully setup, skipping <hr>";
}
if ($added_one) {
return true;
} else {
return false;
}
}
示例7: Vote
require_once mnminclude . 'votes.php';
for ($i = 1; $i <= $feed->feed_votes; $i++) {
$value = 10;
$vote = new Vote();
$vote->type = 'links';
$vote->user = 0;
$vote->link = $linkres->id;
$vote->ip = '0.0.0.' . $i;
$vote->value = $value;
$vote->insert();
$vote = "";
$vote = new Vote();
$vote->type = 'links';
$vote->link = $linkres->id;
$linkres->votes = $vote->count();
$linkres->store_basic();
$linkres->check_should_publish();
}
$thecount = $thecount + 1;
}
}
$sql = "Update `" . table_prefix . "feeds` set `feed_last_check` = FROM_UNIXTIME(" . (time() - 300) . ") where `feed_id` = {$feed->feed_id};";
//echo $sql;
$db->query($sql);
} else {
echo "Feed not fully setup, skipping <hr>";
}
} else {
echo "Feed Frequency is " . $feed->feed_freq_hours . ".<br>";
$x = strtotime($feed->feed_last_check);
$y = time() - $feed->feed_freq_hours * 3600;
示例8: do_submit3
function do_submit3()
{
global $db;
$linkres = new Link();
$linkres->id = sanitize($_POST['id'], 3);
if (!is_numeric($linkres->id)) {
die;
}
$linkres->read();
totals_adjust_count($linkres->status, -1);
totals_adjust_count('queued', 1);
$linkres->status = 'queued';
$vars = array('linkres' => $linkres);
check_actions('do_submit3', $vars);
$linkres->store_basic();
$linkres->check_should_publish();
if (isset($_POST['trackback']) && sanitize($_POST['trackback'], 3) != '') {
require_once mnminclude . 'trackback.php';
$trackres = new Trackback();
$trackres->url = sanitize($_POST['trackback'], 3);
$trackres->link = $linkres->id;
$trackres->title = $linkres->title;
$trackres->author = $linkres->author;
$trackres->content = $linkres->content;
$res = $trackres->send();
}
if ($linkres->link_group_id == 0) {
header("Location: " . getmyurl('upcoming'));
die;
} else {
$redirect = getmyurl("group_story", $linkres->link_group_id);
header("Location: {$redirect}");
die;
}
}
示例9: do_submit3
function do_submit3()
{
global $db;
$linkres = new Link();
$linkres->id = $link_id = strip_tags($_POST['id']);
$linkres->read();
//if (link_errors($linkres)) {
// echo '<form id="thisform">';
// echo '<input type=button onclick="window.history.go(-2)" value="'._(PLIGG_Visual_Submit_Step3_Modify).'">';
// return;
//}
$linkres->status = 'queued';
$linkres->store_basic();
$linkres->check_should_publish();
if (!empty($_POST['trackback'])) {
require_once mnminclude . 'trackback.php';
$trackres = new Trackback();
$trackres->url = trim($_POST['trackback']);
$trackres->link = $linkres->id;
$trackres->title = $linkres->title;
$trackres->author = $linkres->author;
$trackres->content = $linkres->content;
$res = $trackres->send();
}
header("Location: " . getmyurl('upcoming'));
die;
}