>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // MAIN PROGRAM // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $ddatta = $_POST['ddatta']; if ($ddatta != "") { $ddattaA = array(); $ddattaA[0] = explode("|",$ddatta[0]); $ddattaA[0][1] = filter_var($ddattaA[0][1], FILTER_SANITIZE_STRING); $ddattaA[0][2] = filter_var($ddattaA[0][2], FILTER_SANITIZE_STRING); $ddattaA[0][3] = filter_var($ddattaA[0][3], FILTER_SANITIZE_STRING); $ddattaA[0][4] = filter_var($ddattaA[0][4], FILTER_SANITIZE_STRING); $ddattaA[0][5] = filter_var($ddattaA[0][5], FILTER_SANITIZE_STRING); $d1Gap = $ddattaA[0][1]; $d2Gap = $ddattaA[0][2]; $d3Gap = $ddattaA[0][3]; $d4Gap = $ddattaA[0][4]; $d5Gap = $ddattaA[0][5]; $f1 = $d1Gap; $f1 = explode("-",$f1); if ($f1[1] == "10058") { // DeSo Javascript Framework - (for Identity and API Message handling) $echo = iE10058(); } if ($f1[1] == "10060") { // API (submit-transaction) Submit this Signed transaction $echo = iE10060($d2Gap); } if ($f1[1] == "10061") { // API (submit-post) Submit this Post $echo = iE10061($d2Gap,$d3Gap,$d4Gap); } if ($f1[1] == "10064") { // API (create-follow-txn-stateless) Follow this User $echo = iE10064($d2Gap,$d3Gap); } if ($f1[1] == "10065") { // API (create-follow-txn-stateless) UnFollow this User $echo = iE10065($d2Gap,$d3Gap); } if ($f1[1] == "10067") { // Following Feed $echo = iE10067($d2Gap,$d3Gap,$d4Gap); } if ($f1[1] == "10068") { // Comments of Post $echo = iE10068($d2Gap,$d3Gap,$d4Gap); } } else { $echo = getIPO(); // Initial Page Output } // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // PHP FUNCTIONS // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< function iE10068($PostHashHex,$CommentLimit,$PublicKey) { // Comments of Post $allPosts = getPostviaHex($PostHashHex,$CommentLimit); $CommentLimit3 = $CommentLimit; $iiPP = 0; $ii = 0; while ($ii < $CommentLimit3) { $ii2 = (($CommentLimit3 - $ii) - 1); $Posts = $allPosts->PostFound->Comments[$ii2]; $thisArray = $allPosts->PostFound->Comments[$ii2]->PostHashHex; $profile = ""; if (!$thisArray == "") { $echo .= getComment($Posts,$profile,$PublicKey,$iiPP); $iiPP = 5; } $ii++; } $ta = '
POST
Your Own Comment:
'; $echo = $ta . $echo; return $echo; } function iE10067($PostHashHex,$PublicKey,$hexCount) { // Following Feed $hexCountNew = $hexCount + 1; $allPosts = getPostsViaGlobal($PostHashHex,$PublicKey); $Posts = $allPosts->PostsFound[0]; $profile = $allPosts->PostsFound[0]->ProfileEntryResponse; $echo = getPost($Posts,$profile,$PublicKey,$widgetID); $NextPostHashHex = $Posts->PostHashHex; if ($noNextHex == "yes") { $echo .= "
"; } else { $echo .= "
"; } return $echo; } function iE10065($posterKey,$PublicKey) { // API (create-follow-txn-stateless) UnFollow this User $echo = '
FOLLOW
'; $collection_name = 'create-follow-txn-stateless'; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ "FollowerPublicKeyBase58Check" => $PublicKey, "FollowedPublicKeyBase58Check" => $posterKey, "IsUnfollow" => true, "MinFeeRateNanosPerKB" => 1000 ]; $response = curlme($request_url,$data); $response = json_decode($response); $TransactionHex = $response->TransactionHex; $echo .= ""; return $echo; } function iE10064($posterKey,$PublicKey) { // API (create-follow-txn-stateless) Follow this User $echo = '
UNFOLLOW
'; $collection_name = 'create-follow-txn-stateless'; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ "FollowerPublicKeyBase58Check" => $PublicKey, "FollowedPublicKeyBase58Check" => $posterKey, "IsUnfollow" => false, "MinFeeRateNanosPerKB" => 1000 ]; $response = curlme($request_url,$data); $response = json_decode($response); $TransactionHex = $response->TransactionHex; $echo .= ""; return $echo; } function iE10061($parentHex,$PublicKey,$cc) { // API (submit-post) Submit this Post $str1 = " "; $str2 = "\n"; $str3 = str_replace("
", $str2, $cc); $str3 = str_replace("[zz]", $str1, $str3); $cc = $str3; $collection_name = 'submit-post'; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ "UpdaterPublicKeyBase58Check" => $PublicKey, "ParentStakeID" => $parentHex, "BodyObj" => [ "Body" => $cc, "VideoURLs" => [], "ImageURLs" => [] ], "MinFeeRateNanosPerKB" => 1000 ]; $response = curlme($request_url,$data); $response = json_decode($response); $TransactionHex = $response->TransactionHex; $echo = "

Improved Postings coming soon.

Larger area for text, emoji, multi-image upload, video, instant message display without reload, comment-specific notification. more.
"; return $echo; } function iE10060($transHex) { // API (submit-transaction) Submit this Signed transaction $collection_name = 'submit-transaction'; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ "TransactionHex" => $transHex, ]; $response = curlme($request_url,$data); $response = json_decode($response); return $echo; } function iE10058() { // DeSo Javascript Framework - (for Identity and API Message handling) $forReturn = << .ca { position:relative; background: #19b6d9; color:black; height: 126px; } #caT { position:relative; height: 42px; } textarea { font-size: 22px; width: 560px; height: 74px; } #catTT { position:relative; float:left; top: 10px; left: 34px; } #postMe { position: relative; float: left; top: 10px; width: 48px; box-shadow: 0px 3px 9px rgb(0 0 0); text-align: center; border-radius: 4px; height: 22px; background-color: aqua; transition: all 0.5s ease; left:24px; } #taT { position:relative; height: 136px; width: 100%; text-align: center; } .thisComment { position: relative; border: black; border-style: solid; border-width: 1px; background: #5e7a7b; } .thisCommentC { position: relative; background: #2099ff; border: black; border-style: solid; border-width: 1px; } .thisComment1 { position: relative; border: black; border-style: solid; border-width: 1px; background: #941029; } #postInside { position: relative; background: #a2a2a2; word-wrap: break-word; overflow: hidden; } #postInside1 { position: relative; background: #58c430; word-wrap: break-word; overflow: hidden; } #postInsideC { position: relative; word-wrap: break-word; overflow: hidden; margin:0px; } #blackSpace { position:relative; height:40px; } #chain { position:relative; width:60px; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); background-size: 10px 10px; background-image: url("/images/chain.png"); background-repeat: no-repeat, repeat; background-color: #ffffff; height:40px; } #post { position: relative; overflow: hidden; } #postInsidePost { position: relative; background: #d0d0d0; } #postInsidePost1 { position: relative; background: #6cee3b; } #insidePost { position: relative; margin:10px; overflow: hidden; } #postC { position: relative; background: #ffffff; } #postInsidePostC { position: relative; background: #ffffff; border-style: solid; border-width: 1px; border-color: #111827; } #insidePostC { position: relative; margin:10px; overflow: hidden; color:#000000; } .white { position: relative; background: #ffffff; } #postInsideRepost { position: relative; } .commentIcon { fill: none; height: 24px; stroke: black; } .pointer { cursor: pointer; } #actions { position: relative; background: #858b8d; height:68px; } #actions1 { position: relative; background: #6cee3b; height:188px; color: #860000; font-size: 16px; font-weight: 500; } #acTop { position: relative; width:100%; height:36px; } #acBottom { position: relative; width:100%; top: -11px; } #USD1 { position: relative; width: 100%; top:25px; } #DeSo1 { position: relative; width: 100%; top:25px; } #ac233 { position: relative; width:20px; margin:auto; text-align:center; } #ac244 { position: relative; width:20px; margin:auto; text-align:center; } .ac2 { position: relative; width:99px; margin:auto; text-align:center; float:left; top:10px; } #ac221 { } #insideRepost { word-wrap: break-word; overflow: hidden; position: relative; margin:10px; } #headerMess { position: relative; width:100%; box-shadow: 0px 3px 9px rgb(0 0 0); height:100px; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; } #headerMess1 { position: relative; width:100%; box-shadow: 0px 3px 9px rgb(0 0 0); height:100px; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; background: #6cee3b; } #headerMess2 { position: relative; width:100%; box-shadow: 0px 3px 9px rgb(0 0 0); height:100px; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; background-color: #95b4b5; } #im { position: relative; float:left; margin:auto; width:100px; } #username { position: relative; overflow: hidden; font-size: 3em; text-align: center; width: 478px; height: 73px; text-shadow: 2px 2px 3px #000000; float: left; } #username2 { position: relative; overflow: hidden; font-size: 3em; text-align: center; width: 478px; height: 56px; text-shadow: 2px 2px 3px #000000; float: left; } #belowH { position: relative; text-align:center; height:44px; width: 478px; float:left; top: 3px; } #repost { position: relative; width:100%; text-align:center; color:#626060; } #div1,#div2 { position: relative; background: #fff; color: #000; border-radius: 4px; border: 1px solid #000000; box-shadow: inset 1px 2px 8px rgb(0 0 0); font-family: inherit; font-size: 1em; line-height: 1.45; height: 150px; width:150px; background-position: center; /* Center the image */ background-repeat: no-repeat; /* Do not repeat the image */ background-size: cover; /* Resize the background image to cover the entire container */ } #vert { float:left; } #div1 { } #div2 { } #div3 { clear:both; } #div8 { width:100%; } #MARQUEE0 { margin:auto; width:600px; float:left; } #MARQUEE { margin:auto; width:600px; clear:both; } #MARQUEE2 { margin:auto; width:600px; text-align:center; } #allMessages { margin:auto; width:600px; } #clear { clear:both; } #part1 { position: relative; height: 56px; float:left; top: -5px; } #part2 { position: relative; width:100%; height:22px; } #part3 { position: relative; width:100%; height:22px; } #c1 { position: relative; width:121px; float:left; height: 22px; } #b1 { position: relative; width:246px; float:left; height: 22px; } #c2 { position: relative; width:100px; float:left; height: 22px; } #c3 { position: relative; width:121px; float:left; height: 22px; font-size:12px; } #c4 { position: relative; width:246px; float:left; height: 22px; top: -11px; color: #4f88a9; } #c4b { position: relative; width:246px; float:left; height: 22px; top: -17px; color: #003554; } #c5 { position: relative; width:100px; float:left; height: 22px; font-size:12px; } #postpost { position: relative; margin: 10px; } #notes { margin: auto; width: 600px; position: relative; background: #fff; color: #000; border-radius: 4px; border: 1px solid #000000; } #notesInner { margin: 10px; width: 585px; position: relative; } #adNote { margin: 10px; width: 100%; position: relative; top: 27px; color: #003ce2; }

Welcome to oneFileDeSo !!

oneFileDeso is freeware and an open source starter kit, in one file, for you to connect to the DeSo API. Written in PHP, javascript, html, and css.


EOD; return $forReturn; } function getIPO() { $jqueryPath = "https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"; //$jqueryPath = "jquery.min.js"; $forReturn = << oneFileDeSo v1
EOD; return $forReturn; } function curlme($request_url,$data) { $curl = curl_init($request_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($curl, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ]); $response = curl_exec($curl); curl_close($curl); return $response; } function getPostsViaGlobal($PostHashHex,$PublicKey) { $collection_name = 'get-posts-stateless'; $CommentLimit2 = $CommentLimit - 0; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; if ($PostHashHex == "") { $data = [ 'ReaderPublicKeyBase58Check' => $PublicKey, 'GetPostsforFollowFeed' => true, 'NumToFetch' => 2 ]; } else { $data = [ 'ReaderPublicKeyBase58Check' => $PublicKey, 'PostHashHex' => $PostHashHex, 'GetPostsforFollowFeed' => true, 'NumToFetch' => 1 ]; } $response = curlme($request_url,$data); $response = json_decode($response); return $response; } function getIsFollowing($PublicKey,$posterKey) { $collection_name = 'is-following-public-key'; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ 'PublicKeyBase58Check' => $PublicKey, 'IsFollowingPublicKeyBase58Check' => $posterKey ]; $response = curlme($request_url,$data); $response = json_decode($response); } function getFolloweesbyKey($PublicKey,$stateF) { // followers = true following=false $collection_name = 'get-follows-stateless'; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ 'PublicKeyBase58Check' => "$PublicKey", 'GetEntriesFollowingUsername' => $stateF, 'NumToFetch' =>1 ]; $response = curlme($request_url,$data); $response = json_decode($response); return $response; } function getPostviaHex($PostHashHex,$CommentLimit) { $collection_name = 'get-single-post'; $CommentLimit2 = $CommentLimit - 0; $url = 'https://node.deso.org/api/v0'; $request_url = $url . '/' . $collection_name; $data = [ 'PostHashHex' => $PostHashHex, 'CommentLimit' => $CommentLimit2 ]; $response = curlme($request_url,$data); $response = json_decode($response); return $response; } function getPost($Posts,$profile,$PublicKey,$widgetID) { $echo = ""; $Username = $profile->Username; $key = $profile->PublicKeyBase58Check; $posterKey = $Posts->PosterPublicKeyBase58Check; $nothing = "yes"; $hasQuote = "no"; $ac21 = $Posts->CommentCount; $PostHashHex = $Posts->PostHashHex; $CommentLimit = $ac21; $postHashHex = $Posts->PostHashHex; if ((!$Posts->Body == "") || (!$Posts->ImageURLs[0] == "")) { $adCount++; $myBody = $Posts->Body; $myBody = json_encode($myBody); $str3 = $myBody; $str1 = "
"; $str3 = str_replace('\n', $str1, $str3); $str3 = json_decode($str3); if (!$Posts->ImageURLs[0] == "") { $echo5 = "

"; } $hasQuote = "yes"; $nothing = "no"; } $stateF = false; $getFollowees = getFolloweesbyKey($posterKey,$stateF); $ersT = $getFollowees->NumFollowers; $stateF = true; $getFollowees = getFolloweesbyKey($posterKey,$stateF); $eesT = $getFollowees->NumFollowers; $followMe = '
UNFOLLOW
'; if ((!$Posts->RepostedPostEntryResponse->Body == "") || (!$Posts->RepostedPostEntryResponse->ImageURLs[0] == "")) { $key22 = $Posts->RepostedPostEntryResponse->PosterPublicKeyBase58Check; $Username2 = $Posts->RepostedPostEntryResponse->ProfileEntryResponse->Username; if ($hasQuote == "yes") { $echo7 = "
"; } $myBody = $Posts->RepostedPostEntryResponse->Body; $myBody = json_encode($myBody); $str4 = $myBody; $str1 = "
"; $str4 = str_replace('\n', $str1, $str4); $str4 = json_decode($str4); $posterKeyR = $key22; $stateF = false; $getFollowees = getFolloweesbyKey($posterKeyR,$stateF); $ersT = $getFollowees->NumFollowers; $stateF = true; $getFollowees = getFolloweesbyKey($posterKeyR,$stateF); $eesT = $getFollowees->NumFollowers; $response = getIsFollowing($PublicKey,$posterKeyR); $isFollowing = $response->IsFollowing; if ($isFollowing === FALSE) { $followMeR = '
FOLLOW
'; } else { $followMeR = '
UNFOLLOW
'; } if (!$Posts->RepostedPostEntryResponse->ImageURLs[0] == "") { $echo6 = "

"; } $repostImage = "https://diamondapp.com/api/v0/get-single-profile-picture/" . $key22; $echoRepost = <<re-posted by: $Username
$Username2
$eesT
 
$ersT
followers
$followMeR
following
$str4 $echo6
EOD; $nothing = "no"; } $postImage = "https://diamondapp.com/api/v0/get-single-profile-picture/" . $key; $echo .= <<
$Username
$eesT
 
