PDA

View Full Version : vBengine


el3m3nt
04-10-2002, 10:00 PM
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
Originally posted by andrew67
<?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
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("...");

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
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:

********************************
* *
* 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
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
Warning: fopen("../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
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.


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
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 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.

el3m3nt
04-19-2002, 02:29 PM
ehm.. have u added the template 'engine" to the style you use (or all style you use)?

Bad Bunny
04-19-2002, 03:41 PM
Yes, I followed each example. I MAY have done it wrong, I will go and re read it when I get out of work. Thanks.

Fallout2man
05-03-2002, 02:02 AM
Hey, I was wondering, would it be possible for you to add the feature to modify files in the mod directory, and the ability to select between the root forum, admin, and mod directories when creating PHP files? I've been trying to do some of these myself by modifying the code, but none of my tweaks, save adding extensive security checks for unauthorized users, have worked.

GOD-Dblade
05-03-2002, 09:07 PM
Ok....well i installed this hack then edited the config file....everything went fine...then i was Adding a new hack....the Failed log ins hack and edited the member.php file fine..then i went to the Index.php file and edited it in the admin index...just adding a url and i got a error like this.
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/admin/index.php on line 4

Fallout2man
05-04-2002, 10:27 PM
Make sure you've CHMOD 0777'd all of your PHP files in the root, admin, and mod directories, as well as the directories themselves, and the root forum directory. That might fix the problem.

Lotus Ims
05-07-2002, 09:34 PM
Truly a wonderful hack, works perfectly. Thank you so much

Clicking the install button....now

BrAinZ
05-09-2002, 10:32 AM
Thanks for this useful Hack.

Only problem on my board is that we are still running on Version 2.03

I don't know anything about PHP, but I used my logical skills and it seeems to work if you add this to the index.php

<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="2" id="navtable">
<?php maketableheader("VBengine"); ?>
</table>
<a href="engine.php?s=<?php echo $session[sessionhash]; ?>&action=add"> Add File </a> |
<a href="engine.php?s=<?php echo $session[sessionhash]; ?>&action=edit"> Edit Files </a><br>
</td></tr>

Velocd
05-12-2002, 05:39 PM
This has to be one of the most useful hacks out there! Excellent job man ;)

Now I don't have to shift from CuteFTP to my Admin panel when installing a hack, I can do it all from my admin :) Not to mention when I'm at school or another computer without CuteFTP I can easily gain access to my files when making updates!

Only question is, with the "create php file" feature, can you specify what directory this file is going in? Or is it always the default forum/ directory?

Once again, great hack!
* Velocd clicks install button

Fallout2man
05-12-2002, 09:55 PM
Originally posted by Velocd
This has to be one of the most useful hacks out there! Excellent job man ;)

Now I don't have to shift from CuteFTP to my Admin panel when installing a hack, I can do it all from my admin :) Not to mention when I'm at school or another computer without CuteFTP I can easily gain access to my files when making updates!

Only question is, with the "create php file" feature, can you specify what directory this file is going in? Or is it always the default forum/ directory?

Once again, great hack!
* Velocd clicks install button

*points to my feature request*

Yes, It's always in the default dir. If we could read the mod dir, and save to either the mod, forum, or admin dir, then the script would completely eliminate the need for FTPs, except for graphics.

Velocd
05-13-2002, 04:44 AM
well you can never eliminate the use of an FTP, hence the name "file transfer protocol". FTP will always be used to mass upload files and quickly to a web server. even if someone made a vbadmin integrated uploading hack, nobody would use it cause its just crappy uploading through http. Although maybe simple php files would be nice to upload through admin...hmmmmmmmmmmm..

anyway, wth am I going with this discussion..and why?
/me needs sleep -.-

Sketch
05-16-2002, 01:27 AM
wow! That is absolutely AWESOME! Thanks a million. I don't have FTP access at work where I have the time to do alot of my editing. It's nice to have this.

Sketch

Sadie Frost
05-16-2002, 01:08 PM
Looks awesome! :)

I wondered if someone could explain the security issue of having write permissions enabled? I am not that advanced and I'd just like to know if it's risky before I install this :) Thanks!

Dean C
06-03-2002, 01:31 PM
this is a great hack .. sorry to bring an old post up again ...

