function loadRecentPosts($forum, $start, $limit) { global $error; global $conf; require_once 'd4_data_service.php'; $d4s = new D4DataService($conf['d4dsn'], $conf['d4dbname'], $conf['d4dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $posts = $d4s->getLastCommentsForForum($forum, $start, $limit); if ($posts) { // note, this is sparsely populated with only the items that the user actually touched echo json_encode(array("success" => true, "posts" => $posts)); } else { echo json_encode(array("success" => true, "posts" => array())); } }
<meta property="og:title" content="' . $page_title . '"/> <meta property="og:site_name" content="' . $productname . '"/> <meta property="og:url" content="' . $url . '"/> <meta property="og:image" content="' . $image . '"/> <meta property="og:description" content="' . $description_tag . '"/> <meta property="og:locale" content="' . $locale . '"/>'; if (!$lang_was_set) { $lang = substr($locale, 0, 2); } if ($locale) { $ds->addInterestsLanguage($identity, $locale); } // that will effect for new users that came first time through a link to an article of setting the language filter to that language only if ($isbot) { require_once 'd4_data_service.php'; $d4s = new D4DataService($conf['d4dsn'], $conf['d4dbname'], $conf['d4dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $forums = $ds->loadForumsForTopic($threadid); foreach ((array) $forums as $fs) { $f = $fs['forum']; $comments = $d4s->getAllCommentsForThread($f, $url); $comments_html .= '<ul class="bot_comments">'; foreach ((array) $comments as $post) { $comments_html .= ' <li>' . $post['author_name'] . ':' . $post['message'] . '</li>'; } $comments_html .= ' </ul>'; } } } else { $meta_tags = '
<?php /** Port of NRO users, creating subscriptions for all Citizens 6/17/2015 **/ include 'config.php'; require_once 'log_data_service.php'; require_once 'pov_data_service.php'; require_once 'd4_data_service.php'; require_once 'api.php'; $error = ''; $logService = new LogDataService(); $ds = new PovDataService($conf['dsn'], $conf['dbname'], $conf['dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $d4s = new D4DataService($conf['d4dsn'], $conf['d4dbname'], $conf['d4dbpassword'], array(PDO::ATTR_PERSISTENT => false)); $identities = $d4s->getNROIdentities(); foreach ($identities as $idrec) { $identity = $idrec['identity']; $name = 'us_con'; $select = 0; $check = 1; $fringe = 1; $ds->saveSimpleInterests($identity, $name, 'check', $check); $ds->saveSimpleInterests($identity, $name, 'select', $select); $ds->saveSimpleInterests($identity, $name, 'fringe', $fringe); //$simples=innerGetSimpleInterests($identity,$name); $categoryid = $ds->getSimpleInterestsCategory($name); innerSubscribeNode($categoryid, 'us_con_fringe', $select, $check, $fringe); }