View Full Version : Maikeing Thos Work...
globalwin
07-07-2002, 04:45 PM
Can anyone make this code compatible with 2.2.2+
$counter=0;
$postbits = '';
$countposts = 0;
while ($post=$DB_site->fetch_array($posts)) {
if (++$counter%2==0) {
$post[backcolor]="{firstaltcolor}";
$post[bgclass] = "alt1";
$countposts = $countposts+1;
} else {
$post[backcolor]="{secondaltcolor}";
$post[bgclass] = "alt2";
$countposts = $countposts+1;
}
Xenon
07-07-2002, 05:10 PM
huh?
this code is compatible with every version, it's correct...
you should give more infrmations where this code should be...
globalwin
07-07-2002, 07:16 PM
the $countposts variable thingy has changed since then
globalwin
07-09-2002, 11:49 AM
anyone?
Xenon
07-09-2002, 11:53 AM
as i already said, you should give more informations, which hack is it, where is this code located aso or nobody would help....
globalwin
07-09-2002, 11:57 AM
This Hack: Mini - Post Counter in Split Thread
In the ###start split thread### section of postings.php find:
$counter=0;
while ($post=$DB_site->fetch_array($posts)) {
if (++$counter%2==0) {
$post[backcolor]="{firstaltcolor}";
$post[bgclass] = "alt1";
} else {
$post[backcolor]="{secondaltcolor}";
$post[bgclass] = "alt2";
}
Replace it with:
$counter=0;
$countposts = 0;
while ($post=$DB_site->fetch_array($posts)) {
if (++$counter%2==0) {
$post[backcolor]="{firstaltcolor}";
$post[bgclass] = "alt1";
$countposts = $countposts+1;
} else {
$post[backcolor]="{secondaltcolor}";
$post[bgclass] = "alt2";
$countposts = $countposts+1;
}
Then open your threads_splitthreadbit template and add $countposts wherever you want.
I added:
<br><b>Post # $countposts</b>
Right after:
<input type="radio" name="splitpost[$post[postid]]" value="no" checked> No
If you want a direct link to the post to open up the thread in it's own window you can use the following in the same place in the template:
<br><b>Post # <a href="showthread.php?postid=$post[postid]#post$post[postid]" target="_blank">$countposts</a></b>
Xenon
07-09-2002, 12:09 PM
ok, so its better ;)
hmm, the code must work in vb226, theres no bug, normaly you can implement it like it's said in the install file
ok the code isn't really optimized, but it should work w/o problems.
are you sure you've uploaded the hacked file?
globalwin
07-09-2002, 12:41 PM
i hav it going now, i was trying to use different code cause I have the post counter and that uses differnet code so I tried to implememt that, anyway, works now.
Xenon
07-09-2002, 12:43 PM
look into the original thread, i have posted an easier solution for that too ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.