コード例 #1
0
<?php

/* @type $Params string[] */

$tpl = eZTemplate::instance();
$hash = $Params['Hash'];

$socialCard = MMSocialCard::fetchByHash($hash);
$applicationIdentifier = $socialCard->getApplicationIdentifier();

$applicationUrl = SolrSafeOperatorHelper::getApplicationUrl( $applicationIdentifier );

$tpl->setVariable('socialCard', $socialCard);
$tpl->setVariable('baseUrl', urldecode(SolrSafeOperatorHelper::context()));
$tpl->setVariable('applicationUrl', $applicationUrl);
$Result['content'] = $tpl->fetch('extension/ezoscar/design/oscar/templates/esibuild/social/card.tpl');
コード例 #2
0
            '%GLOBAL_RANK' => $playerScoring->attribute('global_ranking'),
            '%NB_POINTS' => $playerScoring->attribute('score')
        ));

        $description = strip_tags($description);
        $data = array(
            'title' => ezpI18n::tr("merck/quiz", "QUIZ ANNOUNCEMENT"),
            'description' => $description,
            'specialty_rank' => $playerScoring->attribute('specialty_ranking'),
            'global_rank' => $playerScoring->attribute('global_ranking'),
            'application_identifier' => $applicationIdentifier,
            'type' => $cardType,
        );
        $userId = $playerScoring->attribute('uuid');
        $clusterIdentifier = $playerScoring->attribute('cluster_identifier');

        $hash = md5($cluster_identifier . $userId . $description);

        $socialCard = MMSocialCard::fetchByHash($hash);
        if (!$socialCard)
        {
            $socialCard = MMSocialCard::create($data);
            $socialCard->hash = $hash;
            $socialCard->store();
        }

        echo ContextTool::instance()->domain() . "/esibuild/social_card/$hash";
    }
}