当前位置: 首页>>代码示例>>PHP>>正文


PHP showProfile函数代码示例

本文整理汇总了PHP中showProfile函数的典型用法代码示例。如果您正苦于以下问题:PHP showProfile函数的具体用法?PHP showProfile怎么用?PHP showProfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了showProfile函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sanitizeString

<?php

require_once 'header.php';
if (!$loggedin) {
    die;
}
echo "<div class='main'>";
if (isset($_GET['view'])) {
    $view = sanitizeString($_GET['view']);
    if ($view == $user) {
        $name = "Your";
    } else {
        $name = "{$view}'s";
    }
    echo "<h3>{$name} Profile</h3>";
    showProfile($view);
    echo "<a class='button' href='messages.php?view={$view}'>" . "View {$name} messages</a><br><br>";
    die("</div></body></html>");
}
if (isset($_GET['add'])) {
    $add = sanitizeString($_GET['add']);
    $result = queryMysql("SELECT * FROM friends WHERE user='{$add}'\nAND friend='{$user}'");
    if (!$result->num_rows) {
        queryMysql("INSERT INTO friends VALUES ('{$add}', '{$user}')");
    }
} elseif (isset($_GET['remove'])) {
    $remove = sanitizeString($_GET['remove']);
    queryMysql("DELETE FROM friends WHERE user='{$remove}' AND friend='{$user}'");
}
$result = queryMysql("SELECT user FROM members ORDER BY user");
$num = $result->num_rows;
开发者ID:ankit75,项目名称:myfb,代码行数:31,代码来源:members.php

示例2: elseif

        $tw = $w;
        $th = $h;
        if ($w > $h && $max < $w) {
            $th = $max / $w * $h;
            $tw = $max;
        } elseif ($h > $w && $max < $h) {
            $tw = $max / $h * $w;
            $th = $max;
        } elseif ($max < $w) {
            $tw = $th = $max;
        }
        $tmp = imagecreatetruecolor($tw, $th);
        imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tw, $th, $w, $h);
        imageconvolution($tmp, array(array('−1', '−1', '−1'), array('−1', '16', '−1'), array('−1', '−1', '−1')), '8', '0');
        imagejpeg($tmp, $saveto);
        imagedestroy($tmp);
        imagedestroy($src);
    }
}
showProfile($conn, $user, $fname);
echo <<<_END
</div>
<div class='right_panel'>
<form method='post' action='profile.php' enctype='multipart/form-data'>
<h3>Enter or edit your details and/or upload an image</h3>
<textarea name='text' cols='50' rows='3'>{$text}</textarea><br />
_END;
?>
Image: <input type='file' name='image' size='14' maxlength='32' />
<input type='submit' value='Save Profile' />
</form></div><br /></body></html>
开发者ID:sb0902,项目名称:LetsChat,代码行数:31,代码来源:profile.php

