|
|

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