mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-11-03 20:45:58 +01:00 
			
		
		
		
	fixed crashing error in graph/user/picture, and started updating the main post row in topic.tpl
This commit is contained in:
		@@ -8,8 +8,34 @@
 | 
				
			|||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<ul id="post-container" class="post-container container">
 | 
					<ul id="post-container" class="post-container container">
 | 
				
			||||||
<!-- BEGIN posts -->
 | 
						<li class="row" data-pid="{posts.pid}" data-deleted="{posts.deleted}">
 | 
				
			||||||
<li class="row" data-pid="{posts.pid}" data-deleted="{posts.deleted}">
 | 
							<div class="span1 profile-image-block visible-desktop">
 | 
				
			||||||
 | 
								<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>-->
 | 
				
			||||||
 | 
								<a href="/users/{posts.username}">
 | 
				
			||||||
 | 
									<img src="http://www.gravatar.com/avatar/5af32f56c02e59591f0d0c1e6941977c?s=80" align="left" />
 | 
				
			||||||
 | 
								</a>
 | 
				
			||||||
 | 
								<i class="icon-star"></i><span class="user_rep_{posts.uid}">100</span>
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
							<div class="span11">
 | 
				
			||||||
 | 
								<div class="post-block">
 | 
				
			||||||
 | 
									<div id="content_{posts.pid}" class="post-content">This is the main post blah blah </div>
 | 
				
			||||||
 | 
									<div class="profile-block">
 | 
				
			||||||
 | 
										<span class="post-buttons">
 | 
				
			||||||
 | 
											<div id="ids_{posts.pid}_{posts.uid}" class="edit {posts.display_moderator_tools} hidden-phone"><i class="icon-pencil"></i></div>
 | 
				
			||||||
 | 
											<div id="ids_{posts.pid}_{posts.uid}" class="delete {posts.display_moderator_tools} hidden-phone"><i class="icon-trash"></i></div>
 | 
				
			||||||
 | 
											<div id="quote_{posts.pid}_{posts.uid}" class="quote hidden-phone"><i class="icon-quote-left"></i></div>
 | 
				
			||||||
 | 
											<div id="favs_{posts.pid}_{posts.uid}" class="favourite hidden-phone"><span class="post_rep_{posts.pid}">50</span><i class="{posts.fav_star_class}"></i></div>
 | 
				
			||||||
 | 
											<div class="post_reply">Reply <i class="icon-reply"></i></div>
 | 
				
			||||||
 | 
										</span>
 | 
				
			||||||
 | 
										<img class="hidden-desktop" src="{posts.gravatar}?s=10" align="left" /> posted by <strong><a href="/users/{posts.username}">psychobunny</a></strong> 1 hour ago
 | 
				
			||||||
 | 
									</div>
 | 
				
			||||||
 | 
								</div>
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
						</li>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						<!-- BEGIN posts -->
 | 
				
			||||||
 | 
						<li class="row" data-pid="{posts.pid}" data-deleted="{posts.deleted}">
 | 
				
			||||||
		<div class="span1 profile-image-block visible-desktop">
 | 
							<div class="span1 profile-image-block visible-desktop">
 | 
				
			||||||
			<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>-->
 | 
								<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>-->
 | 
				
			||||||
			<a href="/users/{posts.username}">
 | 
								<a href="/users/{posts.username}">
 | 
				
			||||||
@@ -34,8 +60,8 @@
 | 
				
			|||||||
				</div>
 | 
									</div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
</li>
 | 
						</li>
 | 
				
			||||||
<!-- END posts -->
 | 
						<!-- END posts -->
 | 
				
			||||||
</ul>
 | 
					</ul>
 | 
				
			||||||
<hr />
 | 
					<hr />
 | 
				
			||||||
<button id="post_reply" class="btn btn-primary btn-large post_reply">Reply</button>
 | 
					<button id="post_reply" class="btn btn-primary btn-large post_reply">Reply</button>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -218,7 +218,12 @@ var express = require('express'),
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	app.get('/graph/users/:username/picture', function(req, res) {
 | 
						app.get('/graph/users/:username/picture', function(req, res) {
 | 
				
			||||||
		user.get_uid_by_username(req.params.username, function(uid) {
 | 
							user.get_uid_by_username(req.params.username, function(uid) {
 | 
				
			||||||
 | 
								if (uid == null) {
 | 
				
			||||||
 | 
									res.send('{status:0}');
 | 
				
			||||||
 | 
									return;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			user.getUserField(uid, 'picture', function(picture) {
 | 
								user.getUserField(uid, 'picture', function(picture) {
 | 
				
			||||||
 | 
									if (picture == null) res.redirect('http://www.gravatar.com/avatar/a938b82215dfc96c4cabeb6906e5f953');
 | 
				
			||||||
				res.redirect(picture);
 | 
									res.redirect(picture);
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user