|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
: t; V' f1 Y) y// Theme Option; B6 w8 ?' z; x j
////////////////////////////////////////////////////////////////////////////////0 {- ]+ {6 ~4 w4 d) ^1 c4 A2 x6 K
! W; A4 H. C% D/ F0 w+ n2 p
$themename = "Zenx";9 S% b9 o4 o* \2 e
$shortname = str_replace(' ', '_', strtolower($themename));
: i# e& w& u/ {* W
( v8 L3 ] Q, w7 B5 E% M4 yfunction get_theme_option($option); g& O6 c& k4 `5 U
{
9 Y# n( A# t Z) s4 N& X global $shortname;
/ n6 [( U3 |* L8 U return stripslashes(get_option($shortname . '_' . $option));
/ g- k( S1 \$ p9 B7 t; R7 K}
# g H" |* W# ~% U3 G7 H/ _6 Y& b# Q
function get_theme_settings($option)$ u/ k! B! Q0 C& o
{
6 L/ {+ j' x" C. H% N& t/ m return stripslashes(get_option($option));9 ?/ e4 r) j; R/ b) R, \" V
}! K( x0 h% P0 h; @$ P5 H( q* e
$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"); }0 y4 R* U% `
$wp_getcat = array();
) h) }/ W# }# [ ^: b! h, qforeach ($wp_dropdown_rd_admin as $category_list) {
# h5 v) z( O% m) p* G' ]6 b$wp_getcat[$category_list->term_id] = $category_list->name;
6 o& g! Y, v8 v; P+ T- W}% f- d' ?4 x+ `% K% h" E/ I
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
( {- b8 a' |. i3 h8 C' R$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");0 n! B& U9 ^' _
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");- {2 a( P* W0 i: a/ R7 H9 E
/ m3 a6 y! J: A& S, D8 Q3 R) l/ q$options = array (% G2 H8 l# v9 E
3 B6 D6 ]- z% Y* Q; J
/ {% Y+ ?1 i8 z) V( ?$ t3 l i array( "name" => "Blog Header Settings"," s# L ^- z3 L. ~: X9 } q. ~
"type" => "heading",! x) d0 P7 R' d Y% C- d
),
% o/ x! X2 f" I$ H# V* g2 k9 ? x; N: s
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. G, ~5 W% Z7 Y# C* g "id" => $shortname."_header_logo_activate",
9 \5 R+ j/ G$ v% u3 O- d/ r "type" => "select",* e# l. p9 X1 f# a; c0 f0 a
"std" => "No",
3 I# C) ^- B @. p$ H3 C* V "options" => array("No", "Yes")),5 f: \$ v, A$ @) o
- P) y0 b$ z0 q2 t8 ~# u' j6 h+ a array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",6 z. t! y) Z( i: j
"id" => $shortname."_logo_url",, F3 H- | ?, X6 w& j- J7 C! o
"type" => "text",
2 X% Z* C2 \" ^& F, J! T9 Z7 v "box" => "social",
% |' W6 T4 ~# Z A: x. o& p "std" => ""," n/ l# O9 B) O1 A
),# |' N; j+ j3 [! q% j
/ g. k1 i& Y/ V& n, x. [ array( "name" => "Insert Header Banner HTML Code (Header)% X5 u* t, |3 R
<br /><em>*Recommended Size 468 x 60</em>
{4 C' Q/ r6 \# J) Q& H <br /><em>*leave blank if not use</em>",, R h. C7 V$ a; q
"id" => $shortname."_header_banner",
* R6 t8 P: Z7 i4 w7 F9 @ "type" => "textarea",
) m3 P0 b+ Z$ J "std" => "",4 F) W2 \. f' a7 P# C2 _' s0 T. g
),+ X: G0 k0 o& F& D, L5 M2 D/ C4 w/ m
7 M, C3 r3 P3 T" n' V7 \. q2 N7 k array( "name" => "</div></div>",
7 I* ?' U1 y/ o7 E) o) y "type" => "close",' s! w* s5 ^# Z
),
- p- b! S% \2 G" {3 {# r# ?
6 A) m' B+ w- E1 V& t; [
! M9 g8 K/ A, l4 P6 w F% U& o/ _1 e5 Q array( "name" => "Header Navigation Settings",
6 C- _* t1 {* b, k0 F% P2 W "type" => "heading",& H% y" V( N% Y0 a# K/ @0 W
),, a+ c: o( Y5 ]* K5 c5 I% B
' e# ~; ^4 y2 e m0 t array( "name" => "Insert Page ID To Exclude On Header Navigation<br />, t4 j1 w5 S, Y1 W! p0 F6 w
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />) D% ]4 v7 J5 C
<em>*Enter the page post ID number only</em><br />
3 L C; I' @7 D6 X <em>*separate by comma</em><br />/ `. |& I8 ?/ j$ O0 [" B2 c% S! k% x0 x
<em>*Exclude pages which you don't want to show on the header navigation</em>",
! ]8 c6 ?( o# c. V "id" => $shortname."_header_page_navigation",: w t3 e! ^: E" }; u$ s" s
"type" => "text",4 _" W" j8 k9 }) N
"std" => "",
( P+ T1 q: M! [9 ~9 T ),
5 C2 K7 x: A$ S6 n0 X, P9 V7 }( L" K/ W+ n+ r6 C: i/ j1 p
array( "name" => "</div></div>",
! V* r: D/ Y4 ?8 \* s "type" => "close",
3 |! c/ T# T ^9 M3 B" x ),
+ @" R6 P3 M+ E* V' c# t 2 J3 ~4 L5 z# M b/ E0 p8 T _
; T, ]9 W% g0 q0 p. G9 i
array( "name" => "Post Auto Thumbnails Settings",
$ ?5 [0 {: [ ~" V8 F* _! ~; b( E "type" => "heading",7 i# J3 M1 K" }8 l/ H
),: i0 Q: y2 _* _# G4 h
( u6 F/ ~0 D$ G a+ W% U A+ E8 K9 T
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",, U% c' x4 A' v0 O
"id" => $shortname."_timthumb_activate",+ z! [0 Z% b/ I$ ]
"type" => "select",+ J9 w5 o& h8 v8 V$ V1 u
"std" => "No",5 j I3 n# ?0 Y; t' }
"options" => array("No", "Yes")),- S8 n% W0 ]4 s+ d/ O5 U. z/ a
! I5 u' V+ M, _. ~% H! T) n array( "name" => "If Timthumb is enabled, Please choose its cropping method",$ g6 q0 R9 A2 ~& X$ p I# Z
"id" => $shortname."_timthumb_cropping",
4 A. T. A% u+ j( L "type" => "select",
4 J# z0 u# Z& R' B8 O. l4 w9 y) h9 w "std" => "",/ q+ }, l; P6 j5 D# `; y
"options" => $crop_position),
5 _: q1 Z6 a6 [+ |6 U3 `2 L" t( J0 W: W9 z
. K8 {4 \ ]. Z0 M x array( "name" => "Insert Width Of Thumbnail Image<br />+ Q7 s* P( J1 ?- b4 D' a% ~' `5 T
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
8 h7 V( _7 v: i. r <em>*Leave Blank To Use Default: 250</em><br />", [. ~- Z4 k1 R; E9 Y
"id" => $shortname."_thumb_width",
3 t1 X4 g4 e5 O- E1 d; ^ H7 j "type" => "text",
% V' `* p1 s8 h! N0 [! S "std" => "",. A/ L; m; H: S2 u1 K$ G( x* j
),0 ^% y1 a' b5 w9 L0 X; r
, l' L* T$ l4 Q1 b* Z# a" v
array( "name" => "Insert Height Of Thumbnail Image<br />) S4 i1 J: J. y; M2 T: z$ ~
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
' W) j; Q( L9 k4 H <em>*Leave Blank To Use Default: 200</em><br />",
3 x- V! Z' p" i0 y- D "id" => $shortname."_thumb_height",
; b H$ N* ~4 r- b5 r' m "type" => "text",
m! p) H" v6 K! k; s9 @; c0 i6 W "std" => "",0 _% X% \ ^: ?- v# t
),& j1 }; c/ C7 G
# P+ x4 V5 G* w- d* J4 S
array( "name" => "</div></div>",
% q, H: g, a- T' ~% @' Z "type" => "close",/ s6 Z2 e& c; V5 c6 K6 _( }. S% A
),
2 Y1 D8 }' s& M- A9 N9 O! S$ j# U: g0 ^, v" h( @, A
array( "name" => "Featured Content Slider Settings",
7 D8 h' R9 s7 U- q "type" => "heading",
1 E; F) x( }' `5 h& }( W9 m" s ),
* {- |# X) k% l0 C' Q
. Q, B" S1 J' g% ? array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% c1 B- e* e: t# ~8 Z w/ W0 r: E "id" => $shortname."_featured_activate", b+ x) u# x2 y8 k h4 Z' n
"type" => "select",2 P y. h; W7 Z$ D1 y% F) c
"std" => "No",
" `9 _, L) ?/ [- X4 Q% d" u4 u "options" => array("No", "Yes")),
$ D& Y9 ?+ } l% G
, D. w; H! j* D! Q
; R' L2 D' ^9 H6 X0 B! C7 \ array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",) }+ ?6 F9 n8 \2 x* X8 a0 B
"id" => $shortname."_featured_category",3 M0 y! q x+ m' k& O2 b7 j1 B* K
"type" => "select",* O) B. J9 ?0 c; X" a3 _9 P( k' q
"std" => "Choose a category:",* e8 G. \% }" Z6 A3 C
"options" => $wp_getcat),! X/ G4 G H! S. L; |+ u
2 S& d9 J. r( }; [
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
- j& [* N! I) G# h/ Y! A7 X "id" => $shortname."_featured_number",
+ b9 x3 o/ f! @) t/ d' F "type" => "select",
' x5 e' \4 w9 K. U0 f& N3 ~ "std" => "Number of post:",
* Z! Q1 ?: D P9 ~% K- Q- l6 W "options" => $number_entries),
) O+ J" c: e2 p) e
" U3 x9 G& t5 k6 i/ g array( "name" => "</div></div>",
, t1 \0 X% ]4 p "type" => "close"," d/ Y4 M0 ?( s+ N! Q# t8 \
),6 }; \0 t# o, t3 p6 z8 z
6 x: A$ \5 \7 m& t1 m6 m- g array( "name" => "Featured Category Settings",
5 T8 V N; P2 @) H "type" => "heading",
1 p% D, ~% | J, z ),8 F4 C' o" T7 U
' ]% Q7 O, V) |% f
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
, b1 b" U2 p' t: ^7 v S8 Y3 ] "id" => $shortname."_featured_category_activate",# V8 q6 @* R! F6 u
"type" => "select",' W/ m- S8 K2 E4 r
"std" => "No",
+ _% m& I) b% E! c* N8 l "options" => array("No", "Yes")),
4 |- {) Y9 d0 ~# v
0 J: h3 |' u( _* H$ x- { array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
# J- W) n% A- J- [( j "id" => $shortname."_featured_category_id1",9 W! Z5 Q" e1 p
"type" => "select",9 K: t7 R' N! U b0 \: o$ ~
"std" => "Choose a category:",
0 N9 z# I- h4 o+ \; @ "options" => $wp_getcat),2 S# m5 N2 p6 W7 }5 P/ t
' V# G% K& N* ]) r- `/ y9 c array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",6 R) ~- r+ X- w6 w4 v
"id" => $shortname."_featured_number1",3 {, E' y9 I* B+ y) x1 }/ U
"type" => "select",
% E! l! Z# c; Z "std" => "Number of post:",
2 I( K$ e; z" S! |2 ? "options" => $number_entries),
7 V5 p) r/ e& D' y, e
4 s7 |5 E% L% u9 L/ r! u8 ` array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",; E4 }2 C- J. A2 u$ C
"id" => $shortname."_featured_category_id2",
# }, d9 Y2 ^0 l2 ?. I3 F9 f: s "type" => "select",& b" P) C. g9 n% d
"std" => "Choose a category:",+ T! ~6 ^& }7 o4 |& ? f7 z C+ v
"options" => $wp_getcat),+ W) z1 d( t6 Q8 v" D2 \/ X
7 T) E& ]2 s# n' g' g& ? array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
7 P- f9 l6 Y9 N+ @# ]" [ "id" => $shortname."_featured_number2",
* u+ j# \& g( `5 @' J, e "type" => "select",; D( t5 e& N& d' g# a% i' c* J; ~
"std" => "Number of post:",
. M2 l0 H/ F0 j' K2 d' X, [ "options" => $number_entries)," b0 R) y6 I7 X0 ]; H3 x$ m2 }
' a: \- B6 S) }4 T+ l o
6 [) c1 h* d4 d2 G) P4 V array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",1 w5 H) ], `* W
"id" => $shortname."_featured_category_id3",
% n6 b' w. e D [- `" E- _ "type" => "select"," x) W% K1 E9 Z$ V, Z
"std" => "Choose a category:",+ G9 L1 G2 W; ^( a: j$ l$ |
"options" => $wp_getcat),
$ c# D4 T* ]9 o5 [9 B( w4 f6 c
. C6 ]" Y8 T: n7 R array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
, |/ {! x1 Z. ?* Y "id" => $shortname."_featured_number3",& A5 @. i/ q' j8 ~ _* @3 I' \
"type" => "select",
/ w0 j# w% r, K( a' S" i "std" => "Number of post:",: N2 a+ p, R9 k2 Q! m+ B% \6 T/ K+ O; [
"options" => $number_entries),4 W1 h5 }% W; j8 ~8 E0 F Z9 p
' H. I) K* [/ |! m
- |7 n; F7 h0 I8 D# @0 I/ g
array( "name" => "</div></div>",
# z" c3 i0 x8 Z( `+ L! Q "type" => "close",
6 p. k- S4 H/ j; i- E ),3 m H/ ]/ M% t T: F. r
; M, s" K& j3 G/ B/ R, q* K
& v: K* u, q: h. G: |
array( "name" => "Google Adsense & Analytics Settings",, n9 F# P6 J9 w O% c
"type" => "heading",
1 |- V* M/ K% a ),/ R ~2 V- _$ a/ ^) |2 c
! N ]9 Q9 \7 i) t5 ]: G8 H! z$ S array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
" \" r9 ?4 w. u `2 |& h8 j "id" => $shortname."_adsense_loop_activate",
; w# v8 {6 h4 I$ ]. I "type" => "select", Y; I% m) @" [6 A$ \
"std" => "Disable", r3 e; I( u: {5 c; ?+ I2 ? ?
"options" => array("Disable", "Enable")),) f K& O6 O4 N0 S b0 M J8 {9 T
0 ^) ?: R9 S& N9 |; i! _
array( "name" => "Insert Google Adsense Code For Loops Here<br />) i* w& ~9 z8 t' Z) Q' n7 i! Z5 D
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
( H c' l Y$ c1 j! x "id" => $shortname."_adsense_loop",
+ H% a3 F- O$ [ "type" => "textarea",
- q( K4 n1 o6 x) ]& i6 i "std" => "",. g$ F4 ?3 E. B# E
),4 Y% W$ m; S; @( U: r
! A5 _1 I/ r \" `
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
6 `5 c+ @" ^+ r {. e$ m7 _ "id" => $shortname."_adsense_single_activate",
: |) g7 }: E) N "type" => "select",
% U- i6 ~" V0 ?# A% @ "std" => "Disable",- U6 ^; l% I8 P' r# j1 v
"options" => array("Disable", "Enable")),$ F3 z1 I: q- e
$ V4 F! X) b5 c2 l4 z5 y
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
6 O ^ N& f+ p! F8 C <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, h) r, G& [! M: L0 D7 O
"id" => $shortname."_adsense_single",' ^4 o' R7 F' Q* b$ h8 z2 B
"type" => "textarea",
& F) H$ U; I) P, P f: C% u "std" => "",7 q, D( d: G9 K* ]
),
1 Z5 `3 ~1 N/ h) }2 i" O8 ]
- O* K" `/ f: f, k- v$ g9 x2 V+ C6 V3 N: T" u/ q
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
5 X; G1 B& M: q/ u7 k4 t$ N "id" => $shortname."_google_analytics",
" j9 T2 T- p% X5 U/ `% \/ Q "type" => "textarea",
5 c4 C; Z R8 }. e8 U0 ~ "std" => "",7 Y2 N6 T+ b; t$ U+ o4 x
),6 w, O p/ Z+ \/ x, S
3 ]. B, ?2 Y$ V) i) k$ [6 d array( "name" => "</div></div>",
7 s# K5 a, C& [6 f3 Z "type" => "close",
4 c, Y$ s8 G4 g ),! I. u0 N$ B+ v) K( t! `6 k6 a
( U/ f& q0 |7 u. b2 S& L* m
8 H% V' R; A% Q* R7 c( g8 x/ f
array( "name" => "AddThis Social Bookmarking Settings",' t2 k' Z5 K$ L* \) l
"type" => "heading",
5 Y) g; U7 L: P) T- L1 Y& {& | ),
$ [! c+ }3 U) Y) F
5 |4 U$ T: {- e+ x( b6 m: q array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
8 ` n) F$ P# V <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",! B9 v% B0 _- X6 \! G# t( k) U8 Q: }
"id" => $shortname."_addthis",
4 [" e; w' h2 P, t) N/ s8 `* v "type" => "text",
" x0 V1 D0 T& J$ S+ Z; l "box" => "social",, F7 C& W* q. g2 h2 w, z3 j, Q
"std" => "",8 _; p a( t/ q% F6 U& J
),
' [: Y( M& j4 \5 v3 u$ g* B
. r/ e2 v# }% M( r array( "name" => "</div></div>",
! g3 j4 N: q: B- g$ j0 r, y "type" => "close",! K# k$ o# O/ D9 h: ]# L8 m
),# i- v& r, O+ b" F0 X0 z. S% j& o
p% T! A4 t* V3 b+ M) J 6 W' I! `2 l+ H, p
! U$ q" F- G) w+ `3 h
array( "name" => "YouTube Video Settings",
" F% h5 C4 l/ w "type" => "heading",, r4 u4 V5 ]9 o2 ]# [5 I# o
),3 }4 b& V! C' Q! i
" ~. N- }$ R2 E/ C3 T array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 s! V, B: x( t: R. R0 k, Q" `6 n "id" => $shortname."_emvideo_activate",; d3 e D% w+ ~$ a
"type" => "select",' d* I, A: o. v' W& |
"std" => "No",
; M7 n6 I3 e9 j& ] "options" => array("No", "Yes")),* t. P* A2 n# O& q3 \) ^% J4 j
, n+ w1 m. W* f2 w } 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>",' }2 d7 j8 K& b. F, s7 N! P
"id" => $shortname."_emvideo",
6 R' j' u2 q$ _ "std" => "",
! U/ |3 P: `1 P "type" => "text"),
; B9 h% r4 Y% {1 g4 U$ D) B. h2 i& W9 C- q% K0 h& o# ]* Q( L+ t5 S* u* m
array( "name" => "</div></div>",0 I- g3 s1 s, I" v Q
"type" => "close",4 @8 O: O# g& T7 ^: L0 p
),
3 I' `) m. k* {7 O ' |; E* z1 j7 Q. k
array( "name" => "Twitter Settings",
- m' y4 n4 p' p# m! B# i6 K+ P "type" => "heading",! T! r6 \- C& @& R
),5 ?1 \, W' y q- ^& g" B
! |, ^. b7 n4 p& D) t0 }9 l2 o array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% g. S5 f% N# B2 t; f- @- q "id" => $shortname."_twitter_activate",
5 l2 S4 G; E; q# ? "type" => "select",
8 [! B- E% a! {$ Z "std" => "No",
! u/ }$ G0 J/ c( x$ j* t2 f" S+ [ "options" => array("No", "Yes")),
. |. V8 s& L2 \2 M
4 g) f1 y* M. R3 J1 {+ q array( "name" => "Insert Your Twitter ID here) n8 u+ R; D4 G% J8 K
<br /><em>*leave blank if not necessary</em># }0 c, D9 M. n4 L/ \) A
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",0 x$ r0 U' w# D) T
"id" => $shortname."_twitter",
2 f" A; l! _" @. c# ]) y1 r* H1 W "type" => "text",
9 o2 A$ e' F/ Q, D( l "box" => "social",
/ ]0 T# r* c- C* J: Y+ N "std" => "",( J6 [7 u- ^! q
),$ G; r4 s; f7 e n- F' I9 Z9 w
* M/ t$ H8 Q. D
array( "name" => "Enter Twitter Feed Count here
1 Y% J- V" L' B3 \( c) v <br /><em>*leave blank if not necessary</em>8 p# T: v3 `8 l2 g- l+ H
<br /><em>*Enter How Many Twitter Feed To Display</em>",
" @+ B( J6 M1 U! p o4 n "id" => $shortname."_twitter_count",
* X* E* o9 f4 e+ P- t8 Z0 d% I a. C "type" => "text",3 f% P2 [3 K6 _6 h8 J2 D6 b
"box" => "social",$ Y$ D" b" J6 v( t6 u! I6 `
"std" => "",- k7 l5 T1 t& Q% K
),
8 t9 Y. J" D- X( m4 }+ ^, Y8 q# O u. j& N3 o
array( "name" => "</div></div>",
/ N! u2 h6 {4 ~: |( ` "type" => "close",$ @6 p7 x$ l8 Z# t" g. x3 n
)," J5 r) |6 E7 o. t9 `- A
. x8 R* \4 L" R& f* Z/ L2 t4 Z2 V, }5 H' k2 |
array( "name" => "125 x 125 Banners Advertisement Settings",
- C4 x6 o; w. R* p "type" => "heading",* T4 K" U- v3 O8 {
),
0 B5 I0 S: P$ H+ X1 D$ [
) [* W" ]0 H+ y+ k array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
l Z7 n2 m: j2 o @ "id" => $shortname."_sponsor_activate",0 S6 r8 Y& w) z' O$ O$ \# _, V
"type" => "select",7 r" f' ], g0 l" q' A% r/ L2 O. u
"std" => "No",% Q8 p6 r5 T# d" J M( Y9 v6 D
"options" => array("No", "Yes")),
, J. ^6 F0 v+ d0 N& w5 J+ U ! x' u& Q% s7 i# v
, S: w$ L0 p, e( s3 T
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
J8 J4 l- |# H; c2 v! ~/ T "id" => $shortname."_sponsor_banner_one",5 ]' x, v$ c1 T" z
"type" => "textarea",6 w8 v$ v& ?+ ]0 i& c% b; l* L
"std" => "",
3 f- E! ]" h; a- w ), : T8 o5 |7 y1 S- g9 Z3 `
/ }/ D1 t$ A9 Z7 v, ? e/ n$ G3 Z array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",1 z- `. Y, D8 f/ l( v
"id" => $shortname."_sponsor_banner_two", E, |. X1 v! A" x, {
"type" => "textarea",
6 t' h5 [& T& _, @- a* \ "std" => "", C- f9 Q3 g( _6 `" W: B
),
6 m; m6 p& L6 |0 w/ F
: Z+ c2 Z$ E8 W. {0 j* a: \$ \ array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",9 K, C/ x( H0 G0 U3 T
"id" => $shortname."_sponsor_banner_three",
1 S# v- A/ P0 ~0 d. U! x I "type" => "textarea",
n3 n+ ~: S8 l) f h' n "std" => "",4 ]0 [- T8 g' W, A
),3 a; f. D. }" m
1 y2 x+ \2 G1 n3 ~: n' P array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
, L- u' f; @" { "id" => $shortname."_sponsor_banner_four",& r$ p) K& \' i% |6 y
"type" => "textarea",$ Y/ l1 M7 Y0 X ?* ^; j6 ^% Z
"std" => "",, n& R$ C" Z& O8 }$ X0 S* R
)," _" A# q- I. N# {7 C; a
( n% n6 V# r( ^: w1 P array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",* t3 }/ N, x% U- G, D
"id" => $shortname."_sponsor_banner_five",! Q0 ]6 t# U5 M# h5 B- p$ d1 P
"type" => "textarea",
# V4 Z s6 \: i; S7 Q "std" => "",
3 s- O! n! X# S1 V- w5 a& s ),: b& R) _1 ]* M) X9 U9 z$ x
' `* @4 s# c; F: [- K' q array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",! w7 Y) L& x/ W' ~, u3 X% Z
"id" => $shortname."_sponsor_banner_six",( q5 F5 K2 C4 b
"type" => "textarea",$ r& _. `$ k2 O* v4 F Y
"std" => "",( h: }7 i7 k2 R
),) {4 B: D8 R/ J
- `2 |) E2 v4 B# s& a0 N! y array( "name" => "</div></div>",
~# ~* n1 f9 q' X- `7 @ "type" => "close",* k2 o8 Y# p0 o. V6 S( F D! A
),2 @1 Q- Q7 K& U E1 `! h) _
# @1 B5 H2 `1 p; ^% S
0 R6 o! k4 O) l' a/ |
# [: x( w/ P# C- O g);+ e* s. [( c$ {4 X, G1 a( R
0 Z7 d2 M% g) z8 P2 F" hfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {5 `$ \% A! V H
4 Z! \! T c- o' s% L' Gecho "<div id=\"admin-options\"> ";, b( F6 p% Y2 Z( T) G, g8 F2 R
9 a2 |' t- q# U, ~9 Tglobal $themename, $shortname, $options;1 e/ N1 ^" |6 H( w
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';! v; G0 B0 d9 S/ z2 T# L; X4 `
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';7 s0 g& h3 m' F4 {/ ^( K+ A
?>
' w% W! f) [2 }+ d5 E0 T. f) l
<h4><?php echo "$themename"; ?> Theme Options</h4>
; n0 a4 |. s1 I
3 V K" l/ H5 v3 T D9 g0 o<div class="annouce">
8 Z% U u( d( Y! {<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>! b( i K O3 a# K
<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>
) w1 E. Z6 Y2 `& E3 I0 E8 z1 {</div>
- U* B, y3 y# @7 m1 S$ Q7 R
- z# l6 }: l# H3 R) C E4 k- f8 m$ X<form action="" method="post">
' X9 }# i- X3 H2 K5 d5 _& J7 W" a* i. j
<?php foreach ($options as $value) { ?>
9 r' G( M) v/ L' [6 N3 z# K! L( O6 n" f8 Q
<?php switch ( $value['type'] ) { case 'heading': ?>
. W8 i# r' |5 [% n& s5 O4 T" c6 X& H! s$ ^8 F+ v# `& u2 V
<div class="get-option">- A6 `! W3 m9 h" G4 U
) v9 K& F4 L$ U5 h% q
<h2><?php echo $value['name']; ?></h2>7 {+ I; T, S: C5 k$ e8 G! ~
: N. F& ]- s. E K7 }$ Z
<div class="option-save">
& \9 H$ J3 F- h3 g
8 z+ f1 W+ }5 d<?php
- M+ a" s0 R! G+ H/ Ibreak;
3 }: W: R% B8 c) s scase 'text':
* T3 [ E0 W8 S6 a) o?>
1 u. P% G- T, k; z
2 v4 H) n1 u( F4 I5 b<div class="description"><?php echo $value['name']; ?></div>- M9 ?0 s* b% D; i1 {- _
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (! \- G7 y; F0 v& L% L* F' X. O
1 P1 ^9 e; r2 d; k% S- A7 A9 z
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>5 t) f' a8 r$ k2 B% E$ Q
+ m ?2 X( K, }: o, Q
<?php. c( m( E* D/ j( B
break;
: H7 u8 m' G9 v& }0 d' Gcase 'select':$ p" |+ u4 p! ^! ]
?>6 [2 x0 m4 y( {+ ?; f! a
: O& d8 m1 ^# T% i<div class="description"><?php echo $value['name']; ?></div>
; U% \7 Z y9 O( |4 ~, M<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
& H# q' w6 ] e. {: G<?php foreach ($value['options'] as $option) { ?>' P$ i. Q7 u# c8 b2 x0 ], X1 D. [
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
& U1 u, R+ ^ O" b7 O<?php } ?>
3 b5 l% g* e& B2 G. U2 _) S</select>4 \3 B- D0 N( i
</p>7 ^% ?, @) w+ Z* K
% {: E8 P" M) m! k) r
<?php
1 f2 Z. M7 W W3 ?, I3 M/ kbreak;
& _, S, U+ `+ Ecase 'textarea':. U2 l3 G z0 U
$valuex = $value['id'];3 K) v) o2 ?- J/ O. X
$valuey = stripslashes($valuex);
G, E2 n6 y, m% k8 ~' u; V; C$video_code = get_settings($valuey);
# L- W' L5 U% a$ T?>
0 V1 s* ^0 g2 m( A( _& |- u. i( u3 f7 C8 ?+ D. z2 Q
<div class="description"><?php echo $value['name']; ?></div>
2 P8 C, O0 w8 C* r- L& x0 h5 K<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
9 e2 b# k% z) L/ X- z
* d6 \% F' s* C/ L% L; Q/ Aelse { echo $value['std']; } ?></textarea></p>. L8 d7 I; z6 m
+ s' \. f4 g9 d$ q/ U4 V<?php
7 i+ D2 X4 ]+ b/ z; |break;
- @, X8 W" K# Z. C% b8 I( [- O( e/ e* hcase 'close':
' R/ O. n u5 ~( k: l& i?>+ _$ H z, W' q: S
1 y$ n* _, C& ?9 P2 L
<div class="clearfix"></div>
6 d% _/ A8 n7 o</div><!-- OPTION SAVE END -->) I8 U2 C2 r. w3 j2 c; V w; i
/ J6 C i# Y+ K$ o r) e) P
<div class="clearfix"></div>
0 I4 K; n- v6 B2 w</div><!-- GET OPTION END -->1 z4 c% O- [- d
* _, C& c! Y% b<?php( K& z; C5 Q ^( ]+ Y
break;7 T) ?7 ?3 s. g6 c- T( w8 |
default;- _! ~, }: B/ m F7 b8 d
?>
5 Y5 ]! X4 c: w3 A
7 b9 Z! @: y8 I3 y( E" C8 S2 z3 u3 h1 P
<?php
6 E6 h* z6 R i" t) Q6 d5 V. bbreak; } ?>* Q9 {3 ?7 q. p/ _% X
{* U3 Z* [! I2 G4 s* F9 j<?php } ?>; E' L" M5 h0 q& m/ b. O
' t7 n# D2 h, b; N1 n+ y9 g<p class="save-p">9 v+ H; m. X" |& P
<input name="save" type="submit" class="sbutton" value="Save Options" />3 f7 H- b7 m6 e" S, g* b
<input type="hidden" name="action" value="save" />
# G5 U) \ Q2 h! {7 ]& T6 ^% a; d: G' N</p>
2 P: @& s- [( _, x" Z* x</form>
$ j0 l, J% t# `# i" O3 W. N i; x1 }5 s$ @
<form method="post">4 D) l. {/ K& }
<p class="save-p">
, ?& _* O2 t4 O" ?$ c% v<input name="reset" type="submit" class="sbutton" value="Reset Options" />
' v' }/ r8 L. w) o1 P1 U+ `) p7 `# }<input type="hidden" name="action" value="reset" />. @9 k2 N( H. v6 J
</p>
6 y* e, z% R4 L* a/ r, y</form>
$ @! B2 a0 N ~$ O; O3 v7 x9 r" g! p" G
</div><!-- ADMIN OPTIONS END -->
9 E' e1 Q2 \2 y
7 d4 v' R4 D" p7 {4 Y<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }( M0 ~7 K; r% s5 o3 u
+ d! E6 n1 z# [* i2 D4 Y! bfunction mytheme_admin_register() {' m9 B- A2 J- ~1 K4 n
global $themename, $shortname, $options;
( m5 U4 p7 ? ~7 _4 r9 {if ( $_GET['page'] == basename(__FILE__) ) {$ }& }2 M) \: M/ U4 c
if ( 'save' == $_REQUEST['action'] ) {5 r' `" [0 `: U7 g
foreach ($options as $value) {# W7 F) j- U! P, y
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
+ _& p2 P; Y' C9 }3 y W8 T A. Sforeach ($options as $value) {. k/ g' c0 `) f/ d- R, [' O
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
1 y" b m/ u. @! v" kheader("Location: themes.php?page=functions.php&saved=true");) |. @5 b8 K; n1 t9 V. T6 S
die;; D! `$ a" x- m1 B
} else if( 'reset' == $_REQUEST['action'] ) {* A! t4 a t, `# B* ]* D1 b
foreach ($options as $value) {
; A. R9 z: v& m* n& j6 edelete_option( $value['id'] ); }5 X# K6 C* [1 m5 G+ s& `* V
header("Location: themes.php?page=functions.php&reset=true");
0 i9 d4 K- e& a8 xdie;7 ?, j& ~& ~7 o4 B
}, U+ u1 L8 a" t% o, A) S, T1 C
}3 `: A @9 U- L% D
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
# p6 s7 ~/ |) A. ]; w}
`6 e) W# y+ ?
6 t# ]+ q* N3 rfunction mytheme_admin_head() { ?>
# X: o. R& T; B. b<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
W, K+ R, c6 l+ Z/ f<?php }' @/ ]9 H: @ A
|
|