2023-08-22, 07:33 PM
Secondary issue in regards to this post that was solved for that issue. I've got a new one.
I attempted to initiate a while inside a while and its not doing what I had hoped. Its actually duplicating one of the entries.
Code:
Template member_profile_icgrouplist:
Template member_profile_icgrouplist_entry:
Output:
Screenshot below. Upon inspecting elements to search for the div in member_profile_icgrouplist I can see that this template is being duplicated but only one of the duplicates is showing both threads/post information being pulled.
I wrote this way too soon. I fixed! Removed the period from eval('$icgentries .=
I attempted to initiate a while inside a while and its not doing what I had hoped. Its actually duplicating one of the entries.
Code:
$icgroups_sql = "
SELECT p.pid, p.fid, p.uid, p.tid, p.subject
FROM ".TABLE_PREFIX."posts p
WHERE p.fid = 16
AND p.uid = $uidc
";
$icgroups_result = $db->query($icgroups_sql);
while ($icgrecords = $db->fetch_array($icgroups_result)) {
$icgroupid = $icgrecords['tid'];
$icgroupsid_sql = "
SELECT t.tid, t.subject
FROM ".TABLE_PREFIX."threads t
WHERE t.tid = $icgroupid
";
$icgroupsid_result = $db->query($icgroupsid_sql);
while ($icgentry = $db->fetch_array($icgroupsid_result)) {
eval('$icgentries .= "' . $templates->get('member_profile_icgrouplist_entry') . '";');
}
eval('$icgrouplist .= "' . $templates->get('member_profile_icgrouplist') . '";');
}
Template member_profile_icgrouplist:
<div>{$icgentries}</div>
Template member_profile_icgrouplist_entry:
<span><a href="{$mybb->settings['bburl']}/showthread.php?tid={$icgrecords['tid']}">{$icgentry['subject']}</a> ({$icgrecords['subject']})</span>
Output:
Herds of Essentia (Rogue)
Herds of Essentia (Rogue) The Cursed Vikings of Valhalla (Clan Member)
Screenshot below. Upon inspecting elements to search for the div in member_profile_icgrouplist I can see that this template is being duplicated but only one of the duplicates is showing both threads/post information being pulled.
I wrote this way too soon. I fixed! Removed the period from eval('$icgentries .=