mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
basic dynamic campaign page
tune page
This commit is contained in:
parent
8bbe6e63ee
commit
d9c4eb3ce4
8 changed files with 162 additions and 1536 deletions
|
@ -5,11 +5,12 @@
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
|
"ext-pdo": "*",
|
||||||
|
"ext-pdo_mysql": "*",
|
||||||
"leafo/scssphp": "0.7.6",
|
"leafo/scssphp": "0.7.6",
|
||||||
"erusev/parsedown": "^1.6",
|
"erusev/parsedown": "^1.6",
|
||||||
"erusev/parsedown-extra": "^0.7.1",
|
"erusev/parsedown-extra": "^0.7.1",
|
||||||
"pelago/emogrifier": "^2.0",
|
"pelago/emogrifier": "^2.0",
|
||||||
"mustangostang/spyc": "^0.6.2",
|
"mustangostang/spyc": "^0.6.2"
|
||||||
"phpunit/phpunit": "^6.5"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1548
composer.lock
generated
1548
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -135,6 +135,8 @@ class Controller
|
||||||
$router->get('/verify/{token}', 'AcquisitionActions::executeVerify');
|
$router->get('/verify/{token}', 'AcquisitionActions::executeVerify');
|
||||||
$router->get('/verify', 'AcquisitionActions::executeAutoVerify');
|
$router->get('/verify', 'AcquisitionActions::executeAutoVerify');
|
||||||
|
|
||||||
|
$router->get('/follow/{claim}', 'AcquisitionActions::executeFollowCampaign');
|
||||||
|
|
||||||
|
|
||||||
$router->get('/news/category/{category}', 'ContentActions::executePostCategoryFilter');
|
$router->get('/news/category/{category}', 'ContentActions::executePostCategoryFilter');
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,24 @@
|
||||||
|
|
||||||
class AcquisitionActions extends Actions
|
class AcquisitionActions extends Actions
|
||||||
{
|
{
|
||||||
|
public static function executeFollowCampaign(string $claimName)
|
||||||
|
{
|
||||||
|
$claim = ChainQuery::findChannelClaim($claimName);
|
||||||
|
|
||||||
|
if (!$claim || !$claim['source_url']) {
|
||||||
|
Controller::redirect('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
$title = $claim['title'] ?: $claim['name'];
|
||||||
|
$coverUrl = $claim['source_url'];
|
||||||
|
return ['acquisition/follow_campaign', [
|
||||||
|
'claim' => $claim,
|
||||||
|
'claimCount' => ChainQuery::countClaimsInChannel($claim['claim_id']),
|
||||||
|
'title' => $title,
|
||||||
|
'coverUrl' => $coverUrl,
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
public static function executeYouTube(string $version = '')
|
public static function executeYouTube(string $version = '')
|
||||||
{
|
{
|
||||||
$errorMessage = Request::getParam('error_message', '');
|
$errorMessage = Request::getParam('error_message', '');
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$config = [];
|
$config = [];
|
||||||
|
// $config[Config::CHAINQUERY_DSN] = '';
|
||||||
|
// $config[Config::CHAINQUERY_USERNAME] = '';
|
||||||
|
// $config[Config::CHAINQUERY_PASSWORD] = '';
|
||||||
// $config[Config::GITHUB_KEY] = '';
|
// $config[Config::GITHUB_KEY] = '';
|
||||||
// $config[Config::GITHUB_APP_CLIENT_ID] = ''; //optional, increases API rate limit
|
// $config[Config::GITHUB_APP_CLIENT_ID] = ''; //optional, increases API rate limit
|
||||||
// $config[Config::GITHUB_APP_CLIENT_SECRET] = '';
|
// $config[Config::GITHUB_APP_CLIENT_SECRET] = '';
|
||||||
|
|
32
lib/thirdparty/ChainQuery.class.php
vendored
Normal file
32
lib/thirdparty/ChainQuery.class.php
vendored
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class ChainQuery
|
||||||
|
{
|
||||||
|
protected static $pdo = null;
|
||||||
|
|
||||||
|
public static function getInstance()
|
||||||
|
{
|
||||||
|
if (!static::$pdo) {
|
||||||
|
static::$pdo = new PDO(Config::get(Config::CHAINQUERY_DSN),
|
||||||
|
Config::get(Config::CHAINQUERY_USERNAME), Config::get(Config::CHAINQUERY_PASSWORD));
|
||||||
|
}
|
||||||
|
return static::$pdo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function findChannelClaim($claimName)
|
||||||
|
{
|
||||||
|
$claimName = '@' . trim($claimName, '@');
|
||||||
|
$stmt = static::getInstance()->prepare("SELECT * FROM claim c WHERE c.name = ? AND c.bid_state = ?");
|
||||||
|
$stmt->execute([$claimName, "controlling"]);
|
||||||
|
return $stmt->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function countClaimsInChannel($claimId)
|
||||||
|
{
|
||||||
|
$stmt = static::getInstance()->prepare("SELECT COUNT(*) FROM claim c WHERE c.publisher_id = ?");
|
||||||
|
$stmt->execute([$claimId]);
|
||||||
|
$result = $stmt->fetch();
|
||||||
|
return $result[0] ?? 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,9 @@ class Config
|
||||||
|
|
||||||
//Constant to help with managing strings
|
//Constant to help with managing strings
|
||||||
const IS_PROD = "is_prod";
|
const IS_PROD = "is_prod";
|
||||||
|
const CHAINQUERY_DSN = 'chainquery_dsn';
|
||||||
|
const CHAINQUERY_USERNAME = 'chainquery_username';
|
||||||
|
const CHAINQUERY_PASSWORD = 'chainquery_password';
|
||||||
const GITHUB_KEY = "github_key";
|
const GITHUB_KEY = "github_key";
|
||||||
const GITHUB_APP_CLIENT_ID = "github_app_client_id";
|
const GITHUB_APP_CLIENT_ID = "github_app_client_id";
|
||||||
const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret";
|
const GITHUB_APP_CLIENT_SECRET = "github_app_client_secret";
|
||||||
|
|
87
view/template/acquisition/follow_campaign.php
Normal file
87
view/template/acquisition/follow_campaign.php
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
<?php Response::setMetaDescription('Watch ' . $title . ' on a platform that shares your values.') ?>
|
||||||
|
<?php Response::setMetaTitle($title . ' on LBRY') ?>
|
||||||
|
<pre>
|
||||||
|
<?php print_r($claim) ?>
|
||||||
|
</pre>
|
||||||
|
<main class="ancillary">
|
||||||
|
<section class="hero hero--half-height" style="background-image: url(<?php echo $coverUrl ?>)">
|
||||||
|
<div class="inner-wrap inner-wrap--center-hero">
|
||||||
|
<h1>Watch <?php echo $title ?></h1>
|
||||||
|
<h3>On a platform that shares your values.</h3>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<div class="inner-wrap">
|
||||||
|
<div class="inline-image-and-text">
|
||||||
|
<img
|
||||||
|
alt="cctv camera"
|
||||||
|
class="inline-image"
|
||||||
|
src="/img/icon--cctv.svg"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<p>Predatory platforms like Facebook and YouTube abuse users, censor creators, enforce rules arbitrarily, and spy on everything you do.</p>
|
||||||
|
</div>
|
||||||
|
<div class="inline-image-and-text">
|
||||||
|
<p>LBRY is a user-controlled, open-source platform that stands for user freedom and personal choice. It has <em><?php echo $claimCount ?> videos from <?php echo $claim['name'] ?></em>.</p>
|
||||||
|
<img
|
||||||
|
alt="smile icon"
|
||||||
|
class="inline-image"
|
||||||
|
src="/img/icon--smile.svg"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="inner-wrap">
|
||||||
|
<h3>Step 1: Download LBRY</h3>
|
||||||
|
<p>LBRY is an open-source application available on Windows, macOS, Linux, and Android, with iOS coming soon.</p>
|
||||||
|
<br/>
|
||||||
|
<div class="align-text--center">
|
||||||
|
<?php echo View::render('download/_downloadButton', ['buttonStyle' => 'primary'])?>
|
||||||
|
<a href="/get?showall=1" class="button--link">show all platforms</a>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="inner-wrap">
|
||||||
|
<h3>Step 2: Search and Follow <?php echo $claim['name'] ?></h3>
|
||||||
|
<p>Type <?php echo $claim['name'] ?> in the search bar and then click Follow.</p>
|
||||||
|
<div class="align-text--center" style="margin-top: 1rem; margin-bottom: 1rem;">
|
||||||
|
<img src="https://via.placeholder.com/600" alt="How to follow <?php echo $claim['name'] ?> on LBRY" />
|
||||||
|
</div>
|
||||||
|
<p>If you provide your email address, you'll be notified about every new video.</p>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="inner-wrap">
|
||||||
|
<h3>Step 3 (Optional): Support <?php echo $claim['name'] ?></h3>
|
||||||
|
<p>Use the Tip button to support <?php echo $claim['name'] ?> and help others discover his content.</p>
|
||||||
|
<p>If you verify your account, you'll receive free credits that you can send to <?php echo $claim['name'] ?> or other creators.</p>
|
||||||
|
<small><em>Having trouble?</em> Read <a href="/faq/rewards">the rewards FAQ</a> for help.</small>
|
||||||
|
<div class="align-text--center" style="margin-top: 1rem; margin-bottom: 1rem;">
|
||||||
|
<img src="https://via.placeholder.com/600" alt="How to support <?php echo $claim['name'] ?> on LBRY" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div class="inner-wrap">
|
||||||
|
<h3>Step 4: Enjoy Peace of Mind</h3>
|
||||||
|
<p>When you watch <?php echo $title ?> on LBRY, you're watching via a platform that is open-source, user-controlled, and censorship-resistant.</p>
|
||||||
|
<p>Unlike other platforms, it is <em>literally impossible</em> for LBRY to put it's thumb on the scales.</p>
|
||||||
|
<p>So what are you waiting for? Try LBRY today!</p>
|
||||||
|
<br/>
|
||||||
|
<div class="align-text--center">
|
||||||
|
<?php echo View::render('download/_downloadButton', ['buttonStyle' => 'primary'])?>
|
||||||
|
<a href="/get?showall=1" class="button--link">show all platforms</a>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<div>
|
||||||
|
<small>Not enough details for you? Read the <a href="/what">manifesto</a> or the <a href="//lbry.tech">docs</a>.</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
Loading…
Add table
Reference in a new issue