View Full Version : Need Advice ... how can i make an simple Product with Hook
Markus_Nellen
05-08-2015, 03:28 AM
Hi guys i have a big problem ..
i need a Plugin / Product that fires my php file on every UserPost.
But im getting this not to work.
I thought it is enough if I create a product and adding a hook.
Then I create the folder ( Core / packages / [product name] ) and insert there my php file . But nothing happens . Can someone help me please ?
Replicant
05-08-2015, 02:47 PM
You need to post the code you currently have in the PHP file for the packages directory.
delicjous
05-09-2015, 04:40 AM
Hi, here is a documentation about how to make a product:
http://www.vbulletin.com/forum/blogs/joe-d/3932614-
But it will be usefull to know what you want to do with the php or what the php should do.
You could also make you a controller-file when it is simple php.
You find a documentation here on page 3-4:
https://docs.google.com/document/d/1hgFiQ8285DoNS3TOrNz57tqBq1CfY-Byq7sDOyopo4A/edit
and a example for a random number here:
https://vborg.vbsupport.ru/showthread.php?t=318153
Creat a new php-file "random.php" (place it into ...includes/vb5/frontend/controller/ :
PHP Code:
<?php
class vB5_Frontend_Controller_Random extends vB5_Frontend_Controller {
public function randomnum() {
$output = rand(1,3);
return $output;
}
}
?>
Put the following in your template:
{vb:action random_result, random, randomnum}
{vb:raw $random_result}
These are small examples to make a product with php included but it would be easier to help you when we know your code.
@Replicant: Do you know how to make a product including a sql-selection?
I looked into the mods who do this already but I did'nt got how to do.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.