Jump to content
dimitris

Sceneries DataBase

Recommended Posts

Developed and Tested on:

phpVMS 2.1.934

php 5.2.6

By:

dimitris | http://www.greeceairwaysva.com/

phpVMS module to allow pilots submit sceneries (hosted on other locations) to create a database. Each scenery need to be approved by an Admin before the public view.

sbmt.png

appr.png

list.png

Create a link at:

<?php echo url('/Scenery'); ?>

To view the scenery list and admin.

See post #4 for updated version

  • Like 2

Share this post


Link to post
Share on other sites

did not work for me

just to clearify if Installed right

move the module & template folder to Core folder

run the SQL file

set the link to the module

http://www.flyeurope-va.org/index.php/secenery

right?

ok just found the error! typo by myself secenery scenery is better I think :P

but strange thing it doesent work even right spelled

I always get this message

An Error Was Encountered

The module "SCENERY" doesn't exist!

any Idea? how to fix

Best Regards

Thomas

Share this post


Link to post
Share on other sites

Hi Thomas :)

I found the error you are referring to ;) Problem is now fixed and version 1.1 is now uploaded please check it and tell me.

If you are getting a MySQL fetch_array error check the name of the prefix of database's table to be the same as the other tables.

Regards,

Dimitris

See post #10 for version 1.2

- Added FS versio (By TAV1702)

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

I have installed the Addon but when i click the Submit scenery or admin scenery or Scenary list nothing happens

Please Help me.

Share this post


Link to post
Share on other sites

Hi Tato! What is your website pleasee ? I will try to access the pages with direct links to see if there is any error with the links ;)

Share this post


Link to post
Share on other sites

That's actually pretty cool and works great. How about a little section for notes the submitter can add. For example, Scenery file for FSX only. Will not work on FS9. Should be fairly simple to do. I can even hack it together and update the database if needs be.

Share this post


Link to post
Share on other sites

I got a flight sim version hacked together and working for this.

scenerydb.jpg

If interested dimitris, let me know and I will send you the updated files and the database insert.

Ray

**EDIT**

I am attaching my version per dimitris. I have included a read me in the file. PLEASE make sure you read it. All code I have added I give freely to dimitris to add to his mod and do with what he wishes. I claim no ownership over his work or mine. It is all his.

Share this post


Link to post
Share on other sites

Hi TAV1702!

Thanks for your interest and also thank you for extending the code ;) You are free to publish it here at this thread ;)

Share this post


Link to post
Share on other sites

Ok will do. Let me take a double look at the files real quick and make sure I did not add anything extra or leave anything out. I will have it up here momentarily.

Done! I attached it to the post that I put the screenshot in.

Ray

Share this post


Link to post
Share on other sites

Hi Ray!

Thanks for the update ;)

I just edited the code so the users select from a dropdown list the FS version:

version.png

To do it open add_scenery.tpl and find this line:

<td><input type="text" name="simv" id="simv" /></td>

about 16

and replace with:

	
<td><select name="simv">
<option>FS9</option>
<option>FSX</option>
<option>Xplane 9</option>
<option>Xplane 10</option>
</select>
</td>

To add more Fs versions add:

<option>Whatever you like!</option>

The above is working with files from Scenery_v1.2.rar

Regards,

Share this post


Link to post
Share on other sites

Ahh ya beat me to it. lol I was actually going to work on that here in a bit. I was working on the old pilot shop mod for a bit.

Nice I will have to make those changes. Thanks!

Share this post


Link to post
Share on other sites

!!!!Deleted because securtiy leak ( my mistake). If u use my posted code please delete it!!!!#

This is the Correct:

<?php



$result = mysql_query("SELECT COUNT(*) FROM phpvms_scenery WHERE active=0"); 
$num_rows = mysql_result($result,0); 
?>

Share this post


Link to post
Share on other sites

That is a nice little addition. Now, I think it would be wiser to make that an admin module so it shows up on the addons tab. That way no edits will be over written in a update to phpVMS.

Share this post


Link to post
Share on other sites

This will actually allow people to download who are not logged in to your site. We need to add a check in. As well, I also got an admin module kicked up and running. I only have one small error left to work out and I am sure it is a simple typo somewhere.

Share this post


Link to post
Share on other sites

This will actually allow people to download who are not logged in to your site.

