- Joined
- Aug 20, 2021
- Messages
- 128
- Points
- 38
Reputation:
[SOLVED]
I'm currently assisting someone in creating a customized backend page that retrieves information about threads, such as likes, attachments, reviews, views and thread IDs, from the XF database. So far, I've successfully displayed information using a single prefix.
I've utilized the column "sv_prefix_ids" from the "xf_thread" table, incorporating the "Multi Prefix" addon developed by xon.
Here is a query i use
In the thread with only one prefix
On the custom page
Added test prefix
After adding an additional prefix, the following is displayed (no prefixes in the custom page)
I'm fairly confident that the issue is related to parsing. I'll eventually resolve this and make it functional, it might take some time. I'm open to any feedback , as it would be greatly appreciated.
I'm currently assisting someone in creating a customized backend page that retrieves information about threads, such as likes, attachments, reviews, views and thread IDs, from the XF database. So far, I've successfully displayed information using a single prefix.
I've utilized the column "sv_prefix_ids" from the "xf_thread" table, incorporating the "Multi Prefix" addon developed by xon.
Here is a query i use
PHP:
$query = "SELECT t.*,
c.cover_id, c.content_type,
t.review_count,
t.sv_prefix_ids
FROM xf_thread t
LEFT JOIN xf_covers_cover c ON t.thread_id = c.content_id AND c.content_type = 'thread'
WHERE t.node_id IN ($nodeIdsString)";
$prefixId = json_decode($row["sv_prefix_ids"], true);
$prefixSpans = "";
PHP:
$prefixClass = "";
$prefixText = "";
switch ($prefixId) {
case 24:
$prefixClass = "pre-renpy";
$prefixText = "Renpy";
break;
case 29:
$prefixClass = "vn-label--red";
$prefixText = "VN";
break;
case 23:
$prefixClass = "label label--silver";
$prefixText = "Collection";
break;
case 32:
$prefixClass = "label label--royalBlue";
$prefixText = "RPGM";
break;
case 33:
$prefixClass = "label label--olive";
$prefixText = "HTML";
break;
case 30:
$prefixClass = "pre-webgl";
$prefixText = "Unity";
break;
case 36:
$prefixClass = "label label--royalBlue";
$prefixText = "Unreal Engine";
break;
case 26:
$prefixClass = "pre-webgl";
$prefixText = "Abandoned";
break;
case 27:
$prefixClass = "pre-webgl";
$prefixText = "[SiteRIP]";
break;
case 31:
$prefixClass = "label label--skyBlue";
$prefixText = "[Completed]";
break;
case 34:
$prefixClass = "label--lightGreen";
$prefixText = "[Others]";
break;
case 37:
$prefixClass = "label label--green";
$prefixText = "Multi Prefix Test";
break;
default:
$prefixClass = "";
$prefixText = "";
}
$prefixSpan =
'<span class="' .
$prefixClass .
'" dir="auto">' .
$prefixText .
"</span>";
JavaScript:
function fetchThreads(page, searchQuery, fpsFilter, recentFilter, prefixFilter, tagFilter) {
showLoadingMask();
$.ajax({
url: '/jim/page/latest_data.php',
type: 'POST',
dataType: 'json',
data: {
page: page,
itemsPerPage: itemsPerPage,
searchQuery: searchQuery,
fpsFilter: fpsFilter,
recentFilter: recentFilter,
prefixFilter: prefixFilter,
tagFilter: tagFilter
},
success: function(response) {
$('#thread-container').html(response.threads);
$('#pagination').html(generatePaginationLinks(page, response.totalPages));
hideLoadingMask();
handleAttachments();
updateThreadRatings(response.ratings);
applySearchHighlighting(searchQuery);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log("Error: " + textStatus + " - " + errorThrown);
hideLoadingMask();
}
});
}
In the thread with only one prefix
On the custom page
Added test prefix
After adding an additional prefix, the following is displayed (no prefixes in the custom page)
I'm fairly confident that the issue is related to parsing. I'll eventually resolve this and make it functional, it might take some time. I'm open to any feedback , as it would be greatly appreciated.
Last edited: