Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config file includes #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/submit/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@



include("../../inc/config.inc.php");
include(dirname(__FILE__) . "/../../../inc/config.inc.php");

include("MDB2.php");

Expand Down
11 changes: 10 additions & 1 deletion public/submit/form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<li>You have something unique to say about PHP.</li>
<li>Your posts are in english.</li>
<li>It's a personal blog and not a project blog.</li>

<li>You have a PHP category and an RSS/Atom feed just for that.</li>
<li>You already made some posts about PHP.</li>
<li>It's an advantage, if you are a PHP or PEAR developer.</li>
Expand Down Expand Up @@ -41,6 +40,16 @@ the textarea below, why you think, we should include your blog :) </p>
<label for="rss">Your RSS/Atom URL:</label><input id="rss" value="" name="rss"/> (to the PHP cat only) <br/>
Why should your blog be on Planet PHP:<br/> <textarea name="description" id="description" cols="40" rows="10"></textarea><br/>
<br/>

What does your blog provide:<br/>
<input type="checkbox" name="provide_web" value="web"/> General web stuff<br/>
<input type="checkbox" name="provide_beginner" value="beginner"/> Beginner PHP tutorials<br/>
<input type="checkbox" name="provide_js" value="js"/> JavaScript stuff<br/>
<input type="checkbox" name="provide_profi" value="profi"/> Professional PHP development<br/>
<input type="checkbox" name="provide_internals" value="internals"/> Stuff about PHP internals<br/>
<input type="checkbox" name="provide_html_css" value="html_css"/> Information on HTML and CSS<br/>
<input type="checkbox" name="provide_advanced" value="advanced"/> Advanced PHP programming topics<br/>

<label for="rss">What's the first name of the inventor of PHP?</label><input id="firstname" value="" name="firstname"/> <br/>
<br/>
<label for="submit"> </label><input type="submit" value="send"/>
Expand Down
15 changes: 10 additions & 5 deletions public/submit/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$dom = new domdocument();
$xsl = new domdocument();
$xsl->load("../themes/planet-php/static.xsl");
$xsl->load(dirname(__FILE__) . "/../themes/planet-php/static.xsl");


$xslt = new xsltprocessor();
Expand All @@ -16,7 +16,8 @@
}

$spam = false;
if ( !empty($_POST['name']) && !empty($_POST['firstname']) && !empty($_POST['url']) && !empty($_POST['description'])) {
if ( !empty($_POST['name']) && !empty($_POST['firstname']) && !empty($_POST['url']) && !empty($_POST['description'])
&& ( !empty($_POST['provide_advanced']) || !empty($_POST['provide_profi']) || !empty($_POST['provide_internals']) ) ) {

foreach($_POST as $key => $value) {
$_POST[$key] = trim($value);
Expand All @@ -41,7 +42,7 @@
die("From is invalid.");
}

include "../inc/config.inc.php";
include dirname(__FILE__) . "/../../inc/config.inc.php";
include "MDB2.php";

if (!$spam) {
Expand Down Expand Up @@ -77,7 +78,7 @@
mail(PROJECT_ADMIN_EMAIL, "[" . PROJECT_NAME_HR . "] (Rejected) New submission for ". $_POST['url'], $mailtext,$header);
} else {
//mail("[email protected]","New Planet PHP submission for ". $_POST['url'], $mailtext,$header);
mail(PROJECT_ADMIN_URL, "[" . PROJECT_NAME_HR . "] New submission for ". $_POST['url'], $mailtext,$header);
mail(PROJECT_ADMIN_EMAIL, "[" . PROJECT_NAME_HR . "] New submission for ". $_POST['url'], $mailtext,$header);
}

if ($db && $db->isError($res)) {
Expand All @@ -90,7 +91,11 @@

} else {
if (count($_POST) > 0 ) {
$xslt->setParameter("","error","Please fill in all fields");
if ( empty($_POST['name']) || empty($_POST['firstname']) || empty($_POST['url']) || empty($_POST['description']) ) {
$xslt->setParameter("","error","Please fill in all fields");
} else if ( empty($_POST['provide_advanced']) || empty($_POST['provide_profi']) || empty($_POST['provide_internals']) ) {
$xslt->setParameter("","error","Sorry, Planet-PHP only accepts advanced or professional PHP content or stuff about PHP internals.");
}
}
$dom->load("form.xml");
}
Expand Down
10 changes: 5 additions & 5 deletions public/themes/planet-php/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<title><xsl:call-template name="htmlheadtitle"/></title>
<link rel="shortcut icon" href="/favicon.ico" />
<link href="/themes/css/style.css" rel="stylesheet" type="text/css"/>
<link href="/themes/planet-php/css/style.css" rel="stylesheet" type="text/css"/>

<xsl:if test="$startEntry > 0">
<meta name="robots" content="noindex,follow"/>
Expand Down Expand Up @@ -51,7 +51,7 @@
</xsl:template>
<xsl:template name="bodylogo">
<a href="/">
<img src="/themes/img/php-planet.png" width="275" height="70" hspace="30" alt="Planet PHP" title="Planet PHP" border="0"/>
<img src="/themes/planet-php/img/php-planet.png" width="275" height="70" hspace="30" alt="Planet PHP" title="Planet PHP" border="0"/>
<!-- <img src="http://www.liip.ch:2001/php-planet.png" width="275" height="70" hspace="30" alt="Planet PHP" title="Planet PHP" border="0"/>-->
</a>
</xsl:template>
Expand Down Expand Up @@ -97,11 +97,11 @@ Twitter account by <a class="inlineBlogLink" href="http://sepehr.ws/">Sepehr Laj
<div class="buttons">
<fieldset>
<legend>Buttons</legend>
<img width="80" height="15" src="/themes/img/planet-php-button-1.jpg" alt="Planet PHP"/>
<img width="80" height="15" src="/themes/planet-php/img/planet-php-button-1.jpg" alt="Planet PHP"/>
&#160;
<img width="80" height="15" src="/themes/img/planet-php-button-2.jpg" alt="Planet PHP"/>
<img width="80" height="15" src="/themes/planet-php/img/planet-php-button-2.jpg" alt="Planet PHP"/>
<br/>
<img width="80" height="15" src="/themes/img/planet-php-button-3.jpg" alt="Planet PHP"/>
<img width="80" height="15" src="/themes/planet-php/img/planet-php-button-3.jpg" alt="Planet PHP"/>
</fieldset>
</div>

Expand Down