Ejemplo n.º 1
0
         $attachcache[$comment['pictureowner'] . '-' . $comment['filedataid']] = $attachmultiple->fetch_results("\r\n\t\t\t\ta.userid = {$comment['pictureowner']}\r\n\t\t\t\t\tAND\r\n\t\t\t\ta.filedataid = {$comment['filedataid']}\r\n\t\t\t\t\tAND\r\n\t\t\t\ta.contenttypeid IN (" . intval($types->getContentTypeID('vBForum_Album')) . ", " . intval($types->getContentTypeID('vBForum_SocialGroup')) . ")\r\n\t\t\t");
     }
     if (!($firstpic = reset($attachcache[$comment['pictureowner'] . '-' . $comment['filedataid']]))) {
         $show['viewableattachment'] = false;
         $show['picture'] = false;
     } else {
         $show['viewableattachment'] = true;
         $show['picture'] = true;
     }
     $comment['pictureowner_name'] = $firstpic['username'];
     $comment['pictureowner_userid'] = $firstpic['userid'];
     $comment['caption'] = $firstpic['caption'];
     // $comment contains comment, picture, and album info
     $pictureinfo = prepare_pictureinfo_thumb($firstpic);
     $factory = new vB_Picture_CommentFactory($vbulletin, $bbcode, $pictureinfo);
     $response_handler = new vB_Picture_Comment_ModeratedView($vbulletin, $factory, $bbcode, $pictureinfo, $comment);
     $response_handler->cachable = false;
     $messagebits .= $response_handler->construct();
     unset($factory, $response_handler);
 }
 $db->free_result($messages);
 $pagenavbits = array("do=viewpcs");
 if ($perpage != $vbulletin->options['vm_perpage']) {
     $pagenavbits[] = "pp={$perpage}";
 }
 if ($daysprune != ($vbulletin->userinfo['daysprune'] ? $vbulletin->userinfo['daysprune'] : 30)) {
     $pagenavbits[] = "daysprune={$daysprune}";
 }
 if ($sortfield != 'dateline') {
     $pagenavbits[] = "sortfield={$sortfield}";
 }
Ejemplo n.º 2
0
 require_once DIR . '/includes/class_bbcode.php';
 require_once DIR . '/includes/class_picturecomment.php';
 require_once DIR . '/includes/functions_bigthree.php';
 $coventry = fetch_coventry('string');
 $bbcode = new vB_BbCodeParser($vbulletin, fetch_tag_list());
 // note: this code assumes that albumpicture and picture are 1:1 because they are in 3.7
 $comments = $db->query_read_slave("\n\t\tSELECT picturecomment.*, user.*, picturecomment.ipaddress AS messageipaddress,\n\t\t\tpicture.caption, picture.extension, picture.filesize, picture.idhash,\n\t\t\tpicture.thumbnail_filesize, picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height,\n\t\t\talbumpicture.albumid\n\t\tFROM " . TABLE_PREFIX . "picture AS picture\n\t\tINNER JOIN " . TABLE_PREFIX . "albumpicture AS albumpicture ON (albumpicture.pictureid = picture.pictureid)\n\t\tINNER JOIN " . TABLE_PREFIX . "picturecomment AS picturecomment ON\n\t\t\t(picturecomment.pictureid = picture.pictureid AND picturecomment.state = 'moderation')\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (picturecomment.postuserid = user.userid)\n\t\tWHERE picture.userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t" . ($coventry ? "AND picturecomment.postuserid NOT IN ({$coventry})" : '') . "\n\t\tORDER BY picturecomment.dateline ASC\n\t");
 $picturecommentbits = '';
 $moderated_count = 0;
 while ($comment = $db->fetch_array($comments)) {
     // $comment contains comment, picture, and album info
     $pictureinfo = array('pictureid' => $comment['pictureid'], 'albumid' => $comment['albumid'], 'userid' => $vbulletin->userinfo['userid'], 'caption' => $comment['caption'], 'extension' => $comment['extension'], 'filesize' => $comment['filesize'], 'idhash' => $comment['idhash'], 'thumbnail_filesize' => $comment['thumbnail_filesize'], 'thumbnail_dateline' => $comment['thumbnail_dateline'], 'thumbnail_width' => $comment['thumbnail_width'], 'thumbnail_height' => $comment['thumbnail_height']);
     $albuminfo = array('albumid' => $comment['albumid'], 'userid' => $vbulletin->userinfo['userid']);
     $pictureinfo = prepare_pictureinfo_thumb($pictureinfo, $albuminfo);
     $factory = new vB_Picture_CommentFactory($vbulletin, $bbcode, $pictureinfo);
     $response_handler = new vB_Picture_Comment_ModeratedView($vbulletin, $factory, $bbcode, $pictureinfo, $comment);
     $response_handler->cachable = false;
     $picturecommentbits .= $response_handler->construct();
     $moderated_count++;
 }
 if ($moderated_count != $vbulletin->userinfo['pcmoderatedcount']) {
     // back counter -- likely tachy based, rebuild all counters
     build_picture_comment_counters($vbulletin->userinfo['userid']);
 }
 if (!$picturecommentbits) {
     standard_error(fetch_error('no_picture_comments_awaiting_approval', 'album.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userinfo['userid']}"), '', false);
 }
 // this is a small kludge to let me use fetch_user_picture_message_perm
 // all pictures will be from this user and userid is the only value used
 $pictureinfo = array('userid' => $userinfo['userid']);
 $show['delete'] = fetch_user_picture_message_perm('candeletemessages', $pictureinfo);