|
|

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