Just add this in the .tpl file

<?php
if(Auth::LoggedIn() == false)
{
  echo 'You must be logged in to view this page!';
  return;
}
?>

Share this post


Link to post
Share on other sites

This will actually allow people to download who are not logged in to your site.

Just add this in the .tpl file

<?php
if(Auth::LoggedIn() == false)
{
  echo 'You must be logged in to view this page!';
  return;
}
?>

that's not too dramatic with exception if an VA develops their own member only scenery files

what is far more a problem is that even non members can post links to sceneries by default which can open a potential door for spamming (pornlinks, etc)

Best Regards

Thomas

Share this post


Link to post
Share on other sites

that's not too dramatic with exception if an VA develops their own member only scenery files

what is far more a problem is that even non members can post links to sceneries by default which can open a potential door for spamming (pornlinks, etc)

Best Regards

Thomas

Hence why admin's have to approve each link. You also put the code to stop people from getting into the scenery insert area.

Share this post


Link to post
Share on other sites

I will probably put it only in scenery Insert area since my VA does not use any customized scenery files ;)

Best Regards

Thomas

Share this post


Link to post
Share on other sites

I dont need this, because i put the Sce DB in the Pilot Center, so u must log in first, and only members can post things and "bad" links...

When u add an row for type e.g. "Aircraft" u can use it as admin, that members can post good tools and other things??? Is this an usefull idea?

Share this post


Link to post
Share on other sites

copy in admin/templates/sidebar_dashboard.tpl

<p>
<?php

$link = mysql_connect("Db ADDRESS", "Your DB User Name", "[color="Your DB Password");
mysql_select_db("phpvms", $link);

$result = mysql_query("SELECT COUNT(*) FROM phpvms_scenery WHERE active=0", $link); 
$num_rows = mysql_result($result,0); 
?>

<strong><a href="<?php echo SITE_URL?>/index.php/scenery/admin"><?php echo  "$num_rows" ?></strong> Scenery pending</a>
</p>

change DB address, db USer and DB Password !!

screen2.jpg

Using that code could let anyone access your mySQL database for phpvms as they could just download the sidebar_dashboard.tpl file (http://www.yourdomain.com/admi/templates/sidebar_dashboard.tpl). Unless of course, you have the .htaccess file which stops people from downloading files from your site

Share this post


Link to post
Share on other sites

thanx for your advice, i make an bad mistake there !!!!

That is the correct

<?php

$result = mysql_query("SELECT COUNT(*) FROM phpvms_scenery WHERE active=0");

$num_rows = mysql_result($result,0);

?>

Share this post


Link to post
Share on other sites

I actually added a bit of code to the php file and you can no longer get to the scenery database at all unless logged in. I had pondered using that little ditty of code as we all do, but I figured this time I would do it php style. It worked out great. I got side tracked on the work I was doing on this fellas mod. I hope to get back on my admin module in the next day or two.

Share this post


Link to post
Share on other sites

one way to stop people viewing without login, is simple

do not add a menu link, instead, add the link to the Pilot Centre

so, open profile_main.tpl

Find the lines

<li><a href="<?php echo url('/profile/editprofile'); ?>">Edit My Profile, Email and Avatar</a></li>

<li><a href="<?php echo url('/profile/changepassword'); ?>">Change my Password</a></li>

<li><a href="<?php echo url('/profile/badge'); ?>">View my Badge</a></li>

<li><a href="<?php echo url('/profile/stats'); ?>">My Stats</a></li>

<li><a href="<?php echo url('/downloads'); ?>">View Downloads</a></li>

then add this to next line

<li><a href="<?php echo url('/Scenery'); ?>">View Scenery Links</a></li>

then, only people who have a pilot profile, can see the link

:P

Share this post


Link to post
Share on other sites

Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /web/htdocs/www.virtualiroma.it/home/newvar/core/modules/Scenery/Scenery.php on line 16 Warning: mysql_query(): A link to the server could not be established in /web/htdocs/www.virtualiroma.it/home/newvar/core/modules/Scenery/Scenery.php on line 16 Warning: mysql_result() expects parameter 1 to be resource, boolean given in /web/htdocs/www.virtualiroma.it/home/newvar/core/modules/Scenery/Scenery.php on line 17

Any Suggestion?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...