$ersT
followers
$followMe
following
$str3 $echo5
$echoRepost
$ac21
EOD; if ($nothing == "yes") { $echo .= "

MISSING
"; } else { $echo .= "
"; } return $echo; } function getComment($Posts,$profile,$PublicKey,$comCount) { $profile = $Posts->ProfileEntryResponse; $Username = $profile->Username; $key = $profile->PublicKeyBase58Check; $posterKey = $Posts->PosterPublicKeyBase58Check; $ac21 = $Posts->CommentCount; $PostHashHex = $Posts->PostHashHex; $CommentLimit = $ac21; $ParentStakeID = $Posts->ParentStakeID; $ac22 = $Posts->RepostCount + $Posts->QuoteRepostCount; $ac23 = "0"; $ac24 = $Posts->LikeCount; $ac25 = $Posts->DiamondCount; $ac26 = ""; if ((!$Posts->Body == "") || (!$Posts->ImageURLs[0] == "")) { $myBody = $Posts->Body; $myBody = json_encode($myBody); $str3 = $myBody; $str1 = "
"; $str3 = str_replace('\n', $str1, $str3); $str3 = json_decode($str3); if (!$Posts->ImageURLs[0] == "") { $echo5 = "

"; } $hasQuote = "yes"; } $stateF = false; $getFollowees = getFolloweesbyKey($posterKey,$stateF); $ersT = $getFollowees->NumFollowers; $stateF = true; $getFollowees = getFolloweesbyKey($posterKey,$stateF); $eesT = $getFollowees->NumFollowers; $response = getIsFollowing($PublicKey,$posterKey); $isFollowing = $response->IsFollowing; if ($isFollowing === FALSE) { $followMe = '
FOLLOW
'; } else { $followMe = '
UNFOLLOW
'; } $commentImage = "https://diamondapp.com/api/v0/get-single-profile-picture/" . $posterKey; $echo .= <<
$Username
$eesT
 
$ersT
followers
$followMe
following
$str3 $echo5
$ac21
EOD; return $echo; } echo $echo; exit; ?>