Jump to content

quickjeff

Members
  • Posts

    323
  • Joined

  • Last visited

Everything posted by quickjeff

  1. Okay, with some help from other members here, I currently am displaying a link to the page the user is assigned to edit inside of their account manager page. <?php foreach($user->editable_pages as $aPage){ echo "<li><a href='$aPage->url'>$aPage->title</a></li>"; } ?> I would like to also add a button for them to be able to delete the page. Any help on this? I have searched the API and not sure what would work best.
  2. Kongondo, yea sorry about that guys. I got a little post happy! I would find a post related to what I needed help with and would post my questions. Next time I will post in the correct areas as well as not double post. I will study further the API and see what I come up with. Ultimately I would like to recreate the delete button and functionality of the button but only for the front editor. Im sure I can figure it out. Thanks for the guidance!
  3. In their profile page where they can edit their password. I allow users to post new pages and currently have them edit their own pages posted via fredi front end editor module. Any light on giving a user the ability to unpublish, publish or delete their posted page? Perhaps a check mark with a submit or simply a button that allows this. Basically how an admin would publish, unpublish or delete pages now only difference, its only the page a user is assigned to edit through the front end. Any help is appreciated.
  4. Thanks but not sure if this will help me. I need to give front end user role the ability to un publish, publish or delete their page if needed. Perhaps a check mark or button that allows them submit these changes.
  5. In regards to this post, is there a way to give a role called frontend_editor a way to unpublish, republish and delete while keeping the page hidden from lists and searches as I have it now in the admin. I have certain pages assigned to users with the frontend_editor which they have access to edit. Any guidance?
  6. Hi Guys, Im at a point in my project where I have front end user registration, login capabilities and posting of page capabilities by registered users. The users can also edit their own page. Its pretty much a clean site that is made to function like Craigs list but look like a personal ad site. I have used ryans method for registration, profile control and login. All is good so far! Now in profile template which I call their account management page, a user sees all their pages they have posted. The user can click the link to their page to front end edit their pages content. I would like to also give them ability to unpublish, republish or delete their page. Any thoughts or ideas? The way I invision it, a script checks to see if the user has access to edit the page, which I have done. Then the user can edit via fedI front end editor module. Now I need to display a button unpublish, a button to republish and a button to delete. Any guidance is appreciated.
  7. Haha, MindFull no worries. The code didn't work. I added it to a form-builder.inc file and figured it would work . No luck, I guess I have to keep thinking of something unless you think of something else. Thanks!!
  8. Great! Thanks again for the help! Now, implementing this into the form builder form, would I create a form builder.inc file? I ask because I have 5 categories and 5 different form builder forms building pages.
  9. Wow, I spoke too soon. I get the error message showing properly no, no more server error nasty page. I simply uploaded your code as a test. I get an error message in the footer since I have a link in the footer that changes logout when a user is logged in. I cannot login period, when I do enter the correct credentials. Here is what I have: <?php if($input->get->logout == 1) { $session->logout(); $session->redirect("./"); // start them on a fresh page, or redirect to another } ?> <?php include("./head.inc"); ?> <div class="row supersize"> <div class="medium-12 columns"> <div class="medium-4 columns"> <p> </p> </div> <div class="medium-4 columns"> <h1><?echo $page->title;?></h1> <?php /** * Login template * Based on a forum contribution by Ryan, can't locate it, but the are many examples of login forms. * */ if($user->isLoggedin()) { // user is already logged in, so they don't need to be here $session->redirect($config->urls->root); } // check for login before outputting markup if($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; try{ $u = $session->login($username, $pass); if($u && $u->id){ $session->redirect("/somepage/"); } } catch(Exception $e) { echo $e->getMessage(); } } ?> <p><?php if($input->post->user) echo "<div class='alert alert-error'>Username and or Password is incorrect!</div>"; ?></p> <form class="" action='./' method='post'> <label style="color:#fff;" for="user">Username</label> <input type="text" name="user" id="user" placeholder="Enter your username"> <label style="color:#fff;" for="pass">Password</label> <input type="password" name="pass" id="pass" placeholder="Enter your password"> <label></label> <button type="submit" name="submit" class="btn btn-primary">Submit</button> </form> <p>Forgot password? <a href='/forgot-password'>Reset here.</a></p> </div> <div class="medium-4 columns"> <p> </p> </div> </div> </div> <?php include("./foot.inc"); ?>
  10. @Ryan, do you know how I can prevent an internal server error that shows with all white screen. Basically, I created your front end login. However, if you attempt to login two times with incorrect password it throws the server error. If you login one time with incorrect values, it will toss the wrong user name message. I feel as if it's trying to display the must wait 60 seconds to login like a back end admin and cannot find it since it's a front end login. How can I fix this so I don't get the server error?
  11. @Mindfull in response: my problem is the API, as I'm not that familiar with it to make it work with my wishes, yet. I'm sure I'll get there. But yes the payment will be the last step. Right now I just made the registration form, users can now register and they are automatically given a front editor role. Now here is my new dilemma, I am going to add an if statement at the top of the posting ad page. To only show the page if the user is logged in or redirect them to login or register for posing privileges. When they are logged in, they can visit the posting page. Here they select a category to post in, that category will direct them to a category page with a form builder iframe form. Right now I am using form builder to build pages. I need help creating a way to auto assign the user to the page they just created through form builder. By auto assign I mean editing privileges. Note: I already setup editing privileges on a per user per page basis. Through the module. So the role frontend-editor has ability to edit pages I manually assign to it. This is where I want to make it automatic. Any help? Thanks again to everyone who has helped me walk over this bridge, I'm almost there!
  12. Wow, this is great stuff. Thanks so much!!! I will give it a try.
  13. @mindfull I have the registration for created and it works in which they are automatically assigned frontend-editor as a role. After a user registers, they are presented with a form builder embedded form, here they can select a category to post a new page too. The form that creates a new page is by form builder as an iframe. This is where I need the help to assign editing privileges to the user that created the new page, but I want them to only be able to edit that page. Right now if we see the new user register, then submit a new page, we manually add them to edit that page. Any light on this?
  14. @kongondo , So I basically did what onjegolders did accept, I removed the system email to the admin. How would I go about taking the users username, possibly his password too and emailing him a welcome to blah blah blah here is your user name and password, to login go to www.example.com. Any guidance on this? Thanks. Here is the code: <?php include("./head.inc"); ?> <?php $headings = " <div id='register'> <div class='row'> <div class='medium-12 columns supersize'> <div class='medium-4 columns'> <p> </p> </div> <div class='medium-4 columns'> <h3>Register with us</h3>"; $form="<form action='./' id='registration' method='post'> <label for='username'>Username</label> <p class='help'>Please ensure your username contains no spaces</p> <input type='text' name='username' value='{$input->post->username}'> <label for='first_name'>First name</label> <input type='text' name='first_name' value='{$input->post->first_name}'> <label for='last_name'>Last name</label> <input type='text' name='last_name' value='{$input->post->last_name}'> <label for='email'>Email address</label> <input type='text' name='email' value='{$input->post->email}'> <label for='pass'>Password</label> <p class='help'>Please ensure your password is at least 6 characters long and contains at least one digit and one letter</p> <input type='password' name='pass' value='{$input->post->pass}'> <label for='pass_confirm'>Confirm password</label> <input type='password' name='pass_confirm' value='{$input->post->pass_confirm}'> <input class='button success small' type='submit' name='submit_registration' id='submit'> </form>"; $message = "Please fill in the form below if you would like to register in order to receive exclusive access to our brochures and latest information."; $usernames = array(); foreach ($users as $u) { $usernames[] = $u->name; } if($input->post->submit_registration) { if (empty($input->post->username) || empty($input->post->email) || empty($input->post->pass)) { $message = "Please fill out all fields marked with a *"; echo $headings; echo "<h5 class='error'>$message</h5>"; echo $form; } elseif (in_array($input->post->username, $usernames)) { $message = "Sorry, that username is already taken, please choose another."; echo $headings; echo "<h5 class='error'>$message</h5>"; echo $form; } elseif (filter_var($input->post->email, FILTER_VALIDATE_EMAIL) === FALSE) { $message = "Please include a valid email address"; echo $headings; echo "<h5 class='error'>$message</h5>"; echo $form; } elseif (!preg_match("/[0-9]/", $input->post->pass) || strlen($input->post->pass) < 6) { $message = "Please ensure your password has at least one digit and is at least 6 characters long"; echo $headings; echo "<h5 class='error'>$message</h5>"; echo $form; } elseif($input->post->pass !== $input->post->pass_confirm) { $message = "Please ensure that your passwords match"; echo $headings; echo "<h5 class='error'>$message</h5>"; echo $form; } else { echo $headings; $message = "Congratulations! You have successfully registered!"; echo "<h5 class='success'>$message</h5>"; echo "<h4><a href='/login' class='button'>LOGIN</a></h4>"; $u = new User(); $u->of(false); $u->name = $sanitizer->username($input->post->username); $u->first_name = $sanitizer->text($input->post->first_name); $u->last_name = $sanitizer->text($input->post->last_name); $u->email = $sanitizer->email($input->post->email); $u->pass = $sanitizer->text($input->post->pass); $u->addRole('frontend-editor'); $u->save(); $u->of(true); } } elseif ($user->isLoggedin()) { echo $headings; echo "<h5>No need to register " . $user->get('first_name|name') . ", you are already are! <a href='{$config->urls->root}'>Click here</a> if you would like to return to the homepage.</h5>"; } else { echo $headings; echo "<h5>$message</h5>"; echo $form; } ?> </div> <div class='medium-4 columns'> <p> </p> </div> </div> </div> <?php ?> <?php include("./foot.inc");
  15. Another question? If a user types in a user name with a space, it goes through, example johnny p it will go through with success. Any suggestions to restrict this?
  16. Awesome!!! I have it working!!! One step closer to my goal. Now, do you recommend sending the user an automatic email with their details? Or any way to avoid multiple user registrations aka spammers?
  17. I think I can use this, let me ask how can I automatically assign a role to the created user through the front end registration? I would like to assign them with frontend-editor Any light on this?
  18. Any way to create a registration form that automatically ads the user type as frontendeditor? Then when they create a new page via form builder they are assigned to the new page or any other new page they create. Any light on this guys?
  19. Yes but the budget is too low for the pricing he requires. :-(
×
×
  • Create New...