The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
trying to return the first shoutid as a number from the shoutbox hack
with some help from friends, i have made the shoutbox act more like a chat
as you add a shout, its gets placed at the bottom simple as all u do is change DESC to ACS and have an onload scrollto thing the only problem with this is that you need to set your number of forumhome shouts to 999 or some other high number i trim the shouts from time to time and never go anywhere near that number they are just shouts, no need to keep 6 month old shouts this is what i have now instead of the original code PHP Code:
PHP Code:
PHP Code:
what i need is to not hard code that but return another variable that will return the first shoutid number in that table i tried... PHP Code:
once i can return a number i can then replace the 49 with $firstshoutid PHP Code:
any idea on how to do this? |
#2
|
||||
|
||||
php tags are you're friend, but only cos i'm incompetant and it's late.
anyway from what i read before i started getting confused, you can do it all in two queries PHP Code:
you don't need the below code ================================== you're problem here is that PHP Code:
PHP Code:
|
#3
|
|||
|
|||
sorry, for some reason after some frustration i forgot i was posting php code
thought it was sql and code would be better suited, i will edit it now i got an error with one of ur queries, not sure why as i went and looked up min and max and it looks good but it returned this... PHP Code:
it works but not sure its the best way to do it i trust you more than my guesses if this is good enough, thanks a lot for your help you seem to be one of the few around here offering any help i really appreciate it if you have anything to add, im all ears thanks again! PHP Code:
|
#4
|
||||
|
||||
what happens when you tried to run [sql]SELECT MIN(shoutid) AS min, SELECT MAX(shoutid) AS max FROM shoutbox_posts[/sql] in phpmyadmin as that definately shouldn't give you an error.
|
#5
|
|||
|
|||
[sql]SELECT MIN(shoutid) AS min, SELECT MAX(shoutid) AS max FROM shoutbox_posts
[/sql] should be: [sql]SELECT MIN(shoutid) AS min, MAX(shoutid) AS max FROM shoutbox_posts [/sql] Only 1 SELECT is needed. |
#6
|
|||
|
|||
Quote:
|
#7
|
||||
|
||||
lol, thanks again marco
|
#8
|
|||
|
|||
marco's query is fine but no matter what i tried i get stuff like this...
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
thanks guys! ------------------------------------------------------------------------------ heh, i know why after looking at it that calculation my friend originally had makes no sense u dont need the first shoutid all u need is the last shoutid, subtract shoutbox_numberofforumhomeshouts and ur done you get the last X amount dispayed thanks again! PHP Code:
|
#9
|
||||
|
||||
i'd say go back to the original code i gave ya
PHP Code:
|
#10
|
|||
|
|||
i did go back to that
but no matter what i try i get an error analyze it a sec why are we taking the last id number subtracting the first id number then subtracting how many you want displayed if your last id is lets say 180 your first id is 50 and u want to display only 20 we are doing this... 180 +50 230 is the sum 230 -20 210 is the sum there is no shoudid with 210 and thats what is causing the errors i believe the last one is 180 all u need it the last number(180) and subtract 20 that gives u 160 any shout with an id higher than 160 will be displayed im not blaming you the idea of doing that calculation came from my friend you only tried to make something that doesnt really make sense work thanks to you and marco i also came up with a better cron job ill see about adding all this to the shoutbox thread and giving you guys all the credit deleteshouts.php PHP Code:
so long ancient shouts! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|