vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   WebTemplates v.0.1 (Old Version) (https://vborg.vbsupport.ru/showthread.php?t=36419)

Ember 01-02-2003 08:07 PM

This may have been covered before, but I am using $user_username like this:

Welcome $user_username

but it is just showing "Unregistered" even if you are logged in... am I doing something wrong?

Grendel 01-02-2003 08:10 PM

I'm using it exactly like you and it works.

Ember 01-02-2003 08:12 PM

Ahh, but I am using it away from vb... using a php include to call the page into my homepage... and its not working... it might because I am using php functions for everything on the site... any ideas?

Ember 01-02-2003 08:13 PM

I mean, it works when I go to the forum directory and try it, but not when I am using it on my homepage.

Grendel 01-02-2003 08:14 PM

So why do you make a call on your homepage? Any reasons for this? Just make webtemplates your starting page.

Ember 01-02-2003 08:20 PM

ehhh, my homepage is a tad more advanced than you think... I couldnt run it from webtemplates even if I wanted too, its got over 1000 lines of functions behind it...

Grendel 01-02-2003 08:24 PM

Hm, okay.
Ever tried to build this code into the webtemplate? Maybe it works?

Logik 01-02-2003 08:26 PM

Lol.. Watch out vB world. This kid has an 'advanced' forum.. haha ;)

Grendel 01-02-2003 08:29 PM

Hm. Even if your posting is not against me - I don't think, you're helpful, Logik.

Ember 01-02-2003 08:33 PM

Havent got an advanced forum, just a website that works, I dont know jack++++ about vb forums really, only how to make styles for them...

I'll give working the site into a webtemplate a miss... all I want to know is do you know why it wont display the users name when they're logged in? I tried including global.php too.

Ember 01-02-2003 08:35 PM

Quote:

Originally posted by Grendel
Hm. Even if your posting is not against me - I don't think, you're helpful, Logik.
No, he's a prick, there's a difference... I get the feeling he's one of those people who thinks he's better than you.

Grendel 01-02-2003 08:35 PM

What type of "functions" do you have on your homepage?

Ember 01-02-2003 08:39 PM

Basically everything that site uses... I have all my functions defined in one file, such as sql queries, php, all the html... and then I just call them in on the main pages, so I can edit everything in one place.

Ember 01-02-2003 08:43 PM

by functions I mean defining stuff using php:

PHP Code:

<?php
function head()
{
?>
<html>
<head>
<title>Title</title>
</head>
<body bgcolor="#cecece">
<?php
}
?>

and then to put it in the main site I just put:

PHP Code:

<?php
head
();
?>

But there is more complex stuff on other pages.. liking viewing a complete story, which usings the post function eg: news.php?id=1 to view news story one...

I am just wondering how to get it to work thats all :) hehe.

Grendel 01-02-2003 08:44 PM

You could try to load it in an iframe on your homepage. Only netscape-users can't see this.

Ember 01-02-2003 08:46 PM

That might work, i'd have to look up the code to make the iframe transparent as the cell its in has a background image.

Grendel 01-02-2003 08:47 PM

The easiest way: just put your functions into webtemplates. I really played around with wt and you can do a lot of things with it.

Ember 01-02-2003 08:49 PM

Ok, thanks for your help all the same... I may just add a fully fledged welcome bar onto my home page and be done with the whole thing :)

Logician 01-03-2003 07:45 AM

Quote:

Originally posted by OrangeCow.net
This may have been covered before, but I am using $user_username like this:

Welcome $user_username

but it is just showing "Unregistered" even if you are logged in... am I doing something wrong?

If Grendal's help solved the problem, ignore me plz.

If you still have the problem, I need some clarification: Can't you make webtemplates work all together or does it work but just $user_username not works? Also please mention if it works if you use it default: ie. you call show.php?pg=template_name directly without PHP includes..

Ember 01-03-2003 09:11 AM

Ok, what I did was:

Create a new webtemplate that contained

PHP Code:

Welcome $user_username 

When I went to the address show.php?pg=welcome - it worked fine and showed Welcome Ember, however when I used php to include show.php?pg=welcome it would only show Welcome Unregistered, I tried including global.php to no effect.

Hope that clears it up!

XrayHead 01-03-2003 09:26 AM

Very nice, will give this a go on my test forum :D

Doc203 01-03-2003 06:19 PM

I think I just found what i didn't know I was looking for!

Awesome hack, and installs easy! Very fine Job Logician!

JohnXWA 01-06-2003 01:08 PM

Are there any plans for a new version? PLEASE make it parse PHP.

How can I include login box, who's online etc on my front page using WebTemplates?

Thanks!

Birdie501 01-09-2003 08:55 AM

will there be a new version?
Thanks!

Logician 01-10-2003 11:53 AM

Quote:

will there be a new version?
A few months ago I was working on the new version and adding a lot of new features. However new features got out of my hand and a lot of them are added until the hack structure didn't carry anymore. The new script was working ok but had performance problems when used under heavy traffic. Therefore I decided to make a revision in the hack algorithm so that script will deal with the new features well. However I stopped working on the structure change for as now VB3 is so close. It would be pointless to change the algorithm of the hack at the moment as we may need to rechange it after VB3.

I must also say that I had too many released hacks here in vb.org which requires my attention&support and it does not help much to have so many hacks when it comes to enhance them.

This is the story..Sorry for the delay of new version..

Birdie501 01-13-2003 11:51 PM

ok thanks! another question! can i also call a webtemplate in another webtemplate?

XrayHead 01-13-2003 11:59 PM

