Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:50:35+00:00 2026-05-25T21:50:35+00:00

This class provides user created content to the page. The call is made from

  • 0

This class provides user created content to the page.

The call is made from html like this:

  <?php new route('tweets'); ?>

or

  <?php new route('bookmarks'); ?>

Route instantiates view_html and passes the paramter along.

What improvments that can be made?

/*view_html*/

class view_html extends database
  {
  function __construct($type)
    {
    parent::__construct();    
    switch ($type) 
      {
      case "bookmraks":
        $this->bookmarks();
        break;
      case "tweets":
        $this->tweets();
        break;
      default:
        echo "Invalid View Type";
        break;
      }
    }
  private function bookmarks()
    {
    $email = $_SESSION['email'];
    $query_return = database::query("SELECT * FROM bo  WHERE email='$email' ORDER BY name ASC");
    while ($ass_array = mysqli_fetch_assoc($query_return))
      {
      $fav=$this->fav($ass_array['url']);
      echo "<img name=\"bo_im\" class=\"c\" src=\"$fav\"/ onerror=\"i_bm_err(this)\"><a target=\"_blank\" name = \"a1\" class = \"b\" href = \"$ass_array[url]\">$ass_array[name]</a>";
      }      
    }
  private function tweets() 
    {
    $query_return = database::query("SELECT * FROM tw ORDER BY time DESC LIMIT 7");
    $time = time();
    while ($a = mysqli_fetch_assoc($query_return))
      {
      echo  "<div class=\"Bb2b\"><img class=\"a\" src=\"p/$a[email].jpg\" alt=\"\"/><a class=\"a\" href=\"javascript:void(0)\">$a[fname] posted <script type=\"text/javascript\">document.write(v0($a[time],$time))</script></a><br/><p class=\"c\">$a[message]</p></div>";
      }
    }
  private function fav($url)     
    {    
    $pieces = parse_url($url);    
    $domain = isset($pieces['host']) ? $pieces['host'] : '';    
    if(preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs))       
      {     
      return $pieces['scheme'] . '://www.' . $regs['domain'] . '/favicon.ico';    
      }    
      return false;
    }
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:50:35+00:00Added an answer on May 25, 2026 at 9:50 pm

    This isn’t a code review site, you’d be better off taking this question here https://codereview.stackexchange.com/

    However, you may want to consider using a switch block instead of if statements in case you want to expand the number of possible types later.
    http://php.net/manual/en/control-structures.switch.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this: class User < ActiveRecord::Base # name, email, password end class Article <
Given this class public partial class Default : Page { private IRepository repo; ...
Given a class like this: class Foo { public: Foo(int); Foo(const Foo&); Foo& operator=(int);
Given a class like this: class B class << self attr_accessor :var end end
I have a page I created with jQuery, and in this page is a
There are many classes having this provider suffix. (Data,membership,modelmetadata,...). When should be a class
Given this class class Foo { // Want to find _bar with reflection [SomeAttribute]
Consider this class hierarchy: Book extends Goods Book implements Taxable As we know, there
given this class definition: public class Frame { IFrameStream CapturedFrom; } I want implement
Take this class as example: public class Category : PersistentObject<int> { public virtual string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.