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