vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Custom Pages. (https://vborg.vbsupport.ru/showthread.php?t=168647)

John3971 01-24-2008 03:36 PM

Custom Pages.
 
hey i never get any help with this when i write here so im looking for someone that is good on php and vb that can help me with some custom pages? i know its a guide how you make them but i need to fix more then thoose guides can help me with so if you wanna help me with this send a pm to me, i don?t think this is to hard if you are good. i can not pay with money but you can get a link on the website to your website.


EDIT:

i will try to explain better here now.
i wan?t it to show the latest news like i got it to do and i wan?t index.php?do=add to be a page where i add to the database and you should be able to limit the access of that one to only admin/mods and when you go to index.php?newsid=id (or something) you should see the news with that id only.

John3971 01-27-2008 02:27 PM

Anybody that can help?

cheesegrits 01-27-2008 08:45 PM

I think you'll have to post a little more information before you get any bites. You gotta bait your hooks. Or chum the water. Or some such fishing analogy. You can't just stand there with your pole yelling "Here fishy fishy fishy!"

;)

-- hugh

Lynne 01-27-2008 09:07 PM

Quote:

Originally Posted by cheesegrits (Post 1430341)
I think you'll have to post a little more information before you get any bites. You gotta bait your hooks. Or chum the water. Or some such fishing analogy. You can't just stand there with your pole yelling "Here fishy fishy fishy!"

;)

-- hugh

Well, he can, but he might not get any nibbles.

Most people will help out if it is either something they have done before, so it's easy to give advice, or it's something of interest to them. So, you really need to say a little more if you want to get people interested in helping you.

(It also doesn't help that guests aren't allowed to view your forums so noone can even see what your site is like or about.)

John3971 01-27-2008 09:13 PM

Quote:

Originally Posted by Lynne (Post 1430355)
Well, he can, but he might not get any nibbles.

Most people will help out if it is either something they have done before, so it's easy to give advice, or it's something of interest to them. So, you really need to say a little more if you want to get people interested in helping you.

(It also doesn't help that guests aren't allowed to view your forums so noone can even see what your site is like or about.)

well i will explain more tomorow but i don?t see why ppl need to see more about my site and what it is about because what i need help with have nothing to do with what my site is about.

cheesegrits 01-27-2008 09:22 PM

Well that's kind of the point Lynne and I are trying to make. It's extremely unlikely anyone is going to PM you asking for how they can help you, with absolutely no indiciation of what it is you need.

Post a clear and concise description of what you want to do, and most likely someone who has done it before, or finds the question interesting in some way, will give you some pointers.

This forum is very busy, and the folk who answer questions here tend to be busy. So they kinda skim thru looking for interesting stuff, or stuff they can answer off the top of their heads. If you don't explain what you want, most of them will just skip your thread and move on.

-- hugh

John3971 01-31-2008 11:33 AM

took a little longer but i have update my first post.

cheesegrits 01-31-2008 01:40 PM

By "news" do you mean posts in a certain forum?

-- hugh

John3971 01-31-2008 01:52 PM

no i have right now fix a own tabel for the news where it gets it. if you wanna help me with this i can send you the index.php i have right now.

cheesegrits 01-31-2008 05:35 PM

Just post what you have here.

Short answers, you can control access to do="add" using the is_member_of() function:

http://members.vbulletin.com/api/

... under "Functions".

For newsid=X you would simply use X in a query on your table, and have a template that display the results. Standard vB stuff.

-- hugh

John3971 01-31-2008 06:00 PM

well i am not good in php and that shit. anyways here it is:

PHP Code:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''index');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
    
'vbnewsbit',
    
'vbnewslist',
    
'vbaddnews',
);

// ######################### REQUIRE BACK-END ############################
GLOBAL $parser;
require_once(
'./includes/class_bbcode.php');
require_once(
'./global.php');
$parser     =& new vB_BbCodeParser($vbulletinfetch_tag_list());

// ######################## START MAIN SCRIPT ############################
$newslimit    =    $vbulletin->input->clean($vbulletin->options['newslimit'], TYPE_INT);

