|
|

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