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)
-   -   vBengine (https://vborg.vbsupport.ru/showthread.php?t=37289)

el3m3nt 04-10-2002 10:00 PM

vBengine
 
Latest Version: 1.1

Yesterday evening i wrote this hack instead of studying math :D. Actually the code is not really difficult, but the hack itself can make many things much easier.

First feature: you can create new php-files thru your admin cp. You can choose if you wanna include the header and footer template and if you wanna create a new template for the content.
Screenshot 1: http://partylife.ch/misc/vbengine1.jpg

Second feature: The script reads all files in your forum and admin directory and you can choose one for editing. So you can edit every file thru the admin cp. This can be usefull for changing small things. You can also choose if you want a backup of the file you are editing.
Screenshot 2: http://partylife.ch/misc/vbengine2.jpg
Screenshot 3: http://partylife.ch/misc/vbengine3.jpg


Installation
Everything is clearly explained in the readme file.


Download
Voil?: http://partylife.ch/misc/vBengine1.1.zip


Note!
I'd really like to get every feedback you guys can give me. Also post bugreports and suggestions to improve this script. If you have installed this hack, pls click on the install button to receive updates thru email. Thank you :).

BigJohnson 04-11-2002 09:49 AM

nice hack i'll install it later

Harvey 04-11-2002 10:10 AM

great idea.

2 month ago I wrote a simple editor but I canceles the project because of needing write access to the directory.

PS: you put a wrong readme.txt into the zip.

el3m3nt 04-11-2002 10:17 AM

ehm.. well you cannot get around the access thing. so if somebody wanna use this .. he has to give the write-access.

whats wrong with the readme-file? =)

RDX1 04-11-2002 10:52 AM

wow very nice, ill install it later also :)

andrew67 04-11-2002 10:58 AM

I tried this and it worked fine except the php file it created was empty except for calls to the header, footer & engine templates... It also has a parse error when I try and load it, whether I create templates or not...

el3m3nt 04-11-2002 11:01 AM

ehm.. well did you create a new template or just add some code/text?

could you post the content of the created file?

RDX1 04-11-2002 11:14 AM

i just thought of a security issue, since vb doesnt allow people to reset the admin log via the ACP and makes them edit the config file, this will allow people to reset the admin log

el3m3nt 04-11-2002 11:25 AM

Quote:

Originally posted by andrew67
PHP Code:

<?php
error_reporting
(7);

require(
"./global.php");

eval(
"\$header = \"".gettemplate('header')."\";");
eval(
"\$footer = \"".gettemplate('footer')."\";");
eval(
"\$headinclude = \"".gettemplate('headinclude')."\";");

$title="TEST";
eval(
"\$page = \"".gettemplate('test')."\";");

eval(
"dooutput(\"".gettemplate('engine')."\");");

?>


If I dont create a template I get this error:
Parse error: parse error in /home/virtual/site2/fst/var/www/html/forums/test.php on line 13


If I create a template I get this error:
Warning: SAFE MODE Restriction in effect. The script whose uid is 48 is not allowed to access ./global.php owned by uid 504 in /home/virtual/site2/fst/var/www/html/forums/test.php on line 4

have you created the engine template? the second error i dont really know. there seems to be several userids.. so the test.php must have the uid 504 too to get access.. but ehm.. sorry, i dont really know :/.

andrew67 04-11-2002 11:25 AM

Ok I got rid of the errors but now it just makes a blank page...

This is the php:

PHP Code:

<?php
error_reporting
(7);

require(
"./global.php");

eval(
"\$header = \"".gettemplate('header')."\";");
eval(
"\$footer = \"".gettemplate('footer')."\";");
eval(
"\$headinclude = \"".gettemplate('headinclude')."\";");

$title="TEST";
eval(
"\$page = \"".gettemplate('test')."\";");

eval(
"dooutput(\"".gettemplate('engine')."\");");

?>

and this is the html it generates:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>


andrew67 04-11-2002 11:33 AM

Ignore me, I added the engine template to the wrong style... oops works dandy now... ;)

el3m3nt 04-11-2002 11:38 AM

hehe.. nobody's perfect :).

Harvey 04-11-2002 12:46 PM

Hi,

2 suggestions.

