Announcement

Collapse
No announcement yet.

How do I add new metrics to promotion and demotion?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I add new metrics to promotion and demotion?

    I posted this on vB.org, but have recieved no response for several days. My question is less about how to construct a modification than about how the unmodified code functions.

    Originally posted by WetWired on vB.org
    As I was investigating adding some promotion capabilities to my activity hack, I found that all promotions are started by the query
    Code:
    $promotions = $DB_site->query("
    	SELECT user.joindate, user.userid, user.membergroupids, user.posts, user.reputation,
    		user.usergroupid, user.displaygroupid, user.customtitle, user.username,
    		userpromotion.joinusergroupid, userpromotion.reputation AS jumpreputation, userpromotion.posts AS jumpposts,
    		userpromotion.date AS jumpdate, userpromotion.type, userpromotion.strategy,
    		usergroup.title, usergroup.usertitle AS ug_usertitle
    	FROM " . TABLE_PREFIX . "user AS user
    	LEFT JOIN " . TABLE_PREFIX . "userpromotion AS userpromotion ON (user.usergroupid = userpromotion.usergroupid)
    	LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (userpromotion.joinusergroupid = usergroup.usergroupid)
    	" . iif(VB_AREA != 'AdminCP', "WHERE user.lastactivity >= " . (TIMENOW - $nextrun))
    );
    and that there doesn't seem to be another comparable query in the system. If I read this query right, when it left joins user and userpromotion on usergroupid, the result will always be either 0 or 1 sets of userpromotion data for that user. If there were, say, both a promotion promotion and a demotion promotion from the same group, where is that handled?
    http://www.zelaron.com/sigs/rotsig.gif

  • #2
    I don't know the answer to this offhand. You will probably have better luck on www.vbulletin.org.

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X