/    Sign up×
Community /Pin to ProfileBookmark

Recruitment box – $_GET and others

Firstly, look at [url]http://dannyp2.ifastnet.com[/url]
There is a box on the right that says, “Vacancies; Jedi Knight Here!”, etc.

What I aim to do, is replace that text with an image I have already created.
That image will essentially have a blue colour scheme when there are vacancies, along with a dynamic number that changes based on the number of vacancies (not sure how I’ll manage the number of vacancies yet).

I have a script that I used when creating a custom forum theme, where phpBB3 had a text link for messages, I altered this to an image with a dynamic value that took it’s value from the users new messages count.

I want this to do exactly the same, but also swap the blue image to a red image when the value is 0 and display “Full” (if possible).

The script I used for the forums was:
To call the image with a count based on new messages. {S_USER_NEW_PRIVMSG} being a predefined phpBB3 function.

[code]
<img src=”{T_THEME_PATH}/messages.php?count={S_USER_NEW_PRIVMSG}” />
[/code]

Messages.php that does all the work:

[code]
<?php
$new_pms = (isset($_GET[‘count’])) ? (int) $_GET[‘count’] : 0;
//load image
$im = imagecreatefromgif(‘images/icon_messages.gif’);

//Font type
$font = imageloadfont(‘verdana.ttf’);

//figure out where to put the text
$imagesize = getimagesize(‘icon_messages.gif’);
$x_offset = 23;
$y_offset = 2;

//allocate text color
$textcolor = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);

//write out the watermark
imagestring($im, 3, $x_offset, $y_offset, $new_pms, $textcolor);

//output watermarked image
header(‘Content-type: image/gif’);
imagegif($im);

?>
[/code]

Hope I explained what I was aiming for well enough. A suggestion as to how to manage the vacancy number would also be appreciated. The site does not support sessions other than a simple officer session that is being made redundant with another method I am employing.

The officer function allowed you to login, look at new application forms submitted to a normal database table (without the need to condense to one column), and an admin would look at the application (it could be viewed through the website after login) and click accept or decline to send an email (The application wasn’t removed though, so not a complete script).

I could suggest that the officer section employs a table that submits the vacancies to a database, then if possible, the first code link somehow gets the value from that database, although I am not sure how given the image I used before to get a count.

Thank you in advance.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Magnacarta spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...