Version 2.1, is there a way to change the _banner display to a Male or Shemale? Now it only shows top viewer.
Need help with Chaturbate API coding.
Collapse
X
-
I think I solved the problem, I put in: if ( $cam->gender == s )
code:
function tpl_banner() {
$cams = new SimpleXMLElement(FLATFILE, null, true);
$count = 0;
foreach( $cams as $cam ){
if ( $cam->gender == s ) {
if ( $count == 0 )
{Comment
-
Comment
-
Yes. Download the latest cron.php file from the v2.1
And check that settings.php have the right paths
For exempel:
define ( 'BASEPATH', '/home/xxx/public_html/xxx .com' );
define ( 'FLATFILE', BASEPATH . '/includes/data/feed.xml');Comment
-
Yes I did.
But the new settings.php in V2.1 doesn't have that base path.
define ( 'BASEPATH', getcwd() );
define ( 'FLATFILE', BASEPATH . '/includes/data/feed.xml');
If I removed the includes/ it doesn't work.
The only way the site is updated is only if I turn the cron to falseComment
-
do you have an actual cron job setup to run cron.php however often you want to update?Comment
-
Comment
-
-
If you want to just cache the current XML of online models ...
Works with PHP 5 untested with PHP 7*PHP Code:<?php //debugging comment out when done error_reporting(E_ALL); ini_set('display_errors', '1'); //cache the working XML file locally $sFileName = './name.xml'; $iCurrentTime = time(); $iFiletime = filemtime($sFileName); if ($iFiletime < $iCurrentTime - 120) { $data = file_get_contents('http://URL_here'); $fp = fopen($sFileName, 'w+'); fwrite($fp, $data); fclose($fp); } ///load cached xml file $xml = simplexml_load_file("name.xml"); //You do the rest :OP{...} ?>Comment
-
If it is not updating from both cron and running from the browser then you probably have a permissions problem with the folder that the xml file is being written to.
If it will write when you run cron from the browser then make sure to delete the file before you try to update it from the cron. If the file was created from a run from the browser then the run from cron might not be able to delete the file created from the run from browser, again because of permissions issues.
.All cookies cleared!Comment
-
-
Thank you man! It's working great@keen - checkout v2.1 I changed up the directory structure a bit but the functions are pretty much the same.
Just keep in mind some of the models put fake ages so the categories wont be 100% accurate.
https://github.com/hillipino/Chaturbate-API
Comment

Comment