AI … the truth

wpHakka.com.br - underground guerrilla - plugin arsenal for wp warfare

face it, AIs are just machines, they can’t do anything by their own, they can’t see what happens and have not organizational or strategical capacity, they might have access to a lot of historical data, but never can predict anything, they are “smart enough” to make stuff up when they don’t know a real answer and that, makes them be extremely stupid

so, let’s cut to the chase

my question:
I get the folder list form imap in disorder, how could I easy fix the order, but the bang is, abc order and so wouldn’t work, so probably I need to define an order which matter to me and order the rest as abc any, suggestion?

AI:
You want a custom sort — a defined order for “important” folders (e.g., INBOX, Sent, Drafts) and then a fallback alphabetical for everything else.
// 1️⃣ Define your priority order
$priority_order = [‘INBOX’, ‘Sent’, ‘Trash’, ‘Drafts’, ‘Junk’];
// 2️⃣ Normalize folder names
$normalized_folders = array_map(function($name){
return ucfirst(strtolower($name));
}, $mbox_list);
// 3️⃣ Split into priority and others
$priority_folders = [];
$other_folders = [];
foreach ($normalized_folders as $folder) {
if (in_array($folder, $priority_order)) {
$priority_folders[] = $folder;
} else {
$other_folders[] = $folder;
}
}

// 4️⃣ Order the priority folders according to $priority_order
$priority_folders_sorted = [];
foreach ($priority_order as $pname) {
if (in_array($pname, $priority_folders)) {
$priority_folders_sorted[] = $pname;
}
}

// 5️⃣ Sort the remaining folders alphabetically
sort($other_folders);
// 6️⃣ Merge final list
$final_folders = array_merge($priority_folders_sorted, $other_folders)
;

// 7️⃣ Store in DB
$mbox_upd = [
‘imap_folders’ => json_encode($final_folders)
];
$result = $wpdb->update($acc_table, $mbox_upd, $thefilter, null, [‘%s’, ‘%s’]);



me …
naaa, too much fiddling I should do that easier I do a check if matches exist in my priority and add only if not, ready
I show you how:

$mbox_list = [‘Inbox’, ‘Sent’, ‘Trash’, ‘Drafts’, ‘Junk’];
$rem_folders = imap_list($established, $srv_cnx, “%”);
foreach ($rem_folders as $folder) {
if (preg_match(‘/}(.+)$/’, $folder, $matches)) {
$mbox = ucfirst(strtolower($matches[1]));
if (!in_array($mbox, $mbox_list)){
$mbox_list[] = $mbox;
}
}


32 vs 9 … too big for any bin, let’s call another nachine to throw it in a bucket, and now dear friends, you also know why apps are growing out of bound, megabytes of garbage in all apps, megas of shit all over the place, result of stupid programming

Artificial Intelligence … pfffffffffffffffffffff

obs.: I made the exact same test with chatgpt, gemini,deepseek and copilot, there were slight differences in their answers, but at the end the same bunch of excessive garbage …

hakka quote … You just open our plugin page and see simple instructions and hit a button to do and it really does what it said it will.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *