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