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