Ok, Just installed on my main Forum 2.8 and all went well.
Top Hack, Just need to look into how to use the sql side of things.
:rolleyes:

XrayHead

Thanks again for the hard work you put into this hack.

Logician 01-14-2003 06:46 AM

Quote:

Originally posted by Birdie501
can i also call a webtemplate in another webtemplate?
No you can't.. But you can use header and footer templates according to your needs if you are trying to form a standart look in many templates. As you know these 2 are called from other webtemplates.

XtReMaTriX 02-06-2003 12:13 PM

Hey, i was just wondering if there was a query that lets you see:

Active Users: 25
2 members | 23 guests
ricksoprano , XtReMaTriX
Most users ever online was 71 on 01-31-2003

and that stuff on your template. I use mybvindex for my home page and i want the template to kinda mimic that. i can get everything working exept the active users...

A little help would be great...

Mustang5ohhh 02-20-2003 12:43 AM

Very cool hack ... installed without a glitch on 2.2.9.

Very impressed.

Craigr 02-22-2003 05:21 PM

Excellent hack, can't wait for the next version when you've got it done.

Craig

Craigr 02-23-2003 07:08 PM

Is there any way you can edit your online.php to add the template locations so you can see people moving about the site?

For example i am browsing :
http://www.mysite.com/forum/show.php?pg=Links

In who is online i want to show the person:
Viewing the links page.

Thanks
Craig

Curator 02-23-2003 11:38 PM

How does this script perform under *heavy* load? Of course it does depend on the server to a large degree, but are there bottlenecks? Slowdowns? Has it been tested on a high-traffic site?

Thanks.

Logician 02-24-2003 07:14 AM

Quote:

Originally posted by Craigr
Is there any way you can edit your online.php to add the template locations so you can see people moving about the site?

For example i am browsing :
http://www.mysite.com/forum/show.php?pg=Links

In who is online i want to show the person:
Viewing the links page.

Try this one:

Edit online.php, find:
PHP Code:

  }
  
$userinfo[time] = vbdate($timeformat,$userinfo[lastactivity]); 

Before that add:

PHP Code:

    // Logician WebTemplates Hack
      
if (preg_match("/(pg=)(.*)(&)/siU"$userinfo[location], $l_match1) OR preg_match("/(pg=)(.*)/siU"$userinfo[location], $l_match2))
    { 
    if (
$l_match1[2]) {$lmatch=$l_match1[2];} else {$lmatch=$l_match2[2];}
      
$userinfo[where]= 'Reading Webtemplate: <a href="show.php?pg='.$lmatch.'" target="_blank">'.$lmatch.'</a>';
    }
    
// Logician WebTemplates Hack 

Enjoy..

Logician 02-24-2003 07:23 AM

Quote:

Originally posted by Curator
How does this script perform under *heavy* load? Of course it does depend on the server to a large degree, but are there bottlenecks? Slowdowns? Has it been tested on a high-traffic site?

I couldn't find a chance to test it under heavy load because my site's load is not high.. However I can see some bottlenecks that can increase PHP running time in the script if you have too much load. Actually this is why I didn't release the next version because script has too many features and its structure is not handling so many features perfectly at the moment. Although the version released is more basic than the unreleased next version, I still say take an eye on the performance if you have a heavy load. The best practise will be installing Microstats hack and monitor your webtemplates performance with it. Both hacks are competible, you just need to put microstat's hacks code inside your webtemplate to make it run with webtemplates.

If PHP running time is high under heavy load, there may be ways to optimize it by cancelling some features like webqueries..

Hopefully the next release will be much performance-friendly if it's is released.. :knockedout:

Boofo 02-24-2003 07:56 AM

I'm waiting on the next release to install this, so I hope it happens. ;)

Craigr 02-25-2003 02:57 PM

Quote:

Originally posted by Logician

Try this one:

Edit online.php, find:
PHP Code:

  }
  
$userinfo[time] = vbdate($timeformat,$userinfo[lastactivity]); 

Before that add:

PHP Code:

    // Logician WebTemplates Hack
      
if (preg_match("/(pg=)(.*)(&)/siU"$userinfo[location], $l_match1) OR preg_match("/(pg=)(.*)/siU"$userinfo[location], $l_match2))
    { 
    if (
$l_match1[2]) {$lmatch=$l_match1[2];} else {$lmatch=$l_match2[2];}
      
$userinfo[where]= 'Reading Webtemplate: <a href="show.php?pg='.$lmatch.'" target="_blank">'.$lmatch.'</a>';
    }
    
// Logician WebTemplates Hack 

Enjoy..

Thanks for that, i'll give it a go.

Craig

refertech 03-10-2003 12:22 AM

Since I'm not that wonderful of a hard coder. Can I build my pages in say Dream Weaver and copy the source into your hack and build my pages that way?

Great idea. I love this hack.

Mark

Logician 03-10-2003 11:18 AM

Quote:

Originally posted by refertech
Since I'm not that wonderful of a hard coder. Can I build my pages in say Dream Weaver and copy the source into your hack and build my pages that way?

Great idea. I love this hack.

Mark

sure Mark, you can use any HTML design software you like to build your page, then simply copy paste its source code to "TEMPLATE" section and you are done.. :)

refertech 03-10-2003 11:22 AM

Logician your the man. Thanks. Lets be best friends. :p I'll buy the beer. :)

Mark


All times are GMT. The time now is 08:41 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.01611 seconds
  • Memory Usage 1,837KB
  • 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
  • (7)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete