Joined: Aug 2004
Posts: 82
Power User
Power User
Joined: Aug 2004
Posts: 82
hey guys i am using contentislands for some thread pulling but i cant format it how i want it to be. what im after is for some category's to pull the posts. no user name or post time just the title and limited the title to say 16 characters. a example is here
Attachments
Joined: Aug 2004
Posts: 82
Power User
Power User
Joined: Aug 2004
Posts: 82
nobody ever done this before?
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Joined: May 2001
Posts: 550
Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Joined: Mar 2000
Posts: 528
Very possible, but through content islands it is a royal pain. If you are needing the info on the same site that holds your threads install, a quickie php script is better for this.
Joined: Aug 2004
Posts: 82
Power User
Power User
Joined: Aug 2004
Posts: 82
any ideas where to get a script or any way going about it?
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Joined: May 2001
Posts: 550
<br /><?<br />// Variables Section - Edit these to suit your needs<br />// Number of threads to show<br />$numposts = 10;<br /><br />//number of characters of the subject to display<br />$numchars = 40;<br /><br />// -----------------------------<br />// End of the variables section<br /><br />require_once ("./includes/main.inc.php");<br />// --------------------------<br />// Let's grab the threads<br />$query = "<br /> SELECT B_Number, B_Subject<br /> FROM {$config['tbprefix']}Posts<br /> WHERE B_Parent = '0'<br /> ORDER BY B_Posted DESC<br /> LIMIT $numposts<br />";<br />$sth = $dbh -> do_query($query); <br /><br />// -----------------------<br />// Cycle through the posts<br />while ( list($Number,$Subject) = $dbh -> fetch_array($sth)) {<br /> $Subject =substr($Subject,0,$numchars) . "...";<br /> $toprint .= "<a href=\"{$config['phpurl']}/showflat.php/Number/$Number\">$Subject</a><br \>";<br />}<br />$dbh -> finish_sth($sth);<br />echo $toprint;<br />
Joined: Aug 2004
Posts: 82
Power User
Power User
Joined: Aug 2004
Posts: 82
argh its pulling shotbox posts as well lol
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Joined: May 2001
Posts: 550
If you want some forums excluded, then you have to add AND B_Board != 'forumkeyword' for each forum after WHERE B_Parent = '0' If you need the urls formated differently, just edit showflat.php/Number/$Number into showflat.php?Number=$Number
Joined: Aug 2004
Posts: 82
Power User
Power User
Joined: Aug 2004
Posts: 82
if i just wanted one forum how would i got about that?
Joined: Sep 1999
Posts: 76
Power User
Power User
Joined: Sep 1999
Posts: 76
[]minto said: if i just wanted one forum how would i got about that? [/] AND B_Board = 'forumkeyword'
Joined: Aug 2004
Posts: 82
Power User
Power User
Joined: Aug 2004
Posts: 82
ok i dont get it. what line do i have to replace with AND B_Board = 'news' or where do i add it to only take from that forum?
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Joined: May 2001
Posts: 550
The SQL queries are can be read just like a natuaral language sentence. Read aloud: SELECT B_Number, B_Subject FROM {$config['tbprefix']}Posts WHERE B_Parent = '0' AND B_Board = 'forumkeyword' ORDER BY B_Posted DESC LIMIT $numposts
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Posts:
5,833
Joined: January 2000
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139Sep 21st, 2024
Currently Online
Topics Created
Posts Made
Users Online
Birthdays