1.) untested: If only those may use these function, witch may view the adminlog, put the following line after cpheader("...");
PHP Code:

checklogperms($canviewadminlog,1,"<p>functions restricted.</p>"); 

2.) implement functions to backup/restore files.

PS: should the readme.txt not contain the information how to integrate the new functions to index.php?

el3m3nt 04-11-2002 01:00 PM

thank you, harvey for the suggestions.

the first one is a very good idea.. which i'll add. the second one.. well do you think it would be usefull?

el3m3nt 04-11-2002 01:03 PM

Quote:

Originally posted by Harvey
PS: should the readme.txt not contain the information how to integrate the new functions to index.php?
you mean the admin/index.php? how to add the links to the admin cp navbar.. that is described.

Harvey 04-11-2002 01:52 PM

Hi.

Perhaps it makes sense to backup files automatically.

Imagine, you edit a file incorrectly but you don't know exactly where the error is and you don't have the previous version downloaded before. (hope this sentence is understandable).

If I download the attachment the readme.txt contains this:
Code:

********************************
*                              *
* Ultra Family Driver Diskette *
*                              *
********************************


====================
Contents on the disk
====================
README  TXT            This readme file
ULTRA                  Microsoft Windows miniport disk label file
TXTSETUP OEM            Microsoft Windows miniport text mode setup file

WIN2000        <DIR>
  ULTRA    SYS          Microsoft Windows2000 miniport driver
  ULTRA    INF          Microsoft Windows miniport setup file


WIN95-98      <DIR>
  ULTRA    MPD          Microsoft Windows95-98 miniport driver
  ULTRA    INF          Microsoft Windows miniport setup file
  ADVPACK  DLL          Advanced INF file format support file
  PTISTP  DLL          Advanced INF file format support file
  PU66VSD  VXD          Promise power management driver
  SMARTVSD VXD          Promise S.M.A.R.T. driver
  PTICACHE VXD          Promise Cache driver file

NT4            <DIR>
  ULTRA    SYS          Microsoft WindowsNT miniport driver file
  ULTRA    INF          Microsoft Windows miniport setup file

WINME          <DIR>
  ULTRA    MPD          Microsoft Windows Millennium miniport driver
  ULTRA    INF          Microsoft Windows miniport setup file
  ADVPACK  DLL          Advanced INF file format support file
  PTISTP  DLL          Advanced INF file format support file
  PU66VSD  VXD          Promise power management driver
  SMARTVSD VXD          Promise S.M.A.R.T. driver
  PTICACHE VXD          Promise Cache driver file

================
Software Version
================
Microsoft WindowsNT miniport driver    1.60 (Build 33)
Microsoft Windows 2000 miniport driver  1.60 (Build 33)
Microsoft Windows95-98 miniport driver  1.60 (Build 33)
Microsoft Windows Millennium miniport driver  1.60 (Build 33)


TECK 04-11-2002 03:31 PM

just a quick note. i looked at the posts made by other users that installed this hack. there is no need to add the $headinclude, $header and $footer in the file, if you call the global.php file. they are included there.

el3m3nt 04-11-2002 03:41 PM

ouh.. cool.. thanks nakkid.

@Harvey: lol funny, ehm pls.. download the zip-file again.. im quite sure that not this readme file is in the file. ;) (btw: du sprichst doch deutsch nicht? :))

Harvey 04-11-2002 04:30 PM

ja, eigentlich nur :)

Vivi Ornitier 04-11-2002 07:15 PM

Also another thing you may want to add is a search feature ;)

JulianD 04-11-2002 08:39 PM

Very interesting, I'm gonna check it out with a test board and post some comments :)

Neo 04-12-2002 04:31 AM

This is great man I am going to have to install this :)

el3m3nt 04-12-2002 10:10 AM

ouh search feature.. very nice idea.. i'll work on that tonight or tomorrow.

thanks JulianD for testing.. and neo for installing ;) :)

-=dm=- 04-12-2002 10:29 AM

Quote:

Originally posted by el3m3nt
ouh search feature.. very nice idea.. i'll work on that tonight or tomorrow.

thanks JulianD for testing.. and neo for installing ;) :)


again excellent hack!!!

I have not installed it yet, I?ll wait to the next version :D

