Please Delete

Avatar

By xQu 22 April 2015 17:11

Member · 11 comments

Please delete.

Last edited by xQu (22 April 2015 19:08)

Avatar

By CaerCam 22 April 2015 17:33

Member · 54 comments

I'm planning to write a PHP Class for the core to fully handle notifications, I'll take what you did (and what you plan to do) into consideration so you can use that when it's done 🙂

Avatar

By Yannick 22 April 2015 17:33

Administrator · 1,434 comments

I tried to use it, but I can only get an "error" out of it. Which is vague by the way. Anyway, for as far as I've taken a look at it, this is what I would suggest:

- Extened the details of errors
- Indeed, add the ability to choose an Icon, keep in mind that all Font Awesome and Lunicons are available to this system by default
- If you can only choose 1 user, only allow to choose one user, make it a dropdown or a search field, but don't allow multiple users to be selected when that can't be done
- Replace your hardcoded database prefix with $db->prefix
- Don't show the guest user in the list of users, they can't get notifications
- Make sure the script can only be executed by the people that filled in the form, use a confirm_referrer()
- Be a little bit consistent with the general Backstage interface:
-- Put that "Send" button in the panel heading
-- Use vertical forms, build-in in Bootstap, and they are used on prety much every page in the Backstage and the profile settings
-- Use an icon for the send button
- And last but not least: submit to the Luna Plugins repository

This code should address the feedback I gave on your interface and the multiple user select issue:

<div class="row">
	<div class="col-sm-3">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><?php echo $lang_nm['Changelog'] ?></h3>
			</div>
			<div class="panel-body">
				<p><b>0.1</b></p>
				<p>-The baby was born!</p>
			</div>
		</div>
	</div>

	<div class="col-sm-9">
		<form class="form-horizontal" id="settings" method="post" action="<?php echo luna_htmlspecialchars($_SERVER['REQUEST_URI']) ?>&amp;foo=bar">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title"><?php echo $lang_nm['Name'] ?><span class="pull-right"><button type="submit" class="btn btn-primary pull-right" name="submit" tabindex="2"><span class="fa fa-fw fa-send"></span> <?php echo $lang_nm['Send'] ?></button></span></h3>
				</div>
				<div class="panel-body">
					<div class="form-group">
						<label class="col-sm-3 control-label"><?php echo $lang_nm['Notification'] ?></label>
						<div class="col-sm-9">
							<input type="text" class="form-control" placeholder="Text" name="connotify">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"><?php echo $lang_nm['Link'] ?></label>
						<div class="col-sm-9">
						<input type="text" class="form-control" placeholder="Link" name="link">
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"><?php echo $lang_nm['Select User'] ?></label>
						<div class="col-sm-9">
							<select class="form-control" name="user_select">
<?php
	while ($user_data = $db->fetch_assoc($result))
		  echo '<option value="'.$user_data["id"].'"> '.$user_data["username"].' | ID: '.$user_data["id"].' </option>';
?>
							</select>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>

And for the language files:

<?php

// Language definitions used in example Plugin
$lang_nm = array(

'Name'				=>	'NotifyManager 0.1',
'Changelog'			=>	'Changelog',
'Select User'		=>	'Select user',
'Notification'		=>	'Notification',
'Link'				=>	'Link after clicking',
'No text'			=>	'Enter a text!',
'No user'			=>	'Select a user!',
'Send'				=>	'Send',
'Success send'		=>	'Success send notification: ',
'to'				=>	' to ',

);

You can do anything

Avatar

By xQu 22 April 2015 18:49

Member · 11 comments

Since the CaerCam will add such features, it does not make sense to develop further extension. He has much more experience. I'll be creating styles. 😉
I am a newbie and "play with php" 🙂

Thanks for the suggestions. I think you can delete the thread. Too much trouble.

(sorry for my eng..)

Avatar

By Yannick 23 April 2015 06:15

Administrator · 1,434 comments

Please restore your original post.


You can do anything