MyBB Community Forums

Full Version: New Download mod problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I just installed the download mod. Everything went fine, until I go to set admin permission. Clicking update gives me this error:
Quote:mySQL error: 1054
Unknown column 'caneditdownloads' in 'field list'
Query: UPDATE adminoptions SET permsset='1', caneditsettings='yes', caneditann='yes', caneditforums='yes', canmodposts='yes', caneditsmilies='yes', caneditpicons='yes', caneditthemes='yes', canedittemps='yes', caneditusers='yes', caneditpfields='yes', caneditugroups='yes', caneditaperms='yes', caneditutitles='yes', caneditattach='yes', canedithelp='yes', caneditlinks='yes', caneditdownloads='yes', canrunmaint='yes' WHERE uid='1'
I think it has something to do with the fact that I have the links mod installed too. PM me as soon as you can if you know of a solution.

Edit: You forgot to add the part where it puts on the front page any download awaiting activation etc. I think the code is:
----- [ OPEN ] --------------------------

admin/index.php

----- [ FIND ] --------------------------

// Get the number of new users for today
$timecut = time() - 86400;
$query = $db->query("SELECT COUNT(*) AS newusers FROM users WHERE regdate>'$timecut'");
$newusers = $db->fetch_array($query);

----- [ AFTER, ADD ] --------------------

// Get the number of downloads
$query = $db->query("SELECT COUNT(*) AS numlinks FROM forumdownloads");
$links = $db->fetch_array($query);

// Get the number of downloads awaiting validation
$query = $db->query("SELECT COUNT(*) AS downloadswaiting FROM forumdownloads WHERE validated != 'yes'");
$linkswaiting = $db->fetch_array($query);

----- [ FIND ] --------------------------

echo "<tr>\\n";
echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>$lang->total_posts</b></td><td valign=\\"top\\" class=\\"altbg2\\">$posts[numposts]</td>\\n";
echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>$lang->posts_today</b></td><td valign=\\"top\\" class=\\"altbg2\\">$newposts[newposts]</td>\\n";
echo "</tr>\\n";

----- [ AFTER, ADD ] --------------------

echo "<tr>\\n";
echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>Total downloads:</b></td><td valign=\\"top\\" class=\\"altbg2\\">$downloads[numdownloads]</td>\\n";
echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>Downloads awaiting validation:</b></td><td valign=\\"top\\" class=\\"altbg2\\">$downloadswaiting[downloadswaiting]</td>\\n";
echo "</tr>\\n";

k776
You're quite right. I knew I'd forgotten something.

To fix the admin cp bug, open admin/index.php and find this...

	// Get the number of users awaiting validation
	$query = $db->query("SELECT COUNT(*) AS awaitingusers FROM users WHERE usergroup='5'");
	$awaitingusers = $db->fetch_array($query);
	
	// Get the number of new users for today
	$timecut = time() - 86400;
	$query = $db->query("SELECT COUNT(*) AS newusers FROM users WHERE regdate>'$timecut'");
	$newusers = $db->fetch_array($query);

...and afterwards, add this...

	// Get the number of downloads
	$query = $db->query("SELECT COUNT(*) AS numdownloads FROM forumdownloads");
	$downloads = $db->fetch_array($query);
	
	// Get the number of downloads awaiting validation
	$query = $db->query("SELECT COUNT(*) AS downloadswaiting FROM forumdownloads WHERE validated != 'yes'");
	$downloadswaiting = $db->fetch_array($query);


Also, find...

	echo "<tr>\\n";
	echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>$lang->total_posts</b></td><td valign=\\"top\\" class=\\"altbg2\\">$posts[numposts]</td>\\n";
	echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>$lang->posts_today</b></td><td valign=\\"top\\" class=\\"altbg2\\">$newposts[newposts]</td>\\n";
	echo "</tr>\\n";

...and add this afterwards...

	echo "<tr>\\n";
	echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>Total downloads:</b></td><td valign=\\"top\\" class=\\"altbg2\\">$downloads[numdownloads]</td>\\n";
	echo "<td valign=\\"top\\" class=\\"altbg1\\"><b>Downloads awaiting validation:</b></td><td valign=\\"top\\" class=\\"altbg2\\">$downloadswaiting[downloadswaiting]</td>\\n";
	echo "</tr>\\n";

To fix the sql error, please download, upload and run this file.

[attachment=10]

The download package has been update.

Edit: Something I realised after posting... What made you think that the stats were supposed to be there?
Ok, great. I also see you fixed the problem that I had with the links page Smile HAving to create a catagory first. Cool Big Grin

One thing though. After adding a catagory, can the add download table be one lower?? It looks weird with the buttons touching it. Do you agree??

k776
Could you post a screenshot or something, I can already see quite a gap between the buttons and the second table.
Sure. Here it is.

[attachment=11]

Found a bug too. Add a catagory, then add a link, with visible yes, sticky no. then submit. Then click edit. You notice it has swapped and is now visible no and sticy yes.

And another, even with allow submition turned on, it wont let me.

k776
Well, that's strange, but I'll add an additional line break in the next release.

There seems to be a minor typo on one of the database queries, hence the bug you are experiencing with categories.

To fix, open admin/downloads.php and find this line:

$query = $db->query("INSERT INTO forumdownloads VALUES ('','$cid','$mybbadmin[uid]','$name','$description','$url','$sticky','$visible','yes')");

Then, replace that line with this one:

$query = $db->query("INSERT INTO forumdownloads VALUES ('','$cid','$mybbadmin[uid]','$name','$description','$url','$visible','$sticky','yes')");

I can't say I'm experiencing the problem with user submissions though. Could you go into a little more detail maybe?
ok, all fixed.

Could the reason there is no line break be because of using firefox??

I set up a catagory, and selected:
Category Is Visible? Yes
Allow User Submissions? Yes

And when I go to the catagory, it doesn't allow you to submit a link :/ Here is a screenshot:

[attachment=13]

k776
Perhaps it's a template error. Could you check that the global template "downloads_submit_bit" exists?
got the following:

# downloads [Edit / Delete]
# downloads_category_bit [Edit / Delete]
# downloads_catmenu_option [Edit / Delete]
# downloads_download [Edit / Delete]
# downloads_download_bit [Edit / Delete]
# downloads_error_nodownloads [Edit / Delete]
# downloads_submit [Edit / Delete]
# downloads_submitbit [Edit / Delete]
# downloads_submitted [Edit / Delete]
Strange. Try renaming "downloads_submitbit" to "downloads_submit_bit" and see if this solves the problem.
Pages: 1 2