|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
In continue developing of hack the Threads Rating, i was confronted with the problem of class vB_DataManager_ThreadRate. I wrote this code: PHP Code: $threadrate =& datamanager_init('ThreadRate', $vbulletin, ERRTYPE_STANDARD); $threadrate->set_info('userid', intval($vbulletin->GPC['u'])); $threadrate->set_info('threadid', intval($vbulletin->GPC['t'])); $threadrate->delete(); unset($threadrate); And I was disappoint by the message Quote: Delete SQL condition not specified! Indeed, this class doesn't have delete functions. But if i will directly delete data from threadrate table, like PHP Code: $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "threadrate WHERE userid = " . intval($vbulletin->GPC['u']) . " AND threadid = " . intval($vbulletin->GPC['t'])); i just delete data from sql, but not from the datastore. Is it possible to see this function in next version of vebulletin? And how can i manually delete the information from the datastore? ------------------------------ I think I found the solution. PHP Code: $vbulletin->db->query_write("
__DEFINE_LIKE_SHARE__
DELETE FROM " . TABLE_PREFIX . "threadrate WHERE userid = " . intval($vbulletin->GPC['u']) . " AND threadid = " . intval($vbulletin->GPC['t']) ); $ratings = $vbulletin->db->query_first(" SELECT COUNT(*) AS votenum, SUM(vote) AS votetotal FROM " . TABLE_PREFIX . "threadrate WHERE threadid = $threadid "); $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost'); $threadman->set_existing($threadinfo); $threadman->set_info('rebuild', true); $threadman->set('votenum', $ratings['votenum'], true, false); $threadman->set('votetotal', intval($ratings['votetotal']), true, false); $threadman->save(); |
مواقع النشر (المفضلة) |
| |
المواضيع المتشابهه | ||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
Can't delete threads | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 03-20-2010 02:40 AM |
Threads Auto delete threads after a specific time | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 02-21-2010 02:40 AM |
CMS issue with CMS sections... how to delete? | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 01-09-2010 07:50 PM |
Can't delete Threads | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 07-25-2009 03:50 AM |
Approval (Moderation) Support "delete" rather than "physicall delete" when moderating new threads | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 04-29-2009 04:30 PM |