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