but is there anyway to only allow one admin to do this... i only want myself to be able to use this and not the other admins...

thanks in advance

Derek
06-20-2002, 01:48 PM
I agree with Mist... another thing is can you make it to where we can upload like up to 5 files at a time... not mass, just 5 so we don't have to restart FTP each time.

wolfe
09-25-2002, 11:23 PM
hey is there a way to add a mod dir



i added

echo "<tr class='firstalt' valign='top'><td><p>Mod Directory:</p></td><td align=center><p>";
echo "\n<select size=15 name=\"filename\">\n\t<option>------------------------------------------------</option>\n";

$dir=opendir("./");
while ($file=readdir($dir)) {
if (is_dir("./".$file)) {
$file="";
} else {
$file="\t<option value=\"$file\">$file</option>\n";
}
echo $file;
}

echo "</select>";
echo "</p></td></tr>";

makehiddencode("dir","mod");
doformfooter("Edit");

under

echo "<tr class='firstalt' valign='top'><td><p>Admin Directory:</p></td><td align=center><p>";
echo "\n<select size=15 name=\"filename\">\n\t<option>------------------------------------------------</option>\n";

$dir=opendir("./");
while ($file=readdir($dir)) {
if (is_dir("./".$file)) {
$file="";
} else {
$file="\t<option value=\"$file\">$file</option>\n";
}
echo $file;
}

echo "</select>";
echo "</p></td></tr>";

makehiddencode("dir","admin");
doformfooter("Edit");

and under that i replaced

