I need a peice of code to let users display graphics

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • shanni
    Corporal

    • Feb 2008
    • 15

    I need a peice of code to let users display graphics

    Hello

    Im using PHPizabi for Social Networking in which Vodahost is hosting. I have been Modifying the codes etc..... to add extra features for members to use. What I want to add 'Comment graphics' here is this scenario: 'When a user wants to add a comment to anothers users Blog, Article, etc... by placing a code that will display something like this:
    HTML Code:
    <a title="MySpace Graphics" href="http://1uo.net"><img border="0" src="http://img1.my-spacelayouts.net/1uo/disney/16.gif" alt="MySpace Graphics"></a><div style="position:absolute;right:0px;top:0px;width:88px;height:31px;"><a title="MySpace Graphics" href="http://1uo.net" target="_self"><img src="http://img1.my-spacelayouts.net/buttons/1uo.gif" border="0" alt="MySpace Graphics"></a></div><div style="position:absolute;left:20px;top:20px;width:300px;height:300px;"><a title="MySpace Graphics" href="http://1uo.net" target="_blank"><img src="http://img1.my-spacelayouts.net/buttons/trans.gif" width="300" height="300" border="0" alt="MySpace Graphics"></a></div>
    Then when its saved it should display a picture. Much like on Myspace.

    I also need a code to display bbcodes ......

    If you can help this would be great and Thanks in advance. My site is www.yapidi.com if you need to view it to see what I mean.

    [IMG]file:///C:/DOCUME%7E1/Owner/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG]
    Social/business Networking
    www.yapidi.com



    Get YOUR Teeth into something new!!!!
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: I need a peice of code to let users display graphics

    If this is an example of what you are tying to use on your site
    [IMG]file:///C:/DOCUME&#37;7E1/Owner/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG]

    The image has to be online, not on a local computer. It has to be something liek



    If it doesn't have the feature of using BB code, or doesn't have images with the bb code then its a matter of editing the existing bb function or creating one. Implementing bb code into a script is not something that can be easily explained on the forum (I don't know how much experience you have writing php code but unless you have a fair amount of experience its not going to make sense). If there is already bb code and images just are not included, if you can find the function and you post it I can edit it for you.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    • shanni
      Corporal

      • Feb 2008
      • 15

      #3
      Re: I need a peice of code to let users display graphics

      No no I know that, I was testing to see if the Image would show on here.. etc.. but it didnt I meant to delete that part.....



      Okay..... I will see what I can do thanks for that!
      Social/business Networking
      www.yapidi.com



      Get YOUR Teeth into something new!!!!

      Comment

      • shanni
        Corporal

        • Feb 2008
        • 15

        #4
        Re: I need a peice of code to let users display graphics

        Okay, I dont have much PHP coding skills, Im learning it..... Slowly.....

        I have found this code in my settings.php file, Is this the one Im supposed to have?
        PHP Code:
        /* Populate the html_comments */
            
        if (!isset($mySettings)) $mySettings unpk(me("settings"));
            if (!
        is_array($mySettings)) $mySettings = array();

            
        $tpl -> AssignArray(array(
            
        "html.comments" => (isset($mySettings["COMMENTS"]["HTML_COMMENTS"]) ? $mySettings["COMMENTS"]["HTML_COMMENTS"] : "Yes"),
            ));


            
        $tpl -> Flush(); 
        Social/business Networking
        www.yapidi.com



        Get YOUR Teeth into something new!!!!

        Comment

        • Watdaflip
          Major General

          • Sep 2005
          • 2116

          #5
          Re: I need a peice of code to let users display graphics

          No thats not it. Check whatever page loads when you submit the form to add a comment.

          Register/Login Script
          Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

          Comment

          • shanni
            Corporal

            • Feb 2008
            • 15

            #6
            Re: I need a peice of code to let users display graphics

            Okay, I was originally thinking that, but then I saw that code and thought, Maybe it was it....

            Here is the script from the myself.php file, this is the file where Users will place their Data.

            PHP Code:
            /* Check Structure Availability */
                
            if (!defined("CORE_STRAP")) die("Out of structure call");
                
                
                
            $tpl = new template;
                
            $tpl -> Load("myself");
                
            $tpl -> GetObjects();
                
                
                if (
            me("id")) {
                    
                    
            $tpl -> Zone("main""enabled");
                    
                    
            /* Load the questionaires list */
                    
            $uDat unpk(me("profile_data"));
                    if (
            $handle opendir("system/cache/questionnaires")) {
                        
            $i=0;
                        while ((
            $file readdir($handle)) !== false) {
                            if (
            $file != "." && $file != "..") {
                                
            $qName base64_decode(str_replace(".dat"""$file));
                                
            $questionaires[$i]["questionaire"] = $qName;
                                
            $questionaires[$i]["id"] = str_replace(".dat"""$file);
                                
            $questionaires[$i]["filled"] = (isset($uDat[$qName])?$GLOBALS["OBJ"]["filled"]:$GLOBALS["OBJ"]["unfilled"]);
                                
            $i++;
                            }
                        }
                        
            closedir($handle);
                        
            $tpl -> Loop("questionaires"$questionaires);
                   }
                   
                   
                    
            /* 
                        Handle the submitted user data
                    */
                    
            if (isset($_POST["submitUserData"])) {
                        
                        
            $previousZipcode me("zipcode");
                    
            $bdArray me("birthdate");
                    
            $bdArray explode("/"$bdArray);
                    
            myQ("
                            UPDATE `[x]users` SET
                                `quote`='
            {$_POST["quote"]}',
                                `header`='"
            .strip_tags($_POST["header"])."',
                                `city`='
            {$_POST["city"]}',
                                `state`='
            {$_POST["state"]}',
                                `country`='
            {$_POST["country"]}',
                                `zipcode`='
            {$_POST["zipcode"]}',
                                `gender`='
            {$_POST["gender"]}',
                                `birthdate`='
            {$_POST["bmonth"]}/{$_POST["bday"]}/{$_POST["byear"]}',
                                `astrologic_sign`='',
                                `age`='"
            ._fnc("age""{$_POST["bmonth"]}/{$_POST["bday"]}/{$_POST["byear"]}")."' WHERE `id`='".me("id")."'
            "
            ).
                        
                        
                        
            me("flush");
                        
                        if (
            $previousZipcode != $_POST["zipcode"] && $CONF["GEOLOC_STRAPON_ZIPCHANGE"]) _fnc("geoLocalize"me("id"));
                    }
                    

                    
            /* find out the user's astrologic sign */
                    
            switch ($bdArray[0]) {
                        case(
            1):
                            
            $sign = ($bdArray[1] <= 19?"capricorn":"aquarius");
                        break;
                        case(
            2):
                            
            $sign = ($bdArray[1] <= 19?"aquarius":"pisces");
                        break;
                        case(
            3):
                            
            $sign = ($bdArray[1] <= 20?"pisces":"aries");
                        break;
                        case(
            4):
                            
            $sign = ($bdArray[1] <= 20?"aires":"taurus");
                        break;
                        case(
            5):
                            
            $sign = ($bdArray[1] <= 21?"taurus":"gemini");
                        break;
                        case(
            6):
                            
            $sign = ($bdArray[1] <= 22?"gemini":"cancer");
                        break;
                        case(
            7):
                            
            $sign = ($bdArray[1] <= 23?"cancer":"leo");
                        break;
                        case(
            8):
                            
            $sign = ($bdArray[1] <= 23?"leo":"virgo");
                        break;
                        case(
            9):
                            
            $sign = ($bdArray[1] <= 23?"virgo":"libra");
                        break;
                        case(
            10):
                            
            $sign = ($bdArray[1] <= 24?"libra":"scorpio");
                        break;
                        case(
            11):
                            
            $sign = ($bdArray[1] <= 22?"scorpio":"sagittarius");
                        break;
                        case(
            12):
                            
            $sign = ($bdArray[1] <= 22?"sagittarius":"capricorn");
                        break;
                    }
                
                    
            myQ("UPDATE `[x]users` SET `astrologic_sign`='{$sign}' WHERE `id`='".me('id')."'");


                    
                    
            /*
                        Handle a password change post.
                    */
                    
            if (isset($_POST["changePassword"])) {
                        
                        
            /*
                            Does the ACTUAL password matches the password
                            we have in the database? (We want to prevent 
                            "floating" (open sessions) users to change the
                            password of another user with that function.
                        */
                        
            if (md5($_POST["actualPassword"]) == me("password")) {
                
                            
            /*
                                Is the password len longer than the minimum
                                allowed len?
                            */        
                            
            if (strlen($_POST["newPassword"]) > $CONF["USERS_PASSWORD_MIN_LEN"]) {
                                
                                
            /*
                                    Is there any SPACE characters in the password?
                                */            
                                
            if (!strpos($_POST["newPassword"], " ")) {
                                
                                    
            /*
                                        Do both the password and password verification
                                        fields value the same?
                                    */
                                    
            if ($_POST["newPassword"] == $_POST["confirmPassword"]) {
                                        
                                        
            /*
                                            Everything is confirmed. Let's update the password
                                            entry for that user
                                        */
                                        
            myQ("UPDATE `[x]users` SET `password`='".md5($_POST["newPassword"])."' WHERE `id`='".me("id")."'");
                
                                        
            $tpl->Zone("passChangeMessage""success");
                
                                    } else 
            $tpl->Zone("passChangeMessage""noMatch");
                
                                } else 
            $tpl->Zone("passChangeMessage""badFormat");
                
                            } else 
            $tpl->Zone("passChangeMessage""tooShort");
                
                        } else 
            $tpl->Zone("passChangeMessage""wrongPass");
                    }
                    
            ///////////////////////////// Age, Sex hack by Thunder /////////////////////////////////////
                
            $genders explode(","$CONF["USERS_GENDERS"]);

                
            $selectedGender me("gender");

                
            $i=0;
                foreach (
            $genders as $genderType) {

                    if (
            $genderType == $selectedGender){$genderReplacementArray[$i]["gender.option"] = "<option SELECTED value='$genderType'>$genderType</option>";$newGender=$genderType;}
                    else 
            $genderReplacementArray[$i]["gender.option"] = "<option  value='$genderType'>$genderType</option>";
                    
            $i++;
                }
                
            $tpl -> Loop("genderOptionDropdown"$genderReplacementArray);


                
            $bdArray me("birthdate");
                
            $bdArray explode("/"$bdArray);
                
            $tpl -> AssignArray(array(
                
            "birth.month"=>$GLOBALS["OBJ"]["month_{$bdArray[0]}"],
                
            "bmonth" => $bdArray[0],
                
            "bday" => "<option SELECTED value='{$bdArray[1]}'>{$bdArray[1]}</option>",
                
            "byear" => "<option SELECTED value='{$bdArray[2]}'>{$bdArray[2]}</option>"
                
            ));

            ///////////////////////////// Age, Sex hack by Thunder /////////////////////////////////////        
            $tpl -> AssignArray(array(
                        
            "me.quote" => me("quote"), 
                        
            "me.header" => me("header")
                    ));
                    
                    
            $tpl -> ConvertSelf();
                
                }
                
                else {
                    
            $tpl -> Zone("main""guest");
                    
            _fnc("reload"3"?L");
                }
                    
                
            $tpl-> CleanZones();
                
            $tpl -> Flush();
                
            ?> 
            Am I wrong?
            Social/business Networking
            www.yapidi.com



            Get YOUR Teeth into something new!!!!

            Comment

            • Watdaflip
              Major General

              • Sep 2005
              • 2116

              #7
              Re: I need a peice of code to let users display graphics

              Its not the right file, view the source for the the comment page and open the file that is the action for the comments form. If that is the page then I can't really say for sure where its at, send me an email if thats the case (my email is this username ******.com)

              Register/Login Script
              Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

              Comment

              Working...
              X