Go to Profile
Much better to just assign a global variable that has conditions to switch in and out of HTTP/HTTPS prefix. So all of the resource links and references are all handled automatically.
Preferably you want UDP protocol prefix set up, while it’s very fast. SSL is heavy on the CPU so maybe 100s of clients are sending requests to that it may slow down..
Glad to be of help ! :wink
<a href="userforumpost.php?id=<?=$id ?>"<?=intval($numforumposts) ?> </a>
number_format() is used for decimals values, what is the output of $numforumposts ? It should be a INT.
It’s safe to use <?= and reduces code.
<?=$a ?> is a shorthand for <?php echo $a; ?> so you also don’t need to add a semi-colon. It’s automatically handled.
It's enabled by default since 5.4 regardless of php.ini settings.
Type declare
public static function ScrapeId(int $id)
Or I usually do
public static function ScrapeId($id): ?int {}
The ?int just tells it to pass through even if not a INT (for those certain cases).
Thanks m-jay! I didn’t even think about this for benchmarking
Great plan. I’m going to get into this myself this weekend. I’ll wait on your final, I didn’t know that was old TT code, saw a few flaws and I was like …!
Also
$seeders = $leechers = $completed = 0;
This is what list() takes care of. Variables are faster but logically, list is the solution there.
I’ll update this class too, implement cURL and options as constants, the interface and the object to scrape id or file.
I would go for checking null so instead of this
if (empty($trackers)) {
To
function ($trackers = null, …)
if (is_null($trackers)) {
I’m just curious, too.. this to me appears incorrect in the way that it can be instructed to assign value and key (and if relying on 1st array position, add a pointer: &$key), not sure why this is a multi array when the iteration is already taking place with those variables - $ann, etc
foreach ($annlist as $ann) {
foreach ($ann as $val) {
Try domain.com/test.php?id=5
$file = printf('uploads/%s.torrent', (isset($_GET[‘id’]) ? Intval($_GET[‘id’]) : 0));
All of this is very easy and I’ve already coded most of what’s requested here for profiles. All but “user’s uploads” which is a really quick query.
Have a look at the V4 section for profile post. Easy to port for V3/MVC.
If you guys need any SQL work let me know! Just show me the table structure and I can generate a structure scheme and get results without any database
Let’s follow up on this! Will make new progress efforts now that I know much more about code.
Updates following.
Implement a interface, dump those variables into public functions and call them in the interface block. It will clean up a lot of that code.
For BSD-based systems (root):
# locate my.cnf
or
# edit /usr/local/etc/my.cnf
# service mysql-server restart
I don’t know what BTREE is so I can’t help there. It’s possible that plug-in or engine is effecting incremental steps, or is duplicating the primary key.
I would not modify indexes or primarily keys with a engine/plug-in that may have unpredictable effects (often experimental) on the tables, general transactions or even the database itself.
My advise is to remove it and go back to stock mariadb install, and import your SQL file into the fresh mariadb install. My table looks nothing like that, and I have 2300 torrents and database relations.. still fast as a bullet.
Not sure what all the MySQL fuss is about lately. 80% of the SQL issues are due to exotic parameters, engine substitutions, config edits.. it should work out of the box without modifying anything in the database!
POLL:
How many of you are using MariaDB? I will write a script that backs up, checks, fixes issues that will cause problems and compile a progress report for saving as document. Your trackers should not be suffering over this.
Title is a global attribute. You can use it with any tag.
<center><span title= ” . format_comment($row['descr']) . " style=‘font-weight:bold’>” . format_comment($row['descr']) . "<b/></center>
Save yourself time on these conditions, use ? :
$token = !empty($token) ? strval($token) : null;
You get a value fill, or a fallback.
Where is description coming in from? Check $row[‘descr’]
$s = preg_replace("/\s*[a-zA-Z\/\/:\.]*youtu.be\/([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", "<a href=\"trailer.php?yt_code=$1\" onclick=\"return hs.htmlExpand(this, { objectType: \'iframe\', width: 620, height: 420, align: \'center\', dimmingOpacity: 0.8 } )\"><img src=\"js/shout/images/play_yout.gif\" alt=\"Regarder dans un Popup\" />YOUTUBE_A_NEW_VIDEO_HAS_ADDED</a>", $row['youtube']);
Even so, I have a friend who is university educated on regex and patterns, and can have regex doing anything you want.
For example, I have regex (preg_match_all) searching inside image files for injected PHP code (malicious exploits), and it works perfectly after about 7 different trials on a specific expression and parser trick, with 4 different PNG exploits.
Regex is powerful.