Addon enhancements thread

Ideas and suggestions for how to improve the Warzone 2100 base game only. Ideas for mods go in Mapping/Modding instead. Read sticky posts first!

Addon enhancements thread

Postby vexed » 23 Sep 2011, 03:05

For those of you that know PHP, the source to the current addon page is located here:
https://github.com/Warzone2100/wz2100.n ... wz2100.net

Feel free to improve it. :)
/facepalm ...Grinch stole Warzone🙈🙉🙊
User avatar
vexed
Inactive
Inactive
 
Posts: 1464
Joined: 27 Jul 2010, 01:07

Re: Addon enhancements thread

Postby NoQ » 23 Sep 2011, 06:03

Hmm thanks for sticking this one. Just finally had a look at this!
index.php refers certain include files like addons-list.inc.php but where are they located?
User avatar
NoQ
Veteran
Veteran
 
Posts: 5510
Joined: 24 Dec 2009, 10:35
Location: /var/zone

Re: Addon enhancements thread

Postby Ezio » 23 Sep 2011, 06:13

NoQ wrote:Hmm thanks for sticking this one. Just finally had a look at this!
index.php refers certain include files like addons-list.inc.php but where are they located?


+1

I got an error:

Code: Select all
Warning: include_once(C:\xampp\htdocs\add\lib/settings.inc.php) [function.include-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\add\lib\global.lib.php on line 3

Warning: include_once() [function.include]: Failed opening 'C:\xampp\htdocs\add\lib/settings.inc.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\add\lib\global.lib.php on line 3

Warning: require_once(C:\xampp\htdocs\add\lib/../forums.wz2100.net/htdocs/common.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\add\lib\global.lib.php on line 13

Fatal error: require_once() [function.require]: Failed opening required 'C:\xampp\htdocs\add\lib/../forums.wz2100.net/htdocs/common.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\add\lib\global.lib.php on line 13
Image
Please Read FAQ, Dev Wiki and Search forum for same post before posting
User avatar
Ezio
Trained
Trained
 
Posts: 278
Joined: 24 Apr 2010, 15:42

Re: Addon enhancements thread

Postby Zarel » 23 Sep 2011, 07:09

I believe lines like this:

include_once('../../wz2100.net/lib/global.lib.php');

can be commented out safely. They're just things like authentication code; you can just do stuff like set $isreviewer to true manually.

addons-*.inc.php should be there, though. No idea where they went.

In the meantime, here's where most of the fun stuff happens: https://github.com/Warzone2100/wz2100.n ... ns.lib.php
User avatar
Zarel
Elite
Elite
 
Posts: 5770
Joined: 03 Jan 2008, 22:35
Location: Minnesota, USA

Re: Addon enhancements thread

Postby Ezio » 23 Sep 2011, 08:23

Zarel wrote:I believe lines like this:

include_once('../../wz2100.net/lib/global.lib.php');

can be commented out safely. They're just things like authentication code; you can just do stuff like set $isreviewer to true manually.

addons-*.inc.php should be there, though. No idea where they went.

In the meantime, here's where most of the fun stuff happens: https://github.com/Warzone2100/wz2100.n ... ns.lib.php


Thanks It's works.
but i'm still confused on which code is used to make div class addon
Image
Please Read FAQ, Dev Wiki and Search forum for same post before posting
User avatar
Ezio
Trained
Trained
 
Posts: 278
Joined: 24 Apr 2010, 15:42

Re: Addon enhancements thread

Postby effigy » 24 Sep 2011, 00:11

I thought I'd put the current "list" format into perspective:

right click and "save as" 1588x43637 pixels (11.3 mb)

:shock: :hmm: :...: :stressed: :!!!: :augh: :zZz: :zZz:
Last edited by effigy on 24 Sep 2011, 03:25, edited 2 times in total.
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
effigy
Regular
Regular
 
Posts: 1217
Joined: 22 Jan 2010, 02:21

Re: Addon enhancements thread

Postby lav_coyote25 » 24 Sep 2011, 02:29

effigy wrote:I thought I'd put the current "list" format into perspective:

1588x43637 pixels (11.3 mb)

:shock: :hmm: :...: :stressed: :!!!: :augh: :zZz: :zZz:



The image “http://dl.dropbox.com/u/1460920/wz/wz%20addons%20page%202011-09-23.jpg” cannot be displayed because it contains errors.
User avatar
lav_coyote25
Professional
Professional
 
Posts: 3434
Joined: 08 Aug 2006, 22:18

Re: Addon enhancements thread

Postby dak180 » 24 Sep 2011, 03:22

Zarel wrote:I believe lines like this:

include_once('../../wz2100.net/lib/global.lib.php');

can be commented out safely. They're just things like authentication code; you can just do stuff like set $isreviewer to true manually.

addons-*.inc.php should be there, though. No idea where they went.

In the meantime, here's where most of the fun stuff happens: https://github.com/Warzone2100/wz2100.n ... ns.lib.php

Fairly sure that you have that backwards; all the *.inc.php are data stores or authentication stuff, the *.lib.php are libraries that handle stuff like persistent storage.

The ../../wz2100.net/lib/global.lib.php is just it using a single copy of the lib for the whole site.

I would not recommend commenting it out.

You can likely comment out include_once(dirname(__FILE__) . '/settings.inc.php'); and set $isreviewer to get rid of the authentication check (that is not in the repo).
User:dak180
Keeper of the Mac Builds
User avatar
dak180
Trained
Trained
 
Posts: 288
Joined: 01 Nov 2009, 22:58
Location: Keeper of the Mac Builds

Re: Addon enhancements thread

Postby effigy » 24 Sep 2011, 03:39

lav_coyote25 wrote:
effigy wrote:I thought I'd put the current "list" format into perspective:

1588x43637 pixels (11.3 mb)

:shock: :hmm: :...: :stressed: :!!!: :augh: :zZz: :zZz:



The image “http://dl.dropbox.com/u/1460920/wz/wz%20addons%20page%202011-09-23.jpg” cannot be displayed because it contains errors.


Sorry, I'm guessing that's a browser issue due to the file size... I can't find a free image host that allows images over 10mb, either. Even dropbox's gallery view seems to have a problem with it.... :C Anyhow, I can't see it in FF 6.0.2, I can see it shrunk to fit in Google Chrome 14.x, and it shows up fine in IE 8. Saving it to your hard drive should let you see it, also.
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
effigy
Regular
Regular
 
Posts: 1217
Joined: 22 Jan 2010, 02:21

Re: Addon enhancements thread

Postby Zarel » 24 Sep 2011, 04:32

dak180 wrote:Fairly sure that you have that backwards; all the *.inc.php are data stores or authentication stuff, the *.lib.php are libraries that handle stuff like persistent storage.

You're close. I do use "*.inc.php" for data stores. But I also used them for the main Addons pages: "addons-*.inc.php".

dak180 wrote:The ../../wz2100.net/lib/global.lib.php is just it using a single copy of the lib for the whole site.

What I'm saying is that all that library handles is stuff like authentication, which isn't really necessary for a local copy.
User avatar
Zarel
Elite
Elite
 
Posts: 5770
Joined: 03 Jan 2008, 22:35
Location: Minnesota, USA

Re: Addon enhancements thread

Postby Iluvalar » 24 Sep 2011, 06:20

" include 'addons-list.inc.php'; "

And where is that file ?
Heretic 2.3 improver and proud of it.
User avatar
Iluvalar
Regular
Regular
 
Posts: 1685
Joined: 02 Oct 2010, 17:44

Re: Addon enhancements thread

Postby dak180 » 24 Sep 2011, 15:26

All the addons-*.inc.php files should now be in the repo.
User:dak180
Keeper of the Mac Builds
User avatar
dak180
Trained
Trained
 
Posts: 288
Joined: 01 Nov 2009, 22:58
Location: Keeper of the Mac Builds

Re: Addon enhancements thread

Postby NoQ » 14 Mar 2012, 13:24

Finally remembered about this thread and wanted to have some fun (at least). Cloned the git, put it into a locally-installed apache root and started looking.

I'm missing some files again, it says the following files are missing:

    /wz2100.net/lib/settings.inc.php
    /wz2100.net/lib/../forums.wz2100.net/htdocs/common.php
and some more forum-related stuff.
Even though i might be able to live without those, i need to somehow make a dummy $user variable to get it all running.
User avatar
NoQ
Veteran
Veteran
 
Posts: 5510
Joined: 24 Dec 2009, 10:35
Location: /var/zone

Re: Addon enhancements thread

Postby dak180 » 14 Mar 2012, 14:00

NoQ wrote:Finally remembered about this thread and wanted to have some fun (at least). Cloned the git, put it into a locally-installed apache root and started looking.

I'm missing some files again, it says the following files are missing:

    /wz2100.net/lib/settings.inc.php
    /wz2100.net/lib/../forums.wz2100.net/htdocs/common.php
and some more forum-related stuff.
Even though i might be able to live without those, i need to somehow make a dummy $user variable to get it all running.

For wz2100.net/lib/settings.inc.php it looks something like (this is not the actual file but could be used as a dummy, maybe with some adjustment):
Code: Select all
<?php
$settings = array();

// phpBB Group ids for access rights
// webmaster
$settings['administrators'] = array(1);

// reviewer
$settings['reviewers'] = array(2);

// helper
$settings['helpers'] = array(3);

$settings['newforum'] = 1;


wz2100.net/lib/../forums.wz2100.net/htdocs/common.php is a standard component of a phpBB install.
User:dak180
Keeper of the Mac Builds
User avatar
dak180
Trained
Trained
 
Posts: 288
Joined: 01 Nov 2009, 22:58
Location: Keeper of the Mac Builds

Re: Addon enhancements thread

Postby NoQ » 16 Mar 2012, 07:33

All right, now i have phpbb installed locally >.<

Hey guys ... how does this $p variable in index.php work? :oops: Cause when i visit http://addons.wz2100.net/submit, this $p thing gets equal to "submit" here, but not on my machine; i have to write something like http://addons.wz2100.net/?p=submit instead, which also works, but internal links on the pages are made the first way.
User avatar
NoQ
Veteran
Veteran
 
Posts: 5510
Joined: 24 Dec 2009, 10:35
Location: /var/zone

Next

Return to Ideas and suggestions