$getnews $db->query_read("SELECT * FROM vb_news ORDER BY id DESC LIMIT 0, $newslimit");
while(
$news $db->fetch_array($getnews))
    {
        
$news['title']            =    preg_replace('/\<[a-zA-Z0-9 \&lt;\<\>\&gt;\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$news['title']);
        
$news['title']            =    unhtmlspecialchars($news['title']);
        
$news['newsdate']        =    vbdate($vbulletin->options['dateformat'], $news['dateline']);
        
$news['newstime']        =    vbdate($vbulletin->options['timeformat'], $news['dateline']);
        
$news['poster']            =    $news['poster'];
        
$news['newstext']          =    $parser->do_parse($news['newstext'], 1111);
    

        if (!isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('') . '";');
        }

        if (isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('vbnewsbit') . '";');
        }
    }

if (
$_REQUEST['do'] == 'add')
      {
              eval(
'$vbaddnews .= "' fetch_template('') . '";');

$navbits = array();
$navbits[$parent] = 'Add News';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('vbaddnews') . '");');
      } 

$navbits = array();
$navbits[$parent] = 'Home';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'$vbnewslist .= "' fetch_template('vbnewslist') . '";');
eval(
'print_output("' fetch_template('vbnewslist') . '");');
?>


John3971 02-01-2008 07:08 PM

can you help me with this?

MoT3rror 02-01-2008 07:23 PM

PHP Code:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''index');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
    
'vbnewsbit',
    
'vbnewslist',
    
'vbaddnews',
);

// ######################### REQUIRE BACK-END ############################
GLOBAL $parser;
require_once(
'./includes/class_bbcode.php');
require_once(
'./global.php');
$parser     =& new vB_BbCodeParser($vbulletinfetch_tag_list());

// ######################## START MAIN SCRIPT ############################
$newslimit    =    $vbulletin->input->clean($vbulletin->options['newslimit'], TYPE_INT);

$getnews $db->query_read("SELECT * FROM vb_news ORDER BY id DESC LIMIT 0, $newslimit");
while(
$news $db->fetch_array($getnews))
    {
        
$news['title']            =    preg_replace('/\<[a-zA-Z0-9 \&lt;\<\>\&gt;\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$news['title']);
        
$news['title']            =    unhtmlspecialchars($news['title']);
        
$news['newsdate']        =    vbdate($vbulletin->options['dateformat'], $news['dateline']);
        
$news['newstime']        =    vbdate($vbulletin->options['timeformat'], $news['dateline']);
        
$news['poster']            =    $news['poster'];
        
$news['newstext']          =    $parser->do_parse($news['newstext'], 1111);
    

        if (!isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('') . '";');
        }

        if (isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('vbnewsbit') . '";');
        }
    }

//Check if in usergroup 6
if(is_member_of($vbulletin->userinfo6))//Change 6 to usergroup ID you want to restrict to
{
//Code to use if usergroup 6
    
if ($_REQUEST['do'] == 'add')
      {
              eval(
'$vbaddnews .= "' fetch_template('') . '";');

$navbits = array();
$navbits[$parent] = 'Add News';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('vbaddnews') . '");');
      } 
}

$newsid $vbulletin->input->clean_gpc('g''id'TYPE_INT);

if(!empty(
$newsid))
{
//Code to show news article
}
else
{

//Show list when $newsid is not defined or 0
$navbits = array();
$navbits[$parent] = 'Home';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'$vbnewslist .= "' fetch_template('vbnewslist') . '";');
eval(
'print_output("' fetch_template('vbnewslist') . '");');
}
?>


John3971 02-01-2008 07:44 PM

Quote:

Originally Posted by MoT3rror (Post 1434156)
PHP Code:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''index');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
    
'vbnewsbit',
    
'vbnewslist',
    
'vbaddnews',
);

// ######################### REQUIRE BACK-END ############################
GLOBAL $parser;
require_once(
'./includes/class_bbcode.php');
require_once(
'./global.php');
$parser     =& new vB_BbCodeParser($vbulletinfetch_tag_list());

// ######################## START MAIN SCRIPT ############################
$newslimit    =    $vbulletin->input->clean($vbulletin->options['newslimit'], TYPE_INT);

$getnews $db->query_read("SELECT * FROM vb_news ORDER BY id DESC LIMIT 0, $newslimit");
while(
$news $db->fetch_array($getnews))
    {
        
$news['title']            =    preg_replace('/\<[a-zA-Z0-9 \&lt;\<\>\&gt;\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$news['title']);
        
$news['title']            =    unhtmlspecialchars($news['title']);
        
$news['newsdate']        =    vbdate($vbulletin->options['dateformat'], $news['dateline']);
        
$news['newstime']        =    vbdate($vbulletin->options['timeformat'], $news['dateline']);
        
$news['poster']            =    $news['poster'];
        
$news['newstext']          =    $parser->do_parse($news['newstext'], 1111);
    

        if (!isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('') . '";');
        }

        if (isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('vbnewsbit') . '";');
        }
    }

