vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Can't display custom product template (https://vborg.vbsupport.ru/showthread.php?t=260665)

virtus 03-19-2011 09:06 PM

Can't display custom product template
 
So, i have searched everywhere I couldn't find how to do what I am doing. The best I could do was follow a few products that I have, closest one being easyforms 4.2.6

Want I want is basically something very much like it with a few tweaks, I would modify the easy forms but its a bit over my head for the most part.

The problem I am having is that when i go to the link where the product is location misc.php?do=infraction the FAQ smiley face page pops up instead of the code that is between my xml template tags.

The code I have between these tags is a simple html form wrapped in a empty div.

So, how do I get the template to display?

side note:

I'm using:
PHP Code:

if($vbulletin->userinfo['userid'] == 6){ print_no_permission(); } 

in the phpcode tags of the xml as a test, these triggers flawlessly.

Thanks!

virtus 03-21-2011 04:08 PM

hmmm ok, maybe i need to state the problem better?

How do i get a product to display? I don't know how to display my form. Would you like me to post the code? I didn't because its 200 line long.

I looked at "how to make a product" but that wasn't very helpful

Lynne 03-21-2011 04:28 PM

Please post some code so that we can try the same on our own test sites and see what is going on. Make sure you use code tags when posting the code. And make sure you put hook locations and template names.

virtus 03-21-2011 04:48 PM

Maybe i am doing this all wrong then :(. This is my first attempt at a product.

any help would be great.

PHP Code:

<templates>
        <
template name="ginfraction" templatetype="template" date="1209011189" username="virtus" version=".1"><![CDATA[
        
<
div>
<
form action="misc.php?do=ginfraction" method="post">
<
b>Name of player: </b> <input type="text" name="playername" />
<
br />
<
b>Forum/Account Name: </b> <input type="text" name="forumname" />
<
br />
<
b>Time of Violation (GMT): </b> <input type="text" name="time" />
<
br />
<
b>Date of Violation: </b> <input type="text" name="date" />
<
br />
<
b>Action Taken: </b>
    <
input type="radio" name="infractiontype" value="warning" /> <b>Warning</b>
    <
br />
    <
input type="text" name="suspenddays" /> <b>Days</b> <input type="radio" name="infractiontype" value="temporary suspension" /> <b>Temp Suspension</b>
    <
br />
    <
input type="radio" name="infractiontype" value="permanent suspension" /> <b>Perma Ban</b>
<
br />
<
b>Violation: </b> <input type="text" name="violation" />
<
br /> 
<
b>Evidence: </b> <input type="text" name="evidence" />
<
br />
<
b>Which ToS did they Violate: </b>
<
select name="tosrules">
  <
option value="choose">Choose an Tos Violation</option>
  <
option value="5.1">5.1</option>
  <
option value="5.2">5.2</option>
  <
option value="5.3">5.3</option>
  <
option value="5.4">5.4</option>
  <
option value="5.5">5.5</option>
  <
option value="5.6">5.6</option>
  <
option value="5.7">5.7</option>
  <
option value="5.8">5.8</option>
  <
option value="5.9">5.9</option>
  <
option value="5.10">5.10</option>
  <
option value="5.11">5.11</option>
  <
option value="5.12">5.12</option>
  <
option value="5.13">5.13</option>
  <
option value="5.14">5.14</option>
  <
option value="5.15">5.15</option>
  <
option value="5.16">5.16</option>
  <
option value="5.17">5.17</option>
  <
option value="5.18">5.18</option>
</
select>
<
input type="submit" name="submit" value="Submit" />
</
form>
</
div>
]]>
</
template>
    </
templates

this is only a small but of the php code:
PHP Code:

<phpcode><![CDATA[
            

if (
$_REQUEST['do'] == "ginfraction")
{

    if(
$vbulletin->userinfo['userid'] != 6){
        
print_no_permission();
    }
    

if(isset(
$_POST['submit'])){

    if(!isset(
$_POST['infractiontype']) || !isset($_POST['suspenddays']) || !isset($_POST['playername']) || !isset($_POST['forumname']) || !isset($_POST['time']) 
    || !isset(
$_POST['date']) || !isset($_POST['violation']) || !isset($_POST['evidence']) || $_POST['tos'] == "choose"){
        
$error "Please fill out all fields";
    }
}]]></
phpcode>
        </
plugin>
    </
plugins


Lynne 03-21-2011 04:52 PM

You didn't post the hook location for the plugin.

virtus 03-21-2011 05:32 PM

oops, i'm sorry

PHP Code:

<hookname>misc_start</hookname


Lynne 03-21-2011 05:42 PM

I don't see anything that actually uses the template in your code. Simply having a template exists doesn't actually make it appear. You need to render it before it will appear. And, if you are wanting it to show up as a misc.php? page, isn't there a tutorial on how to do that?

virtus 03-21-2011 06:01 PM

unless i am being stupid I have not found one that shows how to render objects. I will look first myself then come back here if i can't find anything.

Like i said, i'm new to all this stuff so I don't know how it works.

--------------- Added [DATE]1300740045[/DATE] at [TIME]1300740045[/TIME] ---------------

Thanks Lynne! I got it all sorted now :D

--------------- Added [DATE]1300749926[/DATE] at [TIME]1300749926[/TIME] ---------------

Actually, 1 more question.

Is there an easy command to call the current site theme? I was able to call the template but it doesn't have the site background.

Lynne 03-21-2011 11:05 PM

Perhaps you just need to use the correct CSS class in your html in your template?


All times are GMT. The time now is 02:31 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01064 seconds
  • Memory Usage 1,771KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete