|
|

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