Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] CuteNews i problem z menu
Martinas
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 12.03.2008

Ostrzeżenie: (0%)
-----


Uzywam CuteNews to zadządzania artykułami ale napotkałem dziwny problem, gdy wstawie artykuły przez
  1. <?php 
  2. $category = "1";
  3. $static = TRUE;
  4. include("news/show_news.php");
  5. ?>

Wszystko działa jak należy tzn można przeglądnąć cały artykuł po kliknieciu na link "wiecej" itd

problem pojawia sie gdy ten fragment wstawie do kody który obsluguje moje menu
  1. <a class="web" href="index.php?id=glowna">Strona główna</a>
  2.  
  3.  <?php
  4.  if(empty($_GET['id']) or $_GET['id']=="glowna"){
  5. $number = "3";
  6. $category = "1";
  7. $static = TRUE;
  8.  include("news/show_news.php");
  9.  }
  10.  
  11.  if($_GET['id']=="link1"){
  12.  include("data/site1.php");
  13.  }
  14.  
  15.  if($_GET['id']=="link2"){
  16.  include("data/site2.php");
  17.  }
  18.  ?>

Wtedy wyświetla tylko początkową zawartość a po kliknieciu na "wiecej", środkowy box jest pusty, mecze sie juz 2 dni z tym, i nie wiem co robie nie tak.
Z góry dzięki za pomoc




Ten post edytował Martinas 13.03.2008, 13:00:32
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Popraw proszę tytuł topiku na zgodny z zasadami forum Przedszkole i dodaj bbcode
Go to the top of the page
+Quote Post
Martinas
post
Post #3





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 12.03.2008

Ostrzeżenie: (0%)
-----


No i znowu ja, zadałem moje wcześniejszcze pytanie na forum CuteNews, dostałem następująca odpowiedź, i tu prośba do was może ktoś mi to wytłumaczyć w bardziej przystępny sposób.
Cytat

That's because the generated link that CuteNews does won't put id=site1 in the query string.

Now there's an easy and a hard way to solve this, basically:
  • You can either create two files so that one only has CuteNews on it without requiring it to have some sort of id.
    This might be a hassle because you'd have to update two pages then when it comes to things like the header, footer and similar.
  • Instead of saying that ?id has to be defined, make CuteNews your default option. So having something like
    Kod
    <?php
       switch ($_GET['id']){
         case 'site2': include('data/site2.php'); break;
         default: include('cutenews/show_news.php'); break;
       }
       ?>
    [/php]
    would always make CuteNews go if ?id didn't match any case before. However watch out as CuteNews uses id to refer to a news article, but chances of you defining a page with a name as an article are very, very slim. (They're 10 digit numbers or more).
  • Edit the files so that the generated links of CuteNews will have that id thing defined. Now there's another problem you'll encounter, and that one is that CuteNews uses id to refer to the news article, so I suggest you change ?id you use on your site for navigation to something like ?page or similar - you get the idea.
    Yes, it is possible to edit every file so that the CuteNews use of id will be some other name, but you won't find anyone willing to do that on here as it's completely useless seeing that you could just rename the navigation.
Hope that helped.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 15:56