Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 49
  1. #31
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    i have a jquery one in work thats great for this kind of thing.

    will see if i can find all the files or the tutorial i used
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  2. #32
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  3. #33
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    No, I want it more like a box you click and it brings up a list of users for you to select from.

  4. #34
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    you could have javascript open a popup window with a list of users and have it close and populate the parent page when clicking on a username
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  5. #35
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Yeah that's what I want, no idea where to start though.

  6. #36
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    window link:

    PHP Code:
    <a href="javascript:openWinNav()">Select User</a
    javascript:
    Code:
    <script type="text/javascript">
        function openWinNav() {
        win2 = window.open("userselect.php", "Navigation","width=1000,height=300,scrollbars=no,status=no");
    }
    </script>
    contents of userselect.php

    PHP Code:
    // you can set a hidden field if you dont want people to edit the reply from here
    $query Q("SELECT * FROM users");
    $Head .= '<script language="javascript">
    function SubmitPage(id,name) {
        window.opener.document.getElementById(\'UserID\').value = id;
        window.opener.document.getElementById(\'UserName\').value = name;
        window.opener.document.getElementById(\'UserName\').focus();
        this.close();
    }
    </script>'
    ;

    while (
    $row mysql_fetch_array($query)) {

    echo 
    $row['Username'].'<input type="button" name="Select" value="Select" onClick="SubmitPage(\''.$row['UserID'].'\',\''.$row['Username'].'\')">';
            } 
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  7. #37
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Fatal error: Call to undefined function q()
    I'm now getting the above error on the line below.

    PHP Code:
    $query Q("SELECT * FROM users"); 

  8. #38
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    sorry Q() is my database function, that needs to be your database query

    yours looks something like

    PHP Code:

    $sql
    ="SELECT * FROM users";
    $result=mysql_query($sql); 
    if you would like it, put this at the bottom of your config file then you can use Q() too

    PHP Code:

    function Q($query) {
        
    $Username $db_user;
        
    $Password $db_pass;
        
    $Database $database;
        
    $Host $server;
        global 
    $queries$queries_time$queries_count;
        
    $queries_count++;
        
    mysql_connect($Host$Username$Password) or die ( 'Unable to connect to the server.<br>' );
        
    mysql_select_db($Database) or die ( 'Unable to select the database.<br>' );
        
    $queries .= 'Line <b>'__LINE__ '</b> of file <b>' .__FILE__ '</b> requested <b>' $query '</b>';
        
    $time_overall round(microtime(),4);
        if (!
    $result mysql_query($query))    {
            echo 
    '<pre>Error on line <b>'__LINE__ '</b> of file <b>' __FILE__ '</b> requesting <b>' $query '</b></pre><br>';
            
    $queries .= ' <b>ERROR OCCURED</b><br>';
        } else {
            
    $queries .= '<br>';
        }
        
    $time2_overall round(microtime(), 4);
        
    $gen_overall $time2_overall $time_overall;
        
    $queries_time substr($queries_time $gen_overall,0,6) ;
        
    mysql_close() or die ( 'Unable to disconnect from the server.<br>' );
        return 
    $result;

    Last edited by Arcticwarrio; 03-19-2013 at 08:53 PM.
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  9. #39
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Can't get that to work for me.

  10. #40
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    I got it to show the list of users but it doesn't pull the name down to the 'To' box on the message form.

  11. #41
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    in the javascript


    Code:
    function SubmitPage(id,name) {
        window.opener.document.getElementById(\'UserID\').value = id;
        window.opener.document.getElementById(\'UserName\').value = name; //this is the name of the TO field UserName
        window.opener.document.getElementById(\'UserName\').focus();
        this.close();
    }
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  12. #42
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    I've changed that to the name of the 'TO' box and still nothing.

  13. #43
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    if you dont have a hidden UserID take that line out
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  14. #44
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Nope still not working.

  15. #45
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    I'm still stuck with this. Can anyone help me?


 
Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •