|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////7 l/ }* r. B/ u5 j) `! A& o0 k
// Theme Option
& n& X1 V2 u* K* ]( F! {////////////////////////////////////////////////////////////////////////////////: x3 U* w% D) }4 ~- f
4 G, }' o2 \; i) B ]! a
$themename = "Zenx";
1 J; P! m! U5 z& g% O0 F$shortname = str_replace(' ', '_', strtolower($themename));
& g7 t4 f h+ h u) L( V: a1 Q
5 P3 p/ R+ @; E, |1 Efunction get_theme_option($option)
- A& B, I7 L/ B{8 G) U) Y9 A2 d8 C
global $shortname;
, A+ F9 Q1 ?# A- Z8 k return stripslashes(get_option($shortname . '_' . $option));
( w& P* l1 g2 a7 Y- E}3 C+ ^ P2 B) b: K% E r! c s
& p1 L d3 K- r, Q% K$ l# o4 U5 X
function get_theme_settings($option)
$ ]" X; f4 ?6 H& ]9 _5 ^{+ T; B0 ]& b/ Y3 V$ ]& Q d, j. |
return stripslashes(get_option($option));
+ Z& G) T- W! t! {& J( t( J}- ~. b9 F$ A* o8 }% X
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
: h8 Q) Z4 Y# T9 n8 g$wp_getcat = array();2 Q& R! |& N$ _/ Q l3 ]
foreach ($wp_dropdown_rd_admin as $category_list) {) L; R& G1 M) \
$wp_getcat[$category_list->term_id] = $category_list->name;
' ?% A! j/ z& K* O8 D' C}5 Z0 r8 V/ l [+ v, |% P
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");) A4 G0 m( u2 f( h- f2 O7 h1 L
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
( X# N* l6 k5 ?7 f: Y$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");3 |. o5 e! N4 _
1 U( o5 M4 Z! _% j
$options = array (
4 P4 l+ i v+ v1 k
; {: t& K! E# ?$ z9 z$ |. X/ c
array( "name" => "Blog Header Settings",
7 H. v! p, B7 U "type" => "heading",5 ]" k; B# S2 J
),
& v0 b( j5 H( a- p1 n8 q* y" h! f% S. E; K, ^
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# q2 S' \; y: b) l: J
"id" => $shortname."_header_logo_activate",& B# W$ f' _' S; U) V1 Y8 r
"type" => "select",
9 c! I$ W/ M7 n "std" => "No",
, o, j; K0 f' D3 b" b# ^3 G( l "options" => array("No", "Yes")),& ^, e3 Z1 K6 z
) M% i1 S p. `; n( v" ~; h! H array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
6 Y. w9 ]( O, ], }: _ "id" => $shortname."_logo_url",7 n' K6 a9 I( M( I- O
"type" => "text",; s9 n9 x+ d9 V3 ?6 l& c
"box" => "social",
- G8 |% G* x1 q: Y- c "std" => "",4 s" k& I, ^# j6 r1 d+ L' A
),
" n/ N, L0 @1 C" o" `0 {5 y! \
2 @, d- q! n% K; h array( "name" => "Insert Header Banner HTML Code (Header)
6 b9 i0 i8 J, I <br /><em>*Recommended Size 468 x 60</em>
1 Z x; R, |8 P <br /><em>*leave blank if not use</em>",
. m- n6 L$ Q4 w1 n: k% Z5 p "id" => $shortname."_header_banner",
3 \9 M: O' L3 I "type" => "textarea",
0 f+ z' d1 J n "std" => "",
/ B& l( q1 j% H" \; B( o ),
2 y9 Z' y% V, U
* E) X8 r& Y4 D1 |1 J array( "name" => "</div></div>",
$ n+ I* B: F8 r* V6 l1 P3 c. S) ? "type" => "close",
7 W1 u' q4 r* Y3 P- b$ I' J ),
) \7 c8 P5 G) O; n/ l
. i) I* N: w! I+ k& N9 x
# f7 B) Z1 Z5 D; G1 E2 [+ U& H% E array( "name" => "Header Navigation Settings",
9 }9 p# n! [; N "type" => "heading",
, F3 M# C! ?2 L; } ),
4 s$ Q3 W; u) {+ n9 d* U; u1 t: Q$ O( t- N% S/ M
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
9 c' h3 l8 |: X6 s, }( g <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />: R/ a; V2 g# b) t8 o: p
<em>*Enter the page post ID number only</em><br />
/ J9 |6 h N; l% v+ C <em>*separate by comma</em><br />
' R4 q& |" Z! ?! R }; [1 O <em>*Exclude pages which you don't want to show on the header navigation</em>",
3 q6 K |* g5 x f) W "id" => $shortname."_header_page_navigation",
/ a/ m+ k8 m* O: r6 Z/ F "type" => "text",6 W, b. V% y8 A, p7 B& l
"std" => "",
' {+ i1 a S% C6 }5 p! G8 a ),
, k) J1 D+ H1 T+ B ]
* i$ y7 ^+ ^! H1 N array( "name" => "</div></div>",3 D2 a3 u. {; K8 ?% E
"type" => "close",
# {& g% f& g- x+ m ),: _! N2 z! N- |% a+ r
0 n# V& U3 U) a6 C) n7 M8 M
0 V4 E: S$ E& k* Y array( "name" => "Post Auto Thumbnails Settings",( W8 Y6 m/ j5 ]: v; s
"type" => "heading",
! x( p! I2 W. U ),6 M% M& l9 k- I2 }
! c0 J' Z2 I0 H; Y, ]3 Z array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& ~1 J+ P, f p* R' v: L) H "id" => $shortname."_timthumb_activate",; x3 N/ `' V V1 V
"type" => "select",
8 j; j/ m% @# b% u "std" => "No",0 d" c/ f A8 C$ e# q! E& g
"options" => array("No", "Yes")),. x9 X- ~8 Q) d
+ w% o' W9 a- `* I1 L array( "name" => "If Timthumb is enabled, Please choose its cropping method",
8 ~5 U, a5 _3 _) `7 U0 n "id" => $shortname."_timthumb_cropping", O, }/ S3 ?8 [1 L
"type" => "select",2 c7 _5 ~) E% S1 b& f3 r
"std" => "",
3 Y$ e* q. Z8 s s. ^ "options" => $crop_position)," ]) F- T- i+ U' o3 g |
2 U: ^- w% s. p' e
array( "name" => "Insert Width Of Thumbnail Image<br /> {' j4 T6 B5 _; k
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
( T+ p2 W* ?. ^0 G <em>*Leave Blank To Use Default: 250</em><br />",5 a4 T4 ]: a# C$ @& I' J e
"id" => $shortname."_thumb_width",. W' v1 [7 j& c- `& A/ p) R
"type" => "text",' G- ?( D8 e T! V# W* V
"std" => "",
) \2 y" H v4 }7 Z' j5 q ),6 j8 J7 F3 b+ |, w: |- S( j- v
4 g* P* ?# {/ M# h1 e( p3 Y
array( "name" => "Insert Height Of Thumbnail Image<br />
7 e$ z- C2 ^- |) W <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
% l \5 r. h9 B$ A; Y+ q <em>*Leave Blank To Use Default: 200</em><br />",
! Z5 V4 p& T/ e. D$ a& | "id" => $shortname."_thumb_height",
: D" p* D. A1 d4 ^! D! n "type" => "text",
: u8 Z- _$ O- `4 M* r "std" => "",, h0 n5 x' l$ Q, s$ T/ M6 V6 \
),( t9 v; @6 A2 \$ K0 y% e2 `3 u
7 B( E. M. n* }+ h+ G
array( "name" => "</div></div>",1 @8 h' s! K5 ]. u. c
"type" => "close",9 m1 Z) v6 {/ e
),) y7 R: R7 a7 p' S4 v% s3 m
, f: B& K7 o) S+ x5 ?# u+ p( V, X
array( "name" => "Featured Content Slider Settings",! A( v" ^/ g$ V
"type" => "heading",
# L* |& Z5 {) s, n ),
8 I0 d' @; `" j s8 c h: K( |" }8 B2 t3 P! D
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",0 X4 x$ I" R% K
"id" => $shortname."_featured_activate",
5 j3 _% M8 o( t/ A4 y" y1 u. | "type" => "select",
* H" E* k- M3 }- h" t# x "std" => "No",
( ^- V! ^* `$ T$ j2 _1 T: f2 M "options" => array("No", "Yes")),7 L+ Y* z) i4 T$ I
4 ^$ s0 G2 k1 v! T
/ q a0 }7 w4 R1 J) w
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?"," x5 x# J% n( N2 g8 C& i9 ]
"id" => $shortname."_featured_category",
1 v4 O& [' h7 t( F+ w& M0 J "type" => "select",
5 n7 `& ^. I$ W. p "std" => "Choose a category:",. Z1 |$ V3 `+ @' U
"options" => $wp_getcat),
1 q; C) g F( v6 a! g
8 Y/ Z0 s# i6 q% E6 \' s. H/ @ array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
/ T4 }6 z. W: _( X Y "id" => $shortname."_featured_number",
" h5 D9 S2 \4 X* Q7 q' {: Y+ @ L+ _ "type" => "select",: t: M3 n' x* o) l: Y5 q' C8 [
"std" => "Number of post:",
0 l& l$ {8 e: z% u "options" => $number_entries),& [( }1 p9 L# c* e Y' ]5 |% M
; f, M+ X. X+ o v$ F* z
array( "name" => "</div></div>",: N- j( Q" u& {- l1 Y2 f1 b P1 a
"type" => "close",
: ?/ R8 H t& S3 l" H' h4 b$ g ),
& i n8 q8 A9 P+ D6 S
t6 R: `9 S5 U' ^4 e: S array( "name" => "Featured Category Settings",1 H P. C" ^, [7 M
"type" => "heading",: H, _" Q) U4 P* h m# X
),$ _* b9 S1 i3 q7 _' ]. s# H7 ~
4 t0 V; v4 Y9 d6 p/ K3 c/ B- x array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. f" l/ t3 o6 G
"id" => $shortname."_featured_category_activate",
: Y% j5 B! w# I* h' i [7 Y "type" => "select",% N9 [0 p2 E4 ]( Q5 Q; o
"std" => "No",* q+ A0 y4 o- A5 x$ T0 Z
"options" => array("No", "Yes")),, |* g# g+ y$ _
; k: P; R% S) w array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 y3 g% [" j4 N; k8 }9 f' D3 k% M "id" => $shortname."_featured_category_id1",
}0 r ?. u/ e6 J* y( _( y: \ "type" => "select",$ c3 O9 M. B( m0 C3 B( a
"std" => "Choose a category:",' Q, {( u {; k. w j2 U4 ~0 J
"options" => $wp_getcat),
* ?, y3 c) ?" [9 d( l( T5 d/ W
: z2 T+ t% h* O# D array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",$ i1 y3 M! |* Q: c
"id" => $shortname."_featured_number1",
9 b8 i( |- i, J6 r; i$ q$ M8 R$ o "type" => "select",
8 y1 s! X! q3 f3 O1 B& y n$ K, L "std" => "Number of post:",
$ n- V) ^1 ?( B$ C! `! k "options" => $number_entries),! N- H) Z. _+ J( H/ g* M, x
' T' Z/ A6 E% v7 M Q! n# @
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
9 e% T1 l; B" V+ F- [% j$ D "id" => $shortname."_featured_category_id2",; B% V& s0 l9 R$ ^- u
"type" => "select",
. Q* I, k5 i( \1 ^9 R. i) U "std" => "Choose a category:",4 Q& f- a" h- V( U% b. E
"options" => $wp_getcat),$ i3 y$ J8 M3 {3 |( m& k
0 L+ ^/ a/ h4 i( W i' T! R array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",% F+ }3 y L" H( S7 x" k* ~
"id" => $shortname."_featured_number2",4 U6 J: ?8 K$ G
"type" => "select",9 _) L% k- C. k% l
"std" => "Number of post:",% |& j" q5 [+ \0 c7 y: s r k
"options" => $number_entries),
) z6 ^- H- m! J. |& s6 T 3 c/ h. @0 L- f) u! t4 ?" t
. A0 X% Z7 m A: Y) D0 Z7 c array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",) `, Z" \9 I* S( N
"id" => $shortname."_featured_category_id3",
' S* Q) o3 [9 u O& a6 n' i "type" => "select",) K) x/ ?# o v1 `: ]
"std" => "Choose a category:",6 W6 a8 V2 _5 I
"options" => $wp_getcat)," ?4 e* R6 x& f7 E2 d% Y
( M. {, C0 n7 F array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
) I6 L1 h) E: k% q. B/ x "id" => $shortname."_featured_number3",5 w: J3 [2 m. ~' z$ C& v' k% g8 e. {
"type" => "select",$ l7 n; F* w+ Z* E) L5 i0 h; u
"std" => "Number of post:",% s. Z8 b) Y" u
"options" => $number_entries),
w( J3 X; l9 L& j" z. E* ]9 H
( M5 s" s- ^2 T2 V8 D$ `1 l3 B$ d7 t N& }
array( "name" => "</div></div>",- W5 H1 P, Z" j5 |+ n
"type" => "close",, w3 d. @3 {9 H/ K! V3 F
),
0 J6 N9 m# o# ^1 f8 r Y, ]: o+ V! n
: K( C' @# B* O" U8 r
array( "name" => "Google Adsense & Analytics Settings",* F& t! p; ]! G- l/ N4 `
"type" => "heading",* n, h& r- W: a0 x* n2 H ?( b
),1 \0 N9 V( i) [8 Q; o7 F
5 w; f2 Y+ V2 a4 }# ], A
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
; S+ n4 P0 a2 h! g1 }# l% k "id" => $shortname."_adsense_loop_activate",
) e+ V4 d4 z+ \4 |. A "type" => "select",- |" P) j' b5 P8 u' b3 q
"std" => "Disable",
0 p# H* S2 |2 H4 ~/ S "options" => array("Disable", "Enable")),, u3 b+ W) ]3 ^3 [
0 m- B# q# B9 k; C A array( "name" => "Insert Google Adsense Code For Loops Here<br />
# w! R8 l- N5 F$ M: A0 L <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
! {$ l& n6 O" r, \' ], H5 D2 ~$ i' Z "id" => $shortname."_adsense_loop",
o; o$ Z2 }5 `9 W "type" => "textarea",
0 @/ J1 o9 C0 e0 z% T/ B" E$ t "std" => "",( N: s0 A7 n4 M2 t- Y( {
),, A1 L# l: Y+ A' c% T
9 t! M3 r7 C" v# P, d
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",6 K. W, B& Z* w& s
"id" => $shortname."_adsense_single_activate",
5 i: g! U: ]; X4 s$ B, h7 s- o "type" => "select",; C- t+ m5 {. _& ^
"std" => "Disable",; ~4 v# R/ _% n8 k( l
"options" => array("Disable", "Enable")),/ a8 I% L! C+ s
5 w0 `/ Q* q u; k5 o
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
1 _+ |: J% Q6 ]& g <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
( a, o( h2 Y9 N! l( b+ A5 ^2 E "id" => $shortname."_adsense_single",
# ]/ t5 n6 W: f9 l! ~ "type" => "textarea",5 r; _/ |) E9 r* J: K7 y
"std" => "",
( D6 _( K$ Q: r ),1 p- C) U1 H6 x; R* h
1 C% d1 }3 S: `. o p* [) u+ E
$ e! }' s" s$ C8 U, w
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",) {5 ~, r) n6 q1 }5 V# T3 T# B
"id" => $shortname."_google_analytics",
; Z; P4 a( K3 d; M1 m "type" => "textarea",
0 m" f: C, p- v- n+ d: Z "std" => "",
0 r( a; ]* u4 Q, c) }2 n ),$ g& p' ~8 F$ h. m+ B
5 t. I$ a* J/ F array( "name" => "</div></div>",- S! t! H& O- N& J7 S
"type" => "close",
6 G8 {" z* b0 y$ K ),
4 p- e) {* |* x1 f) j$ X7 V
7 M; Q2 ?! z, Q. Q7 P: b
0 K4 F2 T2 i% f" @" r% K* w* o array( "name" => "AddThis Social Bookmarking Settings",1 \4 R, X* w' @0 M( U
"type" => "heading",9 B k9 ~9 G; s" L1 ?/ d" K& C
),, c8 H, t6 Q: V3 H- s. a
! K2 P2 o1 T9 z! W$ `4 U
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
2 e6 B9 f7 E% l' w) O0 K <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",6 h# M# W! ?! _. f' |
"id" => $shortname."_addthis",6 H. Y0 @% w; |; V! X. D, [
"type" => "text",
6 J. s8 K2 r3 \ "box" => "social",: i7 E I m3 I9 V4 ]4 W
"std" => "",: u. r3 c4 |. J* q
),( B# }; _/ B/ e$ n ^4 a- y" n
- |' h0 m- |: ]' |5 ]8 i array( "name" => "</div></div>",, P& L$ P) b5 V
"type" => "close",& T P' ?( \" g/ P: m
),5 \9 n# E$ S3 A, ?8 B1 o0 E& Y
1 m# d3 q& A9 A) _0 i
- a# s4 f& s7 [ / r! S7 p) [0 D
array( "name" => "YouTube Video Settings",& H+ q, I# D& p) M6 L
"type" => "heading",
+ @. F4 T6 K" H# g ),
$ M. e! ]/ h3 K! {' e1 m% U/ r' u" g' A9 F m, K; j
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* D- S6 _6 c v
"id" => $shortname."_emvideo_activate",9 w8 g4 E% C3 ^ R
"type" => "select",- T4 |: C8 o" h1 U% `) q) v# }
"std" => "No",3 c2 o9 L5 |, l9 G" I m/ w5 G4 V
"options" => array("No", "Yes")),
6 Y8 y2 i. X: F1 U% D6 n# Q7 k! Z0 C$ d3 U, \8 ?
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
" a2 Y/ u# f! r5 n! T4 m+ }- r "id" => $shortname."_emvideo",( a, d) p! T0 c8 B" r
"std" => "",
% m! y& g5 ]; X& j) o$ W1 r% i "type" => "text"),
% Z: z- H* h# c& d w U/ t8 c5 o, c. ~6 w
array( "name" => "</div></div>",7 P+ G1 Z" R6 v5 |' k: P( O/ y, o9 r
"type" => "close",. O. Y% d {7 Q9 ]
),
! |4 L( z# m4 ]
' q% a, I& b5 [( { array( "name" => "Twitter Settings",
6 d& [, G$ P- G. d1 S "type" => "heading",+ d0 q% D# `3 x
),! h5 M5 u' u! F$ {+ n$ t* Y: ]5 z/ P& _
A- h) d1 b& z! f9 ?5 ?1 q
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 V+ o3 B4 Q! a; F& M: ^% L' x "id" => $shortname."_twitter_activate",
! O9 {7 ]' c' R( W2 U "type" => "select",
8 u' i% c* K$ d4 K "std" => "No",
# U- Q( R. S0 g, \9 \ "options" => array("No", "Yes")),2 S; t, L. {0 a) a+ B+ L# ]7 I, D
- e% d! q! M) f' b: A
array( "name" => "Insert Your Twitter ID here
2 y' Z- |" ]% O0 n <br /><em>*leave blank if not necessary</em>
6 d/ |- O# m3 N% L <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",6 Q& z: Q- v+ E6 ~5 ?1 P; |
"id" => $shortname."_twitter",
! `" R* T% Q" c+ K "type" => "text",
& K* S2 c% K" q: {1 j2 ]6 C "box" => "social",
* k! ]) J: R: G9 y# ~6 M* l "std" => "",- n* d5 ^" o9 O. N2 t
),% N0 I" V( F- N
1 q# @0 a( ~1 A8 h% _9 b0 V2 N array( "name" => "Enter Twitter Feed Count here
- o2 I3 o% U$ ?* [3 ] <br /><em>*leave blank if not necessary</em>
! w% X& \5 m# k/ Z8 _ <br /><em>*Enter How Many Twitter Feed To Display</em>",' p# h6 a3 T, D4 i
"id" => $shortname."_twitter_count",
; @' Z( I* D) b# h "type" => "text",' W) g& ?5 K, B! z! ]
"box" => "social", |( Q5 ~ T9 t- ~1 `
"std" => "",
- O. B* C/ e+ V+ G1 G/ l- m3 W ),, o2 K- o5 u1 q' ~0 b
; E% q n/ T6 |5 R! w. K
array( "name" => "</div></div>",
" I! p) h8 M; z0 S; e "type" => "close",' W: O$ P( T* C5 o) N K
),( k; l3 [2 V6 E5 P7 M' q4 _6 k
5 D) D' N. R5 z! S1 Y& {: z
) L+ k ~4 N; f9 Y* [
array( "name" => "125 x 125 Banners Advertisement Settings",2 b2 R; d, W6 G& E5 j
"type" => "heading",
9 d; P* j2 H" Y: I5 V% a ),$ r+ i% ?' ^2 S
* N/ V# P) B/ t array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. ^( ?2 k" M9 s4 z1 N" S
"id" => $shortname."_sponsor_activate",
5 l4 x C* q# E2 H m! X "type" => "select",
: t0 E5 E: h1 R5 X8 p "std" => "No",3 E) @! Q, x) e# l$ ]( X' I! Q
"options" => array("No", "Yes")),
& s) N9 o$ m: F' x& g 1 ^- P, S! \. e
( S% W8 z# A& m& U' [3 L5 T array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",1 j) [0 Q, J# C0 F
"id" => $shortname."_sponsor_banner_one",: t5 ? Z6 D6 C0 J( B; }
"type" => "textarea",
4 X- o( s# O& O) [ "std" => "",
5 @* m3 B) y/ S2 z4 [, | ),
0 ^6 q, K8 M/ F3 {2 V6 p! ^: q0 W
' i% [0 S9 {) I) D4 ]# W+ ?) B array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",4 L3 C2 J, Q3 G
"id" => $shortname."_sponsor_banner_two",
. k3 r/ p5 V/ l2 E5 c/ _( y1 r4 k "type" => "textarea",
% B- G' E4 ~ l9 E$ ~ "std" => "",0 [- h' q6 o! B2 X, ?/ [
), M/ V! \/ ^0 c6 G- H. J
9 Q. s/ I( ~* _$ ]
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
5 E" _% L* c* v" N' w( H: [ ` "id" => $shortname."_sponsor_banner_three",
7 Q: q! Y6 I* m- a# J0 V* c. Z "type" => "textarea",% k5 m. I- E- ~5 q
"std" => "",
, q9 {- o+ s! p$ f9 I3 [( y ),
\2 a4 U& g: x* c. U# j. O' a7 T- V X9 z0 k: R6 u8 U8 X* y
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
$ K; q- J' H1 Q "id" => $shortname."_sponsor_banner_four",. s) r6 x: W; Q
"type" => "textarea",: }5 J6 p6 H5 }" U! w# |
"std" => "",+ [* N O; i) s' z; X
),
1 R* L" \: K% p" i/ ?) F n( B% D9 c1 c! N
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>"," O1 _4 F4 r. A1 x# m7 f
"id" => $shortname."_sponsor_banner_five",1 k. p; X( J) V6 K
"type" => "textarea",4 k! R7 ?% Z* @+ s% s0 Y
"std" => "",
9 H6 Q% q4 l8 p! |3 }" B3 C6 l ),5 E4 @* V) H: |3 o, U0 G3 f% G
. j9 g( ^! x( c7 l4 b3 g
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",, X" r) H }8 r
"id" => $shortname."_sponsor_banner_six",
G" ?* H5 Q6 K/ X$ F4 v: k5 F5 S' S "type" => "textarea",2 r7 `$ l: C# \* }
"std" => "",
/ i; e/ O2 @, d u3 X' } ),' T6 O$ i2 ~% m& o( l( g
& J) ], j( Q5 b4 c- Q: _ array( "name" => "</div></div>",
3 i. ]3 R7 Z% r* K. m9 A7 }3 { "type" => "close",) c' F1 ~5 H: [. g' e
),) ~5 m3 z6 D. @# y6 V, @1 c
+ S- L- R' t4 ~' X, E8 o0 f5 |) C' ?0 Q8 Q+ W
4 B6 ^$ A3 M3 R1 ]
);8 k: q4 t2 d/ E, {; S6 Q
' d. [' j3 S1 Y1 {5 q1 V
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {1 W- B% U/ G% K; v. R
) H0 o2 Q$ [( s- c# g: s3 Jecho "<div id=\"admin-options\"> ";$ O* ~' f' b7 o! ~
8 X3 @4 M0 p3 n
global $themename, $shortname, $options;( h+ {4 v; N6 ?8 a, p" S, G) {8 l' [. M
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
$ z' [, W7 Q1 P- I" Pif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
' K+ R% d, F1 |3 w?>
! j7 |, i A; ^" {1 K( d' A
$ T V# {" {) Y) k S4 z<h4><?php echo "$themename"; ?> Theme Options</h4>
* m0 P6 N6 g. X' x* g5 a9 X, @9 {/ J% R$ J) C v
<div class="annouce">
/ @' e% b; u. u1 P- V/ I<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
1 D1 C/ a# d+ B p( J<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>/ e2 T* F0 \4 \- ~4 X4 Z
</div>( O1 p }" E* C6 [! A6 m" m1 j
+ C+ w+ P7 H7 d0 M$ V# ^<form action="" method="post">
1 f+ a, v+ I: {+ T' g5 T+ p
, }! ~6 O1 a) [/ j: g<?php foreach ($options as $value) { ?>
- B. A+ W9 L3 J, {" @! R# |% q: v! r' P# W# ^" \8 |/ V4 O* \8 k
<?php switch ( $value['type'] ) { case 'heading': ?>5 {0 @( D. ?5 X7 @
0 p f/ i7 D! {9 C
<div class="get-option">% M; |3 K1 ?2 J. D) m+ f! I- v
~3 o2 R, O9 s( q: e+ c
<h2><?php echo $value['name']; ?></h2>/ n |6 a, z# Y+ [! q
3 M, n) |$ O3 h7 F, Q2 r& U: Q
<div class="option-save">
~* v, R2 P# y
5 I' b9 K" F( w: Y: Z<?php& ?9 R! Y% o m1 b
break;
7 n$ F/ Q% g3 q2 C7 }case 'text':6 ~# p6 c. U ]2 i
?>, W: K8 T- h+ W( S, ~" n
2 b' ]7 ~* q! d0 _3 s
<div class="description"><?php echo $value['name']; ?></div>
9 u$ S* S+ _- \" g/ j<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
0 |. ]+ E) M$ c- z' g2 h/ ^7 [2 z5 S1 ^% l( n8 Y
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>( R0 n8 V+ a% F2 J2 l
7 t$ V8 I, p3 s<?php' R: A, M7 n* ?( N
break;
' H* C. [0 J% lcase 'select':
; m b; [& ^0 d" o' A?>. A; a2 E7 r( r
: K! Y" ] o' h, w* ]<div class="description"><?php echo $value['name']; ?></div>3 R( Z6 M8 L& p: ~) O
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">% [$ ^0 S. ^0 D3 b* f4 U
<?php foreach ($value['options'] as $option) { ?>
3 b |% m \! T" `5 K+ H/ j* c<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
% R O- c7 W2 k, s7 G<?php } ?>
' D1 @9 g- R( E8 ^- \</select>
( F* Q) A* F6 K' d, N</p>" C) i( G- [: O' R! X
5 i4 L. Q0 i8 _: g- m
<?php! a w( B( s \# A5 ~5 L: j
break;
- S: U# Q+ A. @3 X4 I$ Kcase 'textarea':
; {! f$ k6 t2 o* a Q$valuex = $value['id'];
3 r$ H) E9 x; M3 p/ c: r5 O5 |$valuey = stripslashes($valuex);) v# I- A/ ^/ B2 m2 u
$video_code = get_settings($valuey);
/ L: |3 X4 h2 L" z?>5 m: N) F8 l$ }, q& y- A
/ h1 U2 g$ T; @, p1 |<div class="description"><?php echo $value['name']; ?></div>$ Q0 Q, W( ~+ h. C# p
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
% G; L9 [# c& ^ h+ P: j; d0 F* |, [6 ~3 [8 F. r/ C
else { echo $value['std']; } ?></textarea></p>
: ~0 {1 n0 |/ {2 O8 s6 h$ F0 L, q) S
<?php7 J8 x4 A, w7 p7 K7 x- O
break;
' \7 L W1 Y) X: Q7 L. Vcase 'close':9 U7 u; I! n8 c+ e8 H" r/ M
?>3 O1 h" C7 C6 q
% R2 {: R p1 ~2 X
<div class="clearfix"></div>
. L+ v; y6 z3 _7 p, e</div><!-- OPTION SAVE END -->
( B# h1 A1 h" s& R# {5 {; c& \9 ^3 l( `' K7 k( t8 [8 K
<div class="clearfix"></div>
7 O/ @: ~" o8 j7 T</div><!-- GET OPTION END -->
! k& t" F. ?& w- p7 j( Y1 S6 z$ D
<?php; T7 v# X2 ]$ g' }: o
break;
/ S0 o; z: I% Bdefault;. \1 n7 }+ F% ^6 Q# X# F3 h
?>
5 u8 I3 U2 r1 M3 ]! z( ]4 l ^ _/ N
5 y* M5 y, c3 _+ b<?php
+ }: }' P$ V+ Xbreak; } ?>/ o' L& q r* z
6 _# b5 V. I" v& {- g<?php } ?>( _; e+ y( J5 `5 M+ J6 |
6 P3 k4 Z# m; V: B2 M
<p class="save-p">3 X; W. l [( m" R8 M: h5 }
<input name="save" type="submit" class="sbutton" value="Save Options" />1 H0 J2 y5 T; I
<input type="hidden" name="action" value="save" />/ O z, U4 S% k: x6 Y
</p>
3 I9 J% c( c; i" S</form>
- I, ^/ o& ^( x* B% }3 W* [
; h6 w! u3 F, a4 b1 x0 z1 R1 U<form method="post">; D8 T& s# F3 v _
<p class="save-p">
9 B. Z: g0 \' [& I; A<input name="reset" type="submit" class="sbutton" value="Reset Options" />
' o! L' [7 u: F8 h1 g<input type="hidden" name="action" value="reset" />
& y: ?- \, N2 d! l* J0 ^7 Q( C</p>
' _& T0 ^3 N) \" y- r) \9 \</form>
- g* z& W% u. {1 @
: b7 U! L; V R$ a$ q</div><!-- ADMIN OPTIONS END -->2 ~7 m% s; R3 K% x
5 z- C' F6 G( X/ N+ I: `* B
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }5 J/ ]) v) X; ?+ D9 J& J6 s- U
E( b; R% |& X9 _8 f! X% c
function mytheme_admin_register() {
1 v \ s9 _8 O! iglobal $themename, $shortname, $options;0 \8 g, u9 O1 ?1 z
if ( $_GET['page'] == basename(__FILE__) ) {
5 ?1 C1 l( V" q4 ^8 f0 fif ( 'save' == $_REQUEST['action'] ) {4 [& j3 o7 q$ K0 s
foreach ($options as $value) {
9 P) W" s: q" h: n4 }, B2 m! ]! Wupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
7 n7 N7 W! g E, v( ]; C& ?5 c$ fforeach ($options as $value) {3 G& N* N2 W4 k3 j9 N) {0 v6 O
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
3 } h& V. q& S, W2 o: Q _, Cheader("Location: themes.php?page=functions.php&saved=true");* S$ V2 ~) d- U. p
die;
y; y& D. g+ ~; \) R; @' |7 _} else if( 'reset' == $_REQUEST['action'] ) {
2 p% s5 | s+ a8 C- a& Aforeach ($options as $value) {
* A' d2 x4 P6 F) B/ Y1 g; q. bdelete_option( $value['id'] ); }
- [7 v* ^5 x6 \header("Location: themes.php?page=functions.php&reset=true");
6 G( D; Z9 w+ ~ e5 V! |die;. N! }0 o; x- H1 {
}
2 l' B* U( k* `}* Y; C3 ]# `" F% |" F4 p! i
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
+ M( t7 @9 W& b; c7 i& }/ g8 v}
: ~) _0 M1 _7 s# h& L
8 {4 ~: k5 \5 p2 L/ ?- j+ F- wfunction mytheme_admin_head() { ?>
- p5 Z) i3 g+ q8 ]0 L<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />$ A N1 J4 ~% V U1 }
<?php }
' Z9 X) |4 V; r+ ]3 V* I8 U6 Z |
|