Files
Testing/js/act/bate_blog_links.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

169 lines
4.1 KiB
PHP

<?php if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/cmeter/');
include(PATHTOINCLUDES."base.php");
$em="";
$sql="SELECT
`bate_blogs_links`.`id`,
`bate_blogs_links`.`thelink`,
`bate_blogs_links`.`thetext`
FROM
`bate_blogs_links`
ORDER BY `bate_blogs_links`.`thetext`";
$result=$database->database_query($sql) or $em=$em.$database->database_error();
$sqlblog="SELECT
`cp_blogroll_rec`.`user_id`,
`cp_blogroll_rec`.`user_name`,
`cp_blogroll_rec`.`blog_url`,
`cp_blogroll_rec`.`blr_date`
FROM
`cp_blogroll_rec`
ORDER BY
`cp_blogroll_rec`.`blr_date` DESC";
$resultblog=$database->database_query($sqlblog) or $em=$em.$database->database_error();
?>
<div style="position:relative">
<div id="formmenu"><a href="javascript:blogroll_hs('batelinks')">Blogroll</a> | <a href="javascript:blogroll_hs('blogrecommendations');">Member Recommendations</a></div>
<div class="xmlform" id="batelinks" style="display:block;">
<div class="xmlform_container">
<div class="xmlform_pad">
<?php
$rownum=0;
while ($row = $database->database_fetch_assoc($result)) {$rownum=$rownum+1;?>
<div id="bl_link_cont_<?php echo $rownum;?>">
<div><label>Text: </label><input type="text" required pattern="\S" class="text"
size="40" name="thetext_<?php echo $rownum;?>" id="thetext_<?php echo $rownum;?>" value="<?php echo $row["thetext"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','thetext_<?php echo $rownum;?>','/js/act/bate_blog_links_act.php','id_<?php echo $rownum;?>','bate_blogs_links','Please enter the links\'s text!','N');" />
</div>
<div><label>Link: </label><input type="text" size="40" required pattern="\S" class="text"
name="thelink_<?php echo $rownum;?>" id="thelink_<?php echo $rownum;?>" value="<?php echo $row["thelink"];?>"
onblur="submit_form_item('<?php echo $rownum;?>','thelink_<?php echo $rownum;?>','/js/act/bate_blog_links_act.php','id_<?php echo $rownum;?>','bate_blogs_links','Please enter the links\'s url!','N');" />
<input type="button" class="bl_delbutton" name="del_<?php echo $rownum;?>" id="del_<?php echo $rownum;?>" value="D" onclick="del_batelink('<?php echo $rownum;?>');" />
</div>
<input type="hidden" name="id_<?php echo $rownum;?>" id="id_<?php echo $rownum;?>" value="<?php echo $row["id"];?>" />
<input type="hidden" name="o_thetext_<?php echo $rownum;?>" id="o_thetext_<?php echo $rownum;?>" value="<?php echo $row["thetext"]; ?>" />
<input type="hidden" name="o_thelink_<?php echo $rownum;?>" id="o_thelink_<?php echo $rownum;?>" value="<?php echo $row["thelink"]; ?>" />
<hr />
</div>
<?php }?>
</div>
</div>
<div style="background:red;color:#fff;" id="batelink_add">
<div style="padding:10px;">
<div><label>Text: </label><input type="text" required pattern="\S" class="text"
name="thetext" id="thetext" size="40"
onblur="" /></div>
<div><label>Link: </label><input type="text" required pattern="^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$" class="text"
name="thelink" id="thelink" size="40"
onblur="" /> <input type="button" value="Add Link" onclick="add_batelinks();" />
</div>
</div>
</div>
</div>
<div style="position:absolute;top:20px;left:0px;background:white;color:black;width:100%;display:none;" id="blogrecommendations">
<div style="height:300px;overflow:auto;width:100%;">
<div style="padding:10px;color:black;">
<?php while ($b = $database->database_fetch_assoc($resultblog)) {
echo '<div style="color:black;">'.$b["blr_date"].'</div>';
echo '<div style="color:black;">'.$b["user_name"].'</div>';
echo '<div style="color:black;">'.$b["blog_url"].'</div>';
echo '<hr />';
}
?>
</div>
</div>
<div style="width:100%;height:20px;background:black;">&nbsp;</div>
</div>
</div>