示例3: sanitizeString

    $text = sanitizeString($conn, $_POST['text']);
    if ($text != "") {
        $pm = substr(sanitizeString($conn, $_POST['pm']), 0, 1);
        $time = time();
        queryMysql($conn, "INSERT INTO `messages` VALUES(NULL, '{$user}',\n'{$view}', '{$pm}', {$time}, '{$text}')");
    }
}
if ($view != "") {
    if ($view == $user) {
        $name1 = $name2 = "Your";
    } else {
        $name1 = "<a href='members.php?view={$view}'>{$view}</a>'s";
        $name2 = $view;
    }
    echo "<div class='main'><h3> {$name1} Messages</h3>";
    showProfile($conn, $view, $fname);
    echo "</div>" . "<div class='right_panel' ><form method='post' action='messages.php?view={$view}'>\n\tType here to leave a message:<br />\n\t<textarea name='text' cols='40' rows='3'></textarea><br />\n\tPublic<input type='radio' name='pm' value='0' checked='checked' />";
    if ($view != $user) {
        echo "Private<input type='radio' name='pm' value='1' />";
    }
    echo "<input type='submit' class='button' value='Post Message' /></form><br />";
    if (isset($_GET['erase'])) {
        $erase = sanitizeString($conn, $_GET['erase']);
        queryMysql($conn, "DELETE FROM `messages` WHERE `id`={$erase} AND `recip`='{$user}'");
    }
    $query = "SELECT * FROM `messages` WHERE recip='{$view}' OR auth='{$view}' ORDER BY `time` DESC";
    $result = queryMysql($conn, $query);
    $num = $result->num_rows;
    for ($j = 0; $j < $num; ++$j) {
        $row = mysqli_fetch_row($result);
        if ($user == $view) {
开发者ID:sb0902,项目名称:LetsChat,代码行数:31,代码来源:messages.php

示例4: elseif

            $tw = $max;
        } elseif ($h > $w && $max < $h) {
            $tw = $max / $h * $w;
            $th = $max;
        } elseif ($max < $w) {
            $tw = $th = $max;
        }
        // resize the image
        $temp = imagecreatetruecolor($tw, $th);
        imagecopyresampled($temp, $src, 0, 0, 0, 0, $tw, $th, $w, $h);
        // image may blurred
        //imageconvolution($temp, array(array(-1,-1,-1),array(-1,16,-1),array(-1,-1,-1)), 8, 0); // sharpen the image
        imagejpeg($temp, $saveto);
        imagedestroy($temp);
        imagedestroy($src);
    }
}
showProfile($user);
echo "</div>";
// profile form
echo <<<_END
        <div class='display'>
        <form class='left' method="post" action="profile.php" enctype="multipart/form-data">
            <h4>Enter or edit your details and/or upload an image</h4>
            <textarea name="text" cols="50" rows="3">{$text}</textarea><br>
            Image: <input type="file" name="image" size="14">
            <input class="submit" type="submit" value="Save Profile">
        </form>
        </div>
_END;
include_once '../templates/footer.php';
开发者ID:njuliuyun,项目名称:studygroup,代码行数:31,代码来源:profile.php

示例5: showProfile

} else {
    print "\n";
    print "Feed record ok, not changing.\n\n";
}
print "\n";
print "Pinging hub {$sub->huburi} with new subscription for {$sub->uri}\n";
$ok = $sub->subscribe();
if ($ok) {
    print "ok\n";
} else {
    print "Could not confirm.\n";
}
$o2 = Ostatus_profile::staticGet('uri', $uri);
print "\n";
print "New profile state:\n";
showProfile($o2);
print "\n";
print "New feed state:\n";
$sub2 = FeedSub::ensureFeed($feedurl);
showSub($sub2);
function showProfile($oprofile)
{
    print "  Feed URL: {$oprofile->feeduri}\n";
    print "  Salmon URL: {$oprofile->salmonuri}\n";
    print "  Avatar URL: {$oprofile->avatar}\n";
    print "  Profile ID: {$oprofile->profile_id}\n";
    print "  Group ID: {$oprofile->group_id}\n";
    print "  Record created: {$oprofile->created}\n";
    print "  Record modified: {$oprofile->modified}\n";
}
function showSub($sub)
开发者ID:microcosmx,项目名称:experiments,代码行数:31,代码来源:update-profile.php

示例6: showProfile

<div class="main_content">
<?php 
include "leftwidget.php";
?>
<div class="center_table">
<table align="center" width="800" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<th scope="col"></th>
    </tr>
    <tr>
		<td>
<!-----------------------Server Side Scripting begins--------------------------->
				<?php 
