The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I am wanting to post the custom field5 in the threadbit template. I tired $post[field5] but it doesn't work. Any ideas?
Thanks, Itworx4me |
|
#2
|
||||
|
||||
|
How would you use a custom field in the threadbit template?
|
|
#3
|
||||
|
||||
|
On my vb site the members all use real names. Which I keep there privacy using an conditional statement to hide the members name. I want to use another conditional statement and use <else /> $post[field5]. Custom field 5 is a nickname option at registration. Is there a way to globalize $post[field5] to show on the threadbit template?
Thanks, Itworx4me |
|
#4
|
||||
|
||||
|
bump
|
|
#5
|
||||
|
||||
|
Custom fields aren't queried for in the threadbit template, so you'll need to use a plugin to hook them in. Give the following a try...
Add a new plugin using hook location "forumdisplay_query" with the following contents: Code:
$hook_query_fields .= ' , userfield.* '; $hook_query_joins = "LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = post.userid)"; Code:
if ($thread['fieldX'])
{
$thread['postusername'] = $thread['fieldX'];
}
|
|
#6
|
||||
|
||||
|
Quote:
I am getting a database error with the above plugin enabled. Any ideas? Thanks, Itworx4me |
|
#7
|
||||
|
||||
|
What is the error?
|
|
#8
|
||||
|
||||
|
just give me a page that says database error. doesn't actually tell me the error.
|
|
#9
|
||||
|
||||
|
Go to View -> View Source and it'll have the error there.
|
|
#10
|
||||
|
||||
|
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>www.nitromater.com Database Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
<!--
body { background-color: white; color: black; }
#container { width: 400px; }
#message { width: 400px; color: black; background-color: #FFFFCC; }
#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
a:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
a:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
-->
</style>
</head>
<body>
<table cellpadding="3" cellspacing="5" id="container">
<tr>
<td><img src="http://www.nitromater.com/image.php?type=dberror" alt="Database Error" width="48" height="48" /></td>
<td id="bodytitle" width="100%">Database error</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The www.nitromater.com database has encountered a problem.</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td class="bodytext" colspan="2">
Please try the following:
<ul>
<li>Load the page again by clicking the <a href="#" onclick="window.location = window.location;">Refresh</a> button in your web browser.</li>
<li>Open the <a href="/">www.nitromater.com</a> home page, then try to open another page.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>
</ul>
</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The www.nitromater.com forum technical staff have been notified of the error, though you may <a href="mailto:">contact them</a> if the problem persists.</td>
</tr>
<tr>
<td class="bodytext" colspan="2"> <br />We apologise for any inconvenience.</td>
</tr>
</table>
<!--
Database error in vBulletin 3.6.8:
Invalid SQL:
SELECT
thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,
thread.lastpost, thread.lastposter, thread.lastpostid, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach,
hiddencount, deletedcount
, vbookie_item_id , userfield.*
FROM thread AS thread
LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid)
WHERE thread.threadid IN (0,10525,10523,10457,10175,10518,10520,10412,10502,10396,10486,10465,10491,9844,10392,10496,10449,10493,10443,10515,10466,10079)
ORDER BY sticky DESC, lastpost DESC;
MySQL Error : Unknown column 'user.userid' in 'on clause'
Error Number : 1054
Date : Thursday, September 27th 2007 @ 07:38:49 PM
Script : http://www.nitromater.com/forumdisplay.php?f=5
Referrer : http://www.nitromater.com/staging-lanes/
IP Address : 76.105.147.62
Username : Unregistered
Classname : vB_Database
-->
</body>
</html>
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|