Jump to content

Документы в профиле


Recommended Posts

рылся встарых темах v-11 нашол такую интересную тему на работа спасобнасть не проверял 

1)Всталяем в profile.php
//################### Документы ###################//
			if($row['user_doc_num'] AND $user_id == $id){
			
				$sql_docs = $db->super_query("SELECT SQL_CALC_FOUND_ROWS did, dname, ddate, ddownload_name, dsize FROM `".PREFIX."_doc` WHERE duser_id = '{$id}' ORDER by `ddate` DESC LIMIT 0, 5", 1, "user_{$id}/docs");
				
				foreach($sql_docs as $row_docs){
					
					$row_docs['dname'] = stripslashes($row_docs['dname']);
					$format = end(explode('.', $row_docs['ddownload_name']));
					
					$docs .= "<div style=\"margin-bottom:10px\"><div class=\"fl_l\" style=\"margin-left:7px;width:175px\"><a href=\"/index.php?go=doc&act=download&did={$row_docs['did']}\">{$row_docs['dname']}</a><span class=\"color777\"><small>{$row_docs['dsize']}</small></span></div><div class=\"clear\"></div></div>";
					
				}
				
				$tpl->set('{docs}', $docs);
				$tpl->set('{docs-num}', $row['user_doc_num']);
				$tpl->set('[docs]', '');
				$tpl->set('[/docs]', '');
				
			} else
				$tpl->set_block("'\\[docs\\](.*?)\\[/docs\\]'si","");
				
				
3)Добавляем user_doc_num в $row = $db->super_query("SELECT

2)Вставляем в profile.tpl

[owner][docs]<div class="albtitle">Документы <span>{docs-num}</span><div><a href="/docs" onClick="Page.Go(this.href); return false">Все</a></div></div>
<div class="newmesnobg" style="padding-right:0px;padding-left:5px">{docs}<div class="clear"></div>
</div>[/docs][/owner]

Потому что, если это на странице /u1 и /u2 хочет просмотреть его документы, то /u2 выбросит на страницу /u2, а не /u1 
  • Upvote 1
Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...