I found a few threads about this but not this exactly.
Link to my site: othg-gamers
SMF version: SMF ver. SMF 2.0
TP version: TP ver. TinyPortal © 2005-2011
Default Forum Language: en_US
Theme name and version: DarkBreak by DzinerStudio
Browser Name and Version: all
Mods installed: Contact Page/SMF Links/Aeva Media/SMF Staff Page/Treasury/
Related Error messages:
Apply Filter: Only show the error messages of this URL
http://www.othg-gamers.com/forum/index.php?action=tpmod;dl
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Integer expected. (week)
Function: TPortalDLManager
Apply Filter: Only show the errors from this file
File: /home2/othggame/public_html/othggamers/forum/Sources/TPdlmanager.php
Line: 610
I have the same problem ...
Type of error: Critical
Apply Filter: Only show the error messages of this URL
http://forum.xxxxxx.de/index.php?action=tpmod;dl
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Integer expected. (week)
Function: TPortalDLManager
Apply Filter: Only show the errors from this file
Datei: /var/www/vhosts/xxxxxxxxxxx/subdomains/forum/httpdocs/Sources/TPdlmanager.php
Zeile: 610
Apply Filter: Only show the error messages of this URL
http://forum.xxxxxx.de/index.php?action=tpmod;dl
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Integer expected. (week)
Function: TPortalDLManager
Apply Filter: Only show the errors from this file
Datei: /var/www/vhosts/xxxxxxxxxxx/subdomains/forum/httpdocs/Sources/TPdlmanager.php
Zeile: 824
and ...
Apply Filter: Only show the error messages of this URL
http://forum.xxxxxx.de/index.php?action=tpmod;dl
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Integer expected. (week)
Function: TPortalDLManager
Apply Filter: Only show the errors from this file
Datei: /var/www/vhosts/xxxxxxxxxxx/subdomains/forum/httpdocs/Sources/TPdlmanager.php
Zeile: 1387
It seems that it has someting to do with this passage:
$request = $smcFunc['db_query']('', '
SELECT dlm.id, dlm.name, dlm.category, dlm.file, data.downloads, dlm.views, dlm.author_id as authorID, dlm.created, dlm.screenshot, dlm.filesize,
dlcat.name AS catname, mem.real_name as realName
FROM ({db_prefix}tp_dlmanager AS dlm, {db_prefix}tp_dldata AS data, {db_prefix}members AS mem)
LEFT JOIN {db_prefix}tp_dlmanager AS dlcat ON dlcat.id=dlm.category
WHERE dlm.type = {string:type}
AND (dlm.category = {int:cat} OR dlm.parent = {int:cat})
AND data.item = dlm.id
AND data.year = {int:year}
AND data.week = {int:week}
AND dlm.author_id = mem.id_member
ORDER BY data.downloads DESC LIMIT 10',
array('type' => 'dlitem', 'cat' => $currentcat, 'year' => $year, 'week' => $week)
);
I found in the database a column called 'week' in the table smf_tp_dldata. Is this the right one? The type of this column is tinyint(4). Should it be changed to integer?
Nope int and integer work the same as far as the way SMF handles the queries. Do a var_dump($week) right before that query and see what the output is. Post it here if you would. Right now I'm working on my server and my sites aren't up or I'd test some things for you.
Same problem on my site when attempting to visit download manager.
Same problem on THIS site. See http://www.tinyportal.net/index.php?action=tpmod;dl
Hmm... I wonder if this has something to do with the year change.... I don't know what, but that's the only thing I can think of right now since the DL manager was working before. Any of you able to do the var_dump()?
Temporary fix for this could be to find this:
$week = date("W",$now);
$year = date("Y",$now);
Replace with this:
$week = (int) date("W",$now);
$year = (int) date("Y",$now);
@IchBin
sorry, I don't know how to use the var_dump function
// DEBUG !!!
var_dump($week)
$request = $smcFunc['db_query']('', '
SELECT dlm.id, dlm.name, dlm.category, dlm.file, data.downloads, dlm.views, dlm.author_id as authorID, dlm.created, dlm.screenshot, dlm.filesize,
dlcat.name AS catname, mem.real_name as realName
FROM ({db_prefix}tp_dlmanager AS dlm, {db_prefix}tp_dldata AS data, {db_prefix}members AS mem)
LEFT JOIN {db_prefix}tp_dlmanager AS dlcat ON dlcat.id=dlm.category
WHERE dlm.type = {string:type}
AND (dlm.category = {int:cat} OR dlm.parent = {int:cat})
AND data.item = dlm.id
AND data.year = {int:year}
AND data.week = {int:week}
AND dlm.author_id = mem.id_member
ORDER BY data.downloads DESC LIMIT 10',
array('type' => 'dlitem', 'cat' => $currentcat, 'year' => $year, 'week' => $week)
);
Here's the output:
Parse error: syntax error, unexpected T_VARIABLE in /var/www/vhosts/xxxxxxxxxxx.de/subdomains/forum/httpdocs/Sources/TPdlmanager.php on line 598
:-[
That must be
// DEBUG !!!
var_dump($week);
Note the ; at the end ...
ratbat, I've already posted a fix above for this if you want to apply it to your site.
@Feline
How embarrassing! :-[ Thank you.
Here's the result:
QuoteEin Fehler ist aufgetreten!
Wrong value type sent to the database. Integer expected. (week)
Zurück
Next I'll try the workaround.
Quote from: IchBinâ,,¢ on January 03, 2012, 05:21:26 AM
Hmm... I wonder if this has something to do with the year change.... I don't know what, but that's the only thing I can think of right now since the DL manager was working before. Any of you able to do the var_dump()?
Temporary fix for this could be to find this:
$week = date("W",$now);
$year = date("Y",$now);
Replace with this:
$week = (int) date("W",$now);
$year = (int) date("Y",$now);
Thankyou, this fixed the issue 100%.
There are about 4 or 5 instances, you need to change.
Once done Downloads were all working, no more week error, :).
Thanks for the heads up F0L. What I'd like to know is why it suddenly stopped working after the new year changed...
the data function returns a string ..
string date ( string $format [, int $timestamp = time() ] )
and date('W', ...) returns ' 1' not '1' ;)
Yeah I understand that Feline. My question is, why did this problem just appear now? This is code that Bloc wrote a long time ago, and it's been in use for quite some time. So something has changed that made this error suddenly to appear. The error should have been happening ever since I converted all the database queries to use $smcFunc, which was quite a long time ago.
Because its 2012 year, end of the world year :P
I don't know if this has something to do with our problem. After implementing the workaround everything seems to work well. After I had a second look I recognized that the edit/delete buttons for the downloads are gone ( ?action=tpmod;dl=admincat* ). Also the aproval column. In the sections view the buttons are visable and useable ( action=tpmod;dl=admin ). Can anyone who implemented the workaround have a look in the backend if everything is ok there. Thx
There is a error message also:
Apply Filter: Only show the error messages of this URL
http://xxxxxxxxxxxxxxxxxxx/index.php?action=tpmod;dl=admincat2
Apply Filter: Only show the errors with the same message
2: mysql_real_escape_string() expects parameter 1 to be string, array given
Apply Filter: Only show the errors from this file
Datei: /var/www/vhosts/xxxxxxxxx.de/subdomains/forum/httpdocs/Sources/Subs-Db-mysql.php
Zeile: 163
I don't think so, I just added this fix to two my live servers and 3 test sites and I see [Edit] and [Delete] buttons in DL section, also they working well.
Where do i edit that code? which file? i had that happen today, it worked last night but this morning it didnt, got to love change of the year ::)
Quote from: league on January 06, 2012, 02:27:02 PM
Where do i edit that code? which file? i had that happen today, it worked last night but this morning it didnt, got to love change of the year ::)
league,
The code is in the Sources/TPdlmanager.php file in a couple of spots. Just search for $week and you'll find all of them where you need to make the change I posted.
I wish I would have fount this before I posted about it. How ever what file do I have to edit in order to fix this
I wish I would have fount this before I posted about it. Thanks Guys that seems to have worked.
Iceman I have removed your other topic, glad this one worked for you :)
Getting this error now and the fix is no good as the lines have already been changed in latest TP version.
Sounds like if you are getting all these same errors in the last couple of topics that I've seen from you, that you should upload all the files again for TP and replace the current ones. These fixes are already in the code.
Well I thought about updating to 1.105. How ever I need to update every thing too. So last time I tried to do an update like that I had to do a new install. Just didn't work.
Quote from: F0L on January 04, 2012, 01:24:41 PM
Quote from: IchBinâ,,¢ on January 03, 2012, 05:21:26 AM
Hmm... I wonder if this has something to do with the year change.... I don't know what, but that's the only thing I can think of right now since the DL manager was working before. Any of you able to do the var_dump()?
Temporary fix for this could be to find this:
$week = date("W",$now);
$year = date("Y",$now);
Replace with this:
$week = (int) date("W",$now);
$year = (int) date("Y",$now);
Thankyou, this fixed the issue 100%.
There are about 4 or 5 instances, you need to change.
Once done Downloads were all working, no more week error, :).
What file do I edit with the above code?
Quote from: Zero_Killz on January 13, 2012, 06:49:48 PM
What file do I edit with the above code?
The file posted about in the error. (in bold below).
Quote from: moto~man on January 02, 2012, 08:37:45 PM
QuoteApply Filter: Only show the error messages of this URL
http://www.othg-gamers.com/forum/index.php?action=tpmod;dl
Apply Filter: Only show the errors with the same message
Wrong value type sent to the database. Integer expected. (week)
Function: TPortalDLManager
Apply Filter: Only show the errors from this file
File: /home2/othggame/public_html/othggamers/forum/Sources/TPdlmanager.php
Line: 610