|
|

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