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