thanx
dm

el3m3nt 04-12-2002 03:39 PM

hehe.. well you dont have really much to install.. just upload the file.. and add a new template.. (plus giving access to the files) then everything should work :).

next version comes soon.

el3m3nt 04-12-2002 04:29 PM

to Vivi Ornitier: what kind of search feature would you like? searching thru all files? or just search thru the current opened file? (like the displaying of templates)

c-pr0mpt 04-12-2002 10:06 PM

I love this hack. Especially for editing things like the cp.css file. Good job.

MarkB 04-13-2002 01:34 AM

Cool hack! I already have something in mind to use this with :)

ZiRu$ 04-13-2002 04:33 AM

Great Job! I installed it.....

I have a few requests...

1. Ability to edit the files in the admin directory
2. Search Feature
3. Ability to download ALL files with the click of a button...for backup purposes

Shroomboy 04-13-2002 04:49 AM

I get this error when ever changing a file
PHP Code:

Warningfopen("../announcement.php""w") - Permission denied in /home/ffmythol/public_html/forums/admin/engine.php on line 122

Warning
Supplied argument is not a valid File-Handle resource in /home/ffmythol/public_html/forums/admin/engine.php on line 124

Warning
Supplied argument is not a valid File-Handle resource in /home/ffmythol/public_html/forums/admin/engine.php on line 126
Done



Vivi Ornitier 04-13-2002 06:07 AM

Searching through the current opened file of course ;)

that was editing will be easy :)

el3m3nt 04-13-2002 06:20 AM

Shroomboy: you have to make the file you wanna edit (in your case announcement.php) writable. so use you ftp-client and change the rights.

c-pr0mpt 04-13-2002 09:46 AM

Everything works great here. Thanks!

el3m3nt 04-13-2002 12:30 PM

i'm happy to hear that c-prompt :). update to v1.1 in a few mins.

el3m3nt 04-13-2002 12:39 PM

okey.. version 1.1 is available.

changes:
- search feature added (as suggested)
- backup feature added (as suggested)
- admin and forum dir editable (as suggested)

further suggestions? :)

Harvey 04-13-2002 12:47 PM

mhmm the webmaster doesn't allow chmod 666 and the PHP-scripts run under user nobody.

sorry,for writing the rest in german.
Schade, denn ich habe auf der Malloche kein FTP. Es sei denn ich arbeite in dringenden F?llen direkt auf der Firewall, aber davon ist unser Admin nicht wirklich begeistert. Und ich dachte schon, ich k?nnte zusammen mit Dir ein High-End-Produkt rausbringen ;) (aber das ist es ja schon: sehr gute Arbeit)

el3m3nt 04-13-2002 01:00 PM

[german]
hehe, danke dir. :)

Dein Board ist ziemlich beeindruckend, muss ich sagen. Sauberes Design, ?bersichtlich, riesiges Forum.. und alles passt sch?n zusammen. Wirklich super Arbeit.
[/german]

hmm.. i don't know how to change the rights (chmod) for files thru php. and how to change user too.

can there somebody help?

ZiRu$ 04-13-2002 06:00 PM

Quote:

Originally posted by el3m3nt
okey.. version 1.1 is available.

changes:
- search feature added (as suggested)
- backup feature added (as suggested)
- admin and forum dir editable (as suggested)

further suggestions? :)

Thanks so much! I'll put it on my forum now! Great Stuff

el3m3nt 04-14-2002 08:42 AM

i found one little complication:

when you edit the cp.css and want to make a backup.. the backup file is named cp.css.bak.php ;). ehm.. well just notice that, if you wanna edit "non-php" files :).

Bad Bunny 04-19-2002 01:48 PM

Ok, I am sort of a newbie to this. I added it just fine. WOrks great to edit files. However, I am having a little issue with making a new file, and having it use the "Use the header and footer template of your style?" option for making a new file.
The line
PHP Code:

eval("dooutput(\"".gettemplate('engine')."\");"); 

always causes an error. I am sure it is because I don't know what the flaming hades I am trying to do...but if anyone could help me, I would apreciate it. Thanks.


All times are GMT. The time now is 04:49 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.01420 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
  • (1)bbcode_code_printable
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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