//Check if in usergroup 6
if(is_member_of($vbulletin->userinfo6))//Change 6 to usergroup ID you want to restrict to
{
//Code to use if usergroup 6
    
if ($_REQUEST['do'] == 'add')
      {
              eval(
'$vbaddnews .= "' fetch_template('') . '";');

$navbits = array();
$navbits[$parent] = 'Add News';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('vbaddnews') . '");');
      } 
}

$newsid $vbulletin->input->clean_gpc('g''id'TYPE_INT);

if(!empty(
$newsid))
{
//Code to show news article
}
else
{

//Show list when $newsid is not defined or 0
$navbits = array();
$navbits[$parent] = 'Home';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'$vbnewslist .= "' fetch_template('vbnewslist') . '";');
eval(
'print_output("' fetch_template('vbnewslist') . '");');
}
?>


can you put in the code so it gets the news from the table? and also template based and gets it from vbsinglenews?

MoT3rror 02-01-2008 08:32 PM

This line is where you put in the code
PHP Code:

if(!empty($newsid))
{
//Code to show news article


You can just put in the code in this section to get news article.

John3971 02-01-2008 08:37 PM

Quote:

Originally Posted by MoT3rror (Post 1434199)
This line is where you put in the code
PHP Code:

if(!empty($newsid))
{
//Code to show news article


You can just put in the code in this section to get news article.

don?t think you understood what i meant i want it to be taken from a template and i don?t know how i fix the code for that?

i tried it like this:

PHP Code:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''index');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
    
'vbnewsbit',
    
'vbnewslist',
    
'vbaddnews',
    
'vbsinglenews',
);

// ######################### REQUIRE BACK-END ############################
GLOBAL $parser;
require_once(
'./includes/class_bbcode.php');
require_once(
'./global.php');
$parser     =& new vB_BbCodeParser($vbulletinfetch_tag_list());

// ######################## START MAIN SCRIPT ############################
$newslimit    =    $vbulletin->input->clean($vbulletin->options['newslimit'], TYPE_INT);

$getnews $db->query_read("SELECT * FROM vb_news ORDER BY id DESC LIMIT 0, $newslimit");
while(
$news $db->fetch_array($getnews))
    {
        
$news['title']            =    preg_replace('/\<[a-zA-Z0-9 \&lt;\<\>\&gt;\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/'''$news['title']);
        
$news['title']            =    unhtmlspecialchars($news['title']);
        
$news['newsdate']        =    vbdate($vbulletin->options['dateformat'], $news['dateline']);
        
$news['newstime']        =    vbdate($vbulletin->options['timeformat'], $news['dateline']);
        
$news['poster']            =    $news['poster'];
        
$news['newstext']          =    $parser->do_parse($news['newstext'], 1111);
    

        if (!isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('') . '";');
        }

        if (isset(
$vbnewsbit))
        {
            eval(
'$vbnewsbit .= "' fetch_template('vbnewsbit') . '";');
        }
    }

//Check if in usergroup 6
if(is_member_of($vbulletin->userinfo6))//Change 6 to usergroup ID you want to restrict to
{
//Code to use if usergroup 6
    
if ($_REQUEST['do'] == 'add')
      {
              eval(
'$vbaddnews .= "' fetch_template('') . '";');

$navbits = array();
$navbits[$parent] = 'Add News';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('vbaddnews') . '");');
      } 
}

$newsid $vbulletin->input->clean_gpc('g''id'TYPE_INT);


if(!empty(
$newsid))
{
        
              eval(
'$vbsinglenews .= "' fetch_template('') . '";');

$navbits = array();
$navbits[$parent] = 'Single News';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('vbsinglenews') . '");');
}
else
{

//Show list when $newsid is not defined or 0
$navbits = array();
$navbits[$parent] = 'Home';
$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'$vbnewslist .= "' fetch_template('vbnewslist') . '";');
eval(
'print_output("' fetch_template('vbnewslist') . '");');
}
?>

and added code to get from template but it won?t show up and when i use this it doesn?t work to see the index.php with all news.


All times are GMT. The time now is 01:34 AM.

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.01400 seconds
  • Memory Usage 1,913KB
  • 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
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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