Jump to content

jpopuk

Members
  • Posts

    64
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

jpopuk's Achievements

Member

Member (2/5)

1

Reputation

  1. That worked great. Thank you very much
  2. Issue solved! Next point is, how do I add additional GROUPS ID: <?php echo $user_data['group_id'] == GROUPS_ADMIN ? I want to add GROUPS_MOD and GROUPS_MEMBER
  3. As I mentioned I tried that but to no effect. Is there a way that the content section can be inserted in another way? <?php echo $user_data['group_id'] == GROUPS_ADMIN ? 'content' : ''; ?> Something like? .... <?php echo $user_data['group_id'] == GROUPS_ADMIN ?) { ?> content <?php : ''; ?> } ?> I have tried this but it did not work. If anyone has a suggestion that would be great. Thanks
  4. I don't think the function is any relevance to the issue I am having. I just need to figure out how I can activate PHP with the ' content ' part of the script. HTML is fine, and as I mentioned you simply add a backwards slash in front of an apostrophe. But when doing this for PHP it just causes an error.
  5. function get_url($page_url, $category_id, $info_id = '', $info_name = '', $default_page = 0) { return $page_url . (array_key_exists($category_id, $GLOBALS['categories']) ? get_url_tidy($GLOBALS['categories'][$category_id]['category_name']) . '-' . $category_id . '/' : '') . ($info_id != '' && $default_page == 0 ? get_url_tidy($info_name) . '-' . $info_id . '.htm' : ''); } Haha, sorry! This is the get_url function:
  6. It looks exacrly like this: <?php echo $user_data['group_id'] == GROUPS_ADMIN ? '<br /> <script type="text/javascript" src="/ckeditor/ckeditor.js"></script> <form method="post" action="<?php echo get_url(\'/products/\', $product[\'category_id\'], $product[\'product_id\'], $product[\'product_name\']); ?>?action=review"> <input type="hidden" name="info_id" value="<?php echo $product[\'product_id\']; ?>" /> <h4>Review Product</h4> <fieldset> <p align="center">Fields marked with a <span class="important">*</span> are required. </p> <p>Please note, you must be registered to post a product review.</p> <table border="0" cellpadding="3" cellspacing="1"> <tr> <td valign="top">Review: <span class="important">*</span></td> <td><textarea name="review" cols="20" rows="5"></textarea> <script type="text/javascript"> CKEDITOR.replace( \'review\', { uiColor: \'#000000\', toolbar: [ [ \'Bold\', \'Italic\', \'Underline\' ], [ \'Cut\', \'Copy\', \'Paste\', \'-\', \'Undo\', \'Redo\' ], [ \'Link\', \'Unlink\' ] ], height: 100, width: 400, }); </script></td> </tr> <tr> <td><a href="javascript:;" onClick="sendGetRequest(\'/includes/get_captcha.php\', \'CaptchaContainer\');">Reload image</a></td> <td><div id="CaptchaContainer" style="height: 32px;"><?php require_once(\'../includes/get_captcha.php\'); ?></div></td> </tr> <tr> <td>Security Code:</td> <td><input type="text" name="code" /> <img src="/images/q-mark.gif" alt="Please enter the values shown above (case insensitive)" title="Please enter the values shown above (case insensitive)" width="15" height="15" /></td> </tr> </table> </fieldset> <p align="center"><input type="submit" name="submit" value="Submit Review" /></p> </form>' : ''; ?>
  7. Thanks for quick response but have tried that. I know that within the content section when using a ' you have to put a backwards slash in front of it to enable the HTML. Not quite sure how to do it with PHP though?
  8. Hi, first of all I am trying to do a section hidden from guests on a website. I have groups for each user (groups_admin, _mod, _member etc.) I have it so ADMIN only view content at the moment, but not sure how to add GROUPS_MOD & GROUPS_MEMBER: <?php echo $user_data['group_id'] == GROUPS_ADMIN ? 'content' : ''; ?> Secondly, where the content section is, I have HTML placed inside it which works fine, but it also has some PHP code. How would I get it so the php code works? This is what I have... <?php echo $user_data['group_id'] == GROUPS_ADMIN ? '<form method="post" action="<?php echo get_url(\'/products/\', $product[\'category_id\'], $product[\'product_id\'], $product[\'product_name\']); ?>?action=review">' : ''; ?> As you can see the form action line has a php url to generate the relevant link for a specific product. If anyone has any suggestions or can help in any way that would be much appreictaed. Cheers, Paul
  9. The options are pulled in from a database so the array part would not be the way to go for me. I have tried this: <option value="<?php echo $post['ad_type']; ?>"<?php echo $post['ad_type'] == $post['ad_type'] ? ' selected="selected"' : ''; ?>><?php echo $post['ad_type']; ?></option> But this did not work.
  10. Hi, I have setup a little post function where you can edit it. When the data has been submitted it sends all data to a database. When I go to edit a post this is how I have each dropdown to load the correct option: <select name="ad_type"> <option selected="selected"><?php echo $post['ad_type']; ?></option> <option>-- Please Select --</option> <option value="For Adoption">For Adoption</option> <option value="For Sale">For Sale</option> </select> How would I do it so it would automatically select the correct option rather than having it add another option at the top? Thanks
  11. Thanks. I have set tables up already so just seeing if possible to do so. I do have a little function to get the data. Is it possible to do a function inside an array? i.e. $acura = array('foreach (get_make_acura() as $macura) { echo $macura['acura_name']; }');
  12. Fastsol, I am having a crack at your tutorial and I have hit a snag. I need to pull data from tables. In the comments part you have put a bit saying to pull the Model FROM cars WHERE model = $model. How would I do it so each selection has gets data from a different table ?
  13. I have a small bit of jquery code that is not working: $(function() { $(‘’[name=\'pet_type\']”).change(function() { $(‘’[name=\'breed\']”).removeAttr(‘disabled’); $(‘’[name=\'breed\']”).children(‘data-pet-type[name!=\'’ + $(this).val() + ‘\']’).hide(); $(‘’[name=\'breed\']”).children(‘data-pet-type[name=\'’ + $(this).val() + ‘\']’).show(); }); }); My javascript is not good at all, so cannot spot errors? Any help would be much appreciated! Thanks
  14. Thanks for reply guys. Fastsol - your tutorial looks pretty much what I am looking for. In need of sleep now so will get on the case in the morning. Hoping it will be straight forward to do with the database! Again thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.