Article Directory
Results 1 to 5 of 5

Thread: Article Directory

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    3

    Article Directory

    Anybody know the inner workings of ArticleSetup??? I need to slide a Captcha into the registration code and the author really put a bunch of twists and turns into his coding. It's supposed to be open source.

  2. #2
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    If you've got the code, that is the open source part. Open source doesn't necessarily mean simple code.
    Ashley Sheridan
    www.ashleysheridan.co.uk

  3. #3
    Senior Member
    Join Date
    Apr 2003
    Location
    Silver Lake
    Posts
    4,811
    Quote Originally Posted by The Parson View Post
    Anybody know the inner workings of ArticleSetup??? I need to slide a Captcha into the registration code and the author really put a bunch of twists and turns into his coding. It's supposed to be open source.
    The linux kernel is also open source.

    You would do well to ask a more specific question about PHP. E.g., "what does this function return". Or "can anyone tell me how I can set up my IDE to step through PHP code as it runs"
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  4. #4
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Hey, if you do know about the inner workings of ArticleSetup, do you know how to add a function in the author.php that will allow you to delete the author without having to do it from phpMyAdmin?
    Code:
    <?php 
    	session_start();
    	include ('../config.php');
    	include ('secureadmin.php');
    	include ('paginator.php');
    		
    	$metatitle = "Edit Author - Admin Control Panel";
    	include ('includes/document_head.php');
    	
    	$authorid = $_GET['id'];
    	
    	
    	$query = "select * from authors where id = ".$authorid.";"; 
    	$result = mysql_query($query,$connection) or die(mysql_error());
    	$info = mysql_fetch_assoc($result);
    	// get this category's information
    	$name = $info['fname'];
    	$status = $info['status'];
    	$email = $info['email'];
    	$username = $info['username'];
    	$displayname = $info['displayname'];
    	$bio = $info['bio'];	
    	$url = $info['url'];	
    	$avatar = $info['gravatar'];	
    	
    	if($status == 0) {
    		$status = "Active";
    		$action = "Ban";
    	} else {
    		$status = "Banned";
    		$action = "Restore";
    	}
    
    		
    ?>
    		<div id="wrapper">
    			<?php include 'includes/topbar.php'?>		
    			<?php include 'includes/sidebar.php'?>
    			<div class="main_container container_16 clearfix">
    				
    					
    			<div class="flat_area grid_16">
    			
    			
    		
    	<div class="box grid_8 round_all">
    		<div class="block">
    			<h2>Profile Settings for <?php echo $name; ?></h2>
    					
    	
    
    	
    	<div style="float:left; padding: 7px;"><img src="<?php echo $avatar; ?>" /></div>
    	
    	<b>Pen Name:</b> <?php echo $displayname; ?><br/><br/>
    	
    	<b>Homepage:</b> <a href="<?php echo $url; ?>"><?php echo $url; ?></a><br/><br/>
    	<div style="clear: both;"></div>
    	<b>Bio:</b> <br/><div style="width: 300px;"><?php echo $bio; ?></div><br/>
    	
    			</div>
    		</div>
    
    
    
    			<div class="box grid_8 round_all">
    			<div class="block">
    	<h2>Account Settings for <?php echo $name; ?></h2>
    					
    	<b>Name:</b> <?php echo $name; ?><br/><br/>
    		
    	<b>Username:</b> <?php echo $username; ?><br/><br/>
    	
    	<b>Status:</b> <?php echo $status; ?><br/><br/>
    	
    	<b>Email:</b> <?php echo $email; ?><br/><br/>
    	
    			<a href="authors.php?status=<?php echo $info['status']; ?>&id=<?php echo $authorid; ?>"><button  class="skin_colour round_all"><img width="24" height="24" src="images/icons/small/white/Create Write.png"><span><?php echo $action; ?> User</span></button></a>
    
    
    	<br/><br/><br/>
    	
    			</div>
    		</div>
    		
    
    	</div>
    	
    
    <?php 
    // Setup pagination controls
    	$rowsquery = "select * from articles where authorid=".$authorid."";
    	$rowsresults = mysql_query($rowsquery,$connection) or die(mysql_error());
    	$rows_results = mysql_num_rows($rowsresults);
    	
    	$pages = new Paginator;
    	$pages->urlparam = "?id=".$authorid."";
    	$pages->items_total = $rows_results;
    	$pages->mid_range = 9;
    	$pages->paginate();
    
    	if ($pages->items_total) {	
    		$query = "select * from articles where authorid=".$authorid." order by date asc ".$pages->limit;
    	} else {
    		$query = "select * from articles where authorid=".$authorid." order by date asc";
    	}
    
    	$articleresults = mysql_query($query,$connection) or die(mysql_error());
    	$num_results = mysql_num_rows($articleresults);
    	
    	// for display of page #
    	$pagenum = $_GET['page'];
    	if (!$pagenum)
    		$pagenum = 1;
    		
    
    ?>
    
    	<br/><br/>
    	<h2>All Articles by <?php echo $name; ?> (<?php echo $rows_results; ?>)</h2>
    					<?php echo "<div style=\"float:right; font-weight: bold;\">(Page ".$pagenum.") &nbsp; &nbsp;".$pages->display_pages()."</div><br/>"; ?>
    
    				<div class="box grid_16 round_all">
    				<table width="100%" class="listing"> 
    					<thead> 
    						<tr> 
    							<th>ID</th> 
    							<th>Date</th>
    							<th>Author</th> 
    							<th>Title</th> 
    							<th>Views</th>
    							<th>Status</th>
    						</tr> 
    					</thead> 
    					<tbody> 
    					
    					
    <?php // Populates the Dropdown list with all categories and subcats		
    	
    	for ($i=0; $i <$num_results; $i++) { 
    		$row = mysql_fetch_assoc($articleresults);
    		
    		$date = strtotime($row['date']);
    		$artdate = date('m/d/y', $date);
    		
    		
    		// Get Author Display Name
    		$authquery = "select * from authors where id=".$row['authorid']; 
    		$authresult = mysql_query($authquery,$connection) or die(mysql_error());
    		$authinfo = mysql_fetch_assoc($authresult);
    		
    		// Get Views
    		$viewquery = "select * from articleviews where articleid=".$row['id']; 
    		$viewresult = mysql_query($viewquery,$connection) or die(mysql_error());
    		$viewinfo = mysql_fetch_assoc($viewresult);
    		$views = $viewinfo['views'];
    		if (!$views) $views = "-";
    
    		if($row['status'] == 0) {
    			$status = "Active";
    		} elseif($row['status'] == 1) {
    			$status = "In Review";
    		} else {
    			$status = "Problem";
    		}
    		
    		echo "<tr> <td>".$row['id']."</td> 
    			 <td>".$artdate."</td> 
    			 <td>".$authinfo['displayname']."</td>
    			 <td><a href=\"articleedit.php?id=".$row['id']."\">".$row['title']."</a></td>
    			 <td>".$views."</td>
    			 <td>".$status."</td></tr>";
    		}
    ?>
    
    					</tbody> 
    				</table>
    			</div>
    
    <?php 
    	//display pagination
    	echo "<div style=\"float:right; font-weight: bold;\"> (Page ".$pagenum.") &nbsp; &nbsp;".$pages->display_pages()."</div><br/>";
    
    	?>			
    
    		</div>	
    <?php include 'includes/closing_items.php'?>

  5. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Is that better? Any help would be appreciated folks...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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