function maniapress_event_publisher_hook($post) { $notification = new \Maniaplanet\WebServices\Notification(); $notification->message = $post->post_title; $notification->link = get_permalink($post->ID); try { $maniahome = new \Maniaplanet\WebServices\ManiaHome(maniapress_get_option('api-username'), maniapress_get_option('api-password'), maniapress_get_option('manialink')); $maniahome->postPublicNotification($notification); } catch (\Maniaplanet\WebServices\Exception $e) { trigger_error($e->getHTTPStatusCode() . ' ' . $e->getHTTPStatusMessage() . ' ' . $e->getMessage(), E_USER_ERROR); } }
function maniapress_core_settings_api_password_input() { ?> <input id="maniapress-api-password" name="maniapress-options[api-password]" size="25" type="password" value="<?php echo maniapress_get_option('api-password'); ?> " class="regular-text"/> <?php }
$ui = new \ManiaLib\Gui\Elements\Bgs1InRace(202, 200); $ui->setPosition(0, 0, 0.09); $ui->setAlign('center', 'center'); $ui->setSubStyle(\ManiaLib\Gui\Elements\Bgs1InRace::BgTitleShadow); $ui->save(); Manialink::beginFrame(-100, 90, 0.1); $ui = new Quad(200, 28); $ui->setBgcolor(maniapress_get_option('theme-header-bg', 'fff')); $ui->save(); $ui = new \ManiaLib\Gui\Elements\Quad(200, 145); $ui->setPosition(0, -28, 0); $ui->setBgcolor(maniapress_get_option('theme-content-bg', 'fffa')); $ui->save(); $ui = new \ManiaLib\Gui\Elements\Quad(200, 7); $ui->setPosition(0, -173, 0); $ui->setBgcolor(maniapress_get_option('theme-footer-bg', 'fff')); $ui->save(); Manialink::beginFrame(10, -5.5, 0.1); $ui = new Icons128x128_1(15); $ui->setSubStyle(Icons128x128_1::Vehicles); $ui->save(); $ui = new Label(100); $ui->setPosition(17, -2.5, 0); $ui->setScale(1.75); $ui->setStyle(Label::TextButtonBig); $ui->setText(maniapress_get_bloginfo('name')); $ui->save(); $ui = new Label(150); $ui->setPosition(17, -9, 0.1); $ui->setStyle(Label::TextTips); $ui->setText(maniapress_get_bloginfo('description'));
use ManiaLib\ManiaScript\UI; use ManiaLib\ManiaScript\Action; use ManiaLib\ManiaScript\Event; Manialink::beginFrame(-100, -83, 0.2); $ui = new Label(175); $ui->setValign('center2'); $ui->setPosition(3, -3.5, 0); $ui->setScale(0.75); $ui->setStyle(Label::TextInfoSmall); $ui->setText(sprintf('$<$000%s$> is proudly powered by $l[http://wordpress.org/]WordPress$l and $l[http://code.google.com/p/maniapress/]ManiaPress$l.', maniapress_get_bloginfo('name'))); $ui->save(); if (maniapress_get_option('manialink')) { Manialink::beginFrame(150, 1.5, 0.1); $params['url'] = maniapress_get_option('manialink'); if (maniapress_get_option('manialink-name')) { $params['name'] = maniapress_get_option('manialink-name'); } $url = 'http://maniahome.maniaplanet.com/add/?' . http_build_query($params); $ui = new \ManiaLib\Gui\Elements\IncludeManialink(); $ui->setUrl($url); $ui->save(); Manialink::endFrame(); } Manialink::beginFrame(188, -1, 0.1); $ui = new Icons64x64_1(5); $ui->setSubStyle(Icons64x64_1::ToolUp); $ui->setScriptEvents(); $ui->setId('view-external'); //$ui->setUrl(ManiaLib\Utils\URI::getCurrent()); $ui->save(); UI::tooltip('view-external', 'Visit the Website');
function maniapress_google_analytics() { $propertyId = maniapress_get_option('google-analytics-id'); if (!$propertyId) { return; } $tracker = new \ManiaLib\Application\Tracking\GoogleAnalytics($propertyId); $tracker->loadFromConfig(); $ui = new \ManiaLib\Gui\Elements\Quad(0.01, 0.01); $ui->setPosition(800, 600); $ui->setImage($tracker->getTrackingURL(), true); $ui->save(); }