Пример #1
0
    /**
     * Generates the array of information for a standard group list from sql queries
     *
     * @param array  $rows  the list from a standard sql queries
     * @return       $code  the array prepared for Smarty template
     */
	function generatePlaylistListFromSql( $rows )
	{
		global $hwdvsItemid;
		$c = hwd_vs_Config::get_instance();

		$code = array();
		$k = 0;
		for ($i=0, $n=count($rows); $i < $n; $i++) {
			$row = $rows[$i];

			if (!isset($row->avatar)) { $row->avatar=null; }

			$code[$i]->thumbnail = hwd_vs_tools::generatePlaylistThumbnailLink($row, $k, null, null, null);
			$code[$i]->avatar = hwd_vs_tools::generateAvatar($row->user_id, $row->avatar, $k, null, null, null);
			$code[$i]->playlisttitle = hwd_vs_tools::generatePlaylistLink($row->id, $row->playlist_name);
			$code[$i]->playlistdescription = hwd_vs_tools::truncateText(strip_tags($row->playlist_description), $c->trunvdesc);
			$code[$i]->totalvideos = $row->total_videos;
			//$code[$i]->user = hwd_vs_tools::generateUserFromID($row->user_id, $row->username, $row->name);
			$code[$i]->datecreated = $row->date_created;
			$code[$i]->deleteplaylist = hwd_vs_tools::generateDeletePlaylistLink($row);
			$code[$i]->editplaylist = hwd_vs_tools::generateEditPlaylistLink($row);
			$code[$i]->k = $k;
			$k = 1 - $k;
		}
		return $code;
    }