In my templates I have
PHP Code:
<if condition="$show_request_link">
<br />
Your request has been submitted
<else />
<if condition="$user[planid] < $hp[planid] AND $user[planid] > 0 AND $vbulletin->userinfo[posts] >= $hp[posts]">
<br />
<b><a href="hosting.php?do=upgrade&planid=$hp[planid]">Upgrade to this plan</a></b>
</if>
<if condition="$user[hosting_plan] == $hp[title]">
<br />
<else />
<if condition="$vbulletin->userinfo[posts] >= $hp[posts] AND $user[planid] == 0">
<br />
<b><a href="hosting.php?do=request&planid=$hp[planid]">Request This Plan</a></b>
</if>
</if>
</if>
In my php file I have
PHP Code:
$checksubdomain = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "temp_host_request WHERE userid='".$vbulletin->userinfo['userid']."'");
$cs = $db->fetch_row($checksubdomain);
$getplans = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "hosting_plans WHERE planid ORDER BY posts");
while($hp = $db->fetch_array($getplans))
{
$posts = $hp['posts'] - $vbulletin->userinfo['posts'];
if(!$cs['userid'])
{
$show_request_link = true;
}
eval('$hosting_plans .= "' . fetch_template('hosting_plans') . '";');
}
In this part I want it to check if their userid is in the "temp_host_request" table.
PHP Code:
if(!$cs['userid'])
{
$show_request_link = true;
}
If the userid is not in that table then show the "Your request has been submitted" message.