if ($action == "showprofile") {
    showProfile();
} else {
    if ($action == "editprofile") {
        editProfile();
    } else {
        if ($action == "updateprofile") {
            updateProfile();
        } else {
            verify();
        }
    }
}
function verify()
{
    global $tname, $t;
    include "dbconnect.php";
开发者ID:vivekjaiswal90,项目名称:online-coding,代码行数:30,代码来源:profile.php

示例7: sanitizeString

if (!$loggedin) {
    die;
}
echo "<div class='container marketing'>\n        <div class='col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3'>";
echo "<div class='main'>";
echo "<ul class='menus'>" . "<li><a href='members.php'>Members</a></li>" . "<li><a href='messages.php'>Messages</a></li>" . "<li><a href='profile.php'>Edit Profile</a></li>" . "<li><a href='logout.php'>Log out</a></li></ul><br>";
if (isset($_GET['view'])) {
    $view = sanitizeString($_GET['view']);
    if ($view == $user) {
        $name = "Your";
    } else {
        $name = "{$view}'s";
    }
    echo "<h2>{$name} Profile</h2>";
    echo '<div id="pic">';
    echo showProfile($view) . '</div>';
    /*
    Getting individual rank of user from leaderboard
    @author 
    @date 17/04/2015
    @source http://stackoverflow.com/questions/1293817/mysql-get-users-rank
    */
    $database = mysql_connect('localhost', 'root', 'password') or die('Could not connect: ' . mysql_error());
    mysql_select_db('robinsnest') or die('Could not select database');
    $query = "\n      SELECT  uo.*, \n        (\n        SELECT  COUNT(DISTINCT ui.quiz_score)\n        FROM    members ui\n        WHERE   (ui.quiz_score, ui.id) >= (uo.quiz_score, uo.id)\n        ) AS rank\nFROM    members uo\n  WHERE user =  '{$user}';";
    $result = mysql_query($query) or die('Query failed: ' . mysql_error());
    $num_results = mysql_num_rows($result);
    while ($row = mysql_fetch_array($result)) {
        ?>
    
        <h2><?php 
开发者ID:kambalaa,项目名称:EDonation,代码行数:31,代码来源:members.php

示例8: mysql_query

    $result = mysql_query("select * from posts where email='{$email}'");
    $num = mysql_num_rows($result);
    if ($num == 0) {
        $x = "No posts yet!";
    } else {
        $x = "{$user}'s posts:";
    }
    echo "<h2 style=\"color:#123987\"; id=\"users_stat\">{$x}</h2>";
    for ($j = 0; $j < $num; $j++) {
        $row = mysql_fetch_row($result);
        echo "<div id='post'>{$row['2']}<div style=\"font-size:0.7em\";>Written on: {$row['3']}</div></div> <br>";
    }
    die;
}
echo "<span  class=\"user\"> {$user}</span> <br/>  ";
showProfile($id);
echo "<br/><br/><br/><br/>";
?>

Choose your profile pic:
 <form method='post' action='' enctype='multipart/form-data'>

 <input type='file' name='image' size='14' maxlength='32'  />
 <input type='submit' value='Upload' />
 </form><br><br>
 
<div id='posts'>
	Update Your Status:
	<form method='post' action='profile.php'> 
	<textarea name='text' cols='50' rows='3'></textarea><br>
	<input type='submit' />
开发者ID:manitejavarma,项目名称:warmani,代码行数:31,代码来源:profile.php

示例9: explode

<?php

include "../universal/config.php";
//---pageType---//
if (isset($_POST["showPage"])) {
    $resultArray = explode(":|:|:|:", pageType($_POST["q"]));
    $pageType = $resultArray[0];
    $match = $resultArray[1];
    //---showProfile---//
    if ($pageType === "profile") {
        include "showProfile.php";
        $result = showProfile($match);
        echo $pageType . ":|:|:|:" . $result;
    } elseif ($pageType === "project") {
        include "showProject.php";
        $result = showProject($match);
        echo $pageType . ":|:|:|:" . $result;
    } elseif ($pageType === "search") {
        include "showSearch.php";
        $result = showSearch($match);
        if ($result === "") {
            echo $pageType;
        } else {
            echo $pageType . ":|:|:|:" . $result;
        }
    } elseif ($pageType === "home") {
        echo "home";
    }
} elseif (isset($_POST["showList"])) {
    include "showList.php";
    if (isset($_POST["q"])) {
开发者ID:jamesbmayr,项目名称:project-tracker,代码行数:31,代码来源:pageForm.php

示例10: showRecommendations

function showRecommendations($jrec, $req)
{
    global $debugar;
    $content = '';
    $rec = objectToArray(json_decode($jrec));
    // Retrieve list of skills and qualifications
    $sysSkills = objectToArray(requestER('er/skills'));
    $sysQualif = objectToArray(requestER('er/' . STRING_SUBSKILLS));
    // Analyse the recommendations
    $content .= '<h2>Recommended experts:</h2>';
    // RAW
    if ($debugar) {
        $content .= '<p>Raw recommendation:<pre>' . print_r($rec, TRUE) . '</pre>';
    }
    // HTML
    $i = 1;
    $content .= '<ol id="recommendations">';
    $lastAssess = -1;
    foreach ($rec as $expert) {
        if ($lastAssess == $expert['assess']) {
            // Mantenemos el numero
            $ii = $iiAnt;
        } else {
            $ii = $i;
            $iiAnt = $ii;
            $lastAssess = $expert['assess'];
        }
        $txtClass = '';
        if ($i == count($rec)) {
            //$txtClass = ' class="clear"';
        }
        $content .= '  <li class="candidate" value="' . $iiAnt . '"' . $txtClass . '><strong>' . $expert['firstname'] . ' ' . $expert['lastname'] . '</strong> (' . $expert['department'] . ')<br />Assessment: ' . $expert['assess'] . '.';
        $content .= showProfile($expert, $req, $sysSkills, $sysQualif);
        // Mostramos sus habilidades
        //$content .= '  Skills:';
        $content .= '  </li>' . "\n";
        $i = $i + 1;
    }
    $content .= '</ol>';
    if (FALSE) {
        // Test: show the objects
        $content .= '<div class="debugInfo"><h2>Debug information:</h2>';
        //$content .= '<h3>Skills list</h3><pre>'.print_r($sysSkills, TRUE). '</pre>';
        //$content .= '<h3>Qualifications list</h3><pre>'.print_r($sysQualif, TRUE). '</pre>';
        $content .= '<h3 class="float">Raw requirements</h3><pre>' . print_r($req, TRUE) . '</pre>';
        $content .= '<h3 class="float">Raw recommendation</h3><pre>' . print_r($rec, TRUE) . '</pre>';
        $content .= '</div>';
    }
    return $content;
}
开发者ID:Peaso,项目名称:CER,代码行数:50,代码来源:client_functions.php

示例11: sanitizeString

<?php

include_once 'header.php';
if (!$loggedin) {
    die;
}
echo "<div class='main'>";
if (isset($_GET['view'])) {
    $view = sanitizeString($conn, $_GET['view']);
    if ($view == $user) {
        $name = "Your";
    } else {
        $name = "{$view}'s";
    }
    echo "<h3>{$name} Profile</h3>";
    showProfile($conn, $view);
    echo "<br/><a  href='messages.php?view={$view}'>" . "<Button class='button'>View {$name} messages</Button></a><br /><br />";
    die("</div></body></html>");
}
if (isset($_GET['add'])) {
    $add = sanitizeString($conn, $_GET['add']);
    if (!queryMysql($conn, "SELECT * FROM `friends` WHERE `user`='{$add}' AND `friend`='{$user}'")->num_rows) {
        queryMysql($conn, "INSERT INTO `friends` VALUES (NULL,'{$add}', '{$user}')");
    }
} elseif (isset($_GET['remove'])) {
    $remove = sanitizeString($_GET['remove']);
    queryMysql($conn, "DELETE FROM `friends` WHERE `user`='{$remove}' AND `friend`='{$user}'");
}
$result = queryMysql($conn, "SELECT `user` FROM `members` ORDER BY `user`");
$num = $result->num_rows;
echo "<h3>Other Members</h3><ul>";
开发者ID:sb0902,项目名称:LetsChat,代码行数:31,代码来源:members.php


注:本文中的showProfile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。