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