if ($action=='read') {
if ($dir=="forum") {
$dirname="../";
} elseif ($dir=="admin") {
$dirname="./";

}

with

: if ($action=='read') {
if ($dir=="forum") {
$dirname="../";
} elseif ($dir=="admin") {
$dirname="./";
} else { ($dir=="mod") {
$dirname="./";
}



but it loaded the admin files in the mod bit :( can some one please help

wolfe
09-26-2002, 12:10 AM
Sorry this is not my actual hack it is el3m3nt's (https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=5425)

Click Here For Original VBengine (https://vborg.vbsupport.ru/showthread.php?s=&threadid=37289)

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

What i have done

UPDATES:

I have added a extra bit of code so it shows the Mod Directory :D

so now its even easier to add hacks to the Mod CP :D

ALSO I WILL OFFER ALL SUPPORT.

Click Here (https://vborg.vbsupport.ru/misc.php?s=&action=install&threadid=43937)

LawnDawg
09-26-2002, 01:12 AM
Kewl, you think it would be possible to add in directories other than the /forums & /admin /mod etc?

DrkFusion
09-26-2002, 01:14 AM
Seems very useful.

I will take a look at it
-Arunan

wolfe
09-26-2002, 01:14 AM
yeah d00d just ask me and i will add them but i need to know exactly where they are like in forum/tmp or tmp etc etc

wolfe
09-26-2002, 01:15 AM
need to know if it works prolly

some one test it out

wolfe
09-26-2002, 01:16 AM
it works great on my board but might be different to others boards :D

Mike Gaidin
09-26-2002, 01:26 AM
Love the original. Will check this one out.

Unknown553
09-26-2002, 01:55 AM
So the only thing different from v1.0 is the addition of the /mod directory? If so I don't think this update deserves it's own thread...

chitown
09-26-2002, 02:27 AM
well this is an awesome tool, makes all hacks much easier to install!!!

K_2
09-26-2002, 05:04 AM
Thank You. Makes my work ALOT easier! I am only 2 weeks new at this and need all the help I can get. K2 clicks install.

chitown
09-26-2002, 05:47 AM
Warning: fopen("./functions.php3", "w") - Permission denied in /home/cardtrix/public_html/forum/admin/engine.php3 on line 275

Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/cardtrix/public_html/forum/admin/engine.php3 on line 277

Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/cardtrix/public_html/forum/admin/engine.php3 on line 279
Done!

this is what i am getting, will this work with 2.27? i have not upgraded to 2.28

zajako
09-26-2002, 06:31 AM
you don't have the directory's permission of 777. set that and you will not get those errors. You will need to amke forums, admin, and mod all have 777 and your engine.php file have 777 also.

TECK
09-26-2002, 06:37 AM
i dont understand "dood" why you didnt released this as a mod in the original thread?
i could release 385 hacks like that. i take every single hack i like, change few variables and add 2-3 extra lines of code... and voila. there it is a new hack.

think of it this way, the more hacks there are the harder it is to find them.

Erwin
09-26-2002, 06:43 AM
Originally posted by TECK
i dont understand "dood" why you didnt released this as a mod in the original thread?
i could release 385 hacks like that. i take every single hack i like, change few variables and add 2-3 extra lines of code... and voila. there it is a new hack.

think of it this way, the more hacks there are the harder it is to find them.

I have to agree with TECK and Unknown. As far as I can tell, you added a function to edit files in the mod directly. That's hardly enough to release a version 2. Also, I hope you got element's permission to release his hack. After all, he was the one who wrote the original hack. This is not meant to be offensive - I am just pointing out that if this was my hack, I would not be happy if someone else took it and re-released it without my permission after changing something minor. :) Peace.

chitown
09-26-2002, 12:24 PM
i have all the files and folders including engine.php at chmod777 and i am still getting the same error as above....wtf am i doing wrong?

wolfe
09-26-2002, 12:34 PM
d00d does it show the contents fo the mod directory in the bottom box of the engine.php

wolfe
09-26-2002, 12:36 PM
also the original maker of this product was not providing support in that thread so i added my own ok

TECK
09-26-2002, 05:41 PM
is ok "dood", a mod fixed the thread. hope you learn from this lesson.

wolfe
09-26-2002, 08:30 PM
what you merged them

Attrox
10-29-2002, 08:30 PM
Wow...this hack is simply amazing, and by far my favorite. :)

DrkFusion
10-29-2002, 08:32 PM
Works very nice, good for adding hacks at school and at work. Very unique idea.

Thanks
*Clicks Install*
-Arunan

Chris M
10-29-2002, 08:39 PM
I presume this works with vB 2.2.8?

Satan

DrkFusion
10-29-2002, 08:43 PM
It does, but I had ome hard time, figuring stuff out. But It works for me.

-Arunan

Chris M
10-29-2002, 09:43 PM
Fine:)

I may install this later today:)

Satan

N9ne
10-30-2002, 12:17 AM
Exactly how hard is it to install this on 2.2.8?

wolfe
10-30-2002, 01:09 PM
not very

NTLDR
10-30-2002, 01:43 PM
Originally posted by N9ne
Exactly how hard is it to install this on 2.2.8?

1 File Edit and 1 file to upload IIRC.

Megabyt3
11-13-2002, 02:40 AM
I Installed it... but i dont know what to do with the Permissions. I got this error on creating a test file:

Warning: unable to create file ../test.php because Permission denied in ...xxx...xxx/forums/admin/engine.php on line 131

Warning: fopen("../test.php", "w") - Permission denied in ...../forums/admin/engine.php on line 133

Warning: fwrite(): supplied argument is not a valid File-Handle resource ...../forums/admin/engine.php on line 143

Warning: fclose(): supplied argument is not a valid File-Handle resource in ..../forums/admin/engine.php on line 145
Done!

Wich permissions i must set to wich file?

NTLDR
11-13-2002, 10:04 AM
They must be chmod'ed 777.

Megabyt3
11-14-2002, 08:04 PM
"they"<<<??? wich folders and files? my admin folder is 777.

NTLDR
11-14-2002, 08:11 PM
All PHP files and all folders that contain them.

gmarik
05-24-2003, 09:02 AM
How is 2.3?

jdmuniverse
08-07-2003, 05:59 AM
Is it safe to CHMOD all of these folders 777? I just want to know if that will make anything insecure in anyway?

TIA

Bison
08-07-2003, 02:56 PM
Couldn't you just do a server check from within in the code ... on the login/password of the server owner, to alleviate the issue of changing all permissions to the files?

Also, run a test to check the userid to insude that the person editing the file is authorized?

This hack looks way too *unsecure* to leave access open on all files in your directory, dontcha think? :/

jdmuniverse
08-07-2003, 10:27 PM
That's what scares me :( Otherwise, this is such a nice hack!