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