|
|

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