MyUPB.com Discussion forums
You are not logged in. Please Register or Login.

Announcements

This project is not completely dead. I've just started work on localisation.
Please email me at clark@NOSPAMmyupb.com once you've registered so I can activate your account (remove "NOSPAM" from the email address)
~~~~ Clark


If you're getting a "Deprecated" error message, follow the instructions here

URGENT Security Patch for ≤ v2.2.6
A security hole has been discovered, follow the instructions and download the patch at the topic page.
Did the patch break your search page? Search Patch

Download myUPB
Version 2.2.7 Released - 24th December 2010


Posted: Oct 02, 2007 4:52:09 pm
poetman



Hi
I have like 6 or 7 categories on index.php with each category representing a particular section/department of my site such as Music pages Forum category, or Writers Pages forum category or Weight Loss & Nutrition pages category etc.  Each of these 6 or 7 categories have their individual and relevant forum topics & posts. Now each of these sections of my site link to the upb index.php so the visitor in the weight loss & nutrition section of my site can click on a link there to pop up the upb forum's index/php page to look at the forums category covering weight loss and nutrition issues and likewise for the others. The problem is it would be a bit better if i can figure out how to have  like 6 anchors for those 6 main categories on the main upb index page so that when the weight loss visitor clicks on weight loss forum link and the forum index page pops up in stead of all of them showing the header and requiring each of the visitors to scroll to fin that particular forum for there be an anchor for each of those different categories and so when coming i from the weight loss section of my site they end up on the index.php page of the forum but also right at the relevant category of topics and issues for weight loss rather than always at the top of the page.

Now i don't understand php code well enough to know how to implement an anchor (s) code snippet that will correspond to each of the categories i create on the main page of my upb  and do not know where to place such a sinppet of code that would accomplish what anchors do in html?

Please any help on this would be much appreciated.
Here is the link to main upb page and it should be obvious what im trying to do and if anyone can figure a quick little mod to do this I'd be very thankful.
I really like what I've done so far take a look.

http://www.ricksenterprises.com/ricks-funstuff/index.php

(hm)
Have a Good Day! Rick

Posted: Oct 02, 2007 6:12:06 pm
Clark



First of all I would highly recommend updating to the latest version of the software (2.1.1b)

There aren't any anchors yet and they wouldn't be too hard to implement in a future version.

I'm not familiar with the v1 coding but if you upgrade to the latest version and I find the time I might be able to rustle something up but I can't guarantee anything. I might not be able to do anything at all.
myUPB Developer

Posted: Oct 02, 2007 7:22:44 pm
poetman



Hi and thanks for Response

Yes i will update to the new upb sometime by next Summer but there are a host of other to do things to get done first on other sections of website that must be done first.  So, since the older version looks so good and works so well I see no need after having customized it so neatly to do any upgrading in this section of pages on my site at this time while othr sections of my site still need to be finished in terms of basic structure.

Still It would be nice to have those anchors there and I might find a space of a few days to try to code something, but since I am a PHP beginner I don't feel very confident about trying to figure out a solution. What ever I might come up with might work but it would take a few days of trial and eror plus most problems have multiple solutions to accomplish the ends and the solution I come up with may not be a very good one even if it does work where as someone versed in PHP might quickly see an easy and elegant way to code in anchors that I lack the competence to.

Anyway I understand and thanks for offering to try on an upgraded script version, but I really like this version and customization Ive done this past month and now need to work on other things and simply dont have the time to upgrade right now.

The anchors are not of major importance but would be a really nice touch.
Have a Good Day! Rick

Posted: Oct 02, 2007 9:48:42 pm
Clark



Fair enough.

Let me know if you get it working........it sounds like a feature that could be incorporated into a future, it shouldn't be too hard to implement.
myUPB Developer

Posted: Oct 08, 2007 8:01:53 am
Rebles



Creating anchors for each of the categories, huh?  It sounds like you are trying to create a "viewcat.php", which is totally cool.

Let me give you some pointers that I think might be useful to your cause:

Basically, I think the best way to impliment anchors, would be to create a "viewcat.php" page, which will basically be PHP code snippets taken from index.php (probably).
To create the new pages, You will need to include some basic UPB files.
If you are using UPB 2 <= 2.1.1b, You will need to add these lines to the beginning of the page:
PHP Code:
require_once('./includes/class/func.class.php');
require_once('./includes/header.php');


If you are using UPB 1, You will have to use these lines instead:
PHP Code:
include &quot;func.inc.php&quot;;
include &quot;header.php&quot;;


You'll have to verify that Category ID in the query string is valid with a line like this (UPB v2):
PHP Code:
if(!isset($_GET[&quot;id&quot;]) || !is_numeric($_GET[&quot;id&quot;])) exitPage(&quot;Invalid Category ID&quot;);


Then you have to get the category record using a command like this (UPB v2):
PHP Code:
$category = $tdb->get('cats', $_GET['id']);


To retrieve the forums of the category, you're going to have to loop through the forums ID in the "sort" element, like so:
PHP Code:
$forumIDArray = explode(',', $category[0]['sort']);
while(!empty($forumIDArray)) {
    $forumID = shift($forumIDArray);
    if($forumID != &quot;&quot; || !is_numeric($forumID)) continue;
    $record = $tdb->get('forum", $forumID);
    //Add index.php snippets here to make it work, you will have to rename variables so they match.
}


If you have faith in the code, you can use this pretty blindly.  If you don't have a lot of PHP experience, you'll probably run into a lot of Errors, just reply back here with the errors, and your source code, and we'll try to debug together.  The above code, is all the backend stuff.  I didn't bother with processing data/output, because it's all there in the index.php.  Again, if you have trouble locating the necessary coding, reply here again, and me or other fellow staff members will be happy to asssist you.  Happy Modding!

Also, if you do manage to get it working, post a reply here, and upload or link your source code, so that others requesting anchors can utilize it aswell (without duplicating coding).
--Jerroyd Moore
Bachelors of Science, Computer Science 2011
Jack Baskin School of Engineering
University of California, Santa Cruz

Powered by myUPB v2.2.6  ·   © PHP Outburst 2002 - 2013

Creative Commons License